]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/minelayer.qc
Use gender-neutral pronouns when referring to the player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / minelayer.qc
index ee512cf32635c570c474744f9bd3d71910261da4..9026521d62dfe40347290ee67318b1ed47f968f7 100644 (file)
@@ -18,12 +18,12 @@ void W_MineLayer_Stick(entity this, entity to)
 
        newmine.owner = this.owner;
        newmine.realowner = this.realowner;
-       setsize(newmine, '-4 -4 -4', '4 4 4');
        setorigin(newmine, this.origin);
        setmodel(newmine, MDL_MINELAYER_MINE);
+       setsize(newmine, '-4 -4 -4', '4 4 4');
        newmine.angles = vectoangles(-trace_plane_normal); // face against the surface
 
-       newmine.mine_orientation = -trace_plane_normal;
+       newmine.movedir = -trace_plane_normal;
 
        newmine.takedamage = this.takedamage;
        newmine.damageforcescale = this.damageforcescale;
@@ -92,7 +92,7 @@ void W_MineLayer_DoRemoteExplode(entity this)
        this.takedamage = DAMAGE_NO;
 
        if(this.move_movetype == MOVETYPE_NONE || this.move_movetype == MOVETYPE_FOLLOW)
-               this.velocity = this.mine_orientation; // particle fx and decals need .velocity
+               this.velocity = this.movedir; // .velocity must be != '0 0 0' for particle fx and decal to work
 
        RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius),
                                                NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, this.weaponentity_fld, NULL);
@@ -126,7 +126,7 @@ void W_MineLayer_RemoteExplode(entity this)
 
 void W_MineLayer_ProximityExplode(entity this)
 {
-       // make sure no friend is in the mine's radius. If there is any, explosion is delayed until he's at a safe distance
+       // make sure no friend is in the mine's radius. If there is any, explosion is delayed until they're at a safe distance
        if(WEP_CVAR(minelayer, protection) && this.mine_explodeanyway == 0)
        {
                entity head;
@@ -179,7 +179,7 @@ void W_MineLayer_Think(entity this)
                this.mine_explodeanyway = 1; // make the mine super aggressive -- Samual: Rather, make it not care if a team mate is near.
        }
 
-       // a player's mines shall explode if he disconnects or dies
+       // a player's mines shall explode if they disconnect or die
        // TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
        if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
        {
@@ -192,7 +192,7 @@ void W_MineLayer_Think(entity this)
        head = findradius(this.origin, WEP_CVAR(minelayer, proximityradius));
        while(head)
        {
-               if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head))
+               if(IS_PLAYER(head) && !IS_DEAD(head) && !STAT(FROZEN, head) && !IS_INDEPENDENT_PLAYER(head))
                if(head != this.realowner && DIFF_TEAM(head, this.realowner)) // don't trigger for team mates
                if(!this.mine_time)
                {
@@ -270,7 +270,7 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(minelayer, ammo), weaponentity);
 
        W_SetupShot_ProjectileSize(actor, weaponentity, '-4 -4 -4', '4 4 4', false, 5, SND_MINE_FIRE, CH_WEAPON_A, WEP_CVAR(minelayer, damage), thiswep.m_id);
-       W_MuzzleFlash(actor, weaponentity, EFFECT_ROCKET_MUZZLEFLASH, MDL_MINELAYER_MUZZLEFLASH, w_shotorg, w_shotdir);
+       W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
        entity mine = WarpZone_RefSys_SpawnSameRefSys(actor);
        mine.weaponentity_fld = weaponentity;
@@ -346,7 +346,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor, .entity weaponentit
     if(minecount >= WEP_CVAR(minelayer, limit))
         PHYS_INPUT_BUTTON_ATCK(actor) = false;
     else
-        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false, false);
     if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
     {
         // decide whether to detonate mines
@@ -379,7 +379,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor, .entity weaponentit
 
         float desirabledamage;
         desirabledamage = enemydamage;
-        if(time > STAT(INVINCIBLE_FINISHED, actor) && time > actor.spawnshieldtime)
+        if(StatusEffects_active(STATUSEFFECT_Shield, actor) && !StatusEffects_active(STATUSEFFECT_SpawnShield, actor))
             desirabledamage = desirabledamage - selfdamage * autocvar_g_balance_selfdamagepercent;
         if(teamplay && actor.team)
             desirabledamage = desirabledamage - teamdamage;