Skip to content

Commit

Permalink
Merge pull request #181 from jonaeru/enable-combatknife-jp
Browse files Browse the repository at this point in the history
Add the combat knife in jpn-final
  • Loading branch information
fgsfdsfgs authored Sep 24, 2023
2 parents d303971 + 9d2957c commit ee4434e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/game/bondgun.c
Original file line number Diff line number Diff line change
Expand Up @@ -5441,7 +5441,7 @@ void bgunTickSwitch2(void)
ctrl->switchtoweaponnum = WEAPON_UNARMED;
}

#if VERSION == VERSION_JPN_FINAL
#if (VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64)
if (ctrl->switchtoweaponnum == WEAPON_COMBATKNIFE) {
ctrl->switchtoweaponnum = WEAPON_UNARMED;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/botinv.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct aibotweaponpreference g_AibotWeaponPreferences[] = {
/*0x17*/ { 176, 188, 0, 0, 1, 1, BOTDISTCFG_SHOOTEXPLOSIVE, BOTDISTCFG_SHOOTEXPLOSIVE, 20, 20, 4, 4, 2, 0 }, // WEAPON_DEVASTATOR
/*0x18*/ { 160, 188, 0, 0, 1, 1, BOTDISTCFG_SHOOTEXPLOSIVE, BOTDISTCFG_SHOOTEXPLOSIVE, 2, 2, 1, 1, 2, 0 }, // WEAPON_ROCKETLAUNCHER
/*0x19*/ { 168, 188, 0, 0, 1, 1, BOTDISTCFG_SHOOTEXPLOSIVE, BOTDISTCFG_SHOOTEXPLOSIVE, 2, 2, 1, 1, 3, 0 }, // WEAPON_SLAYER
#if VERSION == VERSION_JPN_FINAL
#if (VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64)
/*0x1a*/ { 0, 0, 0, 0, 0, 0, BOTDISTCFG_DEFAULT, BOTDISTCFG_DEFAULT, 0, 0, 0, 0, 1, 0 }, // WEAPON_COMBATKNIFE
#else
/*0x1a*/ { 20, 40, 24, 40, 1, 1, BOTDISTCFG_CLOSE, BOTDISTCFG_DEFAULT, 0, 5, 0, 1, 1, 0 }, // WEAPON_COMBATKNIFE
Expand Down
4 changes: 2 additions & 2 deletions src/game/inv.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ s32 invAddOneIfCantHaveSlayer(s32 index)
index++;
}

#if VERSION >= VERSION_JPN_FINAL
#if (VERSION >= VERSION_JPN_FINAL) && defined(PLATFORM_N64)
if (index >= 26) {
index++;
}
Expand All @@ -310,7 +310,7 @@ bool invCanHaveAllGunsWeapon(s32 weaponnum)
{
bool canhave = true;

#if VERSION == VERSION_JPN_FINAL
#if (VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64)
if (weaponnum == WEAPON_COMBATKNIFE) {
canhave = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/mplayer/mplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct mpweapon g_MpWeapons[NUM_MPWEAPONS] = {
/*0x16*/ { WEAPON_DEVASTATOR, AMMOTYPE_DEVASTATOR, 16, 0, 0, 1, MPFEATURE_WEAPON_DEVASTATOR, MODEL_CHRDEVASTATOR, 256 },
/*0x17*/ { WEAPON_ROCKETLAUNCHER, AMMOTYPE_ROCKET, 3, 0, 0, 1, 0, MODEL_CHRDYROCKET, 256 },
/*0x18*/ { WEAPON_SLAYER, AMMOTYPE_ROCKET, 3, 0, 0, 1, MPFEATURE_WEAPON_SLAYER, MODEL_CHRSKROCKET, 256 },
#if VERSION != VERSION_JPN_FINAL
#if !((VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64))
/*0x19*/ { WEAPON_COMBATKNIFE, AMMOTYPE_KNIFE, 5, 0, 0, 1, 0, MODEL_CHRKNIFE, 256 },
#endif
/*0x1a*/ { WEAPON_CROSSBOW, AMMOTYPE_CROSSBOW, 10, 0, 0, 1, MPFEATURE_WEAPON_CROSSBOW, MODEL_CHRCROSSBOW, 256 },
Expand Down
4 changes: 2 additions & 2 deletions src/game/training.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ u8 ciGetFiringRangeScore(s32 weaponindex)
{
// Data at firingrangescores is a u8 array where each score uses 2 bits

#if VERSION == VERSION_JPN_FINAL
#if (VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64)
if (weaponindex == frGetWeaponIndexByWeapon(WEAPON_COMBATKNIFE)) {
// The knife doesn't exist in the JPN version.
// Treat it as completed so unlockables still work.
Expand Down Expand Up @@ -205,7 +205,7 @@ bool func0f19cbcc(s32 weapon)

bool frIsWeaponAvailable(s32 weapon)
{
#if VERSION == VERSION_JPN_FINAL
#if (VERSION == VERSION_JPN_FINAL) && defined(PLATFORM_N64)
if (weapon == WEAPON_COMBATKNIFE) {
return false;
}
Expand Down
46 changes: 23 additions & 23 deletions src/include/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -2958,34 +2958,34 @@
#define MPWEAPON_DEVASTATOR 0x16
#define MPWEAPON_ROCKETLAUNCHER 0x17
#define MPWEAPON_SLAYER 0x18
#define MPWEAPON_COMBATKNIFE (VERSION == VERSION_JPN_FINAL ? 0 : 0x19)
#define MPWEAPON_CROSSBOW (VERSION == VERSION_JPN_FINAL ? 0x19 : 0x1a)
#define MPWEAPON_TRANQUILIZER (VERSION == VERSION_JPN_FINAL ? 0x1a : 0x1b)
#define MPWEAPON_GRENADE (VERSION == VERSION_JPN_FINAL ? 0x1b : 0x1c)
#define MPWEAPON_NBOMB (VERSION == VERSION_JPN_FINAL ? 0x1c : 0x1d)
#define MPWEAPON_TIMEDMINE (VERSION == VERSION_JPN_FINAL ? 0x1d : 0x1e)
#define MPWEAPON_PROXIMITYMINE (VERSION == VERSION_JPN_FINAL ? 0x1e : 0x1f)
#define MPWEAPON_REMOTEMINE (VERSION == VERSION_JPN_FINAL ? 0x1f : 0x20)
#define MPWEAPON_LASER (VERSION == VERSION_JPN_FINAL ? 0x20 : 0x21)
#define MPWEAPON_XRAYSCANNER (VERSION == VERSION_JPN_FINAL ? 0x21 : 0x22)
#define MPWEAPON_CLOAKINGDEVICE (VERSION == VERSION_JPN_FINAL ? 0x22 : 0x23)
#define MPWEAPON_COMBATBOOST (VERSION == VERSION_JPN_FINAL ? 0x23 : 0x24)
#define MPWEAPON_COMBATKNIFE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0 : 0x19)
#define MPWEAPON_CROSSBOW (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x19 : 0x1a)
#define MPWEAPON_TRANQUILIZER (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1a : 0x1b)
#define MPWEAPON_GRENADE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1b : 0x1c)
#define MPWEAPON_NBOMB (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1c : 0x1d)
#define MPWEAPON_TIMEDMINE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1d : 0x1e)
#define MPWEAPON_PROXIMITYMINE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1e : 0x1f)
#define MPWEAPON_REMOTEMINE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x1f : 0x20)
#define MPWEAPON_LASER (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x20 : 0x21)
#define MPWEAPON_XRAYSCANNER (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x21 : 0x22)
#define MPWEAPON_CLOAKINGDEVICE (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x22 : 0x23)
#define MPWEAPON_COMBATBOOST (VERSION == VERSION_JPN_FINAL && defined(PLATFORM_N64) ? 0x23 : 0x24)
#ifdef PLATFORM_N64
#define MPWEAPON_SHIELD (VERSION == VERSION_JPN_FINAL ? 0x24 : 0x25)
#define MPWEAPON_DISABLED (VERSION == VERSION_JPN_FINAL ? 0x25 : 0x26)
#define NUM_MPWEAPONS (VERSION == VERSION_JPN_FINAL ? 0x26 : 0x27)
#else // add all classic weapons to multiplayer
#define MPWEAPON_PP9I (VERSION == VERSION_JPN_FINAL ? 0x24 : 0x25)
#define MPWEAPON_CC13 (VERSION == VERSION_JPN_FINAL ? 0x25 : 0x26)
#define MPWEAPON_KL01313 (VERSION == VERSION_JPN_FINAL ? 0x26 : 0x27)
#define MPWEAPON_KF7SPECIAL (VERSION == VERSION_JPN_FINAL ? 0x27 : 0x28)
#define MPWEAPON_ZZT (VERSION == VERSION_JPN_FINAL ? 0x28 : 0x29)
#define MPWEAPON_DMC (VERSION == VERSION_JPN_FINAL ? 0x29 : 0x2a)
#define MPWEAPON_AR53 (VERSION == VERSION_JPN_FINAL ? 0x2a : 0x2b)
#define MPWEAPON_RCP45 (VERSION == VERSION_JPN_FINAL ? 0x2b : 0x2c)
#define MPWEAPON_SHIELD (VERSION == VERSION_JPN_FINAL ? 0x2c : 0x2d)
#define MPWEAPON_DISABLED (VERSION == VERSION_JPN_FINAL ? 0x2d : 0x2e)
#define NUM_MPWEAPONS (VERSION == VERSION_JPN_FINAL ? 0x2e : 0x2f)
#define MPWEAPON_PP9I 0x25
#define MPWEAPON_CC13 0x26
#define MPWEAPON_KL01313 0x27
#define MPWEAPON_KF7SPECIAL 0x28
#define MPWEAPON_ZZT 0x29
#define MPWEAPON_DMC 0x2a
#define MPWEAPON_AR53 0x2b
#define MPWEAPON_RCP45 0x2c
#define MPWEAPON_SHIELD 0x2d
#define MPWEAPON_DISABLED 0x2e
#define NUM_MPWEAPONS 0x2f
#endif

#define MUSICEVENTTYPE_PLAY 1
Expand Down

0 comments on commit ee4434e

Please sign in to comment.