void Draw_ShowNames_All()
{
+ SELFPARAM();
if (!autocvar_hud_shownames) return;
LL_EACH(shownames_ent, true, {
entity entcs = entcs_receiver(i);
void SUB_RemoveOnNoImpact()
{
+ SELFPARAM();
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
Gib_Delete(self);
}
METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
{
+ SELFPARAM();
TC(BallStealer, thiswep);
if(fire & 1)
if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
MUTATOR_HOOKFUNCTION(ons, SendWaypoint)
{
+ SELFPARAM();
if(wp_sendflags & 16)
{
if(self.owner.classname == "onslaught_controlpoint")
MUTATOR_HOOKFUNCTION(ons, TurretThink)
{
+ SELFPARAM();
// ONS uses somewhat backwards linking.
if(self.target)
{
void snake_move_head(entity minigame, entity head);
void snake_head_think()
{
+ SELFPARAM();
entity minigame = self.owner;
if(minigame.minigame_flags & SNAKE_TURN_MOVE)
void M_Mage_Attack_Spike_Touch()
{
+ SELFPARAM();
PROJECTILE_TOUCH;
M_Mage_Attack_Spike_Explode(self);
MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
{
+ SELFPARAM();
if (time >= self.spider_slowness)
return false;
PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider
MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)
{
+ SELFPARAM();
if(time < self.spider_slowness)
{
monster_speed_run *= 0.5;
MUTATOR_HOOKFUNCTION(spiderweb, PlayerSpawn)
{
+ SELFPARAM();
self.spider_slowness = 0;
return false;
}
MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn)
{
+ SELFPARAM();
self.spider_slowness = 0;
return false;
}
SOUND(SpiderAttack_FIRE, W_Sound("electro_fire"));
METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire))
{
+ SELFPARAM();
TC(SpiderAttack, thiswep);
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
void Monster_Delay_Action_self()
{
+ SELFPARAM();
Monster_Delay_Action(self);
}
return false;
}
-MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver) { return buffs_RemovePlayer(self); }
-MUTATOR_HOOKFUNCTION(buffs, ClientDisconnect) { return buffs_RemovePlayer(self); }
+MUTATOR_HOOKFUNCTION(buffs, MakePlayerObserver) { SELFPARAM(); return buffs_RemovePlayer(self); }
+MUTATOR_HOOKFUNCTION(buffs, ClientDisconnect) { SELFPARAM(); return buffs_RemovePlayer(self); }
MUTATOR_HOOKFUNCTION(buffs, CustomizeWaypoint)
{SELFPARAM();
#endif
MUTATOR_HOOKFUNCTION(bugrigs, PM_Physics)
{
+ SELFPARAM();
if(!PHYS_BUGRIGS(self) || !IS_PLAYER(self)) { return false; }
#ifdef SVQC
MUTATOR_HOOKFUNCTION(bugrigs, PlayerPhysics)
{
+ SELFPARAM();
if(!PHYS_BUGRIGS(self)) { return false; }
#ifdef SVQC
self.bugrigs_prevangles = self.angles;
MUTATOR_HOOKFUNCTION(bugrigs, ClientConnect)
{
+ SELFPARAM();
stuffcmd(self, "cl_cmd settemp chase_active 1\n");
return false;
}
MUTATOR_HOOKFUNCTION(dodging, PlayerPhysics)
{
+ SELFPARAM();
// print("dodging_PlayerPhysics\n");
PM_dodging_GetPressedKeys(self);
PM_dodging(self);
MUTATOR_HOOKFUNCTION(dodging, GetPressedKeys)
{
+ SELFPARAM();
PM_dodging_checkpressedkeys(self);
return false;
}
MUTATOR_HOOKFUNCTION(doublejump, PlayerJump)
{
+ SELFPARAM();
if (PHYS_DOUBLEJUMP(self))
{
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
MUTATOR_HOOKFUNCTION(hook, FilterItem)
{
+ SELFPARAM();
return self.weapon == WEP_HOOK.m_id;
}
MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics)
{
+ SELFPARAM();
#ifdef CSQC
self.multijump_count = PHYS_MULTIJUMP_COUNT(self);
#endif
MUTATOR_HOOKFUNCTION(multijump, PlayerJump)
{
+ SELFPARAM();
return PM_multijump_checkjump(self);
}
}
MUTATOR_HOOKFUNCTION(cl_nades, Ent_Projectile)
{
+ SELFPARAM();
if (self.cnt == PROJECTILE_NAPALM_FOUNTAIN)
{
self.modelindex = 0;
}
MUTATOR_HOOKFUNCTION(cl_nades, EditProjectile)
{
+ SELFPARAM();
if (self.cnt == PROJECTILE_NAPALM_FOUNTAIN)
{
loopsound(self, CH_SHOTS_SINGLE, SND(FIREBALL_FLY2), VOL_BASE, ATTEN_NORM);
MUTATOR_HOOKFUNCTION(nades, PutClientInServer)
{
+ SELFPARAM();
nades_RemoveBonus(self);
}
MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
{
+ SELFPARAM();
if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
nades_CheckThrow();
return true;
REGISTER_MUTATOR(nix, cvar("g_nix") && !cvar("g_instagib") && !cvar("g_overkill"))
{
+ SELFPARAM();
MUTATOR_ONADD
{
g_nix_with_blaster = autocvar_g_nix_with_blaster;
MUTATOR_ONREMOVE
{
// as the PlayerSpawn hook will no longer run, NIX is turned off by this!
- FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), {
it.ammo_cells = start_ammo_cells;
it.ammo_plasma = start_ammo_plasma;
it.ammo_shells = start_ammo_shells;
it.weapons = start_weapons;
if(!client_hasweapon(it, PS(it).m_weapon, true, false))
PS(it).m_switchweapon = w_getbestweapon(self);
- ));
+ });
}
return 0;
REGISTER_MUTATOR(hmg_nadesupport, true);
MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage)
{
+ SELFPARAM();
if (MUTATOR_ARGV(0, entity) != WEP_HMG) return;
return = true;
MUTATOR_ARGV(0, float) /* damage */ = self.max_health * 0.1;
void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
+ SELFPARAM();
if (!PHYS_INPUT_BUTTON_ATCK(actor))
{
w_ready(thiswep, actor, weaponentity, fire);
METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
else
METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
if(autocvar_g_balance_hmg_reload_ammo)
METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
if(autocvar_g_balance_hmg_reload_ammo)
METHOD(HeavyMachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, WEP_CVAR(hmg, ammo), SND_RELOAD);
}
METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
}
METHOD(RocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(rpc, ammo);
ammo_amount += self.(weapon_load[WEP_RPC.m_id]) >= WEP_CVAR(rpc, ammo);
return ammo_amount;
METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, WEP_CVAR(rpc, ammo), SND_RELOAD);
}
METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
{
+ SELFPARAM();
FOREACH_CLIENT(IS_SPEC(it), LAMBDA(
setself(it);
if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == frag_target)
void func_ladder_link()
{
+ SELFPARAM();
self.SendEntity = func_ladder_send;
self.SendFlags = 0xFFFFFF;
//self.model = "null";
void func_ladder_init()
{
+ SELFPARAM();
self.touch = func_ladder_touch;
trigger_init(self);
void train_use()
{
+ SELFPARAM();
self.SUB_NEXTTHINK = self.SUB_LTIME + 1;
self.SUB_THINK = train_next;
self.use = func_null; // not again
}
void target_music_kill()
{
+ SELFPARAM();
for(self = world; (self = find(self, classname, "target_music")); )
{
self.volume = 0;
void teleport_findtarget()
{
+ SELFPARAM();
int n = 0;
entity e;
for(e = world; (e = find(e, targetname, self.target)); )
void trigger_impulse_link()
{
+ SELFPARAM();
trigger_link(self, trigger_impulse_send);
}
void trigger_push_link()
{
+ SELFPARAM();
trigger_link(self, trigger_push_send);
}
}
METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))
{
+ SELFPARAM();
self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
}
METHOD(FusionReactor, tr_setup, void(FusionReactor this, entity it))
METHOD(Hellion, tr_think, void(Hellion thistur, entity it))
{
+ SELFPARAM();
if (self.tur_head.frame != 0)
self.tur_head.frame += 1;
METHOD(HunterKiller, tr_think, void(HunterKiller thistur, entity it))
{
+ SELFPARAM();
if (self.tur_head.frame != 0)
self.tur_head.frame = self.tur_head.frame + 1;
METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
{
+ SELFPARAM();
// 0 = full, 6 = empty
self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
if(self.tur_head.frame < 0)
METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
{
+ SELFPARAM();
if (self.tur_head.frame != 0)
{
if (self.fireflag == 1)
}
METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it))
{
+ SELFPARAM();
if (self.tur_head.frame != 0)
self.tur_head.frame = self.tur_head.frame + 1;
spawnfunc(turret_plasma_dual) { if (!turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
-METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this, entity it))
+METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret thistur, entity it))
{
+ SELFPARAM();
if (g_instagib) {
FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
} else {
- SUPER(PlasmaTurret).tr_attack(this, it);
+ SUPER(PlasmaTurret).tr_attack(thistur, it);
}
self.tur_head.frame += 1;
}
METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
{
+ SELFPARAM();
if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
self.tur_head.frame = self.tur_head.frame + 1;
METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur, entity it))
{
+ SELFPARAM();
if(!self.active)
{
self.tur_head.avelocity = '0 0 0';
METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
{
+ SELFPARAM();
fixedmakevectors(self.angles);
if (self.spawnflags & TSF_NO_PATHBREAK && self.pathcurrent)
}
METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
{
+ SELFPARAM();
entity oldself = self;
setself(instance);
METHOD(Racer, vr_enter, void(Racer thisveh, entity instance))
{
+ SELFPARAM();
#ifdef SVQC
self.movetype = MOVETYPE_BOUNCE;
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health) * 100;
METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance))
{
+ SELFPARAM();
#ifdef SVQC
if(self.scale != 0.5)
{
#endif
METHOD(Racer, vr_setup, void(Racer thisveh, entity instance))
{
+ SELFPARAM();
#ifdef SVQC
self.vehicle_exit = racer_exit;
#endif
}
METHOD(Raptor, vr_enter, void(Raptor thisveh, entity instance))
{
+ SELFPARAM();
self.vehicle_weapon2mode = RSM_BOMB;
self.owner.PlayerPhysplug = raptor_takeoff;
self.movetype = MOVETYPE_BOUNCEMISSILE;
}
METHOD(Raptor, vr_spawn, void(Raptor thisveh, entity instance))
{
+ SELFPARAM();
if(!self.gun1)
{
entity spinner;
}
METHOD(Raptor, vr_setup, void(Raptor thisveh, entity instance))
{
+ SELFPARAM();
if(autocvar_g_vehicle_raptor_shield)
self.vehicle_flags |= VHF_HASSHIELD;
}
METHOD(Raptor, vr_crosshair, void(Raptor thisveh))
{
+ SELFPARAM();
string crosshair;
switch(weapon2mode)
}
METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
{
+ SELFPARAM();
self.vehicle_weapon2mode = SBRM_GUIDE;
self.movetype = MOVETYPE_WALK;
CSQCVehicleSetup(self.owner, 0);
}
METHOD(Spiderbot, vr_think, void(Spiderbot thisveh, entity instance))
{
+ SELFPARAM();
if(IS_ONGROUND(self))
movelib_brake_simple(self, autocvar_g_vehicle_spiderbot_speed_stop);
}
}
METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
{
+ SELFPARAM();
if(!self.gun1)
{
self.vehicles_impulse = spiderbot_impulse;
}
METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
{
+ SELFPARAM();
if(autocvar_g_vehicle_spiderbot_shield)
self.vehicle_flags |= VHF_HASSHIELD;
}
STATIC_INIT_LATE(W_PROP_reloader)
{
+ SELFPARAM();
entity e = W_PROP_reloader = new_pure(W_PROP_reloader);
WITH(entity, self, e, (e.think = W_PROP_think)());
}
}
METHOD(Arc, wr_drop, void(entity thiswep))
{
+ SELFPARAM();
weapon_dropevent_item.arc_overheat = self.arc_overheat;
weapon_dropevent_item.arc_cooldown = self.arc_cooldown;
self.arc_overheat = 0;
}
METHOD(Arc, wr_pickup, void(entity thiswep))
{
+ SELFPARAM();
if ( !client_hasweapon(self, thiswep, false, false) &&
weapon_dropevent_item.arc_overheat > time )
{
METHOD(Arc, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
if(w_deathtype & HITTYPE_SECONDARY)
{
vector org2;
METHOD(Blaster, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(WEP_CVAR(blaster, secondary))
{
if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
METHOD(Blaster, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.ammo_field = ammo_none;
}
METHOD(Blaster, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
}
METHOD(Crylink, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND_RELOAD);
}
METHOD(Crylink, wr_suicidemessage, Notification(entity thiswep))
#else
METHOD(Devastator, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
// aim and decide to fire if appropriate
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
}
METHOD(Devastator, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.rl_release = 1;
}
METHOD(Devastator, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
#if 0
// don't switch while guiding a missile
if(ATTACK_FINISHED(self, slot) <= time || PS(self).m_weapon != WEP_DEVASTATOR)
}
METHOD(Devastator, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
self.rl_release = 0;
}
METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, WEP_CVAR(devastator, ammo), SND_RELOAD);
}
METHOD(Devastator, wr_suicidemessage, Notification(entity thiswep))
METHOD(Devastator, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
METHOD(Electro, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
if(self.bot_secondary_electromooth == 0)
}
METHOD(Electro, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(electro, ammo);
ammo_amount += self.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo);
return ammo_amount;
}
METHOD(Electro, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount;
if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
{
}
METHOD(Electro, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.electro_secondarytime = time;
}
METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD);
}
METHOD(Electro, wr_suicidemessage, Notification(entity thiswep))
METHOD(Electro, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)
METHOD(Fireball, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = false;
PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(self.bot_primary_fireballmooth == 0)
}
METHOD(Fireball, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.ammo_field = ammo_none;
}
METHOD(Fireball, wr_checkammo1, bool(entity thiswep))
}
METHOD(Fireball, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.fireball_primarytime = time;
}
METHOD(Fireball, wr_suicidemessage, Notification(entity thiswep))
METHOD(Fireball, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
if(w_deathtype & HITTYPE_SECONDARY)
{
METHOD(Hagar, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(random()>0.15)
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
}
METHOD(Hagar, wr_gonethink, void(entity thiswep))
{
+ SELFPARAM();
// we lost the weapon and want to prepare switching away
if(self.hagar_load)
{
}
METHOD(Hagar, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.hagar_loadblock = false;
if(self.hagar_load)
}
METHOD(Hagar, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(hagar, ammo);
ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_PRI(hagar, ammo);
return ammo_amount;
}
METHOD(Hagar, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(hagar, ammo);
ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
return ammo_amount;
}
METHOD(Hagar, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.hagar_load = 0;
}
METHOD(Hagar, wr_playerdeath, void(entity thiswep))
{
+ SELFPARAM();
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
// if we have any rockets loaded when we die, release them
if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath))
}
METHOD(Hagar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
if(!self.hagar_load) // require releasing loaded rockets first
W_Reload(self, min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND_RELOAD);
}
METHOD(Hagar, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
METHOD(HLAC, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
}
METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
}
METHOD(HLAC, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(hlac, ammo);
ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_PRI(hlac, ammo);
return ammo_amount;
}
METHOD(HLAC, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(hlac, ammo);
ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_SEC(hlac, ammo);
return ammo_amount;
}
METHOD(HLAC, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND_RELOAD);
}
METHOD(HLAC, wr_suicidemessage, Notification(entity thiswep))
METHOD(HLAC, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
+ SELFPARAM();
if (fire & 1) {
if(!actor.hook)
if(!(actor.hook_state & HOOK_WAITING_FOR_RELEASE))
}
METHOD(Hook, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.hook_state &= ~HOOK_WAITING_FOR_RELEASE;
}
METHOD(Hook, wr_checkammo1, bool(Hook thiswep))
{
+ SELFPARAM();
if (!thiswep.ammo_factor) return true;
if(self.hook)
return self.ammo_fuel > 0;
}
METHOD(Hook, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
RemoveGrapplingHook(self);
self.hook_time = 0;
self.hook_refire = time;
METHOD(Hook, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
METHOD(MachineGun, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
else
}
METHOD(MachineGun, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount;
if(WEP_CVAR(machinegun, mode) == 1)
ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(machinegun, sustained_ammo);
}
METHOD(MachineGun, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount;
if(WEP_CVAR(machinegun, mode) == 1)
ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR(machinegun, burst_ammo);
}
METHOD(MachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND_RELOAD);
}
METHOD(MachineGun, wr_suicidemessage, Notification(entity thiswep))
METHOD(MachineGun, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
METHOD(MineLayer, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
// aim and decide to fire if appropriate
if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
PHYS_INPUT_BUTTON_ATCK(self) = false;
}
METHOD(MineLayer, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
int slot = 0; // TODO: unhardcode
// don't switch while placing a mine
if(ATTACK_FINISHED(self, slot) <= time || PS(self).m_weapon != WEP_MINE_LAYER)
}
METHOD(MineLayer, wr_resetplayers, void(entity thiswep))
{
+ SELFPARAM();
self.minelayer_mines = 0;
}
METHOD(MineLayer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, WEP_CVAR(minelayer, ammo), SND_RELOAD);
}
METHOD(MineLayer, wr_suicidemessage, Notification(entity thiswep))
METHOD(MineLayer, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
METHOD(Mortar, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = false;
PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
}
METHOD(Mortar, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(mortar, ammo);
ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_PRI(mortar, ammo);
return ammo_amount;
}
METHOD(Mortar, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(mortar, ammo);
ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo);
return ammo_amount;
}
METHOD(Mortar, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND_RELOAD); // WEAPONTODO
}
METHOD(Mortar, wr_suicidemessage, Notification(entity thiswep))
METHOD(Mortar, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 12;
pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
METHOD(Rifle, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
PHYS_INPUT_BUTTON_ATCK(self) = false;
PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(vdist(self.origin - self.enemy.origin, >, 1000))
}
METHOD(Rifle, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(rifle, ammo);
ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_PRI(rifle, ammo);
return ammo_amount;
}
METHOD(Rifle, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(rifle, ammo);
ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo);
return ammo_amount;
}
METHOD(Rifle, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);
}
METHOD(Rifle, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND_RELOAD);
}
METHOD(Rifle, wr_suicidemessage, Notification(entity thiswep))
METHOD(Rifle, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
METHOD(Seeker, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(WEP_CVAR(seeker, type) == 1)
if(W_Seeker_Tagged_Info(self, self.enemy) != world)
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
}
METHOD(Seeker, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount;
if(WEP_CVAR(seeker, type) == 1)
{
}
METHOD(Seeker, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount;
if(WEP_CVAR(seeker, type) == 1)
{
}
METHOD(Seeker, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND_RELOAD);
}
METHOD(Seeker, wr_suicidemessage, Notification(entity thiswep))
METHOD(Seeker, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2;
org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_BOUNCE)
METHOD(Shockwave, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
{ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); }
else
METHOD(Shotgun, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
else
}
METHOD(Shotgun, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.ammo_field = ammo_none;
}
METHOD(Shotgun, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(shotgun, ammo);
ammo_amount += self.(weapon_load[WEP_SHOTGUN.m_id]) >= WEP_CVAR_PRI(shotgun, ammo);
return ammo_amount;
}
METHOD(Shotgun, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
if(IS_BOT_CLIENT(self))
if(vdist(self.origin - self.enemy.origin, >, WEP_CVAR_SEC(shotgun, melee_range)))
return false; // bots cannot use secondary out of range (fixes constant melee when out of ammo)
}
METHOD(Shotgun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, WEP_CVAR_PRI(shotgun, ammo), SND_RELOAD); // WEAPONTODO
}
METHOD(Shotgun, wr_suicidemessage, Notification(entity thiswep))
METHOD(Shotgun, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_SHOTGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent && time - self.prevric > 0.25)
this.enemy = NULL;
}
-void Ent_TubaNote_StopSound_self() { Ent_TubaNote_StopSound(self); }
+void Ent_TubaNote_StopSound_self() { SELFPARAM(); Ent_TubaNote_StopSound(self); }
NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
{
METHOD(Vaporizer, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(self.(thiswep.ammo_field) > 0)
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 1, false);
else
}
METHOD(Vaporizer, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.ammo_field = (thiswep.ammo_field);
self.vaporizer_lasthit = 0;
}
METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
float ammo_amount = self.(thiswep.ammo_field) >= vaporizer_ammo;
ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= vaporizer_ammo;
}
METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
if(!WEP_CVAR_SEC(vaporizer, ammo))
return true;
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_SEC(vaporizer, ammo);
}
METHOD(Vaporizer, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
self.vaporizer_lasthit = 0;
}
METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
float used_ammo;
if(WEP_CVAR_SEC(vaporizer, ammo))
METHOD(Vaporizer, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2 = w_org + w_backoff * 6;
if(w_deathtype & HITTYPE_SECONDARY)
{
METHOD(Vortex, wr_aim, void(entity thiswep))
{
+ SELFPARAM();
if(bot_aim(1000000, 0, 1, false))
PHYS_INPUT_BUTTON_ATCK(self) = true;
else
}
METHOD(Vortex, wr_setup, void(entity thiswep))
{
+ SELFPARAM();
self.vortex_lasthit = 0;
}
METHOD(Vortex, wr_checkammo1, bool(entity thiswep))
{
+ SELFPARAM();
float ammo_amount = self.(thiswep.ammo_field) >= WEP_CVAR_PRI(vortex, ammo);
ammo_amount += (autocvar_g_balance_vortex_reload_ammo && self.(weapon_load[WEP_VORTEX.m_id]) >= WEP_CVAR_PRI(vortex, ammo));
return ammo_amount;
}
METHOD(Vortex, wr_checkammo2, bool(entity thiswep))
{
+ SELFPARAM();
if(WEP_CVAR(vortex, secondary))
{
// don't allow charging if we don't have enough ammo
}
METHOD(Vortex, wr_resetplayer, void(entity thiswep))
{
+ SELFPARAM();
if (WEP_CVAR(vortex, charge)) {
if (WEP_CVAR_SEC(vortex, chargepool)) {
self.vortex_chargepool_ammo = 1;
}
METHOD(Vortex, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
+ SELFPARAM();
W_Reload(self, min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND_RELOAD);
}
METHOD(Vortex, wr_suicidemessage, Notification(entity thiswep))
METHOD(Vortex, wr_impacteffect, void(entity thiswep))
{
+ SELFPARAM();
vector org2 = w_org + w_backoff * 6;
pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
if(!w_issilent)
bool CSQCModel_Send(entity to, int sf)
{
+ SELFPARAM();
// some nice flags for CSQCMODEL_IF
float isplayer = (IS_CLIENT(self));
float islocalplayer = (self == to);
/** return false to remove from the client */
.bool(entity this, entity to, int sendflags) SendEntity3;
- bool SendEntity_self(entity to, int sendflags) { return self.SendEntity3(self, to, sendflags); }
+ bool SendEntity_self(entity to, int sendflags) { SELFPARAM(); return this.SendEntity3(this, to, sendflags); }
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
void UncustomizeEntitiesRun()
{
+ SELFPARAM();
FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITH(entity, self, it, it.uncustomizeentityforclient()));
}
}
void ClientInit_misc()
{
+ SELFPARAM();
int channel = MSG_ONE;
WriteHeader(channel, ENT_CLIENT_INIT);
WriteByte(channel, g_nexball_meter_period * 32);
void Unfreeze (entity targ)
{
+ SELFPARAM();
if(!STAT(FROZEN, targ))
return;
*/
void NextLevel()
{
+ SELFPARAM();
gameover = true;
intermission_running = 1;
// they win. Otherwise the defending team wins once the timelimit passes.
int WinningCondition_Assault()
{
+ SELFPARAM();
WinningConditionHelper(); // set worldstatus
int status = WINNING_NO;
MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn)
{
+ SELFPARAM();
switch(self.classname)
{
case "info_player_team1":
MUTATOR_HOOKFUNCTION(ca, reset_map_players)
{
+ SELFPARAM();
FOREACH_CLIENT(true, {
it.killcount = 0;
if (!it.caplayer && IS_BOT_CLIENT(it))
void superspec_msg(string _center_title, string _con_title, entity _to, string _msg, float _spamlevel); // TODO
MUTATOR_HOOKFUNCTION(ctf, SV_ParseClientCommand)
{
+ SELFPARAM();
if(IS_PLAYER(self) || MUTATOR_RETURNVALUE || !cvar("g_superspectate")) { return false; }
if(cmd_name == "followfc")
void ClientKill_Now();
MUTATOR_HOOKFUNCTION(cts, ClientKill)
{
+ SELFPARAM();
ret_float = 0;
if(self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
MUTATOR_HOOKFUNCTION(ft, PlayerDies)
{
+ SELFPARAM();
if(round_handler_IsActive())
if(round_handler_CountdownRunning())
{
MUTATOR_HOOKFUNCTION(kh, HavocBot_ChooseRole)
{
+ SELFPARAM();
if(IS_DEAD(self))
return true;
MUTATOR_HOOKFUNCTION(lms, ClientCommand_Spectate)
{
+ SELFPARAM();
if(self.lms_spectate_warning)
{
// for the forfeit message...
void WinningConditionHelper()
{
+ SELFPARAM();
float c;
string s;
float fullstatus;
.vector spawnpoint_prevorigin;
void spawnpoint_think()
{
+ SELFPARAM();
self.nextthink = time + 0.1;
if(self.origin != self.spawnpoint_prevorigin)
{
bool client_hasweapon(entity cl, Weapon wpn, float andammo, bool complain)
{
+ SELFPARAM();
float f = 0;
if (time < cl.hasweapon_complain_spam)
.float prevwarntime;
bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary)
{
+ SELFPARAM();
if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true;
bool ammo = false;
if (secondary) WITH(entity, self, actor, ammo = thiswep.wr_checkammo2(thiswep));
void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item)
{
+ SELFPARAM();
Weapon w = Weapons_from(weapon_type);
weapon_dropevent_item = weapon_item;
WITH(entity, self, player, w.event(w));