2006-02-24 04:48:15 +00:00
|
|
|
#ifndef __A_ARTIFACTS_H__
|
|
|
|
#define __A_ARTIFACTS_H__
|
|
|
|
|
|
|
|
#include "farchive.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
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#define STREAM_ENUM(e) \
|
|
|
|
inline FArchive &operator<< (FArchive &arc, e &i) \
|
|
|
|
{ \
|
|
|
|
BYTE val = (BYTE)i; \
|
|
|
|
arc << val; \
|
|
|
|
i = (e)val; \
|
|
|
|
return arc; \
|
|
|
|
}
|
|
|
|
|
|
|
|
class player_s;
|
|
|
|
|
|
|
|
// A powerup is a pseudo-inventory item that applies an effect to its
|
|
|
|
// owner while it is present.
|
|
|
|
class APowerup : public AInventory
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerup, AInventory)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerupGiver, AInventory)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerInvulnerable, APowerup)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerStrength, APowerup)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerInvisibility, APowerup)
|
|
|
|
protected:
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerGhost, APowerInvisibility)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerShadow, APowerInvisibility)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerIronFeet, APowerup)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerMask, APowerIronFeet)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerLightAmp, APowerup)
|
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTorch : public APowerLightAmp
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerTorch, APowerLightAmp)
|
|
|
|
public:
|
|
|
|
void Serialize (FArchive &arc);
|
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
int NewTorch, NewTorchDelta;
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerFlight : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerFlight, APowerup)
|
|
|
|
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
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerWeaponLevel2, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerSpeed : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerSpeed, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerMinotaur : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerMinotaur, APowerup)
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerScanner : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerScanner, APowerup)
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTargeter : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_ACTOR (APowerTargeter, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
void PositionAccuracy ();
|
|
|
|
void Travelled ();
|
|
|
|
};
|
|
|
|
|
2006-05-13 12:41:15 +00:00
|
|
|
class APowerFrightener : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_STATELESS_ACTOR (APowerFrightener, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class player_s;
|
|
|
|
|
|
|
|
#endif //__A_ARTIFACTS_H__
|