]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Lots and lots of updates for the seeker >;D
authorSamual <samual@xonotic.org>
Fri, 18 Mar 2011 21:40:45 +0000 (17:40 -0400)
committerSamual <samual@xonotic.org>
Fri, 18 Mar 2011 21:40:45 +0000 (17:40 -0400)
balanceXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/w_seeker.qc

index a782c6387927577d9e0b0d92a39d7d61c1deb534..0165788372a4710efce6612d825b0ec8ec4eb961 100644 (file)
@@ -726,54 +726,42 @@ set g_balance_fireball_reload_ammo 0 //default: 60
 set g_balance_fireball_reload_time 2
 // }}}
 // {{{ seeker
-set g_balance_seeker_flac_ammo 0.5
-set g_balance_seeker_flac_animtime 0.1
-set g_balance_seeker_flac_damage 15
-set g_balance_seeker_flac_edgedamage 10
-set g_balance_seeker_flac_force 50
-set g_balance_seeker_flac_lifetime 0.1
-set g_balance_seeker_flac_lifetime_rand 0.05
-set g_balance_seeker_flac_radius 100
-set g_balance_seeker_flac_refire 0.1
-set g_balance_seeker_flac_speed 3000
-set g_balance_seeker_flac_speed_up 1000
-set g_balance_seeker_flac_speed_z 0
-set g_balance_seeker_flac_spread 0.4
-set g_balance_seeker_missile_accel 1400
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.2
+set g_balance_seeker_tag_damageforcescale 4
+set g_balance_seeker_tag_health 5
+set g_balance_seeker_tag_lifetime 15
+set g_balance_seeker_tag_refire 0.75 // LOG: 0.7 -> 0.75
+set g_balance_seeker_tag_speed 5000
+set g_balance_seeker_tag_spread 0
+set g_balance_seeker_tag_tracker_lifetime 10 
+set g_balance_seeker_missile_accel 1500
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.2
 set g_balance_seeker_missile_count 3 // LOG: 8 -> 3
-set g_balance_seeker_missile_damage 30 // LOG: 15 -> 30
+set g_balance_seeker_missile_damage 16 // LOG: 15 -> 30
 set g_balance_seeker_missile_damageforcescale 4
 set g_balance_seeker_missile_decel 1400
 set g_balance_seeker_missile_delay 0.25
-set g_balance_seeker_missile_edgedamage 10
-set g_balance_seeker_missile_force 150 // LOG: 100 -> 150
+set g_balance_seeker_missile_edgedamage 8
+set g_balance_seeker_missile_force 50 // LOG: 100 -> 150
 set g_balance_seeker_missile_health 5
 set g_balance_seeker_missile_lifetime 15
 set g_balance_seeker_missile_proxy 0
 set g_balance_seeker_missile_proxy_delay 0.2
 set g_balance_seeker_missile_proxy_maxrange 45
-set g_balance_seeker_missile_radius 80
-set g_balance_seeker_missile_refire 0.5
-set g_balance_seeker_missile_smart 1
+set g_balance_seeker_missile_radius 70
+set g_balance_seeker_missile_refire 0.2
+set g_balance_seeker_missile_smart 0
 set g_balance_seeker_missile_smart_mindist 800
 set g_balance_seeker_missile_smart_trace_max 2500
 set g_balance_seeker_missile_smart_trace_min 1000
-set g_balance_seeker_missile_speed 700
-set g_balance_seeker_missile_speed_up 300
+set g_balance_seeker_missile_speed 1500
+set g_balance_seeker_missile_speed_up 0
 set g_balance_seeker_missile_speed_z 0
-set g_balance_seeker_missile_speed_max 1300 // LOG: 1400 -> 1300
+set g_balance_seeker_missile_speed_max 2000 // LOG: 1400 -> 1300
 set g_balance_seeker_missile_spread 0
-set g_balance_seeker_missile_turnrate 0.65
-set g_balance_seeker_tag_ammo 1
-set g_balance_seeker_tag_animtime 0.2
-set g_balance_seeker_tag_damageforcescale 4
-set g_balance_seeker_tag_health 5
-set g_balance_seeker_tag_lifetime 15
-set g_balance_seeker_tag_refire 0.75 // LOG: 0.7 -> 0.75
-set g_balance_seeker_tag_speed 5000
-set g_balance_seeker_tag_spread 0
+set g_balance_seeker_missile_turnrate 0.25
 set g_balance_seeker_reload_ammo 0 //default: 15
 set g_balance_seeker_reload_time 2
 // End new seeker
index c78460c17391b4cebfdd0cce5f6b8e55a57d5db3..0772e3aaa1efe2cff60c563f008502a84cbb86d2 100644 (file)
@@ -579,17 +579,9 @@ float autocvar_g_balance_rune_strength_force;
 float autocvar_g_balance_rune_vampire_absorb;
 float autocvar_g_balance_rune_vampire_combo_absorb;
 float autocvar_g_balance_rune_vampire_maxhealth;
-float autocvar_g_balance_seeker_flac_ammo;
-float autocvar_g_balance_seeker_flac_animtime;
-float autocvar_g_balance_seeker_flac_damage;
-float autocvar_g_balance_seeker_flac_edgedamage;
-float autocvar_g_balance_seeker_flac_force;
-float autocvar_g_balance_seeker_flac_lifetime;
-float autocvar_g_balance_seeker_flac_lifetime_rand;
-float autocvar_g_balance_seeker_flac_radius;
-float autocvar_g_balance_seeker_flac_refire;
 float autocvar_g_balance_seeker_missile_accel;
 float autocvar_g_balance_seeker_missile_ammo;
+float autocvar_g_balance_seeker_missile_animtime;
 float autocvar_g_balance_seeker_missile_count;
 float autocvar_g_balance_seeker_missile_damage;
 float autocvar_g_balance_seeker_missile_damageforcescale;
@@ -603,6 +595,7 @@ float autocvar_g_balance_seeker_missile_proxy;
 float autocvar_g_balance_seeker_missile_proxy_delay;
 float autocvar_g_balance_seeker_missile_proxy_maxrange;
 float autocvar_g_balance_seeker_missile_radius;
+float autocvar_g_balance_seeker_missile_refire;
 float autocvar_g_balance_seeker_missile_smart;
 float autocvar_g_balance_seeker_missile_smart_mindist;
 float autocvar_g_balance_seeker_missile_smart_trace_max;
@@ -616,6 +609,7 @@ float autocvar_g_balance_seeker_tag_health;
 float autocvar_g_balance_seeker_tag_lifetime;
 float autocvar_g_balance_seeker_tag_refire;
 float autocvar_g_balance_seeker_tag_speed;
+float autocvar_g_balance_seeker_tag_tracker_lifetime;
 float autocvar_g_balance_seeker_reload_ammo;
 float autocvar_g_balance_seeker_reload_time;
 float autocvar_g_balance_selfdamagepercent;
index 9084cc04da2027affd8b8af43cac58de6d4b984d..8fdc57d2b6d49cc367be7f2257a1d53b96ea10de 100644 (file)
@@ -4,6 +4,8 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_RELO
 #ifdef SVQC
 //.float proxytime; = autoswitch
 //.float tl; = wait
+.entity tag_target;
+.float tag_time;
 
 void Seeker_Missile_Explode ()
 {
@@ -154,7 +156,7 @@ void Seeker_Missile_Animate()
 }
 */
 
