]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_seeker.qc
commit message goes here
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_seeker.qc
index 95a6d608569f2f981ddd7e76e42dc6109195c793..b7a57e86924db94e12f24a45d045214538365f86 100644 (file)
 #ifdef REGISTER_WEAPON
 REGISTER_WEAPON(
 /* WEP_##id  */ SEEKER,
-/* function  */ w_seeker,
-/* ammotype  */ IT_ROCKETS,
+/* function  */ W_Seeker,
+/* ammotype  */ ammo_rockets,
 /* impulse   */ 8,
 /* flags     */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating    */ BOT_PICKUP_RATING_MID,
+/* color     */ '0.5 1 0',
 /* model     */ "seeker",
-/* shortname */ "seeker",
-/* fullname  */ _("T.A.G. Seeker")
+/* crosshair */ "gfx/crosshairseeker 0.8",
+/* refname   */ "seeker",
+/* wepname   */ _("T.A.G. Seeker")
 );
-#else
+
+#define SEEKER_SETTINGS(w_cvar,w_prop) SEEKER_SETTINGS_LIST(w_cvar, w_prop, SEEKER, seeker)
+#define SEEKER_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
+       w_cvar(id, sn, NONE, type) \
+       w_cvar(id, sn, NONE, flac_ammo) \
+       w_cvar(id, sn, NONE, flac_animtime) \
+       w_cvar(id, sn, NONE, flac_damage) \
+       w_cvar(id, sn, NONE, flac_edgedamage) \
+       w_cvar(id, sn, NONE, flac_force) \
+       w_cvar(id, sn, NONE, flac_lifetime) \
+       w_cvar(id, sn, NONE, flac_lifetime_rand) \
+       w_cvar(id, sn, NONE, flac_radius) \
+       w_cvar(id, sn, NONE, flac_refire) \
+       w_cvar(id, sn, NONE, flac_speed) \
+       w_cvar(id, sn, NONE, flac_speed_up) \
+       w_cvar(id, sn, NONE, flac_speed_z) \
+       w_cvar(id, sn, NONE, flac_spread) \
+       w_cvar(id, sn, NONE, missile_accel) \
+       w_cvar(id, sn, NONE, missile_ammo) \
+       w_cvar(id, sn, NONE, missile_animtime) \
+       w_cvar(id, sn, NONE, missile_count) \
+       w_cvar(id, sn, NONE, missile_damage) \
+       w_cvar(id, sn, NONE, missile_damageforcescale) \
+       w_cvar(id, sn, NONE, missile_decel) \
+       w_cvar(id, sn, NONE, missile_delay) \
+       w_cvar(id, sn, NONE, missile_edgedamage) \
+       w_cvar(id, sn, NONE, missile_force) \
+       w_cvar(id, sn, NONE, missile_health) \
+       w_cvar(id, sn, NONE, missile_lifetime) \
+       w_cvar(id, sn, NONE, missile_proxy) \
+       w_cvar(id, sn, NONE, missile_proxy_delay) \
+       w_cvar(id, sn, NONE, missile_proxy_maxrange) \
+       w_cvar(id, sn, NONE, missile_radius) \
+       w_cvar(id, sn, NONE, missile_refire) \
+       w_cvar(id, sn, NONE, missile_smart) \
+       w_cvar(id, sn, NONE, missile_smart_mindist) \
+       w_cvar(id, sn, NONE, missile_smart_trace_max) \
+       w_cvar(id, sn, NONE, missile_smart_trace_min) \
+       w_cvar(id, sn, NONE, missile_speed) \
+       w_cvar(id, sn, NONE, missile_speed_max) \
+       w_cvar(id, sn, NONE, missile_speed_up) \
+       w_cvar(id, sn, NONE, missile_speed_z) \
+       w_cvar(id, sn, NONE, missile_spread) \
+       w_cvar(id, sn, NONE, missile_turnrate) \
+       w_cvar(id, sn, NONE, tag_ammo) \
+       w_cvar(id, sn, NONE, tag_animtime) \
+       w_cvar(id, sn, NONE, tag_damageforcescale) \
+       w_cvar(id, sn, NONE, tag_health) \
+       w_cvar(id, sn, NONE, tag_lifetime) \
+       w_cvar(id, sn, NONE, tag_refire) \
+       w_cvar(id, sn, NONE, tag_speed) \
+       w_cvar(id, sn, NONE, tag_spread) \
+       w_cvar(id, sn, NONE, tag_tracker_lifetime) \
+       w_prop(id, sn, float,  reloading_ammo, reload_ammo) \
+       w_prop(id, sn, float,  reloading_time, reload_time) \
+       w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
+       w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
+       w_prop(id, sn, string, weaponreplace, weaponreplace) \
+       w_prop(id, sn, float,  weaponstart, weaponstart) \
+       w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride)
+
 #ifdef SVQC
