mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 14:41:40 +00:00
- Added TELEFRAG_DAMAGE constant, and changed the two places that still used
1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) SVN r1755 (trunk)
This commit is contained in:
parent
a1554799d9
commit
16846fe36d
12 changed files with 29 additions and 32 deletions
|
@ -1,4 +1,7 @@
|
|||
August 6, 2009
|
||||
- Added TELEFRAG_DAMAGE constant, and changed the two places that still used
|
||||
1000 as the threshold for god mode damage to use it instead. (Players with
|
||||
MF2_INVULNERABLE set already used 1000000 as their threshold.)
|
||||
- Added MF6_NOTELEPORT flag.
|
||||
- Fixed: M_QuitResponse() tried to play a sound even when none was specified
|
||||
in the gameinfo.
|
||||
|
|
|
@ -58,6 +58,9 @@ typedef enum
|
|||
// State updates, number of tics / second.
|
||||
#define TICRATE 35
|
||||
|
||||
// Amount of damage done by a telefrag.
|
||||
#define TELEFRAG_DAMAGE 1000000
|
||||
|
||||
// The current state of the game: whether we are
|
||||
// playing, gazing at the intermission screen,
|
||||
// the game final animation, or a demo.
|
||||
|
|
|
@ -113,7 +113,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
|
|||
(other->z < other->Sector->floorplane.ZatPoint (other->x, other->y)))
|
||||
{
|
||||
// kill it immediately
|
||||
P_DamageMobj (other, self, self, 1000000, NAME_None); // ^
|
||||
P_DamageMobj (other, self, self, TELEFRAG_DAMAGE, NAME_None);// ^
|
||||
return; // |
|
||||
} // phares
|
||||
|
||||
|
@ -122,7 +122,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
|
|||
if (!P_CheckPosition (other, other->x, other->y))
|
||||
{
|
||||
// kill it immediately
|
||||
P_DamageMobj (other, self, self, 1000000, NAME_None);
|
||||
P_DamageMobj (other, self, self, TELEFRAG_DAMAGE, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ bool AArtiTomeOfPower::Use (bool pickup)
|
|||
{ // Failed
|
||||
if (!(Owner->player->MorphStyle & MORPH_FAILNOTELEFRAG))
|
||||
{
|
||||
P_DamageMobj (Owner, NULL, NULL, 1000000, NAME_Telefrag);
|
||||
P_DamageMobj (Owner, NULL, NULL, TELEFRAG_DAMAGE, NAME_Telefrag);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -357,7 +357,7 @@ int AMaceFX4::DoSpecialDamage (AActor *target, int damage)
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
return 1000000; // Something's gonna die
|
||||
return TELEFRAG_DAMAGE; // Something's gonna die
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
@ -471,7 +471,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
|
|||
|
||||
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
|
||||
{
|
||||
P_DamageMobj (self1, NULL, NULL, 1000000, NAME_None);
|
||||
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
|
|||
|
||||
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
|
||||
{
|
||||
P_DamageMobj (self1, NULL, NULL, 1000000, NAME_None);
|
||||
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
// Don't allow this in deathmatch even with cheats enabled, because it's
|
||||
// a very very cheap kill.
|
||||
P_LineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE,
|
||||
P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), 1000000,
|
||||
P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), TELEFRAG_DAMAGE,
|
||||
NAME_MDK, NAME_BulletPuff);
|
||||
}
|
||||
break;
|
||||
|
@ -1042,7 +1042,7 @@ void cht_Suicide (player_t *plyr)
|
|||
{
|
||||
plyr->mo->flags |= MF_SHOOTABLE;
|
||||
plyr->mo->flags2 &= ~MF2_INVULNERABLE;
|
||||
P_DamageMobj (plyr->mo, plyr->mo, plyr->mo, 1000000, NAME_Suicide);
|
||||
P_DamageMobj (plyr->mo, plyr->mo, plyr->mo, TELEFRAG_DAMAGE, NAME_Suicide);
|
||||
if (plyr->mo->health <= 0) plyr->mo->flags &= ~MF_SHOOTABLE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -889,7 +889,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
|
||||
// Spectral targets only take damage from spectral projectiles.
|
||||
if (target->flags4 & MF4_SPECTRAL && damage < 1000000)
|
||||
if (target->flags4 & MF4_SPECTRAL && damage < TELEFRAG_DAMAGE)
|
||||
{
|
||||
if (inflictor == NULL || !(inflictor->flags4 & MF4_SPECTRAL))
|
||||
{
|
||||
|
@ -915,7 +915,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
return;
|
||||
}
|
||||
if ((target->flags2 & MF2_INVULNERABLE) && damage < 1000000 && !(flags & DMG_FORCED))
|
||||
if ((target->flags2 & MF2_INVULNERABLE) && damage < TELEFRAG_DAMAGE && !(flags & DMG_FORCED))
|
||||
{ // actor is invulnerable
|
||||
if (target->player == NULL)
|
||||
{
|
||||
|
@ -1103,22 +1103,17 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
|
||||
if (!(flags & DMG_FORCED))
|
||||
{
|
||||
if ((target->flags2 & MF2_INVULNERABLE) && damage < 1000000)
|
||||
if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) ||
|
||||
(target->player->cheats & CF_GODMODE)))
|
||||
{ // player is invulnerable, so don't hurt him
|
||||
return;
|
||||
}
|
||||
|
||||
if (damage < 1000 && ((target->player->cheats & CF_GODMODE)
|
||||
|| (target->player->mo->flags2 & MF2_INVULNERABLE)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// [RH] Avoid friendly fire if enabled
|
||||
if (source != NULL && player != source->player && target->IsTeammate (source))
|
||||
{
|
||||
FriendlyFire = true;
|
||||
if (damage < 1000000)
|
||||
if (damage < TELEFRAG_DAMAGE)
|
||||
{ // Still allow telefragging :-(
|
||||
damage = (int)((float)damage * level.teamdamage);
|
||||
if (damage <= 0)
|
||||
|
@ -1437,7 +1432,8 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (target->flags2&MF2_INVULNERABLE && damage < 1000000)
|
||||
if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) ||
|
||||
(player->cheats & CF_GODMODE)))
|
||||
{ // target is invulnerable
|
||||
return;
|
||||
}
|
||||
|
@ -1446,11 +1442,6 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
|||
// Take half damage in trainer mode
|
||||
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
|
||||
}
|
||||
if(damage < 1000 && ((player->cheats&CF_GODMODE)
|
||||
|| (player->mo->flags2 & MF2_INVULNERABLE)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (damage >= player->health
|
||||
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
|
||||
&& !player->morphTics)
|
||||
|
|
|
@ -1003,7 +1003,7 @@ FUNC(LS_DamageThing)
|
|||
}
|
||||
else
|
||||
{ // If zero damage, guarantee a kill
|
||||
P_DamageMobj (it, NULL, NULL, 1000000, MODtoDamageType (arg1));
|
||||
P_DamageMobj (it, NULL, NULL, TELEFRAG_DAMAGE, MODtoDamageType (arg1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1147,7 +1147,7 @@ FUNC(LS_Thing_Destroy)
|
|||
{
|
||||
AActor *temp = iterator.Next ();
|
||||
if (actor->flags & MF_SHOOTABLE)
|
||||
P_DamageMobj (actor, NULL, it, arg1 ? 1000000 : actor->health, NAME_None);
|
||||
P_DamageMobj (actor, NULL, it, arg1 ? TELEFRAG_DAMAGE : actor->health, NAME_None);
|
||||
actor = temp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
|||
// [RH] Some Heretic/Hexen monsters can telestomp
|
||||
if (StompAlwaysFrags && !(th->flags6 & MF6_NOTELEFRAG))
|
||||
{
|
||||
P_DamageMobj (th, thing, thing, 1000000, NAME_Telefrag, DMG_THRUSTLESS);
|
||||
P_DamageMobj (th, thing, thing, TELEFRAG_DAMAGE, NAME_Telefrag, DMG_THRUSTLESS);
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
|
@ -421,7 +421,7 @@ void P_PlayerStartStomp (AActor *actor)
|
|||
if (actor->z + actor->height < th->z)
|
||||
continue; // underneath
|
||||
|
||||
P_DamageMobj (th, actor, actor, 1000000, NAME_Telefrag);
|
||||
P_DamageMobj (th, actor, actor, TELEFRAG_DAMAGE, NAME_Telefrag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1098,7 +1098,7 @@ bool AActor::Massacre ()
|
|||
do
|
||||
{
|
||||
prevhealth = health;
|
||||
P_DamageMobj (this, NULL, NULL, 1000000, NAME_Massacre);
|
||||
P_DamageMobj (this, NULL, NULL, TELEFRAG_DAMAGE, NAME_Massacre);
|
||||
}
|
||||
while (health != prevhealth && health > 0); //abort if the actor wasn't hurt.
|
||||
return true;
|
||||
|
@ -2000,13 +2000,13 @@ void P_MonsterFallingDamage (AActor *mo)
|
|||
vel = abs(mo->velz);
|
||||
if (vel > 35*FRACUNIT)
|
||||
{ // automatic death
|
||||
damage = 1000000;
|
||||
damage = TELEFRAG_DAMAGE;
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = ((vel - (23*FRACUNIT))*6)>>FRACBITS;
|
||||
}
|
||||
damage = 1000000; // always kill 'em
|
||||
damage = TELEFRAG_DAMAGE; // always kill 'em
|
||||
P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling);
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ bool CheckIfExitIsGood (AActor *self, level_info_t *info)
|
|||
// Is this a deathmatch game and we're not allowed to exit?
|
||||
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
|
||||
{
|
||||
P_DamageMobj (self, self, self, 1000000, NAME_Exit);
|
||||
P_DamageMobj (self, self, self, TELEFRAG_DAMAGE, NAME_Exit);
|
||||
return false;
|
||||
}
|
||||
// Is this a singleplayer game and the next map is part of the same hub and we're dead?
|
||||
|
|
Loading…
Reference in a new issue