-void Seeker_Fire_Missile(vector f_diff)
+void Seeker_Fire_Missile(vector f_diff, entity m_target)
 {
        local entity missile;
 
@@ -178,7 +180,7 @@ void Seeker_Fire_Missile(vector f_diff)
        missile.event_damage    = Seeker_Missile_Damage;
        missile.nextthink       = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
        missile.cnt             = time + autocvar_g_balance_seeker_missile_lifetime;
-       missile.enemy           = self.enemy;
+       missile.enemy           = m_target;
        missile.solid           = SOLID_BBOX;
        missile.scale           = 2;
        missile.takedamage      = DAMAGE_YES;
@@ -201,46 +203,53 @@ void Seeker_Fire_Missile(vector f_diff)
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
-void Seeker_Vollycontroler_Think()
+entity Seeker_Tagged_Info(entity isowner, entity istarget)
 {
-       float c;
-       entity oldself,oldenemy;
-       self.cnt = self.cnt - 1;
-
-       if((!(self.owner.items & IT_UNLIMITED_AMMO) && self.owner.ammo_rockets < autocvar_g_balance_seeker_missile_ammo) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO) || (self.owner.switchweapon != WEP_SEEKER))
-       {
-               remove(self);
-               return;
-       }
-
-       self.nextthink = time + autocvar_g_balance_seeker_missile_delay;
+       entity tag;
+       for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) 
+               if ((tag.owner == isowner) && (tag.tag_target == istarget))
+                       return tag;
+               
+       return world;
+}
 
-       oldself = self;
-       self = self.owner;
+void Seeker_Attack()
+{
+       entity tracker, closest_target;
+       for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) 
+               if (tracker.owner == self)
+                       if (closest_target)
+                       {
+                               if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
+                                       closest_target = tracker.tag_target;
+                       }
+                       else 
+                               closest_target = tracker.tag_target;
+               
+       traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
+       if ((!closest_target) || (trace_fraction < 1 && trace_ent != closest_target))
+               closest_target = world;
+       
+       Seeker_Fire_Missile('0 0 0', closest_target);
 
-       oldenemy = self.enemy;
-       self.enemy = oldself.enemy;
+}
 
-       c = mod(oldself.cnt, 4);
-       switch(c)
+void Seeker_Tracker_Think() // this think method keeps track of the tag entity created to follow/tag down a player. 
+{
+       // Update the think method information
+       self.nextthink = time;
+       
+       // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
+       if ((self.owner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.owner.switchweapon != WEP_SEEKER)
+       || (time > self.tag_time + autocvar_g_balance_seeker_tag_lifetime))
        {
-               case 0:
-                       Seeker_Fire_Missile('-1.25 -3.75 0');
-                       break;
-               case 1:
-                       Seeker_Fire_Missile('+1.25 -3.75 0');
-                       break;
-               case 2:
-                       Seeker_Fire_Missile('-1.25 +3.75 0');
-                       break;
-               case 3:
-               default:
-                       Seeker_Fire_Missile('+1.25 +3.75 0');
-                       break;
+               if (self)
+               {
+                       WaypointSprite_Kill(self.tag_target.waypointsprite_attachedforcarrier);
+                       remove(self);
+               }
+               return;
        }
-
-       self.enemy = oldenemy;
-       self = oldself;
 }
 
 void Seeker_Tag_Explode ()
@@ -261,7 +270,6 @@ void Seeker_Tag_Damage (entity inflictor, entity attacker, float damage, float d
                Seeker_Tag_Explode();
 }
 
-
 void Seeker_Tag_Touch()
 {
        vector dir;
@@ -277,13 +285,27 @@ void Seeker_Tag_Touch()
        Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, self);
 
        if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
-       {               
-               e           = spawn();
-               e.cnt       = autocvar_g_balance_seeker_missile_count;
-               e.owner     = self.owner;
-               e.enemy     = other;
-               e.think     = Seeker_Vollycontroler_Think;
-               e.nextthink = time;
+       {
+               // check to see if this person is already tagged by me
+               entity tag = Seeker_Tagged_Info(self.owner, other);
+               
+               if (tag != world) // if so, just update the time at which the player was last tagged.
+                       tag.tag_time = time;
+               else // if not, create a new tracker just for this person. 
+               {               
+                       e             = spawn();
+                       e.classname   = "tag_tracker";
+                       e.owner       = self.owner;
+                       e.think       = Seeker_Tracker_Think;
+                       e.nextthink   = time;
+                       e.tag_target  = other;
+                       e.tag_time    = time;
+                       
+                       WaypointSprite_Spawn("ka-ball", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.owner, 0, other, waypointsprite_attachedforcarrier, TRUE);
+                       WaypointSprite_UpdateRule(other.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
+               
+                       print("hit: ", self.owner.netname, " -> ", other.netname, ". \n");
+               }
        }
 
        remove(self);
@@ -328,81 +350,6 @@ void Seeker_Fire_Tag()
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
-
-void Seeker_Flac_Explode ()
-{
-       self.event_damage = SUB_Null;
-
-       RadiusDamage (self, self.owner, 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);
-
-       remove (self);
-}
-
-void Seeker_Flac_Touch()
-{
-       PROJECTILE_TOUCH;
-
-       Seeker_Flac_Explode();
-}
-
-void Seeker_Fire_Flac()
-{
-       local entity missile;
-       vector f_diff;
-       float c;
-
-       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_flac_ammo, autocvar_g_balance_seeker_reload_ammo);
-
-       c = mod(self.bulletcounter, 4);
-       switch(c)
-       {
-               case 0:
-                       f_diff = '-1.25 -3.75 0';
-                       break;
-               case 1:
-                       f_diff = '+1.25 -3.75 0';
-                       break;
-               case 2:
-                       f_diff = '-1.25 +3.75 0';
-                       break;
-               case 3:
-               default:
-                       f_diff = '+1.25 +3.75 0';
-                       break;
-       }
-       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CHAN_WEAPON, autocvar_g_balance_seeker_flac_damage);
-       w_shotorg += f_diff;
-
-       pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
-
-       missile                                 = spawn ();
-       missile.owner                   = missile.realowner = self;
-       missile.classname               = "missile";
-       missile.bot_dodge               = TRUE;
-       missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
-       missile.touch                   = Seeker_Flac_Explode;
-       missile.use                     = Seeker_Flac_Explode; 
-       missile.think                   = adaptor_think2use_hittype_splash;
-       missile.nextthink               = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
-       missile.solid                   = SOLID_BBOX;
-       missile.movetype                = MOVETYPE_FLY; 
-       missile.projectiledeathtype = WEP_SEEKER;
-       missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
-       missile.flags                           = FL_PROJECTILE;
-       
-       // csqc projectiles
-       //missile.angles                                = vectoangles (missile.velocity);       
-       //missile.scale = 0.4; // BUG: the model is too big 
-       
-       setorigin (missile, w_shotorg);
-       setsize (missile, '-2 -2 -2', '2 2 2');
-               
-       W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_flac);
-       CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
-
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
-}
-
 void spawnfunc_weapon_seeker (void)
 {
        weapon_defaultspawnfunc(WEP_SEEKER);
@@ -413,13 +360,17 @@ float w_seeker(float req)
        float ammo_amount;
 
        if (req == WR_AIM)
-               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, 20, FALSE);
-
+       {
+               if (Seeker_Tagged_Info(self, self.enemy) != world)
+                       self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_seeker_missile_speed_max, 0, autocvar_g_balance_seeker_missile_lifetime, FALSE);
+               else
+                       self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, autocvar_g_balance_seeker_tag_lifetime, FALSE);
+       }
        else if (req == WR_THINK)
        {
                if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload
                        weapon_action(self.weapon, WR_RELOAD);
-
+                       
                else if (self.BUTTON_ATCK)
                {
                        if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
@@ -431,10 +382,10 @@ float w_seeker(float req)
 
                else if (self.BUTTON_ATCK2)
                {
-                       if (weapon_prepareattack(1, autocvar_g_balance_seeker_flac_refire))
+                       if (weapon_prepareattack(1, autocvar_g_balance_seeker_missile_refire))
                        {
-                               Seeker_Fire_Flac();
-                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
+                               Seeker_Attack();
+                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_missile_animtime, w_ready);
                        }
                }
        }
@@ -455,14 +406,14 @@ float w_seeker(float req)
        }
        else if (req == WR_CHECKAMMO1)
        {
-               ammo_amount = self.ammo_cells >= autocvar_g_balance_seeker_missile_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_missile_ammo;
+               ammo_amount = self.ammo_rockets >= 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_CHECKAMMO2)
        {
-               ammo_amount = self.ammo_cells >= autocvar_g_balance_seeker_flac_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_flac_ammo;
+               ammo_amount = self.ammo_rockets >= 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_RELOAD)