-//.float proxytime; = autoswitch
-//.float tl; = wait
+SEEKER_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 .entity tag_target, wps_tag_tracker;
 .float tag_time;
+#endif
+#else
+#ifdef SVQC
+void spawnfunc_weapon_seeker (void) { weapon_defaultspawnfunc(WEP_SEEKER); }
 
 // ============================
 // Begin: Missile functions, these are general functions to be manipulated by other code
 // ============================
-void Seeker_Missile_Explode ()
+void W_Seeker_Missile_Explode()
 {
        self.event_damage = func_null;
-       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);
-
+       RadiusDamage (self, self.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), self.projectiledeathtype, other);
 
        remove (self);
 }
 
-void Seeker_Missile_Touch()
+void W_Seeker_Missile_Touch()
 {
        PROJECTILE_TOUCH;
 
-       Seeker_Missile_Explode();
+       W_Seeker_Missile_Explode();
 }
 
-void Seeker_Missile_Think()
+void W_Seeker_Missile_Think()
 {
        entity e;
        vector desireddir, olddir, newdir, eorg;
@@ -47,14 +111,14 @@ void Seeker_Missile_Think()
        if (time > self.cnt)
        {
                self.projectiledeathtype |= HITTYPE_SPLASH;
-               Seeker_Missile_Explode();
+               W_Seeker_Missile_Explode();
        }
 
        spd = vlen(self.velocity);
        spd = bound(
-               spd - autocvar_g_balance_seeker_missile_decel * frametime,
-               autocvar_g_balance_seeker_missile_speed_max,
-               spd + autocvar_g_balance_seeker_missile_accel * frametime
+               spd - WEP_CVAR(seeker, missile_decel) * frametime,
+               WEP_CVAR(seeker, missile_speed_max),
+               spd + WEP_CVAR(seeker, missile_accel) * frametime
        );
 
        if (self.enemy != world)
@@ -65,13 +129,13 @@ void Seeker_Missile_Think()
        {
                e               = self.enemy;
                eorg            = 0.5 * (e.absmin + e.absmax);
-               turnrate        = autocvar_g_balance_seeker_missile_turnrate; // how fast to turn
+               turnrate        = WEP_CVAR(seeker, missile_turnrate); // how fast to turn
                desireddir      = normalize(eorg - self.origin);
                olddir          = normalize(self.velocity); // get my current direction
                dist            = vlen(eorg - self.origin);
 
                // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
-               if (autocvar_g_balance_seeker_missile_smart && (dist > autocvar_g_balance_seeker_missile_smart_mindist))
+               if (WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
                {
                        // Is it a better idea (shorter distance) to trace to the target itself?
                        if ( vlen(self.origin + olddir * self.wait) < dist)
@@ -80,12 +144,12 @@ void Seeker_Missile_Think()
                                traceline(self.origin, eorg, FALSE, self);
 
                        // Setup adaptive tracelength
-                       self.wait = bound(autocvar_g_balance_seeker_missile_smart_trace_min, vlen(self.origin - trace_endpos), self.wait = autocvar_g_balance_seeker_missile_smart_trace_max);
+                       self.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = WEP_CVAR(seeker, missile_smart_trace_max));
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
                        desireddir  = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
                }
-               
+
                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
        }
@@ -93,19 +157,19 @@ void Seeker_Missile_Think()
                dist = 0;
 
        // Proxy
-       if (autocvar_g_balance_seeker_missile_proxy)
+       if (WEP_CVAR(seeker, missile_proxy))
        {
-               if ( dist <= autocvar_g_balance_seeker_missile_proxy_maxrange)
+               if ( dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
                {
                        if (self.autoswitch == 0)
                        {
-                               self.autoswitch = time + autocvar_g_balance_seeker_missile_proxy_delay;
+                               self.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
                        }
                        else
                        {
                                if (self.autoswitch <= time)
                                {
-                                       Seeker_Missile_Explode();
+                                       W_Seeker_Missile_Explode();
                                        self.autoswitch = 0;
                                }
                        }
@@ -133,11 +197,11 @@ void Seeker_Missile_Think()
 
 
 
-void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Seeker_Missile_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
        if (self.health <= 0)
                return;
-               
+
        if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, -1)) // no exceptions
                return; // g_projectiles_damage says to halt
 
@@ -145,13 +209,13 @@ void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, flo
                self.health = self.health - (damage * 0.25);
        else
                self.health = self.health - damage;
-               
+
        if (self.health <= 0)
-               W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode);
+               W_PrepareExplosionByDamage(attacker, W_Seeker_Missile_Explode);
 }
 
 /*
-void Seeker_Missile_Animate()
+void W_Seeker_Missile_Animate()
 {
        self.frame = self.frame +1;
        self.nextthink = time + 0.05;
@@ -162,7 +226,7 @@ void Seeker_Missile_Animate()
 
        if(self.frame == 5)
        {
-               self.think           = Seeker_Missile_Think;
+               self.think           = W_Seeker_Missile_Think;
                self.nextthink       = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
 
                if (autocvar_g_balance_seeker_missile_proxy)
@@ -175,11 +239,11 @@ void Seeker_Missile_Animate()
 }
 */
 
