mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- make better use of the damageinterval value for Strife's delayed damage.
This commit is contained in:
parent
990323fb26
commit
154e106315
3 changed files with 10 additions and 6 deletions
|
@ -422,6 +422,7 @@ public:
|
|||
int killcount, itemcount, secretcount; // for intermission
|
||||
int damagecount, bonuscount;// for screen flashing
|
||||
int hazardcount; // for delayed Strife damage
|
||||
int hazardinterval; // Frequency of damage infliction
|
||||
FName hazardtype; // Damage type of last hazardous damage encounter.
|
||||
int poisoncount; // screen flash for poison damage
|
||||
FName poisontype; // type of poison damage to apply
|
||||
|
|
|
@ -453,14 +453,15 @@ void P_PlayerInSpecialSector (player_t *player, sector_t * sector)
|
|||
}
|
||||
|
||||
if (sector->Flags & SECF_ENDGODMODE) player->cheats &= ~CF_GODMODE;
|
||||
if (level.time % sector->damageinterval == 0 && (ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage))
|
||||
if ((ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage))
|
||||
{
|
||||
if (sector->Flags & SECF_HAZARD)
|
||||
{
|
||||
player->hazardcount += sector->damageamount;
|
||||
player->hazardtype = sector->damagetype;
|
||||
player->hazardinterval = sector->damageinterval;
|
||||
}
|
||||
else
|
||||
else if (level.time % sector->damageinterval == 0)
|
||||
{
|
||||
P_DamageMobj(player->mo, NULL, NULL, sector->damageamount, sector->damagetype);
|
||||
if ((sector->Flags & SECF_ENDLEVEL) && player->health <= 10 && (!deathmatch || !(dmflags & DF_NO_EXIT)))
|
||||
|
@ -1232,7 +1233,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
break;
|
||||
|
||||
case sDamage_Hellslime:
|
||||
P_SetupSectorDamage(sector, 2, 1, 0, NAME_Slime, SECF_HAZARD);
|
||||
P_SetupSectorDamage(sector, 2, 32, 0, NAME_Slime, SECF_HAZARD);
|
||||
break;
|
||||
|
||||
case Damage_InstantDeath:
|
||||
|
@ -1241,7 +1242,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
break;
|
||||
|
||||
case sDamage_SuperHellslime:
|
||||
P_SetupSectorDamage(sector, 4, 1, 0, NAME_Slime, SECF_HAZARD);
|
||||
P_SetupSectorDamage(sector, 4, 32, 0, NAME_Slime, SECF_HAZARD);
|
||||
break;
|
||||
|
||||
case Sector_Hidden:
|
||||
|
|
|
@ -363,6 +363,7 @@ player_t &player_t::operator=(const player_t &p)
|
|||
bonuscount = p.bonuscount;
|
||||
hazardcount = p.hazardcount;
|
||||
hazardtype = p.hazardtype;
|
||||
hazardinterval = p.hazardinterval;
|
||||
poisoncount = p.poisoncount;
|
||||
poisontype = p.poisontype;
|
||||
poisonpaintype = p.poisonpaintype;
|
||||
|
@ -2599,7 +2600,7 @@ void P_PlayerThink (player_t *player)
|
|||
if (player->hazardcount)
|
||||
{
|
||||
player->hazardcount--;
|
||||
if (!(level.time & 31) && player->hazardcount > 16*TICRATE)
|
||||
if (!(level.time % player->hazardinterval) && player->hazardcount > 16*TICRATE)
|
||||
P_DamageMobj (player->mo, NULL, NULL, 5, player->hazardtype);
|
||||
}
|
||||
|
||||
|
@ -3015,7 +3016,8 @@ void player_t::Serialize (FArchive &arc)
|
|||
<< oldbuttons;
|
||||
if (SaveVersion >= 4929)
|
||||
{
|
||||
arc << hazardtype;
|
||||
arc << hazardtype
|
||||
<< hazardinterval;
|
||||
}
|
||||
bool IsBot = false;
|
||||
if (SaveVersion >= 4514)
|
||||
|
|
Loading…
Reference in a new issue