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
|
|
|
|
//
|
|
|
|
action void A_FireRailgun(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)
|
|
|
|
{
|
|
|
|
if (!weap.DepleteAmmo (weap.bAltFire, true, 1))
|
|
|
|
return;
|
|
|
|
|
|
|
|
State flash = weap.FindState('Flash');
|
|
|
|
if (flash != null)
|
|
|
|
{
|
|
|
|
player.SetSafeFlash(weap, flash, random[FireRail]()&1);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-10-14 18:08:41 +00:00
|
|
|
|
2016-11-20 11:27:26 +00:00
|
|
|
int damage = GetCVar("deathmatch") ? 100 : 150;
|
|
|
|
A_RailAttack(damage, offset_xy, false); // 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-20 11:27:26 +00:00
|
|
|
A_FireRailgun(-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-20 11:27:26 +00:00
|
|
|
A_FireRailgun(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-20 11:27:26 +00:00
|
|
|
}
|