Z2Creature mostly done (#2049)

This commit is contained in:
Caroline Madsen
2024-01-26 21:11:28 -05:00
committed by GitHub
parent 238f875e39
commit e2a84aef47
67 changed files with 924 additions and 3692 deletions
+3
View File
@@ -238,4 +238,7 @@ inline Z2Audience* Z2GetAudience() {
return JASGlobalInstance<Z2Audience>::getInstance();
}
extern s8 data_80451358;
extern s8 data_80451359;
#endif /* Z2AUDIENCE_H */
+71 -21
View File
@@ -19,13 +19,13 @@ public:
virtual void deleteObject();
virtual void setSoundStarter(Z2SoundStarter*);
virtual void framework(u32, s8);
virtual void startCreatureSound(JAISoundID, u32, s8);
virtual void startCreatureSoundLevel(JAISoundID, u32, s8);
virtual void startCreatureVoice(JAISoundID, s8);
virtual void startCreatureVoiceLevel(JAISoundID, s8);
virtual void startCreatureExtraSound(JAISoundID, u32, s8);
virtual void startCreatureExtraSoundLevel(JAISoundID, u32, s8);
virtual void startCollisionSE(u32, u32);
virtual Z2SoundHandlePool* startCreatureSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8);
virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8);
virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startCollisionSE(u32, u32);
Vec* getCurrentPos() const { return mpPos; }
@@ -33,7 +33,7 @@ public:
/* 0x08 */ Z2SoundObjAnime mSoundObjAnime;
/* 0x50 */ Z2SoundObjSimple mSoundObjSimple1;
/* 0x70 */ Z2SoundObjSimple mSoundObjSimple2;
};
}; // Size: 0x90
struct Z2LinkSoundStarter : public Z2SoundStarter {
Z2LinkSoundStarter();
@@ -69,7 +69,7 @@ public:
void startLinkVoice(JAISoundID, s8);
void startLinkVoiceLevel(JAISoundID, s8);
void startLinkSwordSound(JAISoundID, u32, s8);
virtual void startCollisionSE(u32, u32);
virtual Z2SoundHandlePool* startCollisionSE(u32, u32);
int startHitItemSE(u32, u32, Z2SoundObjBase*, float);
void setResumeAttack(bool);
@@ -147,31 +147,30 @@ private:
/* 0x98 */ bool mLinkRiding;
}; // Size: 0x9C
class Z2CreatureEnemy : public Z2Creature {
class Z2CreatureEnemy : public Z2Creature, public JSULink<Z2CreatureEnemy> {
public:
/* 802C0F64 */ Z2CreatureEnemy();
/* 802C0FC4 */ virtual void deleteObject();
/* 802C1094 */ void init(Vec*, Vec*, u8, u8);
/* 802C10B4 */ void init(Vec*, Vec*, Vec*, u8, u8, u8);
/* 802C10D4 */ virtual void framework(u32, s8);
/* 802C110C */ virtual void startCreatureSound(JAISoundID, u32, s8);
/* 802C136C */ virtual void startCreatureSoundLevel(JAISoundID, u32, s8);
/* 802C168C */ virtual void startCreatureVoice(JAISoundID, s8);
/* 802C1948 */ virtual void startCreatureVoiceLevel(JAISoundID, s8);
/* 802C199C */ virtual void startCreatureExtraSound(JAISoundID, u32, s8);
/* 802C19D8 */ virtual void startCreatureExtraSoundLevel(JAISoundID, u32, s8);
/* 802C1A14 */ virtual void startCollisionSE(u32, u32);
/* 802C110C */ virtual Z2SoundHandlePool* startCreatureSound(JAISoundID, u32, s8);
/* 802C136C */ virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8);
/* 802C168C */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8);
/* 802C1948 */ virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8);
/* 802C199C */ virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID, u32, s8);
/* 802C19D8 */ virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID, u32, s8);
/* 802C1A14 */ virtual Z2SoundHandlePool* startCollisionSE(u32, u32);
/* 802C1B7C */ void setLinkSearch(bool);
/* 802C1B90 */ void setEnemyName(char const*);
/* 0x90 */ JSULink<Z2CreatureEnemy> mLink;
/* 0xA0 */ u8 mEnemyID;
/* 0xA1 */ s8 field_0xa1;
/* 0xA2 */ bool mLinkSearch;
/* 0xA3 */ u8 field_0xa3;
}; // Size: 0xA4
class Z2CreatureCitizen : public Z2Creature {
class Z2CreatureCitizen : public Z2Creature, public JSULink<Z2CreatureCitizen> {
public:
/* 802C0C10 */ Z2CreatureCitizen();
/* 802C0C6C */ ~Z2CreatureCitizen();
@@ -179,14 +178,65 @@ public:
/* 802C0D04 */ virtual void deleteObject();
/* 802C0D48 */ void setMdlType(s8, bool, bool);
/* 802C0E18 */ void playVoice(int);
/* 802C0ED8 */ virtual void startCreatureVoice(JAISoundID, s8);
/* 802C0ED8 */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8);
private:
/* 0x90 */ JSULink<Z2CreatureCitizen> mLink;
/* 0xA0 */ s8 mCitizenID;
/* 0xA1 */ s8 field_0xa1;
/* 0xA2 */ bool mLinkSearch;
/* 0xA3 */ u8 field_0xa3;
}; // Size: 0xA4
class Z2CreatureSumomo : public Z2Creature {
public:
/* 802C1BE8 */ Z2CreatureSumomo();
/* 802C1C24 */ void playSumomoBgm(u32);
/* 802C1CA0 */ void deleteObject();
}; // Size: 0x90
class Z2SoundObjBeeGroup : public Z2SoundObjBase {
public:
/* 802C1D10 */ Z2SoundObjBeeGroup();
/* 802C1D4C */ void init(Vec*, u8);
/* 802C1D6C */ void playBeeGroupSound(JAISoundID, u8);
}; // Size: 0x20
class Z2CreatureFM : public Z2CreatureEnemy {
public:
/* 802C1F54 */ Z2CreatureFM();
/* 802C1FB0 */ void deleteObject();
/* 802C1FFC */ void init(Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, u8, u8, u8, u8, u8, u8);
/* 802C20E8 */ void framework(u32, s8);
/* 802C2194 */ Z2SoundHandlePool* startChainSound(JAISoundID, u8, f32, u32, s8);
/* 802C2290 */ Z2SoundHandlePool* startChainSoundLevel(JAISoundID, u8, f32, u32, s8);
/* 0x0A4 */ Z2SoundObjSimple field_0xa4;
/* 0x0C4 */ Z2SoundObjSimple field_0xc4;
/* 0x0E4 */ Z2SoundObjSimple field_0xe4;
/* 0x104 */ Z2SoundObjSimple field_0x104;
}; // Size: 0x124
class Z2CreatureGob : public Z2Creature {
public:
/* 802C24B0 */ void init(Vec*, Vec*, Vec*, u8, u8, u8);
/* 802C24D0 */ Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8);
};
class Z2CreatureOI : public Z2CreatureEnemy {
public:
/* 802C2578 */ Z2CreatureOI();
/* 802C25EC */ void deleteObject();
/* 802C2670 */ void init(Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*,
Vec*);
/* 802C2864 */ void framework(u32, s8);
/* 802C29D4 */ Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8);
/* 802C2C84 */ Z2SoundHandlePool* startTentacleSound(JAISoundID, u8, u32, s8);
/* 802C2CD4 */ Z2SoundHandlePool* startTentacleSoundLevel(JAISoundID, u8, f32, u32, s8);
/* 0x0A4 */ Z2SoundObjSimple field_0xa4;
/* 0x0C4 */ Z2SoundObjSimple field_0xc4;
/* 0x0E4 */ Z2SoundObjSimple field_0xe4;
/* 0x104 */ Z2SoundObjSimple mTentacleSounds[8];
}; // Size: 0x204
#endif /* Z2CREATURE_H */
+8
View File
@@ -46,5 +46,13 @@ extern u8 struct_80450860;
extern u8 struct_80450861;
extern u8 struct_80450862;
extern u8 struct_80450863;
extern u8 struct_80450864;
extern u8 struct_80450865;
extern u8 struct_80450866;
extern u8 struct_80450867;
extern u8 struct_80450868;
extern u8 struct_80450869;
extern u8 struct_8045086A;
extern u8 struct_8045086B;
#endif /* Z2PARAM_H */
+2 -1
View File
@@ -122,7 +122,8 @@ public:
return -1;
}
private:
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
/* 0x00 */ JAISoundHandle mMainBgmHandle;
/* 0x04 */ JAISoundHandle mSubBgmHandle;
/* 0x08 */ JAISoundHandle field_0x08;
+5 -5
View File
@@ -19,20 +19,20 @@ public:
void initHandlesPool(u8 pNumHandles);
void deleteHandlesPool();
JAISoundHandle* getFreeHandle();
JAISoundHandle* getLowPrioSound(JAISoundID pSoundId);
Z2SoundHandlePool* getFreeHandle();
Z2SoundHandlePool* getLowPrioSound(JAISoundID pSoundId);
bool isActive() const;
JAISoundHandle* getHandleSoundID(JAISoundID pSoundId);
JAISoundHandle* getHandleUserData(u32 pUserData);
Z2SoundHandlePool* getHandleSoundID(JAISoundID pSoundId);
Z2SoundHandlePool* getHandleUserData(u32 pUserData);
void stopAllSounds(u32 fadeout);
void setPos(const JGeometry::TVec3<f32>& pos);
int getNumHandles() const { return getNumLinks(); }
JAISoundHandle* getHandle(int index) { return (Z2SoundHandlePool*)getNth(index); }
Z2SoundHandlePool* getHandle(int index) { return (Z2SoundHandlePool*)getNth(index); }
private:
/* 0xC */ u8 mNumHandles;
+1
View File
@@ -31,6 +31,7 @@ public:
u8 isTwilightBattle();
bool isForceBattle() { return mForceBattle; }
JSUList<Z2CreatureEnemy>* getEnemyList() { return this; }
private:
/* 0x0C */ Z2EnemyArea mEnemyArea;
+9 -9
View File
@@ -7,13 +7,13 @@
class Z2SoundStarter;
class Z2SoundObjBase : protected Z2SoundHandles {
class Z2SoundObjBase : public Z2SoundHandles {
public:
Z2SoundObjBase();
~Z2SoundObjBase();
void deleteObject();
JAISoundHandle* startCollisionSE(u32, u32, Z2SoundObjBase*);
Z2SoundHandlePool* startCollisionSE(u32, u32, Z2SoundObjBase*);
bool isAlive() const { return mIsInitialized; }
void setSoundStarter(Z2SoundStarter* i_soundStarter) { mSoundStarter = i_soundStarter; }
@@ -22,8 +22,8 @@ public:
virtual void dispose();
virtual bool stopOK(Z2SoundHandlePool& pool);
virtual void init(Vec* pSoundPos, u8 pNumHandles);
virtual JAISoundHandle* startSound(JAISoundID, u32, s8);
virtual JAISoundHandle* startLevelSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8);
/* 0x14 */ Z2SoundStarter* mSoundStarter;
/* 0x18 */ JGeometry::TVec3<f32>* mSoundPos;
@@ -35,11 +35,11 @@ public:
class Z2SoundObjSimple : public Z2SoundObjBase {
public:
Z2SoundObjSimple();
~Z2SoundObjSimple();
~Z2SoundObjSimple() {}
virtual void init(Vec* pSoundPos, u8 pNumHandles);
virtual JAISoundHandle* startSound(JAISoundID, u32, s8);
virtual JAISoundHandle* startLevelSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8);
};
class Z2SoundObjAnime : public Z2SoundObjBase {
@@ -91,8 +91,8 @@ public:
virtual void framework(u32, s8);
virtual void init(Vec*, u8);
virtual JAISoundHandle* startSound(JAISoundID, u32, s8);
virtual JAISoundHandle* startLevelSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8);
virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8);
/* 0x20 */ JGeometry::TVec3<f32> field_0x20;
/* 0x2C */ JGeometry::TVec3<f32> field_0x2c;
+1
View File
@@ -21,6 +21,7 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
void setCameraGroupInfo(u8);
void setCameraInWaterDepth(float);
u8 getDemoStatus() const { return mDemoStatus; }
void setHour(s32 hour) { mHour = hour; }
void setMinute(s32 min) { mMinute = min; }
void setWeekday(s32 day) { mWeekday = day; }