- eliminated the native PowerupGiver class.
- scriptified the respawn invulnerability code into a virtual OnRespawn function for PlayerPawn so that custom effects can be implemented.
This commit is contained in:
parent
98f9219334
commit
232b64d332
17 changed files with 139 additions and 131 deletions
|
|
@ -48,35 +48,6 @@ IMPLEMENT_CLASS(APowerup, false, false)
|
|||
// Powerup-Giver -------------------------------------------------------------
|
||||
|
||||
|
||||
IMPLEMENT_CLASS(APowerupGiver, false, true)
|
||||
|
||||
IMPLEMENT_POINTERS_START(APowerupGiver)
|
||||
IMPLEMENT_POINTER(PowerupType)
|
||||
IMPLEMENT_POINTERS_END
|
||||
|
||||
DEFINE_FIELD(APowerupGiver, PowerupType)
|
||||
DEFINE_FIELD(APowerupGiver, EffectTics)
|
||||
DEFINE_FIELD(APowerupGiver, BlendColor)
|
||||
DEFINE_FIELD(APowerupGiver, Mode)
|
||||
DEFINE_FIELD(APowerupGiver, Strength)
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerupGiver :: Serialize
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerupGiver::Serialize(FSerializer &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
auto def = (APowerupGiver*)GetDefault();
|
||||
arc("poweruptype", PowerupType, def->PowerupType)
|
||||
("effecttics", EffectTics, def->EffectTics)
|
||||
("blendcolor", BlendColor, def->BlendColor)
|
||||
("mode", Mode, def->Mode)
|
||||
("strength", Strength, def->Strength);
|
||||
}
|
||||
|
||||
// Powerup -------------------------------------------------------------------
|
||||
|
||||
DEFINE_FIELD(APowerup, EffectTics)
|
||||
|
|
@ -101,4 +72,3 @@ void APowerup::Serialize(FSerializer &arc)
|
|||
("strength", Strength, def->Strength)
|
||||
("colormap", Colormap, def->Colormap);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,22 +23,4 @@ public:
|
|||
friend void EndAllPowerupEffects(AInventory *item);
|
||||
friend void InitAllPowerupEffects(AInventory *item);
|
||||
};
|
||||
|
||||
// An artifact is an item that gives the player a powerup when activated.
|
||||
class APowerupGiver : public AInventory
|
||||
{
|
||||
DECLARE_CLASS (APowerupGiver, AInventory)
|
||||
HAS_OBJECT_POINTERS
|
||||
public:
|
||||
virtual void Serialize(FSerializer &arc) override;
|
||||
|
||||
|
||||
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
|
||||
double Strength; // Meaning depends on powerup - currently used only by Invisibility
|
||||
};
|
||||
|
||||
|
||||
#endif //__A_ARTIFACTS_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue