mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +00:00
- Fixed: The global WeaponSection string was never freed. It has been replaced
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)
This commit is contained in:
parent
3b2c2efcb1
commit
063c85b157
118 changed files with 2118 additions and 1833 deletions
|
@ -1,3 +1,23 @@
|
|||
October 31, 2006 (Changes by Graf Zahl)
|
||||
- Fixed: The global WeaponSection string was never freed. It has been replaced
|
||||
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.
|
||||
|
||||
October 30, 2006
|
||||
- Version bump to 2.1.7.
|
||||
- Fixed: Placing a /* */ comment at the very end of a file without a
|
||||
|
|
23
src/actor.h
23
src/actor.h
|
@ -472,7 +472,7 @@ public:
|
|||
virtual int DoSpecialDamage (AActor *target, int damage);
|
||||
|
||||
// Like DoSpecialDamage, but called on the actor receiving the damage.
|
||||
virtual int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype);
|
||||
virtual int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
|
||||
// Centaurs and ettins squeal when electrocuted, poisoned, or "holy"-ed
|
||||
virtual void Howl ();
|
||||
|
@ -699,26 +699,12 @@ public:
|
|||
fixed_t MaxDropOffHeight, MaxStepHeight;
|
||||
SDWORD Mass;
|
||||
SWORD PainChance;
|
||||
BYTE DamageType;
|
||||
FNameNoInit DamageType;
|
||||
|
||||
FState *SpawnState;
|
||||
FState *SeeState;
|
||||
FState *PainState;
|
||||
FState *MeleeState;
|
||||
FState *MissileState;
|
||||
FState *CrashState;
|
||||
FState *DeathState;
|
||||
FState *XDeathState;
|
||||
FState *BDeathState;
|
||||
FState *IDeathState;
|
||||
FState *EDeathState;
|
||||
FState *RaiseState;
|
||||
FState *WoundState;
|
||||
FState *HealState;
|
||||
FState *CrushState;
|
||||
FState *YesState;
|
||||
FState *NoState;
|
||||
FState *GreetingsState;
|
||||
|
||||
// [RH] The dialogue to show when this actor is "used."
|
||||
FStrifeDialogueNode *Conversation;
|
||||
|
@ -754,6 +740,11 @@ public:
|
|||
bool SetStateNF (FState *newstate);
|
||||
bool UpdateWaterLevel (fixed_t oldz);
|
||||
|
||||
FState *FindState (FName label) const;
|
||||
FState *FindState (int numnames, int first, ...) const;
|
||||
FState *FindState (int numnames, va_list arglist) const;
|
||||
bool HasStates (FName label) const;
|
||||
|
||||
static FState States[];
|
||||
|
||||
enum { S_NULL = 2, S_GENERICFREEZEDEATH = 3 };
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
#include "r_draw.h"
|
||||
#include "v_palette.h"
|
||||
#include "a_sharedglobal.h"
|
||||
#include "thingdef.h"
|
||||
|
||||
// [SO] Just the way Randy said to do it :)
|
||||
// [RH] Made this CVAR_SERVERINFO
|
||||
|
@ -712,6 +713,7 @@ static int PatchThing (int thingy)
|
|||
bool hadHeight = false;
|
||||
bool hadTranslucency = false;
|
||||
bool hadStyle = false;
|
||||
bool patchedStates = false;
|
||||
int oldflags;
|
||||
const PClass *type;
|
||||
SWORD *ednum, dummyed;
|
||||
|
@ -841,27 +843,38 @@ static int PatchThing (int thingy)
|
|||
{
|
||||
FState *state = FindState (val);
|
||||
|
||||
if (type != NULL && !patchedStates)
|
||||
{
|
||||
MakeStateDefines(type->ActorInfo->StateList);
|
||||
patchedStates = true;
|
||||
}
|
||||
|
||||
if (!strnicmp (Line1, "Initial", 7))
|
||||
info->SpawnState = state ? state : GetDefault<AActor>()->SpawnState;
|
||||
AddState("Spawn", state ? state : GetDefault<AActor>()->SpawnState);
|
||||
else if (!strnicmp (Line1, "First moving", 12))
|
||||
info->SeeState = state;
|
||||
AddState("See", state);
|
||||
else if (!strnicmp (Line1, "Injury", 6))
|
||||
info->PainState = state;
|
||||
AddState("Pain", state);
|
||||
else if (!strnicmp (Line1, "Close attack", 12))
|
||||
info->MeleeState = state;
|
||||
{
|
||||
if (thingy != 1) // Not for players!
|
||||
{
|
||||
AddState("Melee", state);
|
||||
}
|
||||
}
|
||||
else if (!strnicmp (Line1, "Far attack", 10))
|
||||
{
|
||||
if (thingy != 1) // Not for players!
|
||||
{
|
||||
info->MissileState = state;
|
||||
AddState("Missile", state);
|
||||
}
|
||||
}
|
||||
else if (!strnicmp (Line1, "Death", 5))
|
||||
info->DeathState = state;
|
||||
AddState("Death", state);
|
||||
else if (!strnicmp (Line1, "Exploding", 9))
|
||||
info->XDeathState = state;
|
||||
AddState("XDeath", state);
|
||||
else if (!strnicmp (Line1, "Respawn", 7))
|
||||
info->RaiseState = state;
|
||||
AddState("Raise", state);
|
||||
}
|
||||
else if (stricmp (Line1 + linelen - 6, " sound") == 0)
|
||||
{
|
||||
|
@ -979,12 +992,12 @@ static int PatchThing (int thingy)
|
|||
// Damage types that once were flags but now are not
|
||||
if (info->flags2 & 0x20000000)
|
||||
{
|
||||
info->DamageType = MOD_ICE;
|
||||
info->DamageType = NAME_Ice;
|
||||
info->flags2 &= ~0x20000000;
|
||||
}
|
||||
if (info->flags2 & 0x10000)
|
||||
{
|
||||
info->DamageType = MOD_FIRE;
|
||||
info->DamageType = NAME_Fire;
|
||||
info->flags2 &= ~0x10000;
|
||||
}
|
||||
}
|
||||
|
@ -1064,6 +1077,10 @@ static int PatchThing (int thingy)
|
|||
{
|
||||
info->flags3 &= ~MF3_ISMONSTER;
|
||||
}
|
||||
if (patchedStates)
|
||||
{
|
||||
InstallStates(type->ActorInfo, info);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1370,17 +1387,21 @@ static int PatchAmmo (int ammoNum)
|
|||
static int PatchWeapon (int weapNum)
|
||||
{
|
||||
int result;
|
||||
const PClass *type;
|
||||
AWeapon *info;
|
||||
BYTE dummy[sizeof(AWeapon)];
|
||||
bool patchedStates = false;
|
||||
|
||||
if (weapNum >= 0 && weapNum < 9)
|
||||
{
|
||||
info = (AWeapon *)GetDefaultByName (WeaponNames[weapNum]);
|
||||
type = PClass::FindClass(WeaponNames[weapNum]);
|
||||
info = (AWeapon *)GetDefaultByType (type);
|
||||
DPrintf ("Weapon %d\n", weapNum);
|
||||
}
|
||||
else
|
||||
{
|
||||
info = (AWeapon *)&dummy;
|
||||
type = NULL;
|
||||
Printf ("Weapon %d out of range.\n", weapNum);
|
||||
}
|
||||
|
||||
|
@ -1394,16 +1415,22 @@ static int PatchWeapon (int weapNum)
|
|||
{
|
||||
FState *state = FindState (val);
|
||||
|
||||
if (type != NULL && !patchedStates)
|
||||
{
|
||||
MakeStateDefines(type->ActorInfo->StateList);
|
||||
patchedStates = true;
|
||||
}
|
||||
|
||||
if (strnicmp (Line1, "Deselect", 8) == 0)
|
||||
info->UpState = state;
|
||||
AddState("Select", state);
|
||||
else if (strnicmp (Line1, "Select", 6) == 0)
|
||||
info->DownState = state;
|
||||
AddState("Deselect", state);
|
||||
else if (strnicmp (Line1, "Bobbing", 7) == 0)
|
||||
info->ReadyState = state;
|
||||
AddState("Ready", state);
|
||||
else if (strnicmp (Line1, "Shooting", 8) == 0)
|
||||
info->AtkState = info->HoldAtkState = state;
|
||||
AddState("Fire", state);
|
||||
else if (strnicmp (Line1, "Firing", 6) == 0)
|
||||
info->FlashState = state;
|
||||
AddState("Flash", state);
|
||||
}
|
||||
else if (stricmp (Line1, "Ammo type") == 0)
|
||||
{
|
||||
|
@ -1458,6 +1485,11 @@ static int PatchWeapon (int weapNum)
|
|||
info->AmmoUse1 = 0;
|
||||
}
|
||||
|
||||
if (patchedStates)
|
||||
{
|
||||
InstallStates(type->ActorInfo, info);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -2446,7 +2478,7 @@ static bool LoadDehSupp ()
|
|||
StateMap[i].State = def->SpawnState;
|
||||
break;
|
||||
case DeathState:
|
||||
StateMap[i].State = def->DeathState;
|
||||
StateMap[i].State = type->ActorInfo->FindStateExact(1, NAME_Death);
|
||||
break;
|
||||
}
|
||||
StateMap[i].StateSpan = supp[6+i*4+3];
|
||||
|
|
|
@ -345,6 +345,7 @@ static void ParseDecorate (void (*process)(FState *, int))
|
|||
info = type->ActorInfo;
|
||||
info->GameFilter = 0x80;
|
||||
Decorations.Push (info);
|
||||
ClearStateLabels();
|
||||
|
||||
SC_MustGetString ();
|
||||
while (!SC_Compare ("{"))
|
||||
|
@ -482,7 +483,7 @@ static void ParseDecorate (void (*process)(FState *, int))
|
|||
if (extra.DeathHeight == 0) extra.DeathHeight = ((AActor*)(type->Defaults))->height;
|
||||
info->Class->Meta.SetMetaFixed (AMETA_DeathHeight, extra.DeathHeight);
|
||||
}
|
||||
((AActor *)(type->Defaults))->DeathState = &info->OwnedStates[extra.DeathStart];
|
||||
AddState("Death", &info->OwnedStates[extra.DeathStart]);
|
||||
}
|
||||
|
||||
// Burn states are the same as death states, except they can optionally terminate
|
||||
|
@ -521,7 +522,7 @@ static void ParseDecorate (void (*process)(FState *, int))
|
|||
if (extra.BurnHeight == 0) extra.BurnHeight = ((AActor*)(type->Defaults))->height;
|
||||
type->Meta.SetMetaFixed (AMETA_BurnHeight, extra.BurnHeight);
|
||||
|
||||
((AActor *)(type->Defaults))->BDeathState = &info->OwnedStates[extra.FireDeathStart];
|
||||
AddState("Burn", &info->OwnedStates[extra.FireDeathStart]);
|
||||
}
|
||||
|
||||
// Ice states are similar to burn and death, except their final frame enters
|
||||
|
@ -542,11 +543,11 @@ static void ParseDecorate (void (*process)(FState *, int))
|
|||
info->OwnedStates[i].Tics = 2;
|
||||
info->OwnedStates[i].Misc1 = 0;
|
||||
info->OwnedStates[i].Action = A_FreezeDeathChunks;
|
||||
((AActor *)(type->Defaults))->IDeathState = &info->OwnedStates[extra.IceDeathStart];
|
||||
AddState("Ice", &info->OwnedStates[extra.IceDeathStart]);
|
||||
}
|
||||
else if (extra.bGenericIceDeath)
|
||||
{
|
||||
((AActor *)(type->Defaults))->IDeathState = &AActor::States[AActor::S_GENERICFREEZEDEATH];
|
||||
AddState("Ice", &AActor::States[AActor::S_GENERICFREEZEDEATH]);
|
||||
}
|
||||
}
|
||||
if (def == DEF_BreakableDecoration)
|
||||
|
@ -557,7 +558,8 @@ static void ParseDecorate (void (*process)(FState *, int))
|
|||
{
|
||||
((AActor *)(type->Defaults))->flags |= MF_DROPOFF|MF_MISSILE;
|
||||
}
|
||||
((AActor *)(type->Defaults))->SpawnState = &info->OwnedStates[extra.SpawnStart];
|
||||
AddState("Spawn", &info->OwnedStates[extra.SpawnStart]);
|
||||
InstallStates(info, ((AActor *)(type->Defaults)));
|
||||
process (info->OwnedStates, info->NumOwnedStates);
|
||||
}
|
||||
}
|
||||
|
@ -728,15 +730,15 @@ static void ParseInsideDecoration (FActorInfo *info, AActor *defaults,
|
|||
SC_MustGetString ();
|
||||
if (SC_Compare ("Normal"))
|
||||
{
|
||||
defaults->DamageType = 0;
|
||||
defaults->DamageType = NAME_None;
|
||||
}
|
||||
else if (SC_Compare ("Ice"))
|
||||
{
|
||||
defaults->DamageType = MOD_ICE;
|
||||
defaults->DamageType = NAME_Ice;
|
||||
}
|
||||
else if (SC_Compare ("Fire"))
|
||||
{
|
||||
defaults->DamageType = MOD_FIRE;
|
||||
defaults->DamageType = NAME_Fire;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -85,6 +85,8 @@ void PClass::StaticFreeData (PClass *type)
|
|||
delete[] type->Defaults;
|
||||
type->Defaults = NULL;
|
||||
}
|
||||
type->FreeStateList ();
|
||||
|
||||
if (type->bRuntimeClass)
|
||||
{
|
||||
if (type->ActorInfo != NULL)
|
||||
|
@ -99,6 +101,7 @@ void PClass::StaticFreeData (PClass *type)
|
|||
}
|
||||
delete type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ClassReg::RegisterClass ()
|
||||
|
@ -288,3 +291,14 @@ void PClass::BuildFlatPointers ()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PClass::FreeStateList ()
|
||||
{
|
||||
if (ActorInfo != NULL && ActorInfo->StateList != NULL)
|
||||
{
|
||||
ActorInfo->StateList->Destroy();
|
||||
free (ActorInfo->StateList);
|
||||
ActorInfo->StateList = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ struct PClass
|
|||
DObject *CreateNew () const;
|
||||
PClass *CreateDerivedClass (FName name, unsigned int size);
|
||||
void BuildFlatPointers ();
|
||||
void FreeStateList();
|
||||
|
||||
// Returns true if this type is an ancestor of (or same as) the passed type.
|
||||
bool IsAncestorOf (const PClass *ti) const
|
||||
|
|
|
@ -289,29 +289,6 @@ enum
|
|||
#define FRICTION_LOW 0xf900
|
||||
#define FRICTION_FLY 0xeb00
|
||||
|
||||
// [RH] Means of death flags (based on Quake2's)
|
||||
#define MOD_UNKNOWN 0
|
||||
#define MOD_ROCKET 5
|
||||
#define MOD_R_SPLASH 6
|
||||
#define MOD_BFG_SPLASH 9
|
||||
#define MOD_WATER 12
|
||||
#define MOD_SLIME 13
|
||||
#define MOD_FIRE 14
|
||||
#define MOD_CRUSH 15
|
||||
#define MOD_TELEFRAG 16
|
||||
#define MOD_FALLING 17
|
||||
#define MOD_SUICIDE 18
|
||||
#define MOD_BARREL 19
|
||||
#define MOD_EXIT 20
|
||||
#define MOD_SPLASH 21
|
||||
#define MOD_HIT 22
|
||||
#define MOD_RAILGUN 23
|
||||
#define MOD_ICE 24
|
||||
#define MOD_DISINTEGRATE 25
|
||||
#define MOD_POISON 26
|
||||
#define MOD_ELECTRIC 27
|
||||
#define MOD_MASSACRE 1000 // Damaged by the massacre cheat
|
||||
#define MOD_FRIENDLY_FIRE 0x80000000
|
||||
|
||||
#define BLINKTHRESHOLD (4*32)
|
||||
|
||||
|
|
|
@ -708,7 +708,7 @@ bool F_CastResponder (event_t* ev)
|
|||
|
||||
// go into death frame
|
||||
castdeath = true;
|
||||
caststate = castorder[castnum].info->DeathState;
|
||||
caststate = castorder[castnum].info->FindState(NAME_Death);
|
||||
if (caststate != NULL)
|
||||
{
|
||||
casttics = caststate->GetTics();
|
||||
|
|
|
@ -152,6 +152,7 @@ static AActor *corpsehit;
|
|||
static AActor *vileobj;
|
||||
static fixed_t viletryx;
|
||||
static fixed_t viletryy;
|
||||
static FState *raisestate;
|
||||
|
||||
bool PIT_VileCheck (AActor *thing)
|
||||
{
|
||||
|
@ -164,7 +165,8 @@ bool PIT_VileCheck (AActor *thing)
|
|||
if (thing->tics != -1)
|
||||
return true; // not lying still yet
|
||||
|
||||
if (thing->RaiseState == NULL)
|
||||
raisestate = thing->FindState(NAME_Raise);
|
||||
if (raisestate == NULL)
|
||||
return true; // monster doesn't have a raise state
|
||||
|
||||
// This may be a potential problem if this is used by something other
|
||||
|
@ -253,9 +255,10 @@ void A_VileChase (AActor *self)
|
|||
|
||||
// Make the state the monster enters customizable - but leave the
|
||||
// default for Dehacked compatibility!
|
||||
if (self->HealState != NULL)
|
||||
FState * state = self->FindState(NAME_Heal);
|
||||
if (state != NULL)
|
||||
{
|
||||
self->SetState (self->HealState);
|
||||
self->SetState (state);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -264,7 +267,7 @@ void A_VileChase (AActor *self)
|
|||
S_Sound (corpsehit, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);
|
||||
info = corpsehit->GetDefault ();
|
||||
|
||||
corpsehit->SetState (info->RaiseState);
|
||||
corpsehit->SetState (raisestate);
|
||||
corpsehit->height = info->height; // [RH] Use real mobj height
|
||||
corpsehit->radius = info->radius; // [RH] Use real radius
|
||||
/*
|
||||
|
@ -390,7 +393,7 @@ void A_VileAttack (AActor *actor)
|
|||
return;
|
||||
|
||||
S_Sound (actor, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM);
|
||||
P_DamageMobj (actor->target, actor, actor, 20, MOD_UNKNOWN);
|
||||
P_DamageMobj (actor->target, actor, actor, 20, NAME_None);
|
||||
P_TraceBleed (20, actor->target);
|
||||
actor->target->momz = 1000 * FRACUNIT / actor->target->Mass;
|
||||
|
||||
|
@ -404,5 +407,5 @@ void A_VileAttack (AActor *actor)
|
|||
// move the fire between the vile and the player
|
||||
fire->x = actor->target->x - FixedMul (24*FRACUNIT, finecosine[an]);
|
||||
fire->y = actor->target->y - FixedMul (24*FRACUNIT, finesine[an]);
|
||||
P_RadiusAttack (fire, actor, 70, 70, MOD_FIRE, false);
|
||||
P_RadiusAttack (fire, actor, 70, 70, NAME_Fire, false);
|
||||
}
|
||||
|
|
|
@ -10,199 +10,6 @@
|
|||
|
||||
static FRandom pr_bruisattack ("BruisAttack");
|
||||
|
||||
void A_BruisAttack (AActor *);
|
||||
|
||||
class ABaronOfHell : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ABaronOfHell, AActor)
|
||||
};
|
||||
|
||||
FState ABaronOfHell::States[] =
|
||||
{
|
||||
#define S_BOSS_STND 0
|
||||
S_NORMAL (BOSS, 'A', 10, A_Look , &States[S_BOSS_STND+1]),
|
||||
S_NORMAL (BOSS, 'B', 10, A_Look , &States[S_BOSS_STND]),
|
||||
|
||||
#define S_BOSS_RUN (S_BOSS_STND+2)
|
||||
S_NORMAL (BOSS, 'A', 3, A_Chase , &States[S_BOSS_RUN+1]),
|
||||
S_NORMAL (BOSS, 'A', 3, A_Chase , &States[S_BOSS_RUN+2]),
|
||||
S_NORMAL (BOSS, 'B', 3, A_Chase , &States[S_BOSS_RUN+3]),
|
||||
S_NORMAL (BOSS, 'B', 3, A_Chase , &States[S_BOSS_RUN+4]),
|
||||
S_NORMAL (BOSS, 'C', 3, A_Chase , &States[S_BOSS_RUN+5]),
|
||||
S_NORMAL (BOSS, 'C', 3, A_Chase , &States[S_BOSS_RUN+6]),
|
||||
S_NORMAL (BOSS, 'D', 3, A_Chase , &States[S_BOSS_RUN+7]),
|
||||
S_NORMAL (BOSS, 'D', 3, A_Chase , &States[S_BOSS_RUN+0]),
|
||||
|
||||
#define S_BOSS_ATK (S_BOSS_RUN+8)
|
||||
S_NORMAL (BOSS, 'E', 8, A_FaceTarget , &States[S_BOSS_ATK+1]),
|
||||
S_NORMAL (BOSS, 'F', 8, A_FaceTarget , &States[S_BOSS_ATK+2]),
|
||||
S_NORMAL (BOSS, 'G', 8, A_BruisAttack , &States[S_BOSS_RUN+0]),
|
||||
|
||||
#define S_BOSS_PAIN (S_BOSS_ATK+3)
|
||||
S_NORMAL (BOSS, 'H', 2, NULL , &States[S_BOSS_PAIN+1]),
|
||||
S_NORMAL (BOSS, 'H', 2, A_Pain , &States[S_BOSS_RUN+0]),
|
||||
|
||||
#define S_BOSS_DIE (S_BOSS_PAIN+2)
|
||||
S_NORMAL (BOSS, 'I', 8, NULL , &States[S_BOSS_DIE+1]),
|
||||
S_NORMAL (BOSS, 'J', 8, A_Scream , &States[S_BOSS_DIE+2]),
|
||||
S_NORMAL (BOSS, 'K', 8, NULL , &States[S_BOSS_DIE+3]),
|
||||
S_NORMAL (BOSS, 'L', 8, A_NoBlocking , &States[S_BOSS_DIE+4]),
|
||||
S_NORMAL (BOSS, 'M', 8, NULL , &States[S_BOSS_DIE+5]),
|
||||
S_NORMAL (BOSS, 'N', 8, NULL , &States[S_BOSS_DIE+6]),
|
||||
S_NORMAL (BOSS, 'O', -1, A_BossDeath , NULL),
|
||||
|
||||
#define S_BOSS_RAISE (S_BOSS_DIE+7)
|
||||
S_NORMAL (BOSS, 'O', 8, NULL , &States[S_BOSS_RAISE+1]),
|
||||
S_NORMAL (BOSS, 'N', 8, NULL , &States[S_BOSS_RAISE+2]),
|
||||
S_NORMAL (BOSS, 'M', 8, NULL , &States[S_BOSS_RAISE+3]),
|
||||
S_NORMAL (BOSS, 'L', 8, NULL , &States[S_BOSS_RAISE+4]),
|
||||
S_NORMAL (BOSS, 'K', 8, NULL , &States[S_BOSS_RAISE+5]),
|
||||
S_NORMAL (BOSS, 'J', 8, NULL , &States[S_BOSS_RAISE+6]),
|
||||
S_NORMAL (BOSS, 'I', 8, NULL , &States[S_BOSS_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ABaronOfHell, Doom, 3003, 3)
|
||||
PROP_SpawnHealth (1000)
|
||||
PROP_RadiusFixed (24)
|
||||
PROP_HeightFixed (64)
|
||||
PROP_Mass (1000)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (50)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
PROP_Flags4 (MF4_BOSSDEATH)
|
||||
|
||||
PROP_SpawnState (S_BOSS_STND)
|
||||
PROP_SeeState (S_BOSS_RUN)
|
||||
PROP_PainState (S_BOSS_PAIN)
|
||||
PROP_MeleeState (S_BOSS_ATK)
|
||||
PROP_MissileState (S_BOSS_ATK)
|
||||
PROP_DeathState (S_BOSS_DIE)
|
||||
PROP_RaiseState (S_BOSS_RAISE)
|
||||
|
||||
PROP_SeeSound ("baron/sight")
|
||||
PROP_PainSound ("baron/pain")
|
||||
PROP_DeathSound ("baron/death")
|
||||
PROP_ActiveSound ("baron/active")
|
||||
PROP_Obituary("$OB_BARON")
|
||||
PROP_HitObituary("$OB_BARONHIT")
|
||||
|
||||
END_DEFAULTS
|
||||
|
||||
class ABaronBall : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ABaronBall, AActor)
|
||||
};
|
||||
|
||||
FState ABaronBall::States[] =
|
||||
{
|
||||
#define S_BRBALL 0
|
||||
S_BRIGHT (BAL7, 'A', 4, NULL , &States[S_BRBALL+1]),
|
||||
S_BRIGHT (BAL7, 'B', 4, NULL , &States[S_BRBALL+0]),
|
||||
|
||||
#define S_BRBALLX (S_BRBALL+2)
|
||||
S_BRIGHT (BAL7, 'C', 6, NULL , &States[S_BRBALLX+1]),
|
||||
S_BRIGHT (BAL7, 'D', 6, NULL , &States[S_BRBALLX+2]),
|
||||
S_BRIGHT (BAL7, 'E', 6, NULL , NULL)
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ABaronBall, Doom, -1, 154)
|
||||
PROP_RadiusFixed (6)
|
||||
PROP_HeightFixed (16)
|
||||
PROP_SpeedFixed (15)
|
||||
PROP_Damage (8)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
|
||||
PROP_Flags4 (MF4_RANDOMIZE)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
||||
PROP_SpawnState (S_BRBALL)
|
||||
PROP_DeathState (S_BRBALLX)
|
||||
|
||||
PROP_SeeSound ("baron/attack")
|
||||
PROP_DeathSound ("baron/shotx")
|
||||
END_DEFAULTS
|
||||
|
||||
AT_SPEED_SET (BaronBall, speed)
|
||||
{
|
||||
SimpleSpeedSetter (ABaronBall, 15*FRACUNIT, 20*FRACUNIT, speed);
|
||||
}
|
||||
|
||||
class AHellKnight : public ABaronOfHell
|
||||
{
|
||||
DECLARE_ACTOR (AHellKnight, ABaronOfHell)
|
||||
};
|
||||
|
||||
FState AHellKnight::States[] =
|
||||
{
|
||||
#define S_BOS2_STND 0
|
||||
S_NORMAL (BOS2, 'A', 10, A_Look , &States[S_BOS2_STND+1]),
|
||||
S_NORMAL (BOS2, 'B', 10, A_Look , &States[S_BOS2_STND]),
|
||||
|
||||
#define S_BOS2_RUN (S_BOS2_STND+2)
|
||||
S_NORMAL (BOS2, 'A', 3, A_Chase , &States[S_BOS2_RUN+1]),
|
||||
S_NORMAL (BOS2, 'A', 3, A_Chase , &States[S_BOS2_RUN+2]),
|
||||
S_NORMAL (BOS2, 'B', 3, A_Chase , &States[S_BOS2_RUN+3]),
|
||||
S_NORMAL (BOS2, 'B', 3, A_Chase , &States[S_BOS2_RUN+4]),
|
||||
S_NORMAL (BOS2, 'C', 3, A_Chase , &States[S_BOS2_RUN+5]),
|
||||
S_NORMAL (BOS2, 'C', 3, A_Chase , &States[S_BOS2_RUN+6]),
|
||||
S_NORMAL (BOS2, 'D', 3, A_Chase , &States[S_BOS2_RUN+7]),
|
||||
S_NORMAL (BOS2, 'D', 3, A_Chase , &States[S_BOS2_RUN+0]),
|
||||
|
||||
#define S_BOS2_ATK (S_BOS2_RUN+8)
|
||||
S_NORMAL (BOS2, 'E', 8, A_FaceTarget , &States[S_BOS2_ATK+1]),
|
||||
S_NORMAL (BOS2, 'F', 8, A_FaceTarget , &States[S_BOS2_ATK+2]),
|
||||
S_NORMAL (BOS2, 'G', 8, A_BruisAttack , &States[S_BOS2_RUN+0]),
|
||||
|
||||
#define S_BOS2_PAIN (S_BOS2_ATK+3)
|
||||
S_NORMAL (BOS2, 'H', 2, NULL , &States[S_BOS2_PAIN+1]),
|
||||
S_NORMAL (BOS2, 'H', 2, A_Pain , &States[S_BOS2_RUN+0]),
|
||||
|
||||
#define S_BOS2_DIE (S_BOS2_PAIN+2)
|
||||
S_NORMAL (BOS2, 'I', 8, NULL , &States[S_BOS2_DIE+1]),
|
||||
S_NORMAL (BOS2, 'J', 8, A_Scream , &States[S_BOS2_DIE+2]),
|
||||
S_NORMAL (BOS2, 'K', 8, NULL , &States[S_BOS2_DIE+3]),
|
||||
S_NORMAL (BOS2, 'L', 8, A_NoBlocking , &States[S_BOS2_DIE+4]),
|
||||
S_NORMAL (BOS2, 'M', 8, NULL , &States[S_BOS2_DIE+5]),
|
||||
S_NORMAL (BOS2, 'N', 8, NULL , &States[S_BOS2_DIE+6]),
|
||||
S_NORMAL (BOS2, 'O', -1, NULL , NULL),
|
||||
|
||||
#define S_BOS2_RAISE (S_BOS2_DIE+7)
|
||||
S_NORMAL (BOS2, 'O', 8, NULL , &States[S_BOS2_RAISE+1]),
|
||||
S_NORMAL (BOS2, 'N', 8, NULL , &States[S_BOS2_RAISE+2]),
|
||||
S_NORMAL (BOS2, 'M', 8, NULL , &States[S_BOS2_RAISE+3]),
|
||||
S_NORMAL (BOS2, 'L', 8, NULL , &States[S_BOS2_RAISE+4]),
|
||||
S_NORMAL (BOS2, 'K', 8, NULL , &States[S_BOS2_RAISE+5]),
|
||||
S_NORMAL (BOS2, 'J', 8, NULL , &States[S_BOS2_RAISE+6]),
|
||||
S_NORMAL (BOS2, 'I', 8, NULL , &States[S_BOS2_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AHellKnight, Doom, 69, 113)
|
||||
PROP_SpawnHealth (500)
|
||||
PROP_RadiusFixed (24)
|
||||
PROP_HeightFixed (64)
|
||||
PROP_Mass (1000)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (50)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
PROP_Flags4Clear (MF4_BOSSDEATH)
|
||||
|
||||
PROP_SpawnState (S_BOS2_STND)
|
||||
PROP_SeeState (S_BOS2_RUN)
|
||||
PROP_PainState (S_BOS2_PAIN)
|
||||
PROP_MeleeState (S_BOS2_ATK)
|
||||
PROP_MissileState (S_BOS2_ATK)
|
||||
PROP_DeathState (S_BOS2_DIE)
|
||||
PROP_RaiseState (S_BOS2_RAISE)
|
||||
|
||||
PROP_SeeSound ("knight/sight")
|
||||
PROP_PainSound ("knight/pain")
|
||||
PROP_DeathSound ("knight/death")
|
||||
PROP_ActiveSound ("knight/active")
|
||||
PROP_Obituary("$OB_KNIGHT")
|
||||
PROP_HitObituary("$OB_KNIGHTHIT")
|
||||
END_DEFAULTS
|
||||
|
||||
void A_BruisAttack (AActor *self)
|
||||
{
|
||||
|
@ -213,11 +20,11 @@ void A_BruisAttack (AActor *self)
|
|||
{
|
||||
int damage = (pr_bruisattack()%8+1)*10;
|
||||
S_Sound (self, CHAN_WEAPON, "baron/melee", 1, ATTN_NORM);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
return;
|
||||
}
|
||||
|
||||
// launch a missile
|
||||
P_SpawnMissile (self, self->target, RUNTIME_CLASS(ABaronBall));
|
||||
P_SpawnMissile (self, self->target, PClass::FindClass("BaronBall"));
|
||||
}
|
||||
|
|
|
@ -9,113 +9,6 @@
|
|||
|
||||
static FRandom pr_headattack ("HeadAttack");
|
||||
|
||||
void A_HeadAttack (AActor *);
|
||||
|
||||
class ACacodemon : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ACacodemon, AActor)
|
||||
};
|
||||
|
||||
FState ACacodemon::States[] =
|
||||
{
|
||||
#define S_HEAD_STND 0
|
||||
S_NORMAL (HEAD, 'A', 10, A_Look , &States[S_HEAD_STND]),
|
||||
|
||||
#define S_HEAD_RUN (S_HEAD_STND+1)
|
||||
S_NORMAL (HEAD, 'A', 3, A_Chase , &States[S_HEAD_RUN+0]),
|
||||
|
||||
#define S_HEAD_ATK (S_HEAD_RUN+1)
|
||||
S_NORMAL (HEAD, 'B', 5, A_FaceTarget , &States[S_HEAD_ATK+1]),
|
||||
S_NORMAL (HEAD, 'C', 5, A_FaceTarget , &States[S_HEAD_ATK+2]),
|
||||
S_BRIGHT (HEAD, 'D', 5, A_HeadAttack , &States[S_HEAD_RUN+0]),
|
||||
|
||||
#define S_HEAD_PAIN (S_HEAD_ATK+3)
|
||||
S_NORMAL (HEAD, 'E', 3, NULL , &States[S_HEAD_PAIN+1]),
|
||||
S_NORMAL (HEAD, 'E', 3, A_Pain , &States[S_HEAD_PAIN+2]),
|
||||
S_NORMAL (HEAD, 'F', 6, NULL , &States[S_HEAD_RUN+0]),
|
||||
|
||||
#define S_HEAD_DIE (S_HEAD_PAIN+3)
|
||||
S_NORMAL (HEAD, 'G', 8, NULL , &States[S_HEAD_DIE+1]),
|
||||
S_NORMAL (HEAD, 'H', 8, A_Scream , &States[S_HEAD_DIE+2]),
|
||||
S_NORMAL (HEAD, 'I', 8, NULL , &States[S_HEAD_DIE+3]),
|
||||
S_NORMAL (HEAD, 'J', 8, NULL , &States[S_HEAD_DIE+4]),
|
||||
S_NORMAL (HEAD, 'K', 8, A_NoBlocking , &States[S_HEAD_DIE+5]),
|
||||
S_NORMAL (HEAD, 'L', -1, A_SetFloorClip , NULL),
|
||||
|
||||
#define S_HEAD_RAISE (S_HEAD_DIE+6)
|
||||
S_NORMAL (HEAD, 'L', 8, A_UnSetFloorClip , &States[S_HEAD_RAISE+1]),
|
||||
S_NORMAL (HEAD, 'K', 8, NULL , &States[S_HEAD_RAISE+2]),
|
||||
S_NORMAL (HEAD, 'J', 8, NULL , &States[S_HEAD_RAISE+3]),
|
||||
S_NORMAL (HEAD, 'I', 8, NULL , &States[S_HEAD_RAISE+4]),
|
||||
S_NORMAL (HEAD, 'H', 8, NULL , &States[S_HEAD_RAISE+5]),
|
||||
S_NORMAL (HEAD, 'G', 8, NULL , &States[S_HEAD_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ACacodemon, Doom, 3005, 19)
|
||||
PROP_SpawnHealth (400)
|
||||
PROP_RadiusFixed (31)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (400)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (128)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_FLOAT|MF_NOGRAVITY|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL)
|
||||
|
||||
PROP_SpawnState (S_HEAD_STND)
|
||||
PROP_SeeState (S_HEAD_RUN)
|
||||
PROP_PainState (S_HEAD_PAIN)
|
||||
PROP_MissileState (S_HEAD_ATK)
|
||||
PROP_DeathState (S_HEAD_DIE)
|
||||
PROP_RaiseState (S_HEAD_RAISE)
|
||||
|
||||
PROP_SeeSound ("caco/sight")
|
||||
PROP_PainSound ("caco/pain")
|
||||
PROP_DeathSound ("caco/death")
|
||||
PROP_ActiveSound ("caco/active")
|
||||
PROP_AttackSound ("caco/melee")
|
||||
PROP_Obituary("$OB_CACO")
|
||||
PROP_HitObituary("$OB_CACOHIT")
|
||||
END_DEFAULTS
|
||||
|
||||
class ACacodemonBall : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ACacodemonBall, AActor)
|
||||
};
|
||||
|
||||
FState ACacodemonBall::States[] =
|
||||
{
|
||||
#define S_RBALL 0
|
||||
S_BRIGHT (BAL2, 'A', 4, NULL , &States[S_RBALL+1]),
|
||||
S_BRIGHT (BAL2, 'B', 4, NULL , &States[S_RBALL+0]),
|
||||
|
||||
#define S_RBALLX (S_RBALL+2)
|
||||
S_BRIGHT (BAL2, 'C', 6, NULL , &States[S_RBALLX+1]),
|
||||
S_BRIGHT (BAL2, 'D', 6, NULL , &States[S_RBALLX+2]),
|
||||
S_BRIGHT (BAL2, 'E', 6, NULL , NULL)
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ACacodemonBall, Doom, -1, 126)
|
||||
PROP_RadiusFixed (6)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_SpeedFixed (10)
|
||||
PROP_Damage (5)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
|
||||
PROP_Flags4 (MF4_RANDOMIZE)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
||||
PROP_SpawnState (S_RBALL)
|
||||
PROP_DeathState (S_RBALLX)
|
||||
|
||||
PROP_SeeSound ("caco/attack")
|
||||
PROP_DeathSound ("caco/shotx")
|
||||
END_DEFAULTS
|
||||
|
||||
AT_SPEED_SET (CacodemonBall, speed)
|
||||
{
|
||||
SimpleSpeedSetter (ACacodemonBall, 10*FRACUNIT, 20*FRACUNIT, speed);
|
||||
}
|
||||
|
||||
void A_HeadAttack (AActor *self)
|
||||
{
|
||||
if (!self->target)
|
||||
|
@ -126,11 +19,11 @@ void A_HeadAttack (AActor *self)
|
|||
{
|
||||
int damage = (pr_headattack()%6+1)*10;
|
||||
S_SoundID (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
return;
|
||||
}
|
||||
|
||||
// launch a missile
|
||||
P_SpawnMissile (self, self->target, RUNTIME_CLASS(ACacodemonBall));
|
||||
P_SpawnMissile (self, self->target, PClass::FindClass("CacodemonBall"));
|
||||
}
|
||||
|
|
|
@ -8,99 +8,6 @@
|
|||
|
||||
static FRandom pr_sargattack ("SargAttack");
|
||||
|
||||
void A_SargAttack (AActor *);
|
||||
|
||||
class ADemon : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ADemon, AActor)
|
||||
};
|
||||
|
||||
FState ADemon::States[] =
|
||||
{
|
||||
#define S_SARG_STND 0
|
||||
S_NORMAL (SARG, 'A', 10, A_Look , &States[S_SARG_STND+1]),
|
||||
S_NORMAL (SARG, 'B', 10, A_Look , &States[S_SARG_STND]),
|
||||
|
||||
#define S_SARG_RUN (S_SARG_STND+2)
|
||||
S_NORMAL (SARG, 'A', 2, A_Chase , &States[S_SARG_RUN+1]),
|
||||
S_NORMAL (SARG, 'A', 2, A_Chase , &States[S_SARG_RUN+2]),
|
||||
S_NORMAL (SARG, 'B', 2, A_Chase , &States[S_SARG_RUN+3]),
|
||||
S_NORMAL (SARG, 'B', 2, A_Chase , &States[S_SARG_RUN+4]),
|
||||
S_NORMAL (SARG, 'C', 2, A_Chase , &States[S_SARG_RUN+5]),
|
||||
S_NORMAL (SARG, 'C', 2, A_Chase , &States[S_SARG_RUN+6]),
|
||||
S_NORMAL (SARG, 'D', 2, A_Chase , &States[S_SARG_RUN+7]),
|
||||
S_NORMAL (SARG, 'D', 2, A_Chase , &States[S_SARG_RUN+0]),
|
||||
|
||||
#define S_SARG_ATK (S_SARG_RUN+8)
|
||||
S_NORMAL (SARG, 'E', 8, A_FaceTarget , &States[S_SARG_ATK+1]),
|
||||
S_NORMAL (SARG, 'F', 8, A_FaceTarget , &States[S_SARG_ATK+2]),
|
||||
S_NORMAL (SARG, 'G', 8, A_SargAttack , &States[S_SARG_RUN+0]),
|
||||
|
||||
#define S_SARG_PAIN (S_SARG_ATK+3)
|
||||
S_NORMAL (SARG, 'H', 2, NULL , &States[S_SARG_PAIN+1]),
|
||||
S_NORMAL (SARG, 'H', 2, A_Pain , &States[S_SARG_RUN+0]),
|
||||
|
||||
#define S_SARG_DIE (S_SARG_PAIN+2)
|
||||
S_NORMAL (SARG, 'I', 8, NULL , &States[S_SARG_DIE+1]),
|
||||
S_NORMAL (SARG, 'J', 8, A_Scream , &States[S_SARG_DIE+2]),
|
||||
S_NORMAL (SARG, 'K', 4, NULL , &States[S_SARG_DIE+3]),
|
||||
S_NORMAL (SARG, 'L', 4, A_NoBlocking , &States[S_SARG_DIE+4]),
|
||||
S_NORMAL (SARG, 'M', 4, NULL , &States[S_SARG_DIE+5]),
|
||||
S_NORMAL (SARG, 'N', -1, NULL , NULL),
|
||||
|
||||
#define S_SARG_RAISE (S_SARG_DIE+6)
|
||||
S_NORMAL (SARG, 'N', 5, NULL , &States[S_SARG_RAISE+1]),
|
||||
S_NORMAL (SARG, 'M', 5, NULL , &States[S_SARG_RAISE+2]),
|
||||
S_NORMAL (SARG, 'L', 5, NULL , &States[S_SARG_RAISE+3]),
|
||||
S_NORMAL (SARG, 'K', 5, NULL , &States[S_SARG_RAISE+4]),
|
||||
S_NORMAL (SARG, 'J', 5, NULL , &States[S_SARG_RAISE+5]),
|
||||
S_NORMAL (SARG, 'I', 5, NULL , &States[S_SARG_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ADemon, Doom, 3002, 8)
|
||||
PROP_SpawnHealth (150)
|
||||
PROP_PainChance (180)
|
||||
PROP_SpeedFixed (10)
|
||||
PROP_RadiusFixed (30)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (400)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
PROP_Flags5 (MF5_FASTER|MF5_FASTMELEE)
|
||||
|
||||
PROP_SpawnState (S_SARG_STND)
|
||||
PROP_SeeState (S_SARG_RUN)
|
||||
PROP_PainState (S_SARG_PAIN)
|
||||
PROP_MeleeState (S_SARG_ATK)
|
||||
PROP_DeathState (S_SARG_DIE)
|
||||
PROP_RaiseState (S_SARG_RAISE)
|
||||
|
||||
PROP_SeeSound ("demon/sight")
|
||||
PROP_AttackSound ("demon/melee")
|
||||
PROP_PainSound ("demon/pain")
|
||||
PROP_DeathSound ("demon/death")
|
||||
PROP_ActiveSound ("demon/active")
|
||||
PROP_HitObituary("$OB_DEMONHIT")
|
||||
END_DEFAULTS
|
||||
|
||||
class ASpectre : public ADemon
|
||||
{
|
||||
DECLARE_STATELESS_ACTOR (ASpectre, ADemon)
|
||||
};
|
||||
|
||||
IMPLEMENT_STATELESS_ACTOR (ASpectre, Doom, 58, 9)
|
||||
PROP_FlagsSet (MF_SHADOW)
|
||||
PROP_RenderStyle (STYLE_OptFuzzy)
|
||||
PROP_Alpha (FRACUNIT/5)
|
||||
|
||||
PROP_SeeSound ("spectre/sight")
|
||||
PROP_AttackSound ("spectre/melee")
|
||||
PROP_PainSound ("spectre/pain")
|
||||
PROP_DeathSound ("spectre/death")
|
||||
PROP_ActiveSound ("spectre/active")
|
||||
PROP_HitObituary("$OB_SPECTREHIT")
|
||||
END_DEFAULTS
|
||||
|
||||
void A_SargAttack (AActor *self)
|
||||
{
|
||||
if (!self->target)
|
||||
|
@ -110,7 +17,7 @@ void A_SargAttack (AActor *self)
|
|||
if (self->CheckMeleeRange ())
|
||||
{
|
||||
int damage = ((pr_sargattack()%10)+1)*4;
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,127 +11,6 @@ static FRandom pr_troopattack ("TroopAttack");
|
|||
|
||||
void A_TroopAttack (AActor *);
|
||||
|
||||
class ADoomImp : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ADoomImp, AActor)
|
||||
};
|
||||
|
||||
FState ADoomImp::States[] =
|
||||
{
|
||||
#define S_TROO_STND 0
|
||||
S_NORMAL (TROO, 'A', 10, A_Look , &States[S_TROO_STND+1]),
|
||||
S_NORMAL (TROO, 'B', 10, A_Look , &States[S_TROO_STND]),
|
||||
|
||||
#define S_TROO_RUN (S_TROO_STND+2)
|
||||
S_NORMAL (TROO, 'A', 3, A_Chase , &States[S_TROO_RUN+1]),
|
||||
S_NORMAL (TROO, 'A', 3, A_Chase , &States[S_TROO_RUN+2]),
|
||||
S_NORMAL (TROO, 'B', 3, A_Chase , &States[S_TROO_RUN+3]),
|
||||
S_NORMAL (TROO, 'B', 3, A_Chase , &States[S_TROO_RUN+4]),
|
||||
S_NORMAL (TROO, 'C', 3, A_Chase , &States[S_TROO_RUN+5]),
|
||||
S_NORMAL (TROO, 'C', 3, A_Chase , &States[S_TROO_RUN+6]),
|
||||
S_NORMAL (TROO, 'D', 3, A_Chase , &States[S_TROO_RUN+7]),
|
||||
S_NORMAL (TROO, 'D', 3, A_Chase , &States[S_TROO_RUN+0]),
|
||||
|
||||
#define S_TROO_ATK (S_TROO_RUN+8)
|
||||
S_NORMAL (TROO, 'E', 8, A_FaceTarget , &States[S_TROO_ATK+1]),
|
||||
S_NORMAL (TROO, 'F', 8, A_FaceTarget , &States[S_TROO_ATK+2]),
|
||||
S_NORMAL (TROO, 'G', 6, A_TroopAttack , &States[S_TROO_RUN+0]),
|
||||
|
||||
#define S_TROO_PAIN (S_TROO_ATK+3)
|
||||
S_NORMAL (TROO, 'H', 2, NULL , &States[S_TROO_PAIN+1]),
|
||||
S_NORMAL (TROO, 'H', 2, A_Pain , &States[S_TROO_RUN+0]),
|
||||
|
||||
#define S_TROO_DIE (S_TROO_PAIN+2)
|
||||
S_NORMAL (TROO, 'I', 8, NULL , &States[S_TROO_DIE+1]),
|
||||
S_NORMAL (TROO, 'J', 8, A_Scream , &States[S_TROO_DIE+2]),
|
||||
S_NORMAL (TROO, 'K', 6, NULL , &States[S_TROO_DIE+3]),
|
||||
S_NORMAL (TROO, 'L', 6, A_NoBlocking , &States[S_TROO_DIE+4]),
|
||||
S_NORMAL (TROO, 'M', -1, NULL , NULL),
|
||||
|
||||
#define S_TROO_XDIE (S_TROO_DIE+5)
|
||||
S_NORMAL (TROO, 'N', 5, NULL , &States[S_TROO_XDIE+1]),
|
||||
S_NORMAL (TROO, 'O', 5, A_XScream , &States[S_TROO_XDIE+2]),
|
||||
S_NORMAL (TROO, 'P', 5, NULL , &States[S_TROO_XDIE+3]),
|
||||
S_NORMAL (TROO, 'Q', 5, A_NoBlocking , &States[S_TROO_XDIE+4]),
|
||||
S_NORMAL (TROO, 'R', 5, NULL , &States[S_TROO_XDIE+5]),
|
||||
S_NORMAL (TROO, 'S', 5, NULL , &States[S_TROO_XDIE+6]),
|
||||
S_NORMAL (TROO, 'T', 5, NULL , &States[S_TROO_XDIE+7]),
|
||||
S_NORMAL (TROO, 'U', -1, NULL , NULL),
|
||||
|
||||
#define S_TROO_RAISE (S_TROO_XDIE+8)
|
||||
S_NORMAL (TROO, 'M', 8, NULL , &States[S_TROO_RAISE+1]),
|
||||
S_NORMAL (TROO, 'L', 8, NULL , &States[S_TROO_RAISE+2]),
|
||||
S_NORMAL (TROO, 'K', 6, NULL , &States[S_TROO_RAISE+3]),
|
||||
S_NORMAL (TROO, 'J', 6, NULL , &States[S_TROO_RAISE+4]),
|
||||
S_NORMAL (TROO, 'I', 6, NULL , &States[S_TROO_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ADoomImp, Doom, 3001, 5)
|
||||
PROP_SpawnHealth (60)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (100)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (200)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
|
||||
PROP_SpawnState (S_TROO_STND)
|
||||
PROP_SeeState (S_TROO_RUN)
|
||||
PROP_PainState (S_TROO_PAIN)
|
||||
PROP_MeleeState (S_TROO_ATK)
|
||||
PROP_MissileState (S_TROO_ATK)
|
||||
PROP_DeathState (S_TROO_DIE)
|
||||
PROP_XDeathState (S_TROO_XDIE)
|
||||
PROP_RaiseState (S_TROO_RAISE)
|
||||
|
||||
PROP_SeeSound ("imp/sight")
|
||||
PROP_PainSound ("imp/pain")
|
||||
PROP_DeathSound ("imp/death")
|
||||
PROP_ActiveSound ("imp/active")
|
||||
PROP_Obituary("$OB_IMP")
|
||||
PROP_HitObituary("$OB_IMPHIT")
|
||||
END_DEFAULTS
|
||||
|
||||
class ADoomImpBall : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (ADoomImpBall, AActor)
|
||||
};
|
||||
|
||||
FState ADoomImpBall::States[] =
|
||||
{
|
||||
#define S_TBALL 0
|
||||
S_BRIGHT (BAL1, 'A', 4, NULL , &States[S_TBALL+1]),
|
||||
S_BRIGHT (BAL1, 'B', 4, NULL , &States[S_TBALL+0]),
|
||||
|
||||
#define S_TBALLX (S_TBALL+2)
|
||||
S_BRIGHT (BAL1, 'C', 6, NULL , &States[S_TBALLX+1]),
|
||||
S_BRIGHT (BAL1, 'D', 6, NULL , &States[S_TBALLX+2]),
|
||||
S_BRIGHT (BAL1, 'E', 6, NULL , NULL)
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ADoomImpBall, Doom, -1, 10)
|
||||
PROP_RadiusFixed (6)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_SpeedFixed (10)
|
||||
PROP_Damage (3)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
|
||||
PROP_Flags4 (MF4_RANDOMIZE)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
||||
PROP_SpawnState (S_TBALL)
|
||||
PROP_DeathState (S_TBALLX)
|
||||
|
||||
PROP_SeeSound ("imp/attack")
|
||||
PROP_DeathSound ("imp/shotx")
|
||||
END_DEFAULTS
|
||||
|
||||
AT_SPEED_SET (ADoomImpBall, speed)
|
||||
{
|
||||
SimpleSpeedSetter (ADoomImpBall, 10*FRACUNIT, 20*FRACUNIT, speed);
|
||||
}
|
||||
|
||||
//
|
||||
// A_TroopAttack
|
||||
//
|
||||
|
@ -145,11 +24,11 @@ void A_TroopAttack (AActor *self)
|
|||
{
|
||||
int damage = (pr_troopattack()%8+1)*3;
|
||||
S_Sound (self, CHAN_WEAPON, "imp/melee", 1, ATTN_NORM);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
return;
|
||||
}
|
||||
|
||||
// launch a missile
|
||||
P_SpawnMissile (self, self->target, RUNTIME_CLASS(ADoomImpBall));
|
||||
P_SpawnMissile (self, self->target, PClass::FindClass("DoomImpBall"));
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ void A_Punch (AActor *actor)
|
|||
|
||||
angle += pr_punch.Random2() << 18;
|
||||
pitch = P_AimLineAttack (actor, angle, MELEERANGE);
|
||||
P_LineAttack (actor, angle, MELEERANGE, pitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
P_LineAttack (actor, angle, MELEERANGE, pitch, damage, NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
|
||||
// turn to face target
|
||||
if (linetarget)
|
||||
|
@ -169,7 +169,7 @@ void A_FirePistol (AActor *actor)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
|
||||
P_SetPsprite (actor->player, ps_flash, weapon->FlashState);
|
||||
P_SetPsprite (actor->player, ps_flash, weapon->FindState(NAME_Flash));
|
||||
}
|
||||
actor->player->mo->PlayAttacking2 ();
|
||||
|
||||
|
@ -283,7 +283,7 @@ void A_Saw (AActor *actor)
|
|||
// use meleerange + 1 so the puff doesn't skip the flash (i.e. plays all states)
|
||||
P_LineAttack (actor, angle, MELEERANGE+1,
|
||||
P_AimLineAttack (actor, angle, MELEERANGE+1), damage,
|
||||
MOD_UNKNOWN, pufftype);
|
||||
NAME_None, pufftype);
|
||||
|
||||
if (!linetarget)
|
||||
{
|
||||
|
@ -392,7 +392,7 @@ void A_FireShotgun (AActor *actor)
|
|||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState);
|
||||
P_SetPsprite (player, ps_flash, weapon->FindState(NAME_Flash));
|
||||
}
|
||||
player->mo->PlayAttacking2 ();
|
||||
|
||||
|
@ -492,7 +492,7 @@ void A_FireShotgun2 (AActor *actor)
|
|||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState);
|
||||
P_SetPsprite (player, ps_flash, weapon->FindState(NAME_Flash));
|
||||
}
|
||||
player->mo->PlayAttacking2 ();
|
||||
|
||||
|
@ -515,7 +515,7 @@ void A_FireShotgun2 (AActor *actor)
|
|||
angle,
|
||||
PLAYERMISSILERANGE,
|
||||
bulletpitch + (pr_fireshotgun2.Random2() * 332063), damage,
|
||||
MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -608,17 +608,21 @@ void A_FireCGun (AActor *actor)
|
|||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
if (weapon->FlashState != NULL)
|
||||
|
||||
FState *flash = weapon->FindState(NAME_Flash);
|
||||
if (flash != NULL)
|
||||
{
|
||||
// [RH] Fix for Sparky's messed-up Dehacked patch! Blargh!
|
||||
int theflash = clamp (int(players->psprites[ps_weapon].state - weapon->AtkState), 0, 1);
|
||||
FState * atk = weapon->FindState(NAME_Fire);
|
||||
|
||||
if (weapon->FlashState[theflash].sprite.index != weapon->FlashState->sprite.index)
|
||||
int theflash = clamp (int(players->psprites[ps_weapon].state - atk), 0, 1);
|
||||
|
||||
if (flash[theflash].sprite.index != flash->sprite.index)
|
||||
{
|
||||
theflash = 0;
|
||||
}
|
||||
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState + theflash);
|
||||
P_SetPsprite (player, ps_flash, flash + theflash);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -841,9 +845,11 @@ void A_FirePlasma (AActor *actor)
|
|||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
if (weapon->FlashState != NULL)
|
||||
|
||||
FState *flash = weapon->FindState(NAME_Flash);
|
||||
if (flash != NULL)
|
||||
{
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState + (pr_fireplasma()&1));
|
||||
P_SetPsprite (player, ps_flash, flash + (pr_fireplasma()&1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -870,9 +876,11 @@ void A_FireRailgun (AActor *actor)
|
|||
{
|
||||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return;
|
||||
if (weapon->FlashState != NULL)
|
||||
|
||||
FState *flash = weapon->FindState(NAME_Flash);
|
||||
if (flash != NULL)
|
||||
{
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState + (pr_firerail()&1));
|
||||
P_SetPsprite (player, ps_flash, flash + (pr_firerail()&1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1099,7 +1107,7 @@ void A_BFGSpray (AActor *mo)
|
|||
damage += (pr_bfgspray() & 7) + 1;
|
||||
|
||||
thingToHit = linetarget;
|
||||
P_DamageMobj (thingToHit, mo->target, mo->target, damage, MOD_BFG_SPLASH);
|
||||
P_DamageMobj (thingToHit, mo->target, mo->target, damage, NAME_BFGSplash);
|
||||
P_TraceBleed (damage, thingToHit, mo->target);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,63 +12,6 @@
|
|||
|
||||
FRandom pr_lost ("LostMissileRange");
|
||||
|
||||
void A_SkullAttack (AActor *);
|
||||
|
||||
FState ALostSoul::States[] =
|
||||
{
|
||||
#define S_SKULL_STND 0
|
||||
S_BRIGHT (SKUL, 'A', 10, A_Look , &States[S_SKULL_STND+1]),
|
||||
S_BRIGHT (SKUL, 'B', 10, A_Look , &States[S_SKULL_STND]),
|
||||
|
||||
#define S_SKULL_RUN (S_SKULL_STND+2)
|
||||
S_BRIGHT (SKUL, 'A', 6, A_Chase , &States[S_SKULL_RUN+1]),
|
||||
S_BRIGHT (SKUL, 'B', 6, A_Chase , &States[S_SKULL_RUN+0]),
|
||||
|
||||
#define S_SKULL_ATK (S_SKULL_RUN+2)
|
||||
S_BRIGHT (SKUL, 'C', 10, A_FaceTarget , &States[S_SKULL_ATK+1]),
|
||||
S_BRIGHT (SKUL, 'D', 4, A_SkullAttack , &States[S_SKULL_ATK+2]),
|
||||
S_BRIGHT (SKUL, 'C', 4, NULL , &States[S_SKULL_ATK+3]),
|
||||
S_BRIGHT (SKUL, 'D', 4, NULL , &States[S_SKULL_ATK+2]),
|
||||
|
||||
#define S_SKULL_PAIN (S_SKULL_ATK+4)
|
||||
S_BRIGHT (SKUL, 'E', 3, NULL , &States[S_SKULL_PAIN+1]),
|
||||
S_BRIGHT (SKUL, 'E', 3, A_Pain , &States[S_SKULL_RUN+0]),
|
||||
|
||||
#define S_SKULL_DIE (S_SKULL_PAIN+2)
|
||||
S_BRIGHT (SKUL, 'F', 6, NULL , &States[S_SKULL_DIE+1]),
|
||||
S_BRIGHT (SKUL, 'G', 6, A_Scream , &States[S_SKULL_DIE+2]),
|
||||
S_BRIGHT (SKUL, 'H', 6, NULL , &States[S_SKULL_DIE+3]),
|
||||
S_BRIGHT (SKUL, 'I', 6, A_NoBlocking , &States[S_SKULL_DIE+4]),
|
||||
S_NORMAL (SKUL, 'J', 6, NULL , &States[S_SKULL_DIE+5]),
|
||||
S_NORMAL (SKUL, 'K', 6, NULL , NULL)
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (ALostSoul, Doom, 3006, 110)
|
||||
PROP_SpawnHealth (100)
|
||||
PROP_RadiusFixed (16)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (50)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_Damage (3)
|
||||
PROP_MaxPainChance
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_FLOAT|MF_NOGRAVITY|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PUSHWALL|MF2_PASSMOBJ)
|
||||
PROP_Flags4 (MF4_NOICEDEATH|MF4_MISSILEMORE|MF4_DONTFALL)
|
||||
PROP_RenderStyle (STYLE_SoulTrans)
|
||||
|
||||
PROP_SpawnState (S_SKULL_STND)
|
||||
PROP_SeeState (S_SKULL_RUN)
|
||||
PROP_PainState (S_SKULL_PAIN)
|
||||
PROP_MissileState (S_SKULL_ATK)
|
||||
PROP_DeathState (S_SKULL_DIE)
|
||||
|
||||
PROP_AttackSound ("skull/melee")
|
||||
PROP_PainSound ("skull/pain")
|
||||
PROP_DeathSound ("skull/death")
|
||||
PROP_ActiveSound ("skull/active")
|
||||
PROP_Obituary("$OB_SKULL")
|
||||
END_DEFAULTS
|
||||
|
||||
//
|
||||
// SkullAttack
|
||||
// Fly at the player like a missile.
|
||||
|
|
|
@ -14,8 +14,6 @@ void A_SkullAttack (AActor *self);
|
|||
class APainElemental : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (APainElemental, AActor)
|
||||
public:
|
||||
bool Massacre ();
|
||||
};
|
||||
|
||||
FState APainElemental::States[] =
|
||||
|
@ -81,24 +79,6 @@ IMPLEMENT_ACTOR (APainElemental, Doom, 71, 115)
|
|||
PROP_ActiveSound ("pain/active")
|
||||
END_DEFAULTS
|
||||
|
||||
bool APainElemental::Massacre ()
|
||||
{
|
||||
if (Super::Massacre ())
|
||||
{
|
||||
FState *deadstate;
|
||||
A_NoBlocking (this); // [RH] Use this instead of A_PainDie
|
||||
deadstate = DeathState;
|
||||
if (deadstate != NULL)
|
||||
{
|
||||
while (deadstate->GetNextState() != NULL)
|
||||
deadstate = deadstate->GetNextState();
|
||||
SetState (deadstate);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// A_PainShootSkull
|
||||
// Spawn a lost soul and launch it at the target
|
||||
|
@ -113,12 +93,14 @@ void A_PainShootSkull (AActor *self, angle_t angle)
|
|||
|
||||
const PClass *spawntype = NULL;
|
||||
|
||||
if (self->DamageType==NAME_Massacre) return;
|
||||
|
||||
int index=CheckIndex(1, NULL);
|
||||
if (index>=0)
|
||||
{
|
||||
spawntype = PClass::FindClass((ENamedName)StateParameters[index]);
|
||||
}
|
||||
if (spawntype == NULL) spawntype = RUNTIME_CLASS(ALostSoul);
|
||||
if (spawntype == NULL) spawntype = PClass::FindClass("LostSoul");
|
||||
|
||||
// [RH] check to make sure it's not too close to the ceiling
|
||||
if (self->z + self->height + 8*FRACUNIT > self->ceilingz)
|
||||
|
@ -178,7 +160,7 @@ void A_PainShootSkull (AActor *self, angle_t angle)
|
|||
(other->z < other->Sector->floorplane.ZatPoint (other->x, other->y)))
|
||||
{
|
||||
// kill it immediately
|
||||
P_DamageMobj (other, self, self, 1000000, MOD_UNKNOWN); // ^
|
||||
P_DamageMobj (other, self, self, 1000000, NAME_None); // ^
|
||||
return; // |
|
||||
} // phares
|
||||
|
||||
|
@ -187,7 +169,7 @@ void A_PainShootSkull (AActor *self, angle_t angle)
|
|||
if (!P_CheckPosition (other, other->x, other->y))
|
||||
{
|
||||
// kill it immediately
|
||||
P_DamageMobj (other, self, self, 1000000, MOD_UNKNOWN);
|
||||
P_DamageMobj (other, self, self, 1000000, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,101 +13,6 @@ static FRandom pr_sposattack ("SPosAttack");
|
|||
static FRandom pr_cposattack ("CPosAttack");
|
||||
static FRandom pr_cposrefire ("CPosRefire");
|
||||
|
||||
void A_PosAttack (AActor *);
|
||||
void A_SPosAttackUseAtkSound (AActor *);
|
||||
void A_CPosAttack (AActor *);
|
||||
void A_CPosRefire (AActor *);
|
||||
|
||||
// Zombie man --------------------------------------------------------------
|
||||
|
||||
class AZombieMan : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (AZombieMan, AActor)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
};
|
||||
|
||||
FState AZombieMan::States[] =
|
||||
{
|
||||
#define S_POSS_STND 0
|
||||
S_NORMAL (POSS, 'A', 10, A_Look , &States[S_POSS_STND+1]),
|
||||
S_NORMAL (POSS, 'B', 10, A_Look , &States[S_POSS_STND]),
|
||||
|
||||
#define S_POSS_RUN (S_POSS_STND+2)
|
||||
S_NORMAL (POSS, 'A', 4, A_Chase , &States[S_POSS_RUN+1]),
|
||||
S_NORMAL (POSS, 'A', 4, A_Chase , &States[S_POSS_RUN+2]),
|
||||
S_NORMAL (POSS, 'B', 4, A_Chase , &States[S_POSS_RUN+3]),
|
||||
S_NORMAL (POSS, 'B', 4, A_Chase , &States[S_POSS_RUN+4]),
|
||||
S_NORMAL (POSS, 'C', 4, A_Chase , &States[S_POSS_RUN+5]),
|
||||
S_NORMAL (POSS, 'C', 4, A_Chase , &States[S_POSS_RUN+6]),
|
||||
S_NORMAL (POSS, 'D', 4, A_Chase , &States[S_POSS_RUN+7]),
|
||||
S_NORMAL (POSS, 'D', 4, A_Chase , &States[S_POSS_RUN+0]),
|
||||
|
||||
#define S_POSS_ATK (S_POSS_RUN+8)
|
||||
S_NORMAL (POSS, 'E', 10, A_FaceTarget , &States[S_POSS_ATK+1]),
|
||||
S_NORMAL (POSS, 'F', 8, A_PosAttack , &States[S_POSS_ATK+2]),
|
||||
S_NORMAL (POSS, 'E', 8, NULL , &States[S_POSS_RUN+0]),
|
||||
|
||||
#define S_POSS_PAIN (S_POSS_ATK+3)
|
||||
S_NORMAL (POSS, 'G', 3, NULL , &States[S_POSS_PAIN+1]),
|
||||
S_NORMAL (POSS, 'G', 3, A_Pain , &States[S_POSS_RUN+0]),
|
||||
|
||||
#define S_POSS_DIE (S_POSS_PAIN+2)
|
||||
S_NORMAL (POSS, 'H', 5, NULL , &States[S_POSS_DIE+1]),
|
||||
S_NORMAL (POSS, 'I', 5, A_Scream , &States[S_POSS_DIE+2]),
|
||||
S_NORMAL (POSS, 'J', 5, A_NoBlocking , &States[S_POSS_DIE+3]),
|
||||
S_NORMAL (POSS, 'K', 5, NULL , &States[S_POSS_DIE+4]),
|
||||
S_NORMAL (POSS, 'L', -1, NULL , NULL),
|
||||
|
||||
#define S_POSS_XDIE (S_POSS_DIE+5)
|
||||
S_NORMAL (POSS, 'M', 5, NULL , &States[S_POSS_XDIE+1]),
|
||||
S_NORMAL (POSS, 'N', 5, A_XScream , &States[S_POSS_XDIE+2]),
|
||||
S_NORMAL (POSS, 'O', 5, A_NoBlocking , &States[S_POSS_XDIE+3]),
|
||||
S_NORMAL (POSS, 'P', 5, NULL , &States[S_POSS_XDIE+4]),
|
||||
S_NORMAL (POSS, 'Q', 5, NULL , &States[S_POSS_XDIE+5]),
|
||||
S_NORMAL (POSS, 'R', 5, NULL , &States[S_POSS_XDIE+6]),
|
||||
S_NORMAL (POSS, 'S', 5, NULL , &States[S_POSS_XDIE+7]),
|
||||
S_NORMAL (POSS, 'T', 5, NULL , &States[S_POSS_XDIE+8]),
|
||||
S_NORMAL (POSS, 'U', -1, NULL , NULL),
|
||||
|
||||
#define S_POSS_RAISE (S_POSS_XDIE+9)
|
||||
S_NORMAL (POSS, 'K', 5, NULL , &States[S_POSS_RAISE+1]),
|
||||
S_NORMAL (POSS, 'J', 5, NULL , &States[S_POSS_RAISE+2]),
|
||||
S_NORMAL (POSS, 'I', 5, NULL , &States[S_POSS_RAISE+3]),
|
||||
S_NORMAL (POSS, 'H', 5, NULL , &States[S_POSS_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AZombieMan, Doom, 3004, 4)
|
||||
PROP_SpawnHealth (20)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (100)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (200)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
|
||||
PROP_SpawnState (S_POSS_STND)
|
||||
PROP_SeeState (S_POSS_RUN)
|
||||
PROP_PainState (S_POSS_PAIN)
|
||||
PROP_MissileState (S_POSS_ATK)
|
||||
PROP_DeathState (S_POSS_DIE)
|
||||
PROP_XDeathState (S_POSS_XDIE)
|
||||
PROP_RaiseState (S_POSS_RAISE)
|
||||
|
||||
PROP_SeeSound ("grunt/sight")
|
||||
PROP_AttackSound ("grunt/attack")
|
||||
PROP_PainSound ("grunt/pain")
|
||||
PROP_DeathSound ("grunt/death")
|
||||
PROP_ActiveSound ("grunt/active")
|
||||
PROP_Obituary("$OB_ZOMBIE")
|
||||
END_DEFAULTS
|
||||
|
||||
void AZombieMan::NoBlockingSet ()
|
||||
{
|
||||
P_DropItem (this, "Clip", -1, 256);
|
||||
}
|
||||
|
||||
//
|
||||
// A_PosAttack
|
||||
//
|
||||
|
@ -127,99 +32,7 @@ void A_PosAttack (AActor *self)
|
|||
S_Sound (self, CHAN_WEAPON, "grunt/attack", 1, ATTN_NORM);
|
||||
angle += pr_posattack.Random2() << 20;
|
||||
damage = ((pr_posattack()%5)+1)*3;
|
||||
P_LineAttack (self, angle, MISSILERANGE, slope, damage, MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
|
||||
// Shotgun guy -------------------------------------------------------------
|
||||
|
||||
class AShotgunGuy : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (AShotgunGuy, AActor)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
};
|
||||
|
||||
FState AShotgunGuy::States[] =
|
||||
{
|
||||
|
||||
#define S_SPOS_STND 0
|
||||
S_NORMAL (SPOS, 'A', 10, A_Look , &States[S_SPOS_STND+1]),
|
||||
S_NORMAL (SPOS, 'B', 10, A_Look , &States[S_SPOS_STND]),
|
||||
|
||||
#define S_SPOS_RUN (S_SPOS_STND+2)
|
||||
S_NORMAL (SPOS, 'A', 3, A_Chase , &States[S_SPOS_RUN+1]),
|
||||
S_NORMAL (SPOS, 'A', 3, A_Chase , &States[S_SPOS_RUN+2]),
|
||||
S_NORMAL (SPOS, 'B', 3, A_Chase , &States[S_SPOS_RUN+3]),
|
||||
S_NORMAL (SPOS, 'B', 3, A_Chase , &States[S_SPOS_RUN+4]),
|
||||
S_NORMAL (SPOS, 'C', 3, A_Chase , &States[S_SPOS_RUN+5]),
|
||||
S_NORMAL (SPOS, 'C', 3, A_Chase , &States[S_SPOS_RUN+6]),
|
||||
S_NORMAL (SPOS, 'D', 3, A_Chase , &States[S_SPOS_RUN+7]),
|
||||
S_NORMAL (SPOS, 'D', 3, A_Chase , &States[S_SPOS_RUN+0]),
|
||||
|
||||
#define S_SPOS_ATK (S_SPOS_RUN+8)
|
||||
S_NORMAL (SPOS, 'E', 10, A_FaceTarget , &States[S_SPOS_ATK+1]),
|
||||
S_BRIGHT (SPOS, 'F', 10, A_SPosAttackUseAtkSound , &States[S_SPOS_ATK+2]),
|
||||
S_NORMAL (SPOS, 'E', 10, NULL , &States[S_SPOS_RUN+0]),
|
||||
|
||||
#define S_SPOS_PAIN (S_SPOS_ATK+3)
|
||||
S_NORMAL (SPOS, 'G', 3, NULL , &States[S_SPOS_PAIN+1]),
|
||||
S_NORMAL (SPOS, 'G', 3, A_Pain , &States[S_SPOS_RUN+0]),
|
||||
|
||||
#define S_SPOS_DIE (S_SPOS_PAIN+2)
|
||||
S_NORMAL (SPOS, 'H', 5, NULL , &States[S_SPOS_DIE+1]),
|
||||
S_NORMAL (SPOS, 'I', 5, A_Scream , &States[S_SPOS_DIE+2]),
|
||||
S_NORMAL (SPOS, 'J', 5, A_NoBlocking , &States[S_SPOS_DIE+3]),
|
||||
S_NORMAL (SPOS, 'K', 5, NULL , &States[S_SPOS_DIE+4]),
|
||||
S_NORMAL (SPOS, 'L', -1, NULL , NULL),
|
||||
|
||||
#define S_SPOS_XDIE (S_SPOS_DIE+5)
|
||||
S_NORMAL (SPOS, 'M', 5, NULL , &States[S_SPOS_XDIE+1]),
|
||||
S_NORMAL (SPOS, 'N', 5, A_XScream , &States[S_SPOS_XDIE+2]),
|
||||
S_NORMAL (SPOS, 'O', 5, A_NoBlocking , &States[S_SPOS_XDIE+3]),
|
||||
S_NORMAL (SPOS, 'P', 5, NULL , &States[S_SPOS_XDIE+4]),
|
||||
S_NORMAL (SPOS, 'Q', 5, NULL , &States[S_SPOS_XDIE+5]),
|
||||
S_NORMAL (SPOS, 'R', 5, NULL , &States[S_SPOS_XDIE+6]),
|
||||
S_NORMAL (SPOS, 'S', 5, NULL , &States[S_SPOS_XDIE+7]),
|
||||
S_NORMAL (SPOS, 'T', 5, NULL , &States[S_SPOS_XDIE+8]),
|
||||
S_NORMAL (SPOS, 'U', -1, NULL , NULL),
|
||||
|
||||
#define S_SPOS_RAISE (S_SPOS_XDIE+9)
|
||||
S_NORMAL (SPOS, 'L', 5, NULL , &States[S_SPOS_RAISE+1]),
|
||||
S_NORMAL (SPOS, 'K', 5, NULL , &States[S_SPOS_RAISE+2]),
|
||||
S_NORMAL (SPOS, 'J', 5, NULL , &States[S_SPOS_RAISE+3]),
|
||||
S_NORMAL (SPOS, 'I', 5, NULL , &States[S_SPOS_RAISE+4]),
|
||||
S_NORMAL (SPOS, 'H', 5, NULL , &States[S_SPOS_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AShotgunGuy, Doom, 9, 1)
|
||||
PROP_SpawnHealth (30)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (100)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (170)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
|
||||
PROP_SpawnState (S_SPOS_STND)
|
||||
PROP_SeeState (S_SPOS_RUN)
|
||||
PROP_PainState (S_SPOS_PAIN)
|
||||
PROP_MissileState (S_SPOS_ATK)
|
||||
PROP_DeathState (S_SPOS_DIE)
|
||||
PROP_XDeathState (S_SPOS_XDIE)
|
||||
PROP_RaiseState (S_SPOS_RAISE)
|
||||
|
||||
PROP_SeeSound ("shotguy/sight")
|
||||
PROP_AttackSound ("shotguy/attack")
|
||||
PROP_PainSound ("shotguy/pain")
|
||||
PROP_DeathSound ("shotguy/death")
|
||||
PROP_ActiveSound ("shotguy/active")
|
||||
PROP_Obituary("$OB_SHOTGUY")
|
||||
END_DEFAULTS
|
||||
|
||||
void AShotgunGuy::NoBlockingSet ()
|
||||
{
|
||||
P_DropItem (this, "Shotgun", -1, 256);
|
||||
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
|
||||
static void A_SPosAttack2 (AActor *self)
|
||||
|
@ -236,7 +49,7 @@ static void A_SPosAttack2 (AActor *self)
|
|||
{
|
||||
int angle = bangle + (pr_sposattack.Random2() << 20);
|
||||
int damage = ((pr_sposattack()%5)+1)*3;
|
||||
P_LineAttack(self, angle, MISSILERANGE, slope, damage, MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
P_LineAttack(self, angle, MISSILERANGE, slope, damage, NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,193 +73,6 @@ void A_SPosAttack (AActor *self)
|
|||
A_SPosAttack2 (self);
|
||||
}
|
||||
|
||||
// Chaingun guy ------------------------------------------------------------
|
||||
|
||||
class AChaingunGuy : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (AChaingunGuy, AActor)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
};
|
||||
|
||||
FState AChaingunGuy::States[] =
|
||||
{
|
||||
#define S_CPOS_STND 0
|
||||
S_NORMAL (CPOS, 'A', 10, A_Look , &States[S_CPOS_STND+1]),
|
||||
S_NORMAL (CPOS, 'B', 10, A_Look , &States[S_CPOS_STND]),
|
||||
|
||||
#define S_CPOS_RUN (S_CPOS_STND+2)
|
||||
S_NORMAL (CPOS, 'A', 3, A_Chase , &States[S_CPOS_RUN+1]),
|
||||
S_NORMAL (CPOS, 'A', 3, A_Chase , &States[S_CPOS_RUN+2]),
|
||||
S_NORMAL (CPOS, 'B', 3, A_Chase , &States[S_CPOS_RUN+3]),
|
||||
S_NORMAL (CPOS, 'B', 3, A_Chase , &States[S_CPOS_RUN+4]),
|
||||
S_NORMAL (CPOS, 'C', 3, A_Chase , &States[S_CPOS_RUN+5]),
|
||||
S_NORMAL (CPOS, 'C', 3, A_Chase , &States[S_CPOS_RUN+6]),
|
||||
S_NORMAL (CPOS, 'D', 3, A_Chase , &States[S_CPOS_RUN+7]),
|
||||
S_NORMAL (CPOS, 'D', 3, A_Chase , &States[S_CPOS_RUN+0]),
|
||||
|
||||
#define S_CPOS_ATK (S_CPOS_RUN+8)
|
||||
S_NORMAL (CPOS, 'E', 10, A_FaceTarget , &States[S_CPOS_ATK+1]),
|
||||
S_BRIGHT (CPOS, 'F', 4, A_CPosAttack , &States[S_CPOS_ATK+2]),
|
||||
S_BRIGHT (CPOS, 'E', 4, A_CPosAttack , &States[S_CPOS_ATK+3]),
|
||||
S_NORMAL (CPOS, 'F', 1, A_CPosRefire , &States[S_CPOS_ATK+1]),
|
||||
|
||||
#define S_CPOS_PAIN (S_CPOS_ATK+4)
|
||||
S_NORMAL (CPOS, 'G', 3, NULL , &States[S_CPOS_PAIN+1]),
|
||||
S_NORMAL (CPOS, 'G', 3, A_Pain , &States[S_CPOS_RUN+0]),
|
||||
|
||||
#define S_CPOS_DIE (S_CPOS_PAIN+2)
|
||||
S_NORMAL (CPOS, 'H', 5, NULL , &States[S_CPOS_DIE+1]),
|
||||
S_NORMAL (CPOS, 'I', 5, A_Scream , &States[S_CPOS_DIE+2]),
|
||||
S_NORMAL (CPOS, 'J', 5, A_NoBlocking , &States[S_CPOS_DIE+3]),
|
||||
S_NORMAL (CPOS, 'K', 5, NULL , &States[S_CPOS_DIE+4]),
|
||||
S_NORMAL (CPOS, 'L', 5, NULL , &States[S_CPOS_DIE+5]),
|
||||
S_NORMAL (CPOS, 'M', 5, NULL , &States[S_CPOS_DIE+6]),
|
||||
S_NORMAL (CPOS, 'N', -1, NULL , NULL),
|
||||
|
||||
#define S_CPOS_XDIE (S_CPOS_DIE+7)
|
||||
S_NORMAL (CPOS, 'O', 5, NULL , &States[S_CPOS_XDIE+1]),
|
||||
S_NORMAL (CPOS, 'P', 5, A_XScream , &States[S_CPOS_XDIE+2]),
|
||||
S_NORMAL (CPOS, 'Q', 5, A_NoBlocking , &States[S_CPOS_XDIE+3]),
|
||||
S_NORMAL (CPOS, 'R', 5, NULL , &States[S_CPOS_XDIE+4]),
|
||||
S_NORMAL (CPOS, 'S', 5, NULL , &States[S_CPOS_XDIE+5]),
|
||||
S_NORMAL (CPOS, 'T', -1, NULL , NULL),
|
||||
|
||||
#define S_CPOS_RAISE (S_CPOS_XDIE+6)
|
||||
S_NORMAL (CPOS, 'N', 5, NULL , &States[S_CPOS_RAISE+1]),
|
||||
S_NORMAL (CPOS, 'M', 5, NULL , &States[S_CPOS_RAISE+2]),
|
||||
S_NORMAL (CPOS, 'L', 5, NULL , &States[S_CPOS_RAISE+3]),
|
||||
S_NORMAL (CPOS, 'K', 5, NULL , &States[S_CPOS_RAISE+4]),
|
||||
S_NORMAL (CPOS, 'J', 5, NULL , &States[S_CPOS_RAISE+5]),
|
||||
S_NORMAL (CPOS, 'I', 5, NULL , &States[S_CPOS_RAISE+6]),
|
||||
S_NORMAL (CPOS, 'H', 5, NULL , &States[S_CPOS_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AChaingunGuy, Doom, 65, 2)
|
||||
PROP_SpawnHealth (70)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (100)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (170)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
|
||||
PROP_SpawnState (S_CPOS_STND)
|
||||
PROP_SeeState (S_CPOS_RUN)
|
||||
PROP_PainState (S_CPOS_PAIN)
|
||||
PROP_MissileState (S_CPOS_ATK)
|
||||
PROP_DeathState (S_CPOS_DIE)
|
||||
PROP_XDeathState (S_CPOS_XDIE)
|
||||
PROP_RaiseState (S_CPOS_RAISE)
|
||||
|
||||
PROP_SeeSound ("chainguy/sight")
|
||||
PROP_PainSound ("chainguy/pain")
|
||||
PROP_DeathSound ("chainguy/death")
|
||||
PROP_ActiveSound ("chainguy/active")
|
||||
PROP_AttackSound ("chainguy/attack")
|
||||
PROP_Obituary("$OB_CHAINGUY")
|
||||
END_DEFAULTS
|
||||
|
||||
void AChaingunGuy::NoBlockingSet ()
|
||||
{
|
||||
P_DropItem (this, "Chaingun", -1, 256);
|
||||
}
|
||||
|
||||
// Wolfenstein SS ----------------------------------------------------------
|
||||
|
||||
class AWolfensteinSS : public AActor
|
||||
{
|
||||
DECLARE_ACTOR (AWolfensteinSS, AActor)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
};
|
||||
|
||||
FState AWolfensteinSS::States[] =
|
||||
{
|
||||
#define S_SSWV_STND 0
|
||||
S_NORMAL (SSWV, 'A', 10, A_Look , &States[S_SSWV_STND+1]),
|
||||
S_NORMAL (SSWV, 'B', 10, A_Look , &States[S_SSWV_STND]),
|
||||
|
||||
#define S_SSWV_RUN (S_SSWV_STND+2)
|
||||
S_NORMAL (SSWV, 'A', 3, A_Chase , &States[S_SSWV_RUN+1]),
|
||||
S_NORMAL (SSWV, 'A', 3, A_Chase , &States[S_SSWV_RUN+2]),
|
||||
S_NORMAL (SSWV, 'B', 3, A_Chase , &States[S_SSWV_RUN+3]),
|
||||
S_NORMAL (SSWV, 'B', 3, A_Chase , &States[S_SSWV_RUN+4]),
|
||||
S_NORMAL (SSWV, 'C', 3, A_Chase , &States[S_SSWV_RUN+5]),
|
||||
S_NORMAL (SSWV, 'C', 3, A_Chase , &States[S_SSWV_RUN+6]),
|
||||
S_NORMAL (SSWV, 'D', 3, A_Chase , &States[S_SSWV_RUN+7]),
|
||||
S_NORMAL (SSWV, 'D', 3, A_Chase , &States[S_SSWV_RUN+0]),
|
||||
|
||||
#define S_SSWV_ATK (S_SSWV_RUN+8)
|
||||
S_NORMAL (SSWV, 'E', 10, A_FaceTarget , &States[S_SSWV_ATK+1]),
|
||||
S_NORMAL (SSWV, 'F', 10, A_FaceTarget , &States[S_SSWV_ATK+2]),
|
||||
S_BRIGHT (SSWV, 'G', 4, A_CPosAttack , &States[S_SSWV_ATK+3]),
|
||||
S_NORMAL (SSWV, 'F', 6, A_FaceTarget , &States[S_SSWV_ATK+4]),
|
||||
S_BRIGHT (SSWV, 'G', 4, A_CPosAttack , &States[S_SSWV_ATK+5]),
|
||||
S_NORMAL (SSWV, 'F', 1, A_CPosRefire , &States[S_SSWV_ATK+1]),
|
||||
|
||||
#define S_SSWV_PAIN (S_SSWV_ATK+6)
|
||||
S_NORMAL (SSWV, 'H', 3, NULL , &States[S_SSWV_PAIN+1]),
|
||||
S_NORMAL (SSWV, 'H', 3, A_Pain , &States[S_SSWV_RUN+0]),
|
||||
|
||||
#define S_SSWV_DIE (S_SSWV_PAIN+2)
|
||||
S_NORMAL (SSWV, 'I', 5, NULL , &States[S_SSWV_DIE+1]),
|
||||
S_NORMAL (SSWV, 'J', 5, A_Scream , &States[S_SSWV_DIE+2]),
|
||||
S_NORMAL (SSWV, 'K', 5, A_NoBlocking , &States[S_SSWV_DIE+3]),
|
||||
S_NORMAL (SSWV, 'L', 5, NULL , &States[S_SSWV_DIE+4]),
|
||||
S_NORMAL (SSWV, 'M', -1, NULL , NULL),
|
||||
|
||||
#define S_SSWV_XDIE (S_SSWV_DIE+5)
|
||||
S_NORMAL (SSWV, 'N', 5, NULL , &States[S_SSWV_XDIE+1]),
|
||||
S_NORMAL (SSWV, 'O', 5, A_XScream , &States[S_SSWV_XDIE+2]),
|
||||
S_NORMAL (SSWV, 'P', 5, A_NoBlocking , &States[S_SSWV_XDIE+3]),
|
||||
S_NORMAL (SSWV, 'Q', 5, NULL , &States[S_SSWV_XDIE+4]),
|
||||
S_NORMAL (SSWV, 'R', 5, NULL , &States[S_SSWV_XDIE+5]),
|
||||
S_NORMAL (SSWV, 'S', 5, NULL , &States[S_SSWV_XDIE+6]),
|
||||
S_NORMAL (SSWV, 'T', 5, NULL , &States[S_SSWV_XDIE+7]),
|
||||
S_NORMAL (SSWV, 'U', 5, NULL , &States[S_SSWV_XDIE+8]),
|
||||
S_NORMAL (SSWV, 'V', -1, NULL , NULL),
|
||||
|
||||
#define S_SSWV_RAISE (S_SSWV_XDIE+9)
|
||||
S_NORMAL (SSWV, 'M', 5, NULL , &States[S_SSWV_RAISE+1]),
|
||||
S_NORMAL (SSWV, 'L', 5, NULL , &States[S_SSWV_RAISE+2]),
|
||||
S_NORMAL (SSWV, 'K', 5, NULL , &States[S_SSWV_RAISE+3]),
|
||||
S_NORMAL (SSWV, 'J', 5, NULL , &States[S_SSWV_RAISE+4]),
|
||||
S_NORMAL (SSWV, 'I', 5, NULL , &States[S_SSWV_RUN+0])
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AWolfensteinSS, Doom, 84, 116)
|
||||
PROP_SpawnHealth (50)
|
||||
PROP_RadiusFixed (20)
|
||||
PROP_HeightFixed (56)
|
||||
PROP_Mass (100)
|
||||
PROP_SpeedFixed (8)
|
||||
PROP_PainChance (170)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
||||
|
||||
PROP_SpawnState (S_SSWV_STND)
|
||||
PROP_SeeState (S_SSWV_RUN)
|
||||
PROP_PainState (S_SSWV_PAIN)
|
||||
PROP_MissileState (S_SSWV_ATK)
|
||||
PROP_DeathState (S_SSWV_DIE)
|
||||
PROP_XDeathState (S_SSWV_XDIE)
|
||||
PROP_RaiseState (S_SSWV_RAISE)
|
||||
|
||||
PROP_SeeSound ("wolfss/sight")
|
||||
PROP_PainSound ("wolfss/pain")
|
||||
PROP_DeathSound ("wolfss/death")
|
||||
PROP_ActiveSound ("wolfss/active")
|
||||
PROP_AttackSound ("wolfss/attack")
|
||||
PROP_Obituary("$OB_WOLFSS")
|
||||
END_DEFAULTS
|
||||
|
||||
void AWolfensteinSS::NoBlockingSet ()
|
||||
{
|
||||
P_DropItem (this, "Clip", -1, 256);
|
||||
}
|
||||
|
||||
void A_CPosAttack (AActor *self)
|
||||
{
|
||||
int angle;
|
||||
|
@ -470,7 +96,7 @@ void A_CPosAttack (AActor *self)
|
|||
|
||||
angle = bangle + (pr_cposattack.Random2() << 20);
|
||||
damage = ((pr_cposattack()%5)+1)*3;
|
||||
P_LineAttack (self, angle, MISSILERANGE, slope, damage, MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
|
||||
void A_CPosRefire (AActor *self)
|
||||
|
|
|
@ -279,7 +279,7 @@ void A_SkelFist (AActor *self)
|
|||
{
|
||||
int damage = ((pr_skelfist()%10)+1)*6;
|
||||
S_Sound (self, CHAN_WEAPON, "skeleton/melee", 1, ATTN_NORM);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,7 +398,7 @@ void A_M_Saw (AActor *self)
|
|||
|
||||
P_LineAttack (self, angle, MELEERANGE+1,
|
||||
P_AimLineAttack (self, angle, MELEERANGE+1), damage,
|
||||
MOD_HIT, RUNTIME_CLASS(ABulletPuff));
|
||||
NAME_Melee, RUNTIME_CLASS(ABulletPuff));
|
||||
|
||||
if (!linetarget)
|
||||
{
|
||||
|
@ -451,7 +451,7 @@ void A_M_Punch (AActor *self)
|
|||
A_FaceTarget (self);
|
||||
angle = self->angle + (pr_m_punch.Random2() << 18);
|
||||
pitch = P_AimLineAttack (self, angle, MELEERANGE);
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, MOD_HIT, RUNTIME_CLASS(ABulletPuff));
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, RUNTIME_CLASS(ABulletPuff));
|
||||
|
||||
// turn to face target
|
||||
if (linetarget)
|
||||
|
@ -481,7 +481,7 @@ void A_M_BerserkPunch (AActor *self)
|
|||
A_FaceTarget (self);
|
||||
angle = self->angle + (pr_m_punch.Random2() << 18);
|
||||
pitch = P_AimLineAttack (self, angle, MELEERANGE);
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, MOD_HIT, RUNTIME_CLASS(ABulletPuff));
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, RUNTIME_CLASS(ABulletPuff));
|
||||
|
||||
// turn to face target
|
||||
if (linetarget)
|
||||
|
@ -510,7 +510,7 @@ void P_GunShot2 (AActor *mo, bool accurate, int pitch, const PClass *pufftype)
|
|||
angle += pr_m_gunshot.Random2 () << 18;
|
||||
}
|
||||
|
||||
P_LineAttack (mo, angle, MISSILERANGE, pitch, damage, MOD_UNKNOWN, pufftype);
|
||||
P_LineAttack (mo, angle, MISSILERANGE, pitch, damage, NAME_None, pufftype);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -611,7 +611,7 @@ void A_M_FireShotgun2 (AActor *self)
|
|||
|
||||
P_LineAttack (self, angle, MISSILERANGE,
|
||||
pitch + (pr_m_fireshotgun2.Random2() * 332063), damage,
|
||||
MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
self->special1 = level.maptime;
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ void A_BeastAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_beastatk.HitDice (3);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -184,10 +184,9 @@ void AChickenPlayer::MorphPlayerThink ()
|
|||
if ((z <= floorz) && (pr_chickenplayerthink() < 32))
|
||||
{ // Jump and noise
|
||||
momz += JumpZ;
|
||||
if (PainState != NULL)
|
||||
{
|
||||
SetState (PainState);
|
||||
}
|
||||
|
||||
FState * painstate = FindState(NAME_Pain);
|
||||
if (painstate != NULL) SetState (painstate);
|
||||
}
|
||||
if (pr_chickenplayerthink () < 48)
|
||||
{ // Just noise
|
||||
|
@ -305,7 +304,7 @@ void A_ChicAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = 1 + (pr_chicattack() & 1);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
}
|
||||
}
|
||||
|
@ -406,7 +405,7 @@ void A_BeakAttackPL1 (AActor *actor)
|
|||
damage = 1 + (pr_beakatkpl1()&3);
|
||||
angle = player->mo->angle;
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(ABeakPuff));
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(ABeakPuff));
|
||||
if (linetarget)
|
||||
{
|
||||
player->mo->angle = R_PointToAngle2 (player->mo->x,
|
||||
|
@ -438,7 +437,7 @@ void A_BeakAttackPL2 (AActor *actor)
|
|||
damage = pr_beakatkpl2.HitDice (4);
|
||||
angle = player->mo->angle;
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(ABeakPuff));
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(ABeakPuff));
|
||||
if (linetarget)
|
||||
{
|
||||
player->mo->angle = R_PointToAngle2 (player->mo->x,
|
||||
|
|
|
@ -98,7 +98,7 @@ void A_ClinkAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
damage = ((pr_clinkattack()%7)+3);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ IMPLEMENT_ACTOR (ASorcererFX1, Heretic, -1, 144)
|
|||
PROP_HeightFixed (10)
|
||||
PROP_SpeedFixed (20)
|
||||
PROP_Damage (10)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -467,7 +467,7 @@ void A_Srcr1Attack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_scrc1atk.HitDice (8);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ void A_Srcr2Attack (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_s2a.HitDice (20);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ void A_GenWizard (AActor *actor)
|
|||
mo->CopyFriendliness (actor->target, true);
|
||||
|
||||
actor->momx = actor->momy = actor->momz = 0;
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
actor->flags &= ~MF_MISSILE;
|
||||
mo->master = actor->target;
|
||||
// Heretic did not offset it by TELEFOGHEIGHT, so I won't either.
|
||||
|
|
|
@ -36,7 +36,7 @@ bool AArtiTomeOfPower::Use (bool pickup)
|
|||
{ // Attempt to undo chicken
|
||||
if (P_UndoPlayerMorph (Owner->player) == false)
|
||||
{ // Failed
|
||||
P_DamageMobj (Owner, NULL, NULL, 1000000, MOD_TELEFRAG);
|
||||
P_DamageMobj (Owner, NULL, NULL, 1000000, NAME_Telefrag);
|
||||
}
|
||||
else
|
||||
{ // Succeeded
|
||||
|
|
|
@ -264,7 +264,7 @@ void A_ImpMeAttack (AActor *self)
|
|||
if (self->CheckMeleeRange ())
|
||||
{
|
||||
int damage = 5+(pr_impmeatk()&7);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ void A_ImpMsAttack2 (AActor *self)
|
|||
if (self->CheckMeleeRange ())
|
||||
{
|
||||
int damage = 5+(pr_impmsatk2()&7);
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -419,7 +419,7 @@ IMPLEMENT_ACTOR (AVolcanoBlast, Heretic, -1, 123)
|
|||
PROP_HeightFixed (8)
|
||||
PROP_SpeedFixed (2)
|
||||
PROP_Damage (2)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF)
|
||||
PROP_Flags2 (MF2_LOGRAV|MF2_NOTELEPORT)
|
||||
|
||||
|
@ -457,7 +457,7 @@ IMPLEMENT_ACTOR (AVolcanoTBlast, Heretic, -1, 124)
|
|||
PROP_HeightFixed (6)
|
||||
PROP_SpeedFixed (2)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF)
|
||||
PROP_Flags2 (MF2_LOGRAV|MF2_NOTELEPORT)
|
||||
|
||||
|
@ -525,7 +525,7 @@ void A_VolcBallImpact (AActor *ball)
|
|||
ball->z += 28*FRACUNIT;
|
||||
//ball->momz = 3*FRACUNIT;
|
||||
}
|
||||
P_RadiusAttack (ball, ball->target, 25, 25, MOD_FIRE, true);
|
||||
P_RadiusAttack (ball, ball->target, 25, 25, NAME_Fire, true);
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
tiny = Spawn<AVolcanoTBlast> (ball->x, ball->y, ball->z, ALLOW_REPLACE);
|
||||
|
|
|
@ -218,7 +218,7 @@ void A_StaffAttackPL1 (AActor *actor)
|
|||
angle = player->mo->angle;
|
||||
angle += pr_sap.Random2() << 18;
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AStaffPuff));
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AStaffPuff));
|
||||
if (linetarget)
|
||||
{
|
||||
//S_StartSound(player->mo, sfx_stfhit);
|
||||
|
@ -257,7 +257,7 @@ void A_StaffAttackPL2 (AActor *actor)
|
|||
angle = player->mo->angle;
|
||||
angle += pr_sap2.Random2() << 18;
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AStaffPuff2));
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AStaffPuff2));
|
||||
if (linetarget)
|
||||
{
|
||||
//S_StartSound(player->mo, sfx_stfpow);
|
||||
|
@ -457,7 +457,7 @@ void A_FireGoldWandPL1 (AActor *actor)
|
|||
{
|
||||
angle += pr_fgw.Random2() << 18;
|
||||
}
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(AGoldWandPuff1));
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, NAME_None, RUNTIME_CLASS(AGoldWandPuff1));
|
||||
S_Sound (player->mo, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
|
@ -497,7 +497,7 @@ void A_FireGoldWandPL2 (AActor *actor)
|
|||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
damage = 1+(pr_fgw2()&7);
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(AGoldWandPuff2));
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, NAME_None, RUNTIME_CLASS(AGoldWandPuff2));
|
||||
angle += ((ANG45/8)*2)/4;
|
||||
}
|
||||
S_Sound (player->mo, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM);
|
||||
|
@ -1651,7 +1651,7 @@ void A_GauntletAttack (AActor *actor)
|
|||
pufftype = RUNTIME_CLASS(AGauntletPuff1);
|
||||
}
|
||||
slope = P_AimLineAttack (player->mo, angle, dist);
|
||||
P_LineAttack (player->mo, angle, dist, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (player->mo, angle, dist, slope, damage, NAME_Melee, pufftype);
|
||||
if (!linetarget)
|
||||
{
|
||||
if (pr_gatk() > 64)
|
||||
|
@ -1976,7 +1976,7 @@ void A_FireBlasterPL1 (AActor *actor)
|
|||
{
|
||||
angle += pr_fb1.Random2() << 18;
|
||||
}
|
||||
P_LineAttack (actor, angle, PLAYERMISSILERANGE, bulletpitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(ABlasterPuff));
|
||||
P_LineAttack (actor, angle, PLAYERMISSILERANGE, bulletpitch, damage, NAME_None, RUNTIME_CLASS(ABlasterPuff));
|
||||
S_Sound (actor, CHAN_WEAPON, "weapons/blastershoot", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
|
@ -2692,7 +2692,7 @@ IMPLEMENT_ACTOR (APhoenixFX1, Heretic, -1, 163)
|
|||
PROP_HeightFixed (8)
|
||||
PROP_SpeedFixed (20)
|
||||
PROP_Damage (20)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_THRUGHOST|MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -2770,7 +2770,7 @@ IMPLEMENT_ACTOR (APhoenixFX2, Heretic, -1, 0)
|
|||
PROP_HeightFixed (8)
|
||||
PROP_SpeedFixed (10)
|
||||
PROP_Damage (2)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
|
|
@ -263,7 +263,7 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage)
|
|||
}
|
||||
if (!(level.time & 7))
|
||||
{
|
||||
P_DamageMobj (target, NULL, this->target, 3, MOD_HIT);
|
||||
P_DamageMobj (target, NULL, this->target, 3, NAME_Melee);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ void A_LichAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_atk.HitDice (6);
|
||||
P_DamageMobj (target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, target, actor);
|
||||
return;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ void A_WhirlwindSeek (AActor *actor)
|
|||
if (actor->health < 0)
|
||||
{
|
||||
actor->momx = actor->momy = actor->momz = 0;
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
actor->flags &= ~MF_MISSILE;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void A_KnightAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_knightatk.HitDice (3);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
S_Sound (actor, CHAN_BODY, "hknight/melee", 1, ATTN_NORM);
|
||||
return;
|
||||
|
|
|
@ -221,7 +221,7 @@ void A_MummyAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_atk.HitDice (2);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
S_Sound (actor, CHAN_WEAPON, "mummy/attack2", 1, ATTN_NORM);
|
||||
return;
|
||||
|
@ -249,7 +249,7 @@ void A_MummyAttack2 (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_ma2.HitDice (2);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ void A_WizAtk3 (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_wizatk3.HitDice (4);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ void A_BatMove (AActor *actor)
|
|||
|
||||
if (actor->special2 < 0)
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
}
|
||||
actor->special2 -= 2; // Called every 2 tics
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ void A_BishopAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_atk.HitDice (4);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ void A_CentaurAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_centaurattack()%7+3;
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ FState ACircleFlame::States[] =
|
|||
IMPLEMENT_ACTOR (ACircleFlame, Hexen, -1, 0)
|
||||
PROP_RadiusFixed (6)
|
||||
PROP_Damage (2)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -278,7 +278,7 @@ IMPLEMENT_ACTOR (ACFlameMissile, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (14)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_Damage (8)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
PROP_RenderFlags (RF_INVISIBLE)
|
||||
|
|
|
@ -360,7 +360,7 @@ bool AHolySpirit::Slam (AActor *thing)
|
|||
// ghost burns out faster when attacking players/bosses
|
||||
health -= 6;
|
||||
}
|
||||
P_DamageMobj (thing, this, target, dam, MOD_HIT);
|
||||
P_DamageMobj (thing, this, target, dam, NAME_Melee);
|
||||
if (pr_spiritslam() < 128)
|
||||
{
|
||||
Spawn<AHolyPuff> (x, y, z, ALLOW_REPLACE);
|
||||
|
@ -666,7 +666,7 @@ void A_CHolyTail (AActor *actor)
|
|||
|
||||
parent = actor->target;
|
||||
|
||||
if (parent == NULL || parent->state >= parent->DeathState)
|
||||
if (parent == NULL || parent->health <= 0) // better check for health than current state - it's safer!
|
||||
{ // Ghost removed, so remove all tail parts
|
||||
CHolyTailRemove (actor);
|
||||
return;
|
||||
|
@ -825,7 +825,7 @@ void A_CHolySeek (AActor *actor)
|
|||
actor->momx >>= 2;
|
||||
actor->momy >>= 2;
|
||||
actor->momz = 0;
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
actor->tics -= pr_holyseek()&3;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ void A_CMaceAttack (AActor *actor)
|
|||
slope = P_AimLineAttack (player->mo, angle, 2*MELEERANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
AdjustPlayerAngle (player->mo);
|
||||
// player->mo->angle = R_PointToAngle2(player->mo->x,
|
||||
// player->mo->y, linetarget->x, linetarget->y);
|
||||
|
@ -105,7 +105,7 @@ void A_CMaceAttack (AActor *actor)
|
|||
slope = P_AimLineAttack (player->mo, angle, 2*MELEERANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack (player->mo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
AdjustPlayerAngle (player->mo);
|
||||
// player->mo->angle = R_PointToAngle2(player->mo->x,
|
||||
// player->mo->y, linetarget->x, linetarget->y);
|
||||
|
@ -117,7 +117,7 @@ void A_CMaceAttack (AActor *actor)
|
|||
|
||||
angle = player->mo->angle;
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
macedone:
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ void A_CStaffCheck (AActor *actor)
|
|||
slope = P_AimLineAttack (pmo, angle, fixed_t(1.5*MELEERANGE));
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, MOD_HIT, RUNTIME_CLASS(ACStaffPuff));
|
||||
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, RUNTIME_CLASS(ACStaffPuff));
|
||||
pmo->angle = R_PointToAngle2 (pmo->x, pmo->y,
|
||||
linetarget->x, linetarget->y);
|
||||
if ((linetarget->player || linetarget->flags3&MF3_ISMONSTER)
|
||||
|
@ -228,7 +228,7 @@ void A_CStaffCheck (AActor *actor)
|
|||
slope = P_AimLineAttack (player->mo, angle, fixed_t(1.5*MELEERANGE));
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, MOD_HIT, RUNTIME_CLASS(ACStaffPuff));
|
||||
P_LineAttack (pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, RUNTIME_CLASS(ACStaffPuff));
|
||||
pmo->angle = R_PointToAngle2 (pmo->x, pmo->y,
|
||||
linetarget->x, linetarget->y);
|
||||
if (linetarget->player || linetarget->flags3&MF3_ISMONSTER)
|
||||
|
|
|
@ -283,7 +283,7 @@ IMPLEMENT_ACTOR (ADemon1FX1, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (10)
|
||||
PROP_HeightFixed (6)
|
||||
PROP_Damage (5)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -529,7 +529,7 @@ IMPLEMENT_ACTOR (ADemon2FX1, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (10)
|
||||
PROP_HeightFixed (6)
|
||||
PROP_Damage (5)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -551,7 +551,7 @@ void A_DemonAttack1 (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_atk.HitDice (2);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ IMPLEMENT_ACTOR (ADragonFireball, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (12)
|
||||
PROP_HeightFixed (10)
|
||||
PROP_Damage (6)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -163,7 +163,7 @@ FState ADragonExplosion::States[] =
|
|||
IMPLEMENT_ACTOR (ADragonExplosion, Hexen, -1, 0)
|
||||
PROP_RadiusFixed (8)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_RenderFlags (RF_INVISIBLE)
|
||||
|
@ -251,7 +251,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_dragonseek.HitDice (10);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
S_SoundID (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM);
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ void A_DragonFlight (AActor *actor)
|
|||
if (abs(actor->angle-angle) < ANGLE_45/2 && actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_dragonflight.HitDice (8);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
S_SoundID (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM);
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ void A_EttinAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_ettinatk.HitDice (2);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,8 +37,7 @@ public:
|
|||
FState *GetUpState ();
|
||||
FState *GetDownState ();
|
||||
FState *GetReadyState ();
|
||||
FState *GetAtkState ();
|
||||
FState *GetHoldAtkState ();
|
||||
FState *GetAtkState (bool hold);
|
||||
};
|
||||
|
||||
FState AFWeapAxe::States[] =
|
||||
|
@ -121,27 +120,22 @@ END_DEFAULTS
|
|||
|
||||
FState *AFWeapAxe::GetUpState ()
|
||||
{
|
||||
return Ammo1->Amount ? &States[S_FAXEUP_G] : UpState;
|
||||
return Ammo1->Amount ? &States[S_FAXEUP_G] : Super::GetUpState();
|
||||
}
|
||||
|
||||
FState *AFWeapAxe::GetDownState ()
|
||||
{
|
||||
return Ammo1->Amount ? &States[S_FAXEDOWN_G] : DownState;
|
||||
return Ammo1->Amount ? &States[S_FAXEDOWN_G] : Super::GetDownState();
|
||||
}
|
||||
|
||||
FState *AFWeapAxe::GetReadyState ()
|
||||
{
|
||||
return Ammo1->Amount ? &States[S_FAXEREADY_G] : ReadyState;
|
||||
return Ammo1->Amount ? &States[S_FAXEREADY_G] : Super::GetReadyState();
|
||||
}
|
||||
|
||||
FState *AFWeapAxe::GetAtkState ()
|
||||
FState *AFWeapAxe::GetAtkState (bool hold)
|
||||
{
|
||||
return Ammo1->Amount ? &States[S_FAXEATK_G] : AtkState;
|
||||
}
|
||||
|
||||
FState *AFWeapAxe::GetHoldAtkState ()
|
||||
{
|
||||
return Ammo1->Amount ? &States[S_FAXEATK_G] : HoldAtkState;
|
||||
return Ammo1->Amount ? &States[S_FAXEATK_G] : Super::GetAtkState(hold);
|
||||
}
|
||||
|
||||
// Axe Puff -----------------------------------------------------------------
|
||||
|
@ -388,7 +382,7 @@ void A_FAxeAttack (AActor *actor)
|
|||
slope = P_AimLineAttack (pmo, angle, AXERANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (pmo, angle, AXERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, AXERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
if (linetarget->flags3&MF3_ISMONSTER || linetarget->player)
|
||||
{
|
||||
P_ThrustMobj (linetarget, angle, power);
|
||||
|
@ -401,7 +395,7 @@ void A_FAxeAttack (AActor *actor)
|
|||
slope = P_AimLineAttack (pmo, angle, AXERANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (pmo, angle, AXERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, AXERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
if (linetarget->flags3&MF3_ISMONSTER)
|
||||
{
|
||||
P_ThrustMobj (linetarget, angle, power);
|
||||
|
@ -416,7 +410,7 @@ void A_FAxeAttack (AActor *actor)
|
|||
|
||||
angle = pmo->angle;
|
||||
slope = P_AimLineAttack (pmo, angle, MELEERANGE);
|
||||
P_LineAttack (pmo, angle, MELEERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, MELEERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
|
||||
axedone:
|
||||
if (useMana == 2)
|
||||
|
|
|
@ -119,7 +119,7 @@ IMPLEMENT_ACTOR (AHammerMissile, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (14)
|
||||
PROP_HeightFixed (20)
|
||||
PROP_Damage (10)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
|
||||
|
@ -194,7 +194,7 @@ void A_FHammerAttack (AActor *actor)
|
|||
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
AdjustPlayerAngle(pmo);
|
||||
if (linetarget->flags3&MF3_ISMONSTER || linetarget->player)
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ void A_FHammerAttack (AActor *actor)
|
|||
slope = P_AimLineAttack(pmo, angle, HAMMER_RANGE);
|
||||
if(linetarget)
|
||||
{
|
||||
P_LineAttack(pmo, angle, HAMMER_RANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack(pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
AdjustPlayerAngle(pmo);
|
||||
if (linetarget->flags3&MF3_ISMONSTER || linetarget->player)
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ void A_FHammerAttack (AActor *actor)
|
|||
PuffSpawned = NULL;
|
||||
angle = pmo->angle;
|
||||
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE);
|
||||
P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(AHammerPuff));
|
||||
P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(AHammerPuff));
|
||||
if (PuffSpawned)
|
||||
{
|
||||
pmo->special1 = false;
|
||||
|
|
|
@ -300,7 +300,7 @@ void A_FPunchAttack (AActor *actor)
|
|||
power = 6*FRACUNIT;
|
||||
pufftype = RUNTIME_CLASS(AHammerPuff);
|
||||
}
|
||||
P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
if (linetarget->flags3&MF3_ISMONSTER || linetarget->player)
|
||||
{
|
||||
P_ThrustMobj (linetarget, angle, power);
|
||||
|
@ -319,7 +319,7 @@ void A_FPunchAttack (AActor *actor)
|
|||
power = 6*FRACUNIT;
|
||||
pufftype = RUNTIME_CLASS(AHammerPuff);
|
||||
}
|
||||
P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, 2*MELEERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
if (linetarget->flags3&MF3_ISMONSTER || linetarget->player)
|
||||
{
|
||||
P_ThrustMobj (linetarget, angle, power);
|
||||
|
@ -333,7 +333,7 @@ void A_FPunchAttack (AActor *actor)
|
|||
|
||||
angle = pmo->angle;
|
||||
slope = P_AimLineAttack (pmo, angle, MELEERANGE);
|
||||
P_LineAttack (pmo, angle, MELEERANGE, slope, damage, MOD_HIT, pufftype);
|
||||
P_LineAttack (pmo, angle, MELEERANGE, slope, damage, NAME_Melee, pufftype);
|
||||
|
||||
punchdone:
|
||||
if (pmo->special1 == 3)
|
||||
|
|
|
@ -312,7 +312,7 @@ IMPLEMENT_ACTOR (AFireDemonMissile, Hexen, -1, 0)
|
|||
PROP_HeightFixed (6)
|
||||
PROP_Mass (15)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS|MF2_FLOORCLIP)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
|
|
@ -75,7 +75,7 @@ FState AFireBomb::States[] =
|
|||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AFireBomb, Hexen, -1, 0)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOGRAVITY)
|
||||
PROP_Flags3 (MF3_FOILINVUL)
|
||||
PROP_RenderStyle (STYLE_Translucent)
|
||||
|
@ -127,7 +127,7 @@ IMPLEMENT_ACTOR (AThrowingBomb, Hexen, -1, 0)
|
|||
PROP_SpeedFixed (12)
|
||||
PROP_RadiusFixed (8)
|
||||
PROP_HeightFixed (10)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_HEXENBOUNCE)
|
||||
|
||||
|
@ -527,7 +527,7 @@ void A_CheckThrowBomb (AActor *actor)
|
|||
{
|
||||
if (--actor->health <= 0)
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ void A_FogMove (AActor *actor)
|
|||
|
||||
if (actor->args[3]-- <= 0)
|
||||
{
|
||||
actor->SetStateNF (actor->DeathState);
|
||||
actor->SetStateNF (actor->FindState(NAME_Death));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -696,7 +696,7 @@ void A_SorcBallOrbit(AActor *ball)
|
|||
// [RH] If no parent, then die instead of crashing
|
||||
if (ball->target == NULL)
|
||||
{
|
||||
ball->SetState (ball->PainState);
|
||||
ball->SetState (ball->FindState(NAME_Pain));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -715,7 +715,7 @@ void A_SorcBallOrbit(AActor *ball)
|
|||
actor = static_cast<ASorcBall *> (ball);
|
||||
|
||||
if (actor->target->health <= 0)
|
||||
actor->SetState (actor->PainState);
|
||||
actor->SetState (actor->FindState(NAME_Pain));
|
||||
|
||||
baseangle = (angle_t)parent->special1;
|
||||
angle = baseangle + actor->AngleOffset;
|
||||
|
@ -1226,7 +1226,7 @@ void A_SorcFX2Orbit (AActor *actor)
|
|||
if ((parent->health <= 0) || // Sorcerer is dead
|
||||
(!parent->args[0])) // Time expired
|
||||
{
|
||||
actor->SetStateNF (actor->DeathState);
|
||||
actor->SetStateNF (actor->FindState(NAME_Death));
|
||||
parent->args[0] = 0;
|
||||
parent->flags2 &= ~MF2_REFLECTIVE;
|
||||
parent->flags2 &= ~MF2_INVULNERABLE;
|
||||
|
@ -1234,7 +1234,7 @@ void A_SorcFX2Orbit (AActor *actor)
|
|||
|
||||
if (actor->args[0] && (parent->args[0]-- <= 0)) // Time expired
|
||||
{
|
||||
actor->SetStateNF (actor->DeathState);
|
||||
actor->SetStateNF (actor->FindState(NAME_Death));
|
||||
parent->args[0] = 0;
|
||||
parent->flags2 &= ~MF2_REFLECTIVE;
|
||||
}
|
||||
|
@ -1320,7 +1320,7 @@ void A_SorcFX4Check(AActor *actor)
|
|||
{
|
||||
if (actor->special2-- <= 0)
|
||||
{
|
||||
actor->SetStateNF (actor->DeathState);
|
||||
actor->SetStateNF (actor->FindState(NAME_Death));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1357,7 +1357,7 @@ void A_DoBounceCheck (AActor *actor, const char *sound)
|
|||
{
|
||||
if (actor->args[3]-- <= 0)
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
S_Sound (actor, CHAN_BODY, sound, 1, ATTN_NONE);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -28,12 +28,12 @@ IMPLEMENT_ABSTRACT_ACTOR (ASwitchableDecoration)
|
|||
|
||||
void ASwitchableDecoration::Activate (AActor *activator)
|
||||
{
|
||||
SetState (SeeState);
|
||||
SetState (FindState(NAME_Active));
|
||||
}
|
||||
|
||||
void ASwitchableDecoration::Deactivate (AActor *activator)
|
||||
{
|
||||
SetState (MeleeState);
|
||||
SetState (FindState(NAME_Inactive));
|
||||
}
|
||||
|
||||
// SwitchingDecoration: Only Activate changes state -------------------------
|
||||
|
@ -86,7 +86,7 @@ END_DEFAULTS
|
|||
void APottery1::HitFloor ()
|
||||
{
|
||||
Super::HitFloor ();
|
||||
P_DamageMobj (this, NULL, NULL, 25, MOD_UNKNOWN);
|
||||
P_DamageMobj (this, NULL, NULL, 25, NAME_None);
|
||||
}
|
||||
|
||||
// Pottery2 -----------------------------------------------------------------
|
||||
|
@ -216,7 +216,7 @@ void A_PotteryExplode (AActor *actor)
|
|||
|
||||
void A_PotteryChooseBit (AActor *actor)
|
||||
{
|
||||
actor->SetState (actor->DeathState+1 + 2*(pr_bit()%5));
|
||||
actor->SetState (actor->FindState(NAME_Death) + 1 + 2*(pr_bit()%5));
|
||||
actor->tics = 256+(pr_bit()<<1);
|
||||
}
|
||||
|
||||
|
@ -827,7 +827,7 @@ void AZBell::Activate (AActor *activator)
|
|||
{
|
||||
if (health > 0)
|
||||
{
|
||||
P_DamageMobj (this, activator, activator, 10, MOD_HIT); // 'ring' the bell
|
||||
P_DamageMobj (this, activator, activator, 10, NAME_Melee); // 'ring' the bell
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ IMPLEMENT_ACTOR (AIceGuy, Hexen, 8020, 20)
|
|||
PROP_RadiusFixed (22)
|
||||
PROP_HeightFixed (75)
|
||||
PROP_Mass (150)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD|MF_COUNTKILL)
|
||||
PROP_Flags2 (MF2_PASSMOBJ|MF2_TELESTOMP|MF2_PUSHWALL|MF2_MCROSS)
|
||||
PROP_Flags4 (MF4_NOICEDEATH)
|
||||
|
@ -110,7 +110,7 @@ IMPLEMENT_ACTOR (AIceGuyFX, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (8)
|
||||
PROP_HeightFixed (10)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
|
||||
|
@ -168,7 +168,7 @@ IMPLEMENT_ACTOR (AIceGuyFX2, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (4)
|
||||
PROP_HeightFixed (4)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_LOGRAV|MF2_NOTELEPORT)
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ IMPLEMENT_ACTOR (AFrostMissile, Hexen, -1, 0)
|
|||
PROP_RadiusFixed (13)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
|
||||
|
@ -139,7 +139,7 @@ FState AIceShard::States[] =
|
|||
};
|
||||
|
||||
IMPLEMENT_ACTOR (AIceShard, Hexen, -1, 65)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_SpawnState (0)
|
||||
END_DEFAULTS
|
||||
|
@ -180,7 +180,7 @@ void A_FireConePL1 (AActor *actor)
|
|||
slope = P_AimLineAttack (actor, angle, MELEERANGE);
|
||||
if (linetarget)
|
||||
{
|
||||
P_DamageMobj (linetarget, actor, actor, damage, MOD_ICE);
|
||||
P_DamageMobj (linetarget, actor, actor, damage, NAME_Ice);
|
||||
conedone = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -132,11 +132,11 @@ int ALightning::SpecialMissileHit (AActor *thing)
|
|||
{
|
||||
if (thing->IsKindOf(RUNTIME_CLASS(ACentaur)))
|
||||
{ // Lightning does more damage to centaurs
|
||||
P_DamageMobj(thing, this, target, 9, MOD_ELECTRIC);
|
||||
P_DamageMobj(thing, this, target, 9, NAME_Electric);
|
||||
}
|
||||
else
|
||||
{
|
||||
P_DamageMobj(thing, this, target, 3, MOD_ELECTRIC);
|
||||
P_DamageMobj(thing, this, target, 3, NAME_Electric);
|
||||
}
|
||||
if (!(S_IsActorPlayingSomething (this, CHAN_WEAPON, -1)))
|
||||
{
|
||||
|
@ -438,7 +438,7 @@ void A_LightningZap (AActor *actor)
|
|||
actor->health -= 8;
|
||||
if (actor->health <= 0)
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
return;
|
||||
}
|
||||
if (actor->flags3 & MF3_FLOORHUGGER)
|
||||
|
@ -532,7 +532,7 @@ void A_ZapMimic (AActor *actor)
|
|||
mo = actor->lastenemy;
|
||||
if (mo)
|
||||
{
|
||||
if (mo->state >= mo->DeathState)
|
||||
if (mo->state >= mo->FindState(NAME_Death))
|
||||
{
|
||||
P_ExplodeMissile (actor, NULL, NULL);
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ IMPLEMENT_ACTOR (AMageStaffFX2, Hexen, -1, 0)
|
|||
PROP_SpeedFixed (17)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_Damage (4)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS|MF2_SEEKERMISSILE)
|
||||
|
||||
|
@ -295,7 +295,7 @@ int AMageStaffFX2::SpecialMissileHit (AActor *victim)
|
|||
!victim->player &&
|
||||
!(victim->flags2 & MF2_BOSS))
|
||||
{
|
||||
P_DamageMobj (victim, this, target, 10, MOD_FIRE);
|
||||
P_DamageMobj (victim, this, target, 10, NAME_Fire);
|
||||
return 1; // Keep going
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -76,7 +76,7 @@ IMPLEMENT_ACTOR (ASnout, Hexen, -1, 0)
|
|||
PROP_Weapon_DownState (S_SNOUTDOWN)
|
||||
PROP_Weapon_ReadyState (S_SNOUTREADY)
|
||||
PROP_Weapon_AtkState (S_SNOUTATK)
|
||||
PROP_Weapon_HoldAtkState (S_SNOUTATK)
|
||||
PROP_Weapon_FlashState (S_SNOUTATK+1) // Not really - but it will do until this gets exported from the EXE
|
||||
PROP_Weapon_Kickback (150)
|
||||
PROP_Weapon_YAdjust (10)
|
||||
END_DEFAULTS
|
||||
|
@ -164,7 +164,10 @@ void APigPlayer::MorphPlayerThink ()
|
|||
}
|
||||
if(!(momx | momy) && pr_pigplayerthink() < 64)
|
||||
{ // Snout sniff
|
||||
P_SetPspriteNF (player, ps_weapon, ((ASnout*)GetDefaultByType(RUNTIME_CLASS(ASnout)))->AtkState + 1);
|
||||
if (player->ReadyWeapon != NULL)
|
||||
{
|
||||
P_SetPspriteNF(player, ps_weapon, player->ReadyWeapon->FindState(NAME_Flash));
|
||||
}
|
||||
S_Sound (this, CHAN_VOICE, "PigActive1", 1, ATTN_NORM); // snort
|
||||
return;
|
||||
}
|
||||
|
@ -261,7 +264,7 @@ void A_SnoutAttack (AActor *actor)
|
|||
angle = player->mo->angle;
|
||||
slope = P_AimLineAttack(player->mo, angle, MELEERANGE);
|
||||
PuffSpawned = NULL;
|
||||
P_LineAttack(player->mo, angle, MELEERANGE, slope, damage, MOD_HIT, RUNTIME_CLASS(ASnoutPuff));
|
||||
P_LineAttack(player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, RUNTIME_CLASS(ASnoutPuff));
|
||||
S_Sound(player->mo, CHAN_VOICE, "PigActive", 1, ATTN_NORM);
|
||||
if(linetarget)
|
||||
{
|
||||
|
@ -287,7 +290,7 @@ void A_PigAttack (AActor *actor)
|
|||
}
|
||||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
P_DamageMobj(actor->target, actor, actor, 2+(pr_pigattack()&1), MOD_HIT);
|
||||
P_DamageMobj(actor->target, actor, actor, 2+(pr_pigattack()&1), NAME_Melee);
|
||||
S_Sound(actor, CHAN_WEAPON, "PigAttack", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,7 +572,7 @@ void A_SerpentMeleeAttack (AActor *actor)
|
|||
if (actor->CheckMeleeRange ())
|
||||
{
|
||||
int damage = pr_serpentmeattack.HitDice (5);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
S_Sound (actor, CHAN_BODY, "SerpentMeleeHit", 1, ATTN_NORM);
|
||||
}
|
||||
|
@ -691,7 +691,7 @@ void A_SerpentHeadCheck (AActor *actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ bool PIT_ThrustStompThing (AActor *thing)
|
|||
if (thing == tsthing)
|
||||
return true; // don't clip against self
|
||||
|
||||
P_DamageMobj (thing, tsthing, tsthing, 10001, MOD_CRUSH);
|
||||
P_DamageMobj (thing, tsthing, tsthing, 10001, NAME_Crush);
|
||||
P_TraceBleed (10001, thing);
|
||||
tsthing->args[1] = 1; // Mark thrust thing as bloody
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ void A_CheckTeleRing (AActor *actor)
|
|||
{
|
||||
if (actor->special1-- <= 0)
|
||||
{
|
||||
actor->SetState (actor->DeathState);
|
||||
actor->SetState (actor->FindState(NAME_Death));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ IMPLEMENT_ACTOR (AWraithFX1, Hexen, -1, 0)
|
|||
PROP_HeightFixed (6)
|
||||
PROP_Mass (5)
|
||||
PROP_Damage (5)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
|
||||
|
@ -383,7 +383,7 @@ void A_WraithMelee (AActor *actor)
|
|||
if (actor->CheckMeleeRange() && (pr_stealhealth()<220))
|
||||
{
|
||||
amount = pr_stealhealth.HitDice (2);
|
||||
P_DamageMobj (actor->target, actor, actor, amount, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, amount, NAME_Melee);
|
||||
actor->health += amount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -548,6 +548,8 @@ static void G_DoParseMapInfo (int lump)
|
|||
switch (SC_MustMatchString (MapInfoTopLevel))
|
||||
{
|
||||
case MITL_DEFAULTMAP:
|
||||
if (defaultinfo.music != NULL) delete [] defaultinfo.music;
|
||||
if (defaultinfo.intermusic != NULL) delete [] defaultinfo.intermusic;
|
||||
SetLevelDefaults (&defaultinfo);
|
||||
ParseMapInfoLower (MapHandlers, MapInfoMapLevel, &defaultinfo, NULL, defaultinfo.flags);
|
||||
break;
|
||||
|
@ -583,6 +585,10 @@ static void G_DoParseMapInfo (int lump)
|
|||
{
|
||||
levelinfo->music = copystring (levelinfo->music);
|
||||
}
|
||||
if (levelinfo->intermusic != NULL)
|
||||
{
|
||||
levelinfo->intermusic = copystring (levelinfo->intermusic);
|
||||
}
|
||||
if (HexenHack)
|
||||
{
|
||||
levelinfo->WallHorizLight = levelinfo->WallVertLight = 0;
|
||||
|
@ -676,6 +682,14 @@ static void G_DoParseMapInfo (int lump)
|
|||
}
|
||||
}
|
||||
SC_Close ();
|
||||
if (defaultinfo.music != NULL)
|
||||
{
|
||||
delete [] defaultinfo.music;
|
||||
}
|
||||
if (defaultinfo.intermusic != NULL)
|
||||
{
|
||||
delete [] defaultinfo.intermusic;
|
||||
}
|
||||
}
|
||||
|
||||
static void ClearLevelInfoStrings(level_info_t *linfo)
|
||||
|
@ -685,6 +699,11 @@ static void ClearLevelInfoStrings(level_info_t *linfo)
|
|||
delete[] linfo->music;
|
||||
linfo->music = NULL;
|
||||
}
|
||||
if (linfo->intermusic != NULL)
|
||||
{
|
||||
delete[] linfo->intermusic;
|
||||
linfo->intermusic = NULL;
|
||||
}
|
||||
if (linfo->level_name != NULL)
|
||||
{
|
||||
delete[] linfo->level_name;
|
||||
|
|
|
@ -220,7 +220,7 @@ AT_GAME_SET (Minotaur)
|
|||
AMinotaur::States[S_MNTR_ATK3+3].SetFrame ('I');
|
||||
AMinotaur::States[S_MNTR_ATK4+0].SetFrame ('F');
|
||||
|
||||
GetDefault<AMinotaur>()->DeathState = &AMinotaur::States[S_MNTR_FADEOUT];
|
||||
RUNTIME_CLASS(AMinotaur)->ActorInfo->ChangeState(NAME_Death, &AMinotaur::States[S_MNTR_FADEOUT]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ IMPLEMENT_ACTOR (AMinotaurFX1, Raven, -1, 0)
|
|||
PROP_HeightFixed (6)
|
||||
PROP_SpeedFixed (20)
|
||||
PROP_Damage (3)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
|
||||
PROP_Flags2 (MF2_NOTELEPORT)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -503,7 +503,7 @@ void A_MinotaurAtk1 (AActor *actor)
|
|||
if (actor->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_minotauratk1.HitDice (4);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
if ((player = actor->target->player) != NULL &&
|
||||
player->mo == actor->target)
|
||||
|
@ -635,7 +635,7 @@ void A_MinotaurAtk2 (AActor *actor)
|
|||
{
|
||||
int damage;
|
||||
damage = pr_atk.HitDice (friendly ? 3 : 5);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
return;
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ void A_MinotaurAtk3 (AActor *actor)
|
|||
int damage;
|
||||
|
||||
damage = pr_minotauratk3.HitDice (friendly ? 3 : 5);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, MOD_HIT);
|
||||
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, actor->target, actor);
|
||||
if ((player = actor->target->player) != NULL &&
|
||||
player->mo == actor->target)
|
||||
|
@ -738,7 +738,7 @@ void P_MinotaurSlam (AActor *source, AActor *target)
|
|||
target->momx += FixedMul (thrust, finecosine[angle]);
|
||||
target->momy += FixedMul (thrust, finesine[angle]);
|
||||
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
|
||||
P_DamageMobj (target, NULL, NULL, damage, MOD_HIT);
|
||||
P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, target, angle, 0);
|
||||
if (target->player)
|
||||
{
|
||||
|
@ -790,7 +790,7 @@ void A_MinotaurRoam (AActor *actor)
|
|||
|
||||
if (self->StartTime >= 0 && (level.maptime - self->StartTime) >= MAULATORTICS)
|
||||
{
|
||||
P_DamageMobj (actor, NULL, NULL, 1000000, MOD_UNKNOWN);
|
||||
P_DamageMobj (actor, NULL, NULL, 1000000, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -909,7 +909,7 @@ void A_MinotaurChase (AActor *actor)
|
|||
|
||||
if (self->StartTime >= 0 && (level.maptime - self->StartTime) >= MAULATORTICS)
|
||||
{
|
||||
P_DamageMobj (actor, NULL, NULL, 1000000, MOD_UNKNOWN);
|
||||
P_DamageMobj (actor, NULL, NULL, 1000000, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ IMPLEMENT_ACTOR (AIceChunkHead, Any, -1, 0)
|
|||
PROP_RadiusFixed (3)
|
||||
PROP_HeightFixed (4)
|
||||
PROP_Mass(5)
|
||||
PROP_DamageType (MOD_ICE)
|
||||
PROP_DamageType (NAME_Ice)
|
||||
PROP_Flags (MF_DROPOFF)
|
||||
PROP_Flags2 (MF2_LOGRAV|MF2_CANNOTPUSH)
|
||||
|
||||
|
@ -214,11 +214,11 @@ void A_IceSetTics (AActor *actor)
|
|||
|
||||
actor->tics = 70+(pr_icesettics()&63);
|
||||
floor = P_GetThingFloorType (actor);
|
||||
if (Terrains[floor].DamageMOD == MOD_FIRE)
|
||||
if (Terrains[floor].DamageMOD == NAME_Fire)
|
||||
{
|
||||
actor->tics >>= 2;
|
||||
}
|
||||
else if (Terrains[floor].DamageMOD == MOD_ICE)
|
||||
else if (Terrains[floor].DamageMOD == NAME_Ice)
|
||||
{
|
||||
actor->tics <<= 1;
|
||||
}
|
||||
|
|
|
@ -551,9 +551,9 @@ END_DEFAULTS
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerIronFeet::AbsorbDamage (int damage, int damageType, int &newdamage)
|
||||
void APowerIronFeet::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
||||
{
|
||||
if (damageType == MOD_WATER)
|
||||
if (damageType == NAME_Water)
|
||||
{
|
||||
newdamage = 0;
|
||||
if (Owner->player != NULL)
|
||||
|
@ -582,9 +582,9 @@ END_DEFAULTS
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void APowerMask::AbsorbDamage (int damage, int damageType, int &newdamage)
|
||||
void APowerMask::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
||||
{
|
||||
if (damageType == MOD_FIRE)
|
||||
if (damageType == NAME_Fire)
|
||||
{
|
||||
newdamage = 0;
|
||||
}
|
||||
|
|
|
@ -104,14 +104,14 @@ class APowerIronFeet : public APowerup
|
|||
{
|
||||
DECLARE_STATELESS_ACTOR (APowerIronFeet, APowerup)
|
||||
public:
|
||||
void AbsorbDamage (int damage, int damageType, int &newdamage);
|
||||
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
};
|
||||
|
||||
class APowerMask : public APowerIronFeet
|
||||
{
|
||||
DECLARE_STATELESS_ACTOR (APowerMask, APowerIronFeet)
|
||||
public:
|
||||
void AbsorbDamage (int damage, int damageType, int &newdamage);
|
||||
void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
void DoEffect ();
|
||||
};
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class AHateTarget : public AActor
|
|||
public:
|
||||
void BeginPlay ();
|
||||
angle_t AngleIncrements (void);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
FState AHateTarget::States[] =
|
||||
|
@ -76,7 +76,7 @@ void AHateTarget::BeginPlay ()
|
|||
}
|
||||
}
|
||||
|
||||
int AHateTarget::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype)
|
||||
int AHateTarget::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
if (special2 != 0)
|
||||
{
|
||||
|
|
|
@ -764,7 +764,7 @@ void AInventory::BecomePickup ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AInventory::AbsorbDamage (int damage, int damageType, int &newdamage)
|
||||
void AInventory::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
||||
{
|
||||
if (Inventory != NULL)
|
||||
{
|
||||
|
@ -1250,18 +1250,6 @@ void AInventory::DetachFromOwner ()
|
|||
IMPLEMENT_STATELESS_ACTOR (ACustomInventory, Any, -1, 0)
|
||||
END_DEFAULTS
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// ACustomInventory :: Serialize
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void ACustomInventory::Serialize (FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << UseState << PickupState << DropState;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// ACustomInventory :: SpecialDropAction
|
||||
|
@ -1270,7 +1258,7 @@ void ACustomInventory::Serialize (FArchive &arc)
|
|||
|
||||
bool ACustomInventory::SpecialDropAction (AActor *dropper)
|
||||
{
|
||||
return CallStateChain (dropper, DropState);
|
||||
return CallStateChain (dropper, FindState(NAME_Drop));
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -1281,7 +1269,7 @@ bool ACustomInventory::SpecialDropAction (AActor *dropper)
|
|||
|
||||
bool ACustomInventory::Use (bool pickup)
|
||||
{
|
||||
return CallStateChain (Owner, UseState);
|
||||
return CallStateChain (Owner, FindState(NAME_Use));
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -1292,8 +1280,9 @@ bool ACustomInventory::Use (bool pickup)
|
|||
|
||||
bool ACustomInventory::TryPickup (AActor *toucher)
|
||||
{
|
||||
bool useok = CallStateChain (toucher, PickupState);
|
||||
if ((useok || PickupState == NULL) && UseState != NULL)
|
||||
FState *pickupstate = FindState(NAME_Pickup);
|
||||
bool useok = CallStateChain (toucher, pickupstate);
|
||||
if ((useok || pickupstate == NULL) && FindState(NAME_Use) != NULL)
|
||||
{
|
||||
useok = Super::TryPickup (toucher);
|
||||
}
|
||||
|
@ -1561,9 +1550,9 @@ bool ABasicArmor::HandlePickup (AInventory *item)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void ABasicArmor::AbsorbDamage (int damage, int damageType, int &newdamage)
|
||||
void ABasicArmor::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
||||
{
|
||||
if (damageType != MOD_WATER)
|
||||
if (damageType != NAME_Water)
|
||||
{
|
||||
int saved = FixedMul (damage, SavePercent);
|
||||
if (Amount < saved)
|
||||
|
@ -1725,9 +1714,9 @@ bool AHexenArmor::AddArmorToSlot (AActor *actor, int slot, int amount)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AHexenArmor::AbsorbDamage (int damage, int damageType, int &newdamage)
|
||||
void AHexenArmor::AbsorbDamage (int damage, FName damageType, int &newdamage)
|
||||
{
|
||||
if (damageType != MOD_WATER)
|
||||
if (damageType != NAME_Water)
|
||||
{
|
||||
fixed_t savedPercent = Slots[0] + Slots[1] + Slots[2] + Slots[3] + Slots[4];
|
||||
APlayerPawn *ppawn = Owner->player != NULL ? Owner->player->mo : NULL;
|
||||
|
|
|
@ -149,7 +149,7 @@ public:
|
|||
virtual void Travelled ();
|
||||
virtual void OwnerDied ();
|
||||
|
||||
virtual void AbsorbDamage (int damage, int damageType, int &newdamage);
|
||||
virtual void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
virtual void AlterWeaponSprite (vissprite_t *vis);
|
||||
|
||||
virtual PalEntry GetBlend ();
|
||||
|
@ -167,12 +167,10 @@ class ACustomInventory : public AInventory
|
|||
{
|
||||
DECLARE_STATELESS_ACTOR (ACustomInventory, AInventory)
|
||||
public:
|
||||
FState *UseState, *PickupState, *DropState;
|
||||
|
||||
// This is used when an inventory item's use state sequence is executed.
|
||||
static bool CallStateChain (AActor *actor, FState *state);
|
||||
|
||||
void Serialize (FArchive &arc);
|
||||
bool TryPickup (AActor *toucher);
|
||||
bool Use (bool pickup);
|
||||
bool SpecialDropAction (AActor *dropper);
|
||||
|
@ -211,13 +209,6 @@ public:
|
|||
int SelectionOrder; // Lower-numbered weapons get picked first
|
||||
fixed_t MoveCombatDist; // Used by bots, but do they *really* need it?
|
||||
|
||||
FState *UpState;
|
||||
FState *DownState;
|
||||
FState *ReadyState;
|
||||
FState *AtkState, *HoldAtkState;
|
||||
FState *AltAtkState, *AltHoldAtkState;
|
||||
FState *FlashState, *AltFlashState;
|
||||
|
||||
// In-inventory instance variables
|
||||
AAmmo *Ammo1, *Ammo2;
|
||||
AWeapon *SisterWeapon;
|
||||
|
@ -237,8 +228,8 @@ public:
|
|||
virtual FState *GetUpState ();
|
||||
virtual FState *GetDownState ();
|
||||
virtual FState *GetReadyState ();
|
||||
virtual FState *GetAtkState ();
|
||||
virtual FState *GetHoldAtkState ();
|
||||
virtual FState *GetAtkState (bool hold);
|
||||
virtual FState *GetAltAtkState (bool hold);
|
||||
|
||||
virtual void PostMorphWeapon ();
|
||||
virtual void EndPowerup ();
|
||||
|
@ -326,7 +317,7 @@ public:
|
|||
virtual void Tick ();
|
||||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
virtual void AbsorbDamage (int damage, int damageType, int &newdamage);
|
||||
virtual void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
|
||||
fixed_t SavePercent;
|
||||
};
|
||||
|
@ -368,7 +359,7 @@ public:
|
|||
virtual AInventory *CreateCopy (AActor *other);
|
||||
virtual AInventory *CreateTossable ();
|
||||
virtual bool HandlePickup (AInventory *item);
|
||||
virtual void AbsorbDamage (int damage, int damageType, int &newdamage);
|
||||
virtual void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
|
||||
fixed_t Slots[5];
|
||||
fixed_t SlotsIncrement[4];
|
||||
|
|
|
@ -96,7 +96,7 @@ void DEarthquake::Tick ()
|
|||
{
|
||||
if (pr_quake() < 50)
|
||||
{
|
||||
P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), MOD_UNKNOWN);
|
||||
P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), NAME_None);
|
||||
}
|
||||
// Thrust player around
|
||||
angle_t an = victim->angle + ANGLE_1*pr_quake();
|
||||
|
|
|
@ -52,10 +52,6 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
<< ProjectileType << AltProjectileType
|
||||
<< SelectionOrder
|
||||
<< MoveCombatDist
|
||||
<< UpState << DownState << ReadyState
|
||||
<< AtkState << HoldAtkState
|
||||
<< AltAtkState << AltHoldAtkState
|
||||
<< FlashState << AltFlashState
|
||||
<< Ammo1 << Ammo2 << SisterWeapon
|
||||
<< bAltFire;
|
||||
}
|
||||
|
@ -70,6 +66,7 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
|
||||
bool AWeapon::TryPickup (AActor *toucher)
|
||||
{
|
||||
FState * ReadyState = FindState(NAME_Ready);
|
||||
if (ReadyState != NULL &&
|
||||
ReadyState->GetFrame() < sprites[ReadyState->sprite.index].numframes)
|
||||
{
|
||||
|
@ -394,7 +391,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo)
|
|||
{
|
||||
enoughmask = 1 << altFire;
|
||||
}
|
||||
if (altFire && AltAtkState == NULL)
|
||||
if (altFire && FindState(NAME_AltFire) == NULL)
|
||||
{ // If this weapon has no alternate fire, then there is never enough ammo for it
|
||||
enough &= 1;
|
||||
}
|
||||
|
@ -472,7 +469,7 @@ void AWeapon::PostMorphWeapon ()
|
|||
Owner->player->PendingWeapon = WP_NOCHANGE;
|
||||
Owner->player->ReadyWeapon = this;
|
||||
Owner->player->psprites[ps_weapon].sy = WEAPONBOTTOM;
|
||||
P_SetPsprite (Owner->player, ps_weapon, UpState);
|
||||
P_SetPsprite (Owner->player, ps_weapon, GetUpState());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -487,7 +484,7 @@ void AWeapon::EndPowerup ()
|
|||
{
|
||||
if (SisterWeapon != NULL && WeaponFlags&WIF_POWERED_UP)
|
||||
{
|
||||
if (ReadyState != SisterWeapon->ReadyState)
|
||||
if (GetReadyState() != SisterWeapon->GetReadyState())
|
||||
{
|
||||
Owner->player->PendingWeapon = SisterWeapon;
|
||||
}
|
||||
|
@ -506,7 +503,7 @@ void AWeapon::EndPowerup ()
|
|||
|
||||
FState *AWeapon::GetUpState ()
|
||||
{
|
||||
return UpState;
|
||||
return FindState(NAME_Select);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -517,7 +514,7 @@ FState *AWeapon::GetUpState ()
|
|||
|
||||
FState *AWeapon::GetDownState ()
|
||||
{
|
||||
return DownState;
|
||||
return FindState(NAME_Deselect);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -528,7 +525,7 @@ FState *AWeapon::GetDownState ()
|
|||
|
||||
FState *AWeapon::GetReadyState ()
|
||||
{
|
||||
return ReadyState;
|
||||
return FindState(NAME_Ready);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -537,20 +534,28 @@ FState *AWeapon::GetReadyState ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AWeapon::GetAtkState ()
|
||||
FState *AWeapon::GetAtkState (bool hold)
|
||||
{
|
||||
return AtkState;
|
||||
FState * state=NULL;
|
||||
|
||||
if (hold) state = FindState(NAME_Hold);
|
||||
if (state == NULL) state = FindState(NAME_Fire);
|
||||
return state;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AWeapon :: GetHoldAtkState
|
||||
// AWeapon :: GetAtkState
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AWeapon::GetHoldAtkState ()
|
||||
FState *AWeapon::GetAltAtkState (bool hold)
|
||||
{
|
||||
return HoldAtkState;
|
||||
FState * state=NULL;
|
||||
|
||||
if (hold) state = FindState(NAME_AltHold);
|
||||
if (state == NULL) state = FindState(NAME_AltFire);
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Weapon slots ***********************************************************/
|
||||
|
@ -792,7 +797,7 @@ CCMD (setslot)
|
|||
{
|
||||
int slot, i;
|
||||
|
||||
if (ParsingKeyConf && !WeaponSection)
|
||||
if (ParsingKeyConf && WeaponSection.IsEmpty())
|
||||
{
|
||||
Printf ("You need to use weaponsection before using setslot\n");
|
||||
return;
|
||||
|
@ -861,7 +866,7 @@ CCMD (weaponsection)
|
|||
{
|
||||
argv[1][32] = 0;
|
||||
}
|
||||
ReplaceString (&WeaponSection, argv[1]);
|
||||
WeaponSection = argv[1];
|
||||
|
||||
// If the ini already has definitions for this section, load them
|
||||
char fullSection[32*3];
|
||||
|
@ -888,7 +893,7 @@ CCMD (weaponsection)
|
|||
tackOn = fullSection + 4;
|
||||
}
|
||||
|
||||
sprintf (tackOn, ".%s.WeaponSlots", WeaponSection);
|
||||
sprintf (tackOn, ".%s.WeaponSlots", WeaponSection.GetChars());
|
||||
if (GameConfig->SetSection (fullSection))
|
||||
{
|
||||
LocalWeapons.RestoreSlots (*GameConfig);
|
||||
|
@ -907,7 +912,7 @@ CCMD (addslotdefault)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ParsingKeyConf && !WeaponSection)
|
||||
if (ParsingKeyConf && WeaponSection.IsEmpty())
|
||||
{
|
||||
Printf ("You need to use weaponsection before using addslotdefault\n");
|
||||
return;
|
||||
|
|
|
@ -1366,7 +1366,7 @@ void FBaseStatusBar::BlendView (float blend[4])
|
|||
{
|
||||
AddBlend (0.f, 1.f, 0.f, 0.125f, blend);
|
||||
}
|
||||
if (CPlayer->mo->DamageType == MOD_ICE)
|
||||
if (CPlayer->mo->DamageType == NAME_Ice)
|
||||
{
|
||||
AddBlend (0.25f, 0.25f, 0.853f, 0.4f, blend);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ END_DEFAULTS
|
|||
|
||||
void AAlienSpectre1::Touch (AActor *toucher)
|
||||
{
|
||||
P_DamageMobj (toucher, this, this, 5, MOD_HIT);
|
||||
P_DamageMobj (toucher, this, this, 5, NAME_Melee);
|
||||
}
|
||||
|
||||
// Alien Spectre 2 -----------------------------------------------------------
|
||||
|
|
|
@ -182,7 +182,7 @@ void AEntityBoss::BeginPlay ()
|
|||
|
||||
void AEntityBoss::Touch (AActor *toucher)
|
||||
{
|
||||
P_DamageMobj (toucher, this, this, 5, MOD_HIT);
|
||||
P_DamageMobj (toucher, this, this, 5, NAME_Melee);
|
||||
}
|
||||
|
||||
// Second Entity Boss -------------------------------------------------------
|
||||
|
@ -273,7 +273,7 @@ END_DEFAULTS
|
|||
|
||||
void AEntitySecond::Touch (AActor *toucher)
|
||||
{
|
||||
P_DamageMobj (toucher, this, this, 5, MOD_HIT);
|
||||
P_DamageMobj (toucher, this, this, 5, NAME_Melee);
|
||||
}
|
||||
|
||||
void A_SubEntityDeath (AActor *self)
|
||||
|
|
|
@ -190,7 +190,7 @@ void A_20538 (AActor *self)
|
|||
|
||||
damage = (pr_atk1() & 9) * 5;
|
||||
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_UNKNOWN);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_None);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ class AMacil2 : public AMacil1
|
|||
DECLARE_STATELESS_ACTOR (AMacil2, AMacil1)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
IMPLEMENT_STATELESS_ACTOR (AMacil2, Strife, 200, 0)
|
||||
|
@ -161,7 +161,7 @@ void AMacil2::NoBlockingSet ()
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
int AMacil2::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype)
|
||||
int AMacil2::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
if (inflictor != NULL && inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1)))
|
||||
return -1;
|
||||
|
|
|
@ -79,7 +79,7 @@ void A_WakeOracleSpectre (AActor *self)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
int AOracle::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype)
|
||||
int AOracle::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
if (inflictor != NULL && inflictor->IsKindOf (RUNTIME_CLASS(ASpectralLightningV1)))
|
||||
return -1;
|
||||
|
|
|
@ -230,7 +230,7 @@ void A_ProgrammerMelee (AActor *self)
|
|||
S_Sound (self, CHAN_WEAPON, "programmer/clank", 1, ATTN_NORM);
|
||||
|
||||
damage = ((pr_prog() % 10) + 1) * 6;
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ void A_ReaverMelee (AActor *self)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "reaver/blade", 1, ATTN_NORM);
|
||||
damage = ((pr_reaverattack() & 7) + 1) * 3;
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ void A_ReaverRanged (AActor *self)
|
|||
{
|
||||
angle_t angle = bangle + (pr_reaverattack.Random2() << 20);
|
||||
int damage = ((pr_reaverattack() & 7) + 1) * 3;
|
||||
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(AStrifePuff));
|
||||
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, NAME_None, RUNTIME_CLASS(AStrifePuff));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ void A_ShootGun (AActor *self)
|
|||
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
|
||||
P_LineAttack (self, self->angle + (pr_shootgun.Random2() << 19),
|
||||
MISSILERANGE, pitch,
|
||||
3*(pr_shootgun() % 5 + 1), MOD_UNKNOWN, RUNTIME_CLASS(AStrifePuff));
|
||||
3*(pr_shootgun() % 5 + 1), NAME_None, RUNTIME_CLASS(AStrifePuff));
|
||||
}
|
||||
|
||||
// Rebel 1 ------------------------------------------------------------------
|
||||
|
|
|
@ -100,7 +100,7 @@ IMPLEMENT_ACTOR (ASentinelFX1, Strife, -1, 0)
|
|||
PROP_RadiusFixed (10)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_Damage (0)
|
||||
PROP_DamageType (MOD_DISINTEGRATE)
|
||||
PROP_DamageType (NAME_Disintegrate)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
|
||||
PROP_Flags4 (MF4_STRIFEDAMAGE)
|
||||
|
|
|
@ -153,7 +153,7 @@ void A_StalkerAttack (AActor *self)
|
|||
{
|
||||
int damage = (pr_stalker() & 7) * 2 + 2;
|
||||
|
||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (damage, self->target, self);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class AOracle : public AActor
|
|||
DECLARE_ACTOR (AOracle, AActor)
|
||||
public:
|
||||
void NoBlockingSet ();
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
class ADummyStrifeItem : public AInventory
|
||||
|
|
|
@ -391,7 +391,7 @@ class AForceFieldGuard : public AActor
|
|||
{
|
||||
DECLARE_ACTOR (AForceFieldGuard, AActor)
|
||||
public:
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
FState AForceFieldGuard::States[] =
|
||||
|
@ -412,7 +412,7 @@ IMPLEMENT_ACTOR (AForceFieldGuard, Strife, 25, 0)
|
|||
PROP_Flags4 (MF4_INCOMBAT)
|
||||
END_DEFAULTS
|
||||
|
||||
int AForceFieldGuard::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype)
|
||||
int AForceFieldGuard::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
if (inflictor == NULL || !inflictor->IsKindOf (RUNTIME_CLASS(ADegninOre)))
|
||||
{
|
||||
|
@ -820,7 +820,7 @@ void A_CheckTerrain (AActor *self)
|
|||
{
|
||||
if ((sec->special & 0xFF) == Damage_InstantDeath)
|
||||
{
|
||||
P_DamageMobj (self, NULL, NULL, 999, MOD_UNKNOWN);
|
||||
P_DamageMobj (self, NULL, NULL, 999, NAME_None);
|
||||
}
|
||||
else if ((sec->special & 0xFF) == Scroll_StrifeCurrent)
|
||||
{
|
||||
|
@ -967,7 +967,7 @@ void A_DropFire (AActor *self)
|
|||
{
|
||||
AActor *drop = Spawn<AFireDroplet> (self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
|
||||
drop->momz = -FRACUNIT;
|
||||
P_RadiusAttack (self, self, 64, 64, MOD_FIRE, false);
|
||||
P_RadiusAttack (self, self, 64, 64, NAME_Fire, false);
|
||||
}
|
||||
|
||||
void A_CrispyPlayer (AActor *self)
|
||||
|
|
|
@ -153,9 +153,10 @@ void P_DaggerAlert (AActor *target, AActor *emitter)
|
|||
emitter->flags4 |= MF4_INCOMBAT;
|
||||
|
||||
emitter->target = target;
|
||||
if (emitter->PainState != NULL)
|
||||
FState * painstate = emitter->FindState(NAME_Pain);
|
||||
if (painstate != NULL)
|
||||
{
|
||||
emitter->SetState (emitter->PainState);
|
||||
emitter->SetState (painstate);
|
||||
}
|
||||
|
||||
for (looker = sec->thinglist; looker != NULL; looker = looker->snext)
|
||||
|
@ -208,7 +209,7 @@ void A_JabDagger (AActor *actor)
|
|||
|
||||
angle = actor->angle + (pr_jabdagger.Random2() << 18);
|
||||
pitch = P_AimLineAttack (actor, angle, 80*FRACUNIT);
|
||||
P_LineAttack (actor, angle, 80*FRACUNIT, pitch, damage, MOD_HIT, RUNTIME_CLASS(AStrifeSpark));
|
||||
P_LineAttack (actor, angle, 80*FRACUNIT, pitch, damage, NAME_Melee, RUNTIME_CLASS(AStrifeSpark));
|
||||
|
||||
// turn to face target
|
||||
if (linetarget)
|
||||
|
@ -689,7 +690,7 @@ void P_StrifeGunShot (AActor *mo, bool accurate)
|
|||
angle += pr_sgunshot.Random2() << (20 - mo->player->accuracy * 5 / 100);
|
||||
}
|
||||
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, MOD_UNKNOWN, RUNTIME_CLASS(AStrifePuff));
|
||||
P_LineAttack (mo, angle, PLAYERMISSILERANGE, bulletpitch, damage, NAME_None, RUNTIME_CLASS(AStrifePuff));
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -1025,7 +1026,7 @@ IMPLEMENT_ACTOR (AFlameMissile, Strife, -1, 0)
|
|||
PROP_HeightFixed (11)
|
||||
PROP_Mass (10)
|
||||
PROP_Damage (4)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_ReactionTime (8)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT)
|
||||
|
@ -1209,7 +1210,7 @@ FState AMaulerPuff::States[] =
|
|||
|
||||
IMPLEMENT_ACTOR (AMaulerPuff, Strife, -1, 0)
|
||||
PROP_SpawnState (0)
|
||||
PROP_DamageType (MOD_DISINTEGRATE)
|
||||
PROP_DamageType (NAME_Disintegrate)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
|
||||
PROP_Flags3 (MF3_PUFFONACTORS)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -1243,7 +1244,7 @@ IMPLEMENT_ACTOR (AMaulerTorpedo, Strife, -1, 0)
|
|||
PROP_RadiusFixed (13)
|
||||
PROP_HeightFixed (8)
|
||||
PROP_Damage (1)
|
||||
PROP_DamageType (MOD_DISINTEGRATE)
|
||||
PROP_DamageType (NAME_Disintegrate)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT)
|
||||
PROP_Flags4 (MF4_STRIFEDAMAGE)
|
||||
|
@ -1274,7 +1275,7 @@ IMPLEMENT_ACTOR (AMaulerTorpedoWave, Strife, -1, 0)
|
|||
PROP_RadiusFixed (13)
|
||||
PROP_HeightFixed (13)
|
||||
PROP_Damage (10)
|
||||
PROP_DamageType (MOD_DISINTEGRATE)
|
||||
PROP_DamageType (NAME_Disintegrate)
|
||||
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
|
||||
PROP_Flags2 (MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT)
|
||||
PROP_Flags4 (MF4_STRIFEDAMAGE)
|
||||
|
@ -1320,7 +1321,7 @@ void A_FireMauler1 (AActor *self)
|
|||
// it should use a different puff. ZDoom's default range is longer
|
||||
// than this, so let's not handicap it by being too faithful to the
|
||||
// original.
|
||||
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, MOD_DISINTEGRATE, RUNTIME_CLASS(AMaulerPuff));
|
||||
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Disintegrate, RUNTIME_CLASS(AMaulerPuff));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1563,7 +1564,7 @@ IMPLEMENT_ACTOR (APhosphorousFire, Strife, -1, 0)
|
|||
PROP_SpawnState (S_BURNINATION)
|
||||
PROP_DeathState (S_BURNDWINDLE)
|
||||
PROP_ReactionTime (120)
|
||||
PROP_DamageType (MOD_FIRE)
|
||||
PROP_DamageType (NAME_Fire)
|
||||
PROP_Flags (MF_NOBLOCKMAP)
|
||||
PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT|MF2_NODMGTHRUST)
|
||||
PROP_RenderStyle (STYLE_Add)
|
||||
|
@ -1783,8 +1784,8 @@ void A_FireGrenade (AActor *self)
|
|||
return;
|
||||
|
||||
// Make it flash
|
||||
P_SetPsprite (player, ps_flash, weapon->FlashState +
|
||||
(player->psprites[ps_weapon].state - weapon->GetAtkState()));
|
||||
P_SetPsprite (player, ps_flash, weapon->FindState(NAME_Flash) +
|
||||
(player->psprites[ps_weapon].state - weapon->GetAtkState(false)));
|
||||
|
||||
self->z += 32*FRACUNIT;
|
||||
grenade = P_SpawnSubMissile (self, grenadetype, self);
|
||||
|
@ -1804,7 +1805,7 @@ void A_FireGrenade (AActor *self)
|
|||
grenade->x += FixedMul (finecosine[an], tworadii);
|
||||
grenade->y += FixedMul (finesine[an], tworadii);
|
||||
|
||||
if (weapon->GetAtkState() == player->psprites[ps_weapon].state)
|
||||
if (weapon->GetAtkState(false) == player->psprites[ps_weapon].state)
|
||||
{
|
||||
an = self->angle - ANGLE_90;
|
||||
}
|
||||
|
|
|
@ -137,6 +137,6 @@ void A_1fce8 (AActor *self)
|
|||
damage = (pr_templar() & 4) * 2;
|
||||
angle = self->angle + (pr_templar.Random2() << 19);
|
||||
pitchdiff = pr_templar.Random2() * 332063;
|
||||
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, MOD_DISINTEGRATE, RUNTIME_CLASS(AMaulerPuff));
|
||||
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_Disintegrate, RUNTIME_CLASS(AMaulerPuff));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ void A_ExtraLightOff (AActor *self)
|
|||
|
||||
void A_Explode512 (AActor *self)
|
||||
{
|
||||
P_RadiusAttack (self, self->target, 512, 512, MOD_UNKNOWN, true);
|
||||
P_RadiusAttack (self, self->target, 512, 512, NAME_None, true);
|
||||
if (self->target != NULL && self->target->player != NULL)
|
||||
{
|
||||
self->target->player->extralight = 5;
|
||||
|
|
|
@ -71,7 +71,7 @@ EXTERN_CVAR (Color, am_wallcolor)
|
|||
EXTERN_CVAR (Color, am_fdwallcolor)
|
||||
EXTERN_CVAR (Color, am_cdwallcolor)
|
||||
|
||||
char *WeaponSection;
|
||||
FString WeaponSection;
|
||||
|
||||
FGameConfigFile::FGameConfigFile ()
|
||||
{
|
||||
|
@ -477,13 +477,13 @@ void FGameConfigFile::ArchiveGameData (const char *gamename)
|
|||
ClearCurrentSection ();
|
||||
C_ArchiveBindings (this, true);
|
||||
|
||||
if (WeaponSection == NULL)
|
||||
if (WeaponSection.IsEmpty())
|
||||
{
|
||||
strcpy (subsection, "WeaponSlots");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (subsection, "%s.WeaponSlots", WeaponSection);
|
||||
sprintf (subsection, "%s.WeaponSlots", WeaponSection.GetChars());
|
||||
}
|
||||
SetSection (section, true);
|
||||
ClearCurrentSection ();
|
||||
|
|
|
@ -69,6 +69,6 @@ private:
|
|||
char *subsection;
|
||||
};
|
||||
|
||||
extern char *WeaponSection;
|
||||
extern FString WeaponSection;
|
||||
|
||||
#endif //__GAMECONFIGFILE_H__
|
||||
|
|
322
src/info.cpp
322
src/info.cpp
|
@ -49,6 +49,7 @@
|
|||
#include "r_state.h"
|
||||
#include "i_system.h"
|
||||
#include "p_local.h"
|
||||
#include "templates.h"
|
||||
|
||||
extern void LoadDecorations (void (*process)(FState *, int));
|
||||
|
||||
|
@ -64,6 +65,11 @@ extern void LoadDecorations (void (*process)(FState *, int));
|
|||
|
||||
#define NULL_STATE_INDEX 127
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FArchive &operator<< (FArchive &arc, FState *&state)
|
||||
{
|
||||
const PClass *info;
|
||||
|
@ -119,7 +125,12 @@ FArchive &operator<< (FArchive &arc, FState *&state)
|
|||
return arc;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Find the actor that a state belongs to.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const PClass *FState::StaticFindStateOwner (const FState *state)
|
||||
{
|
||||
const FActorInfo *info = RUNTIME_CLASS(AActor)->ActorInfo;
|
||||
|
@ -153,8 +164,13 @@ const PClass *FState::StaticFindStateOwner (const FState *state)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Find the actor that a state belongs to, but restrict the search to
|
||||
// the specified type and its ancestors.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const PClass *FState::StaticFindStateOwner (const FState *state, const FActorInfo *info)
|
||||
{
|
||||
while (info != NULL)
|
||||
|
@ -169,6 +185,11 @@ const PClass *FState::StaticFindStateOwner (const FState *state, const FActorInf
|
|||
return NULL;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int GetSpriteIndex(const char * spritename)
|
||||
{
|
||||
for (unsigned i = 0; i < sprites.Size (); ++i)
|
||||
|
@ -187,7 +208,12 @@ int GetSpriteIndex(const char * spritename)
|
|||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Change sprite names to indices
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static void ProcessStates (FState *states, int numstates)
|
||||
{
|
||||
int sprite = -1;
|
||||
|
@ -205,6 +231,12 @@ static void ProcessStates (FState *states, int numstates)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FActorInfo::StaticInit ()
|
||||
{
|
||||
TAutoSegIterator<FActorInfo *, &ARegHead, &ARegTail> reg;
|
||||
|
@ -247,7 +279,12 @@ void FActorInfo::StaticInit ()
|
|||
LoadDecorations (ProcessStates);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Called after the IWAD has been identified
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FActorInfo::StaticGameSet ()
|
||||
{
|
||||
// Run every AT_GAME_SET function
|
||||
|
@ -258,7 +295,12 @@ void FActorInfo::StaticGameSet ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Called after Dehacked patches are applied
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FActorInfo::StaticSetActorNums ()
|
||||
{
|
||||
memset (SpawnableThings, 0, sizeof(SpawnableThings));
|
||||
|
@ -278,6 +320,11 @@ void FActorInfo::StaticSetActorNums ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FActorInfo::RegisterIDs ()
|
||||
{
|
||||
if (GameFilter == GAME_Any || (GameFilter & gameinfo.gametype))
|
||||
|
@ -293,8 +340,12 @@ void FActorInfo::RegisterIDs ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Called when a new game is started, but only if the game
|
||||
// speed has changed.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FActorInfo::StaticSpeedSet ()
|
||||
{
|
||||
|
@ -305,6 +356,11 @@ void FActorInfo::StaticSpeedSet ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FActorInfo *FActorInfo::GetReplacement ()
|
||||
{
|
||||
if (Replacement == NULL)
|
||||
|
@ -320,6 +376,11 @@ FActorInfo *FActorInfo::GetReplacement ()
|
|||
return rep;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FActorInfo *FActorInfo::GetReplacee ()
|
||||
{
|
||||
if (Replacee == NULL)
|
||||
|
@ -335,6 +396,267 @@ FActorInfo *FActorInfo::GetReplacee ()
|
|||
return rep;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FStateLabel *FStateLabels::FindLabel (FName label)
|
||||
{
|
||||
return const_cast<FStateLabel *>(BinarySearch<FStateLabel, FName> (Labels, NumLabels, &FStateLabel::Label, label));
|
||||
}
|
||||
|
||||
void FStateLabels::Destroy ()
|
||||
{
|
||||
for(int i=0; i<NumLabels;i++)
|
||||
{
|
||||
if (Labels[i].Children != NULL)
|
||||
{
|
||||
Labels[i].Children->Destroy();
|
||||
free (Labels[i].Children); // These are malloc'd, not new'd!
|
||||
Labels[i].Children=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// FindState (one name version)
|
||||
//
|
||||
// Finds a state with the exact specified name.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AActor::FindState (FName label) const
|
||||
{
|
||||
const FActorInfo *info = GetClass()->ActorInfo;
|
||||
FStateLabel *slabel;
|
||||
|
||||
while (info != NULL)
|
||||
{
|
||||
if (info->StateList != NULL)
|
||||
{
|
||||
slabel = info->StateList->FindLabel (label);
|
||||
if (slabel != NULL && slabel->valid)
|
||||
{
|
||||
return slabel->State;
|
||||
}
|
||||
}
|
||||
info = info->Class->ParentClass->ActorInfo;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// HasStates
|
||||
//
|
||||
// Checks whether the actor has substates for the given name.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool AActor::HasStates (FName label) const
|
||||
{
|
||||
const FActorInfo *info = GetClass()->ActorInfo;
|
||||
FStateLabel *slabel;
|
||||
|
||||
while (info != NULL)
|
||||
{
|
||||
if (info->StateList != NULL)
|
||||
{
|
||||
slabel = info->StateList->FindLabel (label);
|
||||
if (slabel != NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
info = info->Class->ParentClass->ActorInfo;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// FindState (multiple names version)
|
||||
//
|
||||
// Finds a state that matches as many of the supplied names as possible.
|
||||
// A state with more names than those provided does not match.
|
||||
// A state with fewer names can match if there are no states with the exact
|
||||
// same number of names.
|
||||
//
|
||||
// The search proceeds like this. For the current class, keeping matching
|
||||
// names until there are no more. If both the argument list and the state
|
||||
// are out of names, it's an exact match, so return it. If the state still
|
||||
// has names, ignore it. If the argument list still has names, remember it.
|
||||
// Repeat with each successive ancestor class. The state with the longest
|
||||
// match not exceeding the supplied number of names is returned.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AActor::FindState (int numnames, int first, ...) const // The 'first' parameter is only here to
|
||||
// disambiguate from the single parameter version
|
||||
{
|
||||
va_list arglist;
|
||||
va_start (arglist, numnames);
|
||||
return FindState (numnames, arglist);
|
||||
}
|
||||
|
||||
FState *FActorInfo::FindState (int numnames, ...) const
|
||||
{
|
||||
va_list arglist;
|
||||
va_start (arglist, numnames);
|
||||
return FindState (numnames, arglist);
|
||||
}
|
||||
|
||||
FState *AActor::FindState (int numnames, va_list arglist) const
|
||||
{
|
||||
return GetClass()->ActorInfo->FindState (numnames, arglist);
|
||||
}
|
||||
|
||||
FState *FActorInfo::FindState (int numnames, va_list arglist) const
|
||||
{
|
||||
const FActorInfo *info = this;
|
||||
FState *best = NULL;
|
||||
int bestcount = 0;
|
||||
|
||||
// Search this actor's class, plus all its ancestors for a match.
|
||||
while (info != NULL && bestcount < numnames)
|
||||
{
|
||||
FStateLabels *labels = info->StateList;
|
||||
|
||||
if (labels != NULL)
|
||||
{
|
||||
va_list names = arglist;
|
||||
int count = 0;
|
||||
FStateLabel *slabel = NULL;
|
||||
FName label;
|
||||
|
||||
// Find the best-matching label for this class.
|
||||
while (labels != NULL && count < numnames)
|
||||
{
|
||||
label = ENamedName(va_arg (names, int));
|
||||
slabel = labels->FindLabel (label);
|
||||
|
||||
if (slabel != NULL)
|
||||
{
|
||||
count++;
|
||||
labels = slabel->Children;
|
||||
|
||||
// Labels that are more specific than what we want do not match.
|
||||
// Less specific labels do match.
|
||||
if (slabel->valid && count > bestcount)
|
||||
{
|
||||
if (count == numnames)
|
||||
{
|
||||
return slabel->State;
|
||||
}
|
||||
bestcount = count;
|
||||
best = slabel->State;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Walk up the class hierarchy and repeat.
|
||||
info = info->Class->ParentClass->ActorInfo;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// FindStateExact
|
||||
//
|
||||
// This is like FindState, except it will only return states whose labels
|
||||
// match the requested one exactly.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *FActorInfo::FindStateExact (int numnames, ...) const
|
||||
{
|
||||
va_list arglist;
|
||||
va_start (arglist, numnames);
|
||||
return FindStateExact (numnames, arglist);
|
||||
}
|
||||
|
||||
FState *FActorInfo::FindStateExact (int numnames, va_list arglist) const
|
||||
{
|
||||
const FActorInfo *info = this;
|
||||
|
||||
// Search this actor's class, plus all its ancestors for a match.
|
||||
while (info != NULL)
|
||||
{
|
||||
FStateLabels *labels = info->StateList;
|
||||
|
||||
if (labels != NULL)
|
||||
{
|
||||
va_list names = arglist;
|
||||
int count = 0;
|
||||
FStateLabel *slabel = NULL;
|
||||
FName label;
|
||||
|
||||
// Look for a matching label for this class.
|
||||
while (labels != NULL && count < numnames)
|
||||
{
|
||||
label = ENamedName(va_arg (names, int));
|
||||
slabel = labels->FindLabel (label);
|
||||
|
||||
if (slabel != NULL)
|
||||
{
|
||||
count++;
|
||||
labels = slabel->Children;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Only exact matches count.
|
||||
if (slabel != NULL && slabel->valid && count == numnames)
|
||||
{
|
||||
return slabel->State;
|
||||
}
|
||||
}
|
||||
// Walk up the class hierarchy and repeat.
|
||||
info = info->Class->ParentClass->ActorInfo;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Changes a single state
|
||||
//
|
||||
// If the given state does not exist it won't be changed
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void FActorInfo::ChangeState (FName label, FState * newstate) const
|
||||
{
|
||||
FStateLabel *slabel;
|
||||
|
||||
if (StateList != NULL)
|
||||
{
|
||||
slabel = StateList->FindLabel (label);
|
||||
if (slabel != NULL)
|
||||
{
|
||||
slabel->State = newstate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FDoomEdMap DoomEdMap;
|
||||
|
||||
FDoomEdMap::FDoomEdEntry *FDoomEdMap::DoomEdHash[DOOMED_HASHSIZE];
|
||||
|
|
36
src/info.h
36
src/info.h
|
@ -82,8 +82,6 @@ const BYTE SF_FULLBRIGHT = 0x40;
|
|||
const BYTE SF_BIGTIC = 0x80;
|
||||
|
||||
// All state parameters are stored in this array now.
|
||||
// The first 2 parameters for each function call represent
|
||||
// the old misc1/misc2 values, even for non-weapons
|
||||
|
||||
extern TArray<int> StateParameters;
|
||||
|
||||
|
@ -155,6 +153,26 @@ struct FState
|
|||
static const PClass *StaticFindStateOwner (const FState *state, const FActorInfo *info);
|
||||
};
|
||||
|
||||
struct FStateLabels;
|
||||
struct FStateLabel
|
||||
{
|
||||
FName Label;
|
||||
bool valid; // needed to recognize genuine NULL states
|
||||
FState *State;
|
||||
FStateLabels *Children;
|
||||
};
|
||||
|
||||
struct FStateLabels
|
||||
{
|
||||
int NumLabels;
|
||||
FStateLabel Labels[1];
|
||||
|
||||
FStateLabel *FindLabel (FName label);
|
||||
|
||||
void Destroy(); // intentionally not a destructor!
|
||||
};
|
||||
|
||||
|
||||
|
||||
FArchive &operator<< (FArchive &arc, FState *&state);
|
||||
|
||||
|
@ -291,9 +309,6 @@ enum
|
|||
ADEF_EDeathState,
|
||||
ADEF_RaiseState,
|
||||
ADEF_WoundState,
|
||||
ADEF_YesState,
|
||||
ADEF_NoState,
|
||||
ADEF_GreetingsState,
|
||||
|
||||
ADEF_StrifeType, // Not really a property. Used to init StrifeTypes[] in p_conversation.h.
|
||||
ADEF_StrifeTeaserType,
|
||||
|
@ -338,8 +353,6 @@ enum
|
|||
ADEF_Weapon_ReadyState,
|
||||
ADEF_Weapon_AtkState,
|
||||
ADEF_Weapon_HoldAtkState,
|
||||
ADEF_Weapon_AltAtkState,
|
||||
ADEF_Weapon_AltHoldAtkState,
|
||||
ADEF_Weapon_FlashState,
|
||||
ADEF_Sigil_NumPieces,
|
||||
|
||||
|
@ -375,6 +388,14 @@ struct FActorInfo
|
|||
void BuildDefaults ();
|
||||
void ApplyDefaults (BYTE *defaults);
|
||||
void RegisterIDs ();
|
||||
|
||||
FState *FindState (int numnames, ...) const;
|
||||
FState *FindState (int numnames, va_list arglist) const;
|
||||
void ChangeState (FName label, FState * newstate) const;
|
||||
|
||||
FState *FindStateExact (int numnames, ...) const;
|
||||
FState *FindStateExact (int numnames, va_list arglist) const;
|
||||
|
||||
FActorInfo *GetReplacement ();
|
||||
FActorInfo *GetReplacee ();
|
||||
|
||||
|
@ -386,6 +407,7 @@ struct FActorInfo
|
|||
BYTE GameFilter;
|
||||
BYTE SpawnID;
|
||||
SWORD DoomEdNum;
|
||||
FStateLabels * StateList;
|
||||
|
||||
#if _MSC_VER
|
||||
// A 0-terminated list of default properties
|
||||
|
|
|
@ -98,6 +98,7 @@ static FState *DefaultStates (PClass *type)
|
|||
static PClass *sgClass;
|
||||
static BYTE *sgDefaults;
|
||||
|
||||
|
||||
static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
|
||||
{
|
||||
int datasound = 0;
|
||||
|
@ -203,7 +204,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
|
|||
case ADEF_Height: actor->height = dataint; break;
|
||||
case ADEF_Mass: actor->Mass = dataint; break;
|
||||
case ADEF_Damage: actor->Damage = dataint; break;
|
||||
case ADEF_DamageType: actor->DamageType = dataint; break;
|
||||
case ADEF_DamageType: actor->DamageType = (ENamedName)dataint; break;
|
||||
case ADEF_Flags: actor->flags = dataint; break;
|
||||
case ADEF_Flags2: actor->flags2 = dataint; break;
|
||||
case ADEF_Flags3: actor->flags3 = dataint; break;
|
||||
|
@ -232,22 +233,19 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
|
|||
case ADEF_RDFactor: sgClass->Meta.SetMetaFixed (AMETA_RDFactor, dataint); break;
|
||||
case ADEF_FXFlags: actor->effects = dataint; break;
|
||||
|
||||
case ADEF_SpawnState: actor->SpawnState = datastate; break;
|
||||
case ADEF_SeeState: actor->SeeState = datastate; break;
|
||||
case ADEF_PainState: actor->PainState = datastate; break;
|
||||
case ADEF_MeleeState: actor->MeleeState = datastate; break;
|
||||
case ADEF_MissileState: actor->MissileState = datastate; break;
|
||||
case ADEF_CrashState: actor->CrashState = datastate; break;
|
||||
case ADEF_DeathState: actor->DeathState = datastate; break;
|
||||
case ADEF_XDeathState: actor->XDeathState = datastate; break;
|
||||
case ADEF_BDeathState: actor->BDeathState = datastate; break;
|
||||
case ADEF_IDeathState: actor->IDeathState = datastate; break;
|
||||
case ADEF_EDeathState: actor->EDeathState = datastate; break;
|
||||
case ADEF_RaiseState: actor->RaiseState = datastate; break;
|
||||
case ADEF_WoundState: actor->WoundState = datastate; break;
|
||||
case ADEF_YesState: actor->YesState = datastate; break;
|
||||
case ADEF_NoState: actor->NoState = datastate; break;
|
||||
case ADEF_GreetingsState: actor->GreetingsState = datastate; break;
|
||||
case ADEF_SpawnState: AddState("Spawn", datastate); break;
|
||||
case ADEF_SeeState: AddState("See", datastate); break;
|
||||
case ADEF_PainState: AddState("Pain", datastate); break;
|
||||
case ADEF_MeleeState: AddState("Melee", datastate); break;
|
||||
case ADEF_MissileState: AddState("Missile", datastate); break;
|
||||
case ADEF_CrashState: AddState("Crash", datastate); break;
|
||||
case ADEF_DeathState: AddState("Death", datastate); break;
|
||||
case ADEF_XDeathState: AddState("XDeath", datastate); break;
|
||||
case ADEF_BDeathState: AddState("Burn", datastate); break;
|
||||
case ADEF_IDeathState: AddState("Ice", datastate); break;
|
||||
case ADEF_EDeathState: AddState("Disintegrate", datastate);break;
|
||||
case ADEF_RaiseState: AddState("Raise", datastate); break;
|
||||
case ADEF_WoundState: AddState("Wound", datastate); break;
|
||||
|
||||
case ADEF_StrifeType: if (!(gameinfo.flags & GI_SHAREWARE)) StrifeTypes[dataint] = sgClass; break;
|
||||
case ADEF_StrifeTeaserType:
|
||||
|
@ -306,14 +304,13 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint)
|
|||
case ADEF_Weapon_YAdjust: weapon->YAdjust = (dataint<<8)>>8; break;
|
||||
case ADEF_Weapon_SelectionOrder:weapon->SelectionOrder = dataint; break;
|
||||
case ADEF_Weapon_MoveCombatDist:weapon->MoveCombatDist = dataint; break;
|
||||
case ADEF_Weapon_UpState: weapon->UpState = datastate; break;
|
||||
case ADEF_Weapon_DownState: weapon->DownState = datastate; break;
|
||||
case ADEF_Weapon_ReadyState: weapon->ReadyState = datastate; break;
|
||||
case ADEF_Weapon_AtkState: weapon->AtkState = datastate; break;
|
||||
case ADEF_Weapon_HoldAtkState: weapon->HoldAtkState = datastate; break;
|
||||
case ADEF_Weapon_AltAtkState: weapon->AltAtkState = datastate; break;
|
||||
case ADEF_Weapon_AltHoldAtkState:weapon->AltHoldAtkState = datastate; break;
|
||||
case ADEF_Weapon_FlashState: weapon->FlashState = datastate; break;
|
||||
|
||||
case ADEF_Weapon_UpState: AddState("Select", datastate); break;
|
||||
case ADEF_Weapon_DownState: AddState("Deselect", datastate); break;
|
||||
case ADEF_Weapon_ReadyState: AddState("Ready", datastate); break;
|
||||
case ADEF_Weapon_AtkState: AddState("Fire", datastate); break;
|
||||
case ADEF_Weapon_HoldAtkState: AddState("Hold", datastate); break;
|
||||
case ADEF_Weapon_FlashState: AddState("Flash", datastate); break;
|
||||
case ADEF_Sigil_NumPieces: sigil->NumPieces = dataint; break;
|
||||
|
||||
// [GRB] Player class properties
|
||||
|
@ -360,6 +357,7 @@ void FActorInfo::ApplyDefaults (BYTE *defaults)
|
|||
sgClass = Class;
|
||||
sgDefaults = defaults;
|
||||
|
||||
ClearStateLabels();
|
||||
#if _MSC_VER
|
||||
const BYTE *parser = DefaultList;
|
||||
|
||||
|
@ -410,6 +408,7 @@ void FActorInfo::ApplyDefaults (BYTE *defaults)
|
|||
#else
|
||||
DefaultsConstructor ();
|
||||
#endif
|
||||
InstallStates(this, ((AActor *)defaults));
|
||||
// Anything that is CountKill is also a monster, even if it doesn't specify it.
|
||||
if (((AActor *)defaults)->flags & MF_COUNTKILL)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ typedef void (*voidfunc_)();
|
|||
FActorInfo actor##ActorInfo = {
|
||||
|
||||
#define BEGIN_DEFAULTS_POST(actor,game,ednum,id) \
|
||||
GAME_##game, id, ednum,
|
||||
GAME_##game, id, ednum, NULL,
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define END_DEFAULTS "\xED\x5E" };
|
||||
|
@ -280,9 +280,6 @@ public:
|
|||
#define PROP_EDeathState(x) ADD_BYTE_PROP(ADEF_EDeathState,x)
|
||||
#define PROP_RaiseState(x) ADD_BYTE_PROP(ADEF_RaiseState,x)
|
||||
#define PROP_WoundState(x) ADD_BYTE_PROP(ADEF_WoundState,x)
|
||||
#define PROP_YesState(x) ADD_BYTE_PROP(ADEF_YesState,x)
|
||||
#define PROP_NoState(x) ADD_BYTE_PROP(ADEF_NoState,x)
|
||||
#define PROP_GreetingsState(x) ADD_BYTE_PROP(ADEF_GreetingsState,x)
|
||||
|
||||
#define PROP_StrifeType(x) ADD_WORD_PROP(ADEF_StrifeType,x)
|
||||
#define PROP_StrifeTeaserType(x) ADD_WORD_PROP(ADEF_StrifeTeaserType,x)
|
||||
|
@ -329,8 +326,6 @@ public:
|
|||
#define PROP_Weapon_ReadyState(x) ADD_BYTE_PROP(ADEF_Weapon_ReadyState,x)
|
||||
#define PROP_Weapon_AtkState(x) ADD_BYTE_PROP(ADEF_Weapon_AtkState,x)
|
||||
#define PROP_Weapon_HoldAtkState(x) ADD_BYTE_PROP(ADEF_Weapon_HoldAtkState,x)
|
||||
#define PROP_Weapon_AltAtkState(x) ADD_BYTE_PROP(ADEF_Weapon_AltAtkState,x)
|
||||
#define PROP_Weapon_AltHoldAtkState(x) ADD_BYTE_PROP(ADEF_Weapon_AltHoldAtkState,x)
|
||||
#define PROP_Weapon_FlashState(x) ADD_BYTE_PROP(ADEF_Weapon_FlashState,x)
|
||||
#define PROP_Sigil_NumPieces(x) ADD_BYTE_PROP(ADEF_Sigil_NumPieces,x)
|
||||
|
||||
|
|
|
@ -274,11 +274,11 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
player->mo->height = player->mo->GetDefault()->height;
|
||||
player->mo->SetState (player->mo->SpawnState);
|
||||
player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players));
|
||||
player->mo->DamageType = MOD_UNKNOWN;
|
||||
player->mo->DamageType = NAME_None;
|
||||
// player->mo->GiveDefaultInventory();
|
||||
if (player->ReadyWeapon != NULL)
|
||||
{
|
||||
P_SetPsprite(player, ps_weapon, player->ReadyWeapon->UpState);
|
||||
P_SetPsprite(player, ps_weapon, player->ReadyWeapon->GetUpState());
|
||||
}
|
||||
|
||||
if (player->morphTics > 0)
|
||||
|
@ -342,7 +342,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
// a very very cheap kill.
|
||||
P_LineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE,
|
||||
P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), 1000000,
|
||||
MOD_UNKNOWN, RUNTIME_CLASS(ABulletPuff));
|
||||
NAME_None, RUNTIME_CLASS(ABulletPuff));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -701,7 +701,7 @@ void cht_Suicide (player_t *plyr)
|
|||
{
|
||||
plyr->mo->flags |= MF_SHOOTABLE;
|
||||
plyr->mo->flags2 &= ~MF2_INVULNERABLE;
|
||||
P_DamageMobj (plyr->mo, plyr->mo, plyr->mo, 1000000, MOD_SUICIDE);
|
||||
P_DamageMobj (plyr->mo, plyr->mo, plyr->mo, 1000000, NAME_Suicide);
|
||||
plyr->mo->flags &= ~MF_SHOOTABLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,15 +103,55 @@ xx(Mauler)
|
|||
xx(Chicken)
|
||||
xx(Pig)
|
||||
|
||||
// Standard animator names.
|
||||
xx(Spawn)
|
||||
xx(See)
|
||||
xx(Pain)
|
||||
xx(Melee)
|
||||
xx(Missile)
|
||||
xx(Crash)
|
||||
xx(Death)
|
||||
xx(Raise)
|
||||
xx(Wound)
|
||||
xx(Heal)
|
||||
xx(Crush)
|
||||
xx(Yes)
|
||||
xx(No)
|
||||
xx(Greetings)
|
||||
|
||||
// Compatible death names for the decorate parser.
|
||||
xx(XDeath)
|
||||
xx(Burn)
|
||||
//xx(Ice) // already defined above
|
||||
xx(Disintegrate)
|
||||
|
||||
// Weapon animator names.
|
||||
xx(Select)
|
||||
xx(Deselect)
|
||||
xx(Ready)
|
||||
xx(Fire)
|
||||
xx(Hold)
|
||||
xx(AltFire)
|
||||
xx(AltHold)
|
||||
xx(Flash)
|
||||
xx(AltFlash)
|
||||
|
||||
// State names used by ASwitchableDecoration
|
||||
xx(Active)
|
||||
xx(Inactive)
|
||||
|
||||
// State names used by ACustomInventory
|
||||
xx(Pickup)
|
||||
xx(Use)
|
||||
xx(Drop)
|
||||
|
||||
// Damage types
|
||||
xx(Fire)
|
||||
//xx(Ice) already defined above
|
||||
xx(Disintegrate)
|
||||
#if 0
|
||||
xx(Water)
|
||||
//xx(Fire) already defined above
|
||||
//xx(Ice)
|
||||
//xx(Disintegrate)
|
||||
//xx(Water)
|
||||
xx(Slime)
|
||||
xx(Crush)
|
||||
//xx(Crush)
|
||||
xx(Telefrag)
|
||||
xx(Falling)
|
||||
xx(Suicide)
|
||||
|
@ -124,39 +164,8 @@ xx(DrainLife) // A weapon like the Sigil that drains your life away.
|
|||
xx(Massacre) // For death by a cheater!
|
||||
//(Melee) already defined above, so don't define it again
|
||||
|
||||
|
||||
// Standard animator names.
|
||||
xx(Spawn)
|
||||
xx(See)
|
||||
xx(Pain)
|
||||
xx(Melee)
|
||||
xx(Missile)
|
||||
xx(Crash)
|
||||
xx(Death)
|
||||
xx(Raise)
|
||||
xx(Wound)
|
||||
|
||||
// Weapon animator names.
|
||||
xx(Up)
|
||||
xx(Down)
|
||||
xx(Ready)
|
||||
xx(Flash)
|
||||
xx(Attack)
|
||||
xx(HoldAttack)
|
||||
xx(AltAttack)
|
||||
xx(AltHoldAttack)
|
||||
|
||||
// Special death name for getting killed excessively. Could be used as
|
||||
// a damage type if you wanted to force an extreme death.
|
||||
xx(Extreme)
|
||||
|
||||
// Compatible death names for the decorate parser.
|
||||
xx(XDeath)
|
||||
xx(BDeath)
|
||||
xx(IDeath)
|
||||
xx(EDeath)
|
||||
|
||||
// State names used by ASwitchableDecoration
|
||||
xx(Active)
|
||||
xx(Inactive)
|
||||
#endif
|
||||
|
|
|
@ -4995,17 +4995,6 @@ int DLevelScript::RunScript ()
|
|||
int flags = STACK(1);
|
||||
sp -= 5;
|
||||
|
||||
// Oh, give me custom damage types! :-)
|
||||
int modtype;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case NAME_Fire: modtype = MOD_FIRE; break;
|
||||
case NAME_Ice: modtype = MOD_ICE; break;
|
||||
case NAME_Disintegrate: modtype = MOD_DISINTEGRATE; break;
|
||||
default: modtype = MOD_UNKNOWN; break;
|
||||
}
|
||||
|
||||
int secnum = -1;
|
||||
|
||||
while ((secnum = P_FindSectorFromTag (tag, secnum)) >= 0)
|
||||
|
@ -5050,7 +5039,7 @@ int DLevelScript::RunScript ()
|
|||
}
|
||||
}
|
||||
|
||||
P_DamageMobj (actor, NULL, NULL, amount, modtype);
|
||||
P_DamageMobj (actor, NULL, NULL, amount, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2317,7 +2317,7 @@ void A_Pain (AActor *actor)
|
|||
// killough 11/98: kill an object
|
||||
void A_Die (AActor *actor)
|
||||
{
|
||||
P_DamageMobj (actor, NULL, NULL, actor->health, MOD_UNKNOWN);
|
||||
P_DamageMobj (actor, NULL, NULL, actor->health, NAME_None);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -69,6 +69,10 @@ CVAR (Bool, cl_showsprees, true, CVAR_ARCHIVE)
|
|||
CVAR (Bool, cl_showmultikills, true, CVAR_ARCHIVE)
|
||||
EXTERN_CVAR (Bool, show_obituaries)
|
||||
|
||||
|
||||
FName MeansOfDeath;
|
||||
bool FriendlyFire;
|
||||
|
||||
//
|
||||
// GET STUFF
|
||||
//
|
||||
|
@ -172,11 +176,11 @@ void SexMessage (const char *from, char *to, int gender, const char *victim, con
|
|||
//
|
||||
void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
||||
{
|
||||
int mod;
|
||||
FName mod;
|
||||
const char *message;
|
||||
const char *messagename;
|
||||
char gendermessage[1024];
|
||||
INTBOOL friendly;
|
||||
bool friendly;
|
||||
int gender;
|
||||
|
||||
// No obituaries for non-players, voodoo dolls or when not wanted
|
||||
|
@ -187,19 +191,19 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
|
||||
// Treat voodoo dolls as unknown deaths
|
||||
if (inflictor && inflictor->player == self->player)
|
||||
MeansOfDeath = MOD_UNKNOWN;
|
||||
MeansOfDeath = NAME_None;
|
||||
|
||||
if (multiplayer && !deathmatch)
|
||||
MeansOfDeath |= MOD_FRIENDLY_FIRE;
|
||||
FriendlyFire = true;
|
||||
|
||||
friendly = MeansOfDeath & MOD_FRIENDLY_FIRE;
|
||||
mod = MeansOfDeath & ~MOD_FRIENDLY_FIRE;
|
||||
friendly = FriendlyFire;
|
||||
mod = MeansOfDeath;
|
||||
message = NULL;
|
||||
messagename = NULL;
|
||||
|
||||
if (attacker == NULL || attacker->player != NULL)
|
||||
{
|
||||
if (mod == MOD_TELEFRAG)
|
||||
if (mod == NAME_Telefrag)
|
||||
{
|
||||
if (AnnounceTelefrag (attacker, self))
|
||||
return;
|
||||
|
@ -213,15 +217,13 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
|
||||
switch (mod)
|
||||
{
|
||||
case MOD_SUICIDE: messagename = "OB_SUICIDE"; break;
|
||||
case MOD_FALLING: messagename = "OB_FALLING"; break;
|
||||
case MOD_CRUSH: messagename = "OB_CRUSH"; break;
|
||||
case MOD_EXIT: messagename = "OB_EXIT"; break;
|
||||
case MOD_WATER: messagename = "OB_WATER"; break;
|
||||
case MOD_SLIME: messagename = "OB_SLIME"; break;
|
||||
case MOD_FIRE: messagename = "OB_LAVA"; break;
|
||||
case MOD_BARREL: messagename = "OB_BARREL"; break;
|
||||
case MOD_SPLASH: messagename = "OB_SPLASH"; break;
|
||||
case NAME_Suicide: messagename = "OB_SUICIDE"; break;
|
||||
case NAME_Falling: messagename = "OB_FALLING"; break;
|
||||
case NAME_Crush: messagename = "OB_CRUSH"; break;
|
||||
case NAME_Exit: messagename = "OB_EXIT"; break;
|
||||
case NAME_Water: messagename = "OB_WATER"; break;
|
||||
case NAME_Slime: messagename = "OB_SLIME"; break;
|
||||
case NAME_Fire: if (attacker == NULL) messagename = "OB_LAVA"; break;
|
||||
}
|
||||
|
||||
if (messagename != NULL)
|
||||
|
@ -231,21 +233,15 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
{
|
||||
if (attacker == self)
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
case MOD_R_SPLASH: messagename = "OB_R_SPLASH"; break;
|
||||
case MOD_ROCKET: messagename = "OB_ROCKET"; break;
|
||||
default: messagename = "OB_KILLEDSELF"; break;
|
||||
}
|
||||
message = GStrings(messagename);
|
||||
message = GStrings("OB_KILLEDSELF");
|
||||
}
|
||||
else if (attacker->player == NULL)
|
||||
{
|
||||
if (mod == MOD_TELEFRAG)
|
||||
if (mod == NAME_Telefrag)
|
||||
{
|
||||
message = GStrings("OB_MONTELEFRAG");
|
||||
}
|
||||
else if (mod == MOD_HIT)
|
||||
else if (mod == NAME_Melee)
|
||||
{
|
||||
message = attacker->GetClass()->Meta.GetMetaString (AMETA_HitObituary);
|
||||
if (message == NULL)
|
||||
|
@ -273,7 +269,7 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mod == MOD_TELEFRAG) message = GStrings("OB_MPTELEFRAG");
|
||||
if (mod == NAME_Telefrag) message = GStrings("OB_MPTELEFRAG");
|
||||
if (message == NULL)
|
||||
{
|
||||
if (inflictor != NULL)
|
||||
|
@ -288,9 +284,8 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
|
|||
{
|
||||
switch (mod)
|
||||
{
|
||||
case MOD_R_SPLASH: messagename = "OB_MPR_SPLASH"; break;
|
||||
case MOD_BFG_SPLASH: messagename = "OB_MPBFG_SPLASH"; break;
|
||||
case MOD_RAILGUN: messagename = "OB_RAILGUN"; break;
|
||||
case NAME_BFGSplash: messagename = "OB_MPBFG_SPLASH"; break;
|
||||
case NAME_Railgun: messagename = "OB_RAILGUN"; break;
|
||||
}
|
||||
if (messagename != NULL)
|
||||
message = GStrings(messagename);
|
||||
|
@ -360,7 +355,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SKULLFLY);
|
||||
if (!(flags4 & MF4_DONTFALL)) flags&=~MF_NOGRAVITY;
|
||||
flags |= MF_DROPOFF;
|
||||
if ((flags3 & MF3_ISMONSTER) || RaiseState != NULL)
|
||||
if ((flags3 & MF3_ISMONSTER) || FindState(NAME_Raise) != NULL)
|
||||
{ // [RH] Only monsters get to be corpses.
|
||||
// Objects with a raise state should get the flag as well so they can
|
||||
// be revived by an Arch-Vile. Batman Doom needs this.
|
||||
|
@ -368,7 +363,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
}
|
||||
// [RH] Allow the death height to be overridden using metadata.
|
||||
fixed_t metaheight = 0;
|
||||
if (DamageType == MOD_FIRE)
|
||||
if (DamageType == NAME_Fire)
|
||||
{
|
||||
metaheight = GetClass()->Meta.GetMetaFixed (AMETA_BurnHeight);
|
||||
}
|
||||
|
@ -612,29 +607,26 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
return;
|
||||
}
|
||||
|
||||
if (DamageType == MOD_DISINTEGRATE && EDeathState)
|
||||
{ // Electrocution death
|
||||
SetState (EDeathState);
|
||||
}
|
||||
else if (DamageType == MOD_FIRE && BDeathState)
|
||||
{ // Burn death
|
||||
SetState (BDeathState);
|
||||
}
|
||||
else if (DamageType == MOD_ICE &&
|
||||
(IDeathState || (
|
||||
(!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH)) &&
|
||||
(player || (flags3 & MF3_ISMONSTER)))))
|
||||
{ // Ice death
|
||||
if (IDeathState)
|
||||
|
||||
|
||||
FState *diestate=NULL;
|
||||
|
||||
if (DamageType != NAME_None)
|
||||
{
|
||||
diestate = GetClass()->ActorInfo->FindStateExact (2, NAME_Death, int(DamageType));
|
||||
if (diestate == NULL)
|
||||
{
|
||||
SetState (IDeathState);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState (&AActor::States[S_GENERICFREEZEDEATH]);
|
||||
if (DamageType == NAME_Ice)
|
||||
{ // If an actor doesn't have an ice death, we can still give them a generic one.
|
||||
|
||||
if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER)))
|
||||
{
|
||||
diestate = &AActor::States[S_GENERICFREEZEDEATH];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (diestate == NULL)
|
||||
{
|
||||
int flags4 = !inflictor ? 0 : inflictor->player && inflictor->player->ReadyWeapon ?
|
||||
inflictor->player->ReadyWeapon->flags4 : inflictor->flags4;
|
||||
|
@ -642,40 +634,30 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
int gibhealth = -abs(GetClass()->Meta.GetMetaInt (AMETA_GibHealth,
|
||||
gameinfo.gametype == GAME_Doom ? -GetDefault()->health : -GetDefault()->health/2));
|
||||
|
||||
DamageType = MOD_UNKNOWN; // [RH] "Frozen" barrels shouldn't do freezing damage
|
||||
if (XDeathState && (health<gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH))
|
||||
DamageType =NAME_None; // Don't pass on a damage type this actor cannot handle
|
||||
// (most importantly prevent barrels from passing on ice damage)
|
||||
if ((health<gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH))
|
||||
{ // Extreme death
|
||||
SetState (XDeathState);
|
||||
diestate = FindState (2, NAME_Death, NAME_Extreme);
|
||||
}
|
||||
else
|
||||
{ // Normal death
|
||||
DamageType = MOD_UNKNOWN; // [RH] "Frozen" barrels shouldn't do freezing damage
|
||||
if (DeathState != NULL) // [RH] DeathState might be NULL, so try others as needed
|
||||
{
|
||||
SetState (DeathState);
|
||||
}
|
||||
else if (EDeathState != NULL)
|
||||
{
|
||||
SetState (EDeathState);
|
||||
}
|
||||
else if (BDeathState != NULL)
|
||||
{
|
||||
SetState (BDeathState);
|
||||
}
|
||||
else if (IDeathState != NULL)
|
||||
{
|
||||
SetState (IDeathState);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
diestate = FindState (NAME_Death);
|
||||
}
|
||||
}
|
||||
|
||||
tics -= pr_killmobj() & 3;
|
||||
if (tics < 1)
|
||||
tics = 1;
|
||||
if (diestate != NULL)
|
||||
{
|
||||
SetState (diestate);
|
||||
|
||||
tics -= pr_killmobj() & 3;
|
||||
if (tics < 1)
|
||||
tics = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -794,9 +776,8 @@ void P_AutoUseStrifeHealth (player_t *player)
|
|||
==================
|
||||
*/
|
||||
|
||||
int MeansOfDeath;
|
||||
|
||||
void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, int mod, int flags)
|
||||
void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags)
|
||||
{
|
||||
unsigned ang;
|
||||
player_t *player;
|
||||
|
@ -824,7 +805,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
if (target->health <= 0)
|
||||
{
|
||||
if (inflictor && mod == MOD_ICE)
|
||||
if (inflictor && mod == NAME_Ice)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -858,6 +839,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
|
||||
MeansOfDeath = mod;
|
||||
FriendlyFire = false;
|
||||
// [RH] Andy Baker's Stealth monsters
|
||||
if (target->flags & MF_STEALTH)
|
||||
{
|
||||
|
@ -898,7 +880,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (mod == MOD_FIRE && target->flags4 & MF4_FIRERESIST)
|
||||
if (mod == NAME_Fire && target->flags4 & MF4_FIRERESIST)
|
||||
{
|
||||
damage /= 2;
|
||||
}
|
||||
|
@ -1000,7 +982,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
// [RH] Avoid friendly fire if enabled
|
||||
if (source != NULL && player != source->player && target->IsTeammate (source))
|
||||
{
|
||||
MeansOfDeath |= MOD_FRIENDLY_FIRE;
|
||||
FriendlyFire = true;
|
||||
if (damage < 1000000)
|
||||
{ // Still allow telefragging :-(
|
||||
damage = (int)((float)damage * teamdamage);
|
||||
|
@ -1066,7 +1048,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
target->target = source;
|
||||
}
|
||||
// check for special fire damage or ice damage deaths
|
||||
if (mod == MOD_FIRE)
|
||||
if (mod == NAME_Fire)
|
||||
{
|
||||
if (player && !player->morphTics)
|
||||
{ // Check for flame death
|
||||
|
@ -1074,12 +1056,12 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
((target->health > -50) && (damage > 25)) ||
|
||||
!inflictor->IsKindOf (RUNTIME_CLASS(APhoenixFX1)))
|
||||
{
|
||||
target->DamageType = MOD_FIRE;
|
||||
target->DamageType = NAME_Fire;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->DamageType = MOD_FIRE;
|
||||
target->DamageType = NAME_Fire;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1103,28 +1085,27 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
target->Die (source, inflictor);
|
||||
return;
|
||||
}
|
||||
if (target->WoundState != NULL)
|
||||
|
||||
FState * woundstate = target->FindState(2,NAME_Wound, (int)mod);
|
||||
if (woundstate != NULL)
|
||||
{
|
||||
int woundhealth = RUNTIME_TYPE(target)->Meta.GetMetaInt (AMETA_WoundHealth, 6);
|
||||
|
||||
if (target->health <= woundhealth)
|
||||
{
|
||||
target->SetState (target->WoundState);
|
||||
target->SetState (woundstate);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((pr_damagemobj() < target->PainChance) && target->PainState != NULL
|
||||
&& !(target->flags & MF_SKULLFLY))
|
||||
if ((pr_damagemobj() < target->PainChance) && !(target->flags & MF_SKULLFLY))
|
||||
{
|
||||
if (inflictor && inflictor->IsKindOf (RUNTIME_CLASS(ALightning)))
|
||||
{
|
||||
if (pr_lightning() < 96)
|
||||
{
|
||||
target->flags |= MF_JUSTHIT; // fight back!
|
||||
if (target->PainState != NULL)
|
||||
{
|
||||
target->SetState (target->PainState);
|
||||
}
|
||||
FState * painstate = target->FindState(2,NAME_Pain, (int)mod);
|
||||
if (painstate != NULL) target->SetState (painstate);
|
||||
}
|
||||
else
|
||||
{ // "electrocute" the target
|
||||
|
@ -1138,7 +1119,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
else
|
||||
{
|
||||
target->flags |= MF_JUSTHIT; // fight back!
|
||||
target->SetState (target->PainState);
|
||||
FState * painstate = target->FindState(2,NAME_Pain, (int)mod);
|
||||
if (painstate != NULL) target->SetState (painstate);
|
||||
if (inflictor && inflictor->IsKindOf (RUNTIME_CLASS(APoisonCloud)))
|
||||
{
|
||||
if ((target->flags3 & MF3_ISMONSTER) && pr_poison() < 128)
|
||||
|
@ -1317,22 +1299,20 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
|||
target->special1 = damage;
|
||||
if (player && inflictor && !player->morphTics)
|
||||
{ // Check for flame death
|
||||
if ((inflictor->DamageType == MOD_FIRE)
|
||||
if ((inflictor->DamageType == NAME_Fire)
|
||||
&& (target->health > -50) && (damage > 25))
|
||||
{
|
||||
target->DamageType = MOD_FIRE;
|
||||
}
|
||||
if (inflictor->DamageType == MOD_ICE)
|
||||
{
|
||||
target->DamageType = MOD_ICE;
|
||||
target->DamageType = NAME_Fire;
|
||||
}
|
||||
else target->DamageType = inflictor->DamageType;
|
||||
}
|
||||
target->Die (source, source);
|
||||
return;
|
||||
}
|
||||
if (!(level.time&63) && playPainSound && target->PainState != NULL)
|
||||
if (!(level.time&63) && playPainSound)
|
||||
{
|
||||
target->SetState (target->PainState);
|
||||
FState * painstate = target->FindState(2,NAME_Pain, (int)target->DamageType);
|
||||
if (painstate != NULL) target->SetState (painstate);
|
||||
}
|
||||
/*
|
||||
if((P_Random() < target->info->painchance)
|
||||
|
|
|
@ -63,6 +63,29 @@
|
|||
|
||||
static FRandom pr_glass ("GlassBreak");
|
||||
|
||||
FName MODtoDamageType (int mod)
|
||||
{
|
||||
switch (mod)
|
||||
{
|
||||
default: return NAME_None; break;
|
||||
case 9: return NAME_BFGSplash; break;
|
||||
case 12: return NAME_Water; break;
|
||||
case 13: return NAME_Slime; break;
|
||||
case 14: return NAME_Fire; break;
|
||||
case 15: return NAME_Crush; break;
|
||||
case 16: return NAME_Telefrag; break;
|
||||
case 17: return NAME_Falling; break;
|
||||
case 18: return NAME_Suicide; break;
|
||||
case 20: return NAME_Exit; break;
|
||||
case 22: return NAME_Melee; break;
|
||||
case 23: return NAME_Railgun; break;
|
||||
case 24: return NAME_Ice; break;
|
||||
case 25: return NAME_Disintegrate; break;
|
||||
case 26: return NAME_Poison; break;
|
||||
case 27: return NAME_Electric; break;
|
||||
case 1000: return NAME_Massacre; break;
|
||||
}
|
||||
}
|
||||
|
||||
FUNC(LS_NOP)
|
||||
{
|
||||
|
@ -734,7 +757,7 @@ FUNC(LS_Teleport_NewMap)
|
|||
|
||||
FUNC(LS_Teleport)
|
||||
// Teleport (tid, sectortag, bNoSourceFog)
|
||||
{
|
||||
{
|
||||
return EV_Teleport (arg0, arg1, ln, backSide, it, true, !arg2, false);
|
||||
}
|
||||
|
||||
|
@ -751,7 +774,7 @@ FUNC(LS_Teleport_ZombieChanger)
|
|||
if (it != NULL)
|
||||
{
|
||||
EV_Teleport (arg0, arg1, ln, backSide, it, false, false, false);
|
||||
it->SetState (it->PainState);
|
||||
it->SetState (it->FindState(NAME_Pain));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -935,11 +958,11 @@ FUNC(LS_DamageThing)
|
|||
}
|
||||
else if (arg0 > 0)
|
||||
{
|
||||
P_DamageMobj (it, NULL, NULL, arg0, arg1);
|
||||
P_DamageMobj (it, NULL, NULL, arg0, MODtoDamageType (arg1));
|
||||
}
|
||||
else
|
||||
{ // If zero damage, guarantee a kill
|
||||
P_DamageMobj (it, NULL, NULL, 1000000, arg1);
|
||||
P_DamageMobj (it, NULL, NULL, 1000000, MODtoDamageType (arg1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1094,7 +1117,7 @@ FUNC(LS_Thing_Destroy)
|
|||
{
|
||||
AActor *temp = iterator.Next ();
|
||||
if (actor->flags & MF_SHOOTABLE)
|
||||
P_DamageMobj (actor, NULL, it, arg1 ? 1000000 : actor->health, MOD_UNKNOWN);
|
||||
P_DamageMobj (actor, NULL, it, arg1 ? 1000000 : actor->health, NAME_None);
|
||||
actor = temp;
|
||||
}
|
||||
}
|
||||
|
@ -1115,7 +1138,7 @@ FUNC(LS_Thing_Damage)
|
|||
{
|
||||
if (arg1 > 0)
|
||||
{
|
||||
P_DamageMobj (actor, NULL, it, arg1, arg2);
|
||||
P_DamageMobj (actor, NULL, it, arg1, MODtoDamageType (arg2));
|
||||
}
|
||||
else if (actor->health < actor->GetDefault()->health)
|
||||
{
|
||||
|
@ -1354,7 +1377,8 @@ static bool DoThingRaise(AActor *thing)
|
|||
if (thing->tics != -1)
|
||||
return true; // not lying still yet
|
||||
|
||||
if (thing->RaiseState == NULL)
|
||||
FState * RaiseState = thing->FindState(NAME_Raise);
|
||||
if (RaiseState == NULL)
|
||||
return true; // monster doesn't have a raise state
|
||||
|
||||
AActor *info = thing->GetDefault ();
|
||||
|
@ -1379,7 +1403,7 @@ static bool DoThingRaise(AActor *thing)
|
|||
|
||||
S_Sound (thing, CHAN_BODY, "vile/raise", 1, ATTN_IDLE);
|
||||
|
||||
thing->SetState (info->RaiseState);
|
||||
thing->SetState (RaiseState);
|
||||
thing->flags = info->flags;
|
||||
thing->flags2 = info->flags2;
|
||||
thing->flags3 = info->flags3;
|
||||
|
@ -1974,6 +1998,11 @@ FUNC(LS_PointPush_SetForce)
|
|||
FUNC(LS_Sector_SetDamage)
|
||||
// Sector_SetDamage (tag, amount, mod)
|
||||
{
|
||||
// The sector still stores the mod in its old format because
|
||||
// adding an FName to the sector_t structure might cause
|
||||
// problems by adding an unwanted constructor.
|
||||
// Since it doesn't really matter whether the type is translated
|
||||
// here or in P_PlayerInSpecialSector I think it's the best solution.
|
||||
int secnum = -1;
|
||||
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0) {
|
||||
sectors[secnum].damage = arg1;
|
||||
|
@ -2561,7 +2590,7 @@ FUNC(LS_ForceField)
|
|||
{
|
||||
if (it != NULL)
|
||||
{
|
||||
P_DamageMobj (it, NULL, NULL, 16, MOD_UNKNOWN);
|
||||
P_DamageMobj (it, NULL, NULL, 16, NAME_None);
|
||||
P_ThrustMobj (it, it->angle + ANGLE_180, 0x7D000);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -427,6 +427,8 @@ typedef enum {
|
|||
struct line_s;
|
||||
class AActor;
|
||||
|
||||
FName MODtoDamageType (int mod);
|
||||
|
||||
typedef int (*lnSpecFunc)(struct line_s *line,
|
||||
class AActor *activator,
|
||||
bool backSide,
|
||||
|
|
|
@ -299,7 +299,7 @@ extern AActor* linetarget; // who got hit (or NULL)
|
|||
extern AActor *PuffSpawned; // points to last puff spawned
|
||||
|
||||
fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, fixed_t vrange=0);
|
||||
void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, int damageType, const PClass *pufftype);
|
||||
void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, const PClass *pufftype);
|
||||
void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target, angle_t angle, int pitch);
|
||||
void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch);
|
||||
void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version
|
||||
|
@ -315,7 +315,7 @@ extern fixed_t CameraX, CameraY, CameraZ;
|
|||
extern sector_t *CameraSector;
|
||||
|
||||
// [RH] Means of death
|
||||
void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int damageType, bool hurtSelf, bool dodamage=true);
|
||||
void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, FName damageType, bool hurtSelf, bool dodamage=true);
|
||||
|
||||
void P_DelSector_List();
|
||||
void P_DelSeclist(msecnode_t *); // phares 3/16/98
|
||||
|
@ -346,7 +346,7 @@ extern FBlockNode** blocklinks; // for thing chains
|
|||
//
|
||||
void P_TouchSpecialThing (AActor *special, AActor *toucher);
|
||||
|
||||
void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, int mod, int flags=0);
|
||||
void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags=0);
|
||||
|
||||
bool P_GiveBody (AActor *actor, int num);
|
||||
bool P_MorphPlayer (player_t *player, const PClass *morphClass);
|
||||
|
@ -355,8 +355,6 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPain
|
|||
|
||||
#define DMG_NO_ARMOR 1
|
||||
|
||||
extern int MeansOfDeath;
|
||||
|
||||
|
||||
// ===== PO_MAN =====
|
||||
|
||||
|
|
|
@ -295,7 +295,7 @@ bool PIT_StompThing (AActor *thing)
|
|||
// [RH] Some Heretic/Hexen monsters can telestomp
|
||||
if (StompAlwaysFrags || (tmthing->flags2 & MF2_TELESTOMP))
|
||||
{
|
||||
P_DamageMobj (thing, tmthing, tmthing, 1000000, MOD_TELEFRAG);
|
||||
P_DamageMobj (thing, tmthing, tmthing, 1000000, NAME_Telefrag);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -453,7 +453,7 @@ bool PIT_StompThing2 (AActor *thing)
|
|||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
P_DamageMobj (thing, tmthing, tmthing, 1000000, MOD_TELEFRAG);
|
||||
P_DamageMobj (thing, tmthing, tmthing, 1000000, NAME_Telefrag);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -662,7 +662,7 @@ bool PIT_CheckLine (line_t *ld)
|
|||
{ // One sided line
|
||||
if (tmthing->flags2 & MF2_BLASTED)
|
||||
{
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, MOD_HIT);
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, NAME_Melee);
|
||||
}
|
||||
BlockingLine = ld;
|
||||
CheckForPushSpecial (ld, 0, tmthing);
|
||||
|
@ -681,7 +681,7 @@ bool PIT_CheckLine (line_t *ld)
|
|||
{
|
||||
if (tmthing->flags2 & MF2_BLASTED)
|
||||
{
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, MOD_HIT);
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, NAME_Melee);
|
||||
}
|
||||
BlockingLine = ld;
|
||||
CheckForPushSpecial (ld, 0, tmthing);
|
||||
|
@ -1867,7 +1867,7 @@ pushline:
|
|||
|
||||
if (tmthing->flags2 & MF2_BLASTED)
|
||||
{
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, MOD_HIT);
|
||||
P_DamageMobj (tmthing, NULL, NULL, tmthing->Mass >> 5, NAME_Melee);
|
||||
}
|
||||
numSpecHitTemp = (int)spechit.Size ();
|
||||
while (numSpecHitTemp > 0)
|
||||
|
@ -2683,7 +2683,7 @@ static bool CheckForSpectral (FTraceResults &res)
|
|||
}
|
||||
|
||||
void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
||||
int pitch, int damage, int damageType, const PClass *pufftype)
|
||||
int pitch, int damage, FName damageType, const PClass *pufftype)
|
||||
{
|
||||
fixed_t vx, vy, vz, shootz;
|
||||
FTraceResults trace;
|
||||
|
@ -3089,7 +3089,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
|
|||
{
|
||||
P_SpawnBlood (x, y, z, source->angle - ANG180, damage, RailHits[i].HitActor);
|
||||
}
|
||||
P_DamageMobj (RailHits[i].HitActor, source, source, damage, MOD_RAILGUN);
|
||||
P_DamageMobj (RailHits[i].HitActor, source, source, damage, NAME_Railgun);
|
||||
P_TraceBleed (damage, x, y, z, RailHits[i].HitActor, angle, pitch);
|
||||
}
|
||||
|
||||
|
@ -3421,7 +3421,7 @@ float bombdamagefloat;
|
|||
int bombdistance;
|
||||
float bombdistancefloat;
|
||||
bool DamageSource;
|
||||
int bombmod;
|
||||
FName bombmod;
|
||||
vec3_t bombvec;
|
||||
bool bombdodamage;
|
||||
|
||||
|
@ -3598,7 +3598,7 @@ bool PIT_RadiusAttack (AActor *thing)
|
|||
// P_RadiusAttack
|
||||
// Source is the creature that caused the explosion at spot.
|
||||
//
|
||||
void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int damageType,
|
||||
void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, FName damageType,
|
||||
bool hurtSource, bool dodamage)
|
||||
{
|
||||
static TArray<AActor *> radbt;
|
||||
|
@ -3853,12 +3853,13 @@ void P_DoCrunch (AActor *thing)
|
|||
!(thing->flags3 & MF3_DONTGIB) &&
|
||||
(thing->health <= 0))
|
||||
{
|
||||
if (thing->CrushState && !(thing->flags & MF_ICECORPSE))
|
||||
FState * state = thing->FindState(NAME_Crush);
|
||||
if (state != NULL && !(thing->flags & MF_ICECORPSE))
|
||||
{
|
||||
// Clear MF_CORPSE so that this isn't done more than once
|
||||
thing->flags &= ~(MF_CORPSE|MF_SOLID);
|
||||
thing->height = thing->radius = 0;
|
||||
thing->SetState (thing->CrushState);
|
||||
thing->SetState (state);
|
||||
return;
|
||||
}
|
||||
if (!(thing->flags & MF_NOBLOOD))
|
||||
|
@ -3912,7 +3913,7 @@ void P_DoCrunch (AActor *thing)
|
|||
|
||||
if ((crushchange > 0) && !(level.maptime & 3))
|
||||
{
|
||||
P_DamageMobj (thing, NULL, NULL, crushchange, MOD_CRUSH);
|
||||
P_DamageMobj (thing, NULL, NULL, crushchange, NAME_Crush);
|
||||
|
||||
// spray blood in a random direction
|
||||
if ((!(thing->flags&MF_NOBLOOD)) &&
|
||||
|
|
117
src/p_mobj.cpp
117
src/p_mobj.cpp
|
@ -303,22 +303,8 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< PainChance
|
||||
<< SpawnState
|
||||
<< SeeState
|
||||
<< PainState
|
||||
<< MeleeState
|
||||
<< MissileState
|
||||
<< CrashState
|
||||
<< DeathState
|
||||
<< XDeathState
|
||||
<< BDeathState
|
||||
<< IDeathState
|
||||
<< EDeathState
|
||||
<< RaiseState
|
||||
<< WoundState
|
||||
<< HealState
|
||||
<< YesState
|
||||
<< NoState
|
||||
<< GreetingsState
|
||||
<< CrushState
|
||||
<< MaxDropOffHeight
|
||||
<< MaxStepHeight
|
||||
<< bouncefactor
|
||||
|
@ -947,18 +933,20 @@ bool AActor::CheckLocalView (int playernum) const
|
|||
|
||||
void AActor::ConversationAnimation (int animnum)
|
||||
{
|
||||
FState * state = NULL;
|
||||
switch (animnum)
|
||||
{
|
||||
case 0:
|
||||
if (GreetingsState != NULL) SetState (GreetingsState);
|
||||
state = FindState(NAME_Greetings);
|
||||
break;
|
||||
case 1:
|
||||
if (YesState != NULL) SetState (YesState);
|
||||
state = FindState(NAME_Yes);
|
||||
break;
|
||||
case 2:
|
||||
if (NoState != NULL) SetState (NoState);
|
||||
state = FindState(NAME_No);
|
||||
break;
|
||||
}
|
||||
if (state != NULL) SetState(state);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -993,7 +981,7 @@ bool AActor::Massacre ()
|
|||
do
|
||||
{
|
||||
prevhealth = health;
|
||||
P_DamageMobj (this, NULL, NULL, 1000000, MOD_MASSACRE);
|
||||
P_DamageMobj (this, NULL, NULL, 1000000, NAME_Massacre);
|
||||
}
|
||||
while (health != prevhealth && health > 0); //abort if the actor wasn't hurt.
|
||||
return true;
|
||||
|
@ -1021,12 +1009,12 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
|
|||
|
||||
FState *nextstate=NULL;
|
||||
|
||||
if (target != NULL && target->flags & MF_SHOOTABLE)
|
||||
if (target != NULL && target->flags & (MF_SHOOTABLE|MF_CORPSE))
|
||||
{
|
||||
if (target->flags & MF_NOBLOOD) nextstate = mo->CrashState;
|
||||
if (nextstate == NULL) nextstate = mo->XDeathState;
|
||||
if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash);
|
||||
if (nextstate == NULL) nextstate = mo->FindState(2, NAME_Death, NAME_Extreme);
|
||||
}
|
||||
if (nextstate == NULL) nextstate = mo->DeathState;
|
||||
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);
|
||||
mo->SetState (nextstate);
|
||||
|
||||
if (mo->ObjectFlags & OF_MassDestruction)
|
||||
|
@ -1085,7 +1073,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
|
|||
}
|
||||
}
|
||||
|
||||
if (mo->DeathState != NULL)
|
||||
if (nextstate != NULL)
|
||||
{
|
||||
// [RH] Change render style of exploding rockets
|
||||
if (mo->flags5 & MF5_DEHEXPLOSION)
|
||||
|
@ -1167,7 +1155,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
momz -= MulScale15 (plane.c, dot);
|
||||
angle = R_PointToAngle2 (0, 0, momx, momy);
|
||||
flags |= MF_INBOUNCE;
|
||||
SetState (DeathState);
|
||||
SetState (FindState(NAME_Death));
|
||||
flags &= ~MF_INBOUNCE;
|
||||
return false;
|
||||
}
|
||||
|
@ -1813,7 +1801,7 @@ void P_MonsterFallingDamage (AActor *mo)
|
|||
damage = ((mom - (23*FRACUNIT))*6)>>FRACBITS;
|
||||
}
|
||||
damage = 1000000; // always kill 'em
|
||||
P_DamageMobj (mo, NULL, NULL, damage, MOD_FALLING);
|
||||
P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -1957,7 +1945,7 @@ void P_ZMovement (AActor *mo)
|
|||
|
||||
// Spawn splashes, etc.
|
||||
P_HitFloor (mo);
|
||||
if (mo->DamageType == MOD_ICE && mom < minmom)
|
||||
if (mo->DamageType == NAME_Ice && mom < minmom)
|
||||
{
|
||||
mo->tics = 1;
|
||||
mo->momx = 0;
|
||||
|
@ -1984,13 +1972,13 @@ void P_ZMovement (AActor *mo)
|
|||
{ // The skull slammed into something
|
||||
mo->momz = -mo->momz;
|
||||
}
|
||||
if (mo->CrashState &&
|
||||
(mo->flags & MF_CORPSE) &&
|
||||
if ((mo->flags & MF_CORPSE) &&
|
||||
!(mo->flags3 & MF3_CRASHED) &&
|
||||
mo->DamageType != MOD_ICE)
|
||||
mo->DamageType != NAME_Ice)
|
||||
{
|
||||
FState * crashstate = mo->FindState(NAME_Crash);
|
||||
if (crashstate != NULL) mo->SetState(crashstate);
|
||||
mo->flags3 |= MF3_CRASHED;
|
||||
mo->SetState (mo->CrashState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2353,7 +2341,7 @@ void AActor::HitFloor ()
|
|||
bool AActor::Slam (AActor *thing)
|
||||
{
|
||||
int dam = GetMissileDamage (7, 1);
|
||||
P_DamageMobj (thing, this, this, dam, MOD_HIT);
|
||||
P_DamageMobj (thing, this, this, dam, NAME_Melee);
|
||||
P_TraceBleed (dam, thing, this);
|
||||
flags &= ~MF_SKULLFLY;
|
||||
momx = momy = momz = 0;
|
||||
|
@ -2864,13 +2852,13 @@ void AActor::Tick ()
|
|||
}
|
||||
flags2 |= MF2_ONMOBJ;
|
||||
momz = 0;
|
||||
if (CrashState &&
|
||||
(flags & MF_CORPSE) &&
|
||||
if ((flags & MF_CORPSE) &&
|
||||
!(flags3 & MF3_CRASHED) &&
|
||||
DamageType != MOD_ICE)
|
||||
DamageType != NAME_Ice)
|
||||
{
|
||||
FState * crashstate = FindState(NAME_Crash);
|
||||
if (crashstate != NULL) SetState(crashstate);
|
||||
flags3 |= MF3_CRASHED;
|
||||
SetState (CrashState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2884,13 +2872,13 @@ void AActor::Tick ()
|
|||
}
|
||||
else if (z <= floorz)
|
||||
{
|
||||
if (CrashState &&
|
||||
(flags & MF_CORPSE) &&
|
||||
if ((flags & MF_CORPSE) &&
|
||||
!(flags3 & MF3_CRASHED) &&
|
||||
DamageType != MOD_ICE)
|
||||
DamageType != NAME_Ice)
|
||||
{
|
||||
FState * crashstate = FindState(NAME_Crash);
|
||||
if (crashstate != NULL) SetState(crashstate);
|
||||
flags3 |= MF3_CRASHED;
|
||||
SetState (CrashState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3918,9 +3906,10 @@ AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, an
|
|||
// If a puff has a crash state and an actor was not hit,
|
||||
// it will enter the crash state. This is used by the StrifeSpark
|
||||
// and BlasterPuff.
|
||||
if (hitthing == false && puff->CrashState != NULL)
|
||||
FState *crashstate;
|
||||
if (hitthing == false && (crashstate = puff->FindState(NAME_Crash)) != NULL)
|
||||
{
|
||||
puff->SetState (puff->CrashState);
|
||||
puff->SetState (crashstate);
|
||||
}
|
||||
else if (attackrange == MELEERANGE && puff->MeleeState != NULL)
|
||||
{
|
||||
|
@ -4625,7 +4614,7 @@ int AActor::DoSpecialDamage (AActor *target, int damage)
|
|||
}
|
||||
}
|
||||
|
||||
int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, int damagetype)
|
||||
int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
// If the actor does not have a corresponding death state, then it does not take damage.
|
||||
// Note that DeathState matches every kind of damagetype, so if an actor has that, it can
|
||||
|
@ -4636,48 +4625,36 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, in
|
|||
if (flags5 & MF5_NODAMAGE)
|
||||
{
|
||||
target = source;
|
||||
if (PainState != NULL && pr_takedamage() < PainChance)
|
||||
if (pr_takedamage() < PainChance)
|
||||
{
|
||||
SetState (PainState);
|
||||
FState * painstate = FindState(2,NAME_Pain, (int)damagetype);
|
||||
if (painstate != NULL) SetState (painstate);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (DeathState != NULL)
|
||||
// If the actor does not have a corresponding death state, then it does not take damage.
|
||||
// Note that DeathState matches every kind of damagetype, so an actor has that, it can
|
||||
// be hurt with any type of damage. Exception: Massacre damage always succeeds, because
|
||||
// it needs to work.
|
||||
|
||||
// Always kill if there is a regular death state or no death states at all.
|
||||
if (FindState (NAME_Death) != NULL || !HasStates(NAME_Death))
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
if (EDeathState==NULL && BDeathState==NULL && IDeathState==NULL)
|
||||
if (damagetype == NAME_Ice)
|
||||
{
|
||||
// If there is no death state at all, kill it always.
|
||||
return damage;
|
||||
}
|
||||
|
||||
switch (damagetype)
|
||||
{
|
||||
case MOD_MASSACRE:
|
||||
return damage;
|
||||
|
||||
case MOD_DISINTEGRATE:
|
||||
death = EDeathState;
|
||||
break;
|
||||
|
||||
case MOD_FIRE:
|
||||
death = BDeathState;
|
||||
break;
|
||||
|
||||
case MOD_ICE:
|
||||
death = IDeathState;
|
||||
death = GetClass()->ActorInfo->FindStateExact (2, NAME_Death, NAME_Ice);
|
||||
if (death == NULL && !deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) &&
|
||||
(player || (flags3 & MF3_ISMONSTER)))
|
||||
{
|
||||
death = &AActor::States[S_GENERICFREEZEDEATH];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
death = NULL;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
death = FindState (2, NAME_Death, int(damagetype));
|
||||
}
|
||||
return (death == NULL) ? -1 : damage;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue