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
+77
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