- Added: BUDDHA and FOILBUDDHA.

- Fixed: mugshot didn't take the god2 cheat into account.
This commit is contained in:
MajorCooke 2014-10-24 23:09:39 -05:00 committed by Christoph Oelckers
parent b980069367
commit d1dc6fd59a
4 changed files with 41 additions and 28 deletions

View file

@ -342,6 +342,8 @@ enum
MF7_HANDLENODELAY = 0x00000008, // respect NoDelay state flag
MF7_WEAPONSPAWN = 0x00000010, // subject to DF_NO_COOP_WEAPON_SPAWN dmflag
MF7_HARMFRIENDS = 0x00000020, // is allowed to harm friendly monsters.
MF7_BUDDHA = 0x00000040, // Behaves just like the buddha cheat.
MF7_FOILBUDDHA = 0x00000080, // Similar to FOILINVUL, foils buddha mode.
// --- mobj.renderflags ---

View file

@ -444,7 +444,7 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags)
if (bNormal)
{
bool good;
if ((player->cheats & CF_GODMODE) || (player->mo != NULL && player->mo->flags2 & MF2_INVULNERABLE))
if ((player->cheats & CF_GODMODE) || (player->cheats & CF_GODMODE2) || (player->mo != NULL && player->mo->flags2 & MF2_INVULNERABLE))
{
good = SetState((stateflags & ANIMATEDGODMODE) ? "godanimated" : "god");
}

View file

@ -1322,7 +1322,15 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (target->health <= 0)
{ // Death
{
if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && (!(inflictor->flags3 & MF7_FOILBUDDHA) && !(flags & DMG_FOILBUDDHA)))
{ //Make sure FOILINVUL flags work here too for monsters. Or perhaps consider a FOILBUDDHA flag...
target->health = 1;
}
else
{
// Death
target->special1 = damage;
// use inflictor's death type if it got one.
@ -1360,6 +1368,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
target->Die (source, inflictor, flags);
return damage;
}
}
woundstate = target->FindState(NAME_Wound, mod);
if (woundstate != NULL)

View file

@ -242,6 +242,8 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF7, ALWAYSTELEFRAG, AActor, flags7),
DEFINE_FLAG(MF7, WEAPONSPAWN, AActor, flags7),
DEFINE_FLAG(MF7, HARMFRIENDS, AActor, flags7),
DEFINE_FLAG(MF7, BUDDHA, AActor, flags7),
DEFINE_FLAG(MF7, FOILBUDDHA, AActor, flags7),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),