11 RadiusDamage(
this, this.
realowner,
WEP_CVAR(WEP_SEEKER, missile_damage),
WEP_CVAR(WEP_SEEKER, missile_edgedamage),
WEP_CVAR(WEP_SEEKER, missile_radius),
NULL,
NULL,
WEP_CVAR(WEP_SEEKER, missile_force), this.
projectiledeathtype, this.
weaponentity_fld, directhitentity);
31 vector desireddir, olddir, newdir, eorg;
45 WEP_CVAR(WEP_SEEKER, missile_speed_max),
56 eorg = 0.5 * (e.absmin + e.absmax);
57 turnrate =
WEP_CVAR(WEP_SEEKER, missile_turnrate);
63 if(
WEP_CVAR(WEP_SEEKER, missile_smart) && (dist >
WEP_CVAR(WEP_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);
85 if(
WEP_CVAR(WEP_SEEKER, missile_proxy))
87 if(dist <=
WEP_CVAR(WEP_SEEKER, missile_proxy_maxrange))
89 if(this.cvar_cl_autoswitch == 0)
91 this.cvar_cl_autoswitch =
time +
WEP_CVAR(WEP_SEEKER, missile_proxy_delay);
95 if(this.cvar_cl_autoswitch <=
time)
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(WEP_SEEKER, missile_damage);
186 missile.nextthink =
time;
187 missile.cnt =
time +
WEP_CVAR(WEP_SEEKER, missile_lifetime);
188 missile.enemy = m_target;
192 missile.weaponentity_fld = weaponentity;
194 missile.damageforcescale =
WEP_CVAR(WEP_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');
229 RadiusDamage(
this, this.
realowner,
WEP_CVAR(WEP_SEEKER, flac_damage),
WEP_CVAR(WEP_SEEKER, flac_edgedamage),
WEP_CVAR(WEP_SEEKER, flac_radius),
NULL,
NULL,
WEP_CVAR(WEP_SEEKER, flac_force), this.
projectiledeathtype, this.
weaponentity_fld, directhitentity);
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_SEEKER_FLAC_FIRE,
CH_WEAPON_A,
WEP_CVAR(WEP_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(WEP_SEEKER, flac_damage);
282 missile.nextthink =
time +
WEP_CVAR(WEP_SEEKER, flac_lifetime) +
WEP_CVAR(WEP_SEEKER, flac_lifetime_rand);
286 missile.weaponentity_fld = weaponentity;
297 setsize(missile,
'-2 -2 -2',
'2 2 2');
312 if(it.tag_target == istarget && it.weaponentity_fld == weaponentity)
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;
348 Weapon thiswep = WEP_SEEKER;
360 entity oldenemy = own.enemy;
361 own.enemy = this.
enemy;
380 own.enemy = oldenemy;
388 || (
time >
this.tag_time +
WEP_CVAR(WEP_SEEKER, tag_tracker_lifetime)))
434 te_knightspike(org2);
455 e =
new(tag_tracker);
457 e.cnt =
WEP_CVAR(WEP_SEEKER, missile_count);
458 e.owner = this.
owner;
479 WaypointSprite_Spawn(WP_Seeker,
WEP_CVAR(WEP_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(WEP_SEEKER, missile_damage) *
WEP_CVAR(WEP_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;
501 missile.nextthink =
time +
WEP_CVAR(WEP_SEEKER, tag_lifetime);
508 missile.damageforcescale =
WEP_CVAR(WEP_SEEKER, tag_damageforcescale);
511 setsize(missile,
'-2 -2 -2',
'2 2 2');
546 if(autocvar_g_balance_seeker_reload_ammo && actor.(weaponentity).clip_load <
min(
WEP_CVAR(WEP_SEEKER, missile_ammo),
WEP_CVAR(WEP_SEEKER, tag_ammo))) {
547 thiswep.wr_reload(thiswep, actor, weaponentity);
595 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(WEP_SEEKER, missile_ammo);
600 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(WEP_SEEKER, tag_ammo);
611 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(WEP_SEEKER, tag_ammo);
616 ammo_amount += actor.(weaponentity).(
weapon_load[thiswep.m_id]) >=
WEP_CVAR(WEP_SEEKER, flac_ammo);
628 return WEAPON_SEEKER_SUICIDE;
634 return WEAPON_SEEKER_MURDER_TAG;
636 return WEAPON_SEEKER_MURDER_SPRAY;
675 PAR(_(
"The %s is a unique weapon, firing a \"tag\" which then launches a few homing missiles if it collides with a player. "
676 "The homing isn't perfect, so sometimes the missiles can hit an object or a corner."),
COLORED_NAME(
this));
677 PAR(_(
"The secondary fire launches a rapid barrage of scattered explosives that travel only a short distance."));
678 PAR(_(
"It consumes %s ammo, even when the tag doesn't land."),
COLORED_NAME(ITEM_Rockets));
679 PAR(_(
"The %s primary fire deals quite a lot of damage when a tag lands, although it requires skill to aim effectively. "
680 "The secondary fire is only useful in close range combat, and sometimes the explosives can damage yourself too."),
COLORED_NAME(
this));
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
IntrusiveList g_bot_dodge
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Resource ammo_type
M: ammotype : main ammo type.
#define COLORED_NAME(this)
const int IT_UNLIMITED_AMMO
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float W_WeaponRateFactor(entity this)
vector findbetterlocation(vector org, float mindist)
const float MOVE_NOMONSTERS
vector trace_plane_normal
void UpdateCSQCProjectile(entity e)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
IntrusiveList g_damagedbycontents
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
const int HITTYPE_SECONDARY
void SUB_Remove(entity this)
Remove entity.
#define pointparticles(effect, org, vel, howmany)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
void set_movetype(entity this, int mt)
const int MOVETYPE_FLYMISSILE
entity Notification
always last
#define METHOD(cname, name, prototype)
const int PROJECTILE_FLAC
const int PROJECTILE_SEEKER
void W_Seeker_Vollycontroller_Think(entity this)
void W_Seeker_Fire_Flac(Weapon thiswep, entity actor,.entity weaponentity)
void W_Seeker_Fire_Tag(Weapon thiswep, entity actor,.entity weaponentity)
void W_Seeker_Flac_Explode(entity this, entity directhitentity)
void W_Seeker_Tag_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Seeker_Missile_Think(entity this)
void W_Seeker_Missile_Touch(entity this, entity toucher)
void W_Seeker_Flac_Explode_use(entity this, entity actor, entity trigger)
void W_Seeker_Fire_Missile(Weapon thiswep, entity actor,.entity weaponentity, vector f_diff, entity m_target)
entity W_Seeker_Tagged_Info(entity isowner,.entity weaponentity, entity istarget)
void W_Seeker_Tag_Touch(entity this, entity toucher)
void W_Seeker_Missile_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Seeker_Flac_Touch(entity this, entity toucher)
void W_Seeker_Missile_Explode(entity this, entity directhitentity)
void W_Seeker_Missile_Explode_think(entity this)
void W_Seeker_Tracker_Think(entity this)
void W_Seeker_Tag_Explode(entity this)
void W_Seeker_Attack(Weapon thiswep, entity actor,.entity weaponentity)
Sound SND_SEEKEREXP_RANDOM(float rnd)
Sound SND_TAGEXP_RANDOM(float rnd)
IntrusiveList g_seeker_trackers
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
void adaptor_think2use_hittype_splash(entity this)
#define PROJECTILE_TOUCH(e, t)
IntrusiveList g_projectiles
#define sound(e, c, s, v, a)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
#define W_SetupProjVelocity_PRE(ent, wep, prefix)
#define W_SetupProjVelocity_UP_PRE(ent, wep, prefix)
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void WaypointSprite_Kill(entity wp)
entity WaypointSprite_Spawn(entity spr, float _lifetime, float maxdistance, entity ref, vector ofs, entity showto, float t, entity own,.entity ownfield, float hideable, entity icon)
void WaypointSprite_UpdateRule(entity e, float t, float r)
const int SPRITERULE_DEFAULT
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_primaryMultishot(string name, string pri, string sec, string shots, string refire2)
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
#define WEP_CVAR(wep, name)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float weapon_load[REGISTRY_MAX(Weapons)]