ref: 6645b85139985d61a2b1f54041b952f031e06a89
parent: b2b9d8ab128e5f2c126300697816e447593d2141
author: Gabriel Ravier <gabravier@gmail.com>
date: Tue Sep 24 05:30:44 EDT 2019
Change gArmsEnergyX stuff from hexadecimal to decimal. Also commented some more stuff. Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -14,7 +14,7 @@
#include "Sound.h"
#include "TextScr.h"
-int gArmsEnergyX = 0x10;
+int gArmsEnergyX = 16;
int gSelectedArms;
int gSelectedItem;
@@ -31,7 +31,7 @@
#ifdef FIX_BUGS
gSelectedArms = 0; // Should probably be done in order to avoid potential problems with the selected weapon being invalid (like is done in SubArmsData)
#endif
- gArmsEnergyX = 0x20;
+ gArmsEnergyX = 32;
memset(gArmsData, 0, sizeof(gArmsData));
}
@@ -494,7 +494,7 @@
// Resume original script
LoadTextScript_Stage(old_script_path);
- gArmsEnergyX = 0x20; // ?
+ gArmsEnergyX = 32; // Displays weapon rotation animation in case the weapon was changed
return 1; // Go to game
}
@@ -579,7 +579,7 @@
if (gSelectedArms == arms_num)
gSelectedArms = 0;
- gArmsEnergyX = 0x20;
+ gArmsEnergyX = 32;
PlaySoundObject(SND_SWITCH_WEAPON, 1);
return gArmsData[gSelectedArms].code;
@@ -618,6 +618,6 @@
void ChangeToFirstArms()
{
gSelectedArms = 0;
- gArmsEnergyX = 0x20;
+ gArmsEnergyX = 32;
PlaySoundObject(SND_SWITCH_WEAPON, 1);
}
--- a/src/ArmsItem.h
+++ b/src/ArmsItem.h
@@ -34,13 +34,20 @@
#define ITEM_MAX 0x20
-/// X coordinate for the weapons energy
+/// X coordinate for the weapons HUD section. Set it to 32 for the forward weapon rotation "animation", 0 for the reverse weapon rotation "animation" and 16 to immobilise it
extern int gArmsEnergyX;
+
+/// Currently selected weapon
extern int gSelectedArms;
+
+// Currently selected item
extern int gSelectedItem;
+/// Contains data for all the weapons the character currently has
extern ARMS gArmsData[ARMS_MAX];
+
+/// Contains data for all the items the character currently has
extern ITEM gItemData[ITEM_MAX];