mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
- Added Species property for actors and separated Hexen's Demon1 and Demon2
into different species. SVN r1573 (trunk)
This commit is contained in:
parent
41a416f068
commit
1c61ef89eb
6 changed files with 40 additions and 8 deletions
|
@ -1,4 +1,8 @@
|
|||
May 8, 2009
|
||||
May 11, 2009
|
||||
- Added Species property for actors and separated Hexen's Demon1 and Demon2
|
||||
into different species.
|
||||
|
||||
May 8, 2009
|
||||
- Added transference of a select few flags from PowerProtection to its owner.
|
||||
- Added actor type parameters to A_PodPain() and A_MakePod().
|
||||
- The savegame path is now passed through NicePath(), since it's user-
|
||||
|
|
|
@ -608,7 +608,7 @@ public:
|
|||
bool IsHostile (AActor *other);
|
||||
|
||||
// What species am I?
|
||||
virtual const PClass *GetSpecies();
|
||||
virtual FName GetSpecies();
|
||||
|
||||
// Enter the crash state
|
||||
void Crash();
|
||||
|
@ -639,7 +639,6 @@ public:
|
|||
FRenderStyle RenderStyle; // Style to draw this actor with
|
||||
DWORD renderflags; // Different rendering flags
|
||||
FTextureID picnum; // Draw this instead of sprite if valid
|
||||
int TIDtoHate; // TID of things to hate (0 if none)
|
||||
DWORD effects; // [RH] see p_effect.h
|
||||
fixed_t alpha;
|
||||
DWORD fillcolor; // Color to draw when STYLE_Shaded
|
||||
|
@ -685,6 +684,8 @@ public:
|
|||
fixed_t SpawnPoint[3]; // For nightmare respawn
|
||||
WORD SpawnAngle;
|
||||
int skillrespawncount;
|
||||
int TIDtoHate; // TID of things to hate (0 if none)
|
||||
FNameNoInit Species;
|
||||
TObjPtr<AActor> tracer; // Thing being chased/attacked for tracers
|
||||
TObjPtr<AActor> master; // Thing which spawned this one (prevents mutual attacks)
|
||||
fixed_t floorclip; // value to use for floor clipping
|
||||
|
|
|
@ -233,7 +233,7 @@ DObject *PClass::CreateNew () const
|
|||
assert (mem != NULL);
|
||||
|
||||
// Set this object's defaults before constructing it.
|
||||
if (Defaults!=NULL)
|
||||
if (Defaults != NULL)
|
||||
memcpy (mem, Defaults, Size);
|
||||
else
|
||||
memset (mem, 0, Size);
|
||||
|
@ -274,14 +274,20 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
|
|||
type->Size = size;
|
||||
type->Pointers = NULL;
|
||||
type->ConstructNative = ConstructNative;
|
||||
if (!notnew) type->ClassIndex = m_Types.Push (type);
|
||||
if (!notnew)
|
||||
{
|
||||
type->ClassIndex = m_Types.Push (type);
|
||||
}
|
||||
type->Meta = Meta;
|
||||
|
||||
// Set up default instance of the new class.
|
||||
type->Defaults = new BYTE[size];
|
||||
memcpy (type->Defaults, Defaults, Size);
|
||||
if (size > Size)
|
||||
{
|
||||
memset (type->Defaults + Size, 0, size - Size);
|
||||
}
|
||||
|
||||
type->FlatPointers = NULL;
|
||||
type->bRuntimeClass = true;
|
||||
type->ActorInfo = NULL;
|
||||
|
|
|
@ -291,6 +291,11 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< BlockingMobj
|
||||
<< BlockingLine;
|
||||
|
||||
if (SaveVersion >= 1573)
|
||||
{
|
||||
arc << Species;
|
||||
}
|
||||
|
||||
if (arc.IsStoring ())
|
||||
{
|
||||
int convnum = 0;
|
||||
|
@ -4939,13 +4944,19 @@ bool AActor::IsTeammate (AActor *other)
|
|||
// AActor :: GetSpecies
|
||||
//
|
||||
// Species is defined as the lowest base class that is a monster
|
||||
// with no non-monster class in between. This is virtualized, so special
|
||||
// with no non-monster class in between. If the actor specifies an explicit
|
||||
// species (i.e. not 'None'), that is used. This is virtualized, so special
|
||||
// monsters can change this behavior if they like.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const PClass *AActor::GetSpecies()
|
||||
FName AActor::GetSpecies()
|
||||
{
|
||||
if (Species != NAME_None)
|
||||
{
|
||||
return Species;
|
||||
}
|
||||
|
||||
const PClass *thistype = GetClass();
|
||||
|
||||
if (GetDefaultByType(thistype)->flags3 & MF3_ISMONSTER)
|
||||
|
@ -4958,7 +4969,7 @@ const PClass *AActor::GetSpecies()
|
|||
break;
|
||||
}
|
||||
}
|
||||
return thistype;
|
||||
return thistype->TypeName;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -950,6 +950,15 @@ DEFINE_PROPERTY(gravity, F, Actor)
|
|||
if (i == 0) defaults->flags |= MF_NOGRAVITY;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(species, S, Actor)
|
||||
{
|
||||
PROP_STRING_PARM(n, 0);
|
||||
defaults->Species = n;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
|
@ -216,6 +216,7 @@ ACTOR Demon2 : Demon1 8080
|
|||
{
|
||||
Game Hexen
|
||||
Obituary "$OB_DEMON2"
|
||||
Species "Demon2"
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
|
|
Loading…
Reference in a new issue