1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
#ifndef D_LYT_METER_TIMER_H
#define D_LYT_METER_TIMER_H
#include "common.h"
#include "d/a/d_a_item.h"
#include "d/lyt/d2d.h"
#include "m/m_color.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
class LytMeterTimerPart1_c : public d2d::dSubPane {
public:
LytMeterTimerPart1_c()
: mActualTearCount(0), mDisplayedTearCount(0), field_0x760(0), mTrial(dAcItem_c::TRIAL_NONE), mChangeFruitIndex(0) {
sInstance = this;
}
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() override;
virtual nw4r::lyt::Pane *getPane() override {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
virtual const char *getName() const override {
return mLyt.getName();
}
virtual ~LytMeterTimerPart1_c() {
sInstance = nullptr;
}
static LytMeterTimerPart1_c *GetInstance() {
return sInstance;
}
void init();
void startInAnim();
void realizeTrial();
void startOutAnim();
void stopInAnim();
void stopFinishedFruit();
void stopOutAnim();
bool isInAnimFinished();
bool isCurrentFruitAnimFinished();
bool isAnyFruitAnimFinished();
bool isLastFruitAnimFinished();
bool isOutAnimFinished();
void startFruitAnim(s32 index);
void resetBowlNuts();
void startDropLineChange(nw4r::lyt::Pane *pane);
void startEffect(s32 fruitIndex);
bool incrementTearCount();
bool isAnyFruitAnimAtFrame(f32 f) const;
s32 getActualTearCount() const {
return mActualTearCount;
}
s32 getDisplayedTearCount() const {
return mDisplayedTearCount;
}
s32 getChangeFruitIndex() const {
return mChangeFruitIndex;
}
void setChangeFruitIndex(s32 val) {
mChangeFruitIndex = val;
}
private:
void initLoopAnim();
void initBowlNuts();
void initOutAnim();
void initColors();
void initInAnim();
void startNextFruitAnim();
void disableCurrentFruitAnim();
static LytMeterTimerPart1_c *sInstance;
/* 0x008 */ d2d::dLytSub mLyt;
/* 0x09C */ d2d::AnmGroup_c mAnm[26];
/* 0x71C */ s32 mActualTearCount;
/* 0x720 */ s32 mDisplayedTearCount;
/* 0x724 */ nw4r::lyt::Pane *mpPanes[15];
/* 0x760 */ s32 field_0x760;
/* 0x764 */ dAcItem_c::Trial_e mTrial;
/* 0x768 */ mColor mColors1[3];
/* 0x774 */ mColor mColors2[3];
/* 0x780 */ s32 mChangeFruitIndex;
};
class LytMeterTimerPart2_c : public d2d::dSubPane {
public:
LytMeterTimerPart2_c(): mNumPetals(0), mTrial(dAcItem_c::TRIAL_NONE), mVisible(true), mFlowerLoopFrame(0.0f) {
sInstance = this;
}
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() override;
virtual nw4r::lyt::Pane *getPane() override {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
virtual const char *getName() const override {
return mLyt.getName();
}
virtual ~LytMeterTimerPart2_c() {
sInstance = nullptr;
}
static LytMeterTimerPart2_c *GetInstance() {
return sInstance;
}
void setNumPetals(s32 num) {
mNumPetals = num;
}
s32 getNumPetals() const {
return mNumPetals;
}
nw4r::lyt::Pane *i_getPane() const {
return mpPane;
}
void setVisible(bool bVisible) {
mVisible = bVisible;
}
void calc();
void init();
void initDyingAnims();
void initFallOutAnims();
void realizePetalsOnOff();
void syncPetalsTime();
void updatePetalsRate();
void restartPetals();
void finishSingleAnim(u8 idx);
void resetSingleAnim(u8 idx);
void startInAnim();
void startOutAnim();
void stopInAnim();
void stopBloomAnim();
void stopBeforeFallAnim();
void stopChangeSirenAnim();
void stopSirenLoopAnim();
void stopSirenSafeAnim();
void stopFlowerLoopAnim();
void resetFlowerLoopAnim();
void stopDyingAnims();
void stopFinishedDyingAnims();
void stopFallOutAnims();
void stopFinishedFallOutAnims();
void stopOutAnim();
void stopChangeFruitAnim();
bool isInAnimFinished();
bool isBloomAnimFinished();
bool isBeforeFallAnimAtStart();
bool isChangeSirenAnimFinished();
bool isSirenSafeAnimFinished();
bool isFlowerLoopAnimFinished();
bool isOutAnimFinished();
bool isChangeFruitAnimFinished();
void realizeFruitsColor();
void finishDyingAnims();
void setPetalsToStart();
void enableChangeFruitAnim();
void enableBloomAnim();
void enableBeforeFallAnim();
void enableChangeSirenAnim();
void enableSirenLoopAnim();
void enableSafeAnim();
void resumeFlowerLoop();
void startFlowerLoop();
void syncTime();
void syncTimeWithSafe();
/** Played when the finish animation is played and each tear hits the flower */
void createSingleFruitEffect();
/** Played when the whole fruit is finished */
void createFruitCompleteEffect();
void initBeforeFallAnim();
bool isPetalDyingAnimFinished();
bool isFirstFallOutAnimFinished();
void initChangeSirenAnim();
private:
void initBloomAnim();
void initSirenLoopAnim();
void initSirenSafeAnim();
void initFlowerLoopAnim();
void initOutAnim();
void initInAnim();
void initChangeFruitAnim();
void initColors();
static LytMeterTimerPart2_c *sInstance;
/* 0x008 */ d2d::dLytSub mLyt;
/* 0x09C */ d2d::AnmGroup_c mAnm[30];
/* 0x81C */ s32 mNumPetals;
/* 0x820 */ nw4r::lyt::Pane *mpPane;
/* 0x824 */ dAcItem_c::Trial_e mTrial;
/* 0x828 */ mColor mColors1[2];
/* 0x830 */ mColor mColors2[2];
/* 0x838 */ u8 mVisible;
/* 0x83C */ f32 mFlowerLoopFrame;
};
class dLytMeterTimer_c {
public:
dLytMeterTimer_c()
: mStateMgr(*this),
mpPart1(nullptr),
mpPart2(nullptr),
field_0x48(0),
field_0x49(0),
mActualTime(0),
mLastTime(0),
field_0x54(0),
field_0x55(0),
field_0x56(8),
field_0x57(8),
field_0x58(0),
field_0x59(0),
field_0x5C(0),
field_0x60(0) {}
virtual ~dLytMeterTimer_c() {}
bool build();
bool remove();
bool execute();
bool startIn2();
bool startOut2();
bool getField_0x54() const {
return field_0x54;
}
private:
void startIn();
void gotoChangeSiren();
void gotoSiren();
void gotoChangeSafeBloom();
void gotoChangeSafe();
void gotoSafe();
void gotoChangeFruits6();
void gotoFruits();
void startOut();
void gotoChangeFruits3();
void startSafe();
void doPickup();
bool isInSiren();
s32 getPetalForTimerMaybe(s32 time);
bool checkForPetalChangeMaybe();
STATE_FUNC_DECLARE(dLytMeterTimer_c, ChangeSiren);
STATE_FUNC_DECLARE(dLytMeterTimer_c, Siren);
STATE_FUNC_DECLARE(dLytMeterTimer_c, ChangeSafeBloom);
STATE_FUNC_DECLARE(dLytMeterTimer_c, ChangeSafe);
STATE_FUNC_DECLARE(dLytMeterTimer_c, Safe);
STATE_FUNC_DECLARE(dLytMeterTimer_c, ChangeFruits);
STATE_FUNC_DECLARE(dLytMeterTimer_c, Fruits);
static bool sDoExit;
static bool sDoFinishAnim;
static bool sFinished;
STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytMeterTimer_c);
STATE_MGR_DEFINE_UTIL_ISSTATE(dLytMeterTimer_c);
/* 0x04 */ UI_STATE_MGR_DECLARE(dLytMeterTimer_c);
/* 0x40 */ LytMeterTimerPart1_c *mpPart1;
/* 0x44 */ LytMeterTimerPart2_c *mpPart2;
/* 0x48 */ u8 field_0x48;
/* 0x49 */ u8 field_0x49;
/* 0x4C */ s32 mActualTime;
/* 0x50 */ s32 mLastTime;
/* 0x54 */ bool field_0x54;
/* 0x55 */ u8 field_0x55;
/* 0x56 */ u8 field_0x56;
/* 0x57 */ u8 field_0x57;
/* 0x58 */ u8 field_0x58;
/* 0x59 */ u8 field_0x59;
/* 0x5C */ s32 field_0x5C;
/* 0x60 */ s32 field_0x60;
};
#endif
|