From 4dc1b9579e4f3b41fe03e5bca5d341cb1b0e16a2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 8 Apr 2008 09:52:50 +0000 Subject: [PATCH] - Removed the check for Heretic when playing *evillaugh when using the Chaos Device. This sound is not defined by the other games so it won't play by default. - Added MORPH_UNDOBYTOMEOFPOWER and MORPH_UNDOBYCHAOSDEVICE flags for the morph style so that the special behavior of these two items can be switched on and off. SVN r890 (trunk) --- docs/rh-log.txt | 6 ++++++ src/g_heretic/a_hereticartifacts.cpp | 2 +- src/g_raven/a_artitele.cpp | 13 ++++++++++--- src/g_shared/a_morph.h | 2 +- src/m_cheat.cpp | 9 +++++++-- src/thingdef/thingdef_properties.cpp | 10 ++++++---- wadsrc/decorate/raven/artiegg.txt | 4 +++- 7 files changed, 34 insertions(+), 12 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a2f1546cd..a43bcc46c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,10 @@ April 8, 2008 (Changes by Graf Zahl) +- Removed the check for Heretic when playing *evillaugh when using the + Chaos Device. This sound is not defined by the other games so it won't + play by default. +- Added MORPH_UNDOMORPHBYTOMEOFPOWER and MORPH_UNDOMORPHBYCHAOSDEVICE flags + for the morph style so that the special behavior of these two items + can be switched on and off. - Added Martin Howe's morph system enhancement. April 7, 2008 (Changes by Graf Zahl) diff --git a/src/g_heretic/a_hereticartifacts.cpp b/src/g_heretic/a_hereticartifacts.cpp index 7afce176e..a8fe2b2fd 100644 --- a/src/g_heretic/a_hereticartifacts.cpp +++ b/src/g_heretic/a_hereticartifacts.cpp @@ -32,7 +32,7 @@ END_DEFAULTS bool AArtiTomeOfPower::Use (bool pickup) { - if (Owner->player->morphTics) + if (Owner->player->morphTics && (Owner->player->MorphStyle & MORPH_UNDOBYTOMEOFPOWER)) { // Attempt to undo chicken if (!P_UndoPlayerMorph (Owner->player)) { // Failed diff --git a/src/g_raven/a_artitele.cpp b/src/g_raven/a_artitele.cpp index 4b2ee066e..c1242829f 100644 --- a/src/g_raven/a_artitele.cpp +++ b/src/g_raven/a_artitele.cpp @@ -59,11 +59,18 @@ bool AArtiTeleport::Use (bool pickup) destAngle = ANG45 * (playerstarts[Owner->player - players].angle/45); } P_Teleport (Owner, destX, destY, ONFLOORZ, destAngle, true, true, false); - if (gameinfo.gametype == GAME_Hexen && Owner->player->morphTics) + if (Owner->player->morphTics && (Owner->player->MorphStyle & MORPH_UNDOBYCHAOSDEVICE)) { // Teleporting away will undo any morph effects (pig) - P_UndoPlayerMorph (Owner->player); + if (P_UndoPlayerMorph (Owner->player)) + { + Owner->player->MorphedPlayerClass = 0; + Owner->player->MorphStyle = 0; + Owner->player->MorphExitFlash = NULL; + } } - if (gameinfo.gametype == GAME_Heretic) + // The game check is not necessary because only Heretic defines *evillaugh by default + // However if it is there no other game can use it if it wants to. + //if (gameinfo.gametype == GAME_Heretic) { // Full volume laugh S_Sound (Owner, CHAN_VOICE, "*evillaugh", 1, ATTN_NONE); } diff --git a/src/g_shared/a_morph.h b/src/g_shared/a_morph.h index 891e71f8f..2cab5ef8c 100644 --- a/src/g_shared/a_morph.h +++ b/src/g_shared/a_morph.h @@ -17,7 +17,7 @@ enum MORPH_UNDOBYCHAOSDEVICE = 8, }; -class PClass; +struct PClass; class AActor; class player_s; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index d800cce27..bcdd2211e 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -431,18 +431,23 @@ const char *cht_Morph (player_t *player, const PClass *morphclass, bool quickund return ""; } PClass *oldclass = player->mo->GetClass(); + + // Set the standard morph style for the current game + int style = MORPH_UNDOBYTOMEOFPOWER; + if (gameinfo.gametype == GAME_Hexen) style |= MORPH_UNDOBYCHAOSDEVICE; + if (player->morphTics) { if (P_UndoPlayerMorph (player)) { - if (!quickundo && oldclass != morphclass && P_MorphPlayer (player, morphclass)) + if (!quickundo && oldclass != morphclass && P_MorphPlayer (player, morphclass, 0, style)) { return "You feel even stranger."; } return "You feel like yourself again."; } } - else if (P_MorphPlayer (player, morphclass)) + else if (P_MorphPlayer (player, morphclass, 0, style)) { return "You feel strange..."; } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 123d90f10..4f91cee16 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -749,10 +749,10 @@ static bool CheckFloatParm(FScanner &sc) static int ParseMorphStyle (FScanner &sc) { static const char * morphstyles[]={ - "MRF_ADDSTAMINA", "MRF_FULLHEALTH", NULL}; + "MRF_ADDSTAMINA", "MRF_FULLHEALTH", "MRF_UNDOBYTOMEOFPOWER", "MRF_UNDOBYCHAOSDEVICE", NULL}; static const int morphstyle_values[]={ - MORPH_ADDSTAMINA, MORPH_FULLHEALTH}; + MORPH_ADDSTAMINA, MORPH_FULLHEALTH, MORPH_UNDOBYTOMEOFPOWER, MORPH_UNDOBYCHAOSDEVICE}; // May be given flags by number... if (sc.CheckNumber()) @@ -762,6 +762,8 @@ static int ParseMorphStyle (FScanner &sc) } // ... else should be flags by name. + // NOTE: Later this should be removed and a normal expression used. + // The current DECORATE parser can't handle this though. bool gotparen = sc.CheckString("("); int style = 0; do @@ -2679,7 +2681,7 @@ static const ActorProps props[] = { "morphprojectile.duration", (apf)EggFXDuration, RUNTIME_CLASS(AMorphProjectile) }, { "morphprojectile.monsterclass", (apf)EggFXMonsterClass, RUNTIME_CLASS(AMorphProjectile) }, { "morphprojectile.morphflash", (apf)EggFXMorphFlash, RUNTIME_CLASS(AMorphProjectile) }, -// { "morphprojectile.morphstyle", (apf)EggFXMorphStyle, RUNTIME_CLASS(AMorphProjectile) }, + { "morphprojectile.morphstyle", (apf)EggFXMorphStyle, RUNTIME_CLASS(AMorphProjectile) }, { "morphprojectile.playerclass", (apf)EggFXPlayerClass, RUNTIME_CLASS(AMorphProjectile) }, { "morphprojectile.unmorphflash", (apf)EggFXUnMorphFlash, RUNTIME_CLASS(AMorphProjectile) }, { "obituary", ActorObituary, RUNTIME_CLASS(AActor) }, @@ -2708,7 +2710,7 @@ static const ActorProps props[] = { "player.viewheight", (apf)PlayerViewHeight, RUNTIME_CLASS(APlayerPawn) }, { "poisondamage", ActorPoisonDamage, RUNTIME_CLASS(AActor) }, { "powermorph.morphflash", (apf)PowerMorphMorphFlash, RUNTIME_CLASS(APowerMorph) }, - //{ "powermorph.morphstyle", (apf)PowerMorphMorphStyle, RUNTIME_CLASS(APowerMorph) }, + { "powermorph.morphstyle", (apf)PowerMorphMorphStyle, RUNTIME_CLASS(APowerMorph) }, { "powermorph.playerclass", (apf)PowerMorphPlayerClass, RUNTIME_CLASS(APowerMorph) }, { "powermorph.unmorphflash", (apf)PowerMorphUnMorphFlash, RUNTIME_CLASS(APowerMorph) }, { "powerup.color", (apf)PowerupColor, RUNTIME_CLASS(APowerupGiver) }, diff --git a/wadsrc/decorate/raven/artiegg.txt b/wadsrc/decorate/raven/artiegg.txt index 1cee515cc..18a2d83f5 100644 --- a/wadsrc/decorate/raven/artiegg.txt +++ b/wadsrc/decorate/raven/artiegg.txt @@ -10,6 +10,7 @@ ACTOR EggFX : MorphProjectile Speed 18 MorphProjectile.PlayerClass "ChickenPlayer" MorphProjectile.MonsterClass "Chicken" + MorphProjectile.MorphStyle MRF_UNDOBYTOMEOFPOWER States { Spawn: @@ -63,7 +64,8 @@ ACTOR PorkFX : MorphProjectile Speed 18 MorphProjectile.PlayerClass "PigPlayer" MorphProjectile.MonsterClass "Pig" - States + MorphProjectile.MorphStyle MRF_UNDOBYTOMEOFPOWER|MRF_UNDOBYCHAOSDEVICE + States { Spawn: PRKM ABCDE 4