58 bool is_linkexplode = (inflictor.owner !=
NULL ? inflictor.owner == this.
owner :
true)
59 && (
HITTYPE_SECONDARY & inflictor.projectiledeathtype &
this.projectiledeathtype);
62 is_linkexplode =
WEP_CVAR_SEC(WEP_HAGAR, load_linkexplode);
107 missile =
new(missile);
108 missile.owner = missile.realowner = actor;
109 missile.bot_dodge =
true;
110 missile.bot_dodgerating =
WEP_CVAR_PRI(WEP_HAGAR, damage);
116 missile.damagedbycontents =
true;
124 missile.projectiledeathtype = thiswep.
m_id;
125 missile.weaponentity_fld = weaponentity;
127 setsize(missile,
'0 0 0',
'0 0 0');
152 missile =
new(missile);
153 missile.owner = missile.realowner = actor;
154 missile.bot_dodge =
true;
155 missile.bot_dodgerating =
WEP_CVAR_SEC(WEP_HAGAR, damage);
161 missile.damagedbycontents =
true;
171 missile.weaponentity_fld = weaponentity;
173 setsize(missile,
'0 0 0',
'0 0 0');
195 if (!actor.(weaponentity).hagar_load)
201 float shots = actor.(weaponentity).
hagar_load;
209 float spread_pershot;
210 for (
int counter = 0; counter < shots; ++counter)
212 missile =
new(missile);
213 missile.owner = missile.realowner = actor;
214 missile.bot_dodge =
true;
215 missile.bot_dodgerating =
WEP_CVAR_SEC(WEP_HAGAR, damage);
221 missile.damagedbycontents =
true;
230 missile.weaponentity_fld = weaponentity;
232 setsize(missile,
'0 0 0',
'0 0 0');
237 spread_pershot = ((shots - 1) / (
WEP_CVAR_SEC(WEP_HAGAR, load_max) - 1));
238 spread_pershot = (1 - (spread_pershot *
WEP_CVAR_SEC(WEP_HAGAR, load_spread_bias)));
275 else if (autocvar_g_balance_hagar_reload_ammo)
280 bool stopped = loaded || !enough_ammo;
286 if (actor.(weaponentity).hagar_load)
305 && !actor.(weaponentity).hagar_loadblock && actor.(weaponentity).hagar_loadstep <
time)
312 if (actor.(weaponentity).hagar_load >=
WEP_CVAR_SEC(WEP_HAGAR, load_max))
317 if (stopped && !actor.(weaponentity).hagar_loadbeep && actor.(weaponentity).hagar_load)
326 else if (actor.(weaponentity).hagar_loadblock)
332 if (actor.(weaponentity).hagar_load)
335 if (stopped && actor.(weaponentity).hagar_loadstep - 0.5 <
time &&
WEP_CVAR_SEC(WEP_HAGAR, load_hold) >= 0
336 && !actor.(weaponentity).hagar_warning)
345 || (stopped && actor.(weaponentity).hagar_loadstep <
time &&
WEP_CVAR_SEC(WEP_HAGAR, load_hold) >= 0))
369 if (!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock
372 w_ready(thiswep, actor, weaponentity, fire);
380 w_ready(thiswep, actor, weaponentity, fire);
387 actor.(weaponentity).
wframe = WFRAME_FIRE1;
402 if (loadable_secondary)
406 thiswep.wr_reload(thiswep, actor, weaponentity);
407 else if ((fire & 1) && !actor.(weaponentity).hagar_load && !actor.(weaponentity).hagar_loadblock)
412 else if ((fire & 2) && !loadable_secondary &&
WEP_CVAR(WEP_HAGAR, secondary))
425 if (actor.(weaponentity).hagar_load)
435 if (actor.(weaponentity).hagar_load)
468 if (actor.(weaponentity).hagar_load &&
WEP_CVAR_SEC(WEP_HAGAR, load_releasedeath))
474 if (!actor.(weaponentity).hagar_load)
480 return WEAPON_HAGAR_SUICIDE;
486 return WEAPON_HAGAR_MURDER_BURST;
488 return WEAPON_HAGAR_MURDER_SPRAY;
510 PAR(_(
"The %s rapidly fires small propelled rockets forwards, dealing some splash damage on impact."),
COLORED_NAME(
this));
511 PAR(_(
"When the secondary fire is held, multiple rockets are loaded up, and they're shot at the same time when released. "
512 "These rockets can't be held forever, so it will fire itself after some time (after a warning beep) if the secondary fire isn't released."));
513 PAR(_(
"It consumes %s ammo for each rocket."),
COLORED_NAME(ITEM_Rockets));
514 PAR(_(
"The %s works best over close to medium ranges, since it's hard to land hits at a long distance. "
515 "A common usage is fully loading the secondary fire before turning a corner, so you can surprise any enemies around the corner with a bunch of rockets to the face."),
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,...)
vector W_CalculateSpreadPattern(int pattern, float bias, int counter, int total)
float autocvar_g_weaponspreadfactor
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.
virtual void wr_checkammo2()
(SERVER) checks ammo for weapon second
virtual void wr_checkammo1()
(SERVER) checks ammo for weapon primary
#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)
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 W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
const int HITTYPE_SECONDARY
#define pointparticles(effect, org, vel, howmany)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
void W_Hagar_Explode_use(entity this, entity actor, entity trigger)
void W_Hagar_Attack2(Weapon thiswep, entity actor,.entity weaponentity)
void W_Hagar_Attack_Auto(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Hagar_Attack(Weapon thiswep, entity actor,.entity weaponentity)
void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor,.entity weaponentity)
void W_Hagar_Explode2_use(entity this, entity actor, entity trigger)
void W_Hagar_Explode(entity this, entity directhitentity)
void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_Hagar_Touch2(entity this, entity toucher)
void W_Hagar_Attack2_Load(Weapon thiswep, entity actor,.entity weaponentity)
void W_Hagar_Explode2(entity this, entity directhitentity)
void W_Hagar_Touch(entity this, entity toucher)
Sound SND_HAGEXP_RANDOM(float rnd)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
entity Notification
always last
#define METHOD(cname, name, prototype)
const int PROJECTILE_HAGAR
const int PROJECTILE_HAGAR_BOUNCING
float health
Legacy fields for the resources. To be removed.
void W_SwitchToOtherWeapon(entity this,.entity weaponentity)
Perform weapon to attack (weaponstate and attack_finished check is here)
#define w_getbestweapon(ent, wepent)
const float TIMEOUT_ACTIVE
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 PROJECTILE_MAKETRIGGER(e)
#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...
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
#define W_SetupProjVelocity_SEC(ent, wep)
#define W_SetupProjVelocity_PRI(ent, wep)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_secondaryMultishot(string name, string pri, string sec, string shots, string refire2, bool sec_variable)
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_SEC(wep, name)
const int MAX_WEAPONSLOTS
const int WS_READY
idle frame
entity weaponentities[MAX_WEAPONSLOTS]
const int WS_INUSE
fire state
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)
bool weaponUseForbidden(entity player)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void weapon_prepareattack_do(entity actor,.entity weaponentity, bool secondary, float attacktime)
bool weapon_prepareattack_check(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
#define ATTACK_FINISHED(ent, w)
float weapon_load[REGISTRY_MAX(Weapons)]