-void Seeker_Fire_Missile(vector f_diff, entity m_target)
+void W_Seeker_Fire_Missile(vector f_diff, entity m_target)
 {
        entity missile;
 
-       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_reload_ammo);
+       W_DecreaseAmmo(WEP_CVAR(seeker, missile_ammo));
 
        makevectors(self.v_angle);
        W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
@@ -192,25 +256,25 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
        missile.owner           = missile.realowner = self;
        missile.classname       = "seeker_missile";
        missile.bot_dodge       = TRUE;
-       missile.bot_dodgerating = autocvar_g_balance_seeker_missile_damage;
+       missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
 
-       missile.think           = Seeker_Missile_Think;
-       missile.touch           = Seeker_Missile_Touch;
-       missile.event_damage    = Seeker_Missile_Damage;
+       missile.think           = W_Seeker_Missile_Think;
+       missile.touch           = W_Seeker_Missile_Touch;
+       missile.event_damage    = W_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.cnt             = time + WEP_CVAR(seeker, missile_lifetime);
        missile.enemy           = m_target;
        missile.solid           = SOLID_BBOX;
        missile.scale           = 2;
        missile.takedamage      = DAMAGE_YES;
-       missile.health          = autocvar_g_balance_seeker_missile_health;
-       missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
+       missile.health          = WEP_CVAR(seeker, missile_health);
+       missile.damageforcescale = WEP_CVAR(seeker, missile_damageforcescale);
        missile.damagedbycontents = TRUE;
-       //missile.think           = Seeker_Missile_Animate; // csqc projectiles.
-       
+       //missile.think           = W_Seeker_Missile_Animate; // csqc projectiles.
+
        if (missile.enemy != world)
                missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
-       else 
+       else
                missile.projectiledeathtype = WEP_SEEKER;
 
 
@@ -219,8 +283,8 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
        missile.movetype    = MOVETYPE_FLYMISSILE;
        missile.flags       = FL_PROJECTILE;
        missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
-       
-       W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
+
+       W_SetupProjVelocity_UP_PRE(missile, seeker, missile_);
 
        missile.angles = vectoangles (missile.velocity);
 
@@ -230,31 +294,31 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
 }
 
 // ============================
-// Begin: FLAC, close range attack meant for defeating rockets which are coming at you. 
+// Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
 // ============================
-void Seeker_Flac_Explode ()
+void W_Seeker_Flac_Explode()
 {
        self.event_damage = func_null;
 
-       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);
+       RadiusDamage (self, self.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), self.projectiledeathtype, other);
 
        remove (self);
 }
 
-void Seeker_Flac_Touch()
+void W_Seeker_Flac_Touch()
 {
        PROJECTILE_TOUCH;
 
-       Seeker_Flac_Explode();
+       W_Seeker_Flac_Explode();
 }
 
-void Seeker_Fire_Flac()
+void W_Seeker_Fire_Flac()
 {
        entity missile;
        vector f_diff;
        float c;
 
-       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_flac_ammo, autocvar_g_balance_seeker_reload_ammo);
+       W_DecreaseAmmo(WEP_CVAR(seeker, flac_ammo));
 
        c = mod(self.bulletcounter, 4);
        switch(c)
@@ -273,7 +337,7 @@ void Seeker_Fire_Flac()
                        f_diff = '+1.25 +3.75 0';
                        break;
        }
-       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_flac_damage);
+       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
        w_shotorg += f_diff;
 
        pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -282,48 +346,48 @@ void Seeker_Fire_Flac()
        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.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
+       missile.touch                   = W_Seeker_Flac_Explode;
+       missile.use                     = W_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.nextthink               = time + WEP_CVAR(seeker, flac_lifetime) + WEP_CVAR(seeker, flac_lifetime_rand);
        missile.solid                   = SOLID_BBOX;
-       missile.movetype                = MOVETYPE_FLY; 
+       missile.movetype                = MOVETYPE_FLY;
        missile.projectiledeathtype = WEP_SEEKER;
        missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
        missile.flags                           = FL_PROJECTILE;
-       missile.missile_flags       = MIF_SPLASH; 
-       
+       missile.missile_flags       = MIF_SPLASH;
+
        // csqc projectiles
-       //missile.angles                                = vectoangles (missile.velocity);       
-       //missile.scale = 0.4; // BUG: the model is too big 
-       
+       //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);
+
+       W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
 
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
 // ============================
-// Begin: Tag and rocket controllers 
+// Begin: Tag and rocket controllers
 // ============================
-entity Seeker_Tagged_Info(entity isowner, entity istarget)
+entity W_Seeker_Tagged_Info(entity isowner, entity istarget)
 {
        entity tag;
-       for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) 
+       for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
                if ((tag.realowner == isowner) && (tag.tag_target == istarget))
                        return tag;
-               
+
        return world;
 }
 
-void Seeker_Attack()
+void W_Seeker_Attack()
 {
        entity tracker, closest_target;
-       
+
        closest_target = world;
        for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
        {
@@ -332,52 +396,52 @@ void Seeker_Attack()
                        if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
                                closest_target = tracker.tag_target;
                }
-               else 
+               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);
+
+       W_Seeker_Fire_Missile('0 0 0', closest_target);
 }
 
-void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack
+void W_Seeker_Vollycontroller_Think() // TODO: Merge this with W_Seeker_Attack
 {
        float c;
        entity oldself,oldenemy;
        self.cnt = self.cnt - 1;
 
-       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.ammo_rockets < autocvar_g_balance_seeker_missile_ammo) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER))
+       if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.WEP_AMMO(SEEKER) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER))
        {
                remove(self);
                return;
        }
 
-       self.nextthink = time + autocvar_g_balance_seeker_missile_delay * W_WeaponRateFactor();
-       
+       self.nextthink = time + WEP_CVAR(seeker, missile_delay) * W_WeaponRateFactor();
+
        oldself = self;
        self = self.realowner;
-       
+
        oldenemy = self.enemy;
        self.enemy = oldself.enemy;
