From 6b3325b358fdb46686ab2ddfe6b5880cdd336a03 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 7 Aug 2008 20:16:07 +0000 Subject: [PATCH] - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. SVN r1126 (trunk) --- docs/rh-log.txt | 8 + src/actor.h | 25 +- src/codepointers.h | 12 +- src/g_hexen/a_flechette.cpp | 8 +- src/g_raven/a_artitele.cpp | 24 +- src/g_raven/a_minotaur.cpp | 11 - src/g_raven/ravenshared.h | 2 - src/g_shared/a_action.cpp | 5 - src/g_shared/a_pickups.h | 2 +- src/g_strife/a_stalker.cpp | 147 +---------- src/g_strife/a_strifestuff.cpp | 229 +---------------- src/p_enemy.cpp | 12 +- src/p_mobj.cpp | 4 - src/thingdef/thingdef_properties.cpp | 3 +- wadsrc/static/actors/nativeclasses.txt | 1 + wadsrc/static/actors/raven/artitele.txt | 24 ++ wadsrc/static/actors/strife/stalker.txt | 78 ++++++ wadsrc/static/actors/strife/strifestuff.txt | 266 ++++++++++++++++++++ wadsrc/static/decorate.txt | 2 + 19 files changed, 433 insertions(+), 430 deletions(-) create mode 100644 wadsrc/static/actors/raven/artitele.txt create mode 100644 wadsrc/static/actors/strife/stalker.txt diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 5cefa774b..c043959d5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,12 @@ August 7, 2008 (Changes by Graf Zahl) +- Converted the rest of a_strifestuff.cpp to DECORATE. +- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. + I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that + this feature can also be used by other actors. +- Converted Strife's Stalker to DECORATE. +- Converted ArtiTeleport to DECORATE. +- Removed the NoBlockingSet method from AActor because everything using it has been + converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved diff --git a/src/actor.h b/src/actor.h index e6d0ca53b..235733198 100644 --- a/src/actor.h +++ b/src/actor.h @@ -306,6 +306,7 @@ enum MF5_SPECIALFIREDAMAGE=0x01000000, // Special treatment of PhoenixFX1 turned into a flag to removr // dependence of main engine code of specific actor types. MF5_SUMMONEDMONSTER = 0x02000000, // To mark the friendly Minotaur. Hopefully to be generalized later. + MF5_NOVERTICALMELEERANGE=0x04000000,// Does not check vertical distance for melee range // --- mobj.renderflags --- @@ -452,6 +453,17 @@ public: return (AActor *)(RUNTIME_TYPE(this)->Defaults); } + + // Return true if the monster should use a missile attack, false for melee + bool SuggestMissileAttack (fixed_t dist); + + // Adjusts the angle for deflection/reflection of incoming missiles + // Returns true if the missile should be allowed to explode anyway + bool AdjustReflectionAngle (AActor *thing, angle_t &angle); + + // Returns true if this actor is within melee range of its target + bool CheckMeleeRange (); + // BeginPlay: Called just after the actor is created virtual void BeginPlay (); // LevelSpawned: Called after BeginPlay if this actor was spawned by the world @@ -467,9 +479,6 @@ public: // Smallest yaw interval for a mapthing to be spawned with virtual angle_t AngleIncrements (); - // Return true if the monster should use a missile attack, false for melee - virtual bool SuggestMissileAttack (fixed_t dist); - // Called when actor dies virtual void Die (AActor *source, AActor *inflictor); @@ -490,9 +499,6 @@ public: // Made a metadata property so no longer virtual void Howl (); - // Called by A_NoBlocking in case the actor wants to drop some presents - virtual void NoBlockingSet (); - // Called by A_SinkMobj virtual fixed_t GetSinkSpeed (); @@ -505,10 +511,6 @@ public: // Called when an actor with MF_MISSILE and MF2_FLOORBOUNCE hits the floor virtual bool FloorBounceMissile (secplane_t &plane); - // Adjusts the angle for deflection/reflection of incoming missiles - // Returns true if the missile should be allowed to explode anyway - virtual bool AdjustReflectionAngle (AActor *thing, angle_t &angle); - // Called when an actor is to be reflected by a disc of repulsion. // Returns true to continue normal blast processing. virtual bool SpecialBlastHandling (AActor *source, fixed_t strength); @@ -531,9 +533,6 @@ public: // Returns true if it's okay to switch target to "other" after being attacked by it. virtual bool OkayToSwitchTarget (AActor *other); - // Returns true if this actor is within melee range of its target - virtual bool CheckMeleeRange (); - // Something just touched this actor. virtual void Touch (AActor *toucher); diff --git a/src/codepointers.h b/src/codepointers.h index eaffb5dbc..1a2a89e7f 100644 --- a/src/codepointers.h +++ b/src/codepointers.h @@ -109,9 +109,7 @@ ACTOR(ResetReloadCounter) ACTOR(ClearReFire) ACTOR(SpawnSingleItem) ACTOR(GiveQuestItem) -ACTOR(Bang4Cloud) -ACTOR(HandLower) -ACTOR(WakeOracleSpectre) +ACTOR(RemoveForceField) ACTOR(M_Refire) ACTOR(M_CheckAttack) @@ -306,6 +304,14 @@ ACTOR(LoremasterChain) ACTOR(ExtraLightOff) ACTOR(Explode512) ACTOR(LightGoesOut) +ACTOR(Bang4Cloud) +ACTOR(HandLower) +ACTOR(WakeOracleSpectre) +ACTOR(StalkerLookInit) +ACTOR(StalkerChaseDecide) +ACTOR(StalkerWalk) +ACTOR(StalkerAttack) +ACTOR(StalkerDrop) // Special code pointers for Strife's player - not to be used elsewhere! ACTOR(ItBurnsItBurns) diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index b2985cc3b..e619c4d66 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -20,6 +20,7 @@ void A_PoisonBagDamage (AActor *); void A_PoisonBagCheck (AActor *); void A_CheckThrowBomb (AActor *); void A_CheckThrowBomb2 (AActor *); +void A_TimeBomb(AActor *self); // Fire Bomb (Flechette used by Mage) --------------------------------------- @@ -27,11 +28,6 @@ class AFireBomb : public AActor { DECLARE_ACTOR (AFireBomb, AActor) public: - void PreExplode () - { - z += 32*FRACUNIT; - RenderStyle = STYLE_Normal; - } }; FState AFireBomb::States[] = @@ -42,7 +38,7 @@ FState AFireBomb::States[] = S_NORMAL (PSBG, 'A', 10, NULL , &States[S_FIREBOMB1+3]), S_NORMAL (PSBG, 'B', 4, NULL , &States[S_FIREBOMB1+4]), S_NORMAL (PSBG, 'C', 4, A_Scream , &States[S_FIREBOMB1+5]), - S_BRIGHT (XPL1, 'A', 4, A_Explode , &States[S_FIREBOMB1+6]), + S_BRIGHT (XPL1, 'A', 4, A_TimeBomb , &States[S_FIREBOMB1+6]), S_BRIGHT (XPL1, 'B', 4, NULL , &States[S_FIREBOMB1+7]), S_BRIGHT (XPL1, 'C', 4, NULL , &States[S_FIREBOMB1+8]), S_BRIGHT (XPL1, 'D', 4, NULL , &States[S_FIREBOMB1+9]), diff --git a/src/g_raven/a_artitele.cpp b/src/g_raven/a_artitele.cpp index d75b1d58c..60eeef728 100644 --- a/src/g_raven/a_artitele.cpp +++ b/src/g_raven/a_artitele.cpp @@ -13,30 +13,12 @@ static FRandom pr_tele ("TeleportSelf"); class AArtiTeleport : public AInventory { - DECLARE_ACTOR (AArtiTeleport, AInventory) + DECLARE_CLASS (AArtiTeleport, AInventory) public: bool Use (bool pickup); }; -FState AArtiTeleport::States[] = -{ - S_NORMAL (ATLP, 'A', 4, NULL, &States[1]), - S_NORMAL (ATLP, 'B', 4, NULL, &States[2]), - S_NORMAL (ATLP, 'C', 4, NULL, &States[3]), - S_NORMAL (ATLP, 'B', 4, NULL, &States[0]) -}; - -IMPLEMENT_ACTOR (AArtiTeleport, Raven, 36, 18) - PROP_Flags (MF_SPECIAL|MF_COUNTITEM) - PROP_Flags2 (MF2_FLOATBOB) - PROP_SpawnState (0) - PROP_Inventory_DefMaxAmount - PROP_Inventory_PickupFlash (1) - PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND) - PROP_Inventory_Icon ("ARTIATLP") - PROP_Inventory_PickupSound ("misc/p_pkup") - PROP_Inventory_PickupMessage("$TXT_ARTITELEPORT") -END_DEFAULTS +IMPLEMENT_CLASS (AArtiTeleport) bool AArtiTeleport::Use (bool pickup) { @@ -82,7 +64,7 @@ bool AArtiTeleport::Use (bool pickup) bool P_AutoUseChaosDevice (player_t *player) { - AArtiTeleport *arti = player->mo->FindInventory (); + AInventory *arti = player->mo->FindInventory(PClass::FindClass("ArtiTeleport")); if (arti != NULL) { diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 5f0192905..3561584f8 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -42,12 +42,6 @@ void AMinotaur::Tick () } } -void AMinotaur::NoBlockingSet () -{ - P_DropItem (this, "ArtiSuperHealth", 0, 51); - P_DropItem (this, "PhoenixRodAmmo", 10, 84); -} - bool AMinotaur::Slam (AActor *thing) { // Slamming minotaurs shouldn't move non-creatures @@ -165,11 +159,6 @@ bool AMinotaurFriend::OkayToSwitchTarget (AActor *other) return Super::OkayToSwitchTarget (other); } -void AMinotaurFriend::NoBlockingSet () -{ - // Do not drop anything -} - // Action functions for the minotaur ---------------------------------------- //---------------------------------------------------------------------------- diff --git a/src/g_raven/ravenshared.h b/src/g_raven/ravenshared.h index 249dbfe2e..7afd75947 100644 --- a/src/g_raven/ravenshared.h +++ b/src/g_raven/ravenshared.h @@ -7,7 +7,6 @@ class AMinotaur : public AActor { DECLARE_CLASS (AMinotaur, AActor) public: - void NoBlockingSet (); int DoSpecialDamage (AActor *target, int damage); public: @@ -21,7 +20,6 @@ class AMinotaurFriend : public AMinotaur public: int StartTime; - void NoBlockingSet (); bool IsOkayToAttack (AActor *target); void Die (AActor *source, AActor *inflictor); bool OkayToSwitchTarget (AActor *other); diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index d043389bb..02f2c3cb9 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -97,7 +97,6 @@ void A_NoBlocking (AActor *actor) actor->Conversation = NULL; // If the actor has attached metadata for items to drop, drop those. - // Otherwise, call NoBlockingSet() and let it decide what to drop. if (!actor->IsKindOf (RUNTIME_CLASS (APlayerPawn))) // [GRB] { FDropItem *di = GetDropItems(RUNTIME_TYPE(actor)); @@ -114,10 +113,6 @@ void A_NoBlocking (AActor *actor) di = di->Next; } } - else - { - actor->NoBlockingSet (); - } } } diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index cc063715b..71d14c43a 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -278,7 +278,7 @@ enum WIF_POWERED_UP = 0x00000400, // this is a tome-of-power'ed version of its sister WIF_NO_AUTO_SWITCH = 0x00001000, // never switch to this weapon when it's picked up - WIF_STAFF2_KICKBACK = 0x00002000, // the powered-up Heretic staff has special kickback + WIF_STAFF2_KICKBACK = 0x00002000, // the powered-up Heretic staff has special kickba WIF_CHEATNOTWEAPON = 1<<27, // Give cheat considers this not a weapon (used by Sigil) diff --git a/src/g_strife/a_stalker.cpp b/src/g_strife/a_stalker.cpp index ddcbf2f60..43cf61392 100644 --- a/src/g_strife/a_stalker.cpp +++ b/src/g_strife/a_stalker.cpp @@ -7,137 +7,39 @@ static FRandom pr_stalker ("Stalker"); -void A_StalkerLookInit (AActor *); -void A_StalkerChaseDecide (AActor *); -void A_StalkerWalk (AActor *); -void A_StalkerAttack (AActor *); -void A_StalkerDrop (AActor *); - -// Stalker ------------------------------------------------------------------ - -class AStalker : public AActor -{ - DECLARE_ACTOR (AStalker, AActor) -public: - bool CheckMeleeRange (); -}; - -FState AStalker::States[] = -{ -#define S_STALK_SPAWN 0 - S_NORMAL (STLK, 'A', 1, A_StalkerLookInit, &States[S_STALK_SPAWN]), - -#define S_STALK_STND_CEIL (S_STALK_SPAWN+1) - S_NORMAL (STLK, 'A', 10, A_Look, &States[S_STALK_STND_CEIL]), - -#define S_STALK_STND_FLOOR (S_STALK_STND_CEIL+1) - S_NORMAL (STLK, 'J', 10, A_Look, &States[S_STALK_STND_FLOOR]), - -#define S_STALK_CHASE (S_STALK_STND_FLOOR+1) - S_NORMAL (STLK, 'A', 1, A_StalkerChaseDecide, &States[S_STALK_CHASE+1]), - S_NORMAL (STLK, 'A', 3, A_Chase, &States[S_STALK_CHASE+2]), - S_NORMAL (STLK, 'B', 3, A_Chase, &States[S_STALK_CHASE+3]), - S_NORMAL (STLK, 'B', 3, A_Chase, &States[S_STALK_CHASE+4]), - S_NORMAL (STLK, 'C', 3, A_StalkerWalk, &States[S_STALK_CHASE+5]), - S_NORMAL (STLK, 'C', 3, A_Chase, &States[S_STALK_CHASE]), - -#define S_STALK_ATK (S_STALK_CHASE+6) - S_NORMAL (STLK, 'J', 3, A_FaceTarget, &States[S_STALK_ATK+1]), - S_NORMAL (STLK, 'K', 3, A_StalkerAttack, &States[S_STALK_ATK+2]), - -#define S_STALK_GROUND_CHASE (S_STALK_ATK+2) - S_NORMAL (STLK, 'J', 3, A_StalkerWalk, &States[S_STALK_GROUND_CHASE+1]), - S_NORMAL (STLK, 'K', 3, A_Chase, &States[S_STALK_GROUND_CHASE+2]), - S_NORMAL (STLK, 'K', 3, A_Chase, &States[S_STALK_GROUND_CHASE+3]), - S_NORMAL (STLK, 'L', 3, A_StalkerWalk, &States[S_STALK_GROUND_CHASE+4]), - S_NORMAL (STLK, 'L', 3, A_Chase, &States[S_STALK_GROUND_CHASE]), - -#define S_STALK_PAIN (S_STALK_GROUND_CHASE+5) - S_NORMAL (STLK, 'L', 1, A_Pain, &States[S_STALK_CHASE]), - -#define S_STALK_FLIP (S_STALK_PAIN+1) - S_NORMAL (STLK, 'C', 2, A_StalkerDrop, &States[S_STALK_FLIP+1]), - S_NORMAL (STLK, 'I', 3, NULL, &States[S_STALK_FLIP+2]), - S_NORMAL (STLK, 'H', 3, NULL, &States[S_STALK_FLIP+3]), - S_NORMAL (STLK, 'G', 3, NULL, &States[S_STALK_FLIP+4]), - S_NORMAL (STLK, 'F', 3, NULL, &States[S_STALK_FLIP+5]), - S_NORMAL (STLK, 'E', 3, NULL, &States[S_STALK_FLIP+6]), - S_NORMAL (STLK, 'D', 3, NULL, &States[S_STALK_GROUND_CHASE]), - -#define S_STALK_DIE (S_STALK_FLIP+7) - S_NORMAL (STLK, 'O', 4, NULL, &States[S_STALK_DIE+1]), - S_NORMAL (STLK, 'P', 4, A_Scream, &States[S_STALK_DIE+2]), - S_NORMAL (STLK, 'Q', 4, NULL, &States[S_STALK_DIE+3]), - S_NORMAL (STLK, 'R', 4, NULL, &States[S_STALK_DIE+4]), - S_NORMAL (STLK, 'S', 4, NULL, &States[S_STALK_DIE+5]), - S_NORMAL (STLK, 'T', 4, NULL, &States[S_STALK_DIE+6]), - S_NORMAL (STLK, 'U', 4, A_NoBlocking, &States[S_STALK_DIE+7]), - S_NORMAL (STLK, 'V', 4, NULL, &States[S_STALK_DIE+8]), - S_NORMAL (STLK, 'W', 4, NULL, &States[S_STALK_DIE+9]), - S_BRIGHT (STLK, 'X', 4, NULL, &States[S_STALK_DIE+10]), - S_BRIGHT (STLK, 'Y', 4, NULL, &States[S_STALK_DIE+11]), - S_BRIGHT (STLK, 'Z', 4, NULL, &States[S_STALK_DIE+12]), - S_BRIGHT (STLK, '[', 4, NULL, NULL) -}; - -IMPLEMENT_ACTOR (AStalker, Strife, 186, 0) - PROP_StrifeType (92) - PROP_SpawnHealth (80) - PROP_SpawnState (S_STALK_SPAWN) - PROP_SeeState (S_STALK_CHASE) - PROP_PainState (S_STALK_PAIN) - PROP_PainChance (40) - PROP_MeleeState (S_STALK_ATK) - PROP_DeathState (S_STALK_DIE) - PROP_SpeedFixed (16) - PROP_RadiusFixed (31) - PROP_HeightFixed (25) - PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_SPAWNCEILING|MF_NOGRAVITY|MF_DROPOFF| - MF_NOBLOOD|MF_COUNTKILL) - PROP_Flags2 (MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS) - PROP_Flags4 (MF4_INCOMBAT) - PROP_MaxDropOffHeight (32) - PROP_MinMissileChance (150) - PROP_SeeSound ("stalker/sight") - PROP_AttackSound ("stalker/attack") - PROP_PainSound ("stalker/pain") - PROP_DeathSound ("stalker/death") - PROP_ActiveSound ("stalker/active") - PROP_HitObituary ("$OB_STALKER") -END_DEFAULTS void A_StalkerChaseDecide (AActor *self) { if (!(self->flags & MF_NOGRAVITY)) { - self->SetState (&AStalker::States[S_STALK_GROUND_CHASE]); + self->SetState (self->FindState("SeeFloor")); } else if (self->ceilingz - self->height > self->z) { - self->SetState (&AStalker::States[S_STALK_FLIP]); + self->SetState (self->FindState("Drop")); } } void A_StalkerLookInit (AActor *self) { + FState *state; if (self->flags & MF_NOGRAVITY) { - if (self->state->NextState != &AStalker::States[S_STALK_STND_CEIL]) - { - self->SetState (&AStalker::States[S_STALK_STND_CEIL]); - } + state = self->FindState("LookCeiling"); } else { - if (self->state->NextState != &AStalker::States[S_STALK_STND_FLOOR]) - { - self->SetState (&AStalker::States[S_STALK_STND_FLOOR]); - } + state = self->FindState("LookFloor"); + } + if (self->state->NextState != state) + { + self->SetState (state); } } void A_StalkerDrop (AActor *self) { + self->flags5 &= ~MF5_NOVERTICALMELEERANGE; self->flags &= ~MF_NOGRAVITY; } @@ -145,7 +47,7 @@ void A_StalkerAttack (AActor *self) { if (self->flags & MF_NOGRAVITY) { - self->SetState (&AStalker::States[S_STALK_FLIP]); + self->SetState (self->FindState("Drop")); } else if (self->target != NULL) { @@ -166,30 +68,3 @@ void A_StalkerWalk (AActor *self) A_Chase (self); } -bool AStalker::CheckMeleeRange () -{ - if (!(flags & MF_NOGRAVITY)) - { - return Super::CheckMeleeRange (); - } - else - { - AActor *pl; - fixed_t dist; - - if (!target) - return false; - - pl = target; - dist = P_AproxDistance (pl->x - x, pl->y - y); - - if (dist >= MELEERANGE-20*FRACUNIT + pl->radius) - return false; - - if (!P_CheckSight (this, pl, 0)) - return false; - - return true; - } -} - diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 329559442..ccc5bf970 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -389,28 +389,12 @@ void A_RemoveForceField (AActor *); class AForceFieldGuard : public AActor { - DECLARE_ACTOR (AForceFieldGuard, AActor) + DECLARE_CLASS (AForceFieldGuard, AActor) public: int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype); }; -FState AForceFieldGuard::States[] = -{ - S_NORMAL (TOKN, 'A', -1, NULL, NULL), - S_NORMAL (XPRK, 'A', 1, A_RemoveForceField, NULL) -}; - -IMPLEMENT_ACTOR (AForceFieldGuard, Strife, 25, 0) - PROP_StrifeType (0) - PROP_SpawnHealth (10) - PROP_SpawnState (0) - PROP_DeathState (1) - PROP_RadiusFixed (2) - PROP_HeightFixed (1) - PROP_Mass (10000) - PROP_Flags (MF_SHOOTABLE|MF_NOSECTOR) - PROP_Flags4 (MF4_INCOMBAT) -END_DEFAULTS +IMPLEMENT_CLASS (AForceFieldGuard) int AForceFieldGuard::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype) { @@ -453,59 +437,6 @@ void A_GetHurt (AActor *self) } } -class AKneelingGuy : public AActor -{ - DECLARE_ACTOR (AKneelingGuy, AActor) -}; - -FState AKneelingGuy::States[] = -{ -#define S_KNEEL 0 - S_NORMAL (NEAL, 'A', 15, A_LoopActiveSound, &States[S_KNEEL+1]), - S_NORMAL (NEAL, 'B', 40, A_LoopActiveSound, &States[S_KNEEL]), - -#define S_KNEEL_PAIN (S_KNEEL+2) - S_NORMAL (NEAL, 'C', 5, A_SetShadow, &States[S_KNEEL_PAIN+1]), - S_NORMAL (NEAL, 'B', 4, A_Pain, &States[S_KNEEL_PAIN+2]), - S_NORMAL (NEAL, 'C', 5, A_ClearShadow, &States[S_KNEEL]), - -#define S_KNEEL_HURT (S_KNEEL_PAIN+3) - S_NORMAL (NEAL, 'B', 6, NULL, &States[S_KNEEL_HURT+1]), - S_NORMAL (NEAL, 'C', 13, A_GetHurt, &States[S_KNEEL_HURT]), - -#define S_KNEEL_DIE (S_KNEEL_HURT+2) - S_NORMAL (NEAL, 'D', 5, NULL, &States[S_KNEEL_DIE+1]), - S_NORMAL (NEAL, 'E', 5, A_Scream, &States[S_KNEEL_DIE+2]), - S_NORMAL (NEAL, 'F', 6, NULL, &States[S_KNEEL_DIE+3]), - S_NORMAL (NEAL, 'G', 5, A_NoBlocking, &States[S_KNEEL_DIE+4]), - S_NORMAL (NEAL, 'H', 5, NULL, &States[S_KNEEL_DIE+5]), - S_NORMAL (NEAL, 'I', 6, NULL, &States[S_KNEEL_DIE+6]), - S_NORMAL (NEAL, 'J', -1, NULL, NULL) -}; - -IMPLEMENT_ACTOR (AKneelingGuy, Strife, 204, 0) - PROP_SpawnState (S_KNEEL) - PROP_SeeState (S_KNEEL) - PROP_PainState (S_KNEEL_PAIN) - PROP_WoundState (S_KNEEL_HURT) - PROP_DeathState (S_KNEEL_DIE) - - PROP_SpawnHealth (51) - PROP_PainChance (255) - PROP_RadiusFixed (6) - PROP_HeightFixed (17) - PROP_MassLong (50000) - PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD) - PROP_Flags3 (MF3_ISMONSTER) - PROP_Flags4 (MF4_INCOMBAT) - PROP_MinMissileChance (150) - PROP_StrifeType (37) - - PROP_PainSound ("misc/static") - PROP_DeathSound ("misc/static") - PROP_ActiveSound ("misc/chant") -END_DEFAULTS - // Klaxon Warning Light ----------------------------------------------------- void A_TurretLook (AActor *self) @@ -561,99 +492,16 @@ void A_KlaxonBlare (AActor *self) } } -class AKlaxonWarningLight : public AActor -{ - DECLARE_ACTOR (AKlaxonWarningLight, AActor) -}; - -FState AKlaxonWarningLight::States[] = -{ - S_NORMAL (KLAX, 'A', 5, A_TurretLook, &States[0]), - - S_NORMAL (KLAX, 'B', 6, A_KlaxonBlare, &States[2]), - S_NORMAL (KLAX, 'C', 60, NULL, &States[1]) -}; - -IMPLEMENT_ACTOR (AKlaxonWarningLight, Strife, 24, 0) - PROP_SpawnState (0) - PROP_SeeState (1) - PROP_ReactionTime (60) - PROP_RadiusFixed(5) - PROP_Flags (MF_NOBLOCKMAP|MF_AMBUSH|MF_SPAWNCEILING|MF_NOGRAVITY) - PROP_Flags4 (MF4_FIXMAPTHINGPOS|MF4_NOSPLASHALERT|MF4_SYNCHRONIZED) - PROP_StrifeType (121) -END_DEFAULTS - -// CeilingTurret ------------------------------------------------------------ - -void A_ShootGun (AActor *); - -class ACeilingTurret : public AActor -{ - DECLARE_ACTOR (ACeilingTurret, AActor) -}; - -FState ACeilingTurret::States[] = -{ - S_NORMAL (TURT, 'A', 5, A_TurretLook, &States[0]), - - S_NORMAL (TURT, 'A', 2, A_Chase, &States[1]), - - S_NORMAL (TURT, 'B', 4, A_ShootGun, &States[3]), - S_NORMAL (TURT, 'D', 3, A_SentinelRefire, &States[4]), - S_NORMAL (TURT, 'A', 4, A_SentinelRefire, &States[2]), - - S_BRIGHT (BALL, 'A', 6, A_Scream, &States[6]), - S_BRIGHT (BALL, 'B', 6, NULL, &States[7]), - S_BRIGHT (BALL, 'C', 6, NULL, &States[8]), - S_BRIGHT (BALL, 'D', 6, NULL, &States[9]), - S_BRIGHT (BALL, 'E', 6, NULL, &States[10]), - S_NORMAL (TURT, 'C', -1, NULL, NULL) -}; - -IMPLEMENT_ACTOR (ACeilingTurret, Strife, 27, 0) - PROP_StrifeType (122) - PROP_SpawnHealth (125) - PROP_SpawnState (0) - PROP_SeeState (1) - PROP_PainState (2) - PROP_MissileState (2) - PROP_DeathState (5) - PROP_SpeedFixed (0) - PROP_PainChance (0) - PROP_MassLong (10000000) - PROP_Flags (MF_SHOOTABLE|MF_AMBUSH|MF_SPAWNCEILING|MF_NOGRAVITY| - MF_NOBLOOD|MF_COUNTKILL) - PROP_Flags4 (MF4_NOSPLASHALERT|MF4_DONTFALL) - PROP_MinMissileChance (150) - PROP_DeathSound ("turret/death") -END_DEFAULTS - // Power Coupling ----------------------------------------------------------- class APowerCoupling : public AActor { - DECLARE_ACTOR (APowerCoupling, AActor) + DECLARE_CLASS (APowerCoupling, AActor) public: void Die (AActor *source, AActor *inflictor); }; -FState APowerCoupling::States[] = -{ - S_NORMAL (COUP, 'A', 5, NULL, &States[1]), - S_NORMAL (COUP, 'B', 5, NULL, &States[0]), -}; - -IMPLEMENT_ACTOR (APowerCoupling, Strife, 220, 0) - PROP_SpawnState (0) - PROP_SpawnHealth (40) - PROP_RadiusFixed (17) - PROP_HeightFixed (64) - PROP_MassLong (999999) - PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_DROPPED|MF_NOBLOOD|MF_NOTDMATCH) - PROP_Flags4 (MF4_INCOMBAT) - PROP_StrifeType (288) -END_DEFAULTS +IMPLEMENT_CLASS (APowerCoupling) void APowerCoupling::Die (AActor *source, AActor *inflictor) { @@ -686,7 +534,7 @@ void APowerCoupling::Die (AActor *source, AActor *inflictor) class AMeat : public AActor { - DECLARE_ACTOR (AMeat, AActor) + DECLARE_CLASS (AMeat, AActor) public: void BeginPlay () { @@ -695,70 +543,7 @@ public: } }; -FState AMeat::States[] = -{ - S_NORMAL (MEAT, 'A', 700, NULL, NULL), - S_NORMAL (MEAT, 'B', 700, NULL, NULL), - S_NORMAL (MEAT, 'C', 700, NULL, NULL), - S_NORMAL (MEAT, 'D', 700, NULL, NULL), - S_NORMAL (MEAT, 'E', 700, NULL, NULL), - S_NORMAL (MEAT, 'F', 700, NULL, NULL), - S_NORMAL (MEAT, 'G', 700, NULL, NULL), - S_NORMAL (MEAT, 'H', 700, NULL, NULL), - S_NORMAL (MEAT, 'I', 700, NULL, NULL), - S_NORMAL (MEAT, 'J', 700, NULL, NULL), - S_NORMAL (MEAT, 'K', 700, NULL, NULL), - S_NORMAL (MEAT, 'L', 700, NULL, NULL), - S_NORMAL (MEAT, 'M', 700, NULL, NULL), - S_NORMAL (MEAT, 'N', 700, NULL, NULL), - S_NORMAL (MEAT, 'O', 700, NULL, NULL), - S_NORMAL (MEAT, 'P', 700, NULL, NULL), - S_NORMAL (MEAT, 'Q', 700, NULL, NULL), - S_NORMAL (MEAT, 'R', 700, NULL, NULL), - S_NORMAL (MEAT, 'S', 700, NULL, NULL), - S_NORMAL (MEAT, 'T', 700, NULL, NULL) -}; - -IMPLEMENT_ACTOR (AMeat, Any, -1, 0) - PROP_SpawnState (0) - PROP_Flags (MF_NOCLIP) -END_DEFAULTS - -// Gibs for things that don't bleed ----------------------------------------- - -class AJunk : public AMeat -{ - DECLARE_ACTOR (AJunk, AMeat) -}; - -FState AJunk::States[] = -{ - S_NORMAL (JUNK, 'A', 700, NULL, NULL), - S_NORMAL (JUNK, 'B', 700, NULL, NULL), - S_NORMAL (JUNK, 'C', 700, NULL, NULL), - S_NORMAL (JUNK, 'D', 700, NULL, NULL), - S_NORMAL (JUNK, 'E', 700, NULL, NULL), - S_NORMAL (JUNK, 'F', 700, NULL, NULL), - S_NORMAL (JUNK, 'G', 700, NULL, NULL), - S_NORMAL (JUNK, 'H', 700, NULL, NULL), - S_NORMAL (JUNK, 'I', 700, NULL, NULL), - S_NORMAL (JUNK, 'J', 700, NULL, NULL), - S_NORMAL (JUNK, 'K', 700, NULL, NULL), - S_NORMAL (JUNK, 'L', 700, NULL, NULL), - S_NORMAL (JUNK, 'M', 700, NULL, NULL), - S_NORMAL (JUNK, 'N', 700, NULL, NULL), - S_NORMAL (JUNK, 'O', 700, NULL, NULL), - S_NORMAL (JUNK, 'P', 700, NULL, NULL), - S_NORMAL (JUNK, 'Q', 700, NULL, NULL), - S_NORMAL (JUNK, 'R', 700, NULL, NULL), - S_NORMAL (JUNK, 'S', 700, NULL, NULL), - S_NORMAL (JUNK, 'T', 700, NULL, NULL) -}; - -IMPLEMENT_ACTOR (AJunk, Any, -1, 0) - PROP_SpawnState (0) - PROP_Flags (MF_NOCLIP) -END_DEFAULTS +IMPLEMENT_CLASS (AMeat) //========================================================================== // @@ -768,7 +553,7 @@ END_DEFAULTS void A_TossGib (AActor *self) { - const PClass *gibtype = (self->flags & MF_NOBLOOD) ? RUNTIME_CLASS(AJunk) : RUNTIME_CLASS(AMeat); + const char *gibtype = (self->flags & MF_NOBLOOD) ? "Junk" : "Meat"; AActor *gib = Spawn (gibtype, self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); angle_t an; int speed; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 7e5a1b587..f170fbce8 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -237,10 +237,13 @@ bool AActor::CheckMeleeRange () return true; // [RH] Don't melee things too far above or below actor. - if (pl->z > z + height) - return false; - if (pl->z + pl->height < z) - return false; + if (!(flags5 & MF5_NOVERTICALMELEERANGE)) + { + if (pl->z > z + height) + return false; + if (pl->z + pl->height < z) + return false; + } if (!P_CheckSight (this, pl, 0)) return false; @@ -2590,7 +2593,6 @@ void A_Explode (AActor *thing) int distance = 128; bool hurtSource = true; - thing->PreExplode (); thing->GetExplodeParms (damage, distance, hurtSource); P_RadiusAttack (thing, thing->target, damage, distance, thing->DamageType, hurtSource); if (thing->z <= thing->floorz + (distance<