]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Give electro secondary orbs a size so they sit on floors and walls properly, also...
authorMario <mario@smbclan.net>
Wed, 27 Jul 2016 02:02:08 +0000 (12:02 +1000)
committerMario <mario@smbclan.net>
Wed, 27 Jul 2016 02:02:08 +0000 (12:02 +1000)
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-overkill.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
bal-wep-xpm.cfg
qcsrc/client/weapons/projectile.qc
qcsrc/common/weapons/weapon/electro.qc

index 9bfca55f37ed586b8ee44cc5e1f00fd1baa441e9..ccaa679e06bb3d7713294ccb6ea1e78d934cd0ff 100644 (file)
@@ -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
index 8a47e40d50dc73ebf56bf40bbf450c8f6c2afbe0..d4b47594d7061462769246cb79af1a180c4b84d1 100644 (file)
@@ -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
index d0cfa361d269c1aae66c89cefc2e3e660f65dd24..d7463338aa0f2746550ab2c40468fa8838e89e7a 100644 (file)
@@ -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
index af2234f0d6c898c02d110d98273a46019bdb7c9d..fe3b9ed8711e62bb64ba564310ae573008677f6c 100644 (file)
@@ -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
index 931a63c6a2264d068110f90817f63be68fc5ac64..c9bdb2aa367e5b11629c5778825d3c895e4f0539 100644 (file)
@@ -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
index 779c7129c68009e6493df50b05af29aef33c6581..64d79e150aee00e1e9abfbb90d420edede443993 100644 (file)
@@ -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
index 779c7129c68009e6493df50b05af29aef33c6581..64d79e150aee00e1e9abfbb90d420edede443993 100644 (file)
@@ -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
index 56a172b10b193ae2a326b5c722d5f161091bbb92..e2b37d93ef72ed50270ba3ed265e2f951f40058b 100644 (file)
@@ -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);
index a1d6eb39a7a5af43cea4cc42fbabdfee928e9286..2853625f2c343ef0829ab129ab635eeddd6ad6fe 100644 (file)
@@ -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);