-       
+
        c = mod(self.cnt, 4);
        switch(c)
        {
                case 0:
-                       Seeker_Fire_Missile('-1.25 -3.75 0', self.enemy);
+                       W_Seeker_Fire_Missile('-1.25 -3.75 0', self.enemy);
                        break;
                case 1:
-                       Seeker_Fire_Missile('+1.25 -3.75 0', self.enemy);
+                       W_Seeker_Fire_Missile('+1.25 -3.75 0', self.enemy);
                        break;
                case 2:
-                       Seeker_Fire_Missile('-1.25 +3.75 0', self.enemy);
+                       W_Seeker_Fire_Missile('-1.25 +3.75 0', self.enemy);
                        break;
                case 3:
                default:
-                       Seeker_Fire_Missile('+1.25 +3.75 0', self.enemy);
+                       W_Seeker_Fire_Missile('+1.25 +3.75 0', self.enemy);
                        break;
        }
 
@@ -385,11 +449,11 @@ void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack
        self = oldself;
 }
 
-void Seeker_Tracker_Think() 
+void W_Seeker_Tracker_Think()
 {
        // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
        if ((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
-       || (time > self.tag_time + autocvar_g_balance_seeker_tag_tracker_lifetime))
+       || (time > self.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
        {
                if (self)
                {
@@ -398,15 +462,15 @@ void Seeker_Tracker_Think()
                }
                return;
        }
-       
+
        // Update the think method information
        self.nextthink = time;
 }
 
 // ============================
-// Begin: Tag projectile 
+// Begin: Tag projectile
 // ============================
-void Seeker_Tag_Explode ()
+void W_Seeker_Tag_Explode()
 {
        //if(other==self.realowner)
        //    return;
@@ -415,21 +479,21 @@ void Seeker_Tag_Explode ()
        remove (self);
 }
 
-void Seeker_Tag_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Seeker_Tag_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
        if (self.health <= 0)
                return;
        self.health = self.health - damage;
        if (self.health <= 0)
-               Seeker_Tag_Explode();
+               W_Seeker_Tag_Explode();
 }
 
-void Seeker_Tag_Touch()
+void W_Seeker_Tag_Touch()
 {
        vector dir;
        vector org2;
        entity e;
-       
+
        PROJECTILE_TOUCH;
 
        dir     = normalize (self.realowner.origin - self.origin);
@@ -443,42 +507,42 @@ void Seeker_Tag_Touch()
        if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
        {
                // check to see if this person is already tagged by me
-               entity tag = Seeker_Tagged_Info(self.realowner, other);
-               
+               entity tag = W_Seeker_Tagged_Info(self.realowner, other);
+
                if (tag != world)
                {
-                       if (other.wps_tag_tracker && (autocvar_g_balance_seeker_type == 1)) // don't attach another waypointsprite without killing the old one first
+                       if (other.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
                                WaypointSprite_Kill(other.wps_tag_tracker);
-                               
+
                        tag.tag_time = time;
                }
                else
-               {               
+               {
                        //sprint(self.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n"));
                        e             = spawn();
-                       e.cnt         = autocvar_g_balance_seeker_missile_count;
+                       e.cnt         = WEP_CVAR(seeker, missile_count);
                        e.classname   = "tag_tracker";
                        e.owner       = self.owner;
                        e.realowner   = self.realowner;
-                       
-                       if      (autocvar_g_balance_seeker_type == 1)
+
+                       if(WEP_CVAR(seeker, type) == 1)
                        {
                                e.tag_target  = other;
                                e.tag_time    = time;
-                               e.think       = Seeker_Tracker_Think;
+                               e.think       = W_Seeker_Tracker_Think;
                        }
-                       else 
+                       else
                        {
                                e.enemy     = other;
-                               e.think     = Seeker_Vollycontroller_Think;
+                               e.think     = W_Seeker_Vollycontroller_Think;
                        }
-                       
+
                        e.nextthink   = time;
                }
-               
-               if      (autocvar_g_balance_seeker_type == 1)
+
+               if(WEP_CVAR(seeker, type) == 1)
                {
-                       WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
+                       WaypointSprite_Spawn("tagged-target", WEP_CVAR(seeker, tag_tracker_lifetime), 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
                        WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
                }
        }
@@ -487,37 +551,37 @@ void Seeker_Tag_Touch()
        return;
 }
 
-void Seeker_Fire_Tag()
+void W_Seeker_Fire_Tag()
 {
        entity missile;
-       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_tag_ammo, autocvar_g_balance_seeker_reload_ammo);
+       W_DecreaseAmmo(WEP_CVAR(seeker, tag_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);
+       W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
 
        missile                 = spawn();
        missile.owner           = missile.realowner = self;
        missile.classname       = "seeker_tag";
        missile.bot_dodge       = TRUE;
        missile.bot_dodgerating = 50;
-       missile.touch           = Seeker_Tag_Touch;
+       missile.touch           = W_Seeker_Tag_Touch;
        missile.think           = SUB_Remove;
-       missile.nextthink       = time + autocvar_g_balance_seeker_tag_lifetime;
+       missile.nextthink       = time + WEP_CVAR(seeker, tag_lifetime);
        missile.movetype        = MOVETYPE_FLY;
        missile.solid           = SOLID_BBOX;
 
        missile.takedamage       = DAMAGE_YES;
-       missile.event_damage     = Seeker_Tag_Damage;
-       missile.health           = autocvar_g_balance_seeker_tag_health;
-       missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
+       missile.event_damage     = W_Seeker_Tag_Damage;
+       missile.health           = WEP_CVAR(seeker, tag_health);
+       missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
 
        setorigin (missile, w_shotorg);
        setsize (missile, '-2 -2 -2', '2 2 2');
 
        missile.flags       = FL_PROJECTILE;
-       //missile.missile_flags = MIF_..?; 
+       //missile.missile_flags = MIF_..?;
 
        missile.movetype    = MOVETYPE_FLY;
-       W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag);
+       W_SetupProjVelocity_PRE(missile, seeker, tag_);
        missile.angles = vectoangles (missile.velocity);
 
        CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
@@ -528,12 +592,8 @@ void Seeker_Fire_Tag()
 // ============================
 // Begin: Genereal weapon functions
 // ============================
-void spawnfunc_weapon_seeker (void)
-{
-       weapon_defaultspawnfunc(WEP_SEEKER);
-}
 
-float w_seeker(float req)
+float W_Seeker(float req)
 {
        float ammo_amount;
 
@@ -541,64 +601,63 @@ float w_seeker(float req)
        {
                case WR_AIM:
                {
-                       if (autocvar_g_balance_seeker_type == 1) 
-                               if (Seeker_Tagged_Info(self, self.enemy) != world)
-                                       self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_missile_speed_max, 0, autocvar_g_balance_seeker_missile_lifetime, FALSE);
+                       if (WEP_CVAR(seeker, type) == 1)
+                               if (W_Seeker_Tagged_Info(self, self.enemy) != world)
+                                       self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), FALSE);
                                else
-                                       self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, autocvar_g_balance_seeker_tag_lifetime, FALSE);
+                                       self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), FALSE);
                        else
-                               self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, autocvar_g_balance_seeker_tag_lifetime, FALSE);
-                               
+                               self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), FALSE);
                        return TRUE;
                }
                case 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);
