mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 00:20:38 +00:00
Added TRANSFERTRANSLATION morph flag
This commit is contained in:
parent
a1a0bdefff
commit
69a00ddabb
4 changed files with 11 additions and 0 deletions
|
@ -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));
|
morphed = static_cast<APlayerPawn *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
|
||||||
EndAllPowerupEffects(actor->Inventory);
|
EndAllPowerupEffects(actor->Inventory);
|
||||||
DObject::StaticPointerSubstitution (actor, morphed);
|
DObject::StaticPointerSubstitution (actor, morphed);
|
||||||
|
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
|
||||||
|
{
|
||||||
|
morphed->Translation = actor->Translation;
|
||||||
|
}
|
||||||
if ((actor->tid != 0) && (style & MORPH_NEWTIDBEHAVIOUR))
|
if ((actor->tid != 0) && (style & MORPH_NEWTIDBEHAVIOUR))
|
||||||
{
|
{
|
||||||
morphed->tid = actor->tid;
|
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));
|
morphed = static_cast<AMorphedMonster *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
|
||||||
DObject::StaticPointerSubstitution (actor, morphed);
|
DObject::StaticPointerSubstitution (actor, morphed);
|
||||||
|
if ((style & MORPH_TRANSFERTRANSLATION) && !(morphed->flags2 & MF2_DONTTRANSLATE))
|
||||||
|
{
|
||||||
|
morphed->Translation = actor->Translation;
|
||||||
|
}
|
||||||
morphed->tid = actor->tid;
|
morphed->tid = actor->tid;
|
||||||
morphed->Angles.Yaw = actor->Angles.Yaw;
|
morphed->Angles.Yaw = actor->Angles.Yaw;
|
||||||
morphed->UnmorphedMe = actor;
|
morphed->UnmorphedMe = actor;
|
||||||
|
|
|
@ -25,6 +25,7 @@ enum
|
||||||
MORPH_UNDOBYDEATHSAVES = 0x00000800, // Actor (if unmorphed when killed) regains their health and doesn't die
|
MORPH_UNDOBYDEATHSAVES = 0x00000800, // Actor (if unmorphed when killed) regains their health and doesn't die
|
||||||
MORPH_UNDOBYTIMEOUT = 0x00001000, // Player unmorphs once countdown expires
|
MORPH_UNDOBYTIMEOUT = 0x00001000, // Player unmorphs once countdown expires
|
||||||
MORPH_UNDOALWAYS = 0x00002000, // Powerups must always unmorph, no matter what.
|
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,
|
MORPH_STANDARDUNDOING = MORPH_UNDOBYTOMEOFPOWER | MORPH_UNDOBYCHAOSDEVICE | MORPH_UNDOBYTIMEOUT,
|
||||||
};
|
};
|
||||||
|
|
|
@ -710,6 +710,7 @@ static int ParseMorphStyle (FScanner &sc)
|
||||||
{ "MRF_UNDOBYDEATHFORCED", MORPH_UNDOBYDEATHFORCED},
|
{ "MRF_UNDOBYDEATHFORCED", MORPH_UNDOBYDEATHFORCED},
|
||||||
{ "MRF_UNDOBYDEATHSAVES", MORPH_UNDOBYDEATHSAVES},
|
{ "MRF_UNDOBYDEATHSAVES", MORPH_UNDOBYDEATHSAVES},
|
||||||
{ "MRF_UNDOALWAYS", MORPH_UNDOALWAYS },
|
{ "MRF_UNDOALWAYS", MORPH_UNDOALWAYS },
|
||||||
|
{ "MRF_TRANSFERTRANSLATION", MORPH_TRANSFERTRANSLATION },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,7 @@ const int MRF_UNDOBYDEATH = 512;
|
||||||
const int MRF_UNDOBYDEATHFORCED = 1024;
|
const int MRF_UNDOBYDEATHFORCED = 1024;
|
||||||
const int MRF_UNDOBYDEATHSAVES = 2048;
|
const int MRF_UNDOBYDEATHSAVES = 2048;
|
||||||
const int MRF_UNDOALWAYS = 4096;
|
const int MRF_UNDOALWAYS = 4096;
|
||||||
|
const int MRF_TRANSFERTRANSLATION = 8192;
|
||||||
|
|
||||||
// Flags for A_RailAttack and A_CustomRailgun
|
// Flags for A_RailAttack and A_CustomRailgun
|
||||||
const int RGF_SILENT = 1;
|
const int RGF_SILENT = 1;
|
||||||
|
|
Loading…
Reference in a new issue