From 3b36334704d300b9a670b8c187696faf6dc27541 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 Mar 2009 21:17:00 +0000 Subject: [PATCH] - changed: If a monster with the BOSSDEATH flag is crushed A_BossDeath will be called now. - fixed: D'Sparil's second form was missing the BOSSDEATH flag. - fixed: D'Sparil's first form requires the DONTGIB flag. - fixed: Heretic doesn't crush monsters. To handle this in a more generic fashion this depends on the presence of a gib sprite now. SVN r1459 (trunk) --- docs/rh-log.txt | 10 ++++- src/p_enemy.h | 1 + src/p_map.cpp | 49 ++++++++++++++++++++---- wadsrc/static/actors/heretic/dsparil.txt | 2 + 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 4d17ac532..76f9c88fc 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,12 @@ -March 1, 2009 (Changes by Graf Zahl) +March 3, 2009 (Changes by Graf Zahl) +- changed: If a monster with the BOSSDEATH flag is crushed A_BossDeath will + be called now. +- fixed: D'Sparil's second form was missing the BOSSDEATH flag. +- fixed: D'Sparil's first form requires the DONTGIB flag. +- fixed: Heretic doesn't crush monsters. To handle this in a more generic + fashion this depends on the presence of a gib sprite now. + +March 1, 2009 (Changes by Graf Zahl) - Changed burn and Acolyte death sequences so that they leave corpses that don't vanish. - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true diff --git a/src/p_enemy.h b/src/p_enemy.h index a994fe518..f111f9d08 100644 --- a/src/p_enemy.h +++ b/src/p_enemy.h @@ -45,6 +45,7 @@ DECLARE_ACTION(A_NoBlocking) DECLARE_ACTION(A_Scream) DECLARE_ACTION(A_FreezeDeath) DECLARE_ACTION(A_FreezeDeathChunks) +DECLARE_ACTION(A_BossDeath) void A_Chase(AActor *self); void A_FaceTarget (AActor *actor); diff --git a/src/p_map.cpp b/src/p_map.cpp index 3c5cf23c8..f0e9add9e 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -38,6 +38,7 @@ #include "p_effect.h" #include "p_terrain.h" #include "p_trace.h" +#include "p_enemy.h" #include "s_sound.h" #include "decallib.h" @@ -4167,19 +4168,53 @@ void P_DoCrunch (AActor *thing, FChangePosition *cpos) 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); + if (thing->flags4 & MF4_BOSSDEATH) + { + CALL_ACTION(A_BossDeath, thing); + } + thing->flags &= ~MF_SOLID; + thing->flags3 |= MF3_DONTGIB; thing->height = thing->radius = 0; thing->SetState (state); return; } if (!(thing->flags & MF_NOBLOOD)) { - AActor *gib = Spawn ("RealGibs", thing->x, thing->y, thing->z, ALLOW_REPLACE); - gib->RenderStyle = thing->RenderStyle; - gib->alpha = thing->alpha; - gib->height = 0; - gib->radius = 0; + if (thing->flags4 & MF4_BOSSDEATH) + { + CALL_ACTION(A_BossDeath, thing); + } + + const PClass *i = PClass::FindClass("RealGibs"); + + if (i != NULL) + { + i = i->ActorInfo->GetReplacement()->Class; + + const AActor *defaults = GetDefaultByType (i); + if (defaults->SpawnState == NULL || + sprites[defaults->SpawnState->sprite].numframes == 0) + { + i = NULL; + } + } + if (i == NULL) + { + // if there's no gib sprite don't crunch it. + thing->flags &= ~MF_SOLID; + thing->flags3 |= MF3_DONTGIB; + thing->height = thing->radius = 0; + return; + } + + AActor *gib = Spawn (i, thing->x, thing->y, thing->z, ALLOW_REPLACE); + if (gib != NULL) + { + gib->RenderStyle = thing->RenderStyle; + gib->alpha = thing->alpha; + gib->height = 0; + gib->radius = 0; + } S_Sound (thing, CHAN_BODY, "misc/fallingsplat", 1, ATTN_IDLE); PalEntry bloodcolor = (PalEntry)thing->GetClass()->Meta.GetMetaInt(AMETA_BloodColor); diff --git a/wadsrc/static/actors/heretic/dsparil.txt b/wadsrc/static/actors/heretic/dsparil.txt index d5ad9d24d..79d457ae7 100644 --- a/wadsrc/static/actors/heretic/dsparil.txt +++ b/wadsrc/static/actors/heretic/dsparil.txt @@ -27,6 +27,7 @@ ACTOR Sorcerer1 7 +NOTARGET +NOICEDEATH +FLOORCLIP + +DONTGIB SeeSound "dsparilserpent/sight" AttackSound "dsparilserpent/attack" PainSound "dsparilserpent/pain" @@ -128,6 +129,7 @@ ACTOR Sorcerer2 +NOTARGET +NOICEDEATH +FLOORCLIP + +BOSSDEATH SeeSound "dsparil/sight" AttackSound "dsparil/attack" PainSound "dsparil/pain"