-                               
+                       if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) // forced reload
+                               WEP_ACTION(self.weapon, WR_RELOAD);
+
                        else if (self.BUTTON_ATCK)
                        {
-                               if (autocvar_g_balance_seeker_type == 1) 
+                               if (WEP_CVAR(seeker, type) == 1)
                                {
-                                       if (weapon_prepareattack(0, autocvar_g_balance_seeker_missile_refire))
+                                       if (weapon_prepareattack(0, WEP_CVAR(seeker, missile_refire)))
                                        {
-                                               Seeker_Attack();
-                                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_missile_animtime, w_ready);
+                                               W_Seeker_Attack();
+                                               weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, missile_animtime), w_ready);
                                        }
                                }
-                               else 
+                               else
                                {
-                                       if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
+                                       if (weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
                                        {
-                                               Seeker_Fire_Tag();
-                                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready);
+                                               W_Seeker_Fire_Tag();
+                                               weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
                                        }
                                }
                        }
 
                        else if (self.BUTTON_ATCK2)
                        {
-                               if (autocvar_g_balance_seeker_type == 1) 
+                               if (WEP_CVAR(seeker, type) == 1)
                                {
-                                       if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
+                                       if (weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
                                        {
-                                               Seeker_Fire_Tag();
-                                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready);
+                                               W_Seeker_Fire_Tag();
+                                               weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
                                        }
                                }
-                               else 
+                               else
                                {
-                                       if (weapon_prepareattack(0, autocvar_g_balance_seeker_flac_refire))
+                                       if (weapon_prepareattack(0, WEP_CVAR(seeker, flac_refire)))
                                        {
-                                               Seeker_Fire_Flac();
-                                               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
+                                               W_Seeker_Fire_Flac();
+                                               weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, flac_animtime), w_ready);
                                        }
                                }
                        }
