with an FString now. - Fixed: The music strings in the default level info were never freed and caused memory leaks when used repeatedly. - Fixed: The intermusic string in the level info was never freed. - Fixed: The default fire obituary should only be printed if the damage came from the environment. If it comes from a monster the monster specific obituary should be used instead. - Added custom damage types from the floating point test release. - Changed Pain Elemental's massacre check. Now A_PainDie checks for the damage type and doesn't spawn anything if it is NAME_Massacre. A_PainDie can also be used by other actors so a more generalized approach is needed than hard coding it into the Pain Elemental. - Converted a few of Doom's monsters to DECORATE because I couldn't test the first version of the custom state code with the corpses inheriting from them. - Added custom states from last year's floating point test release and fixed some bugs I found in that code. Unfortunately it wasn't all salvageable and it was easier to recreate some parts from scratch. SVN r368 (trunk)
70 lines
1.7 KiB
C++
70 lines
1.7 KiB
C++
#ifndef __THINGDEF_H
|
|
#define __THINGDEF_H
|
|
|
|
// This class is for storing a name inside a const PClass* field without
|
|
// generating compiler warnings. It does not manipulate data in any other
|
|
// way.
|
|
class fuglyname : public FName
|
|
{
|
|
public:
|
|
fuglyname() : FName() {}
|
|
fuglyname(const char *foo) : FName(foo) {}
|
|
operator const PClass *()
|
|
{
|
|
return reinterpret_cast<const PClass *>(size_t(int(*this)));
|
|
}
|
|
fuglyname &operator= (const PClass *foo)
|
|
{
|
|
FName *p = this;
|
|
*p = ENamedName(reinterpret_cast<size_t>(foo));
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
|
|
int ParseExpression (bool _not);
|
|
|
|
int EvalExpressionI (int id, AActor *self);
|
|
float EvalExpressionF (int id, AActor *self);
|
|
bool EvalExpressionN (int id, AActor *self);
|
|
|
|
void ClearStateLabels();
|
|
void AddState (const char * statename, FState * state);
|
|
FState * FindState(AActor * actor, const PClass * type, const char * name);
|
|
void InstallStates(FActorInfo *info, AActor *defaults);
|
|
void MakeStateDefines(const FStateLabels *list);
|
|
|
|
struct FDropItem
|
|
{
|
|
FName Name;
|
|
int probability;
|
|
int amount;
|
|
FDropItem * Next;
|
|
};
|
|
|
|
FDropItem *GetDropItems(AActor * actor);
|
|
|
|
|
|
// A truly awful hack to get to the state that called an action function
|
|
// without knowing whether it has been called from a weapon or actor.
|
|
extern FState * CallingState;
|
|
int CheckIndex(int paramsize, FState ** pcallstate=NULL);
|
|
|
|
void A_ExplodeParms(AActor * self);
|
|
|
|
enum
|
|
{
|
|
ACMETA_BASE = 0x83000,
|
|
ACMETA_DropItems, // Int (index into DropItemList)
|
|
ACMETA_ExplosionDamage,
|
|
ACMETA_ExplosionRadius,
|
|
ACMETA_DontHurtShooter,
|
|
};
|
|
|
|
|
|
// The contents of string must be lowercase (for now, anyway)
|
|
int FindLineSpecialEx (const char *string, int *minargs, int *maxargs);
|
|
|
|
|
|
|
|
#endif
|