From 05360e14b56fb0df34beee3cf2980f98c31aa61c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 May 2020 12:18:36 +0200 Subject: [PATCH] - game startup, include and moving formerly global variables back to global. # Conflicts: # source/games/duke/src/zz_gamedef.cpp --- source/games/duke/src/actors.cpp | 2 +- source/games/duke/src/gamedef.cpp | 54 +++++------ source/games/duke/src/global.h | 20 ++--- source/games/duke/src/player.h | 4 +- source/games/duke/src/sectors_d.cpp | 10 +-- source/games/duke/src/sectors_r.cpp | 10 +-- source/games/duke/src/zz_cheats.cpp | 18 ++-- source/games/duke/src/zz_game.cpp | 16 ++-- source/games/duke/src/zz_gamedef.cpp | 123 +------------------------- source/games/duke/src/zz_gameexec.cpp | 44 ++++----- source/games/duke/src/zz_global.cpp | 10 +-- source/games/duke/src/zz_net.cpp | 2 +- source/games/duke/src/zz_osdcmds.cpp | 4 +- source/games/duke/src/zz_player.cpp | 12 +-- source/games/duke/src/zz_premap.cpp | 18 ++-- source/games/duke/src/zz_sbar.cpp | 32 +++---- source/games/duke/src/zz_sector.cpp | 38 ++++---- 17 files changed, 141 insertions(+), 276 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 944d8f47a..ea2f810f1 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -520,7 +520,7 @@ void moveplayers(void) //Players } if (ud.god) { - s->extra = p->max_player_health; + s->extra = max_player_health; s->cstat = 257; if (!isWW2GI() && !isRR()) p->jetpack_amount = 1599; diff --git a/source/games/duke/src/gamedef.cpp b/source/games/duke/src/gamedef.cpp index 111b007c9..c255d6a6e 100644 --- a/source/games/duke/src/gamedef.cpp +++ b/source/games/duke/src/gamedef.cpp @@ -654,24 +654,7 @@ int parsecommand(int tw) // for now just run an externally parsed command. default: case -1: return 0; //End -#if 0 - case concmd_blockcomment: //Rem endrem - popscriptvalue(); - j = line_number; - do - { - textptr++; - if (*textptr == 0x0a) line_number++; - if (*textptr == 0) - { - Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Found '/*' with no '*/'.\n", fn, j, label + (labelcnt << 6)); - errorcount++; - return 0; - } - } while (*textptr != '*' || *(textptr + 1) != '/'); - textptr += 2; - return 0; -#endif + case concmd_state: if (parsing_actor == 0 && parsing_state == 0) { @@ -862,10 +845,12 @@ int parsecommand(int tw) // for now just run an externally parsed command. } return 0; } -#if 0 case concmd_include: { popscriptvalue(); + skipcomments(); + + parsebuffer.Clear(); while (isaltok(*textptr) == 0) { if (*textptr == 0x0a) line_number++; @@ -875,12 +860,12 @@ int parsecommand(int tw) // for now just run an externally parsed command. j = 0; while (isaltok(*textptr)) { - tempbuf[j] = *(textptr++); + parsebuffer.Push(*(textptr++)); j++; } - tempbuf[j] = '\0'; + parsebuffer.Push(0); - auto fn = fileSystem.FindFile(tempbuf); + auto fn = fileSystem.FindFile(parsebuffer.Data()); if (fn < 0) { errorcount++; @@ -888,9 +873,10 @@ int parsecommand(int tw) // for now just run an externally parsed command. return 0; } - auto data = fileSystem.LoadFile(tempbuf, 1); + auto data = fileSystem.GetFileData(fn, 1); temp_current_file = g_currentSourceFile; + g_currentSourceFile = fn; temp_line_number = line_number; line_number = 1; @@ -899,19 +885,22 @@ int parsecommand(int tw) // for now just run an externally parsed command. auto origtptr = textptr; textptr = (char*)data.Data(); +#if 0 do done = parsecommand(); while (done == 0); +#else // TRANSITIONAL + C_ParseCommand(1); +#endif textptr = origtptr; - total_lines += line_number; line_number = temp_line_number; checking_ifelse = temp_ifelse_check; g_currentSourceFile = temp_current_file; return 0; } -#endif + case concmd_ai: if (parsing_actor || parsing_state) transnum(); @@ -1723,12 +1712,10 @@ int parsecommand(int tw) // for now just run an externally parsed command. //case concmd_leavedroppings: //case concmd_deploybias: return 0; -#if 0 case concmd_gamestartup: { -#if 0 // cannot be activated before the old CON code is tossed. - auto parseone = []() { transnum(); popscriptvalue(); return *scriptptr; } - ud_const_visibility = parseone(); + auto parseone = []() { transnum(); return popscriptvalue(); }; + ud.const_visibility = parseone(); impact_damage = parseone(); max_player_health = parseone(); max_armour_amount = parseone(); @@ -1736,13 +1723,14 @@ int parsecommand(int tw) // for now just run an externally parsed command. respawnitemtime = parseone(); dukefriction = parseone(); gc = parseone(); - pgblastradius = parseone(); - ipebombblastradius = parseone(); + rpgblastradius = parseone(); + pipebombblastradius = parseone(); shrinkerblastradius = parseone(); tripbombblastradius = parseone(); morterblastradius = parseone(); bouncemineblastradius = parseone(); seenineblastradius = parseone(); + max_ammo_amount[1] = parseone(); max_ammo_amount[2] = parseone(); max_ammo_amount[3] = parseone(); @@ -1752,7 +1740,7 @@ int parsecommand(int tw) // for now just run an externally parsed command. max_ammo_amount[7] = parseone(); max_ammo_amount[8] = parseone(); max_ammo_amount[9] = parseone(); - max_ammo_amount[11] = parseone(); + max_ammo_amount[11] = parseone(); if (isRR()) max_ammo_amount[12] = parseone(); camerashitable = parseone(); numfreezebounces = parseone(); @@ -1766,10 +1754,8 @@ int parsecommand(int tw) // for now just run an externally parsed command. max_ammo_amount[16] = parseone(); } scriptptr++; -#endif } return 0; -#endif } return 0; } diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index 717078a9d..dd0c2af0f 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -125,8 +125,7 @@ G_EXTERN int32_t g_freezerSelfDamage; G_EXTERN int32_t g_gameQuit; G_EXTERN int32_t g_globalRandom; #define global_random g_globalRandom -G_EXTERN int32_t g_impactDamage; -#define impact_damage g_impactDamage +G_EXTERN int32_t impact_damage; extern int32_t labelcnt; G_EXTERN int32_t g_maxPlayerHealth; G_EXTERN int32_t g_mirrorCount; @@ -136,8 +135,9 @@ G_EXTERN int32_t g_playerSpawnCnt; G_EXTERN int32_t g_scriptDebug; G_EXTERN int32_t g_showShareware; G_EXTERN int32_t g_spriteDeleteQueuePos; -G_EXTERN int32_t g_startArmorAmount; -G_EXTERN int32_t g_tripbombLaserMode; +G_EXTERN int32_t max_player_health; +G_EXTERN int32_t max_armour_amount; +G_EXTERN int32_t lasermode; G_EXTERN int32_t screenpeek; G_EXTERN int16_t g_animateSect[MAXANIMATES]; @@ -255,21 +255,19 @@ extern float g_gameUpdateAvgTime; extern char CheatKeys[2]; extern char g_gametypeNames[MAXGAMETYPES][33]; -extern int32_t g_actorRespawnTime; +extern int32_t respawnactortime; extern int32_t g_bouncemineRadius; #define bouncemineblastradius g_bouncemineRadius extern int32_t g_deleteQueueSize; extern int32_t g_gametypeCnt; -extern int32_t g_itemRespawnTime; -#define respawnitemtime g_itemRespawnTime +extern int32_t respawnitemtime; extern int32_t g_morterRadius; #define morterblastradius g_morterRadius -extern int32_t g_numFreezeBounces; +extern int32_t numfreezebounces; extern int32_t g_pipebombRadius; #define pipebombblastradius g_pipebombRadius -extern int32_t g_playerFriction; -extern int32_t g_rpgRadius; -#define rpgblastradius g_rpgRadius +extern int32_t dukefriction; +extern int32_t rpgblastradius; extern int32_t g_scriptSize; extern int32_t g_seenineRadius; #define seenineblastradius g_seenineRadius diff --git a/source/games/duke/src/player.h b/source/games/duke/src/player.h index f32c40078..004154984 100644 --- a/source/games/duke/src/player.h +++ b/source/games/duke/src/player.h @@ -182,7 +182,7 @@ typedef struct player_struct { int32_t truefz, truecz, player_par; int32_t randomflamex, exitx, exity; - int32_t runspeed, max_player_health, max_shield_amount; + int32_t runspeed; int32_t autostep, autostep_sbw; uint32_t interface_toggle_flag; @@ -193,7 +193,7 @@ typedef struct player_struct { int16_t loogiex[64], loogiey[64], sbs, sound_pitch; int16_t cursectnum, look_ang, last_extra, subweapon; - int16_t max_ammo_amount[MAX_WEAPONS], ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX]; + int16_t ammo_amount[MAX_WEAPONS], inv_amount[GET_MAX]; int16_t wackedbyactor, pyoff, opyoff; int16_t newowner, jumping_counter, airleft; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 167233caf..cbe3e173c 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -1653,13 +1653,13 @@ void checksectors_d(int snum) p->holster_weapon = 1; p->weapon_pos = -1; } - if (sprite[p->i].extra <= (p->max_player_health - (p->max_player_health / 10))) + if (sprite[p->i].extra <= (max_player_health - (max_player_health / 10))) { - sprite[p->i].extra += p->max_player_health / 10; + sprite[p->i].extra += max_player_health / 10; p->last_extra = sprite[p->i].extra; } - else if (sprite[p->i].extra < p->max_player_health) - sprite[p->i].extra = p->max_player_health; + else if (sprite[p->i].extra < max_player_health) + sprite[p->i].extra = max_player_health; } else if (S_CheckSoundPlaying(FLUSH_TOILET) == 0) spritesound(FLUSH_TOILET, p->i); @@ -1685,7 +1685,7 @@ void checksectors_d(int snum) hittype[neartagsprite].temp_data[0] = 1; sprite[neartagsprite].owner = p->i; - if (sprite[p->i].extra < p->max_player_health) + if (sprite[p->i].extra < max_player_health) { sprite[p->i].extra++; spritesound(DUKE_DRINKING, p->i); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index e1a1d3b35..23b032dc0 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -2647,13 +2647,13 @@ void checksectors_r(int snum) p->holster_weapon = 1; p->weapon_pos = -1; } - if (sprite[p->i].extra <= (p->max_player_health - (p->max_player_health / 10))) + if (sprite[p->i].extra <= (max_player_health - (max_player_health / 10))) { - sprite[p->i].extra += p->max_player_health / 10; + sprite[p->i].extra += max_player_health / 10; p->last_extra = sprite[p->i].extra; } - else if (sprite[p->i].extra < p->max_player_health) - sprite[p->i].extra = p->max_player_health; + else if (sprite[p->i].extra < max_player_health) + sprite[p->i].extra = max_player_health; } else if (A_CheckSoundPlaying(p->i, DUKE_GRUNT) == 0) spritesound(DUKE_GRUNT, p->i); @@ -2664,7 +2664,7 @@ void checksectors_r(int snum) hittype[neartagsprite].temp_data[0] = 1; sprite[neartagsprite].owner = p->i; - if (sprite[p->i].extra < p->max_player_health) + if (sprite[p->i].extra < max_player_health) { sprite[p->i].extra++; spritesound(DUKE_DRINKING, p->i); diff --git a/source/games/duke/src/zz_cheats.cpp b/source/games/duke/src/zz_cheats.cpp index fd901fbc2..f4d47885e 100644 --- a/source/games/duke/src/zz_cheats.cpp +++ b/source/games/duke/src/zz_cheats.cpp @@ -269,7 +269,7 @@ static void G_CheatGetInv(DukePlayer_t *pPlayer) doinvcheat(pPlayer, GET_SCUBA, 6400, EVENT_CHEATGETSCUBA); doinvcheat(pPlayer, GET_HOLODUKE, 2400, EVENT_CHEATGETHOLODUKE); doinvcheat(pPlayer, GET_JETPACK, RR ? 600 : 1600, EVENT_CHEATGETJETPACK); - doinvcheat(pPlayer, GET_FIRSTAID, pPlayer->max_player_health, EVENT_CHEATGETFIRSTAID); + doinvcheat(pPlayer, GET_FIRSTAID, max_player_health, EVENT_CHEATGETFIRSTAID); } static void end_cheat(DukePlayer_t * const pPlayer) @@ -432,7 +432,7 @@ void G_DoCheats(void) for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++) { - P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); + P_AddAmmo(pPlayer, weaponNum, max_ammo_amount[weaponNum]); pPlayer->gotweapon.Set(weaponNum); } @@ -540,20 +540,20 @@ void G_DoCheats(void) // pPlayer->gotweapon |= (1<max_ammo_amount[weaponNum]); + // P_AddAmmo(pPlayer, weaponNum, max_ammo_amount[weaponNum]); // // pPlayer->got_access = 7; //} } else { - sprite[pi].extra = pPlayer->max_player_health; + sprite[pi].extra = max_player_health; actor[pi].extra = -1; - pPlayer->last_extra = pPlayer->max_player_health; + pPlayer->last_extra = max_player_health; P_DoQuote(QUOTE_CHEAT_GODMODE_OFF, pPlayer); } - sprite[pi].extra = pPlayer->max_player_health; + sprite[pi].extra = max_player_health; actor[pi].extra = 0; //if (cheatNum != CHEAT_COMEGETSOME) @@ -571,7 +571,7 @@ void G_DoCheats(void) pPlayer->gotweapon.Set(weaponNum); for (bssize_t weaponNum = PISTOL_WEAPON; weaponNum < weaponLimit; weaponNum++) - P_AddAmmo(pPlayer, weaponNum, pPlayer->max_ammo_amount[weaponNum]); + P_AddAmmo(pPlayer, weaponNum, max_ammo_amount[weaponNum]); if (RRRA) pPlayer->ammo_amount[SLINGBLADE_WEAPON] = 1; @@ -760,7 +760,7 @@ void G_DoCheats(void) case CHEAT_RAJOSEPH: OnMotorcycle(pPlayer, 0); - pPlayer->ammo_amount[MOTORCYCLE_WEAPON] = pPlayer->max_ammo_amount[MOTORCYCLE_WEAPON]; + pPlayer->ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON]; P_DoQuote(126, pPlayer); end_cheat(pPlayer); inputState.keyFlushChars(); @@ -885,7 +885,7 @@ void G_DoCheats(void) case CHEAT_RAARIJIT: case CHEAT_RADONUT: OnBoat(pPlayer, 0); - pPlayer->ammo_amount[BOAT_WEAPON] = pPlayer->max_ammo_amount[BOAT_WEAPON]; + pPlayer->ammo_amount[BOAT_WEAPON] = max_ammo_amount[BOAT_WEAPON]; P_DoQuote(136, pPlayer); end_cheat(pPlayer); inputState.keyFlushChars(); diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index ffe44531b..46e03b91b 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -1501,7 +1501,7 @@ int A_Spawn(int spriteNum, int tileNum) { changespritestat(newSprite, STAT_FALLER); pSprite->cstat |= 257; - pSprite->extra = g_impactDamage; + pSprite->extra = impact_damage; goto SPAWN_END; } } @@ -1908,9 +1908,9 @@ default_case: pSprite->yrepeat = 6; pSprite->xrepeat = 32; - if (g_tripbombLaserMode == 1) + if (lasermode == 1) pSprite->cstat = 16 + 2; - else if (g_tripbombLaserMode == 0 || g_tripbombLaserMode == 2) + else if (lasermode == 0 || lasermode == 2) pSprite->cstat = 16; else { @@ -3228,7 +3228,7 @@ rr_badguy: case REACTOR2__STATIC: case REACTOR__STATIC: - pSprite->extra = g_impactDamage; + pSprite->extra = impact_damage; pSprite->cstat |= 257; if ((!g_netServer && ud.multimode < 2) && pSprite->pal != 0) { @@ -3535,7 +3535,7 @@ rr_badguy: pSprite->cstat |= 1+256; //Make it hitable pSprite->xrepeat = pSprite->yrepeat = 24; pSprite->shade = -127; - pSprite->extra = g_impactDamage<<2; + pSprite->extra = impact_damage<<2; changespritestat(newSprite, STAT_ZOMBIEACTOR); break; case CAMERA1__STATIC: @@ -4200,7 +4200,7 @@ rr_badguy: } else pSprite->cstat = 1+256; - pSprite->extra = g_impactDamage << 2; + pSprite->extra = impact_damage << 2; pSprite->owner = newSprite; changespritestat(newSprite, STAT_STANDABLE); @@ -4215,7 +4215,7 @@ rr_badguy: if (!RR && pSprite->picnum == TILE_FIREEXT) { pSprite->cstat = 257; - pSprite->extra = g_impactDamage<<2; + pSprite->extra = impact_damage<<2; } else { @@ -5447,7 +5447,7 @@ skip: if (RR) break; if (sector[t->sectnum].lotag == ST_2_UNDERWATER) t->pal = 8; t->z = sprite[pSprite->owner].z-(3<<8); - if (g_tripbombLaserMode == 2 && g_player[screenpeek].ps->heat_on == 0) + if (lasermode == 2 && g_player[screenpeek].ps->heat_on == 0) t->yrepeat = 0; fallthrough__; case EXPLOSION2BOT__STATIC: diff --git a/source/games/duke/src/zz_gamedef.cpp b/source/games/duke/src/zz_gamedef.cpp index b9239e447..f8acc5f1b 100644 --- a/source/games/duke/src/zz_gamedef.cpp +++ b/source/games/duke/src/zz_gamedef.cpp @@ -722,77 +722,6 @@ static void C_Include(const char *confile) Xfree(mptr); } -void G_DoGameStartup(const int32_t *params) -{ - int j = 0; - - ud.const_visibility = params[j++]; - g_impactDamage = params[j++]; - g_player[0].ps->max_shield_amount = params[j++]; - g_player[0].ps->max_player_health = g_player[0].ps->max_shield_amount; - g_maxPlayerHealth = g_player[0].ps->max_player_health; - g_startArmorAmount = params[j++]; - g_actorRespawnTime = params[j++]; - g_itemRespawnTime = params[j++]; - g_playerFriction = params[j++]; - g_spriteGravity = params[j++]; - g_rpgRadius = params[j++]; - g_pipebombRadius = params[j++]; - g_shrinkerRadius = params[j++]; - g_tripbombRadius = params[j++]; - g_morterRadius = params[j++]; - g_bouncemineRadius = params[j++]; - g_seenineRadius = params[j++]; - - max_ammo_amount[1] = g_player[0].ps->max_ammo_amount[1] = params[j++]; - max_ammo_amount[2] = g_player[0].ps->max_ammo_amount[2] = params[j++]; - max_ammo_amount[3] = g_player[0].ps->max_ammo_amount[3] = params[j++]; - max_ammo_amount[4] = g_player[0].ps->max_ammo_amount[4] = params[j++]; - max_ammo_amount[5] = g_player[0].ps->max_ammo_amount[5] = params[j++]; - max_ammo_amount[6] = g_player[0].ps->max_ammo_amount[6] = params[j++]; - max_ammo_amount[7] = g_player[0].ps->max_ammo_amount[7] = params[j++]; - max_ammo_amount[8] = g_player[0].ps->max_ammo_amount[8] = params[j++]; - max_ammo_amount[9] = g_player[0].ps->max_ammo_amount[9] = params[j++]; - max_ammo_amount[11] = g_player[0].ps->max_ammo_amount[11] = params[j++]; - - if (RR) - max_ammo_amount[12] = g_player[0].ps->max_ammo_amount[12] = params[j++]; - - g_damageCameras = params[j++]; - g_numFreezeBounces = params[j++]; - g_freezerSelfDamage = params[j++]; - g_deleteQueueSize = clamp(params[j++], 0, 1024); - g_tripbombLaserMode = params[j++]; - - if (RRRA) - { - max_ammo_amount[13] = g_player[0].ps->max_ammo_amount[13] = params[j++]; - max_ammo_amount[14] = g_player[0].ps->max_ammo_amount[14] = params[j++]; - max_ammo_amount[16] = g_player[0].ps->max_ammo_amount[16] = params[j++]; - } -} - -void C_DefineMusic(int volumeNum, int levelNum, const char *fileName) -{ - Bassert((unsigned)volumeNum < MAXVOLUMES+1); - Bassert((unsigned)levelNum < MAXLEVELS); - - mapList[(MAXLEVELS*volumeNum)+levelNum].music = fileName; -} - -void C_DefineVolumeFlags(int32_t vol, int32_t flags) -{ - Bassert((unsigned)vol < MAXVOLUMES); - - gVolumeFlags[vol] = flags; -} - -int32_t C_AllocQuote(int32_t qnum) -{ - Bassert((unsigned)qnum < MAXQUOTES); - return 1; -} - void C_InitQuotes(void) { #if 0 // if we want to keep this it must be done differently. This does not play nice with text substitution. @@ -963,6 +892,7 @@ int32_t C_ParseCommand(int32_t loop) case concmd_definequote: case concmd_definesound: case concmd_enda: + case concmd_include: case concmd_break: case concmd_fall: case concmd_tip: @@ -996,6 +926,7 @@ int32_t C_ParseCommand(int32_t loop) case concmd_garybanjo: case concmd_motoloopsnd: case concmd_rndmove: + case concmd_gamestartup: if (parsecommand(g_lastKeyword)) return 1; continue; @@ -1053,26 +984,6 @@ int32_t C_ParseCommand(int32_t loop) continue; } - case concmd_include: - scriptptr--; - - C_SkipComments(); - while (isaltok(*textptr) == 0) - { - textptr++; - if (*textptr == 0) break; - } - - j = 0; - while (isaltok(*textptr)) - { - tempbuf[j] = *(textptr++); - j++; - } - tempbuf[j] = '\0'; - - C_Include(tempbuf); - continue; case concmd_onevent: @@ -1272,39 +1183,9 @@ ifvar: Bsprintf(g_szCurrentBlockName,"(none)"); continue; - case concmd_gamestartup: - { - int32_t params[34]; - scriptptr--; - for (j = 0; j < 34; j++) - { - C_GetNextValue(LABEL_DEFINE); - scriptptr--; - params[j] = *scriptptr; - - if (j != 29 && j != 30) continue; - - if (C_GetKeyword() != -1) - { - /*if (j == 12) - g_scriptVersion = 10; - else if (j == 21) - g_scriptVersion = 11; - else if (j == 25) - g_scriptVersion = 13; - else if (j == 29) - g_scriptVersion = 14;*/ - break; } - /*else - g_scriptVersion = 16;*/ } - G_DoGameStartup(params); - } - continue; - } - } while (loop); return 0; diff --git a/source/games/duke/src/zz_gameexec.cpp b/source/games/duke/src/zz_gameexec.cpp index 1a8edb0ee..cefefc6d7 100644 --- a/source/games/duke/src/zz_gameexec.cpp +++ b/source/games/duke/src/zz_gameexec.cpp @@ -854,7 +854,7 @@ static void VM_AddWeapon(DukePlayer_t * const pPlayer, int const weaponNum, int { P_AddWeapon(pPlayer, weaponNum); } - else if (pPlayer->ammo_amount[weaponNum] >= pPlayer->max_ammo_amount[weaponNum]) + else if (pPlayer->ammo_amount[weaponNum] >= max_ammo_amount[weaponNum]) { vm.flags |= VM_NOEXECUTE; return; @@ -874,7 +874,7 @@ static void VM_AddAmmo(DukePlayer_t * const pPlayer, int const weaponNum, int co return; } - if (pPlayer->ammo_amount[weaponNum] >= pPlayer->max_ammo_amount[weaponNum]) + if (pPlayer->ammo_amount[weaponNum] >= max_ammo_amount[weaponNum]) { vm.flags |= VM_NOEXECUTE; return; @@ -904,7 +904,7 @@ static void VM_AddInventory(DukePlayer_t * const pPlayer, int const itemNum, int case GET_SHIELD: { int16_t & shield_amount = pPlayer->inv_amount[GET_SHIELD]; - shield_amount = min(shield_amount + nAmount, pPlayer->max_shield_amount); + shield_amount = min(shield_amount + nAmount, max_player_health); break; } @@ -1893,8 +1893,8 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) if (newHealth > 0) newHealth += *insptr; - if (newHealth > (pPlayer->max_player_health << 1)) - newHealth = (pPlayer->max_player_health << 1); + if (newHealth > (max_player_health << 1)) + newHealth = (max_player_health << 1); if (newHealth < 0) newHealth = 0; @@ -1902,7 +1902,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) { if (*insptr > 0) { - if ((newHealth - *insptr) < (pPlayer->max_player_health >> 2) && newHealth >= (pPlayer->max_player_health >> 2)) + if ((newHealth - *insptr) < (max_player_health >> 2) && newHealth >= (max_player_health >> 2)) A_PlaySound(DUKE_GOTHEALTHATLOW, pPlayer->i); pPlayer->last_extra = newHealth; } @@ -1912,10 +1912,10 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) if (pPlayer->drink_amt > 100) pPlayer->drink_amt = 100; - if (sprite[pPlayer->i].extra >= pPlayer->max_player_health) + if (sprite[pPlayer->i].extra >= max_player_health) { - sprite[pPlayer->i].extra = pPlayer->max_player_health; - pPlayer->last_extra = pPlayer->max_player_health; + sprite[pPlayer->i].extra = max_player_health; + pPlayer->last_extra = max_player_health; } } insptr++; @@ -2058,7 +2058,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) if (vm.pSprite->picnum != TILE_ATOMICHEALTH) { - if (newHealth > pPlayer->max_player_health && *insptr > 0) + if (newHealth > max_player_health && *insptr > 0) { insptr++; continue; @@ -2067,16 +2067,16 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) { if (newHealth > 0) newHealth += (*insptr)*3; - if (newHealth > pPlayer->max_player_health && *insptr > 0) - newHealth = pPlayer->max_player_health; + if (newHealth > max_player_health && *insptr > 0) + newHealth = max_player_health; } } else { if (newHealth > 0) newHealth += *insptr; - if (newHealth > (pPlayer->max_player_health << 1)) - newHealth = (pPlayer->max_player_health << 1); + if (newHealth > (max_player_health << 1)) + newHealth = (max_player_health << 1); } if (newHealth < 0) @@ -2086,7 +2086,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) { if (*insptr > 0) { - if ((newHealth - *insptr) < (pPlayer->max_player_health >> 2) && newHealth >= (pPlayer->max_player_health >> 2)) + if ((newHealth - *insptr) < (max_player_health >> 2) && newHealth >= (max_player_health >> 2)) A_PlaySound(DUKE_GOTHEALTHATLOW, pPlayer->i); pPlayer->last_extra = newHealth; } @@ -2109,7 +2109,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) if (vm.pSprite->picnum != TILE_ATOMICHEALTH) { - if (newHealth > pPlayer->max_player_health && *insptr > 0) + if (newHealth > max_player_health && *insptr > 0) { insptr++; continue; @@ -2118,16 +2118,16 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) { if (newHealth > 0) newHealth += *insptr; - if (newHealth > pPlayer->max_player_health && *insptr > 0) - newHealth = pPlayer->max_player_health; + if (newHealth > max_player_health && *insptr > 0) + newHealth = max_player_health; } } else { if (newHealth > 0) newHealth += *insptr; - if (newHealth > (pPlayer->max_player_health << 1)) - newHealth = (pPlayer->max_player_health << 1); + if (newHealth > (max_player_health << 1)) + newHealth = (max_player_health << 1); } if (newHealth < 0) @@ -2137,7 +2137,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) { if (*insptr > 0) { - if ((newHealth - *insptr) < (pPlayer->max_player_health >> 2) && newHealth >= (pPlayer->max_player_health >> 2)) + if ((newHealth - *insptr) < (max_player_health >> 2) && newHealth >= (max_player_health >> 2)) A_PlaySound(DUKE_GOTHEALTHATLOW, pPlayer->i); pPlayer->last_extra = newHealth; } @@ -2520,7 +2520,7 @@ GAMEEXEC_STATIC void VM_Execute(native_t loop) case GET_JETPACK: tw = (pPlayer->inv_amount[*(insptr - 1)] != *insptr); break; case GET_SHIELD: - tw = (pPlayer->inv_amount[GET_SHIELD] != pPlayer->max_player_health); break; + tw = (pPlayer->inv_amount[GET_SHIELD] != max_player_health); break; case GET_ACCESS: if (RR) { diff --git a/source/games/duke/src/zz_global.cpp b/source/games/duke/src/zz_global.cpp index b3a6b93cc..1bd6b2556 100644 --- a/source/games/duke/src/zz_global.cpp +++ b/source/games/duke/src/zz_global.cpp @@ -80,18 +80,18 @@ int32_t g_gametypeFlags[MAXGAMETYPES] = float g_gameUpdateAvgTime = -1.f; -int32_t g_actorRespawnTime = 768; +int32_t respawnactortime = 768; int32_t g_bouncemineRadius = 2500; int32_t g_deleteQueueSize = 64; -int32_t g_itemRespawnTime = 768; +int32_t respawnitemtime = 768; int32_t g_morterRadius = 2500; -int32_t g_numFreezeBounces = 3; +int32_t numfreezebounces = 3; int32_t g_gametypeCnt = 5; int32_t g_volumeCnt = 3; int32_t g_pipebombRadius = 2500; -int32_t g_playerFriction = 0xCFD0; -int32_t g_rpgRadius = 1780; +int32_t dukefriction = 0xCFD0; +int32_t rpgblastradius = 1780; int32_t g_scriptSize = 1048576; int32_t g_seenineRadius = 2048; int32_t g_shrinkerRadius = 650; diff --git a/source/games/duke/src/zz_net.cpp b/source/games/duke/src/zz_net.cpp index b39065637..8f7148dde 100644 --- a/source/games/duke/src/zz_net.cpp +++ b/source/games/duke/src/zz_net.cpp @@ -2708,7 +2708,7 @@ void Net_ParseClientPacket(ENetEvent *event) // g_player[other].ps->i = j; // changespritestat(j, STAT_PLAYER); // - // g_player[other].ps->last_extra = sprite[g_player[other].ps->i].extra = g_player[other].ps->max_player_health; + // g_player[other].ps->last_extra = sprite[g_player[other].ps->i].extra = max_player_health; // sprite[g_player[other].ps->i].cstat = 1+256; // actor[g_player[other].ps->i].t_data[2] = actor[g_player[other].ps->i].t_data[3] = actor[g_player[other].ps->i].t_data[4] = 0; // diff --git a/source/games/duke/src/zz_osdcmds.cpp b/source/games/duke/src/zz_osdcmds.cpp index d81e03633..388ba7d57 100644 --- a/source/games/duke/src/zz_osdcmds.cpp +++ b/source/games/duke/src/zz_osdcmds.cpp @@ -339,7 +339,7 @@ static int osdcmd_give(CCmdFuncPtr parm) } else if (!Bstrcasecmp(parm->parms[0], "health")) { - sprite[g_player[myconnectindex].ps->i].extra = g_player[myconnectindex].ps->max_player_health<<1; + sprite[g_player[myconnectindex].ps->i].extra = max_player_health<<1; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "weapons")) @@ -350,7 +350,7 @@ static int osdcmd_give(CCmdFuncPtr parm) else if (!Bstrcasecmp(parm->parms[0], "ammo")) { for (i=MAX_WEAPONS-(VOLUMEONE?6:1)-1; i>=PISTOL_WEAPON; i--) - P_AddAmmo(g_player[myconnectindex].ps,i,g_player[myconnectindex].ps->max_ammo_amount[i]); + P_AddAmmo(g_player[myconnectindex].ps,i, max_ammo_amount[i]); return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "armor")) diff --git a/source/games/duke/src/zz_player.cpp b/source/games/duke/src/zz_player.cpp index 9f6ba5191..9ec22c32c 100644 --- a/source/games/duke/src/zz_player.cpp +++ b/source/games/duke/src/zz_player.cpp @@ -665,7 +665,7 @@ growspark_rr: } if (pPlayer != NULL && pPlayer->inv_amount[GET_STEROIDS] > 0 && pPlayer->inv_amount[GET_STEROIDS] < 400) - sprite[kneeSprite].extra += (pPlayer->max_player_health>>2); + sprite[kneeSprite].extra += (max_player_health>>2); if (hitData.sprite >= 0 && sprite[hitData.sprite].picnum != TILE_ACCESSSWITCH && sprite[hitData.sprite].picnum != TILE_ACCESSSWITCH2) { @@ -1173,7 +1173,7 @@ growspark_rr: pReturn->yvel = (playerNum >= 0 && otherSprite >= 0) ? otherSprite : -1; // RPG_YVEL else { - pReturn->yvel = g_numFreezeBounces; + pReturn->yvel = numfreezebounces; pReturn->xrepeat >>= 1; pReturn->yrepeat >>= 1; pReturn->zvel -= (2 << 4); @@ -4485,7 +4485,7 @@ static int32_t P_DoCounters(int playerNum) else { pPlayer->extra_extra8 += 32; - if (pPlayer->last_extra < (pPlayer->max_player_health >> 1) && (pPlayer->last_extra & 3) == 0) + if (pPlayer->last_extra < (max_player_health >> 1) && (pPlayer->last_extra & 3) == 0) A_PlaySound(DUKE_LONGTERM_PAIN, pPlayer->i); } } @@ -4679,8 +4679,8 @@ void P_AddAmmo(DukePlayer_t * const pPlayer, int const weaponNum, int const addA { pPlayer->ammo_amount[weaponNum] += addAmount; - if (pPlayer->ammo_amount[weaponNum] > pPlayer->max_ammo_amount[weaponNum]) - pPlayer->ammo_amount[weaponNum] = pPlayer->max_ammo_amount[weaponNum]; + if (pPlayer->ammo_amount[weaponNum] > max_ammo_amount[weaponNum]) + pPlayer->ammo_amount[weaponNum] = max_ammo_amount[weaponNum]; } void addweapon(player_struct* p, int w); @@ -8450,7 +8450,7 @@ HORIZONLY:; sprite[spriteNum].pal = 0; pPlayer->drug_mode = 5; pPlayer->drug_timer = (int32_t) totalclock; - sprite[pPlayer->i].extra = pPlayer->max_player_health; + sprite[pPlayer->i].extra = max_player_health; } } } diff --git a/source/games/duke/src/zz_premap.cpp b/source/games/duke/src/zz_premap.cpp index 6be15d7ca..372929a76 100644 --- a/source/games/duke/src/zz_premap.cpp +++ b/source/games/duke/src/zz_premap.cpp @@ -803,7 +803,7 @@ void P_ResetPlayer(int playerNum) pSprite->xoffset = 0; pSprite->pal = pPlayer->palookup; - pPlayer->last_extra = pSprite->extra = pPlayer->max_player_health; + pPlayer->last_extra = pSprite->extra = max_player_health; pPlayer->wantweaponfire = -1; pPlayer->q16horiz = F16(100); @@ -812,7 +812,7 @@ void P_ResetPlayer(int playerNum) pPlayer->q16horizoff = 0; pPlayer->opyoff = 0; pPlayer->wackedbyactor = -1; - pPlayer->inv_amount[GET_SHIELD] = g_startArmorAmount; + pPlayer->inv_amount[GET_SHIELD] = max_armour_amount; pPlayer->dead_flag = 0; pPlayer->footprintcount = 0; pPlayer->weapreccnt = 0; @@ -820,7 +820,7 @@ void P_ResetPlayer(int playerNum) pPlayer->ftq = 0; pPlayer->vel.x = pPlayer->vel.y = 0; if (!RR) pPlayer->rotscrnang = 0; - pPlayer->runspeed = g_playerFriction; + pPlayer->runspeed = dukefriction; pPlayer->falling_counter = 0; P_ResetTintFade(pPlayer); @@ -1038,7 +1038,7 @@ void P_ResetWeapons(int playerNum) pPlayer->gotweapon.Set(PISTOL_WEAPON); pPlayer->gotweapon.Set(KNEE_WEAPON); pPlayer->gotweapon.Set(HANDREMOTE_WEAPON); - pPlayer->ammo_amount[PISTOL_WEAPON] = min(pPlayer->max_ammo_amount[PISTOL_WEAPON], 48); + pPlayer->ammo_amount[PISTOL_WEAPON] = min(max_ammo_amount[PISTOL_WEAPON], 48); if (RRRA) { g_chickenWeaponTimer = 0; @@ -1070,7 +1070,7 @@ void P_ResetInventory(int playerNum) pPlayer->jetpack_on = 0; pPlayer->holoduke_on = -1; pPlayer->inven_icon = ICON_NONE; - pPlayer->inv_amount[GET_SHIELD] = g_startArmorAmount; + pPlayer->inv_amount[GET_SHIELD] = max_armour_amount; if (RR) { @@ -1952,7 +1952,7 @@ end_vol4a: { pPlayer->curr_weapon = weaponNum; pPlayer->gotweapon.Set(weaponNum); - pPlayer->ammo_amount[weaponNum] = min(pPlayer->max_ammo_amount[weaponNum], 48); + pPlayer->ammo_amount[weaponNum] = min(max_ammo_amount[weaponNum], 48); } else if (worksLike == KNEE_WEAPON || (!RR && worksLike == HANDREMOTE_WEAPON) || (RRRA && worksLike == SLINGBLADE_WEAPON)) { @@ -2062,9 +2062,9 @@ static void resetpspritevars(char gameMode) { if ((gameMode&MODE_EOL) != MODE_EOL || g_player[j].ps->last_extra == 0) { - g_player[j].ps->last_extra = g_player[j].ps->max_player_health; - s->extra = g_player[j].ps->max_player_health; - g_player[j].ps->runspeed = g_playerFriction; + g_player[j].ps->last_extra = max_player_health; + s->extra = max_player_health; + g_player[j].ps->runspeed = dukefriction; } else s->extra = g_player[j].ps->last_extra; diff --git a/source/games/duke/src/zz_sbar.cpp b/source/games/duke/src/zz_sbar.cpp index bca33aec5..a8f5fdc8a 100644 --- a/source/games/duke/src/zz_sbar.cpp +++ b/source/games/duke/src/zz_sbar.cpp @@ -328,10 +328,10 @@ public: DrawGraphic(tileGetTexture(TILE_COLA), 2, -2, DI_ITEM_LEFT_BOTTOM, 1., -1, -1, 0.75, 0.75); FString format; - if (!althud_flashing || p->last_extra > (p->max_player_health >> 2) || ((int32_t)totalclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2)) + if (!althud_flashing || p->last_extra > (max_player_health >> 2) || ((int32_t)totalclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2)) { int s = -8; - if (althud_flashing && p->last_extra > p->max_player_health) + if (althud_flashing && p->last_extra > max_player_health) s += (sintable[((int)totalclock << 5) & 2047] >> 10); int intens = clamp(255 - 4 * s, 0, 255); auto pe = PalEntry(255, intens, intens, intens); @@ -362,7 +362,7 @@ public: int weapon = p->curr_weapon; if (weapon == HANDREMOTE_WEAPON) weapon = HANDBOMB_WEAPON; - if (p->curr_weapon != KNEE_WEAPON && (!althud_flashing || (int32_t)totalclock & 32 || p->ammo_amount[weapon] > (p->max_ammo_amount[weapon] / 10))) + if (p->curr_weapon != KNEE_WEAPON && (!althud_flashing || (int32_t)totalclock & 32 || p->ammo_amount[weapon] > (max_ammo_amount[weapon] / 10))) { format.Format("%d", p->ammo_amount[weapon]); SBar_DrawString(this, &numberFont, format, -22, -numberFont.mFont->GetHeight() - 0.5, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, 1, 1); @@ -460,10 +460,10 @@ public: DrawGraphic(tileGetTexture(TILE_SPINNINGNUKEICON+1), 2, -2, DI_ITEM_LEFT_BOTTOM, 1, 0, 0, 10000. / 65536., 10000. / 65536.); FString format; - if (!althud_flashing || p->last_extra > (p->max_player_health >> 2) || ((int32_t)totalclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2)) + if (!althud_flashing || p->last_extra > (max_player_health >> 2) || ((int32_t)totalclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2)) { int s = -8; - if (althud_flashing && p->last_extra > p->max_player_health) + if (althud_flashing && p->last_extra > max_player_health) s += (sintable[((int)totalclock << 5) & 2047] >> 10); int intens = clamp(255 - 4 * s, 0, 255); auto pe = PalEntry(255, intens, intens, intens); @@ -499,7 +499,7 @@ public: int weapon = p->curr_weapon; if (weapon == HANDREMOTE_WEAPON) weapon = DYNAMITE_WEAPON; - if (p->curr_weapon != KNEE_WEAPON && p->curr_weapon != SLINGBLADE_WEAPON && (!althud_flashing || (int32_t)totalclock & 32 || p->ammo_amount[weapon] > (p->max_ammo_amount[weapon] / 10))) + if (p->curr_weapon != KNEE_WEAPON && p->curr_weapon != SLINGBLADE_WEAPON && (!althud_flashing || (int32_t)totalclock & 32 || p->ammo_amount[weapon] > (max_ammo_amount[weapon] / 10))) { format.Format("%d", p->ammo_amount[weapon]); SBar_DrawString(this, &numberFont, format, -20, -numberFont.mFont->GetHeight() * scale - 0.5, DI_TEXT_ALIGN_CENTER, CR_UNTRANSLATED, 1, 0, 0, scale, scale); @@ -693,18 +693,18 @@ public: return (((!p->ammo_amount[weapon]) | (!p->gotweapon[weapon])) * 9) + 12 - 18 * ((cw == weapon) || (optweapon != -1 && cw == optweapon)); }; - DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], p->max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3); - DrawWeaponNum(3, x, y + 6, p->ammo_amount[SHOTGUN_WEAPON], p->max_ammo_amount[SHOTGUN_WEAPON], ShadeForWeapon(SHOTGUN_WEAPON), 3); - DrawWeaponNum(4, x, y + 12, p->ammo_amount[CHAINGUN_WEAPON], p->max_ammo_amount[CHAINGUN_WEAPON], ShadeForWeapon(CHAINGUN_WEAPON), 3); - DrawWeaponNum(5, x + 39, y, p->ammo_amount[RPG_WEAPON], p->max_ammo_amount[RPG_WEAPON], ShadeForWeapon(RPG_WEAPON), 2); - DrawWeaponNum(6, x + 39, y + 6, p->ammo_amount[HANDBOMB_WEAPON], p->max_ammo_amount[HANDBOMB_WEAPON], ShadeForWeapon(HANDBOMB_WEAPON, HANDREMOTE_WEAPON), 2); + DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3); + DrawWeaponNum(3, x, y + 6, p->ammo_amount[SHOTGUN_WEAPON], max_ammo_amount[SHOTGUN_WEAPON], ShadeForWeapon(SHOTGUN_WEAPON), 3); + DrawWeaponNum(4, x, y + 12, p->ammo_amount[CHAINGUN_WEAPON], max_ammo_amount[CHAINGUN_WEAPON], ShadeForWeapon(CHAINGUN_WEAPON), 3); + DrawWeaponNum(5, x + 39, y, p->ammo_amount[RPG_WEAPON], max_ammo_amount[RPG_WEAPON], ShadeForWeapon(RPG_WEAPON), 2); + DrawWeaponNum(6, x + 39, y + 6, p->ammo_amount[HANDBOMB_WEAPON], max_ammo_amount[HANDBOMB_WEAPON], ShadeForWeapon(HANDBOMB_WEAPON, HANDREMOTE_WEAPON), 2); if (p->subweapon & (1 << GROW_WEAPON)) // original code says: if(!p->ammo_amount[SHRINKER_WEAPON] || cw == GROW_WEAPON) - DrawWeaponNum(7, x + 39, y + 12, p->ammo_amount[GROW_WEAPON], p->max_ammo_amount[GROW_WEAPON], ShadeForWeapon(GROW_WEAPON), 2); + DrawWeaponNum(7, x + 39, y + 12, p->ammo_amount[GROW_WEAPON], max_ammo_amount[GROW_WEAPON], ShadeForWeapon(GROW_WEAPON), 2); else - DrawWeaponNum(7, x + 39, y + 12, p->ammo_amount[SHRINKER_WEAPON], p->max_ammo_amount[SHRINKER_WEAPON], ShadeForWeapon(SHRINKER_WEAPON), 2); - DrawWeaponNum(8, x + 70, y, p->ammo_amount[DEVISTATOR_WEAPON], p->max_ammo_amount[DEVISTATOR_WEAPON], ShadeForWeapon(DEVISTATOR_WEAPON), 2); - DrawWeaponNum(9, x + 70, y + 6, p->ammo_amount[TRIPBOMB_WEAPON], p->max_ammo_amount[TRIPBOMB_WEAPON], ShadeForWeapon(TRIPBOMB_WEAPON), 2); - DrawWeaponNum(0, x + 70, y + 12, p->ammo_amount[FREEZE_WEAPON], p->max_ammo_amount[FREEZE_WEAPON], ShadeForWeapon(FREEZE_WEAPON), 2); + DrawWeaponNum(7, x + 39, y + 12, p->ammo_amount[SHRINKER_WEAPON], max_ammo_amount[SHRINKER_WEAPON], ShadeForWeapon(SHRINKER_WEAPON), 2); + DrawWeaponNum(8, x + 70, y, p->ammo_amount[DEVISTATOR_WEAPON], max_ammo_amount[DEVISTATOR_WEAPON], ShadeForWeapon(DEVISTATOR_WEAPON), 2); + DrawWeaponNum(9, x + 70, y + 6, p->ammo_amount[TRIPBOMB_WEAPON], max_ammo_amount[TRIPBOMB_WEAPON], ShadeForWeapon(TRIPBOMB_WEAPON), 2); + DrawWeaponNum(0, x + 70, y + 12, p->ammo_amount[FREEZE_WEAPON], max_ammo_amount[FREEZE_WEAPON], ShadeForWeapon(FREEZE_WEAPON), 2); } //========================================================================== diff --git a/source/games/duke/src/zz_sector.cpp b/source/games/duke/src/zz_sector.cpp index 1e42181f2..12d25045d 100644 --- a/source/games/duke/src/zz_sector.cpp +++ b/source/games/duke/src/zz_sector.cpp @@ -170,13 +170,13 @@ void P_HandleSharedKeys(int playerNum) pPlayer->last_pissed_time = 4000; if (!adult_lockout) A_PlaySound(437, pPlayer->i); - if (sprite[pPlayer->i].extra <= pPlayer->max_player_health - pPlayer->max_player_health / 10) + if (sprite[pPlayer->i].extra <= max_player_health - max_player_health / 10) { sprite[pPlayer->i].extra += 2; pPlayer->last_extra = sprite[pPlayer->i].extra; } - else if (sprite[pPlayer->i].extra < pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + else if (sprite[pPlayer->i].extra < max_player_health) + sprite[pPlayer->i].extra = max_player_health; } } else @@ -619,12 +619,12 @@ rrtripbomb_case: { if (RR) { - if (pPlayer->inv_amount[GET_HOLODUKE] > 0 && sprite[pPlayer->i].extra < pPlayer->max_player_health) + if (pPlayer->inv_amount[GET_HOLODUKE] > 0 && sprite[pPlayer->i].extra < max_player_health) { pPlayer->inv_amount[GET_HOLODUKE] -= 400; sprite[pPlayer->i].extra += 5; - if (sprite[pPlayer->i].extra > pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + if (sprite[pPlayer->i].extra > max_player_health) + sprite[pPlayer->i].extra = max_player_health; pPlayer->drink_amt += 5; pPlayer->inven_icon = 3; @@ -681,16 +681,16 @@ rrtripbomb_case: P_MadeNoise(playerNum); if (sector[pPlayer->cursectnum].lotag == 857) { - if (sprite[pPlayer->i].extra <= pPlayer->max_player_health) + if (sprite[pPlayer->i].extra <= max_player_health) { sprite[pPlayer->i].extra += 10; - if (sprite[pPlayer->i].extra >= pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + if (sprite[pPlayer->i].extra >= max_player_health) + sprite[pPlayer->i].extra = max_player_health; } } else { - if (sprite[pPlayer->i].extra + 1 <= pPlayer->max_player_health) + if (sprite[pPlayer->i].extra + 1 <= max_player_health) { sprite[pPlayer->i].extra++; } @@ -701,9 +701,9 @@ rrtripbomb_case: { if (VM_OnEvent(EVENT_USEMEDKIT,g_player[playerNum].ps->i,playerNum) == 0) { - if (pPlayer->inv_amount[GET_FIRSTAID] > 0 && sprite[pPlayer->i].extra < pPlayer->max_player_health) + if (pPlayer->inv_amount[GET_FIRSTAID] > 0 && sprite[pPlayer->i].extra < max_player_health) { - int healthDiff = pPlayer->max_player_health-sprite[pPlayer->i].extra; + int healthDiff = max_player_health-sprite[pPlayer->i].extra; if (RR) healthDiff = 10; @@ -712,8 +712,8 @@ rrtripbomb_case: pPlayer->inv_amount[GET_FIRSTAID] -= healthDiff; if (RR) sprite[pPlayer->i].extra += healthDiff; - if (!RR || sprite[pPlayer->i].extra > pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + if (!RR || sprite[pPlayer->i].extra > max_player_health) + sprite[pPlayer->i].extra = max_player_health; pPlayer->inven_icon = ICON_FIRSTAID; } else @@ -724,8 +724,8 @@ rrtripbomb_case: } if (RR) { - if (sprite[pPlayer->i].extra > pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + if (sprite[pPlayer->i].extra > max_player_health) + sprite[pPlayer->i].extra = max_player_health; pPlayer->drink_amt += 10; } if (!RR || (pPlayer->drink_amt <= 100 && !A_CheckSoundPlaying(pPlayer->i, DUKE_USEMEDKIT))) @@ -740,7 +740,7 @@ rrtripbomb_case: { if (VM_OnEvent(EVENT_USEJETPACK,g_player[playerNum].ps->i,playerNum) == 0) { - if (pPlayer->inv_amount[GET_JETPACK] > 0 && sprite[pPlayer->i].extra < pPlayer->max_player_health) + if (pPlayer->inv_amount[GET_JETPACK] > 0 && sprite[pPlayer->i].extra < max_player_health) { if (!A_CheckSoundPlaying(pPlayer->i, 429)) A_PlaySound(429, pPlayer->i); @@ -764,8 +764,8 @@ rrtripbomb_case: pPlayer->inven_icon = 4; - if (sprite[pPlayer->i].extra > pPlayer->max_player_health) - sprite[pPlayer->i].extra = pPlayer->max_player_health; + if (sprite[pPlayer->i].extra > max_player_health) + sprite[pPlayer->i].extra = max_player_health; if (pPlayer->inv_amount[GET_JETPACK] <= 0) P_SelectNextInvItem(pPlayer);