3 /* ammotype */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets)
4 /* impulse */ ATTRIB(Seeker, impulse, int, 8)
5 /* flags */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
6 /* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
7 /* color */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0');
8 /* modelname */ ATTRIB(Seeker, mdl, string, "seeker");
10 /* model */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM);
12 /* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker");
13 /* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
14 /* wepimg */ ATTRIB(Seeker, model2, string, "weaponseeker");
15 /* refname */ ATTRIB(Seeker, netname, string, "seeker");
16 /* wepname */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
18 #define X(BEGIN, P, END, class, prefix) \
20 P(class, prefix, flac_ammo, float, NONE) \
21 P(class, prefix, flac_animtime, float, NONE) \
22 P(class, prefix, flac_damage, float, NONE) \
23 P(class, prefix, flac_edgedamage, float, NONE) \
24 P(class, prefix, flac_force, float, NONE) \
25 P(class, prefix, flac_lifetime, float, NONE) \
26 P(class, prefix, flac_lifetime_rand, float, NONE) \
27 P(class, prefix, flac_radius, float, NONE) \
28 P(class, prefix, flac_refire, float, NONE) \
29 P(class, prefix, flac_speed, float, NONE) \
30 P(class, prefix, flac_speed_up, float, NONE) \
31 P(class, prefix, flac_speed_z, float, NONE) \
32 P(class, prefix, flac_spread, float, NONE) \
33 P(class, prefix, missile_accel, float, NONE) \
34 P(class, prefix, missile_ammo, float, NONE) \
35 P(class, prefix, missile_animtime, float, NONE) \
36 P(class, prefix, missile_count, float, NONE) \
37 P(class, prefix, missile_damageforcescale, float, NONE) \
38 P(class, prefix, missile_damage, float, NONE) \
39 P(class, prefix, missile_decel, float, NONE) \
40 P(class, prefix, missile_delay, float, NONE) \
41 P(class, prefix, missile_edgedamage, float, NONE) \
42 P(class, prefix, missile_force, float, NONE) \
43 P(class, prefix, missile_health, float, NONE) \
44 P(class, prefix, missile_lifetime, float, NONE) \
45 P(class, prefix, missile_proxy, float, NONE) \
46 P(class, prefix, missile_proxy_delay, float, NONE) \
47 P(class, prefix, missile_proxy_maxrange, float, NONE) \
48 P(class, prefix, missile_radius, float, NONE) \
49 P(class, prefix, missile_refire, float, NONE) \
50 P(class, prefix, missile_smart, float, NONE) \
51 P(class, prefix, missile_smart_mindist, float, NONE) \
52 P(class, prefix, missile_smart_trace_max, float, NONE) \
53 P(class, prefix, missile_smart_trace_min, float, NONE) \
54 P(class, prefix, missile_speed, float, NONE) \
55 P(class, prefix, missile_speed_max, float, NONE) \
56 P(class, prefix, missile_speed_up, float, NONE) \
57 P(class, prefix, missile_speed_z, float, NONE) \
58 P(class, prefix, missile_spread, float, NONE) \
59 P(class, prefix, missile_turnrate, float, NONE) \
60 P(class, prefix, reload_ammo, float, NONE) \
61 P(class, prefix, reload_time, float, NONE) \
62 P(class, prefix, switchdelay_drop, float, NONE) \
63 P(class, prefix, switchdelay_raise, float, NONE) \
64 P(class, prefix, tag_ammo, float, NONE) \
65 P(class, prefix, tag_animtime, float, NONE) \
66 P(class, prefix, tag_damageforcescale, float, NONE) \
67 P(class, prefix, tag_health, float, NONE) \
68 P(class, prefix, tag_lifetime, float, NONE) \
69 P(class, prefix, tag_refire, float, NONE) \
70 P(class, prefix, tag_speed, float, NONE) \
71 P(class, prefix, tag_spread, float, NONE) \
72 P(class, prefix, tag_tracker_lifetime, float, NONE) \
73 P(class, prefix, type, float, NONE) \
74 P(class, prefix, weaponreplace, string, NONE) \
75 P(class, prefix, weaponstartoverride, float, NONE) \
76 P(class, prefix, weaponstart, float, NONE) \
77 P(class, prefix, weaponthrowable, float, NONE) \
79 W_PROPS(X, Seeker, seeker)
82 REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
86 .entity tag_target, wps_tag_tracker;
92 spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); }
94 // ============================
95 // Begin: Missile functions, these are general functions to be manipulated by other code
96 // ============================
97 void W_Seeker_Missile_Explode(entity this)
99 this.event_damage = func_null;
100 RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other);
105 void W_Seeker_Missile_Touch(entity this, entity toucher)
107 PROJECTILE_TOUCH(this, toucher);
110 WITH(entity, other, toucher, W_Seeker_Missile_Explode(this));
113 void W_Seeker_Missile_Think(entity this)
116 vector desireddir, olddir, newdir, eorg;
123 this.projectiledeathtype |= HITTYPE_SPLASH;
124 W_Seeker_Missile_Explode(this);
127 spd = vlen(this.velocity);
129 spd - WEP_CVAR(seeker, missile_decel) * frametime,
130 WEP_CVAR(seeker, missile_speed_max),
131 spd + WEP_CVAR(seeker, missile_accel) * frametime
134 if(this.enemy != NULL)
135 if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
138 if(this.enemy != NULL)
141 eorg = 0.5 * (e.absmin + e.absmax);
142 turnrate = WEP_CVAR(seeker, missile_turnrate); // how fast to turn
143 desireddir = normalize(eorg - this.origin);
144 olddir = normalize(this.velocity); // get my current direction
145 dist = vlen(eorg - this.origin);
147 // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
148 if(WEP_CVAR(seeker, missile_smart) && (dist > WEP_CVAR(seeker, missile_smart_mindist)))
150 // Is it a better idea (shorter distance) to trace to the target itthis?
151 if( vdist(this.origin + olddir * this.wait, <, dist))
152 traceline(this.origin, this.origin + olddir * this.wait, false, this);
154 traceline(this.origin, eorg, false, this);
156 // Setup adaptive tracelength
157 this.wait = bound(WEP_CVAR(seeker, missile_smart_trace_min), vlen(this.origin - trace_endpos), this.wait = WEP_CVAR(seeker, missile_smart_trace_max));
159 // Calc how important it is that we turn and add this to the desierd (enemy) dir.
160 desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
163 newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
164 this.velocity = newdir * spd; // make me fly in the new direction at my flight speed
170 if(WEP_CVAR(seeker, missile_proxy))
172 if(dist <= WEP_CVAR(seeker, missile_proxy_maxrange))
174 if(this.autoswitch == 0)
176 this.autoswitch = time + WEP_CVAR(seeker, missile_proxy_delay);
180 if(this.autoswitch <= time)
182 W_Seeker_Missile_Explode(this);
189 if(this.autoswitch != 0)
195 if(IS_DEAD(this.enemy))
198 this.cnt = time + 1 + (random() * 4);
199 this.nextthink = this.cnt;
203 //this.angles = vectoangles(this.velocity); // turn model in the new flight direction
204 this.nextthink = time;// + 0.05; // csqc projectiles
205 UpdateCSQCProjectile(this);
210 void W_Seeker_Missile_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
215 if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
216 return; // g_projectiles_damage says to halt
218 if(this.realowner == attacker)
219 this.health = this.health - (damage * 0.25);
221 this.health = this.health - damage;
224 W_PrepareExplosionByDamage(this, attacker, W_Seeker_Missile_Explode);
228 void W_Seeker_Missile_Animate(entity this)
230 this.frame = this.frame +1;
231 this.nextthink = time + 0.05;
233 if(this.enemy != NULL)
234 if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
239 this.think = W_Seeker_Missile_Think;
240 this.nextthink = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
242 if(autocvar_g_balance_seeker_missile_proxy)
243 this.movetype = MOVETYPE_BOUNCEMISSILE;
245 this.movetype = MOVETYPE_FLYMISSILE;
248 UpdateCSQCProjectile(this);
252 void W_Seeker_Fire_Missile(Weapon thiswep, entity actor, vector f_diff, entity m_target)
256 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, missile_ammo));
258 makevectors(actor.v_angle);
259 W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_SEEKER_FIRE, CH_WEAPON_A, 0);
261 Send_Effect(EFFECT_SEEKER_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
263 //actor.detornator = false;
265 missile = new(seeker_missile);
266 missile.owner = missile.realowner = actor;
267 missile.bot_dodge = true;
268 missile.bot_dodgerating = WEP_CVAR(seeker, missile_damage);
270 setthink(missile, W_Seeker_Missile_Think);
271 settouch(missile, W_Seeker_Missile_Touch);
272 missile.event_damage = W_Seeker_Missile_Damage;
273 missile.nextthink = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
274 missile.cnt = time + WEP_CVAR(seeker, missile_lifetime);
275 missile.enemy = m_target;
276 missile.solid = SOLID_BBOX;
278 missile.takedamage = DAMAGE_YES;
279 missile.health = WEP_CVAR(seeker, missile_health);
280 missile.damageforcescale = WEP_CVAR(seeker, missile_damageforcescale);
281 missile.damagedbycontents = true;
282 //missile.think = W_Seeker_Missile_Animate; // csqc projectiles.
284 if(missile.enemy != NULL)
285 missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
287 missile.projectiledeathtype = WEP_SEEKER.m_id;
290 setorigin(missile, w_shotorg);
291 setsize(missile, '-4 -4 -4', '4 4 4');
292 missile.movetype = MOVETYPE_FLYMISSILE;
293 missile.flags = FL_PROJECTILE;
294 missile.missile_flags = MIF_SPLASH | MIF_GUIDED_TAG;
296 W_SetupProjVelocity_UP_PRE(missile, seeker, missile_);
298 missile.angles = vectoangles(missile.velocity);
300 CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
302 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
305 // ============================
306 // Begin: FLAC, close range attack meant for defeating rockets which are coming at you.
307 // ============================
308 void W_Seeker_Flac_Explode(entity this)
310 this.event_damage = func_null;
312 RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other);
317 void W_Seeker_Flac_Touch(entity this, entity toucher)
319 WITH(entity, other, toucher, W_Seeker_Flac_Explode(this));
322 void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
324 WITH(entity, other, trigger, W_Seeker_Flac_Explode(this));
327 void W_Seeker_Fire_Flac(Weapon thiswep, entity actor)
333 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, flac_ammo));
335 c = actor.bulletcounter % 4;
339 f_diff = '-1.25 -3.75 0';
342 f_diff = '+1.25 -3.75 0';
345 f_diff = '-1.25 +3.75 0';
349 f_diff = '+1.25 +3.75 0';
352 W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_FLAC_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, flac_damage));
355 Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
357 missile = new(missile);
358 missile.owner = missile.realowner = actor;
359 missile.bot_dodge = true;
360 missile.bot_dodgerating = WEP_CVAR(seeker, flac_damage);
361 settouch(missile, W_Seeker_Flac_Touch);
362 missile.use = W_Seeker_Flac_Explode_use;
363 setthink(missile, adaptor_think2use_hittype_splash);
364 missile.nextthink = time + WEP_CVAR(seeker, flac_lifetime) + WEP_CVAR(seeker, flac_lifetime_rand);
365 missile.solid = SOLID_BBOX;
366 missile.movetype = MOVETYPE_FLY;
367 missile.projectiledeathtype = WEP_SEEKER.m_id;
368 missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
369 missile.flags = FL_PROJECTILE;
370 missile.missile_flags = MIF_SPLASH;
373 //missile.angles = vectoangles(missile.velocity);
374 //missile.scale = 0.4; // BUG: the model is too big
376 setorigin(missile, w_shotorg);
377 setsize(missile, '-2 -2 -2', '2 2 2');
379 W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
380 CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
382 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
385 // ============================
386 // Begin: Tag and rocket controllers
387 // ============================
388 entity W_Seeker_Tagged_Info(entity isowner, entity istarget)
391 for(tag = NULL; (tag = find(tag, classname, "tag_tracker")); )
392 if((tag.realowner == isowner) && (tag.tag_target == istarget))
398 void W_Seeker_Attack(entity actor)
400 entity tracker, closest_target;
402 closest_target = NULL;
403 for(tracker = NULL; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor)
407 if(vlen2(actor.origin - tracker.tag_target.origin) < vlen2(actor.origin - closest_target.origin))
408 closest_target = tracker.tag_target;
411 closest_target = tracker.tag_target;
414 traceline(actor.origin + actor.view_ofs, closest_target.origin, MOVE_NOMONSTERS, actor);
415 if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
416 closest_target = NULL;
418 W_Seeker_Fire_Missile(WEP_SEEKER, actor, '0 0 0', closest_target);
421 void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
425 this.cnt = this.cnt - 1;
427 Weapon thiswep = WEP_SEEKER;
428 if((!(this.realowner.items & IT_UNLIMITED_AMMO) && this.realowner.(thiswep.ammo_field) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (PS(this.realowner).m_switchweapon != WEP_SEEKER))
434 this.nextthink = time + WEP_CVAR(seeker, missile_delay) * W_WeaponRateFactor(this.realowner);
436 entity own = this.realowner;
438 oldenemy = own.enemy;
439 own.enemy = this.enemy;
445 W_Seeker_Fire_Missile(WEP_SEEKER, own, '-1.25 -3.75 0', own.enemy);
448 W_Seeker_Fire_Missile(WEP_SEEKER, own, '+1.25 -3.75 0', own.enemy);
451 W_Seeker_Fire_Missile(WEP_SEEKER, own, '-1.25 +3.75 0', own.enemy);
455 W_Seeker_Fire_Missile(WEP_SEEKER, own, '+1.25 +3.75 0', own.enemy);
459 own.enemy = oldenemy;
462 void W_Seeker_Tracker_Think(entity this)
464 // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
465 if((IS_DEAD(this.realowner)) || (IS_DEAD(this.tag_target)) || (PS(this.realowner).m_switchweapon != WEP_SEEKER)
466 || (time > this.tag_time + WEP_CVAR(seeker, tag_tracker_lifetime)))
470 WaypointSprite_Kill(this.tag_target.wps_tag_tracker);
476 // Update the think method information
477 this.nextthink = time;
480 // ============================
481 // Begin: Tag projectile
482 // ============================
483 void W_Seeker_Tag_Explode(entity this)
485 //if(other==this.realowner)
487 Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE, other.species, this);
492 void W_Seeker_Tag_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
496 this.health = this.health - damage;
498 W_Seeker_Tag_Explode(this);
501 void W_Seeker_Tag_Touch(entity this, entity toucher)
507 PROJECTILE_TOUCH(this, toucher);
509 dir = normalize(this.realowner.origin - this.origin);
510 org2 = findbetterlocation(this.origin, 8);
512 te_knightspike(org2);
514 this.event_damage = func_null;
515 Damage_DamageInfo(this.origin, 0, 0, 0, this.velocity, WEP_SEEKER.m_id | HITTYPE_BOUNCE | HITTYPE_SECONDARY, toucher.species, this);
517 if(toucher.takedamage == DAMAGE_AIM && !IS_DEAD(toucher))
519 // check to see if this person is already tagged by me
520 entity tag = W_Seeker_Tagged_Info(this.realowner, toucher);
524 if(toucher.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
525 WaypointSprite_Kill(toucher.wps_tag_tracker);
531 //sprint(this.realowner, strcat("You just tagged ^2", toucher.netname, "^7 with a tracking device!\n"));
532 e = new(tag_tracker);
533 e.cnt = WEP_CVAR(seeker, missile_count);
534 e.owner = this.owner;
535 e.realowner = this.realowner;
537 if(WEP_CVAR(seeker, type) == 1)
539 e.tag_target = toucher;
541 setthink(e, W_Seeker_Tracker_Think);
546 setthink(e, W_Seeker_Vollycontroller_Think);
552 if(WEP_CVAR(seeker, type) == 1)
554 WaypointSprite_Spawn(WP_Seeker, WEP_CVAR(seeker, tag_tracker_lifetime), 0, toucher, '0 0 64', this.realowner, 0, toucher, wps_tag_tracker, true, RADARICON_TAGGED);
555 WaypointSprite_UpdateRule(toucher.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
563 void W_Seeker_Fire_Tag(Weapon thiswep, entity actor)
566 W_DecreaseAmmo(thiswep, actor, WEP_CVAR(seeker, tag_ammo));
568 W_SetupShot_ProjectileSize(actor, '-2 -2 -2', '2 2 2', false, 2, SND_TAG_FIRE, CH_WEAPON_A, WEP_CVAR(seeker, missile_damage) * WEP_CVAR(seeker, missile_count));
570 missile = new(seeker_tag);
571 missile.owner = missile.realowner = actor;
572 missile.bot_dodge = true;
573 missile.bot_dodgerating = 50;
574 settouch(missile, W_Seeker_Tag_Touch);
575 setthink(missile, SUB_Remove);
576 missile.nextthink = time + WEP_CVAR(seeker, tag_lifetime);
577 missile.movetype = MOVETYPE_FLY;
578 missile.solid = SOLID_BBOX;
580 missile.takedamage = DAMAGE_YES;
581 missile.event_damage = W_Seeker_Tag_Damage;
582 missile.health = WEP_CVAR(seeker, tag_health);
583 missile.damageforcescale = WEP_CVAR(seeker, tag_damageforcescale);
585 setorigin(missile, w_shotorg);
586 setsize(missile, '-2 -2 -2', '2 2 2');
588 missile.flags = FL_PROJECTILE;
589 //missile.missile_flags = MIF_..?;
591 missile.movetype = MOVETYPE_FLY;
592 W_SetupProjVelocity_PRE(missile, seeker, tag_);
593 missile.angles = vectoangles(missile.velocity);
595 CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
597 MUTATOR_CALLHOOK(EditProjectile, actor, missile);
600 // ============================
601 // Begin: Genereal weapon functions
602 // ============================
604 METHOD(Seeker, wr_aim, void(entity thiswep, entity actor))
606 if(WEP_CVAR(seeker, type) == 1)
607 if(W_Seeker_Tagged_Info(actor, actor.enemy) != NULL)
608 PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
610 PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
612 PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
614 METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
616 if(autocvar_g_balance_seeker_reload_ammo && actor.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload
617 thiswep.wr_reload(thiswep, actor, weaponentity);
620 if(WEP_CVAR(seeker, type) == 1)
622 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, missile_refire)))
624 W_Seeker_Attack(actor);
625 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, missile_animtime), w_ready);
630 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, tag_refire)))
632 W_Seeker_Fire_Tag(thiswep, actor);
633 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
640 if(WEP_CVAR(seeker, type) == 1)
642 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, tag_refire)))
644 W_Seeker_Fire_Tag(thiswep, actor);
645 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
650 if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(seeker, flac_refire)))
652 W_Seeker_Fire_Flac(thiswep, actor);
653 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR(seeker, flac_animtime), w_ready);
658 METHOD(Seeker, wr_checkammo1, bool(entity thiswep, entity actor))
661 if(WEP_CVAR(seeker, type) == 1)
663 ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(seeker, missile_ammo);
664 ammo_amount += actor.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, missile_ammo);
668 ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(seeker, tag_ammo);
669 ammo_amount += actor.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
673 METHOD(Seeker, wr_checkammo2, bool(entity thiswep, entity actor))
676 if(WEP_CVAR(seeker, type) == 1)
678 ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(seeker, tag_ammo);
679 ammo_amount += actor.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, tag_ammo);
683 ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(seeker, flac_ammo);
684 ammo_amount += actor.(weapon_load[WEP_SEEKER.m_id]) >= WEP_CVAR(seeker, flac_ammo);
688 METHOD(Seeker, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
690 W_Reload(actor, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND_RELOAD);
692 METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep))
694 return WEAPON_SEEKER_SUICIDE;
696 METHOD(Seeker, wr_killmessage, Notification(entity thiswep))
698 if(w_deathtype & HITTYPE_SECONDARY)
699 return WEAPON_SEEKER_MURDER_TAG;
701 return WEAPON_SEEKER_MURDER_SPRAY;
707 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
710 org2 = w_org + w_backoff * 6;
711 if(w_deathtype & HITTYPE_BOUNCE)
713 if(w_deathtype & HITTYPE_SECONDARY)
716 sound(actor, CH_SHOTS, SND_TAG_IMPACT, 1, ATTEN_NORM);
720 pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
724 sound(actor, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
725 else if(w_random<0.7)
726 sound(actor, CH_SHOTS, SND_TAGEXP2, 1, ATTEN_NORM);
728 sound(actor, CH_SHOTS, SND_TAGEXP3, 1, ATTEN_NORM);
734 pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
738 sound(actor, CH_SHOTS, SND_SEEKEREXP1, 1, ATTEN_NORM);
739 else if(w_random<0.7)
740 sound(actor, CH_SHOTS, SND_SEEKEREXP2, 1, ATTEN_NORM);
742 sound(actor, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM);