diff --git a/ld/gamefiles.ntsc-final.inc b/ld/gamefiles.ntsc-final.inc index a678e9a6b..e91e70a59 100644 --- a/ld/gamefiles.ntsc-final.inc +++ b/ld/gamefiles.ntsc-final.inc @@ -131,7 +131,6 @@ build/ROMID/game/activemenu.o (section); \ build/ROMID/game/stubs/game_102230.o (section); \ build/ROMID/game/mainmenu.o (section); \ - build/ROMID/game/cheats.o (section); \ build/ROMID/game/filemgr.o (section); \ build/ROMID/game/fmb.o (section); \ build/ROMID/game/gamefile.o (section); \ diff --git a/src/game/body.c b/src/game/body.c index 5cf2556ec..b9c4a5f2e 100644 --- a/src/game/body.c +++ b/src/game/body.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/chr.h" #include "game/body.h" @@ -165,10 +164,6 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf struct modelnode *node = NULL; u32 stack[2]; - if (cheatIsActive(CHEAT_DKMODE)) { - scale *= 0.8f; - } - if (bodyfiledata == NULL) { if (g_HeadsAndBodies[bodynum].filedata == NULL) { g_HeadsAndBodies[bodynum].filedata = modeldefLoadToNew(g_HeadsAndBodies[bodynum].filenum); @@ -213,20 +208,6 @@ struct model *body0f02ce8c(s32 bodynum, s32 headnum, struct modelfiledata *bodyf scale *= 2.0f * frac - 0.05f + 1.0f; } } - - if (!isplayer) { - if (cheatIsActive(CHEAT_SMALLCHARACTERS)) { - scale *= 0.4f; - } - - if (cheatIsActive(CHEAT_DKMODE)) { - scale *= 1.25f; - } - } else { - if (cheatIsActive(CHEAT_SMALLJO)) { - scale *= 0.4f; - } - } } } else if (bodyfiledata->skel == &g_SkelSkedar) { if (g_HeadsAndBodies[bodynum].canvaryheight && varyheight && bodynum == BODY_SKEDAR) { @@ -473,12 +454,6 @@ void bodyAllocateChr(s32 stagenum, struct packedchr *packed, s32 cmdindex) chr->flags = packed->flags; chr->flags2 = packed->flags2; - - if (cheatIsActive(CHEAT_MARQUIS)) { - chr->flags2 &= ~CHRFLAG1_NOHANDCOMBAT; - chr->flags2 |= CHRFLAG1_HANDCOMBATONLY; - } - chr->team = packed->team; chr->squadron = packed->squadron; chr->aibot = NULL; diff --git a/src/game/bodyreset.c b/src/game/bodyreset.c index 1550ae6ee..5f822334f 100644 --- a/src/game/bodyreset.c +++ b/src/game/bodyreset.c @@ -1,7 +1,6 @@ #include #include "constants.h" #include "game/body.h" -#include "game/cheats.h" #include "game/game_00b820.h" #include "game/playerreset.h" #include "game/setuputils.h" @@ -303,13 +302,8 @@ void bodiesReset(s32 stagenum) } // Male heads - if (cheatIsActive(CHEAT_TEAMHEADSONLY)) { - headsavailablelist = g_MaleGuardTeamHeads; - headsavailablelen = g_NumMaleGuardTeamHeads; - } else { - headsavailablelist = g_MaleGuardHeads; - headsavailablelen = g_NumMaleGuardHeads; - } + headsavailablelist = g_MaleGuardHeads; + headsavailablelen = g_NumMaleGuardHeads; for (i = 0; i < g_NumActiveHeadsPerGender; i++) { do { @@ -327,13 +321,8 @@ void bodiesReset(s32 stagenum) } // Female heads - if (cheatIsActive(CHEAT_TEAMHEADSONLY)) { - headsavailablelist = g_FemaleGuardTeamHeads; - headsavailablelen = g_NumFemaleGuardTeamHeads; - } else { - headsavailablelist = g_FemaleGuardHeads; - headsavailablelen = g_NumFemaleGuardHeads; - } + headsavailablelist = g_FemaleGuardHeads; + headsavailablelen = g_NumFemaleGuardHeads; for (i = 0; i < g_NumActiveHeadsPerGender; i++) { do { diff --git a/src/game/bondgrab.c b/src/game/bondgrab.c index 1388160ec..90b1fa273 100644 --- a/src/game/bondgrab.c +++ b/src/game/bondgrab.c @@ -2,7 +2,6 @@ #include "constants.h" #include "game/bondgrab.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/debug.h" #include "game/prop.h" @@ -1086,13 +1085,6 @@ void bgrab0f0ce924(void) sp84 = g_Vars.currentplayer->headpos.x; sp80 = g_Vars.currentplayer->headpos.z; -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_SMALLJO)) { - sp84 *= 0.4f; - sp80 *= 0.4f; - } -#endif - sp74.x += (sp80 * g_Vars.currentplayer->bond2.unk00.f[0] - sp84 * g_Vars.currentplayer->bond2.unk00.f[2]) * g_Vars.lvupdate60freal; sp74.z += (sp80 * g_Vars.currentplayer->bond2.unk00.f[2] + sp84 * g_Vars.currentplayer->bond2.unk00.f[0]) * g_Vars.lvupdate60freal; diff --git a/src/game/bondgun.c b/src/game/bondgun.c index 9a34d768f..4a0e8a266 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -1,7 +1,6 @@ #include #include "constants.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/inv.h" #include "game/game_006900.h" @@ -2404,10 +2403,6 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand) } } - if (cheatIsActive(CHEAT_HURRICANEFISTS)) { - hand->stateminor = 2; - } - return false; } @@ -2416,10 +2411,6 @@ bool bgunTickIncAttackingClose(s32 handnum, struct hand *hand) return true; } - if (cheatIsActive(CHEAT_HURRICANEFISTS) && hand->gset.weaponnum == WEAPON_UNARMED) { - return true; - } - if (hand->stateframes > TICKS(60)) { return true; } @@ -11788,27 +11779,6 @@ void bgunTickGameplay(bool triggeron) bgunTickHand(HAND_RIGHT); bgunTickHand(HAND_LEFT); bgunTickSwitch(); - - if (cheatIsActive(CHEAT_UNLIMITEDAMMONORELOADS)) { - s32 i; - struct weapon *weapon; - struct hand *lhand = &g_Vars.currentplayer->hands[HAND_LEFT]; - struct hand *rhand = &g_Vars.currentplayer->hands[HAND_RIGHT]; - - weapon = weaponFindById(rhand->gset.weaponnum); - - for (i = 0; i != 2; i++) { - if (weapon && weapon->ammos[i] && - bgunAmmotypeAllowsUnlimitedAmmo(weapon->ammos[i]->type)) { - rhand->loadedammo[i] = rhand->clipsizes[i]; - lhand->loadedammo[i] = lhand->clipsizes[i]; - } - } - - bgunGiveMaxAmmo(false); - } else if (cheatIsActive(CHEAT_UNLIMITEDAMMO)) { - bgunGiveMaxAmmo(false); - } } bgunDecreaseNoiseRadius(); diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 221825844..82bb62743 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -5,7 +5,6 @@ #include "game/bondgrab.h" #include "game/bondmove.h" #include "game/bondwalk.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/footstep.h" #include "game/game_006900.h" @@ -2034,30 +2033,6 @@ void bmove0f0cc19c(struct coord *arg) g_Vars.currentplayer->bond2.unk10.y += -(1.0f - g_Vars.currentplayer->vv_cosverta) * g_Vars.currentplayer->bondleandown; } - if (cheatIsActive(CHEAT_SMALLJO)) { - if (g_Vars.currentplayer->bondmovemode == MOVEMODE_BIKE) { - mult = g_Vars.currentplayer->bondentert * 0.6f + 0.4f; - } else if (g_Vars.currentplayer->bondmovemode == MOVEMODE_WALK && g_Vars.currentplayer->walkinitmove) { - mult = (1.0f - g_Vars.currentplayer->walkinitt) * 0.6f + 0.4f; - g_Vars.currentplayer->bond2.unk10.y += (g_Vars.currentplayer->crouchoffsetreal - g_Vars.currentplayer->crouchoffsetrealsmall) * g_Vars.currentplayer->walkinitt; - } else if (g_Vars.currentplayer->bondmovemode == MOVEMODE_WALK) { - mult = 0.4f; - g_Vars.currentplayer->bond2.unk10.y += (g_Vars.currentplayer->crouchoffsetreal - g_Vars.currentplayer->crouchoffsetrealsmall); - } else { - mult = 0.4f; - } - - g_Vars.currentplayer->bond2.unk10.y = (g_Vars.currentplayer->bond2.unk10.y - g_Vars.currentplayer->vv_manground) * mult; - -#if VERSION < VERSION_NTSC_1_0 - if (g_Vars.currentplayer->bond2.unk10.y < 30) { - g_Vars.currentplayer->bond2.unk10.y = 30; - } -#endif - - g_Vars.currentplayer->bond2.unk10.y += g_Vars.currentplayer->vv_manground; - } - #if VERSION >= VERSION_NTSC_1_0 min = g_Vars.currentplayer->vv_ground + 10; diff --git a/src/game/bondwalk.c b/src/game/bondwalk.c index 5f004c1ca..ef3b35bf3 100644 --- a/src/game/bondwalk.c +++ b/src/game/bondwalk.c @@ -2,7 +2,6 @@ #include "constants.h" #include "game/bondmove.h" #include "game/bondwalk.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/debug.h" #include "game/footstep.h" @@ -1152,13 +1151,8 @@ void bwalkUpdateCrouchOffsetReal(void) g_Vars.currentplayer->crouchoffsetreal = g_Vars.currentplayer->crouchoffset * g_Vars.currentplayer->vv_eyeheight * (1.0f / 159.0f); } - if (cheatIsActive(CHEAT_SMALLJO)) { - g_Vars.currentplayer->crouchoffsetsmall = 69.0f - g_Vars.currentplayer->vv_eyeheight; - g_Vars.currentplayer->crouchoffsetrealsmall = 69.0f - g_Vars.currentplayer->vv_eyeheight; - } else { - g_Vars.currentplayer->crouchoffsetsmall = g_Vars.currentplayer->crouchoffset; - g_Vars.currentplayer->crouchoffsetrealsmall = g_Vars.currentplayer->crouchoffsetreal; - } + g_Vars.currentplayer->crouchoffsetsmall = g_Vars.currentplayer->crouchoffset; + g_Vars.currentplayer->crouchoffsetrealsmall = g_Vars.currentplayer->crouchoffsetreal; } void bwalkUpdateCrouchOffset(void) @@ -1426,12 +1420,6 @@ void bwalk0f0c69b8(void) spc0 *= 1.25f; } -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_SMALLJO)) { - spc0 *= 0.4f; - } -#endif - if (g_Vars.currentplayer->walkinitmove) { g_Vars.currentplayer->walkinitt += g_Vars.lvupdate60freal * (1.0f / 60.0f); @@ -1546,12 +1534,6 @@ void bwalk0f0c69b8(void) mult = var80075c00[1].unk0c * 0.5f * g_Vars.lvupdate60freal; spe0 = (g_Vars.currentplayer->speedsideways * spc0 + spc4) * mult; -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_SMALLJO)) { - spe0 /= 0.4f; - } -#endif - bmove0f0cc654(maxspeed, g_Vars.currentplayer->speedforwards * spc0 + spc8, spe0); g_Vars.currentplayer->gunspeed = maxspeed; @@ -1559,12 +1541,6 @@ void bwalk0f0c69b8(void) spdc = g_Vars.currentplayer->headpos.x; spd8 = g_Vars.currentplayer->headpos.z; -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_SMALLJO)) { - spdc *= 0.4f; - } -#endif - spcc.f[0] += (spd8 * g_Vars.currentplayer->bond2.unk00.f[0] - spdc * g_Vars.currentplayer->bond2.unk00.f[2]) * g_Vars.lvupdate60freal; spcc.f[2] += (spd8 * g_Vars.currentplayer->bond2.unk00.f[2] + spdc * g_Vars.currentplayer->bond2.unk00.f[0]) * g_Vars.lvupdate60freal; spcc.f[0] += spb4; diff --git a/src/game/bossfile.c b/src/game/bossfile.c index a95d0ded9..9f2f85a3e 100644 --- a/src/game/bossfile.c +++ b/src/game/bossfile.c @@ -2,7 +2,6 @@ #include "constants.h" #include "constants.h" #include "game/camdraw.h" -#include "game/cheats.h" #include "game/player.h" #include "game/savebuffer.h" #include "game/bossfile.h" diff --git a/src/game/challenge.c b/src/game/challenge.c index 9f7223cc9..e48372cb4 100644 --- a/src/game/challenge.c +++ b/src/game/challenge.c @@ -807,14 +807,7 @@ void challengeConsiderMarkingComplete(void) { bool result = challengeIsCompleteForEndscreen(); -#if VERSION == VERSION_PAL_BETA - if ((g_CheatsActiveBank0 == 0 && g_CheatsActiveBank1 == 0) && (result || debugIsSetCompleteEnabled())) -#elif VERSION >= VERSION_NTSC_1_0 - if (g_CheatsActiveBank0 == 0 && g_CheatsActiveBank1 == 0 && result) -#else - if (result && g_CheatsActiveBank0 == 0 && g_CheatsActiveBank1 == 0) -#endif - { + if (result) { u32 prevplayernum; s32 i; diff --git a/src/game/cheats.c b/src/game/cheats.c deleted file mode 100644 index f49478124..000000000 --- a/src/game/cheats.c +++ /dev/null @@ -1,1562 +0,0 @@ -#include -#include "constants.h" -#include "lib/sched.h" -#include "lib/str.h" -#include "game/camdraw.h" -#include "game/cheats.h" -#include "game/inv.h" -#include "game/playermgr.h" -#include "game/gamefile.h" -#include "game/lang.h" -#include "game/pak.h" -#include "bss.h" -#include "data.h" -#include "types.h" - -u32 g_CheatsActiveBank0; -u32 g_CheatsActiveBank1; -u32 g_CheatsEnabledBank0; -u32 g_CheatsEnabledBank1; - -struct menuitem g_CheatsBuddiesMenuItems[]; -struct menudialogdef g_CheatsBuddiesMenuDialog; - -#define TIME(mins, secs) (mins * 60 + secs) -#define m -#define s - -struct cheat g_Cheats[NUM_CHEATS] = { - { L_MPWEAPONS_075, TIME(2 m, 3 s), SOLOSTAGEINDEX_EXTRACTION, DIFF_A, CHEATFLAG_TIMED | CHEATFLAG_TRANSFERPAK }, // Hurricane Fists -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_076, TIME(1 m, 40 s), SOLOSTAGEINDEX_G5BUILDING, DIFF_A, CHEATFLAG_TIMED | CHEATFLAG_TRANSFERPAK }, // Cloaking Device -#else - { L_MPWEAPONS_076, TIME(0 m, 59 s), SOLOSTAGEINDEX_G5BUILDING, DIFF_A, CHEATFLAG_TIMED | CHEATFLAG_TRANSFERPAK }, // Cloaking Device -#endif - { L_MPWEAPONS_077, TIME(3 m, 50 s), SOLOSTAGEINDEX_ESCAPE, DIFF_A, CHEATFLAG_TIMED }, // Invincible -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_078, TIME(5 m, 31 s), SOLOSTAGEINDEX_SKEDARRUINS, DIFF_PA, CHEATFLAG_TIMED | CHEATFLAG_TRANSFERPAK }, // All Guns in Solo - { L_MPWEAPONS_079, TIME(7 m, 7 s), SOLOSTAGEINDEX_PELAGIC, DIFF_SA, CHEATFLAG_TIMED }, // Unlimited Ammo - { L_MPWEAPONS_080, TIME(3 m, 11 s), SOLOSTAGEINDEX_AIRBASE, DIFF_SA, CHEATFLAG_TIMED }, // Unlimited Ammo, No Reloads -#else - { L_MPWEAPONS_078, TIME(4 m, 7 s), SOLOSTAGEINDEX_SKEDARRUINS, DIFF_PA, CHEATFLAG_TIMED | CHEATFLAG_TRANSFERPAK }, // All Guns in Solo - { L_MPWEAPONS_079, TIME(5 m, 50 s), SOLOSTAGEINDEX_PELAGIC, DIFF_SA, CHEATFLAG_TIMED }, // Unlimited Ammo - { L_MPWEAPONS_080, TIME(2 m, 59 s), SOLOSTAGEINDEX_AIRBASE, DIFF_SA, CHEATFLAG_TIMED }, // Unlimited Ammo, No Reloads -#endif - { L_MPWEAPONS_081, 0, SOLOSTAGEINDEX_INVESTIGATION, DIFF_A, CHEATFLAG_COMPLETION }, // Slo-mo Single Player - { L_MPWEAPONS_082, 0, SOLOSTAGEINDEX_CHICAGO, DIFF_A, CHEATFLAG_COMPLETION }, // DK Mode - { L_MPWEAPONS_083, TIME(2 m, 50 s), SOLOSTAGEINDEX_CRASHSITE, DIFF_A, CHEATFLAG_TIMED }, // Trent's Magnum -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_084, TIME(7 m, 27 s), SOLOSTAGEINDEX_DEEPSEA, DIFF_PA, CHEATFLAG_TIMED }, // FarSight -#else - { L_MPWEAPONS_084, TIME(5 m, 13 s), SOLOSTAGEINDEX_DEEPSEA, DIFF_PA, CHEATFLAG_TIMED }, // FarSight -#endif - { L_MPWEAPONS_085, 0, SOLOSTAGEINDEX_G5BUILDING, DIFF_A, CHEATFLAG_COMPLETION }, // Small Jo - { L_MPWEAPONS_086, 0, SOLOSTAGEINDEX_INFILTRATION, DIFF_A, CHEATFLAG_COMPLETION }, // Small Characters - { L_MPWEAPONS_087, 0, SOLOSTAGEINDEX_DEFENSE, DIFF_A, CHEATFLAG_COMPLETION }, // Enemy Shields - { L_MPWEAPONS_088, 0, SOLOSTAGEINDEX_DEEPSEA, DIFF_A, CHEATFLAG_COMPLETION }, // Jo Shield -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_089, TIME(1 m, 45 s), SOLOSTAGEINDEX_DEFENSE, DIFF_A, CHEATFLAG_TIMED }, // Super Shield -#else - { L_MPWEAPONS_089, TIME(1 m, 12 s), SOLOSTAGEINDEX_DEFENSE, DIFF_A, CHEATFLAG_TIMED }, // Super Shield -#endif - { L_MPWEAPONS_090, 0, SOLOSTAGEINDEX_DEFECTION, DIFF_A, CHEATFLAG_COMPLETION }, // Classic Sight - { L_MPWEAPONS_091, 0, SOLOSTAGEINDEX_AIRBASE, DIFF_A, CHEATFLAG_COMPLETION }, // Team Heads Only -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_092, TIME(7 m, 59 s), SOLOSTAGEINDEX_RESCUE, DIFF_PA, CHEATFLAG_TIMED }, // Play as Elvis -#else - { L_MPWEAPONS_092, TIME(7 m, 0 s), SOLOSTAGEINDEX_RESCUE, DIFF_PA, CHEATFLAG_TIMED }, // Play as Elvis -#endif - { L_MPWEAPONS_093, 0, SOLOSTAGEINDEX_PELAGIC, DIFF_A, CHEATFLAG_COMPLETION }, // Enemy Rockets -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_094, TIME(3 m, 55 s), SOLOSTAGEINDEX_AIRFORCEONE, DIFF_PA, CHEATFLAG_TIMED }, // Unlimited Ammo - Laptop Sentry Gun -#else - { L_MPWEAPONS_094, TIME(2 m, 59 s), SOLOSTAGEINDEX_AIRFORCEONE, DIFF_PA, CHEATFLAG_TIMED }, // Unlimited Ammo - Laptop Sentry Gun -#endif - { L_MPWEAPONS_095, TIME(1 m, 30 s), SOLOSTAGEINDEX_DEFECTION, DIFF_SA, CHEATFLAG_TIMED }, // Marquis of Queensbury Rules - { L_MPWEAPONS_096, 0, SOLOSTAGEINDEX_CRASHSITE, DIFF_A, CHEATFLAG_COMPLETION }, // Perfect Darkness - { L_MPWEAPONS_097, TIME(6 m, 30 s), SOLOSTAGEINDEX_INVESTIGATION, DIFF_PA, CHEATFLAG_TIMED }, // Pugilist - { L_MPWEAPONS_098, TIME(5 m, 0 s), SOLOSTAGEINDEX_INFILTRATION, DIFF_SA, CHEATFLAG_TIMED }, // Hotshot - { L_MPWEAPONS_099, TIME(2 m, 30 s), SOLOSTAGEINDEX_VILLA, DIFF_SA, CHEATFLAG_TIMED }, // Hit and Run - { L_MPWEAPONS_100, TIME(5 m, 17 s), SOLOSTAGEINDEX_ATTACKSHIP, DIFF_SA, CHEATFLAG_TIMED }, // Alien - { L_MPWEAPONS_101, 0, SOLOSTAGEINDEX_SKEDARRUINS, DIFF_A, CHEATFLAG_COMPLETION | CHEATFLAG_TRANSFERPAK }, // R-Tracker/Weapon Cache Locations - { L_MPWEAPONS_102, 0, SOLOSTAGEINDEX_EXTRACTION, DIFF_A, CHEATFLAG_COMPLETION }, // Rocket Launcher - { L_MPWEAPONS_103, 0, SOLOSTAGEINDEX_VILLA, DIFF_A, CHEATFLAG_COMPLETION }, // Sniper Rifle - { L_MPWEAPONS_104, 0, SOLOSTAGEINDEX_RESCUE, DIFF_A, CHEATFLAG_COMPLETION }, // X-Ray Scanner - { L_MPWEAPONS_105, 0, SOLOSTAGEINDEX_ESCAPE, DIFF_A, CHEATFLAG_COMPLETION }, // SuperDragon - { L_MPWEAPONS_106, 0, SOLOSTAGEINDEX_AIRFORCEONE, DIFF_A, CHEATFLAG_COMPLETION }, // Laptop Gun - { L_MPWEAPONS_107, 0, SOLOSTAGEINDEX_ATTACKSHIP, DIFF_A, CHEATFLAG_COMPLETION }, // Phoenix -#if VERSION >= VERSION_NTSC_1_0 - { L_MPWEAPONS_108, TIME(2 m, 0 s), SOLOSTAGEINDEX_CHICAGO, DIFF_PA, CHEATFLAG_TIMED }, // Psychosis Gun -#else - { L_MPWEAPONS_108, TIME(1 m, 44 s), SOLOSTAGEINDEX_CHICAGO, DIFF_PA, CHEATFLAG_TIMED }, // Psychosis Gun -#endif - { L_MPWEAPONS_109, WEAPON_PP9I, 0, 0, CHEATFLAG_FIRINGRANGE }, // PP9i - { L_MPWEAPONS_110, WEAPON_CC13, 0, 0, CHEATFLAG_FIRINGRANGE }, // CC13 - { L_MPWEAPONS_111, WEAPON_KL01313, 0, 0, CHEATFLAG_FIRINGRANGE }, // KL01313 - { L_MPWEAPONS_112, WEAPON_KF7SPECIAL, 0, 0, CHEATFLAG_FIRINGRANGE }, // KF7 Special - { L_MPWEAPONS_113, WEAPON_ZZT, 0, 0, CHEATFLAG_FIRINGRANGE }, // ZZT (9mm) - { L_MPWEAPONS_114, WEAPON_DMC, 0, 0, CHEATFLAG_FIRINGRANGE }, // DMC - { L_MPWEAPONS_115, WEAPON_AR53, 0, 0, CHEATFLAG_FIRINGRANGE }, // AR53 - { L_MPWEAPONS_116, WEAPON_RCP45, 0, 0, CHEATFLAG_FIRINGRANGE }, // RC-P45 -}; - -u32 cheatIsUnlocked(s32 cheat_id) -{ - struct cheat *cheat = &g_Cheats[cheat_id]; - u32 unlocked = 0; - - if (cheat->flags & CHEATFLAG_FIRINGRANGE) { - } else if (cheat->flags & CHEATFLAG_COMPLETION) { - if (g_GameFile.besttimes[cheat->stage_index][0]) { - unlocked++; - } - if (g_GameFile.besttimes[cheat->stage_index][1]) { - unlocked++; - } - if (g_GameFile.besttimes[cheat->stage_index][2]) { - unlocked++; - } - } else { - if (g_GameFile.besttimes[cheat->stage_index][cheat->difficulty] && - g_GameFile.besttimes[cheat->stage_index][cheat->difficulty] <= cheat->time) { - unlocked++; - } - } - - if ((cheat->flags & CHEATFLAG_TRANSFERPAK) && gamefileHasFlag(GAMEFILEFLAG_USED_TRANSFERPAK)) { - unlocked++; - } - - return unlocked; -} - -bool cheatIsActive(s32 cheat_id) -{ - if (cheat_id < 32) { - return g_CheatsActiveBank0 & (1 << cheat_id); - } - - return g_CheatsActiveBank1 & (1 << cheat_id); -} - -void cheatActivate(s32 cheat_id) -{ - u32 prevplayernum; - s32 playernum; - - switch (cheat_id) { - case CHEAT_INVINCIBLE: - // Make all players invincible - prevplayernum = g_Vars.currentplayernum; - - for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) { - setCurrentPlayerNum(playernum); - g_Vars.currentplayer->invincible = 1; - } - - setCurrentPlayerNum(prevplayernum); - break; - case CHEAT_ALLGUNS: - // Give all guns if only one player playing - if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) { - prevplayernum = g_Vars.currentplayernum; - - for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) { - setCurrentPlayerNum(playernum); - invSetAllGuns(true); - } - - setCurrentPlayerNum(prevplayernum); - } - break; - } - - if (cheat_id < 32) { - g_CheatsActiveBank0 = g_CheatsActiveBank0 | (1 << cheat_id); - } else { - g_CheatsActiveBank1 = g_CheatsActiveBank1 | (1 << cheat_id); - } -} - -void cheatDeactivate(s32 cheat_id) -{ - u32 prevplayernum; - s32 playernum; - - switch (cheat_id) { - case CHEAT_INVINCIBLE: - prevplayernum = g_Vars.currentplayernum; - - for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) { - setCurrentPlayerNum(playernum); - g_Vars.currentplayer->invincible = 1; // @bug? - } - - setCurrentPlayerNum(prevplayernum); - break; - case CHEAT_ALLGUNS: - if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) { - prevplayernum = g_Vars.currentplayernum; - - for (playernum = 0; playernum < PLAYERCOUNT(); playernum++) { - setCurrentPlayerNum(playernum); - invSetAllGuns(false); - } - - setCurrentPlayerNum(prevplayernum); - } - break; - } - - if (cheat_id < 32) { - g_CheatsActiveBank0 = g_CheatsActiveBank0 & ~(1 << cheat_id); - } else { - g_CheatsActiveBank1 = g_CheatsActiveBank1 & ~(1 << cheat_id); - } -} - -void cheatsInit(void) -{ - g_CheatsActiveBank0 = 0; - g_CheatsActiveBank1 = 0; - g_CheatsEnabledBank0 = 0; - g_CheatsEnabledBank1 = 0; -} - -/** - * Apply cheats at level startup. - */ -void cheatsReset(void) -{ - s32 cheat_id; - - // Copy enabled cheats to active cheats, unless in CI training - // or weapon cheats not in solo - if (g_Vars.stagenum != STAGE_CITRAINING) { - g_CheatsActiveBank0 = g_CheatsEnabledBank0; - g_CheatsActiveBank1 = g_CheatsEnabledBank1; - - if (g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0 || g_Vars.normmplayerisrunning) { - // Co-op/counter-op/multi - deactivate "Weapons for Jo in Solo" cheats - g_CheatsActiveBank0 &= ~( - (1 << CHEAT_TRENTSMAGNUM) | - (1 << CHEAT_FARSIGHT) | - (1 << CHEAT_ROCKETLAUNCHER) | - (1 << CHEAT_SNIPERRIFLE) | - (1 << CHEAT_XRAYSCANNER) | - (1 << CHEAT_SUPERDRAGON) | - (1 << CHEAT_LAPTOPGUN) - ); - g_CheatsActiveBank1 &= ~( - (1 << (CHEAT_PHOENIX - 32)) | - (1 << (CHEAT_PSYCHOSISGUN - 32)) | - (1 << (CHEAT_PP9I - 32)) | - (1 << (CHEAT_CC13 - 32)) | - (1 << (CHEAT_KL01313 - 32)) | - (1 << (CHEAT_KF7SPECIAL - 32)) | - (1 << (CHEAT_ZZT - 32)) | - (1 << (CHEAT_DMC - 32)) | - (1 << (CHEAT_AR53 - 32)) | - (1 << (CHEAT_RCP45 - 32)) - ); - } - } else { - g_CheatsActiveBank0 = 0; - g_CheatsActiveBank1 = 0; - } - - // Set any "always on" cheats to active and properly activate all active cheats - for (cheat_id = 0; cheat_id != NUM_CHEATS; cheat_id++) { - if (g_Cheats[cheat_id].flags & CHEATFLAG_ALWAYSON) { - if (cheatIsUnlocked(cheat_id)) { - if (cheat_id < 32) { - g_CheatsActiveBank0 = g_CheatsActiveBank0 | (1 << cheat_id); - } else { - g_CheatsActiveBank1 = g_CheatsActiveBank1 | (1 << cheat_id); - } - } else { - if (cheat_id < 32) { - g_CheatsActiveBank0 = g_CheatsActiveBank0 & ~(1 << cheat_id); - } else { - g_CheatsActiveBank1 = g_CheatsActiveBank1 & ~(1 << cheat_id); - } - } - } - - if (cheatIsActive(cheat_id)) { - cheatActivate(cheat_id); - } - } -} - -s32 cheatCheckboxMenuHandler(s32 operation, struct menuitem *item, union handlerdata *data) -{ - switch (operation) { - case MENUOP_GET: - if (item->param < 32) { - if (g_CheatsEnabledBank0 & (1 << item->param)) { - return true; - } - - return false; - } - - if (g_CheatsEnabledBank1 & (1 << item->param)) { - return true; - } - - return false; - case MENUOP_SET: - if (cheatIsUnlocked(item->param)) { - if (item->param < 32) { - // Bank 0 - if (g_CheatsEnabledBank0 & (1 << item->param)) { - g_CheatsEnabledBank0 = g_CheatsEnabledBank0 & ~(1 << item->param); - } else { - // If enabling Marquis or enemy rockets, turn off the other - if (item->param == CHEAT_MARQUIS) { - g_CheatsEnabledBank0 &= ~(1 << CHEAT_ENEMYROCKETS); - } - - if (item->param == CHEAT_ENEMYROCKETS) { - g_CheatsEnabledBank0 &= ~(1 << CHEAT_MARQUIS); - } - - g_CheatsEnabledBank0 = g_CheatsEnabledBank0 | 1 << item->param; - } - } else { - // Bank 1 - if (g_CheatsEnabledBank1 & (1 << item->param)) { - if (1); - g_CheatsEnabledBank1 = g_CheatsEnabledBank1 & ~(1 << item->param); - } else { - g_CheatsEnabledBank1 = g_CheatsEnabledBank1 | 1 << item->param; - } - } - } - break; - } - - return 0; -} - -s32 cheatMenuHandleBuddyCheckbox(s32 operation, struct menuitem *item, union handlerdata *data) -{ - switch (operation) { - case MENUOP_GET: - if (item->param == 0) { - if (g_CheatsEnabledBank0 & (1 << CHEAT_PUGILIST | 1 << CHEAT_HOTSHOT | 1 << CHEAT_HITANDRUN | 1 << CHEAT_ALIEN)) { - return false; - } - - return true; - } - - if (g_CheatsEnabledBank0 & (1 << item->param)) { - return true; - } - - return false; - case MENUOP_SET: - if (item->param == 0) { - // Velvet - g_CheatsEnabledBank0 &= ~( - (1 << CHEAT_PUGILIST) | - (1 << CHEAT_HOTSHOT) | - (1 << CHEAT_HITANDRUN) | - (1 << CHEAT_ALIEN) - ); - } else if (cheatIsUnlocked(item->param)) { - // Not Velvet - g_CheatsEnabledBank0 = g_CheatsEnabledBank0 & ~( - (1 << CHEAT_PUGILIST) | - (1 << CHEAT_HOTSHOT) | - (1 << CHEAT_HITANDRUN) | - (1 << CHEAT_ALIEN) - ); - g_CheatsEnabledBank0 = g_CheatsEnabledBank0 | (1 << item->param); - } - } - - return 0; -} - -char *cheatGetNameIfUnlocked(struct menuitem *item) -{ - if (cheatIsUnlocked(item->param)) { - return langGet(g_Cheats[item->param].nametextid); - } - - return langGet(L_MPWEAPONS_074); // "----------" -} - -s32 cheatMenuHandleDialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) -{ - if (operation == MENUOP_OPEN) { - func0f14a52c(); - - if (gbpakIsAnyPerfectDark()) { - gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK); - } - -#if PIRACYCHECKS - { - u32 *ptr = (u32 *)&__scHandleTasks; - u32 *end = (u32 *)&__scHandleRSP; - u32 checksum = 0; - - while (ptr < end) { - checksum ^= ~*ptr; - ptr++; - } - - if (checksum != CHECKSUM_PLACEHOLDER) { - ptr = (u32 *)&__scHandleTasks + 20; - if (1); - end = &ptr[4]; - - while (ptr < end) { - *ptr = 0x00000012; - ptr++; - } - } - } -#endif - } - - if (operation == MENUOP_CLOSE) { - if (gbpakIsAnyPerfectDark()) { - gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK); - } - - func0f14a560(); - } - - return 0; -} - -struct menuitem g_CheatsWarningMenuItems[] = { - { - MENUITEMTYPE_LABEL, - 0, - 0, - L_MPMENU_479, // "If you activate any cheats, then you will be unable to progress further in the game while those cheats are active." - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_480, // "OK" - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_481, // "Cancel" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsWarningMenuDialog = { - MENUDIALOGTYPE_SUCCESS, - L_MPMENU_478, // "Warning" - g_CheatsWarningMenuItems, - NULL, - 0, - NULL, -}; - -/** - * NTSC Beta uses g_StringPointer while newer versions use g_CheatMarqueeString. - * - * PAL Final introduces a string length check which ultimately doesn't do - * anything. - * - * JPN final removes the colon characters from the format strings. - */ -char *cheatGetMarquee(struct menuitem *arg0) -{ - u32 cheat_id; - char *ptr; - char difficultyname[256]; - char cheatname[256]; - -#if VERSION >= VERSION_JPN_FINAL - s32 len; - static s32 var80074020pf = 0; - static s32 var80074024pf = 0; - - if (g_Menus[g_MpPlayerNum].curdialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem - && g_Menus[g_MpPlayerNum].curdialog->focuseditem->type == MENUITEMTYPE_CHECKBOX) { - cheat_id = g_Menus[g_MpPlayerNum].curdialog->focuseditem->param; - - if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem == &g_CheatsBuddiesMenuItems[0]) { - // Velvet - sprintf(g_CheatMarqueeString, "%s %s", langGet(L_MPWEAPONS_143), langGet(L_MPWEAPONS_117)); // "Buddy Available", "Velvet Dark" - } else if (cheatIsUnlocked(cheat_id)) { - // Show cheat name - sprintf(g_CheatMarqueeString, "%s %s\n", - g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog ? langGet(L_MPWEAPONS_143) : langGet(L_MPWEAPONS_136), // "Buddy Available", "Cheat available" - langGet(g_Cheats[cheat_id].nametextid) - ); - } else { - // Locked - strcpy(cheatname, langGet(g_Cheats[cheat_id].nametextid)); - ptr = cheatname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - if (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION) { - sprintf(g_CheatMarqueeString, "%s %s %s %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } else { - // Timed - strcpy(difficultyname, langGet(L_OPTIONS_251 + g_Cheats[cheat_id].difficulty)); - ptr = difficultyname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - sprintf(g_CheatMarqueeString, "%s %s %s %s %s %s %d:%02d %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_139), // "on" - &difficultyname, - langGet(L_MPWEAPONS_140), // "in under" - g_Cheats[cheat_id].time / 60, - g_Cheats[cheat_id].time % 60, - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } - - if (g_Cheats[cheat_id].flags & CHEATFLAG_TRANSFERPAK) { - strcat(g_CheatMarqueeString, langGet(L_MPWEAPONS_141)); // " or insert Game Boy ..." - } - - strcat(g_CheatMarqueeString, "\n"); - } - - len = strlen(g_CheatMarqueeString); - - if (var80074024pf != len) { - var80074024pf = len; - - if (len > var80074020pf) { - var80074020pf = len; - } - } - - return g_CheatMarqueeString; - } -#elif VERSION >= VERSION_PAL_FINAL - s32 len; - static s32 var80074020pf = 0; - static s32 var80074024pf = 0; - - if (g_Menus[g_MpPlayerNum].curdialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem - && g_Menus[g_MpPlayerNum].curdialog->focuseditem->type == MENUITEMTYPE_CHECKBOX) { - cheat_id = g_Menus[g_MpPlayerNum].curdialog->focuseditem->param; - - if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem == &g_CheatsBuddiesMenuItems[0]) { - // Velvet - sprintf(g_CheatMarqueeString, "%s: %s", langGet(L_MPWEAPONS_143), langGet(L_MPWEAPONS_117)); // "Buddy Available", "Velvet Dark" - } else if (cheatIsUnlocked(cheat_id)) { - // Show cheat name - sprintf(g_CheatMarqueeString, "%s: %s\n", - g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog ? langGet(L_MPWEAPONS_143) : langGet(L_MPWEAPONS_136), // "Buddy Available", "Cheat available" - langGet(g_Cheats[cheat_id].nametextid) - ); - } else { - // Locked - strcpy(cheatname, langGet(g_Cheats[cheat_id].nametextid)); - ptr = cheatname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - if (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION) { - sprintf(g_CheatMarqueeString, "%s %s: %s %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } else { - // Timed - strcpy(difficultyname, langGet(L_OPTIONS_251 + g_Cheats[cheat_id].difficulty)); - ptr = difficultyname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - sprintf(g_CheatMarqueeString, "%s %s: %s %s %s %s %d:%02d %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_139), // "on" - &difficultyname, - langGet(L_MPWEAPONS_140), // "in under" - g_Cheats[cheat_id].time / 60, - g_Cheats[cheat_id].time % 60, - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } - - if (g_Cheats[cheat_id].flags & CHEATFLAG_TRANSFERPAK) { - strcat(g_CheatMarqueeString, langGet(L_MPWEAPONS_141)); // " or insert Game Boy ..." - } - - strcat(g_CheatMarqueeString, "\n"); - } - - len = strlen(g_CheatMarqueeString); - - if (var80074024pf != len) { - var80074024pf = len; - - if (len > var80074020pf) { - var80074020pf = len; - } - } - - return g_CheatMarqueeString; - } -#elif VERSION >= VERSION_NTSC_1_0 - if (g_Menus[g_MpPlayerNum].curdialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem - && g_Menus[g_MpPlayerNum].curdialog->focuseditem->type == MENUITEMTYPE_CHECKBOX) { - cheat_id = g_Menus[g_MpPlayerNum].curdialog->focuseditem->param; - - if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem == &g_CheatsBuddiesMenuItems[0]) { - // Velvet - sprintf(g_CheatMarqueeString, "%s: %s", langGet(L_MPWEAPONS_143), langGet(L_MPWEAPONS_117)); // "Buddy Available", "Velvet Dark" - } else if (cheatIsUnlocked(cheat_id)) { - // Show cheat name - sprintf(g_CheatMarqueeString, "%s: %s\n", - g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog ? langGet(L_MPWEAPONS_143) : langGet(L_MPWEAPONS_136), // "Buddy Available", "Cheat available" - langGet(g_Cheats[cheat_id].nametextid) - ); - } else { - // Locked - strcpy(cheatname, langGet(g_Cheats[cheat_id].nametextid)); - ptr = cheatname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - if (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION) { - sprintf(g_CheatMarqueeString, "%s %s: %s %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } else { - // Timed - strcpy(difficultyname, langGet(L_OPTIONS_251 + g_Cheats[cheat_id].difficulty)); - ptr = difficultyname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - sprintf(g_CheatMarqueeString, "%s %s: %s %s %s %s %d:%02d %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_139), // "on" - &difficultyname, - langGet(L_MPWEAPONS_140), // "in under" - g_Cheats[cheat_id].time / 60, - g_Cheats[cheat_id].time % 60, - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } - - if (g_Cheats[cheat_id].flags & CHEATFLAG_TRANSFERPAK) { - strcat(g_CheatMarqueeString, langGet(L_MPWEAPONS_141)); // " or insert Game Boy ..." - } - - strcat(g_CheatMarqueeString, "\n"); - } - - return g_CheatMarqueeString; - } -#else - if (g_Menus[g_MpPlayerNum].curdialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem - && g_Menus[g_MpPlayerNum].curdialog->focuseditem->type == MENUITEMTYPE_CHECKBOX) { - cheat_id = g_Menus[g_MpPlayerNum].curdialog->focuseditem->param; - - if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog - && g_Menus[g_MpPlayerNum].curdialog->focuseditem == &g_CheatsBuddiesMenuItems[0]) { - // Velvet - sprintf(g_StringPointer, "%s: %s", langGet(L_MPWEAPONS_143), langGet(L_MPWEAPONS_117)); // "Buddy Available", "Velvet Dark" - } else if (cheatIsUnlocked(cheat_id)) { - // Show cheat name - sprintf(g_StringPointer, "%s: %s\n", - g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog ? langGet(L_MPWEAPONS_143) : langGet(L_MPWEAPONS_136), // "Buddy Available", "Cheat available" - langGet(g_Cheats[cheat_id].nametextid) - ); - } else { - // Locked - strcpy(cheatname, langGet(g_Cheats[cheat_id].nametextid)); - ptr = cheatname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - if (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION) { - sprintf(g_StringPointer, "%s %s: %s %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } else { - // Timed - strcpy(difficultyname, langGet(L_OPTIONS_251 + g_Cheats[cheat_id].difficulty)); - ptr = difficultyname; - - while (*ptr != '\n') { - ptr++; - } - - *ptr = '\0'; - - sprintf(g_StringPointer, "%s %s: %s %s %s %s %d:%02d %s %s", - langGet(L_MPWEAPONS_137), // "Complete" - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name1), - langGet(g_StageNames[g_Cheats[cheat_id].stage_index].name2), - langGet(L_MPWEAPONS_139), // "on" - &difficultyname, - langGet(L_MPWEAPONS_140), // "in under" - g_Cheats[cheat_id].time / 60, - g_Cheats[cheat_id].time % 60, - langGet(L_MPWEAPONS_138), // "for cheat:" - &cheatname - ); - } - - if (g_Cheats[cheat_id].flags & CHEATFLAG_TRANSFERPAK) { - strcat(g_StringPointer, langGet(L_MPWEAPONS_141)); // " or insert Game Boy ..." - } - - strcat(g_StringPointer, "\n"); - } - - return g_StringPointer; - } -#endif - - // No cheat selected - return langGet(L_MPWEAPONS_142); // "Select cheat for information" -} - -s32 cheatMenuHandleTurnOffAllCheats(s32 operation, struct menuitem *item, union handlerdata *data) -{ - if (operation == MENUOP_SET) { - g_CheatsEnabledBank0 = 0; - g_CheatsEnabledBank1 = 0; - } - - return false; -} - -#if VERSION >= VERSION_NTSC_1_0 -s32 cheatGetByTimedStageIndex(s32 stage_index, s32 difficulty) -{ - s32 cheat_id; - - for (cheat_id = 0; cheat_id < NUM_CHEATS; cheat_id++) { - if (g_Cheats[cheat_id].stage_index == stage_index && - g_Cheats[cheat_id].difficulty == difficulty && - (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION) == 0 && - (g_Cheats[cheat_id].flags & CHEATFLAG_FIRINGRANGE) == 0) { - return cheat_id; - } - } - - return -1; -} -#endif - -#if VERSION >= VERSION_NTSC_1_0 -s32 cheatGetByCompletedStageIndex(s32 stage_index) -{ - s32 cheat_id; - - for (cheat_id = 0; cheat_id < NUM_CHEATS; cheat_id++) { - if (g_Cheats[cheat_id].stage_index == stage_index && (g_Cheats[cheat_id].flags & CHEATFLAG_COMPLETION)) { - return cheat_id; - } - } - - return -1; -} -#endif - -#if VERSION >= VERSION_NTSC_1_0 -s32 cheatGetTime(s32 cheat_id) -{ - return g_Cheats[cheat_id].time; -} -#endif - -#if VERSION >= VERSION_NTSC_1_0 -char *cheatGetName(s32 cheat_id) -{ - return langGet(g_Cheats[cheat_id].nametextid); -} -#endif - -struct menuitem g_CheatsFunMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - CHEAT_DKMODE, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SMALLJO, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SMALLCHARACTERS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_TEAMHEADSONLY, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PLAYASELVIS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SLOMO, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - (u32)&cheatGetMarquee, - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsFunMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_118, // "Fun" - g_CheatsFunMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsGameplayMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - CHEAT_INVINCIBLE, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_CLOAKINGDEVICE, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_MARQUIS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_JOSHIELD, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SUPERSHIELD, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ENEMYSHIELDS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ENEMYROCKETS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PERFECTDARKNESS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - (u32)&cheatGetMarquee, - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsGameplayMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_119, // "Gameplay" - g_CheatsGameplayMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsSoloWeaponsMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ROCKETLAUNCHER, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SNIPERRIFLE, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_SUPERDRAGON, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_LAPTOPGUN, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PHOENIX, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PSYCHOSISGUN, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_TRENTSMAGNUM, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_FARSIGHT, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - (u32)&cheatGetMarquee, - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsSoloWeaponsMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_122, // "Weapons for Jo in Solo" - g_CheatsSoloWeaponsMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsClassicWeaponsMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PP9I, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_CC13, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_KL01313, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_KF7SPECIAL, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ZZT, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_DMC, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_AR53, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_RCP45, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x000000c8, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - L_MPWEAPONS_144, // "Win Golds on the firing range to enable classic guns." - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x000000c8, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsClassicWeaponsMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_123, // "Classic Weapons for Jo in Solo" - g_CheatsClassicWeaponsMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsWeaponsMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - CHEAT_CLASSICSIGHT, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_UNLIMITEDAMMOLAPTOP, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_HURRICANEFISTS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_UNLIMITEDAMMO, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_UNLIMITEDAMMONORELOADS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_XRAYSCANNER, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_RTRACKER, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ALLGUNS, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatCheckboxMenuHandler, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - (u32)&cheatGetMarquee, - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsWeaponsMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_120, // "Weapons" - g_CheatsWeaponsMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsBuddiesMenuItems[] = { - { - MENUITEMTYPE_CHECKBOX, - 0, - 0, - L_MPWEAPONS_117, // "Velvet Dark" - 0, - cheatMenuHandleBuddyCheckbox, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_PUGILIST, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatMenuHandleBuddyCheckbox, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_HOTSHOT, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatMenuHandleBuddyCheckbox, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_HITANDRUN, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatMenuHandleBuddyCheckbox, - }, - { - MENUITEMTYPE_CHECKBOX, - CHEAT_ALIEN, - 0, - (u32)&cheatGetNameIfUnlocked, - 0, - cheatMenuHandleBuddyCheckbox, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_MARQUEE, - 0, - MENUITEMFLAG_SMALLFONT | MENUITEMFLAG_MARQUEE_FADEBOTHSIDES, - (u32)&cheatGetMarquee, - 0, - NULL, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsBuddiesMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPWEAPONS_121, // "Buddies" - g_CheatsBuddiesMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; - -struct menuitem g_CheatsMenuItems[] = { - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_118, // "Fun" - 0, - (void *)&g_CheatsFunMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_119, // "Gameplay" - 0, - (void *)&g_CheatsGameplayMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_122, // "Weapons for Jo in Solo" - 0, - (void *)&g_CheatsSoloWeaponsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_123, // "Classic Weapons for Jo in Solo" - 0, - (void *)&g_CheatsClassicWeaponsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_120, // "Weapons" - 0, - (void *)&g_CheatsWeaponsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG, - L_MPWEAPONS_121, // "Buddies" - 0, - (void *)&g_CheatsBuddiesMenuDialog, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - 0, - L_MPWEAPONS_217, // "Turn off all Cheats" - 0, - cheatMenuHandleTurnOffAllCheats, - }, - { - MENUITEMTYPE_SEPARATOR, - 0, - 0, - 0x00000096, - 0, - NULL, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE, - L_MPMENU_477, // "Done" - 0, - NULL, - }, - { MENUITEMTYPE_END }, -}; - -struct menudialogdef g_CheatsMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_MPMENU_476, // "Cheats" - g_CheatsMenuItems, - cheatMenuHandleDialog, - 0, - NULL, -}; diff --git a/src/game/chr.c b/src/game/chr.c index ad7389f71..bd5190a11 100644 --- a/src/game/chr.c +++ b/src/game/chr.c @@ -2,7 +2,6 @@ #include "lib/sched.h" #include "constants.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/debug.h" #include "game/chr.h" @@ -1070,11 +1069,6 @@ void chrInit(struct prop *prop) chr->invalidmove = 0; chr->lastmoveok60 = g_Vars.lvframe60; chr->visionrange = 250; - - if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - chr->visionrange = 4; - } - chr->shotbondsum = 0; chr->damage = 0; chr->sumground = 0; @@ -1310,10 +1304,6 @@ struct prop *chrAllocate(struct model *model, struct coord *pos, s16 *rooms, f32 if (prop) { prop = chr0f020b14(prop, model, pos, rooms, faceangle); - - if (cheatIsActive(CHEAT_ENEMYSHIELDS)) { - chrSetShield(prop->chr, 8); - } } return prop; @@ -1635,14 +1625,6 @@ void chrHandleJointPositioned(s32 joint, Mtxf *mtx) neckjoint = -1; } - if (cheatIsActive(CHEAT_DKMODE) && CHRRACE(g_CurModelChr) == RACE_HUMAN) { - if (joint == neckjoint) { - scale = 4.0f; - } else if (joint == lshoulderjoint || joint == rshoulderjoint) { - scale = 2.5f; - } - } - if (joint == lshoulderjoint || joint == rshoulderjoint || joint == waistjoint || joint == neckjoint) { xrot = 0.0f; yrot = 0.0f; @@ -2582,10 +2564,6 @@ s32 chrTick(struct prop *prop) chr->hidden |= CHRHFLAG_00800000; } - if (cheatIsActive(CHEAT_DKMODE)) { - modelSetDistanceScale(0.3125f); - } - g_ModelJointPositionedFunc = &chrHandleJointPositioned; g_CurModelChr = chr; @@ -3504,10 +3482,6 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool xlupass) shadowalpha = shadowalpha * (400 - gaptoground) * 0.004f; } - if (cheatIsActive(CHEAT_SMALLCHARACTERS)) { - radius *= 0.4f; - } - gdl = gfxRenderRadialShadow(gdl, prop->pos.x, chr->ground, prop->pos.z, chrGetInverseTheta(chr), radius, 0xffffff00 | shadowalpha); } } diff --git a/src/game/dlights.c b/src/game/dlights.c index 499f1637d..4d7c7ca52 100644 --- a/src/game/dlights.c +++ b/src/game/dlights.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/dlights.h" #include "game/gfxmemory.h" #include "game/propsnd.h" @@ -412,26 +411,9 @@ void roomInitLights(s32 roomnum) room->flags |= ROOMFLAG_DIRTY; -#if VERSION < VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_PERFECTDARKNESS) && (room->flags & ROOMFLAG_RENDERALWAYS) == 0) { - room->lightop = LIGHTOP_1; - room->unk60 = 0.0f; - } -#endif - light = (struct light *)&g_BgLightsFileData[(u32)g_Rooms[roomnum].lightindex * 0x22]; for (i = 0; i < room->numlights; i++) { -#if VERSION < VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - light->unk04 = 0; - light->unk05_00 = (random() % 2) ? true : false; - light->healthy = false; - light->on = false; - light->sparking = false; - light->vulnerable = false; - } else -#endif { light->unk04 = g_Rooms[roomnum].unk4a; light->unk05_00 = true; @@ -919,7 +901,7 @@ void roomSetLightsOn(s32 roomnum, s32 enable) void roomSetLighting(s32 roomnum, s32 operation, u8 arg2, u8 arg3, u8 arg4) { - if (cheatIsActive(CHEAT_PERFECTDARKNESS) == false) { + { g_Rooms[roomnum].lightop = operation; switch (operation) { @@ -1826,11 +1808,6 @@ void func0f0037ac(void) f32 average; u32 stack; -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - func0f00372c(); - } -#else static s32 prevtickmode = 0; if (prevtickmode != g_Vars.tickmode) { @@ -1840,7 +1817,6 @@ void func0f0037ac(void) prevtickmode = g_Vars.tickmode; } -#endif if (var80061420 == NULL) { return; diff --git a/src/game/filelist.c b/src/game/filelist.c index 37f65a257..88c689466 100644 --- a/src/game/filelist.c +++ b/src/game/filelist.c @@ -2,7 +2,6 @@ #include "constants.h" #include "constants.h" #include "game/camdraw.h" -#include "game/cheats.h" #include "game/player.h" #include "game/savebuffer.h" #include "game/filelist.h" diff --git a/src/game/game_00b820.c b/src/game/game_00b820.c index f20531181..30f9b8805 100644 --- a/src/game/game_00b820.c +++ b/src/game/game_00b820.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/game_00b820.h" #include "game/playerreset.h" #include "game/body.h" diff --git a/src/game/game_0b0fd0.c b/src/game/game_0b0fd0.c index 563c68c9f..4be9e79d8 100644 --- a/src/game/game_0b0fd0.c +++ b/src/game/game_0b0fd0.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/inv.h" #include "game/bondgun.h" #include "game/game_0b0fd0.h" @@ -581,10 +580,6 @@ u32 currentPlayerGetSight(void) return SIGHT_NONE; } - if (cheatIsActive(CHEAT_CLASSICSIGHT)) { - return SIGHT_CLASSIC; - } - switch (g_Vars.currentplayer->hands[HAND_RIGHT].gset.weaponnum) { case WEAPON_HORIZONSCANNER: return SIGHT_NONE; diff --git a/src/game/gamefile.c b/src/game/gamefile.c index 12a5e93c6..e8a0ec437 100644 --- a/src/game/gamefile.c +++ b/src/game/gamefile.c @@ -2,7 +2,6 @@ #include "constants.h" #include "constants.h" #include "game/camdraw.h" -#include "game/cheats.h" #include "game/player.h" #include "game/savebuffer.h" #include "game/bg.h" @@ -284,7 +283,6 @@ s32 gamefileLoad(s32 device) g_FilemgrLastPakError = ret; if (ret == 0) { - cheatsInit(); savebufferReadString(&buffer, g_GameFile.name, 0); g_GameFile.thumbnail = savebufferReadBits(&buffer, 5); g_GameFile.totaltime = savebufferReadBits(&buffer, 32); diff --git a/src/game/inv.c b/src/game/inv.c index d46b4ae29..334630325 100644 --- a/src/game/inv.c +++ b/src/game/inv.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/bondgun.h" #include "game/game_0b0fd0.h" #include "game/inv.h" @@ -449,17 +448,6 @@ bool invGiveProp(struct prop *prop) { struct invitem *item; - // Don't add duplicate night vision to inventory - // (night vision is already there when using perfect darkness) - // Note that this check doesn't work on Investigation because it uses the - // IR specs model. See bug note in Investigation's setup file (setupear.c). - if (cheatIsActive(CHEAT_PERFECTDARKNESS) - && prop->type == PROPTYPE_OBJ - && prop->obj - && prop->obj->modelnum == MODEL_CHRNIGHTSIGHT) { - return true; - } - item = invFindUnusedSlot(); if (item) { @@ -508,10 +496,6 @@ s32 invGiveWeaponsByProp(struct prop *prop) weaponnum = weapon->weaponnum; otherweaponnum; - if (cheatIsActive(CHEAT_PERFECTDARKNESS) && weaponnum == WEAPON_NIGHTVISION) { - return 1; - } - if (invGiveSingleWeapon(weaponnum)) { numgiven = 1; } diff --git a/src/game/invreset.c b/src/game/invreset.c index 98fcd6350..2dada896d 100644 --- a/src/game/invreset.c +++ b/src/game/invreset.c @@ -1,7 +1,6 @@ #include #include "constants.h" #include "constants.h" -#include "game/cheats.h" #include "game/inv.h" #include "bss.h" #include "lib/memp.h" @@ -12,11 +11,7 @@ void invReset(void) { s32 i; - if (PLAYERCOUNT() == 1 && g_Vars.normmplayerisrunning == false) { - g_Vars.currentplayer->equipallguns = cheatIsActive(CHEAT_ALLGUNS); - } else { - g_Vars.currentplayer->equipallguns = false; - } + g_Vars.currentplayer->equipallguns = false; for (i = 0; i != 10; i++) { g_Vars.currentplayer->gunheldarr[i].totaltime240_60 = -1; diff --git a/src/game/lv.c b/src/game/lv.c index bde87c49e..55e004710 100644 --- a/src/game/lv.c +++ b/src/game/lv.c @@ -12,7 +12,6 @@ #include "game/bondview.h" #include "game/camdraw.h" #include "game/casing.h" -#include "game/cheats.h" #include "game/chr.h" #include "game/chraction.h" #include "game/credits.h" @@ -256,8 +255,6 @@ void lvReset(s32 stagenum) g_Vars.paksconnected = 0; g_Vars.stagenum = stagenum; - cheatsReset(); - var80084040 = true; g_Vars.lvframenum = 0; var80084050 = 0; @@ -2031,16 +2028,6 @@ s32 lvGetSlowMotionType(void) if (g_MpSetup.options & MPOPTION_SLOWMOTION_SMART) { return SLOWMOTION_SMART; } - } else { - if (cheatIsActive(CHEAT_SLOMO)) { - return SLOWMOTION_ON; - } - if (debugGetSlowMotion() == SLOWMOTION_ON) { - return SLOWMOTION_ON; - } - if (debugGetSlowMotion() == SLOWMOTION_SMART) { - return SLOWMOTION_SMART; - } } return SLOWMOTION_OFF; diff --git a/src/game/mainmenu.c b/src/game/mainmenu.c index b1a597695..d0e7e514e 100644 --- a/src/game/mainmenu.c +++ b/src/game/mainmenu.c @@ -1,7 +1,6 @@ #include #include "constants.h" #include "game/bossfile.h" -#include "game/cheats.h" #include "game/setup.h" #include "game/title.h" #include "game/pdmode.h" @@ -2110,58 +2109,6 @@ struct menuitem g_2PMissionOptionsVMenuItems[] = { { MENUITEMTYPE_END }, }; -struct menuitem g_CiOptionsMenuItems[] = { - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x000056b5, - 0x00000001, - (void *)&g_AudioOptionsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x000056b6, - 0x00000002, - (void *)&g_VideoOptionsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x000056b7, - 0x00000003, - (void *)&g_CiControlOptionsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x000056b8, - 0x00000004, - (void *)&g_CiDisplayMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x000056b9, - 0x00000005, - (void *)&g_CheatsMenuDialog, - }, - { - MENUITEMTYPE_SELECTABLE, - 0, - MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_BIGFONT, - 0x00005679, - 0x00000006, - (void *)&g_CinemaMenuDialog, - }, - { MENUITEMTYPE_END }, -}; - struct menudialogdef g_SoloMissionOptionsMenuDialog = { MENUDIALOGTYPE_DEFAULT, L_OPTIONS_180, // "Options" @@ -2171,42 +2118,6 @@ struct menudialogdef g_SoloMissionOptionsMenuDialog = { &g_SoloMissionBriefingMenuDialog, }; -struct menudialogdef g_CiOptionsViaPcMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_OPTIONS_180, // "Options" - g_CiOptionsMenuItems, - menudialog0010559c, - 0, - NULL, -}; - -struct menudialogdef g_CiOptionsViaPauseMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_OPTIONS_180, // "Options" - g_CiOptionsMenuItems, - menudialog0010559c, - 0, - NULL, -}; - -struct menudialogdef g_2PMissionOptionsHMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_OPTIONS_180, // "Options" - g_2PMissionOptionsHMenuItems, - menudialog0010559c, - 0, - &g_2PMissionBriefingHMenuDialog, -}; - -struct menudialogdef g_2PMissionOptionsVMenuDialog = { - MENUDIALOGTYPE_DEFAULT, - L_OPTIONS_180, // "Options" - g_2PMissionOptionsVMenuItems, - menudialog0010559c, - 0, - &g_2PMissionBriefingVMenuDialog, -}; - u8 var80072d88 = 255; char *invMenuTextPrimaryFunction(struct menuitem *item) diff --git a/src/game/modelmgrreset.c b/src/game/modelmgrreset.c index b35585dcf..452e0f67c 100644 --- a/src/game/modelmgrreset.c +++ b/src/game/modelmgrreset.c @@ -2,7 +2,6 @@ #include "constants.h" #include "constants.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/inv.h" #include "game/playerreset.h" #include "game/chr.h" diff --git a/src/game/mplayer/ingame.c b/src/game/mplayer/ingame.c index 0d65d2ac4..4bcc4fe08 100644 --- a/src/game/mplayer/ingame.c +++ b/src/game/mplayer/ingame.c @@ -770,9 +770,7 @@ void mpPushEndscreenDialog(u32 arg0, u32 playernum) if (g_MpSetup.options & MPOPTION_TEAMSENABLED) { if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) { - if (g_CheatsActiveBank0 || g_CheatsActiveBank1) { - menuPushRootDialog(&g_MpEndscreenChallengeCheatedMenuDialog, MENUROOT_MPENDSCREEN); - } else if (challengeIsCompleteForEndscreen()) { + if (challengeIsCompleteForEndscreen()) { menuPushRootDialog(&g_MpEndscreenChallengeCompletedMenuDialog, MENUROOT_MPENDSCREEN); } else { menuPushRootDialog(&g_MpEndscreenChallengeFailedMenuDialog, MENUROOT_MPENDSCREEN); diff --git a/src/game/mplayer/mplayer.c b/src/game/mplayer/mplayer.c index 803b088a7..144d72701 100644 --- a/src/game/mplayer/mplayer.c +++ b/src/game/mplayer/mplayer.c @@ -2282,7 +2282,7 @@ void mpCalculateAwards(void) mpplayer->medals = 0; - if (!g_CheatsActiveBank0 && !g_CheatsActiveBank1) { + { mpplayer->kills += metrics[i].numkills; mpplayer->deaths += metrics[i].numdeaths; mpplayer->gamesplayed++; @@ -2549,7 +2549,7 @@ void mpCalculateAwards(void) } } - if (!g_CheatsActiveBank0 && !g_CheatsActiveBank1) { + { if (mostkillsplayer < 4 && mostkillsplayer >= 0) { struct mpplayerconfig *mpplayer = (struct mpplayerconfig *)MPCHR(mostkillsplayer); mpplayer->medals |= MEDAL_KILLMASTER; @@ -2565,7 +2565,7 @@ void mpCalculateAwards(void) } // Calculate Headshot and Accuracy medals - if (!g_CheatsActiveBank0 && !g_CheatsActiveBank1 && playercount >= 2) { + if (playercount >= 2) { s32 mostheadshotvalue = 0; f32 mostaccuratevalue = 0.5f; s32 mostheadshotplayer = -1; diff --git a/src/game/mpstats.c b/src/game/mpstats.c index dfc66318a..472eb8171 100644 --- a/src/game/mpstats.c +++ b/src/game/mpstats.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/inv.h" #include "game/bondgun.h" #include "game/game_0b0fd0.h" diff --git a/src/game/options.c b/src/game/options.c index 9a38dbe18..8b8110068 100644 --- a/src/game/options.c +++ b/src/game/options.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/mainmenu.h" #include "game/music.h" #include "game/options.h" @@ -252,22 +251,6 @@ s32 optionsGetEffectiveScreenSize(void) || g_Menus[g_MpPlayerNum].curdialog->definition == &g_SoloMissionControlStyleMenuDialog) { return SCREENSIZE_FULL; } - -#if VERSION >= VERSION_JPN_FINAL - if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsFunMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsGameplayMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsSoloWeaponsMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsClassicWeaponsMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsWeaponsMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsBuddiesMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_CheatsMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_AcceptMissionMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_PreAndPostMissionBriefingMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_RetryMissionMenuDialog - || g_Menus[g_MpPlayerNum].curdialog->definition == &g_NextMissionMenuDialog) { - return SCREENSIZE_FULL; - } -#endif } if (PLAYERCOUNT() >= 2 || g_MenuData.root == MENUROOT_MPSETUP) { diff --git a/src/game/player.c b/src/game/player.c index f4575fcf3..272e0c798 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -2,7 +2,6 @@ #include "constants.h" #include "game/bondeyespy.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/floor.h" #include "game/inv.h" @@ -951,15 +950,6 @@ void playerSpawn(void) invGiveSingleWeapon(WEAPON_UNARMED); playerSetShieldFrac(0); - if (cheatIsActive(CHEAT_JOSHIELD)) { - playerSetShieldFrac(1); - } - - if (cheatIsActive(CHEAT_SUPERSHIELD)) { - playerSetShieldFrac(1); - g_Vars.currentplayer->armourscale = 2; - } - if (g_Vars.mplayerisrunning) { if (g_Vars.antiplayernum >= 0 && g_Vars.currentplayer == g_Vars.anti) { numsqdists = 0; @@ -1170,12 +1160,6 @@ void playerChooseBodyAndHead(s32 *bodynum, s32 *headnum, s32 *arg2) outfit = g_Vars.currentplayer->bondtype; solo = !(g_Vars.coopplayernum >= 0) || (g_Vars.currentplayer != g_Vars.coop); - if (cheatIsActive(CHEAT_PLAYASELVIS)) { - *bodynum = BODY_THEKING; - *headnum = HEAD_ELVIS; - return; - } - if (g_Vars.stagenum == STAGE_VILLA && lvGetDifficulty() >= DIFF_PA) { outfit = OUTFIT_NEGOTIATOR; } @@ -4821,16 +4805,6 @@ bool playerIsHealthVisible(void) return g_Vars.currentplayer->healthshowmode != HEALTHSHOWMODE_HIDDEN; } -// Never called -void playerSetInvincible(bool enable) -{ - if (enable) { - cheatActivate(CHEAT_INVINCIBLE); - } else { - cheatDeactivate(CHEAT_INVINCIBLE); - } -} - void playerSetBondVisible(bool visible) { g_Vars.bondvisible = visible; diff --git a/src/game/playermgr.c b/src/game/playermgr.c index 2d13671d1..793b36a27 100644 --- a/src/game/playermgr.c +++ b/src/game/playermgr.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/bondgun.h" #include "game/player.h" #include "game/playermgr.h" @@ -539,7 +538,7 @@ void playermgrAllocatePlayer(s32 index) g_Vars.players[index]->equipcuritem = 0; g_Vars.players[index]->angleoffset = 0; - g_Vars.players[index]->invincible = cheatIsActive(CHEAT_INVINCIBLE); + g_Vars.players[index]->invincible = 0; g_Vars.players[index]->healthdamagetype = 7; g_Vars.players[index]->vv_height = 1; g_Vars.players[index]->vv_eyeheight = 1; diff --git a/src/game/playerreset.c b/src/game/playerreset.c index 6ee9b6719..fb93177f4 100644 --- a/src/game/playerreset.c +++ b/src/game/playerreset.c @@ -2,7 +2,6 @@ #include "constants.h" #include "constants.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/inv.h" #include "game/playerreset.h" #include "game/chr.h" @@ -170,118 +169,6 @@ void playerReset(void) invGiveSingleWeapon(WEAPON_UNARMED); - if (cheatIsActive(CHEAT_TRENTSMAGNUM)) { - invGiveSingleWeapon(WEAPON_DY357LX); - bgunSetAmmoQuantity(AMMOTYPE_MAGNUM, 80); - } - - if (cheatIsActive(CHEAT_FARSIGHT)) { - invGiveSingleWeapon(WEAPON_FARSIGHT); - bgunSetAmmoQuantity(AMMOTYPE_FARSIGHT, 80); - } - - if (cheatIsActive(CHEAT_CLOAKINGDEVICE)) { - invGiveSingleWeapon(WEAPON_CLOAKINGDEVICE); -#if VERSION >= VERSION_PAL_FINAL - bgunSetAmmoQuantity(AMMOTYPE_CLOAK, TICKS(7200)); -#else - bgunSetAmmoQuantity(AMMOTYPE_CLOAK, 7200); -#endif - } - - if (cheatIsActive(CHEAT_PERFECTDARKNESS)) { - invGiveSingleWeapon(WEAPON_NIGHTVISION); - } - - if (cheatIsActive(CHEAT_RTRACKER)) { - invGiveSingleWeapon(WEAPON_RTRACKER); - } - - if (cheatIsActive(CHEAT_ROCKETLAUNCHER)) { - invGiveSingleWeapon(WEAPON_ROCKETLAUNCHER); - bgunSetAmmoQuantity(AMMOTYPE_ROCKET, 10); - } - - if (cheatIsActive(CHEAT_SNIPERRIFLE)) { - invGiveSingleWeapon(WEAPON_SNIPERRIFLE); - bgunSetAmmoQuantity(AMMOTYPE_RIFLE, 200); - } - - if (cheatIsActive(CHEAT_XRAYSCANNER)) { - invGiveSingleWeapon(WEAPON_XRAYSCANNER); - } - - if (cheatIsActive(CHEAT_SUPERDRAGON)) { - invGiveSingleWeapon(WEAPON_SUPERDRAGON); - bgunSetAmmoQuantity(AMMOTYPE_RIFLE, 200); - bgunSetAmmoQuantity(AMMOTYPE_DEVASTATOR, 20); - } - - if (cheatIsActive(CHEAT_LAPTOPGUN)) { - invGiveSingleWeapon(WEAPON_LAPTOPGUN); - bgunSetAmmoQuantity(AMMOTYPE_SMG, 200); - } - - if (cheatIsActive(CHEAT_PHOENIX)) { - invGiveSingleWeapon(WEAPON_PHOENIX); - bgunSetAmmoQuantity(AMMOTYPE_PISTOL, 200); - } - -#if VERSION >= VERSION_NTSC_1_0 - if (cheatIsActive(CHEAT_PSYCHOSISGUN) || cheatIsActive(CHEAT_ALLGUNS)) { - bgunSetAmmoQuantity(AMMOTYPE_PSYCHOSIS, 4); - - if (cheatIsActive(CHEAT_PSYCHOSISGUN)) { - invGiveSingleWeapon(WEAPON_PSYCHOSISGUN); - } - } -#else - if (cheatIsActive(CHEAT_PSYCHOSISGUN)) { - invGiveSingleWeapon(WEAPON_PSYCHOSISGUN); - bgunSetAmmoQuantity(AMMOTYPE_PSYCHOSIS, 4); - } -#endif - - if (cheatIsActive(CHEAT_PP9I)) { - invGiveSingleWeapon(WEAPON_PP9I); - bgunSetAmmoQuantity(AMMOTYPE_PISTOL, 200); - } - - if (cheatIsActive(CHEAT_CC13)) { - invGiveSingleWeapon(WEAPON_CC13); - bgunSetAmmoQuantity(AMMOTYPE_RIFLE, 200); - } - - if (cheatIsActive(CHEAT_KL01313)) { - invGiveSingleWeapon(WEAPON_KL01313); - bgunSetAmmoQuantity(AMMOTYPE_SMG, 200); - } - - if (cheatIsActive(CHEAT_KF7SPECIAL)) { - invGiveSingleWeapon(WEAPON_KF7SPECIAL); - bgunSetAmmoQuantity(AMMOTYPE_RIFLE, 200); - } - - if (cheatIsActive(CHEAT_ZZT)) { - invGiveSingleWeapon(WEAPON_ZZT); - bgunSetAmmoQuantity(AMMOTYPE_SMG, 200); - } - - if (cheatIsActive(CHEAT_DMC)) { - invGiveSingleWeapon(WEAPON_DMC); - bgunSetAmmoQuantity(AMMOTYPE_SMG, 200); - } - - if (cheatIsActive(CHEAT_AR53)) { - invGiveSingleWeapon(WEAPON_AR53); - bgunSetAmmoQuantity(AMMOTYPE_RIFLE, 200); - } - - if (cheatIsActive(CHEAT_RCP45)) { - invGiveSingleWeapon(WEAPON_RCP45); - bgunSetAmmoQuantity(AMMOTYPE_SMG, 200); - } - if (!hasdefaultweapon) { g_DefaultWeapons[HAND_RIGHT] = WEAPON_UNARMED; } diff --git a/src/game/portal.c b/src/game/portal.c index cc68060e2..93b0efd07 100644 --- a/src/game/portal.c +++ b/src/game/portal.c @@ -2,7 +2,6 @@ #include "constants.h" #include "game/bondeyespy.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/inv.h" #include "game/nbomb.h" diff --git a/src/game/propobj.c b/src/game/propobj.c index 3858f79c0..708326dba 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -2,7 +2,6 @@ #include "constants.h" #include "game/bondmove.h" #include "game/bondwalk.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/debug.h" #include "game/dlights.h" @@ -1598,12 +1597,7 @@ void propCalculateShadeColour(struct prop *prop, u8 *nextcol, u16 floorcol) nextcol[3] = 0xff; } -#if VERSION >= VERSION_NTSC_1_0 - if (obj == NULL || (obj->flags & OBJFLAG_IGNOREROOMCOLOUR) == 0 || cheatIsActive(CHEAT_PERFECTDARKNESS)) -#else - if (obj == NULL || (obj->flags & OBJFLAG_IGNOREROOMCOLOUR) == 0) -#endif - { + if (obj == NULL || (obj->flags & OBJFLAG_IGNOREROOMCOLOUR) == 0) { s32 shade = func0f068fc8(prop, 0); roomr = shade; @@ -18185,11 +18179,7 @@ s32 objTestForPickup(struct prop *prop) } if (invHasSingleWeaponExcAllGuns(weapon->weaponnum) && bgunGetAmmoTypeForWeapon(weapon->weaponnum, FUNC_PRIMARY)) { - if (cheatIsActive(CHEAT_UNLIMITEDAMMO) || cheatIsActive(CHEAT_UNLIMITEDAMMONORELOADS)) { - maybe = false; - } else { - maybe = bgunGetAmmoQtyForWeapon(weapon->weaponnum, FUNC_PRIMARY) >= bgunGetAmmoCapacityForWeapon(weapon->weaponnum, FUNC_PRIMARY); - } + maybe = bgunGetAmmoQtyForWeapon(weapon->weaponnum, FUNC_PRIMARY) >= bgunGetAmmoCapacityForWeapon(weapon->weaponnum, FUNC_PRIMARY); if (weapon->weaponnum == WEAPON_SUPERDRAGON) { if (bgunGetAmmoQtyForWeapon(weapon->weaponnum, FUNC_SECONDARY) < bgunGetAmmoCapacityForWeapon(weapon->weaponnum, FUNC_SECONDARY)) { @@ -18308,28 +18298,19 @@ s32 objTestForPickup(struct prop *prop) f32 ydiff = prop->pos.y - playerprop->pos.y; f32 zdiff = prop->pos.z - playerprop->pos.z; f32 range; - bool usebigrange; bool pickup; u32 stack; - usebigrange = (obj->flags3 & OBJFLAG3_ONSHELF) - && (cheatIsActive(CHEAT_SMALLJO) || cheatIsActive(CHEAT_PLAYASELVIS)); - if (g_Vars.currentplayer->magnetattracttime >= 60) { pickup = xdiff * xdiff + zdiff * zdiff <= 350 * 350 && ydiff >= -500 && ydiff <= 500; } else { - if (usebigrange) { - range = 200 * 200; - } else { - range = 100 * 100; - } + range = 100 * 100; pickup = xdiff * xdiff + zdiff * zdiff <= range && ydiff >= -200 && ydiff <= 200; } if (pickup && (obj->flags2 & OBJFLAG2_PICKUPWITHOUTLOS) == 0 - && !usebigrange && cdTestLos05(&playerprop->pos, playerprop->rooms, &prop->pos, prop->rooms, CDTYPE_DOORS | CDTYPE_BG, GEOFLAG_WALL | GEOFLAG_BLOCK_SIGHT | GEOFLAG_BLOCK_SHOOT) == false) { @@ -19190,11 +19171,7 @@ struct autogunobj *laptopDeploy(s32 modelnum, struct gset *gset, struct chrdata laptop->ammoquantity = qty; } - if (cheatIsActive(CHEAT_UNLIMITEDAMMOLAPTOP)) { - laptop->ammoquantity = 255; - } else { - qty -= laptop->ammoquantity; - } + qty -= laptop->ammoquantity; bgunSetAmmoQtyForWeapon(WEAPON_LAPTOPGUN, FUNC_PRIMARY, qty); setCurrentPlayerNum(prevplayernum); diff --git a/src/game/proptick.c b/src/game/proptick.c index aab0be465..a4bb28507 100644 --- a/src/game/proptick.c +++ b/src/game/proptick.c @@ -2,7 +2,6 @@ #include "lib/sched.h" #include "constants.h" #include "game/bondmove.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/debug.h" #include "game/chr.h" diff --git a/src/game/radar.c b/src/game/radar.c index 3d6fa819d..a07471ffa 100644 --- a/src/game/radar.c +++ b/src/game/radar.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/chraction.h" #include "game/atan2f.h" #include "game/game_0b2150.h" @@ -435,8 +434,7 @@ Gfx *radarRenderRTrackedProps(Gfx *gdl) case PROPTYPE_WEAPON: obj = prop->obj; - if ((obj->flags3 & OBJFLAG3_RTRACKED_YELLOW) || - (cheatIsActive(CHEAT_RTRACKER) && (obj->flags3 & OBJFLAG3_RTRACKED_BLUE))) { + if (obj->flags3 & OBJFLAG3_RTRACKED_YELLOW) { dist1.x = prop->pos.x - playerpos->x; dist1.y = prop->pos.y - playerpos->y; dist1.z = prop->pos.z - playerpos->z; diff --git a/src/game/setup.c b/src/game/setup.c index 92cbb90e4..2510faea1 100644 --- a/src/game/setup.c +++ b/src/game/setup.c @@ -1,6 +1,5 @@ #include #include "constants.h" -#include "game/cheats.h" #include "game/game_00b820.h" #include "game/setup.h" #include "game/objectives.h" @@ -624,82 +623,8 @@ void setupPlaceWeapon(struct weaponobj *weapon, s32 cmdindex) struct chrdata *chr = chrFindByLiteralId(weapon->base.pad); if (chr && chr->prop && chr->model) { - if (cheatIsActive(CHEAT_MARQUIS)) { - // NTSC 1.0 and newer simplifies the Marquis logic -#if VERSION >= VERSION_NTSC_1_0 - weapon->base.flags &= ~OBJFLAG_DEACTIVATED; - weapon->base.flags |= OBJFLAG_WEAPON_AICANNOTUSE; - modelmgrLoadProjectileModeldefs(weapon->weaponnum); - func0f08b25c(weapon, chr); -#else - if (g_Vars.stagenum == STAGE_INVESTIGATION - && lvGetDifficulty() == DIFF_PA - && weapon->weaponnum == WEAPON_K7AVENGER) { - modelmgrLoadProjectileModeldefs(weapon->weaponnum); - func0f08b25c(weapon, chr); - } else if (g_Vars.stagenum == STAGE_ATTACKSHIP) { - weapon->base.flags &= ~OBJFLAG_DEACTIVATED; - weapon->base.flags |= OBJFLAG_WEAPON_AICANNOTUSE; - modelmgrLoadProjectileModeldefs(weapon->weaponnum); - func0f08b25c(weapon, chr); - } else { - weapon->weaponnum = WEAPON_NONE; - } -#endif - } else { - if (cheatIsActive(CHEAT_ENEMYROCKETS)) { - switch (weapon->weaponnum) { - case WEAPON_FALCON2: - case WEAPON_FALCON2_SILENCER: - case WEAPON_FALCON2_SCOPE: - case WEAPON_MAGSEC4: - case WEAPON_MAULER: - case WEAPON_PHOENIX: - case WEAPON_DY357MAGNUM: - case WEAPON_DY357LX: - case WEAPON_CMP150: - case WEAPON_CYCLONE: - case WEAPON_CALLISTO: - case WEAPON_RCP120: - case WEAPON_LAPTOPGUN: - case WEAPON_DRAGON: - case WEAPON_AR34: - case WEAPON_SUPERDRAGON: - case WEAPON_SHOTGUN: - case WEAPON_REAPER: - case WEAPON_SNIPERRIFLE: - case WEAPON_FARSIGHT: - case WEAPON_DEVASTATOR: - case WEAPON_ROCKETLAUNCHER: - case WEAPON_SLAYER: - case WEAPON_COMBATKNIFE: - case WEAPON_CROSSBOW: - case WEAPON_TRANQUILIZER: - case WEAPON_GRENADE: - case WEAPON_NBOMB: - case WEAPON_TIMEDMINE: - case WEAPON_PROXIMITYMINE: - case WEAPON_REMOTEMINE: - weapon->weaponnum = WEAPON_ROCKETLAUNCHER; - weapon->base.modelnum = MODEL_CHRDYROCKET; - weapon->base.extrascale = 256; - break; - case WEAPON_K7AVENGER: - // Don't replace the K7 guard's weapon in Investigation - // because it would make an objective impossible. - // @bug: It's still replaced on PD mode difficulty. - if (g_Vars.stagenum != STAGE_INVESTIGATION || lvGetDifficulty() != DIFF_PA) { - weapon->weaponnum = WEAPON_ROCKETLAUNCHER; - weapon->base.modelnum = MODEL_CHRDYROCKET; - weapon->base.extrascale = 256; - } - break; - } - } - - modelmgrLoadProjectileModeldefs(weapon->weaponnum); - func0f08b25c(weapon, chr); - } + modelmgrLoadProjectileModeldefs(weapon->weaponnum); + func0f08b25c(weapon, chr); } } else { bool giveweapon = true; diff --git a/src/include/bss.h b/src/include/bss.h index b05680fe4..b6ebb791a 100644 --- a/src/include/bss.h +++ b/src/include/bss.h @@ -175,10 +175,6 @@ extern struct menu g_Menus[4]; extern struct menudata g_MenuData; extern struct activemenu g_AmMenus[4]; extern s32 g_AmIndex; -extern u32 g_CheatsActiveBank0; -extern u32 g_CheatsActiveBank1; -extern u32 g_CheatsEnabledBank0; -extern u32 g_CheatsEnabledBank1; extern s32 g_FilemgrLastPakError; extern struct gamefile g_GameFile; extern struct fileguid g_GameFileGuid; diff --git a/src/include/data.h b/src/include/data.h index 85c1bd0ff..5f97b36e8 100644 --- a/src/include/data.h +++ b/src/include/data.h @@ -286,14 +286,11 @@ extern struct menudialogdef g_CiControlStylePlayer2MenuDialog; extern struct menudialogdef g_ChangeAgentMenuDialog; extern struct menudialogdef g_2PMissionOptionsHMenuDialog; extern struct menudialogdef g_2PMissionOptionsVMenuDialog; -extern struct menudialogdef g_FrWeaponsAvailableMenuDialog; extern struct menudialogdef g_SoloMissionPauseMenuDialog; extern struct menudialogdef g_2PMissionPauseHMenuDialog; extern struct menudialogdef g_2PMissionPauseVMenuDialog; -extern struct cutscene g_Cutscenes[]; extern struct menudialogdef g_CiMenuViaPcMenuDialog; extern struct menudialogdef g_CiMenuViaPauseMenuDialog; -extern struct menudialogdef g_CheatsMenuDialog; extern struct menudialogdef g_PakChoosePakMenuDialog; extern struct menudialogdef g_FilemgrFileSelect4MbMenuDialog; extern struct menudialogdef g_MpQuickGo4MbMenuDialog; diff --git a/src/include/game/cheats.h b/src/include/game/cheats.h deleted file mode 100644 index 32c4a823c..000000000 --- a/src/include/game/cheats.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef IN_GAME_CHEATS_H -#define IN_GAME_CHEATS_H -#include -#include "data.h" -#include "types.h" - -extern struct menudialogdef g_CheatsMenuDialog; -extern struct menudialogdef g_CheatsFunMenuDialog; -extern struct menudialogdef g_CheatsGameplayMenuDialog; -extern struct menudialogdef g_CheatsSoloWeaponsMenuDialog; -extern struct menudialogdef g_CheatsClassicWeaponsMenuDialog; -extern struct menudialogdef g_CheatsWeaponsMenuDialog; -extern struct menudialogdef g_CheatsBuddiesMenuDialog; - -u32 cheatIsUnlocked(s32 cheat_id); -bool cheatIsActive(s32 cheat_id); -void cheatActivate(s32 cheat_id); -void cheatDeactivate(s32 cheat_id); -void cheatsInit(void); -void cheatsReset(void); -char *cheatGetNameIfUnlocked(struct menuitem *item); -char *cheatGetMarquee(struct menuitem *item); -s32 cheatGetByTimedStageIndex(s32 stage_index, s32 difficulty); -s32 cheatGetByCompletedStageIndex(s32 stage_index); -s32 cheatGetTime(s32 cheat_id); -char *cheatGetName(s32 cheat_id); -s32 cheatMenuHandleDialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data); -s32 cheatCheckboxMenuHandler(s32 operation, struct menuitem *item, union handlerdata *data); -s32 cheatMenuHandleBuddyCheckbox(s32 operation, struct menuitem *item, union handlerdata *data); -s32 cheatMenuHandleTurnOffAllCheats(s32 operation, struct menuitem *item, union handlerdata *data); - -#endif diff --git a/src/lib/main.c b/src/lib/main.c index 499770e9e..19e2a7645 100644 --- a/src/lib/main.c +++ b/src/lib/main.c @@ -4,7 +4,6 @@ #include "lib/vars.h" #include "constants.h" #include "game/camdraw.h" -#include "game/cheats.h" #include "game/debug.h" #include "game/file.h" #include "game/lang.h" @@ -540,7 +539,6 @@ void mainInit(void) texInit(); langInit(); lvInit(); - cheatsInit(); func0000e9c0(); textInit(); dhudInit();