mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- scriptified PowerInfiniteAmmo to test the exported functions.
This commit is contained in:
parent
fe0f19e1e0
commit
3b524cbed4
4 changed files with 60 additions and 49 deletions
|
@ -259,7 +259,7 @@ DEFINE_ACTION_FUNCTION(APowerup, EndEffect)
|
|||
|
||||
void APowerup::CallEndEffect()
|
||||
{
|
||||
IFVIRTUAL(APowerup, InitEffect)
|
||||
IFVIRTUAL(APowerup, EndEffect)
|
||||
{
|
||||
VMValue params[1] = { (DObject*)this };
|
||||
VMFrameStack stack;
|
||||
|
@ -1993,42 +1993,3 @@ void APowerMorph::EndEffect( )
|
|||
MorphedPlayer = NULL;
|
||||
}
|
||||
|
||||
// Infinite Ammo Powerup -----------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(APowerInfiniteAmmo, false, false)
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerInfiniteAmmo :: InitEffect
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerInfiniteAmmo::InitEffect( )
|
||||
{
|
||||
Super::InitEffect();
|
||||
|
||||
if (Owner== NULL || Owner->player == NULL)
|
||||
return;
|
||||
|
||||
// Give the player infinite ammo
|
||||
Owner->player->cheats |= CF_INFINITEAMMO;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerInfiniteAmmo :: EndEffect
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerInfiniteAmmo::EndEffect( )
|
||||
{
|
||||
Super::EndEffect();
|
||||
|
||||
// Nothing to do if there's no owner.
|
||||
if (Owner != NULL && Owner->player != NULL)
|
||||
{
|
||||
// Take away the limitless ammo
|
||||
Owner->player->cheats &= ~CF_INFINITEAMMO;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -257,14 +257,6 @@ protected:
|
|||
virtual void EndEffect() override;
|
||||
};
|
||||
|
||||
class APowerInfiniteAmmo : public APowerup
|
||||
{
|
||||
DECLARE_CLASS( APowerInfiniteAmmo, APowerup )
|
||||
protected:
|
||||
virtual void InitEffect() override;
|
||||
virtual void EndEffect() override;
|
||||
};
|
||||
|
||||
class APowerMorph : public APowerup
|
||||
{
|
||||
DECLARE_CLASS( APowerMorph, APowerup )
|
||||
|
|
|
@ -1055,3 +1055,32 @@ enum EPuffFlags
|
|||
PF_HITTHINGBLEED = 8,
|
||||
PF_NORANDOMZ = 16
|
||||
};
|
||||
|
||||
enum EPlayerCheats
|
||||
{
|
||||
CF_NOCLIP = 1 << 0, // No clipping, walk through barriers.
|
||||
CF_GODMODE = 1 << 1, // No damage, no health loss.
|
||||
CF_NOVELOCITY = 1 << 2, // Not really a cheat, just a debug aid.
|
||||
CF_NOTARGET = 1 << 3, // [RH] Monsters don't target
|
||||
CF_FLY = 1 << 4, // [RH] Flying player
|
||||
CF_CHASECAM = 1 << 5, // [RH] Put camera behind player
|
||||
CF_FROZEN = 1 << 6, // [RH] Don't let the player move
|
||||
CF_REVERTPLEASE = 1 << 7, // [RH] Stick camera in player's head if (s)he moves
|
||||
CF_STEPLEFT = 1 << 9, // [RH] Play left footstep sound next time
|
||||
CF_FRIGHTENING = 1 << 10, // [RH] Scare monsters away
|
||||
CF_INSTANTWEAPSWITCH= 1 << 11, // [RH] Switch weapons instantly
|
||||
CF_TOTALLYFROZEN = 1 << 12, // [RH] All players can do is press +use
|
||||
CF_PREDICTING = 1 << 13, // [RH] Player movement is being predicted
|
||||
CF_INTERPVIEW = 1 << 14, // [RH] view was changed outside of input, so interpolate one frame
|
||||
CF_DRAIN = 1 << 16, // Player owns a drain powerup
|
||||
CF_HIGHJUMP = 1 << 18, // more Skulltag flags. Implementation not guaranteed though. ;)
|
||||
CF_REFLECTION = 1 << 19,
|
||||
CF_PROSPERITY = 1 << 20,
|
||||
CF_DOUBLEFIRINGSPEED= 1 << 21, // Player owns a double firing speed artifact
|
||||
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
|
||||
CF_INFINITEAMMO = 1 << 23, // Player owns an infinite ammo artifact
|
||||
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
|
||||
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
|
||||
CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die
|
||||
CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip
|
||||
};
|
||||
|
|
|
@ -281,11 +281,40 @@ class PowerMorph : Powerup native
|
|||
}
|
||||
}
|
||||
|
||||
class PowerInfiniteAmmo : Powerup native
|
||||
//===========================================================================
|
||||
//
|
||||
// PowerInfiniteAmmo
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
class PowerInfiniteAmmo : Powerup
|
||||
{
|
||||
Default
|
||||
{
|
||||
Powerup.Duration -30;
|
||||
}
|
||||
|
||||
override void InitEffect()
|
||||
{
|
||||
Super.InitEffect();
|
||||
|
||||
if (Owner!= null && Owner.player != null)
|
||||
{
|
||||
// Give the player infinite ammo
|
||||
Owner.player.cheats |= CF_INFINITEAMMO;
|
||||
}
|
||||
}
|
||||
|
||||
override void EndEffect()
|
||||
{
|
||||
Super.EndEffect();
|
||||
|
||||
// Nothing to do if there's no owner.
|
||||
if (Owner!= null && Owner.player != null)
|
||||
{
|
||||
// Take away the limitless ammo
|
||||
Owner.player.cheats &= ~CF_INFINITEAMMO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue