2016-03-01 15:47:10 +00:00
|
|
|
#ifndef __A_ARTIFACTS_H__
|
|
|
|
#define __A_ARTIFACTS_H__
|
|
|
|
|
|
|
|
#include "a_pickups.h"
|
|
|
|
|
|
|
|
class player_t;
|
|
|
|
|
|
|
|
// A powerup is a pseudo-inventory item that applies an effect to its
|
|
|
|
// owner while it is present.
|
|
|
|
class APowerup : public AInventory
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerup, AInventory)
|
|
|
|
public:
|
|
|
|
virtual void Tick ();
|
|
|
|
virtual void Destroy ();
|
|
|
|
virtual bool HandlePickup (AInventory *item);
|
|
|
|
virtual AInventory *CreateCopy (AActor *other);
|
|
|
|
virtual AInventory *CreateTossable ();
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
virtual void OwnerDied ();
|
|
|
|
virtual bool GetNoTeleportFreeze();
|
|
|
|
virtual PalEntry GetBlend ();
|
|
|
|
virtual bool DrawPowerup (int x, int y);
|
|
|
|
|
|
|
|
int EffectTics;
|
|
|
|
PalEntry BlendColor;
|
|
|
|
FNameNoInit Mode;
|
2016-03-22 12:35:16 +00:00
|
|
|
double Strength;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void InitEffect ();
|
|
|
|
virtual void DoEffect ();
|
|
|
|
virtual void EndEffect ();
|
|
|
|
|
|
|
|
friend void EndAllPowerupEffects(AInventory *item);
|
|
|
|
friend void InitAllPowerupEffects(AInventory *item);
|
|
|
|
};
|
|
|
|
|
|
|
|
class PClassPowerupGiver: public PClassInventory
|
|
|
|
{
|
|
|
|
DECLARE_CLASS(PClassPowerupGiver, PClassInventory)
|
|
|
|
protected:
|
|
|
|
public:
|
|
|
|
virtual void ReplaceClassRef(PClass *oldclass, PClass *newclass);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// An artifact is an item that gives the player a powerup when activated.
|
|
|
|
class APowerupGiver : public AInventory
|
|
|
|
{
|
|
|
|
DECLARE_CLASS_WITH_META (APowerupGiver, AInventory, PClassPowerupGiver)
|
|
|
|
public:
|
|
|
|
virtual bool Use (bool pickup);
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
PClassActor *PowerupType;
|
|
|
|
int EffectTics; // Non-0 to override the powerup's default tics
|
|
|
|
PalEntry BlendColor; // Non-0 to override the powerup's default blend
|
|
|
|
FNameNoInit Mode; // Meaning depends on powerup - used for Invulnerability and Invisibility
|
2016-03-22 12:35:16 +00:00
|
|
|
double Strength; // Meaning depends on powerup - currently used only by Invisibility
|
2016-03-01 15:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class APowerInvulnerable : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerInvulnerable, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
int AlterWeaponSprite (visstyle_t *vis);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerStrength : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerStrength, APowerup)
|
|
|
|
public:
|
|
|
|
PalEntry GetBlend ();
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void Tick ();
|
|
|
|
bool HandlePickup (AInventory *item);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerInvisibility : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerInvisibility, APowerup)
|
|
|
|
protected:
|
|
|
|
bool HandlePickup (AInventory *item);
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
int AlterWeaponSprite (visstyle_t *vis);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerIronFeet : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerIronFeet, APowerup)
|
|
|
|
public:
|
|
|
|
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
|
|
|
void DoEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerMask : public APowerIronFeet
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerMask, APowerIronFeet)
|
|
|
|
public:
|
|
|
|
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
|
|
|
void DoEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerLightAmp : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerLightAmp, APowerup)
|
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTorch : public APowerLightAmp
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerTorch, APowerLightAmp)
|
|
|
|
public:
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
|
|
|
int NewTorch, NewTorchDelta;
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerFlight : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerFlight, APowerup)
|
|
|
|
public:
|
|
|
|
bool DrawPowerup (int x, int y);
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void Tick ();
|
|
|
|
void EndEffect ();
|
|
|
|
|
2016-11-23 16:34:36 +00:00
|
|
|
private:
|
2016-03-01 15:47:10 +00:00
|
|
|
bool HitCenterFrame;
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerWeaponLevel2 : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerWeaponLevel2, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerSpeed : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerSpeed, APowerup)
|
|
|
|
protected:
|
|
|
|
void DoEffect ();
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-19 23:54:18 +00:00
|
|
|
double GetSpeedFactor();
|
2016-03-01 15:47:10 +00:00
|
|
|
public:
|
|
|
|
int SpeedFlags;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define PSF_NOTRAIL 1
|
|
|
|
|
|
|
|
class APowerMinotaur : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerMinotaur, APowerup)
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerScanner : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerScanner, APowerup)
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTargeter : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerTargeter, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void DoEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
void PositionAccuracy ();
|
|
|
|
void Travelled ();
|
2016-06-02 17:19:50 +00:00
|
|
|
void AttachToOwner(AActor *other);
|
2016-03-01 15:47:10 +00:00
|
|
|
bool HandlePickup(AInventory *item);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerFrightener : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerFrightener, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerBuddha : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (APowerBuddha, APowerup)
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerTimeFreezer : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerTimeFreezer, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void DoEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerDamage : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerDamage, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerProtection : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerProtection, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerDrain : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerDrain, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerRegeneration : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerRegeneration, APowerup )
|
|
|
|
protected:
|
|
|
|
void DoEffect();
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerHighJump : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerHighJump, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerDoubleFiringSpeed : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerDoubleFiringSpeed, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerInfiniteAmmo : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerInfiniteAmmo, APowerup )
|
|
|
|
protected:
|
|
|
|
void InitEffect( );
|
|
|
|
void EndEffect( );
|
|
|
|
};
|
|
|
|
|
|
|
|
class APowerMorph : public APowerup
|
|
|
|
{
|
|
|
|
DECLARE_CLASS( APowerMorph, APowerup )
|
|
|
|
public:
|
2016-09-19 17:14:30 +00:00
|
|
|
|
2016-09-19 13:07:53 +00:00
|
|
|
virtual void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
void SetNoCallUndoMorph() { bNoCallUndoMorph = true; }
|
|
|
|
|
2016-11-23 16:34:36 +00:00
|
|
|
// Variables
|
2016-03-01 15:47:10 +00:00
|
|
|
FNameNoInit PlayerClass, MorphFlash, UnMorphFlash;
|
|
|
|
int MorphStyle;
|
2016-11-23 16:34:36 +00:00
|
|
|
player_t *Player;
|
|
|
|
bool bNoCallUndoMorph; // Because P_UndoPlayerMorph() can call EndEffect recursively
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void InitEffect ();
|
|
|
|
void EndEffect ();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__A_ARTIFACTS_H__
|