mirror of
https://github.com/zeldaret/tmc
synced 2026-08-30 01:20:16 -04:00
Merge branch 'master' into tilemap-docs
This commit is contained in:
+197
-192
@@ -4,234 +4,241 @@
|
||||
*
|
||||
* @brief Bird object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "collision.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "item.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
#include "object/cutsceneOrchestrator.h"
|
||||
#include "save.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ s16 gravity;
|
||||
} BirdEntity;
|
||||
|
||||
extern u16 script_EzloTalkOcarina[];
|
||||
|
||||
void Bird_Type0(Entity*);
|
||||
void Bird_Type1(Entity*);
|
||||
void Bird_Type2(Entity*);
|
||||
void Bird_Type3(Entity*);
|
||||
void Bird_Type8(Entity*);
|
||||
void Bird_Type9(Entity*);
|
||||
void Bird_Type10(Entity*);
|
||||
void Bird_Type0_Init(Entity*);
|
||||
void Bird_Type0_Action1(Entity*);
|
||||
void Bird_Type1_Init(Entity*);
|
||||
void Bird_Type1_Action1(Entity*);
|
||||
void Bird_Type1_Action1_Subaction0(Entity*);
|
||||
void Bird_Type1_Action1_Subaction1(Entity*);
|
||||
void Bird_Type2_Init(Entity*);
|
||||
void Bird_Type2_Action1(Entity*);
|
||||
void Bird_Type0(BirdEntity* this);
|
||||
void Bird_Type1(BirdEntity* this);
|
||||
void Bird_Type2(BirdEntity* this);
|
||||
void Bird_Type3(BirdEntity* this);
|
||||
void Bird_Type8(BirdEntity* this);
|
||||
void Bird_Type9(BirdEntity* this);
|
||||
void Bird_Type10(BirdEntity* this);
|
||||
void Bird_Type0_Init(BirdEntity* this);
|
||||
void Bird_Type0_Action1(BirdEntity* this);
|
||||
void Bird_Type1_Init(BirdEntity* this);
|
||||
void Bird_Type1_Action1(BirdEntity* this);
|
||||
void Bird_Type1_Action1_Subaction0(BirdEntity* this);
|
||||
void Bird_Type1_Action1_Subaction1(BirdEntity* this);
|
||||
void Bird_Type2_Init(BirdEntity* this);
|
||||
void Bird_Type2_Action1(BirdEntity* this);
|
||||
|
||||
void Bird(Entity* this) {
|
||||
static void (*const typeFuncs[])(Entity*) = {
|
||||
void Bird(BirdEntity* this) {
|
||||
static void (*const typeFuncs[])(BirdEntity*) = {
|
||||
Bird_Type0, Bird_Type1, Bird_Type2, Bird_Type3, Bird_Type3, Bird_Type3,
|
||||
Bird_Type3, Bird_Type3, Bird_Type8, Bird_Type9, Bird_Type10,
|
||||
};
|
||||
typeFuncs[this->type](this);
|
||||
typeFuncs[super->type](this);
|
||||
}
|
||||
|
||||
void Bird_Type0(Entity* this) {
|
||||
static void (*const Bird_Type0_Actions[])(Entity*) = {
|
||||
void Bird_Type0(BirdEntity* this) {
|
||||
static void (*const Bird_Type0_Actions[])(BirdEntity*) = {
|
||||
Bird_Type0_Init,
|
||||
Bird_Type0_Action1,
|
||||
};
|
||||
|
||||
Bird_Type0_Actions[this->action](this);
|
||||
Bird_Type0_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void Bird_Type0_Init(Entity* this) {
|
||||
void Bird_Type0_Init(BirdEntity* this) {
|
||||
Entity* target;
|
||||
|
||||
this->action++;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
this->timer = 49;
|
||||
this->subtimer = 1;
|
||||
this->zVelocity = Q_16_16(-1.5);
|
||||
this->z.WORD = Q_16_16(-56.75);
|
||||
this->field_0x68.HWORD = Q_8_8(-8.0);
|
||||
this->speed = 0x280;
|
||||
this->direction = 8;
|
||||
this->collisionLayer = 2;
|
||||
this->x.HALF.HI = gRoomControls.scroll_x;
|
||||
super->action++;
|
||||
super->spriteSettings.draw = TRUE;
|
||||
super->timer = 49;
|
||||
super->subtimer = 1;
|
||||
super->zVelocity = Q_16_16(-1.5);
|
||||
super->z.WORD = Q_16_16(-56.75);
|
||||
this->gravity = Q_8_8(-8.0);
|
||||
super->speed = 0x280;
|
||||
super->direction = 8;
|
||||
super->collisionLayer = 2;
|
||||
super->x.HALF.HI = gRoomControls.scroll_x;
|
||||
SoundReq(SFX_123);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
target = CreateObject(BIRD, 1, 0);
|
||||
if (target != NULL) {
|
||||
target->parent = this;
|
||||
PositionRelative(this, target, 0, Q_16_16(8.0));
|
||||
SortEntityAbove(this, target);
|
||||
target->parent = super;
|
||||
PositionRelative(super, target, 0, Q_16_16(8.0));
|
||||
SortEntityAbove(super, target);
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type0_Action1(Entity* this) {
|
||||
LinearMoveUpdate(this);
|
||||
GravityUpdate(this, *(s16*)&this->field_0x68.HWORD);
|
||||
if (this->timer != 0) {
|
||||
if (--this->timer == 0) {
|
||||
this->subtimer = 0;
|
||||
void Bird_Type0_Action1(BirdEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
GravityUpdate(super, this->gravity);
|
||||
if (super->timer != 0) {
|
||||
if (--super->timer == 0) {
|
||||
super->subtimer = 0;
|
||||
}
|
||||
} else if (CheckOnScreen(this) == 0) {
|
||||
} else if (CheckOnScreen(super) == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
UpdateAnimationSingleFrame(super);
|
||||
}
|
||||
|
||||
void Bird_Type1(Entity* this) {
|
||||
static void (*const Bird_Type1_Actions[])(Entity*) = {
|
||||
void Bird_Type1(BirdEntity* this) {
|
||||
static void (*const Bird_Type1_Actions[])(BirdEntity*) = {
|
||||
Bird_Type1_Init,
|
||||
Bird_Type1_Action1,
|
||||
};
|
||||
Bird_Type1_Actions[this->action](this);
|
||||
Bird_Type1_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void Bird_Type1_Init(Entity* this) {
|
||||
this->action++;
|
||||
this->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitAnimationForceUpdate(this, 0x17);
|
||||
void Bird_Type1_Init(BirdEntity* this) {
|
||||
super->action++;
|
||||
super->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
InitAnimationForceUpdate(super, 0x17);
|
||||
}
|
||||
|
||||
void Bird_Type1_Action1(Entity* this) {
|
||||
static void (*const Bird_Type1_Action1_Subactions[])(Entity*) = {
|
||||
void Bird_Type1_Action1(BirdEntity* this) {
|
||||
static void (*const Bird_Type1_Action1_Subactions[])(BirdEntity*) = {
|
||||
Bird_Type1_Action1_Subaction0,
|
||||
Bird_Type1_Action1_Subaction1,
|
||||
};
|
||||
Bird_Type1_Action1_Subactions[this->subAction](this);
|
||||
Bird_Type1_Action1_Subactions[super->subAction](this);
|
||||
}
|
||||
|
||||
void Bird_Type1_Action1_Subaction0(Entity* this) {
|
||||
void Bird_Type1_Action1_Subaction0(BirdEntity* this) {
|
||||
u32 temp;
|
||||
|
||||
if (this->parent != NULL) {
|
||||
temp = this->parent->subtimer;
|
||||
if (super->parent != NULL) {
|
||||
temp = super->parent->subtimer;
|
||||
if (temp != 0) {
|
||||
PositionRelative(this->parent, this, 0, Q_16_16(8.0));
|
||||
PositionRelative(super->parent, super, 0, Q_16_16(8.0));
|
||||
} else {
|
||||
this->subAction++;
|
||||
this->zVelocity = temp;
|
||||
super->subAction++;
|
||||
super->zVelocity = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type1_Action1_Subaction1(Entity* this) {
|
||||
void Bird_Type1_Action1_Subaction1(BirdEntity* this) {
|
||||
Entity* fx;
|
||||
|
||||
if (sub_080044EC(this, 0x1800) < 2) {
|
||||
this->type = 2;
|
||||
this->action = 1;
|
||||
this->z.WORD = 0;
|
||||
this->collisionLayer = 1;
|
||||
if (sub_080044EC(super, 0x1800) < 2) {
|
||||
super->type = 2;
|
||||
super->action = 1;
|
||||
super->z.WORD = 0;
|
||||
super->collisionLayer = 1;
|
||||
SetLocalFlag(LV3_OCARINA_FALL);
|
||||
SoundReq(SFX_SECRET);
|
||||
fx = CreateFx(this, FX_DASH, 0);
|
||||
fx = CreateFx(super, FX_DASH, 0);
|
||||
if (fx != NULL) {
|
||||
SortEntityBelow(this, fx);
|
||||
SortEntityBelow(super, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type2(Entity* this) {
|
||||
static void (*const Bird_Type2_Actions[])(Entity*) = {
|
||||
void Bird_Type2(BirdEntity* this) {
|
||||
static void (*const Bird_Type2_Actions[])(BirdEntity*) = {
|
||||
Bird_Type2_Init,
|
||||
Bird_Type2_Action1,
|
||||
};
|
||||
Bird_Type2_Actions[this->action](this);
|
||||
Bird_Type2_Actions[super->action](this);
|
||||
}
|
||||
|
||||
void Bird_Type2_Init(Entity* this) {
|
||||
this->action++;
|
||||
this->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitAnimationForceUpdate(this, 0x17);
|
||||
void Bird_Type2_Init(BirdEntity* this) {
|
||||
super->action++;
|
||||
super->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
InitAnimationForceUpdate(super, 0x17);
|
||||
}
|
||||
|
||||
void Bird_Type2_Action1(Entity* this) {
|
||||
void Bird_Type2_Action1(BirdEntity* this) {
|
||||
if ((gPlayerState.flags & PL_MINISH) != 0) {
|
||||
sub_0800445C(this);
|
||||
} else if (IsCollidingPlayer(this) != 0) {
|
||||
sub_0800445C(super);
|
||||
} else if (IsCollidingPlayer(super) != 0) {
|
||||
CreateItemEntity(ITEM_OCARINA, 0, 0);
|
||||
gSave.windcrests |= 0x10000000;
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type3(Entity* this) {
|
||||
void Bird_Type3(BirdEntity* this) {
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action++;
|
||||
this->collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
this->frame = 0x80;
|
||||
if (super->action == 0) {
|
||||
super->action++;
|
||||
super->collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
super->frame = 0x80;
|
||||
}
|
||||
|
||||
if ((this->frame & ANIM_DONE) != 0) {
|
||||
InitializeAnimation(this, Random() & 3);
|
||||
this->frameDuration = (Random() & 0xf) + 0x10;
|
||||
this->spriteSettings.flipX = FALSE;
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
InitializeAnimation(super, Random() & 3);
|
||||
super->frameDuration = (Random() & 0xf) + 0x10;
|
||||
super->spriteSettings.flipX = FALSE;
|
||||
if ((Random() & 1) != 0) {
|
||||
this->spriteSettings.flipX = TRUE;
|
||||
super->spriteSettings.flipX = TRUE;
|
||||
}
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
GetNextFrame(super);
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type8(Entity* this) {
|
||||
void Bird_Type8(BirdEntity* this) {
|
||||
Entity* pEVar5;
|
||||
|
||||
switch (this->action) {
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
if (this->timer != 0) {
|
||||
this->frameIndex = 0xff;
|
||||
this->timer--;
|
||||
if (super->timer != 0) {
|
||||
super->frameIndex = 0xff;
|
||||
super->timer--;
|
||||
return;
|
||||
}
|
||||
this->action = 1;
|
||||
this->zVelocity = 0;
|
||||
this->z.WORD = Q_16_16(-20.0);
|
||||
this->speed = 0x180;
|
||||
this->direction = 8;
|
||||
this->collisionLayer = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
this->spriteRendering.b3 = 0;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->x.HALF.HI = gRoomControls.scroll_x;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
this->child = NULL;
|
||||
SetDefaultPriority(this, 6);
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
super->action = 1;
|
||||
super->zVelocity = 0;
|
||||
super->z.WORD = Q_16_16(-20.0);
|
||||
super->speed = 0x180;
|
||||
super->direction = 8;
|
||||
super->collisionLayer = 1;
|
||||
super->spritePriority.b0 = 0;
|
||||
super->spriteRendering.b3 = 0;
|
||||
super->spriteOrientation.flipY = 1;
|
||||
super->x.HALF.HI = gRoomControls.scroll_x;
|
||||
super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
super->child = NULL;
|
||||
SetDefaultPriority(super, 6);
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
SoundReq(0x123);
|
||||
break;
|
||||
case 1:
|
||||
this->collisionLayer = gPlayerEntity.collisionLayer;
|
||||
this->speed += 8;
|
||||
if (this->speed > 0x300) {
|
||||
this->speed = 0x300;
|
||||
super->collisionLayer = gPlayerEntity.collisionLayer;
|
||||
super->speed += 8;
|
||||
if (super->speed > 0x300) {
|
||||
super->speed = 0x300;
|
||||
}
|
||||
|
||||
if ((gPlayerEntity.flags & ENT_COLLIDE) && (gMessage.doTextBox & 0x7f) == 0 &&
|
||||
gPlayerEntity.action != PLAYER_SLEEP && gPlayerEntity.action != PLAYER_BOUNCE &&
|
||||
gPlayerEntity.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
|
||||
gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_PARACHUTE &&
|
||||
PlayerCanBeMoved() && (EntityInRectRadius(this, &gPlayerEntity, 0xe, 0xe))) {
|
||||
s32 z = gPlayerEntity.z.HALF.HI - this->z.HALF.HI - 8;
|
||||
PlayerCanBeMoved() && (EntityInRectRadius(super, &gPlayerEntity, 0xe, 0xe))) {
|
||||
s32 z = gPlayerEntity.z.HALF.HI - super->z.HALF.HI - 8;
|
||||
if ((u16)z < 0x20 && gPlayerEntity.health != 0) {
|
||||
pEVar5 = CreateObject(BIRD, 10, 0);
|
||||
if (pEVar5 != NULL) {
|
||||
this->child = pEVar5;
|
||||
this->action = 2;
|
||||
this->timer = 8;
|
||||
this->speed = 0x300;
|
||||
this->field_0x68.HWORD = Q_8_8(-32.0);
|
||||
super->child = pEVar5;
|
||||
super->action = 2;
|
||||
super->timer = 8;
|
||||
super->speed = 0x300;
|
||||
this->gravity = Q_8_8(-32.0);
|
||||
PlayerDropHeldObject();
|
||||
sub_08078B48();
|
||||
ResetPlayerAnimationAndAction();
|
||||
@@ -251,33 +258,33 @@ void Bird_Type8(Entity* this) {
|
||||
gPlayerEntity.spriteSettings.draw = 0;
|
||||
break;
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
GravityUpdate(this, (s16)this->field_0x68.HWORD);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
pEVar5 = this->child;
|
||||
LinearMoveUpdate(super);
|
||||
GravityUpdate(super, (s16)this->gravity);
|
||||
UpdateAnimationSingleFrame(super);
|
||||
pEVar5 = super->child;
|
||||
if (pEVar5 != NULL) {
|
||||
if (gPlayerEntity.x.HALF.HI < this->x.HALF.HI - 8) {
|
||||
this->timer = 0;
|
||||
if (gPlayerEntity.x.HALF.HI < super->x.HALF.HI - 8) {
|
||||
super->timer = 0;
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
PositionRelative(this, pEVar5, 0xfff80000, 0);
|
||||
if (super->timer == 0) {
|
||||
PositionRelative(super, pEVar5, 0xfff80000, 0);
|
||||
pEVar5->z.HALF.HI += 0x18;
|
||||
pEVar5->spritePriority.b0 = this->spritePriority.b0;
|
||||
pEVar5->spriteRendering.b3 = this->spriteRendering.b3;
|
||||
pEVar5->spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
pEVar5->spritePriority.b0 = super->spritePriority.b0;
|
||||
pEVar5->spriteRendering.b3 = super->spriteRendering.b3;
|
||||
pEVar5->spriteOrientation.flipY = super->spriteOrientation.flipY;
|
||||
} else {
|
||||
this->timer--;
|
||||
super->timer--;
|
||||
CopyPosition(&gPlayerEntity, pEVar5);
|
||||
}
|
||||
}
|
||||
|
||||
if (CheckOnScreen(this) == 0) {
|
||||
if (this->action == 2) {
|
||||
if (CheckOnScreen(super) == 0) {
|
||||
if (super->action == 2) {
|
||||
gSave.windcrests |= 0x10000000;
|
||||
MenuFadeIn(9, 0);
|
||||
}
|
||||
pEVar5 = this->child;
|
||||
pEVar5 = super->child;
|
||||
if (pEVar5 != NULL) {
|
||||
DeleteEntityAny(pEVar5);
|
||||
}
|
||||
@@ -285,43 +292,42 @@ void Bird_Type8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type9(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
void Bird_Type9(BirdEntity* this) {
|
||||
Entity* child;
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->zVelocity = Q_16_16(-2.5);
|
||||
this->z.WORD = Q_16_16(-75.25);
|
||||
this->field_0x68.HWORD = Q_8_8(-16.0);
|
||||
this->speed = 0x300;
|
||||
this->direction = 8;
|
||||
this->collisionLayer = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
this->spriteRendering.b3 = 0;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
SetDefaultPriority(this, 6);
|
||||
this->x.HALF.HI = gRoomControls.scroll_x;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
if (super->action == 0) {
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
super->zVelocity = Q_16_16(-2.5);
|
||||
super->z.WORD = Q_16_16(-75.25);
|
||||
this->gravity = Q_8_8(-16.0);
|
||||
super->speed = 0x300;
|
||||
super->direction = 8;
|
||||
super->collisionLayer = 1;
|
||||
super->spritePriority.b0 = 0;
|
||||
super->spriteRendering.b3 = 0;
|
||||
super->spriteOrientation.flipY = 1;
|
||||
SetDefaultPriority(super, 6);
|
||||
super->x.HALF.HI = gRoomControls.scroll_x;
|
||||
super->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
SoundReq(SFX_123);
|
||||
this->spritePriority.b1 = 2;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
super->spritePriority.b1 = 2;
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
sub_08078B48();
|
||||
} else if (this->action == 1) {
|
||||
} else if (super->action == 1) {
|
||||
gPlayerEntity.spriteSettings.draw = 0;
|
||||
child = this->child;
|
||||
child = super->child;
|
||||
if (child != NULL) {
|
||||
PositionRelative(this, child, Q_16_16(-8), 0);
|
||||
PositionRelative(super, child, Q_16_16(-8), 0);
|
||||
child->z.HALF.HI += 0x18;
|
||||
child->spritePriority.b0 = this->spritePriority.b0;
|
||||
child->spriteRendering.b3 = this->spriteRendering.b3;
|
||||
child->spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
child->spritePriority.b0 = super->spritePriority.b0;
|
||||
child->spriteRendering.b3 = super->spriteRendering.b3;
|
||||
child->spriteOrientation.flipY = super->spriteOrientation.flipY;
|
||||
}
|
||||
sub_08078B48();
|
||||
if (gRoomControls.scroll_x + 0x78 < this->x.HALF.HI) {
|
||||
this->action++;
|
||||
this->spritePriority.b1 = 1;
|
||||
if (gRoomControls.scroll_x + 0x78 < super->x.HALF.HI) {
|
||||
super->action++;
|
||||
super->spritePriority.b1 = 1;
|
||||
if (child != NULL) {
|
||||
child->action++;
|
||||
}
|
||||
@@ -331,39 +337,40 @@ void Bird_Type9(Entity* this) {
|
||||
ResetPlayerEventPriority();
|
||||
gPauseMenuOptions.disabled = 0;
|
||||
if (!CheckGlobalFlag(WARP_1ST)) {
|
||||
pEVar1 = CreateObject(CUTSCENE_ORCHESTRATOR, 0, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
*(ScriptExecutionContext**)&pEVar1->cutsceneBeh = StartCutscene(pEVar1, script_EzloTalkOcarina);
|
||||
CutsceneOrchestratorEntity* orchestrator =
|
||||
(CutsceneOrchestratorEntity*)CreateObject(CUTSCENE_ORCHESTRATOR, 0, 0);
|
||||
if (orchestrator != NULL) {
|
||||
orchestrator->context = StartCutscene(&orchestrator->base, script_EzloTalkOcarina);
|
||||
SetGlobalFlag(WARP_1ST);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LinearMoveUpdate(this);
|
||||
GravityUpdate(this, (short)this->field_0x68.HWORD);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (!CheckOnScreen(this)) {
|
||||
LinearMoveUpdate(super);
|
||||
GravityUpdate(super, (short)this->gravity);
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if (!CheckOnScreen(super)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void Bird_Type10(Entity* this) {
|
||||
this->palette.b.b0 = gPlayerEntity.palette.b.b0;
|
||||
switch (this->action) {
|
||||
void Bird_Type10(BirdEntity* this) {
|
||||
super->palette.b.b0 = gPlayerEntity.palette.b.b0;
|
||||
switch (super->action) {
|
||||
case 0:
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->collisionLayer = 1;
|
||||
this->spritePriority.b0 = 0;
|
||||
this->spriteRendering.b3 = 0;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
SetDefaultPriority(this, 6);
|
||||
InitAnimationForceUpdate(this, 0xe0);
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
super->collisionLayer = 1;
|
||||
super->spritePriority.b0 = 0;
|
||||
super->spriteRendering.b3 = 0;
|
||||
super->spriteOrientation.flipY = 1;
|
||||
SetDefaultPriority(super, 6);
|
||||
InitAnimationForceUpdate(super, 0xe0);
|
||||
case 1:
|
||||
UpdateAnimationSingleFrame(this);
|
||||
UpdateAnimationSingleFrame(super);
|
||||
break;
|
||||
case 2:
|
||||
this->action = 3;
|
||||
super->action = 3;
|
||||
break;
|
||||
case 3:
|
||||
DeleteThisEntity();
|
||||
@@ -372,8 +379,6 @@ void Bird_Type10(Entity* this) {
|
||||
}
|
||||
|
||||
void CreateBird(Entity* this) {
|
||||
Entity* birdEnt;
|
||||
|
||||
// EU only allows warp from the overworld. This prevents warping from the rooftop of the Wind Tribe's tower.
|
||||
#ifndef EU
|
||||
if (AreaAllowsWarp()) {
|
||||
@@ -381,9 +386,9 @@ void CreateBird(Entity* this) {
|
||||
if (AreaIsOverworld()) {
|
||||
#endif
|
||||
if (!FindEntity(OBJECT, BIRD, 6, 8, 0)) {
|
||||
birdEnt = CreateObject(BIRD, 8, 0);
|
||||
if (birdEnt != NULL) {
|
||||
birdEnt->timer = 0;
|
||||
Entity* bird = CreateObject(BIRD, 8, 0);
|
||||
if (bird != NULL) {
|
||||
bird->timer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user