Added TRANSFERTRANSLATION morph flag

This commit is contained in:
Blue-Shadow 2016-07-22 16:21:15 +03:00 committed by Christoph Oelckers
parent a1a0bdefff
commit 69a00ddabb
4 changed files with 11 additions and 0 deletions

View File

@ -81,6 +81,10 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
morphed = static_cast<APlayerPawn *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
EndAllPowerupEffects(actor->Inventory);
DObject::StaticPointerSubstitution (actor, morphed);
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
{
morphed->Translation = actor->Translation;
}
if ((actor->tid != 0) && (style & MORPH_NEWTIDBEHAVIOUR))
{
morphed->tid = actor->tid;
@ -382,6 +386,10 @@ bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int st
morphed = static_cast<AMorphedMonster *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
DObject::StaticPointerSubstitution (actor, morphed);
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
{
morphed->Translation = actor->Translation;
}
morphed->tid = actor->tid;
morphed->Angles.Yaw = actor->Angles.Yaw;
morphed->UnmorphedMe = actor;

View File

@ -25,6 +25,7 @@ enum
MORPH_UNDOBYDEATHSAVES = 0x00000800, // Actor (if unmorphed when killed) regains their health and doesn't die
MORPH_UNDOBYTIMEOUT = 0x00001000, // Player unmorphs once countdown expires
MORPH_UNDOALWAYS = 0x00002000, // Powerups must always unmorph, no matter what.
MORPH_TRANSFERTRANSLATION = 0x00004000, // Transfer translation from the original actor to the morphed one
MORPH_STANDARDUNDOING = MORPH_UNDOBYTOMEOFPOWER | MORPH_UNDOBYCHAOSDEVICE | MORPH_UNDOBYTIMEOUT,
};

View File

@ -710,6 +710,7 @@ static int ParseMorphStyle (FScanner &sc)
{ "MRF_UNDOBYDEATHFORCED", MORPH_UNDOBYDEATHFORCED},
{ "MRF_UNDOBYDEATHSAVES", MORPH_UNDOBYDEATHSAVES},
{ "MRF_UNDOALWAYS", MORPH_UNDOALWAYS },
{ "MRF_TRANSFERTRANSLATION", MORPH_TRANSFERTRANSLATION },
{ NULL, 0 }
};

View File

@ -164,6 +164,7 @@ const int MRF_UNDOBYDEATH = 512;
const int MRF_UNDOBYDEATHFORCED = 1024;
const int MRF_UNDOBYDEATHSAVES = 2048;
const int MRF_UNDOALWAYS = 4096;
const int MRF_TRANSFERTRANSLATION = 8192;
// Flags for A_RailAttack and A_CustomRailgun
const int RGF_SILENT = 1;