2006-02-24 04:48:15 +00:00
|
|
|
#ifndef __A_ARTIFACTS_H__
|
|
|
|
#define __A_ARTIFACTS_H__
|
|
|
|
|
|
|
|
#include "a_pickups.h"
|
|
|
|
|
2008-06-01 07:52:33 +00:00
|
|
|
class player_t;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// A powerup is a pseudo-inventory item that applies an effect to its
|
|
|
|
// owner while it is present.
|
|
|
|
class APowerup : public AInventory
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerup, AInventory)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
virtual void Tick ();
|
|
|
|
virtual void Destroy ();
|
|
|
|
virtual bool HandlePickup (AInventory *item);
|
|
|
|
virtual AInventory *CreateCopy (AActor *other);
|
|
|
|
virtual AInventory *CreateTossable ();
|
|
|
|
virtual void Serialize (FArchive &arc);
|
2006-06-18 04:10:47 +00:00
|
|
|
virtual void OwnerDied ();
|
2006-02-24 04:48:15 +00:00
|
|
|
virtual PalEntry GetBlend ();
|
|
|
|
virtual bool DrawPowerup (int x, int y);
|
|
|
|
|
|
|
|
int EffectTics;
|
|
|
|
PalEntry BlendColor;
|
2009-06-30 22:10:51 +00:00
|
|
|
FNameNoInit Mode;
|
|
|
|
fixed_t Strength;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void InitEffect ();
|
|
|
|
virtual void DoEffect ();
|
|
|
|
virtual void EndEffect ();
|
2013-02-23 03:25:33 +00:00
|
|
|
|
|
|
|
friend void EndAllPowerupEffects(AInventory *item);
|
|
|
|
friend void InitAllPowerupEffects(AInventory *item);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// An artifact is an item that gives the player a powerup when activated.
|
|
|
|
class APowerupGiver : public AInventory
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerupGiver, AInventory)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
virtual bool Use (bool pickup);
|
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
const PClass *PowerupType;
|
2006-02-24 04:48:15 +00:00
|
|
|
int EffectTics; // Non-0 to override the powerup's default tics
|
|
|
|
PalEntry BlendColor; // Non-0 to override the powerup's default blend
|
2009-06-30 22:10:51 +00:00
|
|
|
FNameNoInit Mode; // Meaning depends on powerup - used for Invulnerability and Invisibility
|
|
|
|
fixed_t Strength; // Meaning depends on powerup - currently used only by Invisibility
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerInvulnerable : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerInvulnerable, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
2011-07-06 13:00:51 +00:00
|
|
|
int AlterWeaponSprite (visstyle_t *vis);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerStrength : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerStrength, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
PalEntry GetBlend ();
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
2007-01-12 15:24:10 +00:00
|
|
|
void Tick ();
|
2006-02-24 04:48:15 +00:00
|
|
|
bool HandlePickup (AInventory *item);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerInvisibility : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerInvisibility, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
2009-06-30 22:10:51 +00:00
|
|
|
bool HandlePickup (AInventory *item);
|
2006-02-24 04:48:15 +00:00
|
|
|
void InitEffect ();
|
2007-01-12 15:24:10 +00:00
|
|
|
void DoEffect ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void EndEffect ();
|
2011-07-06 13:00:51 +00:00
|
|
|
int AlterWeaponSprite (visstyle_t *vis);
|
2009-09-14 19:44:14 +00:00
|
|
|
// FRenderStyle OwnersNormalStyle;
|
|
|
|
// fixed_t OwnersNormalAlpha;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerIronFeet : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerIronFeet, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
2006-10-31 14:53:21 +00:00
|
|
|
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
2010-06-13 10:38:38 +00:00
|
|
|
void DoEffect ();
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerMask : public APowerIronFeet
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerMask, APowerIronFeet)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
2006-10-31 14:53:21 +00:00
|
|
|
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
2006-02-24 04:48:15 +00:00
|
|
|
void DoEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerLightAmp : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerLightAmp, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTorch : public APowerLightAmp
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerTorch, APowerLightAmp)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
int NewTorch, NewTorchDelta;
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerFlight : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerFlight, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
bool DrawPowerup (int x, int y);
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
2007-01-12 15:24:10 +00:00
|
|
|
void Tick ();
|
2006-02-24 04:48:15 +00:00
|
|
|
void EndEffect ();
|
|
|
|
|
|
|
|
bool HitCenterFrame;
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerWeaponLevel2 : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerWeaponLevel2, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerSpeed : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerSpeed, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
2013-02-19 02:44:49 +00:00
|
|
|
void Serialize(FArchive &arc);
|
2007-05-12 11:14:09 +00:00
|
|
|
fixed_t GetSpeedFactor();
|
2013-02-19 02:44:49 +00:00
|
|
|
public:
|
|
|
|
int SpeedFlags;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2013-02-19 02:44:49 +00:00
|
|
|
#define PSF_NOTRAIL 1
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class APowerMinotaur : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerMinotaur, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerScanner : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerScanner, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTargeter : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerTargeter, APowerup)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
void PositionAccuracy ();
|
|
|
|
void Travelled ();
|
|
|
|
};
|
|
|
|
|
2006-05-13 12:41:15 +00:00
|
|
|
class APowerFrightener : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerFrightener, APowerup)
|
2006-05-13 12:41:15 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
2007-05-01 15:09:44 +00:00
|
|
|
class APowerTimeFreezer : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerTimeFreezer, APowerup )
|
2007-05-01 15:09:44 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void DoEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
2007-05-10 22:22:38 +00:00
|
|
|
class APowerDamage : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerDamage, APowerup )
|
2007-05-10 22:22:38 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerProtection : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerProtection, APowerup )
|
2007-05-10 22:22:38 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerDrain : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerDrain, APowerup )
|
2007-05-10 22:22:38 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerRegeneration : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerRegeneration, APowerup )
|
2007-05-10 22:22:38 +00:00
|
|
|
protected:
|
2012-05-11 04:05:55 +00:00
|
|
|
void DoEffect();
|
2007-05-10 22:22:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerHighJump : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerHighJump, APowerup )
|
2007-05-10 22:22:38 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
2009-05-26 01:16:39 +00:00
|
|
|
class APowerDoubleFiringSpeed : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerDoubleFiringSpeed, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
2009-06-07 16:48:42 +00:00
|
|
|
class APowerInfiniteAmmo : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerInfiniteAmmo, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
2008-04-08 08:53:42 +00:00
|
|
|
class APowerMorph : public APowerup
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS( APowerMorph, APowerup )
|
2008-04-08 08:53:42 +00:00
|
|
|
public:
|
|
|
|
void Serialize (FArchive &arc);
|
2012-05-01 03:43:14 +00:00
|
|
|
void SetNoCallUndoMorph() { bNoCallUndoMorph = true; }
|
2007-05-10 22:22:38 +00:00
|
|
|
|
2008-04-08 08:53:42 +00:00
|
|
|
FNameNoInit PlayerClass, MorphFlash, UnMorphFlash;
|
|
|
|
int MorphStyle;
|
2007-05-01 15:09:44 +00:00
|
|
|
|
2008-04-08 08:53:42 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
// Variables
|
2008-06-01 07:52:33 +00:00
|
|
|
player_t *Player;
|
2012-05-01 03:43:14 +00:00
|
|
|
bool bNoCallUndoMorph; // Because P_UndoPlayerMorph() can call EndEffect recursively
|
2008-04-08 08:53:42 +00:00
|
|
|
};
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#endif //__A_ARTIFACTS_H__
|