]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_fireball.qc
Merge remote-tracking branch 'origin/master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_fireball.qc
index a45f083321101acb1901c95dcc905466a329007d..ebdfa2bbe734cb9b67916e334ba45e8115f94d63 100644 (file)
@@ -38,14 +38,13 @@ REGISTER_WEAPON(
 
 #ifdef SVQC
 FIREBALL_SETTINGS(fireball)
-void spawnfunc_weapon_fireball() { weapon_defaultspawnfunc(WEP_FIREBALL); }
-
 .float bot_primary_fireballmooth; // whatever a mooth is
 .vector fireball_impactvec;
 .float fireball_primarytime;
 #endif
 #else
 #ifdef SVQC
+void spawnfunc_weapon_fireball() { weapon_defaultspawnfunc(WEP_FIREBALL); }
 
 void W_Fireball_Explode (void)
 {
@@ -69,7 +68,7 @@ void W_Fireball_Explode (void)
                // 2. bfg effect
                // NOTE: this cannot be made warpzone aware by design. So, better intentionally ignore warpzones here.
                for(e = findradius(self.origin, WEP_CVAR_PRI(fireball, bfgradius)); e; e = e.chain)
-               if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || IsDifferentTeam(e, self))
+               if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
                {
                        // can we see fireball?
                        traceline(e.origin + e.view_ofs, self.origin, MOVE_NORMAL, e);
@@ -114,7 +113,7 @@ void W_Fireball_LaserPlay(float dt, float dist, float damage, float edgedamage,
 
        RandomSelection_Init();
        for(e = WarpZone_FindRadius(self.origin, dist, TRUE); e; e = e.chain)
-       if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || IsDifferentTeam(e, self))
+       if(e != self.realowner) if(e.takedamage == DAMAGE_AIM) if(!IS_PLAYER(e) || !self.realowner || DIFF_TEAM(e, self))
        {
                p = e.origin;
                p_x += e.mins_x + random() * (e.maxs_x - e.mins_x);
@@ -156,10 +155,10 @@ void W_Fireball_Damage (entity inflictor, entity attacker, float damage, float d
 {
        if(self.health <= 0)
                return;
-               
+
        if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
                return; // g_projectiles_damage says to halt
-               
+
        self.health = self.health - damage;
        if (self.health <= 0)
        {
@@ -201,7 +200,7 @@ void W_Fireball_Attack1()
        setsize(proj, '-16 -16 -16', '16 16 16');
        proj.flags = FL_PROJECTILE;
     proj.missile_flags = MIF_SPLASH | MIF_PROXY;
-    
+
        CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE);
 
        other = proj; MUTATOR_CALLHOOK(EditProjectile);
@@ -241,7 +240,7 @@ void W_Fireball_Attack1_Frame1()
 void W_Fireball_Attack1_Frame0()
 {
        W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
-       sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTN_NORM);
+       sound (self, CH_WEAPON_SINGLE, "weapons/fireball_prefire2.wav", VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame1);
 }
 
@@ -332,7 +331,7 @@ void W_Fireball_Attack2()
        proj.angles = vectoangles(proj.velocity);
        proj.flags = FL_PROJECTILE;
     proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
-    
+
        CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE);
 
        other = proj; MUTATOR_CALLHOOK(EditProjectile);
@@ -401,7 +400,6 @@ float w_fireball(float req)
                }
                case WR_SETUP:
                {
-                       weapon_setup(WEP_FIREBALL);
                        self.current_ammo = ammo_none;
                        return TRUE;
                }
@@ -455,7 +453,7 @@ float w_fireball(float req)
                                org2 = w_org + w_backoff * 16;
                                pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1);
                                if(!w_issilent)
-                                       sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom
+                                       sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTEN_NORM * 0.25); // long range boom
                        }
                        
                        return TRUE;