set g_weaponreplace_campingrifle ""
set g_weaponreplace_tuba ""
set g_weaponreplace_fireball ""
+set g_weaponreplace_seeker ""
set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility)"
// }}}
set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_health_start 100
set g_balance_armor_start 0
set g_start_ammo_shells 45
set g_balance_fireball_secondary_speed 650
set g_balance_fireball_secondary_spread 0
// }}}
+// {{{ 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_spread 0.4
+set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_ammo 2
+set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_count 4
+set g_balance_seeker_missile_damage 40
+set g_balance_seeker_missile_damageforcescale 4
+set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_delay 0.25
+set g_balance_seeker_missile_edgedamage 10
+set g_balance_seeker_missile_force 250
+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_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_max 1250
+set g_balance_seeker_missile_turnrate 0.65
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.3
+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.7
+set g_balance_seeker_tag_speed 9000
+// End new seeker
set g_weaponreplace_campingrifle ""
set g_weaponreplace_tuba ""
set g_weaponreplace_fireball ""
+set g_weaponreplace_seeker ""
set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility)"
// }}}
set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_health_start 150
set g_balance_armor_start 0
set g_start_ammo_shells 40
set g_balance_fireball_secondary_speed 650
set g_balance_fireball_secondary_spread 0
// }}}
+// {{{ 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_spread 0.4
+set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_ammo 2
+set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_count 4
+set g_balance_seeker_missile_damage 40
+set g_balance_seeker_missile_damageforcescale 4
+set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_delay 0.25
+set g_balance_seeker_missile_edgedamage 10
+set g_balance_seeker_missile_force 250
+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_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_max 1250
+set g_balance_seeker_missile_turnrate 0.65
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.3
+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.7
+set g_balance_seeker_tag_speed 9000
+// End new seeker
set g_weaponreplace_campingrifle 0
set g_weaponreplace_tuba ""
set g_weaponreplace_fireball 0
+set g_weaponreplace_seeker 0
set sv_q3acompat_machineshotgunswap 0
// }}}
set g_start_weapon_campingrifle 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_health_start 125
set g_balance_armor_start 0
set g_start_ammo_shells 0
set g_balance_fireball_secondary_speed 650
set g_balance_fireball_secondary_spread 0
// }}}
+// {{{ 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_spread 0.4
+set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_ammo 2
+set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_count 4
+set g_balance_seeker_missile_damage 40
+set g_balance_seeker_missile_damageforcescale 4
+set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_delay 0.25
+set g_balance_seeker_missile_edgedamage 10
+set g_balance_seeker_missile_force 250
+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_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_max 1250
+set g_balance_seeker_missile_turnrate 0.65
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.3
+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.7
+set g_balance_seeker_tag_speed 9000
+// End new seeker
set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_seeker 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
set g_balance_health_start 100
set g_balance_armor_start 0
set g_start_ammo_shells 45
set g_balance_fireball_secondary_speed 650
set g_balance_fireball_secondary_spread 0
// }}}
+// {{{ 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_spread 0.4
+set g_balance_seeker_missile_accel 1.05
+set g_balance_seeker_missile_ammo 2
+set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_count 4
+set g_balance_seeker_missile_damage 40
+set g_balance_seeker_missile_damageforcescale 4
+set g_balance_seeker_missile_decel 0.9
+set g_balance_seeker_missile_delay 0.25
+set g_balance_seeker_missile_edgedamage 10
+set g_balance_seeker_missile_force 250
+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_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_max 1250
+set g_balance_seeker_missile_turnrate 0.65
+set g_balance_seeker_tag_ammo 1
+set g_balance_seeker_tag_animtime 0.3
+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.7
+set g_balance_seeker_tag_speed 9000
+// End new seeker
seta crosshair_hlac_color_blue 0.2 "crosshair color blue component to display when wielding the H.L.A.C."
seta crosshair_hlac_color_alpha 1 "crosshair alpha value to display when wielding the H.L.A.C."
seta crosshair_hlac_size 0.6 "crosshair size when wielding the H.L.A.C."
+seta crosshair_seeker "" "crosshair to display when wielding the TAG Seeker"
+seta crosshair_seeker_color_red 1 "crosshair color red component to display when wielding the TAG seeker"
+seta crosshair_seeker_color_green 0.35 "crosshair color green component to display when wielding the TAG seeker"
+seta crosshair_seeker_color_blue 0.35 "crosshair color blue component to display when wielding the TAG seeker"
+seta crosshair_seeker_color_alpha 0.9 "crosshair alpha value to display when wielding the TAG seeker"
+seta crosshair_seeker_size 0.8 "crosshair size when wielding the TAG seeker"
seta crosshair_campingrifle "" "crosshair to display when wielding the campingrifle"
seta crosshair_campingrifle_color_red 0.85 "crosshair color red component to display when wielding the campingrifle"
seta crosshair_campingrifle_color_green 0.5 "crosshair color green component to display when wielding the campingrifle"
--- /dev/null
+1 8 20 0 // fire
+9 5 20 0 // fire2
+15 200 20 1 // idle
+215 40 20 0 // reload
mi = '-16 -16 -16';
ma = '16 16 16';
break;
+ case WEP_SEEKER: // projectile has a size!
+ mi = '-2 -2 -2';
+ ma = '2 2 2';
+ break;
case WEP_ELECTRO: // projectile has a size!
mi = '0 0 -3';
ma = '0 0 -3';
if(!issilent)
sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
break;
+ case WEP_SEEKER:
+ org2 = org + backoff * 6;
+ if(secondary)
+ {
+ pointparticles(particleeffectnum("flac_explode"), org2, '0 0 0', 1);
+ if(!issilent)
+ {
+ if (r<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp1.wav", 1, ATTN_NORM);
+ else if (r<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/flacexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else
+ {
+ if(bounce)
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!issilent)
+ {
+ if (r<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp1.wav", 1, ATTN_NORM);
+ else if (r<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/tagexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ else if(headshot)
+ {
+ if(!issilent)
+ sound(self, CHAN_PROJECTILE, "weapons/tag_impact.wav", 1, ATTN_NORM);
+ }
+ else
+ {
+ pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
+ if(!issilent)
+ {
+ if (r<0.15)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp1.wav", 1, ATTN_NORM);
+ else if (r<0.7)
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp2.wav", 1, ATTN_NORM);
+ else
+ sound(self, CHAN_PROJECTILE, "weapons/seekerexp3.wav", 1, ATTN_NORM);
+ }
+ }
+ }
+ break;
case WEP_HLAC:
org2 = org + backoff * 6;
pointparticles(particleeffectnum("laser_impact"), org2, backoff * 1000, 1);
precache_sound("weapons/crylink_impact.wav");
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
+ precache_sound("weapons/flacexp1.wav");
+ precache_sound("weapons/flacexp2.wav");
+ precache_sound("weapons/flacexp3.wav");
precache_sound("weapons/grenade_impact.wav");
precache_sound("weapons/hagexp1.wav");
precache_sound("weapons/hagexp2.wav");
precache_sound("weapons/rocket_impact.wav");
precache_sound("weapons/fireball_impact.wav");
precache_sound("weapons/fireball_impact2.wav");
+ precache_sound("weapons/seekerexp1.wav");
+ precache_sound("weapons/seekerexp2.wav");
+ precache_sound("weapons/seekerexp3.wav");
+ precache_sound("weapons/tagexp1.wav");
+ precache_sound("weapons/tagexp2.wav");
+ precache_sound("weapons/tagexp3.wav");
+ precache_sound("weapons/tag_impact.wav");
}
case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("TR_GRENADE"); self.scale = 0.4; break;
case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("fireball"); break; // particle effect is good enough
case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("firemine"); break; // particle effect is good enough
+ case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
+ case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.md3"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_ROCKET"); break;
+ case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.scale = 2; self.traileffect = particleeffectnum("TR_ROCKET"); break;
default:
error("Received invalid CSQC projectile, can't work with this!");
break;
self.mins = '-4 -4 -4';
self.maxs = '4 4 4';
break;
+ case PROJECTILE_TAG:
+ loopsound(self, CHAN_PROJECTILE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
+ self.mins = '-2 -2 -2';
+ self.maxs = '2 2 2';
+ break;
+ case PROJECTILE_FLAC:
+ self.mins = '-2 -2 -2';
+ self.maxs = '2 2 2';
+ break;
+ case PROJECTILE_SEEKER:
+ self.mins = '-4 -4 -4';
+ self.maxs = '4 4 4';
+ break;
default:
break;
}
precache_model("models/laser.mdl");
precache_model("models/plasmatrail.mdl");
precache_model("models/rocket.md3");
+ precache_model("models/tagrocket.md3");
precache_model("models/tracer.mdl");
precache_sound("weapons/electro_fly.wav");
precache_sound("weapons/rocket_fly.wav");
precache_sound("weapons/fireball_fly.wav");
precache_sound("weapons/fireball_fly2.wav");
+ precache_sound("weapons/tag_rocket_fly.wav");
}
// this sets sounds and other properties of the projectiles in csqc
float PROJECTILE_ELECTRO = 1;
float PROJECTILE_ROCKET = 2;
+float PROJECTILE_TAG = 3;
float PROJECTILE_BULLET = 4;
float PROJECTILE_CRYLINK = 5;
float PROJECTILE_ELECTRO_BEAM = 6;
float PROJECTILE_GRENADE_BOUNCING = 8;
float PROJECTILE_LASER = 9;
float PROJECTILE_HLAC = 10;
+float PROJECTILE_SEEKER = 11;
+float PROJECTILE_FLAC = 12;
float PROJECTILE_PORTO_RED = 13;
float PROJECTILE_PORTO_BLUE = 14;
float PROJECTILE_HOOKBOMB = 15;
for(i = WEP_FIRST; i < WEP_LAST ; ++i)
{
// Find weapon
- if((get_weaponinfo(i)).weapons & self.weapons)
+ if(power2of(i-1) & self.weapons)
if(++c>=4)
break;
}
--- /dev/null
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 9, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MEDIUM, "seeker", "seeker", "T.A.G. Seeker");
+#else
+//.float speed; = switchweapon
+//.float proxytime; = autoswitch
+//.float tl; = wait
+
+void Seeker_Missile_Explode ()
+{
+ self.event_damage = SUB_Null;
+ RadiusDamage (self, self.owner, cvar("g_balance_seeker_missile_damage"), cvar("g_balance_seeker_missile_edgedamage"), cvar("g_balance_seeker_missile_radius"), world, cvar("g_balance_seeker_missile_force"), self.projectiledeathtype, other, WEP_SEEKER);
+
+ remove (self);
+}
+
+void Seeker_Missile_Touch()
+{
+ PROJECTILE_TOUCH;
+
+ Seeker_Missile_Explode();
+}
+
+void Seeker_Missile_Think()
+{
+ entity e;
+ vector desireddir, olddir, newdir, eorg;
+ float turnrate;
+ float dist;
+
+ if (time > self.cnt)
+ Seeker_Missile_Explode();
+
+ if (!self.switchweapon)
+ self.switchweapon = cvar("g_balance_seeker_missile_speed");
+
+ if ((self.switchweapon < cvar("g_balance_seeker_missile_speed_max")) && cvar("g_balance_seeker_missile_speed_accel"))
+ self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_accel");
+
+ if (self.switchweapon > cvar("g_balance_seeker_missile_speed_max"))
+ self.switchweapon = self.switchweapon * cvar("g_balance_seeker_missile_decel");
+
+ if (self.enemy != world)
+ if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+ self.enemy = world;
+
+ if (self.enemy != world)
+ {
+ e = self.enemy;
+ eorg = 0.5 * (e.absmin + e.absmax);
+ turnrate = cvar("g_balance_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 (cvar("g_balance_seeker_missile_smart") && (dist > cvar("g_balance_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)
+ traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
+ else
+ traceline(self.origin, eorg, FALSE, self);
+
+ // Setup adaptive tracelength
+ self.wait = vlen(self.origin - trace_endpos);
+ if (self.wait < cvar("g_balance_seeker_missile_smart_trace_min")) self.wait = cvar("g_balance_seeker_missile_smart_trace_min");
+ if (self.wait > cvar("g_balance_seeker_missile_smart_trace_max")) self.wait = cvar("g_balance_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) * 0.5);// take the average of the 2 directions; not the best method but simple & easy
+ newdir = normalize(olddir + desireddir * turnrate);// take the average of the 2 directions; not the best method but simple & easy
+
+ self.velocity = newdir * self.switchweapon; // make me fly in the new direction at my flight speed
+ }
+
+ // Proxy
+ if (cvar("g_balance_seeker_missile_proxy"))
+ {
+ if ( dist <= cvar("g_balance_seeker_missile_proxy_maxrange"))
+ {
+ if (self.autoswitch == 0)
+ {
+ self.autoswitch = time + cvar("g_balance_seeker_missile_proxy_delay");
+ }
+ else
+ {
+ if (self.autoswitch <= time)
+ {
+ Seeker_Missile_Explode();
+ self.autoswitch = 0;
+ }
+ }
+ }
+ else
+ {
+ if (self.autoswitch != 0)
+ self.autoswitch = 0;
+ }
+ }
+ ///////////////
+
+ if (self.enemy.deadflag != DEAD_NO)
+ {
+ self.enemy = world;
+ self.cnt = time + 1 + (random() * 4);
+ self.nextthink = self.cnt;
+ return;
+ }
+
+ self.angles = vectoangles(self.velocity); // turn model in the new flight direction
+ self.nextthink = time + 0.05;
+
+ UpdateCSQCProjectile(self);
+}
+
+
+
+void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ float d;
+ d = damage;
+
+ if (self.health <= 0)
+ return;
+
+ if (self.owner == attacker)
+ d = d * 0.25;
+
+ self.health = self.health - d;
+
+ if (self.health <= 0)
+ W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode);
+}
+
+void Seeker_Missile_Animate()
+{
+ self.frame = self.frame +1;
+ self.nextthink = time + 0.05;
+
+ if (self.enemy != world)
+ if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
+ self.enemy = world;
+
+ if(self.frame == 5)
+ {
+ self.think = Seeker_Missile_Think;
+ self.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
+
+ if (cvar("g_balance_seeker_guided_proxy"))
+ self.movetype = MOVETYPE_BOUNCEMISSILE;
+ else
+ self.movetype = MOVETYPE_FLYMISSILE;
+ }
+
+ UpdateCSQCProjectile(self);
+}
+
+void Seeker_Fire_Missile(vector f_diff)
+{
+ local entity missile;
+
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
+
+ makevectors(self.v_angle);
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", cvar("g_balance_seeker_missile_damage"));
+ w_shotorg += f_diff;
+ pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+ //self.detornator = FALSE;
+
+ missile = spawn();
+ missile.owner = self;
+ missile.classname = "seeker_missile";
+ missile.bot_dodge = TRUE;
+ missile.bot_dodgerating = cvar("g_balance_seeker_missile_damage");
+
+ missile.think = Seeker_Missile_Animate;
+
+ //if (!cvar("g_balance_seeker_missile_proxy"))
+ missile.touch = Seeker_Missile_Touch;
+
+ missile.event_damage = Seeker_Missile_Damage;
+ missile.nextthink = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
+ missile.cnt = time + cvar("g_balance_seeker_missile_lifetime");
+ missile.enemy = self.enemy;
+ missile.switchweapon = cvar("g_balance_seeker_missile_speed");
+ missile.solid = SOLID_BBOX;
+ missile.scale = 2;
+ missile.takedamage = DAMAGE_YES;
+ missile.health = cvar("g_balance_seeker_missile_health");
+ missile.damageforcescale = cvar("g_balance_seeker_missile_damageforcescale");
+ missile.projectiledeathtype = WEP_SEEKER;
+
+ setorigin (missile, w_shotorg);
+ setsize (missile, '-4 -4 -4', '4 4 4');
+
+
+ missile.movetype = MOVETYPE_FLYMISSILE;// MOVETYPE_TOSS;
+
+ missile.flags = FL_PROJECTILE;
+
+ missile.velocity = (w_shotdir + '0 0 0.45') * missile.switchweapon;
+ W_SetupProjectileVelocity(missile);
+
+ missile.switchweapon = vlen(missile.velocity);
+ missile.angles = vectoangles (missile.velocity);
+
+ CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
+}
+
+void Seeker_Vollycontroler_Think()
+{
+ float c;
+ entity oldself,oldenemy;
+ self.cnt = self.cnt - 1;
+
+ if ((self.owner.ammo_rockets < cvar("g_balance_seeker_missile_ammo")) || (self.cnt <= -1) || (self.owner.deadflag != DEAD_NO))
+ {
+ remove(self);
+ return;
+ }
+
+ self.nextthink = time + cvar("g_balance_seeker_missile_delay");
+
+ oldself = self;
+ self = self.owner;
+
+ oldenemy = self.enemy;
+ self.enemy = oldself.enemy;
+
+ c = mod(oldself.cnt, 4);
+ switch(c)
+ {
+ 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;
+ }
+
+ self.enemy = oldenemy;
+ self = oldself;
+}
+
+void Seeker_Tag_Explode ()
+{
+ //if(other==self.owner)
+ // return;
+ Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, self);
+
+ remove (self);
+}
+
+void 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();
+}
+
+void Seeker_Tag_Think()
+{
+ remove(self);
+ return;
+}
+
+void Seeker_Tag_Touch()
+{
+ vector dir;
+ vector org2;
+
+ dir = normalize (self.owner.origin - self.origin);
+ org2 = findbetterlocation (self.origin, 8);
+
+ te_knightspike(org2);
+
+ self.event_damage = SUB_Null;
+ Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, self);
+
+ if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
+ {
+ entity e;
+ e = spawn();
+ e.cnt = cvar("g_balance_seeker_missile_count");
+ e.owner = self.owner;
+ e.enemy = other;
+ e.think = Seeker_Vollycontroler_Think;
+ e.nextthink = time;
+
+ //sprint(self.owner, "^1Target lock ^3[^7 ",other.netname, " ^3]^1 acquired - autofire activated.\n");
+ //sprint(other,"^1You are targeted!\n");
+
+ // stuffcmd(other,"play2 weapons/zany-alarm4.ogg\n");
+ // stuffcmd(self.owner, "play2 weapons/zany-lock4.ogg\n");
+ }
+
+ remove(self);
+ return;
+}
+
+
+
+void Seeker_Fire_Tag()
+{
+ local entity missile;
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
+
+ W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", 0);
+
+ missile = spawn();
+ missile.owner = self;
+ missile.classname = "seeker_tag";
+ missile.bot_dodge = TRUE;
+ missile.bot_dodgerating = 50;
+ missile.touch = Seeker_Tag_Touch;
+ missile.think = Seeker_Tag_Think;
+ missile.nextthink = time + cvar("g_balance_seeker_tag_lifetime");
+ missile.movetype = MOVETYPE_FLY;
+ missile.solid = SOLID_BBOX;
+ missile.owner = self;
+
+ missile.takedamage = DAMAGE_YES;
+ missile.event_damage = Seeker_Tag_Explode;
+ missile.health = cvar("g_balance_seeker_tag_health");
+ missile.damageforcescale = cvar("g_balance_seeker_tag_damageforcescale");
+
+ setorigin (missile, w_shotorg);
+ setsize (missile, '-2 -2 -2', '2 2 2');
+
+ missile.flags = FL_PROJECTILE;
+
+ missile.velocity = w_shotdir * cvar("g_balance_seeker_tag_speed");
+ missile.movetype = MOVETYPE_FLY;
+ W_SetupProjectileVelocity(missile);
+ missile.angles = vectoangles (missile.velocity);
+
+ CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
+}
+
+
+void Seeker_Flac_Explode ()
+{
+ self.event_damage = SUB_Null;
+
+ RadiusDamage (self, self.owner, cvar("g_balance_seeker_flac_damage"), cvar("g_balance_seeker_flac_edgedamage"), cvar("g_balance_seeker_flac_radius"), world, cvar("g_balance_seeker_flac_force"), self.projectiledeathtype, other, WEP_SEEKER);
+
+ remove (self);
+}
+
+void Seeker_Flac_Touch()
+{
+ PROJECTILE_TOUCH;
+
+ Seeker_Flac_Explode();
+}
+
+void Seeker_Fire_Flac()
+{
+ local entity missile;
+ vector f_diff;
+ float c;
+
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_flac_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", cvar("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 = cvar("g_balance_seeker_flac_damage");
+ missile.touch = Seeker_Flac_Explode;
+ missile.use = Seeker_Flac_Explode;
+ missile.think = Seeker_Flac_Explode;
+ missile.nextthink = time + cvar("g_balance_seeker_flac_lifetime") + cvar("g_balance_seeker_flac_lifetime_rand");
+ missile.solid = SOLID_BBOX;
+ missile.scale = 0.4; // BUG: the model is too big
+ missile.projectiledeathtype = WEP_SEEKER;
+ setorigin (missile, w_shotorg);
+ setsize (missile, '-2 -2 -2', '2 2 2');
+ missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
+
+ missile.movetype = MOVETYPE_FLY;
+ w_shotdir = w_shotdir + '0 0 0.3';
+ missile.velocity = (w_shotdir + randomvec() * cvar("g_balance_seeker_flac_spread")) * cvar("g_balance_seeker_flac_speed");
+
+ W_SetupProjectileVelocity(missile);
+
+ missile.angles = vectoangles (missile.velocity);
+ missile.flags = FL_PROJECTILE;
+
+ CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
+}
+
+void spawnfunc_weapon_seeker (void)
+{
+ weapon_defaultspawnfunc(WEP_SEEKER);
+}
+
+float w_seeker(float req)
+{
+ if (req == WR_AIM)
+ self.BUTTON_ATCK = bot_aim(cvar("g_balance_seeker_tag_speed"), 0, 20, FALSE);
+
+ else if (req == WR_THINK)
+ {
+ if (self.BUTTON_ATCK)
+ if (weapon_prepareattack(0, cvar("g_balance_seeker_tag_refire")))
+ {
+ Seeker_Fire_Tag();
+ weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_seeker_tag_animtime"), w_ready);
+ }
+
+ if (self.BUTTON_ATCK2)
+ if (weapon_prepareattack(1, cvar("g_balance_seeker_flac_refire")))
+ {
+ Seeker_Fire_Flac();
+ weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_seeker_flac_animtime"), w_ready);
+ }
+
+ }
+ else if (req == WR_PRECACHE)
+ {
+ precache_model ("models/weapons/g_seeker.md3");
+ precache_model ("models/weapons/v_seeker.md3");
+ precache_model ("models/weapons/h_seeker.dpm");
+ precache_sound ("weapons/tag_fire.wav");
+ precache_sound ("weapons/flac_fire.wav");
+ precache_sound ("weapons/seeker_fire.wav");
+ }
+ else if (req == WR_SETUP)
+ weapon_setup(WEP_SEEKER);
+ else if (req == WR_CHECKAMMO1)
+ return self.ammo_rockets >= cvar("g_balance_seeker_tag_ammo") + cvar("g_balance_seeker_missile_ammo");
+ else if (req == WR_CHECKAMMO2)
+ return self.ammo_rockets >= cvar("g_balance_seeker_flac_ammo");
+ else if (req == WR_SUICIDEMESSAGE)
+ w_deathtypestring = "played with tiny rockets";
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ w_deathtypestring = "ran into #'s flac";
+ else
+ w_deathtypestring = "was tagged by";
+ }
+ return TRUE;
+};
+#endif