2016-10-14 18:08:41 +00:00
// --------------------------------------------------------------------------
//
2016-11-20 11:27:26 +00:00
// Doom weap base class
2016-10-14 18:08:41 +00:00
//
// --------------------------------------------------------------------------
class DoomWeapon : Weapon
{
Default
{
Weapon.Kickback 100;
}
}
2016-11-20 11:27:26 +00:00
extend class StateProvider
2016-10-14 18:08:41 +00:00
{
2016-11-20 11:27:26 +00:00
//
// [RH] A_FireRailgun
2016-11-24 09:47:45 +00:00
// [TP] This now takes a puff type to retain Skulltag's railgun's ability to pierce armor.
2016-11-20 11:27:26 +00:00
//
2016-11-24 09:47:45 +00:00
action void A_FireRailgun(class<Actor> puffType = "BulletPuff", int offset_xy = 0)
2016-10-14 18:08:41 +00:00
{
2016-11-20 11:27:26 +00:00
if (player == null)
{
return;
}
2016-10-14 18:08:41 +00:00
2016-11-20 11:27:26 +00:00
Weapon weap = player.ReadyWeapon;
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
{
2023-11-27 23:35:42 +00:00
if (!weap.DepleteAmmo (weap.bAltFire, true))
2016-11-20 11:27:26 +00:00
return;
State flash = weap.FindState('Flash');
if (flash != null)
{
2018-12-21 11:32:36 +00:00
player.SetSafeFlash(weap, flash, random[FireRail](0, 1));
2016-11-20 11:27:26 +00:00
}
}
2016-10-14 18:08:41 +00:00
2016-11-20 22:39:37 +00:00
int damage = deathmatch ? 100 : 150;
2016-11-24 09:47:45 +00:00
A_RailAttack(damage, offset_xy, false, pufftype: puffType); // note that this function handles ammo depletion itself for Dehacked compatibility purposes.
2016-10-14 18:08:41 +00:00
}
2016-11-20 11:27:26 +00:00
action void A_FireRailgunLeft()
2016-10-14 18:08:41 +00:00
{
2016-11-24 09:47:45 +00:00
A_FireRailgun(offset_xy: -10);
2016-10-14 18:08:41 +00:00
}
2016-11-20 11:27:26 +00:00
action void A_FireRailgunRight()
2016-10-14 18:08:41 +00:00
{
2016-11-24 09:47:45 +00:00
A_FireRailgun(offset_xy: 10);
2016-10-14 18:08:41 +00:00
}
2016-11-20 11:27:26 +00:00
action void A_RailWait()
2016-10-14 18:08:41 +00:00
{
2016-11-20 11:27:26 +00:00
// only here to satisfy old Dehacked patches.
2016-10-14 18:08:41 +00:00
}
2016-11-24 09:47:45 +00:00
}