]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/minelayer.qc
Merge branch 'bones_was_here/lms_specwarn' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / minelayer.qc
index 7f60c5b571d90c84b9d8ff52717c19462300d89d..f25859e0532983b1b1fbf7c9605f8f902fcde27d 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; // particle fx and decals need .velocity
 
        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);
@@ -254,9 +254,6 @@ void W_MineLayer_Damage(entity this, entity inflictor, entity attacker, float da
 
 void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 {
-       entity mine;
-       entity flash;
-
        // scan how many mines we placed, and return if we reached our limit
        if(WEP_CVAR(minelayer, limit))
        {
@@ -273,9 +270,9 @@ 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);
-       Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
+       W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
-       mine = WarpZone_RefSys_SpawnSameRefSys(actor);
+       entity mine = WarpZone_RefSys_SpawnSameRefSys(actor);
        mine.weaponentity_fld = weaponentity;
        IL_PUSH(g_mines, mine);
        mine.owner = mine.realowner = actor;
@@ -317,13 +314,6 @@ void W_MineLayer_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
        CSQCProjectile(mine, true, PROJECTILE_MINE, true);
 
-       // muzzle flash for 1st person view
-       flash = spawn();
-       setmodel(flash, MDL_MINELAYER_MUZZLEFLASH); // precision set below
-       SUB_SetFade(flash, time, 0.1);
-       flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
-       W_AttachToShotorg(actor, weaponentity, flash, '5 0 0');
-
        // common properties
 
        MUTATOR_CALLHOOK(EditProjectile, actor, mine);
@@ -389,7 +379,7 @@ METHOD(MineLayer, wr_aim, void(entity thiswep, entity actor, .entity weaponentit
 
         float desirabledamage;
         desirabledamage = enemydamage;
-        if(time > actor.invincible_finished && 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;