1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 06:10:21 +00:00

BgDyYoseizo OK and documented (#634)

* OK, data imported

* naming

* spec, more naming

* more naming, in EnDyExtra too

* more naming

* deleat asm

* change one function name

* addressed review comments

* Actor changes

* Address review comments

* Apply suggestions from code review

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
EllipticEllipsis 2021-02-03 00:29:40 +00:00 committed by GitHub
parent 02b3640bde
commit 33ce2c977b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 1068 additions and 3389 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,16 +3,71 @@
#include "ultra64.h"
#include "global.h"
#include "overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h"
#include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h"
struct BgDyYoseizo;
typedef void (*BgDyYoseizoActionFunc)(struct BgDyYoseizo*, GlobalContext*);
typedef struct {
/* 0x00 */ u8 alive; // drawn if 1, respawn if 0
/* 0x04 */ Vec3f pos;
/* 0x10 */ Vec3f velocity;
/* 0x1C */ Vec3f accel;
/* 0x28 */ Color_RGB8 primColor;
/* 0x2B */ Color_RGB8 envColor;
/* 0x2E */ s16 alpha;
/* 0x30 */ f32 scale;
/* 0x34 */ s16 timer; // lifetime
/* 0x36 */ s16 type; // 0 is general radiance, else is directed towards Player
/* 0x36 */ f32 pitch;
/* 0x36 */ f32 yaw;
/* 0x40 */ f32 roll;
} BgDyYoseizoParticle; // size = 0x44
typedef struct BgDyYoseizo {
/* 0x0000 */ Actor actor;
/* 0x014C */ BgDyYoseizoActionFunc actionFunc;
/* 0x0150 */ SkelAnime skelAnime;
/* 0x0194 */ char unk_194[0x3720];
/* 0x0194 */ Vec3s jointTable[28];
/* 0x023C */ Vec3s morphTable[28];
/* 0x02E4 */ u8 lightBallSpawned;
/* 0x02E5 */ u8 giveDefenseHearts;
/* 0x02E6 */ u8 healing;
/* 0x02E8 */ s16 vanishTimer;
/* 0x02EA */ s16 givingSpell;
/* 0x02EC */ s16 fountainType;
/* 0x02EE */ s16 dialogState;
/* 0x02F0 */ s16 absoluteTimer;
/* 0x02F2 */ s16 eyeState;
/* 0x02F4 */ s16 eyeState2; // Used, but does not actually change the actor's eyes
/* 0x02F6 */ s16 mouthState;
/* 0x02F8 */ s16 blinkTimer;
/* 0x02FA */ s16 unusedTimer;
/* 0x02FC */ s16 animationChanged;
/* 0x02FE */ s16 finishedSpinGrow;
/* 0x02FE */ s16 itemSpawned;
/* 0x0302 */ s16 healingTimer;
/* 0x0304 */ s16 warpEffectSpawned;
/* 0x0306 */ s16 refillTimer;
/* 0x0308 */ f32 scale;
/* 0x030C */ f32 grownHeight;
/* 0x0310 */ f32 vanishHeight;
/* 0x0314 */ f32 heightFraction;
/* 0x0318 */ f32 scaleFraction;
/* 0x031C */ f32 targetHeight;
/* 0x0320 */ f32 bobOffset;
/* 0x0324 */ f32 bobTimer;
/* 0x0328 */ f32 heightOffset;
/* 0x032C */ f32 frameCount;
/* 0x0330 */ char unk_330[4];
/* 0x0334 */ Vec3s headRot;
/* 0x033A */ Vec3s torsoRot;
/* 0x0340 */ EnDyExtra* beam;
/* 0x0344 */ EnExItem* item;
/* 0x0348 */ char unk_348[0x4C];
/* 0x0394 */ BgDyYoseizoParticle particles[200];
} BgDyYoseizo; // size = 0x38B4
extern const ActorInit Bg_Dy_Yoseizo_InitVars;

View file

@ -16,8 +16,8 @@ void EnDyExtra_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx);
void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_809FF7AC(EnDyExtra* this, GlobalContext* globalCtx);
void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx);
void EnDyExtra_WaitForTrigger(EnDyExtra* this, GlobalContext* globalCtx);
void EnDyExtra_FallAndKill(EnDyExtra* this, GlobalContext* globalCtx);
const ActorInit En_Dy_Extra_InitVars = {
ACTOR_EN_DY_EXTRA,
@ -44,30 +44,30 @@ void EnDyExtra_Init(Actor* thisx, GlobalContext* globalCtx) {
// "Big fairy effect"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ 大妖精効果 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params);
this->type = this->actor.params;
this->unk_15C.x = 0.025f;
this->unk_15C.y = 0.039f;
this->unk_15C.z = 0.025f;
this->scale.x = 0.025f;
this->scale.y = 0.039f;
this->scale.z = 0.025f;
this->unk_168 = this->actor.world.pos;
this->actor.gravity = -0.2f;
this->unk_158 = 1.0f;
this->unk_154 = 0x3C;
this->actionFunc = func_809FF7AC;
this->timer = 60;
this->actionFunc = EnDyExtra_WaitForTrigger;
}
void func_809FF7AC(EnDyExtra* this, GlobalContext* globalCtx) {
void EnDyExtra_WaitForTrigger(EnDyExtra* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f);
if (this->actor.world.pos.y < -55.0f) {
this->actor.velocity.y = 0.0f;
}
if (this->unk_154 == 0 && this->unk_152 != 0) {
this->unk_154 = 0xC8;
this->actionFunc = func_809FF840;
if (this->timer == 0 && this->trigger != 0) {
this->timer = 200;
this->actionFunc = EnDyExtra_FallAndKill;
}
}
void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx) {
void EnDyExtra_FallAndKill(EnDyExtra* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->actor.gravity, 0.0f, 0.1f, 0.005f);
if (this->unk_154 == 0 || this->unk_158 < 0.02f) {
if (this->timer == 0 || this->unk_158 < 0.02f) {
Actor_Kill(&this->actor);
return;
}
@ -80,10 +80,12 @@ void func_809FF840(EnDyExtra* this, GlobalContext* globalCtx) {
void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx) {
EnDyExtra* this = THIS;
DECR(this->unk_154);
this->actor.scale.x = this->unk_15C.x;
this->actor.scale.y = this->unk_15C.y;
this->actor.scale.z = this->unk_15C.z;
if (this->timer != 0) {
this->timer--;
}
this->actor.scale.x = this->scale.x;
this->actor.scale.y = this->scale.y;
this->actor.scale.z = this->scale.z;
Audio_PlayActorSound2(&this->actor, NA_SE_PL_SPIRAL_HEAL_BEAM - SFX_FLAG);
this->actionFunc(this, globalCtx);
Actor_MoveForward(&this->actor);

View file

@ -12,11 +12,11 @@ typedef struct EnDyExtra {
/* 0x0000 */ Actor actor;
/* 0x014C */ EnDyExtraActionFunc actionFunc;
/* 0x0150 */ s16 type;
/* 0x0152 */ s16 unk_152;
/* 0x0154 */ s16 unk_154;
/* 0x0152 */ s16 trigger;
/* 0x0154 */ s16 timer;
/* 0x0158 */ f32 unk_158;
/* 0x015C */ Vec3f unk_15C;
/* 0x0168 */ Vec3f unk_168;
/* 0x015C */ Vec3f scale;
/* 0x0168 */ Vec3f unk_168; // Set and not used
} EnDyExtra; // size = 0x0174
extern const ActorInit En_Dy_Extra_InitVars;