8 void W_Seeker_Missile_Explode(
entity this,
entity directhitentity)
11 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, this.
weaponentity_fld, directhitentity);
16 void W_Seeker_Missile_Explode_think(
entity this)
18 W_Seeker_Missile_Explode(
this,
NULL);
25 W_Seeker_Missile_Explode(
this, toucher);
28 void W_Seeker_Missile_Think(
entity this)
31 vector desireddir, olddir, newdir, eorg;
39 W_Seeker_Missile_Explode(
this,
NULL);
46 spd +
WEP_CVAR(seeker, missile_accel) * frametime
56 eorg = 0.5 * (e.absmin + e.absmax);
57 turnrate =
WEP_CVAR(seeker, missile_turnrate);
63 if(
WEP_CVAR(seeker, missile_smart) && (dist >
WEP_CVAR(seeker, missile_smart_mindist)))
67 traceline(this.
origin, this.
origin + olddir * this.wait,
false,
this);
69 traceline(this.
origin, eorg,
false,
this);
78 newdir =
normalize(olddir + desireddir * turnrate);
87 if(dist <=
WEP_CVAR(seeker, missile_proxy_maxrange))
89 if(this.cvar_cl_autoswitch == 0)
91 this.cvar_cl_autoswitch =
time +
WEP_CVAR(seeker, missile_proxy_delay);
95 if(this.cvar_cl_autoswitch <=
time)
97 W_Seeker_Missile_Explode(
this,
NULL);
98 this.cvar_cl_autoswitch = 0;
104 if(this.cvar_cl_autoswitch != 0)
105 this.cvar_cl_autoswitch = 0;
178 entity missile =
new(seeker_missile);
179 missile.owner = missile.realowner = actor;
180 missile.bot_dodge =
true;
181 missile.bot_dodgerating =
WEP_CVAR(seeker, missile_damage);
183 setthink(missile, W_Seeker_Missile_Think);
184 settouch(missile, W_Seeker_Missile_Touch);
185 missile.event_damage = W_Seeker_Missile_Damage;
186 missile.nextthink =
time;
187 missile.cnt =
time +
WEP_CVAR(seeker, missile_lifetime);
188 missile.enemy = m_target;
192 missile.weaponentity_fld = weaponentity;
194 missile.damageforcescale =
WEP_CVAR(seeker, missile_damageforcescale);
195 missile.damagedbycontents =
true;
199 if(missile.enemy !=
NULL)
202 missile.projectiledeathtype = thiswep.
m_id;
206 setsize(missile,
'-4 -4 -4',
'4 4 4');
208 missile.flags = FL_PROJECTILE;
225 void W_Seeker_Flac_Explode(
entity this,
entity directhitentity)
229 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, this.
weaponentity_fld, directhitentity);
236 W_Seeker_Flac_Explode(
this, toucher);
241 W_Seeker_Flac_Explode(
this, trigger);
256 f_diff =
'-1.25 -3.75 0';
259 f_diff =
'+1.25 -3.75 0';
262 f_diff =
'-1.25 +3.75 0';
266 f_diff =
'+1.25 +3.75 0';
269 W_SetupShot_ProjectileSize(actor, weaponentity,
'-2 -2 -2',
'2 2 2',
false, 2, SND_FLAC_FIRE,
CH_WEAPON_A,
WEP_CVAR(seeker, flac_damage), thiswep.
m_id |
HITTYPE_SECONDARY);
275 missile =
new(missile);
276 missile.owner = missile.realowner = actor;
277 missile.bot_dodge =
true;
278 missile.bot_dodgerating =
WEP_CVAR(seeker, flac_damage);
279 settouch(missile, W_Seeker_Flac_Touch);
280 missile.use = W_Seeker_Flac_Explode_use;
282 missile.nextthink =
time +
WEP_CVAR(seeker, flac_lifetime) +
WEP_CVAR(seeker, flac_lifetime_rand);
286 missile.weaponentity_fld = weaponentity;
287 missile.flags = FL_PROJECTILE;
297 setsize(missile,
'-2 -2 -2',
'2 2 2');
310 IL_EACH(g_seeker_trackers, it.classname ==
"tag_tracker" && it.realowner == isowner,
312 if(it.tag_target == istarget && it.weaponentity_fld == weaponentity)
323 IL_EACH(g_seeker_trackers, it.classname ==
"tag_tracker" && it.realowner == actor,
327 if(vlen2(actor.origin - it.tag_target.origin) < vlen2(actor.origin - closest_target.origin))
328 closest_target = it.tag_target;
331 closest_target = it.tag_target;
336 traceline(actor.origin + actor.view_ofs, closest_target.origin,
MOVE_NOMONSTERS, actor);
338 closest_target =
NULL;
341 W_Seeker_Fire_Missile(thiswep, actor, weaponentity,
'0 0 0', closest_target);
344 void W_Seeker_Vollycontroller_Think(
entity this)
348 Weapon thiswep = WEP_SEEKER;
360 entity oldenemy = own.enemy;
361 own.enemy = this.
enemy;
366 W_Seeker_Fire_Missile(thiswep, own, weaponentity,
'-1.25 -3.75 0', own.enemy);
369 W_Seeker_Fire_Missile(thiswep, own, weaponentity,
'+1.25 -3.75 0', own.enemy);
372 W_Seeker_Fire_Missile(thiswep, own, weaponentity,
'-1.25 +3.75 0', own.enemy);
376 W_Seeker_Fire_Missile(thiswep, own, weaponentity,
'+1.25 +3.75 0', own.enemy);
380 own.enemy = oldenemy;
383 void W_Seeker_Tracker_Think(
entity this)
388 || (
time > this.tag_time +
WEP_CVAR(seeker, tag_tracker_lifetime)))
392 WaypointSprite_Kill(this.tag_target.wps_tag_tracker);
405 void W_Seeker_Tag_Explode(
entity this)
420 W_Seeker_Tag_Explode(
this);
432 org2 = findbetterlocation(this.
origin, 8);
434 te_knightspike(org2);
443 entity tag = W_Seeker_Tagged_Info(this.
realowner, weaponentity, toucher);
447 if(toucher.wps_tag_tracker && (
WEP_CVAR(seeker, type) == 1))
448 WaypointSprite_Kill(toucher.wps_tag_tracker);
455 e =
new(tag_tracker);
457 e.cnt =
WEP_CVAR(seeker, missile_count);
458 e.owner = this.
owner;
464 e.tag_target = toucher;
466 setthink(e, W_Seeker_Tracker_Think);
471 setthink(e, W_Seeker_Vollycontroller_Think);
479 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);
492 W_SetupShot_ProjectileSize(actor, weaponentity,
'-2 -2 -2',
'2 2 2',
false, 2, SND_TAG_FIRE,
CH_WEAPON_A,
WEP_CVAR(seeker, missile_damage) *
WEP_CVAR(seeker, missile_count), thiswep.
m_id |
HITTYPE_BOUNCE |
HITTYPE_SECONDARY);
494 entity missile =
new(seeker_tag);
495 missile.weaponentity_fld = weaponentity;
496 missile.owner = missile.realowner = actor;
497 missile.bot_dodge =
true;
498 missile.bot_dodgerating = 50;
499 settouch(missile, W_Seeker_Tag_Touch);
501 missile.nextthink =
time +
WEP_CVAR(seeker, tag_lifetime);
506 missile.event_damage = W_Seeker_Tag_Damage;
508 missile.damageforcescale =
WEP_CVAR(seeker, tag_damageforcescale);
511 setsize(missile,
'-2 -2 -2',
'2 2 2');
513 missile.flags = FL_PROJECTILE;
535 if(W_Seeker_Tagged_Info(actor, weaponentity, actor.enemy) !=
NULL)
545 if(autocvar_g_balance_seeker_reload_ammo && actor.(weaponentity).clip_load <
min(
WEP_CVAR(seeker, missile_ammo),
WEP_CVAR(seeker, tag_ammo))) {
546 thiswep.wr_reload(thiswep, actor, weaponentity);
553 W_Seeker_Attack(thiswep, actor, weaponentity);
561 W_Seeker_Fire_Tag(thiswep, actor, weaponentity);
573 W_Seeker_Fire_Tag(thiswep, actor, weaponentity);
581 W_Seeker_Fire_Flac(thiswep, actor, weaponentity);
593 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(seeker, missile_ammo);
598 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(seeker, tag_ammo);
608 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(seeker, tag_ammo);
613 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(seeker, flac_ammo);
623 return WEAPON_SEEKER_SUICIDE;
628 return WEAPON_SEEKER_MURDER_TAG;
630 return WEAPON_SEEKER_MURDER_SPRAY;
639 org2 = w_org + w_backoff * 6;
654 else if(w_random<0.7)
668 else if(w_random<0.7)
const int HITTYPE_SPLASH
automatically set by RadiusDamage
#define PHYS_INPUT_BUTTON_ATCK2(s)
#define IL_EACH(this, cond, body)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
float weapon_load[REGISTRY_MAX(Weapons)]
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
const int SPRITERULE_DEFAULT
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
IntrusiveList g_damagedbycontents
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define WEP_CVAR(wepname, name)
#define W_SetupProjVelocity_PRE(ent, wepname, prefix)
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
#define W_SetupProjVelocity_UP_PRE(ent, wepname, prefix)
IntrusiveList g_bot_dodge
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define PROJECTILE_TOUCH(e, t)
const float MOVE_NOMONSTERS
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void UpdateCSQCProjectile(entity e)
Resource ammo_type
M: ammotype : main ammo type.
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
#define PHYS_INPUT_BUTTON_ATCK(s)
const int HITTYPE_SECONDARY
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float MOVETYPE_FLYMISSILE
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
const int PROJECTILE_SEEKER
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const int PROJECTILE_FLAC
entity Notification
always last
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
#define MUTATOR_CALLHOOK(id,...)
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
vector trace_plane_normal
void adaptor_think2use_hittype_splash(entity this)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float W_WeaponRateFactor(entity this)
void set_movetype(entity this, int mt)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)