From: Mario Date: Wed, 27 Jul 2016 02:02:08 +0000 (+1000) Subject: Give electro secondary orbs a size so they sit on floors and walls properly, also... X-Git-Tag: xonotic-v0.8.2~700^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2ddc3cc76f3da544e15e06ae862602987affd00c;p=xonotic%2Fxonotic-data.pk3dir.git Give electro secondary orbs a size so they sit on floors and walls properly, also add a secondary 'sticking' mode to electro orbs (disabled by default) --- diff --git a/bal-wep-mario.cfg b/bal-wep-mario.cfg index 9bfca55f3..ccaa679e0 100644 --- a/bal-wep-mario.cfg +++ b/bal-wep-mario.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 1000 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg index 8a47e40d5..d4b47594d 100644 --- a/bal-wep-nexuiz25.cfg +++ b/bal-wep-nexuiz25.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 900 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.15 set g_balance_electro_switchdelay_raise 0.15 diff --git a/bal-wep-overkill.cfg b/bal-wep-overkill.cfg index d0cfa361d..d7463338a 100644 --- a/bal-wep-overkill.cfg +++ b/bal-wep-overkill.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 1000 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg index af2234f0d..fe3b9ed87 100644 --- a/bal-wep-samual.cfg +++ b/bal-wep-samual.cfg @@ -234,6 +234,7 @@ set g_balance_electro_secondary_speed 1000 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg index 931a63c6a..c9bdb2aa3 100644 --- a/bal-wep-xdf.cfg +++ b/bal-wep-xdf.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 900 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.05 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 0 set g_balance_electro_switchdelay_drop 0 set g_balance_electro_switchdelay_raise 0 diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 779c7129c..64d79e150 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 1000 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 1 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg index 779c7129c..64d79e150 100644 --- a/bal-wep-xpm.cfg +++ b/bal-wep-xpm.cfg @@ -219,6 +219,7 @@ set g_balance_electro_secondary_speed 1000 set g_balance_electro_secondary_speed_up 200 set g_balance_electro_secondary_speed_z 0 set g_balance_electro_secondary_spread 0.04 +set g_balance_electro_secondary_stick 0 set g_balance_electro_secondary_touchexplode 1 set g_balance_electro_switchdelay_drop 0.2 set g_balance_electro_switchdelay_raise 0.2 diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 56a172b10..e2b37d93e 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -338,8 +338,8 @@ NET_HANDLE(ENT_CLIENT_PROJECTILE, bool isnew) case PROJECTILE_ELECTRO: // only new engines support sound moving with object loopsound(this, CH_SHOTS_SINGLE, SND(ELECTRO_FLY), VOL_BASE, ATTEN_NORM); - this.mins = '0 0 -4'; - this.maxs = '0 0 -4'; + this.mins = '-4 -4 -4'; + this.maxs = '4 4 4'; this.move_movetype = MOVETYPE_BOUNCE; settouch(this, func_null); this.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor); diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index a1d6eb39a..2853625f2 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -50,6 +50,7 @@ CLASS(Electro, Weapon) P(class, prefix, speed_up, float, SEC) \ P(class, prefix, speed_z, float, SEC) \ P(class, prefix, spread, float, BOTH) \ + P(class, prefix, stick, float, SEC) \ P(class, prefix, switchdelay_drop, float, NONE) \ P(class, prefix, switchdelay_raise, float, NONE) \ P(class, prefix, touchexplode, float, SEC) \ @@ -156,7 +157,7 @@ void W_Electro_Explode(entity this, entity directhitentity) this.event_damage = func_null; this.takedamage = DAMAGE_NO; - if(this.move_movetype == MOVETYPE_BOUNCE) + if(this.move_movetype == MOVETYPE_BOUNCE || this.classname == "electro_orb") // TODO: classname is more reliable anyway? { RadiusDamage( this, @@ -298,6 +299,43 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor) MUTATOR_CALLHOOK(EditProjectile, actor, proj); } +void W_Electro_Orb_Stick(entity this, entity to) +{ + entity newproj = spawn(); + newproj.classname = this.classname; + + newproj.bot_dodge = this.bot_dodge; + newproj.bot_dodgerating = this.bot_dodgerating; + + newproj.owner = this.owner; + newproj.realowner = this.realowner; + setsize(newproj, this.mins, this.maxs); + setorigin(newproj, this.origin); + setmodel(newproj, MDL_PROJECTILE_ELECTRO); + newproj.angles = vectoangles(-trace_plane_normal); // face against the surface + + newproj.takedamage = this.takedamage; + newproj.damageforcescale = this.damageforcescale; + newproj.health = this.health; + newproj.event_damage = this.event_damage; + newproj.spawnshieldtime = this.spawnshieldtime; + newproj.damagedbycontents = true; + + set_movetype(newproj, MOVETYPE_NONE); // lock the orb in place + newproj.projectiledeathtype = this.projectiledeathtype; + + settouch(newproj, func_null); + setthink(newproj, getthink(this)); + newproj.nextthink = this.nextthink; + newproj.use = this.use; + newproj.flags = this.flags; + + remove(this); + + if(to) + SetMovetypeFollow(this, to); +} + void W_Electro_Orb_Touch(entity this, entity toucher) { PROJECTILE_TOUCH(this, toucher); @@ -308,6 +346,9 @@ void W_Electro_Orb_Touch(entity this, entity toucher) //UpdateCSQCProjectile(this); spamsound(this, CH_SHOTS, SND(ELECTRO_BOUNCE), VOL_BASE, ATTEN_NORM); this.projectiledeathtype |= HITTYPE_BOUNCE; + + if(WEP_CVAR_SEC(electro, stick)) + W_Electro_Orb_Stick(this, toucher); } } @@ -359,8 +400,8 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor) W_SetupShot_ProjectileSize( actor, - '0 0 -4', - '0 0 -4', + '-4 -4 -4', + '4 4 4', false, 2, SND_ELECTRO_FIRE2, @@ -388,7 +429,7 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor) set_movetype(proj, MOVETYPE_BOUNCE); W_SetupProjVelocity_UP_SEC(proj, electro); settouch(proj, W_Electro_Orb_Touch); - setsize(proj, '0 0 -4', '0 0 -4'); + setsize(proj, '-4 -4 -4', '4 4 4'); proj.takedamage = DAMAGE_YES; proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale); proj.health = WEP_CVAR_SEC(electro, health);