qzdoom-gpl/src/g_shared/a_artifacts.h

273 lines
5.8 KiB
C
Raw Normal View History

#ifndef __A_ARTIFACTS_H__
#define __A_ARTIFACTS_H__
#include "a_pickups.h"
May 3, 2006 (Changes by Graf Zahl) - Removed doom.x, heretic.x and strife.x from the SVN repository. These are generated files. - Fixed: A_PainDie has to check whether a valid target exists before calling IsFriend. - Fixed: FDecalLib::FindAnimator needs a signed counter to work properly. May 1, 2006 (Changes by Graf Zahl) - Added support for game specific pickup messages, if only to be able to define Raven's invulnerability item in DECORATE. - Removed A_TreeDeath because it is no longer used. - Fixed: When picking up a PowerupGiver for an active powerup the blend color and the duration were transferred to a temorary item and never took effect. They have to be trnasferred to the newly created powerup item before trying to give it to the player, not afterward. - Made the colormap of the InvulnerabilitySphere item specific. The base power class still needs to have its color adjusted per game though and since Raven's invulnerability item is used in both Hexen and Heretic it can't define its own colormap/blend. - Separated the invulnerability colormaps from the game being played and made them item specific. They can also be specified as regular blend colors in DECORATE now. - Converted a_hereticarmor.cpp and most of a_doomartifacts.cpp, a_hereticartifacts.cpp and a_heretickeys.cpp to DECORATE. - Changed the Soulsphere to be a real health item with the Dehacked modifications made in d_dehacked.cpp as for most other items which need to be adjusted. - Added IF_BIGPOWERUP flag to AInventory to expose the RESPAWN_SUPER dmflag to DECORATE. Also removed the now obsolete ShouldRespawn methods from AInvulnerabilitySphere and ABlurSphere. - Converted a_splashes.cpp to DECORATE. - Converted most of a_debris.cpp to DECORATE. SVN r73 (trunk)
2006-05-03 14:54:48 +00:00
#define INVERSECOLOR 0x00345678
#define GOLDCOLOR 0x009abcde
// [BC] More hacks!
#define REDCOLOR 0x00beefee
#define GREENCOLOR 0x00beefad
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 ();
virtual void Serialize (FArchive &arc);
virtual void OwnerDied ();
virtual PalEntry GetBlend ();
virtual bool DrawPowerup (int x, int y);
int EffectTics;
PalEntry BlendColor;
FNameNoInit mode;
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_CLASS (APowerupGiver, AInventory)
public:
virtual bool Use (bool pickup);
virtual void Serialize (FArchive &arc);
const PClass *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 - currently only of use for Invulnerability
};
class APowerInvulnerable : public APowerup
{
DECLARE_CLASS (APowerInvulnerable, APowerup)
protected:
void InitEffect ();
void DoEffect ();
void EndEffect ();
int AlterWeaponSprite (vissprite_t *vis);
};
class APowerStrength : public APowerup
{
DECLARE_CLASS (APowerStrength, APowerup)
public:
PalEntry GetBlend ();
protected:
void InitEffect ();
- Converted the StrifePlayer to DECORATE. Even though it requires exporting 3 new code pointers without general use it was necessary to handle GiveDefaultInventory consistently for all players without the need to subclass this function. - Added a Player.RunHealth property to expose the StrifePlayer's behavior of not being able to run when its health is below 10. - Changed APlayerPawn::GiveDefaultInventory so that it always adds a HexenArmor and a BasicArmor item to the inventory. If these items are not the first ones added to the inventory anything else that might absorb damage is not guaranteed to work consistently because their function depends on the order in the inventory. - Changed handling of APowerup's DoEffect so that it is called from the owner's Tick function, not the item's. This is so that the order of execution is determined by the order in the inventory. When done in the item's Tick function order depends on the global thinker table which can cause problems with the order in which conflicting powerups apply their effect. Now it is guaranteed that the item that was added to the inventory first applies its effect last. - Fixed: Added checks for Speed==0 to A_Tracer and A_Tracer2 because this could cause a divide by zero. - Fixed: P_MoveThing must also set the moved actor's previous position to prevent interpolation of the move. - Fixed: APowerInvisibility and its subclasses need to constantly update the owner's translucency information in case of interference between different subclasses. Also changed Hexen's Cleric's invulnerability mode to disable the translucency effect if an invisibility powerup is active. SVN r448 (trunk)
2007-01-12 15:24:10 +00:00
void Tick ();
bool HandlePickup (AInventory *item);
};
class APowerInvisibility : public APowerup
{
DECLARE_CLASS (APowerInvisibility, APowerup)
protected:
void CommonInit ();
void InitEffect ();
- Converted the StrifePlayer to DECORATE. Even though it requires exporting 3 new code pointers without general use it was necessary to handle GiveDefaultInventory consistently for all players without the need to subclass this function. - Added a Player.RunHealth property to expose the StrifePlayer's behavior of not being able to run when its health is below 10. - Changed APlayerPawn::GiveDefaultInventory so that it always adds a HexenArmor and a BasicArmor item to the inventory. If these items are not the first ones added to the inventory anything else that might absorb damage is not guaranteed to work consistently because their function depends on the order in the inventory. - Changed handling of APowerup's DoEffect so that it is called from the owner's Tick function, not the item's. This is so that the order of execution is determined by the order in the inventory. When done in the item's Tick function order depends on the global thinker table which can cause problems with the order in which conflicting powerups apply their effect. Now it is guaranteed that the item that was added to the inventory first applies its effect last. - Fixed: Added checks for Speed==0 to A_Tracer and A_Tracer2 because this could cause a divide by zero. - Fixed: P_MoveThing must also set the moved actor's previous position to prevent interpolation of the move. - Fixed: APowerInvisibility and its subclasses need to constantly update the owner's translucency information in case of interference between different subclasses. Also changed Hexen's Cleric's invulnerability mode to disable the translucency effect if an invisibility powerup is active. SVN r448 (trunk)
2007-01-12 15:24:10 +00:00
void DoEffect ();
void EndEffect ();
int AlterWeaponSprite (vissprite_t *vis);
};
class APowerGhost : public APowerInvisibility
{
DECLARE_CLASS (APowerGhost, APowerInvisibility)
protected:
void InitEffect ();
int AlterWeaponSprite (vissprite_t *vis);
};
class APowerShadow : public APowerInvisibility
{
DECLARE_CLASS (APowerShadow, APowerInvisibility)
protected:
bool HandlePickup (AInventory *item);
void InitEffect ();
int AlterWeaponSprite (vissprite_t *vis);
};
class APowerIronFeet : public APowerup
{
DECLARE_CLASS (APowerIronFeet, APowerup)
public:
void AbsorbDamage (int damage, FName damageType, int &newdamage);
};
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:
void Serialize (FArchive &arc);
protected:
void DoEffect ();
int NewTorch, NewTorchDelta;
};
class APowerFlight : public APowerup
{
DECLARE_CLASS (APowerFlight, APowerup)
public:
bool DrawPowerup (int x, int y);
void Serialize (FArchive &arc);
protected:
void InitEffect ();
- Converted the StrifePlayer to DECORATE. Even though it requires exporting 3 new code pointers without general use it was necessary to handle GiveDefaultInventory consistently for all players without the need to subclass this function. - Added a Player.RunHealth property to expose the StrifePlayer's behavior of not being able to run when its health is below 10. - Changed APlayerPawn::GiveDefaultInventory so that it always adds a HexenArmor and a BasicArmor item to the inventory. If these items are not the first ones added to the inventory anything else that might absorb damage is not guaranteed to work consistently because their function depends on the order in the inventory. - Changed handling of APowerup's DoEffect so that it is called from the owner's Tick function, not the item's. This is so that the order of execution is determined by the order in the inventory. When done in the item's Tick function order depends on the global thinker table which can cause problems with the order in which conflicting powerups apply their effect. Now it is guaranteed that the item that was added to the inventory first applies its effect last. - Fixed: Added checks for Speed==0 to A_Tracer and A_Tracer2 because this could cause a divide by zero. - Fixed: P_MoveThing must also set the moved actor's previous position to prevent interpolation of the move. - Fixed: APowerInvisibility and its subclasses need to constantly update the owner's translucency information in case of interference between different subclasses. Also changed Hexen's Cleric's invulnerability mode to disable the translucency effect if an invisibility powerup is active. SVN r448 (trunk)
2007-01-12 15:24:10 +00:00
void Tick ();
void EndEffect ();
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 ();
fixed_t GetSpeedFactor();
};
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 ();
};
class APowerFrightener : public APowerup
{
DECLARE_CLASS (APowerFrightener, 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 InitEffect( );
void EndEffect( );
};
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 APowerMorph : public APowerup
{
DECLARE_CLASS( APowerMorph, APowerup )
public:
void Serialize (FArchive &arc);
FNameNoInit PlayerClass, MorphFlash, UnMorphFlash;
int MorphStyle;
protected:
void InitEffect ();
void EndEffect ();
// Variables
player_t *Player;
};
#endif //__A_ARTIFACTS_H__