Use new entity struct for octorok boss

This commit is contained in:
octorock 2022-01-20 20:23:20 +01:00
parent 12e8722606
commit 61315f2b04
4 changed files with 743 additions and 976 deletions

View File

@ -190,7 +190,7 @@ void SpinyBeetle(Entity*);
void MazaalHead(Entity*);
void MazaalMacro(Entity*);
void MazaalHand(Entity*);
void OctorokBoss(Entity*);
void OctorokBoss();
void FlyingPot(Entity*);
void Gibdo(Entity*);
void OctorokGolden(Entity*);

View File

@ -0,0 +1,77 @@
#ifndef ENEMY_OCTOROK_BOSS_H
#define ENEMY_OCTOROK_BOSS_H
#include "enemy.h"
typedef struct OctorokBossEntity OctorokBossEntity;
typedef struct {
u8 field_0x0; // [0,1,2,4] is later stored in super->field_0xf
u8 tailCount;
u8 field_0x2; // [0,1]
u8 targetAngle; // relates to this->field_0x7a.HALF.HI
u8 rotation; // [0,1,0xff]
u8 phase4PrevAttackPattern; // [0-4], sets this->phase4AttackPattern
u8 fallingStonesTimer;
u8 field_0x7; // some sort of counter that is only set when hit for the first time?
OctorokBossEntity* mouthObject;
OctorokBossEntity* tailObjects[5];
OctorokBossEntity* legObjects[4];
} OctorokBossHeap;
static_assert(sizeof(OctorokBossHeap) == 0x30);
struct OctorokBossEntity {
Entity base;
/*0x68*/ union SplitHWord field_0x68;
/*0x6a*/ union SplitHWord field_0x6a;
/*0x6c*/ union SplitHWord field_0x6c;
/*0x6e*/ union SplitHWord field_0x6e;
/*0x70*/ union SplitWord field_0x70;
/*0x74*/ u16 unk_74;
/*0x76*/ u16 unk_76;
/*0x78*/ u8 attackWaitTurns; /**< Turns until the next attack */
/*0x79*/ u8 timer; /**< Reused timer */
/*0x7a*/ union SplitHWord angle; /**< Angle of legs */
/*0x7c*/ u8 bossPhase; /**< Boss Phase
0: unfrozen
1: frozen 1
2: unfrozen
3: frozen 2
4: unfrozen -> death */
/*0x7d*/ u8 currentAttack;
/*0x7e*/ u8 nextAttackIndex;
/*0x7f*/ u8 unk_7f;
/*0x80*/ u8 unk_80;
/*0x81*/ u8 phase4AttackPattern; /**< Which attack pattern is currently used in phase 4 */
/*0x82*/ union SplitHWord angularSpeed;
/*0x84*/ OctorokBossHeap* heap; /**< Heap data allocated with #zMalloc. */
};
enum OctorokRotation { ROTATION_CW, ROTATION_CCW, NO_ROTATION = 0xff };
enum OctorokBossPart { WHOLE, LEG_BR, LEG_FR, LEG_FL, LEG_BL, MOUTH, TAIL_END, TAIL };
enum OctorokBossAction {
INIT, // 0
ACTION1, // 1
HIT, // 2
INTRO, // 3
BURNING, // 4
};
enum OctorokBossAttack {
ATTACK_SPITROCK, // 0
ATTACK_VACUUM, // 1
ATTACK_SMOKE, // 2
ATTACK_FREEZE, // 3
NO_ATTACK, // 4
END_OF_ATTACK_PATTERN // 5
};
enum OctorokBossAction1SubAction {
ACTION1_AIMTOWARDSPLAYER, // Moving around with step sounds
ACTION1_WAITFORTURN, // Also step sounds
ACTION1_SUBACTION2, // Step sounds, some kind of attack that is started in OctorokBoss_StartRegularAttack?
ACTION1_WAITFORATTACK, // Wait for GET_TIMER(), then OctorokBoss_SetWaitTurnsForNextAttack
ACTION1_ATTACK, // Attack
};
#endif

View File

@ -66,6 +66,7 @@ extern void SetDirtTile(u32);
extern void SetInventoryValue(u32, u32);
extern void SoundReqClipped(Entity*, u32);
extern void TryLoadPrologueHyruleTown(void);
extern void UnloadGFXSlots(Entity*);
extern void UnloadOBJPalette(Entity*);
extern void UpdateDisplayControls(void);
extern void UpdateItemAnim(ItemBehavior*);
@ -243,7 +244,6 @@ extern void sub_080A57F4(void);
extern void sub_080A71C4(u32, u32, u32, u32);
extern void sub_080A7C18(u32, u32, u32);
extern void sub_080ADD70(void);
extern void UnloadGFXSlots(Entity*);
extern bool32 sub_080AE4CC(Entity*, u32, u32, u32);
extern void sub_080AE58C(Entity*, u32, u32);
extern void sub_080AF284(void);

File diff suppressed because it is too large Load Diff