]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/seeker.qc
Remove legacy Quake bbox expansion: projectiles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / seeker.qc
index d7ba289f5ca7ee9f1e92669a9fd5098b93791771..be6d6e13c81dbde5248df327799fb242593d9399 100644 (file)
@@ -86,23 +86,23 @@ void W_Seeker_Missile_Think(entity this)
        {
                if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
                {
-                       if(this.autoswitch == 0)
+                       if(this.cvar_cl_autoswitch == 0)
                        {
-                               this.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
+                               this.cvar_cl_autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
                        }
                        else
                        {
-                               if(this.autoswitch <= time)
+                               if(this.cvar_cl_autoswitch <= time)
                                {
                                        W_Seeker_Missile_Explode(this, NULL);
-                                       this.autoswitch = 0;
+                                       this.cvar_cl_autoswitch = 0;
                                }
                        }
                }
                else
                {
-                       if(this.autoswitch != 0)
-                               this.autoswitch = 0;
+                       if(this.cvar_cl_autoswitch != 0)
+                               this.cvar_cl_autoswitch = 0;
                }
        }
        ///////////////
@@ -169,9 +169,9 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, missile_ammo), weaponentity);
 
        makevectors(actor.v_angle);
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? thiswep.m_id | HITTYPE_SECONDARY : thiswep.m_id));
+       W_SetupShot_ProjectileSize(actor, weaponentity, MISSILE_MINS, MISSILE_MAXS, false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0, ((m_target != NULL) ? thiswep.m_id | HITTYPE_SECONDARY : thiswep.m_id));
        w_shotorg += f_diff;
-       Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
+       W_MuzzleFlash(thiswep, actor, weaponentity, w_shotorg, w_shotdir);
 
        //actor.detornator         = false;
 
@@ -203,7 +203,7 @@ void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, .entity weaponentity, v
 
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-4 -4 -4', '4 4 4');
+       setsize(missile, MISSILE_MINS, MISSILE_MAXS);
        set_movetype(missile, MOVETYPE_FLYMISSILE);
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
@@ -266,10 +266,11 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity)
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY);
+       W_SetupShot_ProjectileSize(actor, weaponentity, FLAC_MINS, FLAC_MAXS, false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage), thiswep.m_id | HITTYPE_SECONDARY);
        w_shotorg += f_diff;
 
-       Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
+       // uses hagar effects!
+       W_MuzzleFlash(WEP_HAGAR, actor, weaponentity, w_shotorg, w_shotdir);
 
        missile                                 = new(missile);
        missile.owner                   = missile.realowner = actor;
@@ -293,7 +294,7 @@ void W_Seeker_Fire_Flac(Weapon thiswep, entity actor, .entity weaponentity)
        //missile.scale = 0.4; // BUG: the model is too big
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-2 -2 -2', '2 2 2');
+       setsize(missile, FLAC_MINS, FLAC_MAXS);
 
        W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
@@ -488,7 +489,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
 {
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, tag_ammo), weaponentity);
 
-       W_SetupShot_ProjectileSize(actor, weaponentity, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count), thiswep.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY);
+       W_SetupShot_ProjectileSize(actor, weaponentity, TAG_MINS, TAG_MAXS, false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count), thiswep.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY);
 
        entity missile          = new(seeker_tag);
        missile.weaponentity_fld = weaponentity;
@@ -507,7 +508,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep, entity actor, .entity weaponentity)
        missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
 
        setorigin(missile, w_shotorg);
-       setsize(missile, '-2 -2 -2', '2 2 2');
+       setsize(missile, TAG_MINS, TAG_MAXS);
 
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
@@ -532,12 +533,12 @@ METHOD(Seeker, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))
     if(WEP_CVAR(seeker, type) == 1)
     {
         if(W_Seeker_Tagged_Info(actor, weaponentity, actor.enemy) != NULL)
-            PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
+            PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false, false);
         else
-            PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+            PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false, false);
     }
     else
-        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+        PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false, true);
 }
 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
@@ -634,8 +635,7 @@ METHOD(Seeker, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_BOUNCE)
     {
         if(w_deathtype & HITTYPE_SECONDARY)