mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 22:41:14 +00:00
Various objects (#677)
* object_okuta * object_crow * object_wallmaster * named wallmaster textures * object_dodongo * object_firefly * object_fire
This commit is contained in:
parent
7b68e8b771
commit
d3311f9a29
15 changed files with 237 additions and 178 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "z_en_dodongo.h"
|
||||
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
|
||||
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
|
||||
#include "objects/object_dodongo/object_dodongo.h"
|
||||
|
||||
#define FLAGS 0x00000015
|
||||
|
||||
|
@ -37,16 +38,6 @@ void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx);
|
|||
void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx);
|
||||
void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx);
|
||||
|
||||
extern SkeletonHeader D_06008318;
|
||||
extern AnimationHeader D_06003B14;
|
||||
extern AnimationHeader D_060042C4;
|
||||
extern AnimationHeader D_06004C20;
|
||||
extern AnimationHeader D_06008B1C;
|
||||
extern AnimationHeader D_060028F0;
|
||||
extern AnimationHeader D_06003088;
|
||||
extern AnimationHeader D_060013C4;
|
||||
extern AnimationHeader D_06001A44;
|
||||
|
||||
const ActorInit En_Dodongo_InitVars = {
|
||||
ACTOR_EN_DODONGO,
|
||||
ACTORCAT_ENEMY,
|
||||
|
@ -327,7 +318,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->bodyScale.x = this->bodyScale.y = this->bodyScale.z = 1.0f;
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawCircle, 48.0f);
|
||||
Actor_SetScale(&this->actor, 0.01875f);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &gDodongoSkel, &gDodongoWaitAnim, this->jointTable, this->morphTable, 31);
|
||||
this->actor.colChkInfo.health = 4;
|
||||
this->actor.colChkInfo.mass = MASS_HEAVY;
|
||||
this->actor.colChkInfo.damageTable = &sDamageTable;
|
||||
|
@ -365,7 +356,7 @@ void EnDodongo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupIdle(EnDodongo* this) {
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06004C20, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &gDodongoWaitAnim, -4.0f);
|
||||
this->actor.speedXZ = 0.0f;
|
||||
this->timer = Rand_S16Offset(30, 50);
|
||||
this->actionState = DODONGO_IDLE;
|
||||
|
@ -373,9 +364,9 @@ void EnDodongo_SetupIdle(EnDodongo* this) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupWalk(EnDodongo* this) {
|
||||
f32 frames = Animation_GetLastFrame(&D_06008B1C);
|
||||
f32 frames = Animation_GetLastFrame(&gDodongoWalkAnim);
|
||||
|
||||
Animation_Change(&this->skelAnime, &D_06008B1C, 0.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &gDodongoWalkAnim, 0.0f, 0.0f, frames, ANIMMODE_LOOP, -4.0f);
|
||||
this->actor.speedXZ = 1.5f;
|
||||
this->timer = Rand_S16Offset(50, 70);
|
||||
this->rightFootStep = true;
|
||||
|
@ -384,21 +375,21 @@ void EnDodongo_SetupWalk(EnDodongo* this) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupBreatheFire(EnDodongo* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060028F0, -4.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gDodongoBreatheFireAnim, -4.0f);
|
||||
this->actionState = DODONGO_BREATHE_FIRE;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
EnDodongo_SetupAction(this, EnDodongo_BreatheFire);
|
||||
}
|
||||
|
||||
void EnDodongo_SetupEndBreatheFire(EnDodongo* this) {
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06003088);
|
||||
Animation_PlayOnce(&this->skelAnime, &gDodongoAfterBreatheFireAnim);
|
||||
this->actionState = DODONGO_END_BREATHE_FIRE;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
EnDodongo_SetupAction(this, EnDodongo_EndBreatheFire);
|
||||
}
|
||||
|
||||
void EnDodongo_SetupSwallowBomb(EnDodongo* this) {
|
||||
Animation_Change(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, -1.0f, 35.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
|
||||
this->actionState = DODONGO_SWALLOW_BOMB;
|
||||
this->timer = 25;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -406,7 +397,7 @@ void EnDodongo_SetupSwallowBomb(EnDodongo* this) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupStunned(EnDodongo* this) {
|
||||
Animation_Change(&this->skelAnime, &D_060028F0, 0.0f, 25.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &gDodongoBreatheFireAnim, 0.0f, 25.0f, 0.0f, ANIMMODE_ONCE, -4.0f);
|
||||
this->actionState = DODONGO_STUNNED;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
if (this->damageEffect == 0xF) {
|
||||
|
@ -601,7 +592,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupSweepTail(EnDodongo* this) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gDodongoDamageAnim, -4.0f);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
|
||||
this->actionState = DODONGO_SWEEP_TAIL;
|
||||
this->timer = 0;
|
||||
|
@ -630,9 +621,9 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
|
|||
this->tailSwipeSpeed = (0xFFFF - ABS(yawDiff2)) / 0xF;
|
||||
if ((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y) >= 0) {
|
||||
this->tailSwipeSpeed = -this->tailSwipeSpeed;
|
||||
animation = &D_060042C4;
|
||||
animation = &gDodongoSweepTailLeftAnim;
|
||||
} else {
|
||||
animation = &D_06003B14;
|
||||
animation = &gDodongoSweepTailRightAnim;
|
||||
}
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL);
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, animation, 2.0f);
|
||||
|
@ -668,7 +659,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDodongo_SetupDeath(EnDodongo* this, GlobalContext* globalCtx) {
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &gDodongoDieAnim, -8.0f);
|
||||
this->timer = 0;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DEAD);
|
||||
this->actionState = DODONGO_DEATH;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue