10 RadiusDamage(
this, this.
realowner,
WEP_CVAR_PRI(hagar, damage),
WEP_CVAR_PRI(hagar, edgedamage),
WEP_CVAR_PRI(hagar,
radius),
NULL,
NULL,
WEP_CVAR_PRI(hagar, force), this.
projectiledeathtype, this.
weaponentity_fld, directhitentity);
17 W_Hagar_Explode(
this, trigger);
20 void W_Hagar_Explode2(
entity this,
entity directhitentity)
23 RadiusDamage(
this, this.
realowner,
WEP_CVAR_SEC(hagar, damage),
WEP_CVAR_SEC(hagar, edgedamage),
WEP_CVAR_SEC(hagar,
radius),
NULL,
NULL,
WEP_CVAR_SEC(hagar, force), this.
projectiledeathtype, this.
weaponentity_fld, directhitentity);
30 W_Hagar_Explode2(
this, trigger);
38 float is_linkexplode = ( ((inflictor.owner !=
NULL) ? (inflictor.owner ==
this.owner) :
true)
43 is_linkexplode = (is_linkexplode &&
WEP_CVAR_SEC(hagar, load_linkexplode));
88 missile =
new(missile);
89 missile.owner = missile.realowner = actor;
90 missile.bot_dodge =
true;
96 missile.event_damage = W_Hagar_Damage;
97 missile.damagedbycontents =
true;
100 settouch(missile, W_Hagar_Touch);
101 missile.use = W_Hagar_Explode_use;
105 missile.projectiledeathtype = thiswep.
m_id;
106 missile.weaponentity_fld = weaponentity;
108 setsize(missile,
'0 0 0',
'0 0 0');
114 missile.flags = FL_PROJECTILE;
134 missile =
new(missile);
135 missile.owner = missile.realowner = actor;
136 missile.bot_dodge =
true;
142 missile.event_damage = W_Hagar_Damage;
143 missile.damagedbycontents =
true;
146 settouch(missile, W_Hagar_Touch2);
148 missile.use = W_Hagar_Explode2_use;
153 missile.weaponentity_fld = weaponentity;
155 setsize(missile,
'0 0 0',
'0 0 0');
161 missile.flags = FL_PROJECTILE;
171 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
177 float counter, shots, spread_pershot;
179 vector forward, right, up;
181 if(!actor.(weaponentity).hagar_load)
195 for(counter = 0; counter < shots; ++counter)
197 missile =
new(missile);
198 missile.owner = missile.realowner = actor;
199 missile.bot_dodge =
true;
205 missile.event_damage = W_Hagar_Damage;
206 missile.damagedbycontents =
true;
209 settouch(missile, W_Hagar_Touch);
210 missile.use = W_Hagar_Explode2_use;
215 missile.weaponentity_fld = weaponentity;
217 setsize(missile,
'0 0 0',
'0 0 0');
222 spread_pershot = ((shots - 1) / (
WEP_CVAR_SEC(hagar, load_max) - 1));
223 spread_pershot = (1 - (spread_pershot *
WEP_CVAR_SEC(hagar, load_spread_bias)));
232 makevectors(
'0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
241 missile.flags = FL_PROJECTILE;
267 if(actor.items & IT_UNLIMITED_AMMO)
269 else if(autocvar_g_balance_hagar_reload_ammo)
274 bool stopped = loaded || !enough_ammo;
280 if(actor.(weaponentity).hagar_load)
292 actor.(weaponentity).hagar_loadblock =
true;
300 if(!actor.(weaponentity).hagar_loadblock && actor.(weaponentity).hagar_loadstep <
time)
307 if(actor.(weaponentity).hagar_load >=
WEP_CVAR_SEC(hagar, load_max))
313 if(stopped && !actor.(weaponentity).hagar_loadbeep && actor.(weaponentity).
hagar_load)
317 actor.(weaponentity).hagar_loadbeep =
true;
322 else if(actor.(weaponentity).hagar_loadblock)
325 actor.(weaponentity).hagar_loadblock =
false;
328 if(actor.(weaponentity).hagar_load)
331 if(stopped && actor.(weaponentity).hagar_loadstep - 0.5 <
time &&
WEP_CVAR_SEC(hagar, load_hold) >= 0)
333 if(!actor.(weaponentity).hagar_warning)
337 actor.(weaponentity).hagar_warning =
true;
345 W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
350 actor.(weaponentity).hagar_loadbeep =
false;
351 actor.(weaponentity).hagar_warning =
false;
354 if(!(thiswep.wr_checkammo1(thiswep, actor, weaponentity) + thiswep.wr_checkammo2(thiswep, actor, weaponentity)))
355 if(!(actor.items & IT_UNLIMITED_AMMO))
364 void W_Hagar_Attack_Auto(
Weapon thiswep,
entity actor, .
entity weaponentity,
int fire)
366 if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock || actor.(weaponentity).m_switchweapon != thiswep || !
weapon_prepareattack_check(thiswep, actor, weaponentity,
false, -1))
368 w_ready(thiswep, actor, weaponentity, fire);
372 if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
373 if(!(actor.items & IT_UNLIMITED_AMMO))
376 w_ready(thiswep, actor, weaponentity, fire);
380 W_Hagar_Attack(thiswep, actor, weaponentity);
383 actor.(weaponentity).wframe = WFRAME_FIRE1;
396 float loadable_secondary;
399 if(loadable_secondary)
400 W_Hagar_Attack2_Load(thiswep, actor, weaponentity);
402 thiswep.wr_reload(thiswep, actor, weaponentity);
404 else if((fire & 1) && !actor.(weaponentity).hagar_load && !actor.(weaponentity).hagar_loadblock)
407 W_Hagar_Attack_Auto(thiswep, actor, weaponentity, fire);
409 else if((fire & 2) && !loadable_secondary &&
WEP_CVAR(hagar, secondary))
413 W_Hagar_Attack2(thiswep, actor, weaponentity);
421 if(actor.(weaponentity).hagar_load)
424 W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
429 actor.(weaponentity).hagar_loadblock =
false;
430 if(actor.(weaponentity).hagar_load)
459 if(actor.(weaponentity).hagar_load &&
WEP_CVAR_SEC(hagar, load_releasedeath))
460 W_Hagar_Attack2_Load_Release(thiswep, actor, weaponentity);
464 if(!actor.(weaponentity).hagar_load)
469 return WEAPON_HAGAR_SUICIDE;
474 return WEAPON_HAGAR_MURDER_BURST;
476 return WEAPON_HAGAR_MURDER_SPRAY;
485 org2 = w_org + w_backoff * 6;
491 else if(w_random<0.7)
#define WEP_CVAR_PRI(wepname, name)
#define PHYS_INPUT_BUTTON_ATCK2(s)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
#define WEP_CVAR_SEC(wepname, name)
float weapon_load[REGISTRY_MAX(Weapons)]
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
#define PROJECTILE_MAKETRIGGER(e)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
bool weaponUseForbidden(entity player)
#define w_getbestweapon(ent, wepent)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
#define W_SetupProjVelocity_SEC(ent, wepname)
IntrusiveList g_damagedbycontents
float MOVETYPE_BOUNCEMISSILE
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define WEP_CVAR(wepname, name)
bool weapon_prepareattack_check(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
const float TIMEOUT_ACTIVE
#define METHOD(cname, name, prototype)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
const int PROJECTILE_HAGAR
const int WS_READY
idle frame
IntrusiveList g_bot_dodge
const int PROJECTILE_HAGAR_BOUNCING
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define PROJECTILE_TOUCH(e, t)
#define W_SetupProjVelocity_PRI(ent, wepname)
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
const int MAX_WEAPONSLOTS
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
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_g_weaponspreadfactor
IntrusiveList g_projectiles
const int WS_INUSE
fire state
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
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,...)
entity weaponentities[MAX_WEAPONSLOTS]
#define ATTACK_FINISHED(ent, w)
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)
void weapon_prepareattack_do(entity actor,.entity weaponentity, bool secondary, float attacktime)
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)