Skip to content

Commit 3cf8ce3

Browse files
zCombo matches (#405)
* Match zNPCGoalJellyAttack::Enter(float, void*) My first Function in god knows how long. * Even more functions out of the way Thanks to Square for helping with ZapperStop! * Even more functions out of the way Thanks to Square for helping with ZapperStop! * Thank you, Square * zCombo Matches --------- Co-authored-by: Josh Sanchez <[email protected]>
1 parent f32566c commit 3cf8ce3

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

src/SB/Game/zCombo.cpp

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "xTextAsset.h"
99
#include "zGlobals.h"
1010
#include "zTextBox.h"
11+
#include "zUIFont.h"
1112

1213
extern const char zCombo_Strings[];
1314
extern const F32 zCombo_float_zero;
@@ -29,19 +30,23 @@ struct widget_chunk : xBase
2930
xhud::text_widget w;
3031
};
3132

32-
extern widget_chunk* comboHUD;
33+
/* .bss */
34+
static xVec3 sUnderCamPos;
35+
static xtextbox * sHideText[5];
3336

34-
extern zComboReward comboReward[16];
35-
36-
extern S32 zCombo_int32_1; // probably comboPending
37-
extern S32 zCombo_int32_2; // probably comboLastCounter
38-
extern S32 zCombo_int32_3; // probably comboCounter
37+
/* .sbss */
38+
static widget_chunk* comboHUD;
39+
static zUIFont* sHideUIF[1];
40+
static S32 comboPending;
41+
static S32 comboLastCounter;
42+
static S32 comboCounter;
43+
static F32 comboTimer;
3944

40-
extern F32 zCombo_float32_1; // probably comboMaxTime
41-
extern F32 zCombo_float32_3; // probably comboTimer
45+
/* .sdata */
46+
static F32 comboMaxTime = 1.0f;
47+
static F32 comboDisplayTime = 2.0f;
4248

43-
extern xBase* sHideText[5];
44-
extern xBase* sHideUIF[1];
49+
extern zComboReward comboReward[16];
4550

4651
void fillCombo(zComboReward* reward)
4752
{
@@ -80,6 +85,23 @@ void fillCombo(zComboReward* reward)
8085
reward->rewardNum = j;
8186
}
8287

88+
void zCombo_Add(S32 arg0)
89+
{
90+
if (comboTimer < 0.0f)
91+
{
92+
comboTimer = comboMaxTime;
93+
comboPending = arg0 - 1;
94+
return;
95+
}
96+
comboTimer = comboMaxTime;
97+
comboCounter += arg0;
98+
if ((S32) comboPending != 0)
99+
{
100+
comboCounter += comboPending;
101+
comboPending = 0;
102+
}
103+
}
104+
83105
#if 0
84106
// Can't get the floating point instructions to go in the right order
85107
// the zCombo_float32_3 = zCombo_float_minusone always gets lifted to the

0 commit comments

Comments
 (0)