-                       
+
                        return TRUE;
                }
-               case WR_PRECACHE:
+               case WR_INIT:
                {
                        precache_model ("models/weapons/g_seeker.md3");
                        precache_model ("models/weapons/v_seeker.md3");
@@ -606,47 +665,45 @@ float w_seeker(float req)
                        precache_sound ("weapons/tag_fire.wav");
                        precache_sound ("weapons/flac_fire.wav");
                        precache_sound ("weapons/seeker_fire.wav");
-                       return TRUE;
-               }
-               case WR_SETUP:
-               {
-                       weapon_setup(WEP_SEEKER);
-                       self.current_ammo = ammo_rockets;
+                       SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP)
                        return TRUE;
                }
                case WR_CHECKAMMO1:
                {
-                       if (autocvar_g_balance_seeker_type == 1) 
+                       if (WEP_CVAR(seeker, type) == 1)
                        {
-                               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.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, missile_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, missile_ammo);
                        }
                        else
                        {
-                               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.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
                        }
-                       
                        return ammo_amount;
                }
                case WR_CHECKAMMO2:
                {
-                       if (autocvar_g_balance_seeker_type == 1) 
+                       if (WEP_CVAR(seeker, type) == 1)
                        {
-                               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.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, tag_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, tag_ammo);
                        }
                        else
                        {
-                               ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_flac_ammo;
-                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_flac_ammo;
+                               ammo_amount = self.WEP_AMMO(SEEKER) >= WEP_CVAR(seeker, flac_ammo);
+                               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= WEP_CVAR(seeker, flac_ammo);
                        }
-                       
                        return ammo_amount;
                }
+               case WR_CONFIG:
+               {
+                       SEEKER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
+                       return TRUE;
+               }
                case WR_RELOAD:
                {
-                       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");
+                       W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), "weapons/reload.wav");
                        return TRUE;
                }
                case WR_SUICIDEMESSAGE:
@@ -665,7 +722,7 @@ float w_seeker(float req)
 }
 #endif
 #ifdef CSQC
-float w_seeker(float req)
+float W_Seeker(float req)
 {
        switch(req)
        {
@@ -678,7 +735,7 @@ float w_seeker(float req)
                                if(w_deathtype & HITTYPE_SECONDARY)
                                {
                                        if(!w_issilent)
-                                               sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTEN_NORM);
                                }
                                else
                                {
@@ -686,11 +743,11 @@ float w_seeker(float req)
                                        if(!w_issilent)
                                        {
                                                if (w_random<0.15)
-                                                       sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
+                                                       sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
                                                else if (w_random<0.7)
-                                                       sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
+                                                       sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTEN_NORM);
                                                else
-                                                       sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
+                                                       sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTEN_NORM);
                                        }
                                }
                        }
@@ -700,17 +757,16 @@ float w_seeker(float req)
                                if(!w_issilent)
                                {
                                        if (w_random<0.15)
-                                               sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTEN_NORM);
                                        else if (w_random<0.7)
-                                               sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTEN_NORM);
                                        else
-                                               sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+                                               sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTEN_NORM);
                                }
                        }
-                       
                        return TRUE;
                }
-               case WR_PRECACHE:
+               case WR_INIT:
                {
                        precache_sound("weapons/seekerexp1.wav");
                        precache_sound("weapons/seekerexp2.wav");
@@ -721,8 +777,13 @@ float w_seeker(float req)
                        precache_sound("weapons/tag_impact.wav");
                        return TRUE;
                }
+               case WR_ZOOMRETICLE:
+               {
+                       // no weapon specific image for this weapon
+                       return FALSE;
+               }
        }
-       
+
        return TRUE;
 }
 #endif