return true;
}
- METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, int fire))
+ METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, int slot, int fire))
{
if(fire & 1)
if(weapon_prepareattack(thiswep, actor, false, autocvar_g_balance_nexball_primary_refire))
void M_Mage_Attack_Spike(vector dir);
void M_Mage_Attack_Push();
-METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, int fire)) {
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, int slot, int fire)) {
if (fire & 1)
if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, false, 0.2)) {
if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
if(random() <= 0.7)
{
Weapon wep = WEP_MAGE_SPIKE;
- wep.wr_think(wep, self, 2);
+ wep.wr_think(wep, self, 0, 2);
return true;
}
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
self.anim_finished = time + 1;
Weapon wep = WEP_MAGE_SPIKE;
- wep.wr_think(wep, self, 1);
+ wep.wr_think(wep, self, 0, 1);
return true;
}
}
void M_Spider_Attack_Web();
-METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, int fire)) {
+METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if ((!isPlayer && time >= actor.spider_web_delay) || weapon_prepareattack(thiswep, actor, false, autocvar_g_monster_spider_attack_web_delay)) {
Weapon wep = WEP_SPIDER_ATTACK;
case MONSTER_ATTACK_MELEE:
{
- wep.wr_think(wep, self, 2);
+ wep.wr_think(wep, self, 0, 2);
return true;
}
case MONSTER_ATTACK_RANGED:
{
- wep.wr_think(wep, self, 1);
+ wep.wr_think(wep, self, 0, 1);
return true;
}
}
void M_Wyvern_Attack_Fireball_Explode();
void M_Wyvern_Attack_Fireball_Touch();
-METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, int fire)) {
+METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, int slot, int fire)) {
if (fire & 1)
if (time > actor.attack_finished_single || weapon_prepareattack(thiswep, actor, false, 1.2)) {
if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
{
w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin);
Weapon wep = WEP_WYVERN_ATTACK;
- wep.wr_think(wep, self, 1);
+ wep.wr_think(wep, self, 0, 1);
return true;
}
}
/** (SERVER) called when turret attacks */
METHOD(Turret, tr_attack, void(Turret this)) {
Weapon w = this.m_weapon;
- w.wr_think(w, self, 1);
+ w.wr_think(w, self, 0, 1);
}
/** (ALL) */
METHOD(Turret, tr_config, void(Turret this)) {
#ifdef SVQC
void turret_initparams(entity);
-METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
#ifdef SVQC
void turret_flac_projectile_think_explode();
-METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
float autocvar_g_turrets_unit_hellion_shot_speed_max;
void turret_hellion_missile_think();
-METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
float autocvar_g_turrets_unit_hk_shot_speed_turnrate;
void turret_hk_missile_think();
-METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
void W_MachineGun_MuzzleFlash();
-METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
#ifdef SVQC
-METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
.int fireflag;
-METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
#ifdef SVQC
-METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
#ifdef SVQC
entity toast(entity from, float range, float damage);
-METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
#ifdef SVQC
-METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
// Fix z-aim (for chase mode)
crosshair_trace(player);
w_shotdir.z = normalize(trace_endpos - org).z * 0.5;
- wep1.wr_think(wep1, self, 1);
+ wep1.wr_think(wep1, self, 0, 1);
}
if(autocvar_g_vehicle_racer_rocket_locktarget)
float autocvar_g_vehicle_racer_rocket_locked_maxangle;
void racer_fire_rocket(vector org, vector dir, entity trg);
-METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int fire))
+METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
if(player.BUTTON_ATCK)
if (wep1.wr_checkammo1(wep1))
{
- wep1.wr_think(wep1, self, 1);
+ wep1.wr_think(wep1, self, 0, 1);
}
if(self.vehicle_flags & VHF_SHIELDREGEN)
if(time > raptor.lip + autocvar_g_vehicle_raptor_bombs_refire)
if(player.BUTTON_ATCK2)
{
- wep2a.wr_think(wep2a, self, 2);
+ wep2a.wr_think(wep2a, self, 1, 2);
raptor.delay = time + autocvar_g_vehicle_raptor_bombs_refire;
raptor.lip = time;
}
if(time > raptor.lip + autocvar_g_vehicle_raptor_flare_refire)
if(player.BUTTON_ATCK2)
{
- wep2b.wr_think(wep2b, self, 2);
+ wep2b.wr_think(wep2b, self, 1, 2);
raptor.delay = time + autocvar_g_vehicle_raptor_flare_refire;
raptor.lip = time;
}
float autocvar_g_vehicle_raptor_bomblet_force;
float autocvar_g_vehicle_raptor_bomblet_explode_delay;
-METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
float autocvar_g_vehicle_raptor_bombs_refire;
void raptor_bombdrop();
-METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
void raptor_flare_touch();
-METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, int fire)) {
+METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, int slot, int fire)) {
bool isPlayer = IS_PLAYER(actor);
entity player = isPlayer ? actor : actor.owner;
entity veh = player.vehicle;
/** (SERVER) setup weapon data */
METHOD(Weapon, wr_setup, void(Weapon this)) {}
/** (SERVER) logic to run every frame */
- METHOD(Weapon, wr_think, void(Weapon this, entity actor, int fire)) {}
+ METHOD(Weapon, wr_think, void(Weapon this, entity actor, int slot, int fire)) {}
/** (SERVER) checks ammo for weapon primary */
METHOD(Weapon, wr_checkammo1, bool(Weapon this)) {return false;}
/** (SERVER) checks ammo for weapon second */
);
}
}
- METHOD(Arc, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Arc, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
Arc_Player_SetHeat(actor);
Arc_Smoke();
{ self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
}
- METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, int fire))
+ METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, int slot, int fire))
{
if(fire & 1)
{
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
}
- METHOD(Crylink, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_crylink_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
}
}
#endif
- METHOD(Devastator, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Devastator, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(devastator, reload_ammo) && actor.clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
MUTATOR_CALLHOOK(EditProjectile, self, proj);
}
-void W_Electro_CheckAttack(Weapon thiswep, entity actor, int fire)
+void W_Electro_CheckAttack(Weapon thiswep, entity actor, int slot, int fire)
{SELFPARAM();
if(self.electro_count > 1)
if(self.BUTTON_ATCK2)
return;
}
// WEAPONTODO: when the player releases the button, cut down the length of refire2?
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
}
.float bot_secondary_electromooth;
}
}
}
- METHOD(Electro, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Electro, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO
{
Send_Effect(EFFECT_FIREBALL_PRE_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
}
-void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame4(Weapon thiswep, entity actor, int slot, int fire)
{
W_Fireball_Attack1();
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), w_ready);
}
-void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame3(Weapon thiswep, entity actor, int slot, int fire)
{
W_Fireball_AttackEffect(0, '+1.25 +3.75 0');
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame4);
}
-void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame2(Weapon thiswep, entity actor, int slot, int fire)
{
W_Fireball_AttackEffect(0, '-1.25 +3.75 0');
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame3);
}
-void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame1(Weapon thiswep, entity actor, int slot, int fire)
{
W_Fireball_AttackEffect(1, '+1.25 -3.75 0');
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(fireball, animtime), W_Fireball_Attack1_Frame2);
}
-void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, int fire)
+void W_Fireball_Attack1_Frame0(Weapon thiswep, entity actor, int slot, int fire)
{SELFPARAM();
W_Fireball_AttackEffect(0, '-1.25 -3.75 0');
sound(self, CH_WEAPON_SINGLE, SND_FIREBALL_PREFIRE2, VOL_BASE, ATTEN_NORM);
}
}
}
- METHOD(Fireball, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Fireball, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(fire & 1)
{
if(time >= actor.fireball_primarytime)
if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(fireball, refire)))
{
- W_Fireball_Attack1_Frame0(thiswep, actor, fire);
+ W_Fireball_Attack1_Frame0(thiswep, actor, slot, fire);
actor.fireball_primarytime = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor();
}
}
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
}
- METHOD(Hagar, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Hagar, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
float loadable_secondary;
loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary));
}
// weapon frames
-void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, int fire)
+void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, int slot, int fire)
{
if(actor.weapon != actor.switchweapon) // abort immediately if switching
{
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
{
self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
}
- METHOD(HLAC, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(HLAC, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_hlac_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(WEP_HMG.m_id); }
-void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
+void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, int slot, int fire)
{
if (!actor.BUTTON_ATCK)
{
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
}
- METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(hmg, reload_ammo) && actor.clip_load < WEP_CVAR(hmg, ammo)) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
if (weapon_prepareattack(thiswep, actor, false, 0))
{
actor.misc_bulletcounter = 0;
- W_HeavyMachineGun_Attack_Auto(thiswep, actor, fire);
+ W_HeavyMachineGun_Attack_Auto(thiswep, actor, slot, fire);
}
}
}
METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
{
Weapon wep = WEP_HOOK;
- wep.wr_think(wep, actor, key_pressed ? 1 : 0);
+ wep.wr_think(wep, actor, 1, key_pressed ? 1 : 0);
}
ENDCLASS(OffhandHook)
OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
MUTATOR_CALLHOOK(EditProjectile, actor, gren);
}
- METHOD(Hook, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Hook, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if (fire & 1) {
if(!actor.hook)
}
// weapon frames
-void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, int slot, int fire)
{
if(actor.weapon != actor.switchweapon) // abort immediately if switching
{
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
if(actor.BUTTON_ATCK)
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
actor.misc_bulletcounter = actor.misc_bulletcounter + 1;
}
-void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, int slot, int fire)
{
float machinegun_spread;
if(!(fire & 1))
{
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), W_MachineGun_Attack_Auto);
}
-void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int fire)
+void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, int slot, int fire)
{
W_SetupShot(actor, true, 0, SND(UZI_FIRE), CH_WEAPON_A, WEP_CVAR(machinegun, sustained_damage));
if(!autocvar_g_norecoil)
else
self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
}
- METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(machinegun, reload_ammo) && actor.clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
if(weapon_prepareattack(thiswep, actor, false, 0))
{
actor.misc_bulletcounter = 0;
- W_MachineGun_Attack_Auto(thiswep, actor, fire);
+ W_MachineGun_Attack_Auto(thiswep, actor, slot, fire);
}
if(fire & 2)
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
W_DecreaseAmmo(thiswep, actor, WEP_CVAR(machinegun, burst_ammo));
actor.misc_bulletcounter = WEP_CVAR(machinegun, burst) * -1;
- W_MachineGun_Attack_Burst(thiswep, actor, fire);
+ W_MachineGun_Attack_Burst(thiswep, actor, slot, fire);
}
}
else
if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
}
}
- METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_minelayer_reload_ammo && actor.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload
{
wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime))));
wepinfo_ter_dps = 0;
*/
- METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Mortar, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_mortar_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
{
PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
}
- METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(porto, secondary))
{
.float rifle_bullethail_frame;
.float rifle_bullethail_animtime;
.float rifle_bullethail_refire;
-void W_Rifle_BulletHail_Continue(Weapon thiswep, entity actor, int fire)
+void W_Rifle_BulletHail_Continue(Weapon thiswep, entity actor, int slot, int fire)
{
float r, sw, af;
}
}
}
- METHOD(Rifle, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Rifle, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_rifle_reload_ammo && actor.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
{
self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
}
- METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(rpc, reload_ammo) && actor.clip_load < WEP_CVAR(rpc, ammo)) {
Weapon w = get_weaponinfo(actor.weapon);
else
self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
}
- METHOD(Seeker, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Seeker, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(autocvar_g_balance_seeker_reload_ammo && actor.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload
Weapon w = get_weaponinfo(actor.weapon);
}
}
-void W_Shockwave_Melee(Weapon thiswep, entity actor, int fire)
+void W_Shockwave_Melee(Weapon thiswep, entity actor, int slot, int fire)
{
sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTN_NORM);
weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR(shockwave, melee_animtime), w_ready);
else
{ self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
}
- METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(fire & 1)
{
}
}
-void W_Shotgun_Attack2(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack2(Weapon thiswep, entity actor, int slot, int fire)
{
sound(actor, CH_WEAPON_A, SND_SHOTGUN_MELEE, VOL_BASE, ATTEN_NORM);
weapon_thinkf(actor, WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
}
// alternate secondary weapon frames
-void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, int slot, int fire)
{
Weapon w = get_weaponinfo(actor.weapon);
if (!w.wr_checkammo2(w))
if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
W_Shotgun_Attack(WEP_SHOTGUN, true); // actually is secondary, but we trick the last shot into playing full reload sound
weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
}
-void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int fire)
+void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, int slot, int fire)
{
Weapon w = get_weaponinfo(actor.weapon);
if (!w.wr_checkammo2(w))
if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
- w_ready(thiswep, actor, fire);
+ w_ready(thiswep, actor, slot, fire);
return;
}
else
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
}
- METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(shotgun, reload_ammo) && actor.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload
{
self.BUTTON_ATCK2 = 1;
}
}
- METHOD(Tuba, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Tuba, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(fire & 1)
if(weapon_prepareattack(thiswep, actor, false, WEP_CVAR(tuba, refire)))
else
self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
}
- METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
// if the laser uses load, we also consider its ammo for reloading
self.BUTTON_ATCK2 = true;
}
}
- METHOD(Vortex, wr_think, void(entity thiswep, entity actor, int fire))
+ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, int slot, int fire))
{
if(WEP_CVAR(vortex, charge) && actor.vortex_charge < WEP_CVAR(vortex, charge_limit))
actor.vortex_charge = min(1, actor.vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME);
// WEAPONTODO
.float autoswitch;
float client_hasweapon(entity cl, float wpn, float andammo, float complain);
-void w_clear(Weapon thiswep, entity actor, int fire);
-void w_ready(Weapon thiswep, entity actor, int fire);
+void w_clear(Weapon thiswep, entity actor, int slot, int fire);
+void w_ready(Weapon thiswep, entity actor, int slot, int fire);
// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
.float weapon_nextthink;
-.void(Weapon thiswep, entity actor, int fire) weapon_think;
+.void(Weapon thiswep, entity actor, int slot, int fire) weapon_think;
// weapon states (self.weaponentity.state)
}
Weapon wpn = get_weaponinfo(self.weapon);
if(self.weaponentity.state != WS_CLEAR)
- w_ready(wpn, self, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, self, 0, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
self.weapon_blocked = true;
}
}
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func);
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func);
bool CL_Weaponentity_CustomizeEntityForClient()
{
}
// Weapon subs
-void w_clear(Weapon thiswep, entity actor, int fire)
+void w_clear(Weapon thiswep, entity actor, int slot, int fire)
{
if (actor.weapon != -1)
{
}
}
-void w_ready(Weapon thiswep, entity actor, int fire)
+void w_ready(Weapon thiswep, entity actor, int slot, int fire)
{
if (actor.weaponentity) actor.weaponentity.state = WS_READY;
weapon_thinkf(actor, WFRAME_IDLE, 1000000, w_ready);
return false;
}
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func)
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func)
{
bool restartanim;
if (fr == WFRAME_DONTCHANGE)
if (actor.weaponentity.state != WS_CLEAR)
{
Weapon wpn = get_weaponinfo(actor.weapon);
- w_ready(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
return;
}
}
actor.hook_switchweapon = key_pressed;
Weapon h = WEP_HOOK;
block_weapon = (actor.weapon == h.m_id && (actor.BUTTON_ATCK || key_pressed));
- h.wr_think(h, actor, block_weapon ? 1 : 0);
+ h.wr_think(h, actor, 0, block_weapon ? 1 : 0);
}
}
if (w)
{
Weapon e = get_weaponinfo(actor.weapon);
- e.wr_think(e, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ e.wr_think(e, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
}
else
{
v_right = ri;
v_up = up;
Weapon wpn = get_weaponinfo(actor.weapon);
- actor.weapon_think(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ actor.weapon_think(wpn, actor, 0, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
}
else
{
.float reload_complain;
.string reload_sound;
-void W_ReloadedAndReady(Weapon thiswep, entity actor, int fire)
+void W_ReloadedAndReady(Weapon thiswep, entity actor, int slot, int fire)
{
// finish the reloading process, and do the ammo transfer
// ATTACK_FINISHED(actor) -= actor.reload_time - 1;
Weapon wpn = get_weaponinfo(actor.weapon);
- w_ready(wpn, actor, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, actor, slot, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
}
void W_Reload(entity actor, float sent_ammo_min, string sent_sound)
void weapon_prepareattack_do(entity actor, float secondary, float attacktime);
-void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int fire) func);
+void weapon_thinkf(entity actor, float fr, float t, void(Weapon thiswep, entity actor, int slot, int fire) func);
#endif