mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 15:02:39 +00:00
- Added: BUDDHA and FOILBUDDHA.
- Fixed: mugshot didn't take the god2 cheat into account.
This commit is contained in:
parent
b980069367
commit
d1dc6fd59a
4 changed files with 41 additions and 28 deletions
|
@ -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 ---
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -1322,43 +1322,52 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
|
||||
|
||||
if (target->health <= 0)
|
||||
{ // Death
|
||||
target->special1 = damage;
|
||||
|
||||
// use inflictor's death type if it got one.
|
||||
if (inflictor && inflictor->DeathType != NAME_None) mod = inflictor->DeathType;
|
||||
|
||||
// check for special fire damage or ice damage deaths
|
||||
if (mod == NAME_Fire)
|
||||
{
|
||||
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
|
||||
{
|
||||
if (player && !player->morphTics)
|
||||
{ // Check for flame death
|
||||
if (!inflictor ||
|
||||
((target->health > -50) && (damage > 25)) ||
|
||||
!(inflictor->flags5 & MF5_SPECIALFIREDAMAGE))
|
||||
|
||||
// Death
|
||||
target->special1 = damage;
|
||||
|
||||
// use inflictor's death type if it got one.
|
||||
if (inflictor && inflictor->DeathType != NAME_None) mod = inflictor->DeathType;
|
||||
|
||||
// check for special fire damage or ice damage deaths
|
||||
if (mod == NAME_Fire)
|
||||
{
|
||||
if (player && !player->morphTics)
|
||||
{ // Check for flame death
|
||||
if (!inflictor ||
|
||||
((target->health > -50) && (damage > 25)) ||
|
||||
!(inflictor->flags5 & MF5_SPECIALFIREDAMAGE))
|
||||
{
|
||||
target->DamageType = NAME_Fire;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->DamageType = NAME_Fire;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->DamageType = NAME_Fire;
|
||||
target->DamageType = mod;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
target->DamageType = mod;
|
||||
}
|
||||
if (source && source->tracer && (source->flags5 & MF5_SUMMONEDMONSTER))
|
||||
{ // Minotaur's kills go to his master
|
||||
// Make sure still alive and not a pointer to fighter head
|
||||
if (source->tracer->player && (source->tracer->player->mo == source->tracer))
|
||||
{
|
||||
source = source->tracer;
|
||||
if (source && source->tracer && (source->flags5 & MF5_SUMMONEDMONSTER))
|
||||
{ // Minotaur's kills go to his master
|
||||
// Make sure still alive and not a pointer to fighter head
|
||||
if (source->tracer->player && (source->tracer->player->mo == source->tracer))
|
||||
{
|
||||
source = source->tracer;
|
||||
}
|
||||
}
|
||||
target->Die (source, inflictor, flags);
|
||||
return damage;
|
||||
}
|
||||
target->Die (source, inflictor, flags);
|
||||
return damage;
|
||||
}
|
||||
|
||||
woundstate = target->FindState(NAME_Wound, mod);
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue