]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_seeker.qc
Merge remote-tracking branch 'origin/master' into samual/spawn_weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_seeker.qc
index 72cd9085a0c39c3edb7f95b2f0237a09f539656b..a6a683389eaf30e85f0afdc878fb86d9bad7b957 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", _("T.A.G. Seeker"))
+REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", _("T.A.G. Seeker"))
 #else
 #ifdef SVQC
 //.float proxytime; = autoswitch
@@ -13,7 +13,7 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_RELOADABLE | WEP_TYPE_
 void Seeker_Missile_Explode ()
 {
        self.event_damage = SUB_Null;
-       RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
+       RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -78,6 +78,8 @@ void Seeker_Missile_Think()
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
                self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
        }
+       else
+               dist = 0;
 
        // Proxy
        if (autocvar_g_balance_seeker_missile_proxy)
@@ -125,7 +127,7 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo
        if (self.health <= 0)
                return;
                
-       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, 0)) // no exceptions
+       if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
                return; // g_projectiles_damage says to halt
 
        if (self.realowner == attacker)
@@ -133,8 +135,6 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo
        else
                self.health = self.health - damage;
                
-       print(strcat("seeker missile health ", ftos(self.health), " after ", ftos(damage), " damage... (at time: ", ftos(time), ")\n"));
-               
        if (self.health <= 0)
                W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode);
 }
@@ -166,7 +166,7 @@ void Seeker_Missile_Animate()
 
 void Seeker_Fire_Missile(vector f_diff, entity m_target)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_reload_ammo);
 
@@ -207,6 +207,8 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
        setsize (missile, '-4 -4 -4', '4 4 4');
        missile.movetype    = MOVETYPE_FLYMISSILE;
        missile.flags       = FL_PROJECTILE;
+       missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
+       
        W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
 
        missile.angles = vectoangles (missile.velocity);
@@ -223,7 +225,7 @@ void Seeker_Flac_Explode ()
 {
        self.event_damage = SUB_Null;
 
-       RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
+       RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -237,7 +239,7 @@ void Seeker_Flac_Touch()
 
 void Seeker_Fire_Flac()
 {
-       local entity missile;
+       entity missile;
        vector f_diff;
        float c;
 
@@ -279,6 +281,7 @@ void Seeker_Fire_Flac()
        missile.projectiledeathtype = WEP_SEEKER;
        missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
        missile.flags                           = FL_PROJECTILE;
+       missile.missile_flags       = MIF_SPLASH; 
        
        // csqc projectiles
        //missile.angles                                = vectoangles (missile.velocity);       
@@ -310,6 +313,7 @@ void Seeker_Attack()
 {
        entity tracker, closest_target;
        
+       closest_target = world;
        for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
        {
                if (closest_target)
@@ -395,7 +399,7 @@ void Seeker_Tag_Explode ()
 {
        //if(other==self.realowner)
        //    return;
-       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, self);
+       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, other.species, self);
 
        remove (self);
 }
@@ -423,7 +427,7 @@ void Seeker_Tag_Touch()
        te_knightspike(org2);
 
        self.event_damage = SUB_Null;
-       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, self);
+       Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, other.species, self);
 
        if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
        {
@@ -474,7 +478,7 @@ void Seeker_Tag_Touch()
 
 void Seeker_Fire_Tag()
 {
-       local entity missile;
+       entity missile;
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_tag_ammo, autocvar_g_balance_seeker_reload_ammo);
 
        W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_missile_damage * autocvar_g_balance_seeker_missile_count);
@@ -499,6 +503,7 @@ void Seeker_Fire_Tag()
        setsize (missile, '-2 -2 -2', '2 2 2');
 
        missile.flags       = FL_PROJECTILE;
+       //missile.missile_flags = MIF_..?; 
 
        missile.movetype    = MOVETYPE_FLY;
        W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag);
@@ -594,13 +599,13 @@ float w_seeker(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_missile_ammo;
+               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_missile_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_tag_ammo;
+               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
@@ -608,7 +613,7 @@ float w_seeker(float req)
                W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_seeker(float req)
@@ -660,13 +665,13 @@ float w_seeker(float req)
                precache_sound("weapons/tag_impact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny rockets");
+               w_deathtypestring = _("%s played with tiny seeker rockets");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was tagged by %s");
+                       w_deathtypestring = _("%s was tagged with a seeker by %s");
                else
-                       w_deathtypestring = _("%s was pummeled by %s");
+                       w_deathtypestring = _("%s was pummeled with seeker rockets by %s");
        }
        return TRUE;
 }