const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
// entity properties of monsterinfo:
-.bool(int) monster_attackfunc;
+.bool(int, entity targ) monster_attackfunc;
// animations
.vector anim_blockend;
#ifdef SVQC
void M_Mage_Attack_Spike(vector dir);
-METHOD(MageSpike, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
- SELFPARAM();
- if (fire1)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire))) {
- if (!self.target_range) self.target_range = autocvar_g_monsters_target_range;
- self.enemy = Monster_FindTarget(self);
- W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
- M_Mage_Attack_Spike(w_shotdir);
- weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
- }
- return true;
+void M_Mage_Attack_Push();
+METHOD(MageSpike, wr_think, bool(MageSpike thiswep, bool fire1, bool fire2)) {
+ SELFPARAM();
+ if (fire1)
+ if (!IS_PLAYER(self) || weapon_prepareattack(false, 0.2)) {
+ if (!self.target_range) self.target_range = autocvar_g_monsters_target_range;
+ self.enemy = Monster_FindTarget(self);
+ W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+ if (!IS_PLAYER(self)) w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin);
+ M_Mage_Attack_Spike(w_shotdir);
+ weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
+ }
+ if (fire2)
+ if (!IS_PLAYER(self) || weapon_prepareattack(true, 0.5)) {
+ M_Mage_Attack_Push();
+ weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
+ }
+ return true;
}
+void M_Mage_Attack_Teleport();
+
+CLASS(OffhandMageTeleport, OffhandWeapon)
+ .bool OffhandMageTeleport_key_pressed;
+ METHOD(OffhandMageTeleport, offhand_think, void(OffhandMageTeleport this, entity player, bool key_pressed))
+ {
+ if (key_pressed && !player.OffhandMageTeleport_key_pressed)
+ WITH(entity, self, player, M_Mage_Attack_Teleport());
+ player.OffhandMageTeleport_key_pressed = key_pressed;
+ }
+ENDCLASS(OffhandMageTeleport)
+OffhandMageTeleport OFFHAND_MAGE_TELEPORT; STATIC_INIT(OFFHAND_MAGE_TELEPORT) { OFFHAND_MAGE_TELEPORT = NEW(OffhandMageTeleport); }
+
float autocvar_g_monster_mage_health;
float autocvar_g_monster_mage_damageforcescale = 0.5;
float autocvar_g_monster_mage_attack_spike_damage;
UpdateCSQCProjectile(self);
}
-void M_Mage_Attack_Spike(vector dir);
-void M_Mage_Attack_Spike_Aim()
-{
- SELFPARAM();
- return M_Mage_Attack_Spike(normalize((self.enemy.origin + '0 0 10') - self.origin));
-}
-
void M_Mage_Attack_Spike(vector dir)
{
SELFPARAM();
void M_Mage_Attack_Teleport()
{SELFPARAM();
- if(vlen(self.enemy.origin - self.origin) >= 500)
- return;
+ entity targ = self.enemy;
+ if (!targ) return;
+ if (vlen(targ.origin - self.origin) > 1500) return;
- makevectors(self.enemy.angles);
- tracebox(self.enemy.origin + ((v_forward * -1) * 200), self.mins, self.maxs, self.origin, MOVE_NOMONSTERS, self);
+ makevectors(targ.angles);
+ tracebox(targ.origin + ((v_forward * -1) * 200), self.mins, self.maxs, self.origin, MOVE_NOMONSTERS, self);
if(trace_fraction < 1)
return;
Send_Effect(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1);
- setorigin(self, self.enemy.origin + ((v_forward * -1) * 200));
+ setorigin(self, targ.origin + ((v_forward * -1) * 200));
+
+ vector a = vectoangles(targ.origin - self.origin);
+ a.x = -a.x;
+ self.angles_x = a.x;
+ self.angles_y = a.y;
+ self.fixangle = true;
+ self.velocity *= 0.5;
self.attack_finished_single = time + 0.2;
}
self.anim_finished = time + 1;
}
-float M_Mage_Attack(float attack_type)
+float M_Mage_Attack(float attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
{
if(random() <= 0.7)
{
- M_Mage_Attack_Push();
+ Weapon wep = WEP_MAGE_SPIKE;
+ wep.wr_think(wep, false, true);
return true;
}
{
if(random() <= 0.4)
{
- M_Mage_Attack_Teleport();
+ OffhandWeapon off = OFFHAND_MAGE_TELEPORT;
+ off.offhand_think(off, self, true);
return true;
}
else
setanim(self, self.anim_shoot, true, true, true);
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
self.anim_finished = time + 1;
- Monster_Delay(1, 0, 0.2, M_Mage_Attack_Spike_Aim);
+ Weapon wep = WEP_MAGE_SPIKE;
+ wep.wr_think(wep, true, false);
return true;
}
}
CSQCProjectile(gren, true, PROJECTILE_SHAMBLER_LIGHTNING, true);
}
-float M_Shambler_Attack(float attack_type)
+float M_Shambler_Attack(float attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
CSQCProjectile(proj, true, PROJECTILE_ELECTRO, true);
}
-bool M_Spider_Attack(int attack_type)
+bool M_Spider_Attack(int attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
}
-float M_Wyvern_Attack(float attack_type)
+float M_Wyvern_Attack(float attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
return true;
}
-float M_Zombie_Attack(float attack_type)
+float M_Zombie_Attack(float attack_type, entity targ)
{SELFPARAM();
switch(attack_type)
{
if(targ_vlen <= e.attack_range)
{
- float attack_success = e.monster_attackfunc(MONSTER_ATTACK_MELEE);
+ float attack_success = e.monster_attackfunc(MONSTER_ATTACK_MELEE, targ);
if(attack_success == 1)
Monster_Sound(monstersound_melee, 0, false, CH_VOICE);
else if(attack_success > 0)
if(targ_vlen > e.attack_range)
{
- float attack_success = e.monster_attackfunc(MONSTER_ATTACK_RANGED);
+ float attack_success = e.monster_attackfunc(MONSTER_ATTACK_RANGED, targ);
if(attack_success == 1)
Monster_Sound(monstersound_melee, 0, false, CH_VOICE);
else if(attack_success > 0)
METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
if (fire1)
- if (weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire))) {
+ if (weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire))) {
W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
self.tur_shotdir_updated = w_shotdir;
self.tur_shotorg = w_shotorg;
METHOD(RacerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
SELFPARAM();
if (fire1)
- if (weapon_prepareattack(0, 0)) {
+ if (weapon_prepareattack(false, 0)) {
W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("lasergun_fire"), CH_WEAPON_B, 0);
racer_fire_cannon("tag_fire1");
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(machinegun, sustained_refire), w_ready);
if((!self.arc_beam) || wasfreed(self.arc_beam))
{
- if(weapon_prepareattack(!!fire2, 0))
+ if(weapon_prepareattack(fire2, 0))
{
- W_Arc_Beam(!!fire2);
+ W_Arc_Beam(fire2);
if(!self.arc_BUTTON_ATCK_prev)
{
#if 0
if(fire2)
- if(weapon_prepareattack(1, autocvar_g_balance_arc_secondary_refire))
+ if(weapon_prepareattack(true, autocvar_g_balance_arc_secondary_refire))
{
W_Arc_Attack2();
self.arc_count = autocvar_g_balance_arc_secondary_count;
{
if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(blaster, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(blaster, refire)))
{
W_Blaster_Attack(
WEP_BLASTER.m_id,
case 1: // normal projectile secondary
{
- if(weapon_prepareattack(1, WEP_CVAR_SEC(blaster, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(blaster, refire)))
{
W_Blaster_Attack(
WEP_BLASTER.m_id | HITTYPE_SECONDARY,
if(fire1)
{
if(self.crylink_waitrelease != 1)
- if(weapon_prepareattack(0, WEP_CVAR_PRI(crylink, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(crylink, refire)))
{
W_Crylink_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(crylink, animtime), w_ready);
if(fire2 && autocvar_g_balance_crylink_secondary)
{
if(self.crylink_waitrelease != 2)
- if(weapon_prepareattack(1, WEP_CVAR_SEC(crylink, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(crylink, refire)))
{
W_Crylink_Attack2(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(crylink, animtime), w_ready);
if(fire1)
{
if(self.rl_release || WEP_CVAR(devastator, guidestop))
- if(weapon_prepareattack(0, WEP_CVAR(devastator, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(devastator, refire)))
{
W_Devastator_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(devastator, animtime), w_ready);
{SELFPARAM();
if(self.electro_count > 1)
if(self.BUTTON_ATCK2)
- if(weapon_prepareattack(1, -1))
+ if(weapon_prepareattack(true, -1))
{
W_Electro_Attack_Orb(WEP_ELECTRO);
self.electro_count -= 1;
if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(electro, refire)))
{
W_Electro_Attack_Bolt(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
else if(fire2)
{
if(time >= self.electro_secondarytime)
- if(weapon_prepareattack(1, WEP_CVAR_SEC(electro, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(electro, refire)))
{
W_Electro_Attack_Orb(thiswep);
self.electro_count = WEP_CVAR_SEC(electro, count);
if(fire1)
{
if(time >= self.fireball_primarytime)
- if(weapon_prepareattack(0, WEP_CVAR_PRI(fireball, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(fireball, refire)))
{
W_Fireball_Attack1_Frame0(thiswep, fire1, fire2);
self.fireball_primarytime = time + WEP_CVAR_PRI(fireball, refire2) * W_WeaponRateFactor();
}
else if(fire2)
{
- if(weapon_prepareattack(1, WEP_CVAR_SEC(fireball, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(fireball, refire)))
{
W_Fireball_Attack2();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(fireball, animtime), w_ready);
if(!self.hagar_load)
return;
- weapon_prepareattack_do(1, WEP_CVAR_SEC(hagar, refire));
+ weapon_prepareattack_do(true, WEP_CVAR_SEC(hagar, refire));
W_SetupShot(self, false, 2, SND(HAGAR_FIRE), CH_WEAPON_A, WEP_CVAR_SEC(hagar, damage));
Send_Effect(EFFECT_HAGAR_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
_WEP_ACTION(self.weapon, WR_RELOAD);
else if(fire1 && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(hagar, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(hagar, refire)))
{
W_Hagar_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(hagar, refire), w_ready);
}
else if(fire2 && !loadable_secondary && WEP_CVAR(hagar, secondary))
{
- if(weapon_prepareattack(1, WEP_CVAR_SEC(hagar, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(hagar, refire)))
{
W_Hagar_Attack2(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready);
_WEP_ACTION(self.weapon, WR_RELOAD);
else if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(hlac, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(hlac, refire)))
{
self.misc_bulletcounter = 0;
W_HLAC_Attack(thiswep);
else if(fire2 && WEP_CVAR(hlac, secondary))
{
- if(weapon_prepareattack(1, WEP_CVAR_SEC(hlac, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(hlac, refire)))
{
W_HLAC_Attack2_Frame(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready);
else
{
if (fire1)
- if (weapon_prepareattack(0, 0))
+ if (weapon_prepareattack(false, 0))
{
self.misc_bulletcounter = 0;
W_HeavyMachineGun_Attack_Auto(thiswep, fire1, fire2);
if(!(self.hook_state & HOOK_WAITING_FOR_RELEASE))
if(!(self.hook_state & HOOK_FIRING))
if(time > self.hook_refire)
- if(weapon_prepareattack(0, -1))
+ if(weapon_prepareattack(false, -1))
{
W_DecreaseAmmo(thiswep, WEP_CVAR_PRI(hook, ammo));
self.hook_state |= HOOK_FIRING;
if(fire2)
{
- if(weapon_prepareattack(1, WEP_CVAR_SEC(hook, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(hook, refire)))
{
W_Hook_Attack2(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hook, animtime), w_ready);
if(WEP_CVAR(machinegun, mode) == 1)
{
if(fire1)
- if(weapon_prepareattack(0, 0))
+ if(weapon_prepareattack(false, 0))
{
self.misc_bulletcounter = 0;
W_MachineGun_Attack_Auto(thiswep, fire1, fire2);
}
if(fire2)
- if(weapon_prepareattack(1, 0))
+ if(weapon_prepareattack(true, 0))
{
if(!_WEP_ACTION(self.weapon, WR_CHECKAMMO2))
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
if(fire1)
- if(weapon_prepareattack(0, 0))
+ if(weapon_prepareattack(false, 0))
{
self.misc_bulletcounter = 1;
W_MachineGun_Attack(WEP_MACHINEGUN, WEP_MACHINEGUN.m_id); // sets attack_finished
}
if(fire2 && WEP_CVAR(machinegun, first))
- if(weapon_prepareattack(1, 0))
+ if(weapon_prepareattack(true, 0))
{
self.misc_bulletcounter = 1;
W_MachineGun_Attack(WEP_MACHINEGUN, WEP_MACHINEGUN.m_id | HITTYPE_SECONDARY); // sets attack_finished
}
else if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR(minelayer, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(minelayer, refire)))
{
W_MineLayer_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(minelayer, animtime), w_ready);
_WEP_ACTION(self.weapon, WR_RELOAD);
else if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(mortar, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(mortar, refire)))
{
W_Mortar_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(mortar, animtime), w_ready);
if(nadefound)
sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM);
}
- else if(weapon_prepareattack(1, WEP_CVAR_SEC(mortar, refire)))
+ else if(weapon_prepareattack(true, WEP_CVAR_SEC(mortar, refire)))
{
W_Mortar_Attack2(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready);
if(fire1)
if(!self.porto_current)
if(!self.porto_forbidden)
- if(weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(porto, refire)))
{
W_Porto_Attack(0);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
if(fire2)
if(!self.porto_current)
if(!self.porto_forbidden)
- if(weapon_prepareattack(1, WEP_CVAR_SEC(porto, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(porto, refire)))
{
W_Porto_Attack(1);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready);
if(fire1)
if(!self.porto_current)
if(!self.porto_forbidden)
- if(weapon_prepareattack(0, WEP_CVAR_PRI(porto, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(porto, refire)))
{
W_Porto_Attack(-1);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
{
self.rifle_accumulator = bound(time - WEP_CVAR(rifle, bursttime), self.rifle_accumulator, time);
if(fire1)
- if(weapon_prepareattack_check(0, WEP_CVAR_PRI(rifle, refire)))
+ if(weapon_prepareattack_check(false, WEP_CVAR_PRI(rifle, refire)))
if(time >= self.rifle_accumulator + WEP_CVAR_PRI(rifle, burstcost))
{
- weapon_prepareattack_do(0, WEP_CVAR_PRI(rifle, refire));
+ weapon_prepareattack_do(false, WEP_CVAR_PRI(rifle, refire));
W_Rifle_BulletHail(WEP_CVAR_PRI(rifle, bullethail), W_Rifle_Attack, WFRAME_FIRE1, WEP_CVAR_PRI(rifle, animtime), WEP_CVAR_PRI(rifle, refire));
self.rifle_accumulator += WEP_CVAR_PRI(rifle, burstcost);
}
_WEP_ACTION(self.weapon, WR_RELOAD);
else
{
- if(weapon_prepareattack_check(1, WEP_CVAR_SEC(rifle, refire)))
+ if(weapon_prepareattack_check(true, WEP_CVAR_SEC(rifle, refire)))
if(time >= self.rifle_accumulator + WEP_CVAR_SEC(rifle, burstcost))
{
- weapon_prepareattack_do(1, WEP_CVAR_SEC(rifle, refire));
+ weapon_prepareattack_do(true, WEP_CVAR_SEC(rifle, refire));
W_Rifle_BulletHail(WEP_CVAR_SEC(rifle, bullethail), W_Rifle_Attack2, WFRAME_FIRE2, WEP_CVAR_SEC(rifle, animtime), WEP_CVAR_PRI(rifle, refire));
self.rifle_accumulator += WEP_CVAR_SEC(rifle, burstcost);
}
{
if (fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR(rpc, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(rpc, refire)))
{
W_RocketPropelledChainsaw_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(rpc, animtime), w_ready);
{
if(WEP_CVAR(seeker, type) == 1)
{
- if(weapon_prepareattack(0, WEP_CVAR(seeker, missile_refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(seeker, missile_refire)))
{
W_Seeker_Attack();
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, missile_animtime), w_ready);
}
else
{
- if(weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(seeker, tag_refire)))
{
W_Seeker_Fire_Tag(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
{
if(WEP_CVAR(seeker, type) == 1)
{
- if(weapon_prepareattack(0, WEP_CVAR(seeker, tag_refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(seeker, tag_refire)))
{
W_Seeker_Fire_Tag(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, tag_animtime), w_ready);
}
else
{
- if(weapon_prepareattack(0, WEP_CVAR(seeker, flac_refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(seeker, flac_refire)))
{
W_Seeker_Fire_Flac(thiswep);
weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(seeker, flac_animtime), w_ready);
{
if(time >= self.shockwave_blasttime) // handle refire separately so the secondary can be fired straight after a primary
{
- if(weapon_prepareattack(0, WEP_CVAR(shockwave, blast_animtime)))
+ if(weapon_prepareattack(false, WEP_CVAR(shockwave, blast_animtime)))
{
W_Shockwave_Attack();
self.shockwave_blasttime = time + WEP_CVAR(shockwave, blast_refire) * W_WeaponRateFactor();
{
//if(self.clip_load >= 0) // we are not currently reloading
if(!self.crouch) // no crouchmelee please
- if(weapon_prepareattack(1, WEP_CVAR(shockwave, melee_refire)))
+ if(weapon_prepareattack(true, WEP_CVAR(shockwave, melee_refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee);
{
if(time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(shotgun, animtime)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(shotgun, animtime)))
{
W_Shotgun_Attack(thiswep, true);
self.shotgun_primarytime = time + WEP_CVAR_PRI(shotgun, refire) * W_WeaponRateFactor();
{
if(time >= self.shotgun_primarytime) // handle refire separately so the secondary can be fired straight after a primary
{
- if(weapon_prepareattack(0, WEP_CVAR_SEC(shotgun, alt_animtime)))
+ if(weapon_prepareattack(false, WEP_CVAR_SEC(shotgun, alt_animtime)))
{
W_Shotgun_Attack(thiswep, false);
self.shotgun_primarytime = time + WEP_CVAR_SEC(shotgun, alt_refire) * W_WeaponRateFactor();
if(!self.crouch) // no crouchmelee please
if(WEP_CVAR(shotgun, secondary) == 1)
if((fire1 && self.WEP_AMMO(SHOTGUN) <= 0 && !(self.items & IT_UNLIMITED_WEAPON_AMMO)) || fire2)
- if(weapon_prepareattack(1, WEP_CVAR_SEC(shotgun, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR_SEC(shotgun, refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2);
METHOD(Tuba, wr_think, bool(entity thiswep, bool fire1, bool fire2))
{
if(fire1)
- if(weapon_prepareattack(0, WEP_CVAR(tuba, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(0);
//weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_tuba_animtime, w_ready);
weapon_thinkf(WFRAME_IDLE, WEP_CVAR(tuba, animtime), w_ready);
}
if(fire2)
- if(weapon_prepareattack(1, WEP_CVAR(tuba, refire)))
+ if(weapon_prepareattack(true, WEP_CVAR(tuba, refire)))
{
W_Tuba_NoteOn(HITTYPE_SECONDARY);
//weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_tuba_animtime, w_ready);
_WEP_ACTION(self.weapon, WR_RELOAD);
if(fire1 && (self.ammo_cells || !autocvar_g_rm) && !forbidWeaponUse(self))
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(vaporizer, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(vaporizer, refire)))
{
W_Vaporizer_Attack(thiswep);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
{
if(fire1)
{
- if(weapon_prepareattack(0, WEP_CVAR_PRI(vortex, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_PRI(vortex, refire)))
{
W_Vortex_Attack(thiswep, 0);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(vortex, animtime), w_ready);
}
else if(WEP_CVAR(vortex, secondary))
{
- if(weapon_prepareattack(0, WEP_CVAR_SEC(vortex, refire)))
+ if(weapon_prepareattack(false, WEP_CVAR_SEC(vortex, refire)))
{
W_Vortex_Attack(thiswep, 1);
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(vortex, animtime), w_ready);
METHOD(BallStealer, wr_think, bool(BallStealer thiswep, bool fire1, bool fire2))
{
if(fire1)
- if(weapon_prepareattack(0, autocvar_g_balance_nexball_primary_refire))
+ if(weapon_prepareattack(false, autocvar_g_balance_nexball_primary_refire))
if(autocvar_g_nexball_basketball_meter)
{
if(self.ballcarried && !self.metertime)
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
}
if(fire2)
- if(weapon_prepareattack(1, autocvar_g_balance_nexball_secondary_refire))
+ if(weapon_prepareattack(true, autocvar_g_balance_nexball_secondary_refire))
{
W_Nexball_Attack2();
weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);