Add a cheat to allow dual-wielding all guns. The cheat's name is "Gameplay/(Two-Handed)"

This commit is contained in:
Not actually throwaway committed 2024-05-01 17:55:22 +02:00
1 parent a0f8550034
commit 798fbf7b90
4 files changed
+31 -1

No files matched your search

+13
View File
@@ -100,6 +100,9 @@ struct cheat g_Cheats[] = {
{ L_MPWEAPONS_114, WEAPON_DMC, 0, 0, CHEATFLAG_FIRINGRANGE }, // DMC { L_MPWEAPONS_114, WEAPON_DMC, 0, 0, CHEATFLAG_FIRINGRANGE }, // DMC
{ L_MPWEAPONS_115, WEAPON_AR53, 0, 0, CHEATFLAG_FIRINGRANGE }, // AR53 { L_MPWEAPONS_115, WEAPON_AR53, 0, 0, CHEATFLAG_FIRINGRANGE }, // AR53
{ L_MPWEAPONS_116, WEAPON_RCP45, 0, 0, CHEATFLAG_FIRINGRANGE }, // RC-P45 { L_MPWEAPONS_116, WEAPON_RCP45, 0, 0, CHEATFLAG_FIRINGRANGE }, // RC-P45
#ifndef PLATFORM_N64
{ L_MPWEAPONS_215, 0, SOLOSTAGEINDEX_EXTRACTION, DIFF_A, CHEATFLAG_COMPLETION }, // dual wield all guns cheat
#endif
}; };
u32 cheatIsUnlocked(s32 cheat_id) u32 cheatIsUnlocked(s32 cheat_id)
@@ -1090,6 +1093,16 @@ struct menuitem g_CheatsGameplayMenuItems[] = {
0, 0,
cheatCheckboxMenuHandler, cheatCheckboxMenuHandler,
}, },
#ifndef PLATFORM_N64
{
MENUITEMTYPE_CHECKBOX,
CHEAT_DUALWIELDALLGUNS,
0,
(uintptr_t)&cheatGetNameIfUnlocked,
0,
cheatCheckboxMenuHandler,
},
#endif
{ {
MENUITEMTYPE_SEPARATOR, MENUITEMTYPE_SEPARATOR,
0, 0,
+6 -1
View File
@@ -286,7 +286,12 @@ void currentPlayerZoomIn(f32 fovpersec)
bool weaponHasFlag(s32 itemid, u32 flag) bool weaponHasFlag(s32 itemid, u32 flag)
{ {
struct weapon *weapon = weaponFindById(itemid); struct weapon *weapon = weaponFindById(itemid);
#ifndef PLATFORM_N64 //always return, that weapon is dual-wieldable if player sets the cheat.
if (cheatIsActive(CHEAT_DUALWIELDALLGUNS) && (flag == WEAPONFLAG_DUALWIELD))
{
return true;
}
#endif
if (!weapon) { if (!weapon) {
return false; return false;
} }
+11
View File
@@ -510,6 +510,17 @@ s32 invGiveWeaponsByProp(struct prop *prop)
weapon = prop->weapon; weapon = prop->weapon;
weaponnum = weapon->weaponnum; weaponnum = weapon->weaponnum;
otherweaponnum; otherweaponnum;
#ifndef PLATFORM_N64
//This piece of code makes the cheat work in singleplayer.
if (cheatIsActive(CHEAT_DUALWIELDALLGUNS) && !g_Vars.normmplayerisrunning)
{
if(invHasSingleWeaponExcAllGuns(weaponnum) && (invHasDoubleWeaponExcAllGuns(weapon->weaponnum, weapon->weaponnum)==0))
{
invGiveDoubleWeapon(weaponnum, weaponnum);
numgiven = 2;
}
}
#endif
if (cheatIsActive(CHEAT_PERFECTDARKNESS) && weaponnum == WEAPON_NIGHTVISION) { if (cheatIsActive(CHEAT_PERFECTDARKNESS) && weaponnum == WEAPON_NIGHTVISION) {
return 1; return 1;
+1
View File
@@ -449,6 +449,7 @@
#define CHEAT_DMC 39 #define CHEAT_DMC 39
#define CHEAT_AR53 40 #define CHEAT_AR53 40
#define CHEAT_RCP45 41 #define CHEAT_RCP45 41
#define CHEAT_DUALWIELDALLGUNS 42
#define CHEATFLAG_TIMED 0 #define CHEATFLAG_TIMED 0
#define CHEATFLAG_ALWAYSON 1 #define CHEATFLAG_ALWAYSON 1