2006-02-24 04:48:15 +00:00
|
|
|
#ifndef __A_ARTIFACTS_H__
|
|
|
|
#define __A_ARTIFACTS_H__
|
|
|
|
|
|
|
|
#include "a_pickups.h"
|
|
|
|
|
2006-05-03 14:54:48 +00:00
|
|
|
#define INVERSECOLOR 0x00345678
|
|
|
|
#define GOLDCOLOR 0x009abcde
|
|
|
|
|
2007-01-09 16:32:44 +00:00
|
|
|
// [BC] More hacks!
|
|
|
|
#define REDCOLOR 0x00beefee
|
|
|
|
#define GREENCOLOR 0x00beefad
|
|
|
|
|
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;
|
2006-11-07 10:20:09 +00:00
|
|
|
FNameNoInit mode;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void InitEffect ();
|
|
|
|
virtual void DoEffect ();
|
|
|
|
virtual void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
// 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
|
2006-11-07 10:20:09 +00:00
|
|
|
FNameNoInit mode; // Meaning depends on powerup - currently only of use for Invulnerability
|
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 ();
|
2007-01-14 08:58:07 +00:00
|
|
|
int AlterWeaponSprite (vissprite_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-02-19 14:36:37 +00:00
|
|
|
void CommonInit ();
|
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 ();
|
2007-01-14 08:58:07 +00:00
|
|
|
int AlterWeaponSprite (vissprite_t *vis);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerGhost : public APowerInvisibility
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerGhost, APowerInvisibility)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
2007-01-14 08:58:07 +00:00
|
|
|
int AlterWeaponSprite (vissprite_t *vis);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerShadow : public APowerInvisibility
|
|
|
|
{
|
2008-08-09 11:35:42 +00:00
|
|
|
DECLARE_CLASS (APowerShadow, APowerInvisibility)
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
2007-03-08 23:34:54 +00:00
|
|
|
bool HandlePickup (AInventory *item);
|
2006-02-24 04:48:15 +00:00
|
|
|
void InitEffect ();
|
2007-01-14 08:58:07 +00:00
|
|
|
int AlterWeaponSprite (vissprite_t *vis);
|
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);
|
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 ();
|
2007-05-12 11:14:09 +00:00
|
|
|
fixed_t GetSpeedFactor();
|
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:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
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;
|
2008-04-08 08:53:42 +00:00
|
|
|
};
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
#endif //__A_ARTIFACTS_H__
|