mirror of https://github.com/zeldaret/tmc.git
commit
c2f081600b
|
@ -10,41 +10,43 @@ CheckBits: @ 0x08000F10
|
||||||
ldr r3, _08000F50 @ =ram_CheckBits
|
ldr r3, _08000F50 @ =ram_CheckBits
|
||||||
bx r3
|
bx r3
|
||||||
|
|
||||||
thumb_func_start sub_08000F14
|
// sum 3 drop probability vectors
|
||||||
sub_08000F14: @ 0x08000F14
|
thumb_func_start SumDropProbabilities
|
||||||
|
SumDropProbabilities: @ 0x08000F14
|
||||||
push {r4, r5, r6}
|
push {r4, r5, r6}
|
||||||
movs r4, #0x1e
|
movs r4, #30 // vector addition for 16 shorts in reverse
|
||||||
_08000F18:
|
_08000F18:
|
||||||
ldrsh r5, [r1, r4]
|
ldrsh r5, [r1, r4] // row 1
|
||||||
ldrsh r6, [r2, r4]
|
ldrsh r6, [r2, r4] // + row 2
|
||||||
adds r5, r5, r6
|
adds r5, r6
|
||||||
ldrsh r6, [r3, r4]
|
ldrsh r6, [r3, r4] // + row 3
|
||||||
adds r5, r5, r6
|
adds r5, r6
|
||||||
strh r5, [r0, r4]
|
strh r5, [r0, r4] // store in output
|
||||||
subs r4, #2
|
subs r4, #2
|
||||||
bpl _08000F18
|
bpl _08000F18
|
||||||
pop {r4, r5, r6}
|
pop {r4, r5, r6}
|
||||||
bx lr
|
bx lr
|
||||||
|
|
||||||
thumb_func_start sub_08000F2C
|
// sum 3 drop probabilities, clamp to 0, return scalar sum
|
||||||
sub_08000F2C: @ 0x08000F2C
|
thumb_func_start SumDropProbabilities2
|
||||||
|
SumDropProbabilities2: @ 0x08000F2C
|
||||||
push {r4, r5, r6, r7}
|
push {r4, r5, r6, r7}
|
||||||
movs r4, #0x1e
|
movs r4, #30
|
||||||
movs r7, #0
|
movs r7, #0 // sum
|
||||||
_08000F32:
|
_08000F32:
|
||||||
ldrsh r5, [r1, r4]
|
ldrsh r5, [r1, r4] // row 1
|
||||||
ldrsh r6, [r2, r4]
|
ldrsh r6, [r2, r4] // + row 2
|
||||||
adds r5, r5, r6
|
adds r5, r6
|
||||||
ldrsh r6, [r3, r4]
|
ldrsh r6, [r3, r4] // + row 3
|
||||||
adds r5, r5, r6
|
adds r5, r6
|
||||||
bpl _08000F40
|
bpl positive_drop_chance // clamp to 0
|
||||||
movs r5, #0
|
movs r5, #0
|
||||||
_08000F40:
|
positive_drop_chance:
|
||||||
strh r5, [r0, r4]
|
strh r5, [r0, r4] // store in output
|
||||||
adds r7, r7, r5
|
adds r7, r5
|
||||||
subs r4, #2
|
subs r4, #2
|
||||||
bpl _08000F32
|
bpl _08000F32
|
||||||
adds r0, r7, #0
|
adds r0, r7, #0 // return sum
|
||||||
pop {r4, r5, r6, r7}
|
pop {r4, r5, r6, r7}
|
||||||
bx lr
|
bx lr
|
||||||
.align 2, 0
|
.align 2, 0
|
||||||
|
|
|
@ -18,7 +18,7 @@ EnemyUpdate: @ 0x080011C4
|
||||||
bne _080011EA
|
bne _080011EA
|
||||||
bl DeleteThisEntity
|
bl DeleteThisEntity
|
||||||
_080011DC:
|
_080011DC:
|
||||||
bl EntityIsDeleted
|
bl EntityDisabled
|
||||||
cmp r0, #0
|
cmp r0, #0
|
||||||
bne _0800120A
|
bne _0800120A
|
||||||
adds r0, r4, #0
|
adds r0, r4, #0
|
||||||
|
|
|
@ -18,7 +18,7 @@ ProjectileUpdate: @ 0x08016AE4
|
||||||
bne _08016B0A
|
bne _08016B0A
|
||||||
bl DeleteThisEntity
|
bl DeleteThisEntity
|
||||||
_08016AFC:
|
_08016AFC:
|
||||||
bl EntityIsDeleted
|
bl EntityDisabled
|
||||||
cmp r0, #0
|
cmp r0, #0
|
||||||
bne _08016B22
|
bne _08016B22
|
||||||
adds r0, r4, #0
|
adds r0, r4, #0
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
|
|
||||||
#define MAX_ENTITIES 71
|
#define MAX_ENTITIES 72
|
||||||
|
#define MAX_MANAGERS 32
|
||||||
|
#define MAX_AUX_PLAYER_ENTITIES 7
|
||||||
|
|
||||||
/** Kinds of Entity's supported by the game. */
|
/** Kinds of Entity's supported by the game. */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -38,6 +40,8 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ENT_DID_INIT = 0x1, /**< Graphics and other data loaded. */
|
ENT_DID_INIT = 0x1, /**< Graphics and other data loaded. */
|
||||||
ENT_SCRIPTED = 0x2, /**< Execute in a scripted environment. */
|
ENT_SCRIPTED = 0x2, /**< Execute in a scripted environment. */
|
||||||
|
ENT_UNUSED1 = 0x4, /**< Unused delete flag. */
|
||||||
|
ENT_UNUSED2 = 0x8, /**< Unused delete flag. */
|
||||||
ENT_DELETED = 0x10, /**< Queue deletion next frame. */
|
ENT_DELETED = 0x10, /**< Queue deletion next frame. */
|
||||||
ENT_PERSIST = 0x20, /**< Persist between rooms. */
|
ENT_PERSIST = 0x20, /**< Persist between rooms. */
|
||||||
ENT_COLLIDE = 0x80, /**< Collide with other Entity's. */
|
ENT_COLLIDE = 0x80, /**< Collide with other Entity's. */
|
||||||
|
@ -238,6 +242,15 @@ typedef struct LinkedList {
|
||||||
Entity* first;
|
Entity* first;
|
||||||
} LinkedList;
|
} LinkedList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LinkedList's which point to allocate Entities.
|
||||||
|
* These work together with Entity.prev and Entity.next fields
|
||||||
|
* to allow the iteration of all Entity's.
|
||||||
|
*/
|
||||||
|
extern LinkedList gEntityLists[9];
|
||||||
|
extern Entity gAuxPlayerEntities[MAX_AUX_PLAYER_ENTITIES];
|
||||||
|
extern Entity gEntities[MAX_ENTITIES];
|
||||||
|
|
||||||
typedef void(EntityAction)(Entity*);
|
typedef void(EntityAction)(Entity*);
|
||||||
typedef void (*EntityActionPtr)(Entity*);
|
typedef void (*EntityActionPtr)(Entity*);
|
||||||
typedef void (*const* EntityActionArray)(Entity*);
|
typedef void (*const* EntityActionArray)(Entity*);
|
||||||
|
@ -283,7 +296,7 @@ Entity* CreateEnemy(u32 id, u32 type);
|
||||||
Entity* CreateNPC(u32 id, u32 type, u32 type2);
|
Entity* CreateNPC(u32 id, u32 type, u32 type2);
|
||||||
Entity* CreateObject(u32 id, u32 type, u32 type2);
|
Entity* CreateObject(u32 id, u32 type, u32 type2);
|
||||||
Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2);
|
Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2);
|
||||||
Entity* CreateItemGetEntity(void);
|
Entity* CreateAuxPlayerEntity(void);
|
||||||
Entity* CreateFx(Entity* parent, u32 type, u32 type2);
|
Entity* CreateFx(Entity* parent, u32 type, u32 type2);
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
@ -389,9 +402,12 @@ Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2);
|
||||||
void SetEntityPriority(Entity* entity, u32 prio);
|
void SetEntityPriority(Entity* entity, u32 prio);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if entity will be deleted next frame.
|
* Check if entity is disabled. Entities are disabled if:
|
||||||
|
* - They are deleted.
|
||||||
|
* - There is an event and the entity doesn't have priority
|
||||||
|
* (n/a if entity is in action 0).
|
||||||
*/
|
*/
|
||||||
bool32 EntityIsDeleted(Entity* entity);
|
bool32 EntityDisabled(Entity* entity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if system or entity is blocking updates.
|
* Check if system or entity is blocking updates.
|
||||||
|
@ -477,18 +493,10 @@ void SetInitializationPriority(void);
|
||||||
/**
|
/**
|
||||||
* Reset the system update priority.
|
* Reset the system update priority.
|
||||||
*/
|
*/
|
||||||
void ResetSystemPriority(void);
|
void ClearEventPriority(void);
|
||||||
|
|
||||||
void sub_0805E958(void);
|
void sub_0805E958(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* LinkedList's which point to allocate Entities.
|
|
||||||
* These work together with Entity.prev and Entity.next fields
|
|
||||||
* to allow the iteration of all Entity's.
|
|
||||||
*/
|
|
||||||
extern LinkedList gEntityLists[9];
|
|
||||||
extern Entity gItemGetEntities[7];
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 unk_0;
|
u8 unk_0;
|
||||||
u8 unk_1;
|
u8 unk_1;
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "structures.h"
|
#include "structures.h"
|
||||||
|
|
||||||
|
#define MESSAGE_ACTIVE 0x7f
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 doTextBox;
|
u8 state;
|
||||||
u8 unk;
|
u8 unk;
|
||||||
u8 textSpeed;
|
u8 textSpeed;
|
||||||
u8 unk3; // HI?
|
u8 unk3; // HI?
|
||||||
|
|
|
@ -720,7 +720,7 @@ s32 AddInteractableObject(Entity*, u32, u32);
|
||||||
void RemoveInteractableObject(Entity*);
|
void RemoveInteractableObject(Entity*);
|
||||||
s32 GetInteractableObjectIndex();
|
s32 GetInteractableObjectIndex();
|
||||||
void sub_08078AC0(u32, u32, u32);
|
void sub_08078AC0(u32, u32, u32);
|
||||||
void sub_08078B48(void);
|
void PausePlayer(void);
|
||||||
void sub_08078E84(Entity*, Entity*);
|
void sub_08078E84(Entity*, Entity*);
|
||||||
void sub_08078FB0(Entity*);
|
void sub_08078FB0(Entity*);
|
||||||
void sub_080792BC(s32, u32, u32);
|
void sub_080792BC(s32, u32, u32);
|
||||||
|
|
|
@ -191,8 +191,8 @@ extern ItemBehavior gActiveItems[MAX_ACTIVE_ITEMS];
|
||||||
static_assert(sizeof(gActiveItems) == 0x70);
|
static_assert(sizeof(gActiveItems) == 0x70);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 sys_priority; // system requested priority
|
u8 event_priority; // system requested priority
|
||||||
u8 ent_priority; // entity requested priority
|
u8 ent_priority; // entity requested priority
|
||||||
u8 queued_priority;
|
u8 queued_priority;
|
||||||
u8 queued_priority_reset;
|
u8 queued_priority_reset;
|
||||||
Entity* requester;
|
Entity* requester;
|
||||||
|
|
|
@ -132,8 +132,8 @@ SECTIONS {
|
||||||
. = 0x000010A0; gRoomTransition = .;
|
. = 0x000010A0; gRoomTransition = .;
|
||||||
. = 0x00001150; gRand = .;
|
. = 0x00001150; gRand = .;
|
||||||
. = 0x00001160; gPlayerEntity = .;
|
. = 0x00001160; gPlayerEntity = .;
|
||||||
. = 0x000011E8; gItemGetEntities = .;
|
. = 0x000011E8; gAuxPlayerEntities = .;
|
||||||
. = 0x000015A0; gUnk_030015A0 = .;
|
. = 0x000015A0; gEntities = .;
|
||||||
. = 0x00003BE0; gCarriedEntity = .;
|
. = 0x00003BE0; gCarriedEntity = .;
|
||||||
. = 0x00003C70; gUnk_03003C70 = .;
|
. = 0x00003C70; gUnk_03003C70 = .;
|
||||||
. = 0x00003D70; gEntityLists = .;
|
. = 0x00003D70; gEntityLists = .;
|
||||||
|
|
|
@ -63,8 +63,8 @@ void CollisionMain(void) {
|
||||||
u32 prio;
|
u32 prio;
|
||||||
|
|
||||||
// pick highest priority
|
// pick highest priority
|
||||||
prio = gPriorityHandler.sys_priority;
|
prio = gPriorityHandler.event_priority;
|
||||||
if (gPriorityHandler.sys_priority <= gPriorityHandler.ent_priority)
|
if (gPriorityHandler.event_priority <= gPriorityHandler.ent_priority)
|
||||||
prio = gPriorityHandler.ent_priority;
|
prio = gPriorityHandler.ent_priority;
|
||||||
|
|
||||||
// if any priority is set, dont do collision
|
// if any priority is set, dont do collision
|
||||||
|
|
|
@ -747,7 +747,7 @@ void Fuse_Action0(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fuse_Action1(void) {
|
void Fuse_Action1(void) {
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
MenuFadeIn(4, 0);
|
MenuFadeIn(4, 0);
|
||||||
gFuseInfo.fusionState = FUSION_STATE_4;
|
gFuseInfo.fusionState = FUSION_STATE_4;
|
||||||
gFuseInfo.action = 2;
|
gFuseInfo.action = 2;
|
||||||
|
@ -773,7 +773,7 @@ void Fuse_Action2(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fuse_Action3(void) {
|
void Fuse_Action3(void) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
if (gFuseInfo.entity != NULL) {
|
if (gFuseInfo.entity != NULL) {
|
||||||
gFuseInfo.entity->updatePriority = gFuseInfo.prevUpdatePriority;
|
gFuseInfo.entity->updatePriority = gFuseInfo.prevUpdatePriority;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ void sub_080535AC(void) {
|
||||||
|
|
||||||
void sub_080535F4(void) {
|
void sub_080535F4(void) {
|
||||||
if (gFadeControl.active == 0) {
|
if (gFadeControl.active == 0) {
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
gMenu.overlayType = 2;
|
gMenu.overlayType = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ void sub_08053758(void) {
|
||||||
gScreen.bg1.control = 0x1c4e;
|
gScreen.bg1.control = 0x1c4e;
|
||||||
gScreen.bg2.control = 0x1dc1;
|
gScreen.bg2.control = 0x1dc1;
|
||||||
SoundReq(BGM_STORY);
|
SoundReq(BGM_STORY);
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void sub_08053A1C(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08053A5C(void) {
|
void sub_08053A5C(void) {
|
||||||
if (((gMessage.doTextBox & 0x7f) == 0) && --gMenu.transitionTimer == 0) {
|
if (((gMessage.state & MESSAGE_ACTIVE) == 0) && --gMenu.transitionTimer == 0) {
|
||||||
gMenu.overlayType++;
|
gMenu.overlayType++;
|
||||||
SetFade(FADE_IN_OUT | FADE_INSTANT, 8);
|
SetFade(FADE_IN_OUT | FADE_INSTANT, 8);
|
||||||
}
|
}
|
||||||
|
@ -451,7 +451,7 @@ void sub_08053B74(void) {
|
||||||
gMenu.overlayType++;
|
gMenu.overlayType++;
|
||||||
gUpdateVisibleTiles = 1;
|
gUpdateVisibleTiles = 1;
|
||||||
LoadRoomEntityList(gUnk_080FCDE0);
|
LoadRoomEntityList(gUnk_080FCDE0);
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
ResetEntityPriority();
|
ResetEntityPriority();
|
||||||
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ void AcroBandit_Type0Action5(Entity* this) {
|
||||||
|
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if (this->frame & ANIM_DONE) {
|
if (this->frame & ANIM_DONE) {
|
||||||
if (gEntCount < MAX_ENTITIES - 4) {
|
if (gEntCount < MAX_ENTITIES - 5) {
|
||||||
u32 tmp = Random();
|
u32 tmp = Random();
|
||||||
tmp &= 3;
|
tmp &= 3;
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@ void BusinessScrub_Action5(Entity* this) {
|
||||||
struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD;
|
struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD;
|
||||||
u32 subtype;
|
u32 subtype;
|
||||||
|
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0 && sub_0802915C(this) && !sub_08056338()) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0 && sub_0802915C(this) && !sub_08056338()) {
|
||||||
if (offer->price <= gSave.stats.rupees) {
|
if (offer->price <= gSave.stats.rupees) {
|
||||||
if (BusinessScrub_CheckRefillFitsBag(this)) {
|
if (BusinessScrub_CheckRefillFitsBag(this)) {
|
||||||
/* Bag full. */
|
/* Bag full. */
|
||||||
|
@ -316,11 +316,11 @@ void BusinessScrub_Action6(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BusinessScrub_Action7(Entity* this) {
|
void BusinessScrub_Action7(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD;
|
struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD;
|
||||||
|
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
this->subAction = gMessage.doTextBox & 0x7f;
|
this->subAction = gMessage.state & MESSAGE_ACTIVE;
|
||||||
this->timer = 1;
|
this->timer = 1;
|
||||||
if (!CheckLocalFlag(offer->local_flag)) {
|
if (!CheckLocalFlag(offer->local_flag)) {
|
||||||
SetLocalFlag(offer->local_flag);
|
SetLocalFlag(offer->local_flag);
|
||||||
|
|
|
@ -270,7 +270,7 @@ void ChuchuBoss_OnDeath(ChuchuBossEntity* this) {
|
||||||
Entity* child;
|
Entity* child;
|
||||||
Entity* parent;
|
Entity* parent;
|
||||||
|
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
if (super->type == 0) {
|
if (super->type == 0) {
|
||||||
if (super->subAction != 12) {
|
if (super->subAction != 12) {
|
||||||
super->subAction = 12;
|
super->subAction = 12;
|
||||||
|
@ -464,7 +464,7 @@ void sub_08026090(ChuchuBossEntity* this) {
|
||||||
}
|
}
|
||||||
CopyPosition(super->child, super);
|
CopyPosition(super->child, super);
|
||||||
} else {
|
} else {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
if (super->timer-- == 0) {
|
if (super->timer-- == 0) {
|
||||||
gRoomControls.camera_target = &gPlayerEntity;
|
gRoomControls.camera_target = &gPlayerEntity;
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
|
@ -543,7 +543,7 @@ void sub_0802626C(ChuchuBossEntity* this) {
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
gUnk_080CC20C[this->unk_84->unk_03](this);
|
gUnk_080CC20C[this->unk_84->unk_03](this);
|
||||||
if (gPlayerEntity.action != PLAYER_ROOMTRANSITION && gPlayerEntity.action != PLAYER_ROOM_EXIT) {
|
if (gPlayerEntity.action != PLAYER_ROOMTRANSITION && gPlayerEntity.action != PLAYER_ROOM_EXIT) {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1127,7 +1127,7 @@ void sub_08026E1C(ChuchuBossEntity* this) {
|
||||||
}
|
}
|
||||||
if ((sub_08027C54(this)) && this->unk_84->unk_04 == 2) {
|
if ((sub_08027C54(this)) && this->unk_84->unk_04 == 2) {
|
||||||
sub_08027C7C(this, 0x3f);
|
sub_08027C7C(this, 0x3f);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1156,7 +1156,7 @@ void sub_08026FA4(ChuchuBossEntity* this) {
|
||||||
ChuchuBossEntity* pEVar3;
|
ChuchuBossEntity* pEVar3;
|
||||||
ChuchuBossEntity* pEVar4;
|
ChuchuBossEntity* pEVar4;
|
||||||
|
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
COLLISION_OFF(super);
|
COLLISION_OFF(super);
|
||||||
pEVar4 = (ChuchuBossEntity*)super->child;
|
pEVar4 = (ChuchuBossEntity*)super->child;
|
||||||
pEVar3 = (ChuchuBossEntity*)super->parent;
|
pEVar3 = (ChuchuBossEntity*)super->parent;
|
||||||
|
@ -1362,7 +1362,7 @@ void sub_080272D4(ChuchuBossEntity* this) {
|
||||||
if (sub_08027C54(super->child) == 0 || ((ChuchuBossEntity*)super->child)->unk_84->unk_04 != 2) {
|
if (sub_08027C54(super->child) == 0 || ((ChuchuBossEntity*)super->child)->unk_84->unk_04 != 2) {
|
||||||
SoundReq(SFX_BOSS_HIT);
|
SoundReq(SFX_BOSS_HIT);
|
||||||
} else {
|
} else {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
gRoomControls.camera_target = super->child;
|
gRoomControls.camera_target = super->child;
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
gRoomControls.camera_target->subAction = 9;
|
gRoomControls.camera_target->subAction = 9;
|
||||||
|
|
|
@ -81,7 +81,7 @@ void FireballGuy_Action2(Entity* this) {
|
||||||
|
|
||||||
/* Can we create enough new entities? */
|
/* Can we create enough new entities? */
|
||||||
count = typeEntityCount[this->type];
|
count = typeEntityCount[this->type];
|
||||||
if (MAX_ENTITIES + 1 - count <= gEntCount)
|
if (MAX_ENTITIES - count <= gEntCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create 2-5 new MiniFireballGuy */
|
/* Create 2-5 new MiniFireballGuy */
|
||||||
|
|
|
@ -145,7 +145,7 @@ void Gleerok(GleerokEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gleerok_OnDeath(GleerokEntity* this) {
|
void Gleerok_OnDeath(GleerokEntity* this) {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
|
|
||||||
switch (super->type) {
|
switch (super->type) {
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -420,7 +420,7 @@ void sub_0802D3B8(GleerokEntity* this) {
|
||||||
|
|
||||||
void sub_0802D650(GleerokEntity* this) {
|
void sub_0802D650(GleerokEntity* this) {
|
||||||
#ifdef EU
|
#ifdef EU
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gUnk_080CD7E4[super->subAction](this);
|
gUnk_080CD7E4[super->subAction](this);
|
||||||
|
@ -1014,7 +1014,7 @@ void sub_0802E0B8(GleerokEntity* this) {
|
||||||
if (this->unk_79 > 1) {
|
if (this->unk_79 > 1) {
|
||||||
super->health = 0;
|
super->health = 0;
|
||||||
super->action = 0;
|
super->action = 0;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
SoundReq(SFX_BOSS_DIE);
|
SoundReq(SFX_BOSS_DIE);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -113,17 +113,17 @@ void OctorokBoss_Hit(OctorokBossEntity* this) {
|
||||||
if (super->subAction != 3) {
|
if (super->subAction != 3) {
|
||||||
gRoomControls.camera_target = &this->heap->tailObjects[0]->base;
|
gRoomControls.camera_target = &this->heap->tailObjects[0]->base;
|
||||||
this->heap->field_0x7 = 0x5a;
|
this->heap->field_0x7 = 0x5a;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->heap->field_0x7 != 0) {
|
if (this->heap->field_0x7 != 0) {
|
||||||
this->heap->field_0x7--;
|
this->heap->field_0x7--;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OctorokBoss_Hit_SubActions[super->subAction](this);
|
OctorokBoss_Hit_SubActions[super->subAction](this);
|
||||||
if (super->subAction > 3) {
|
if (super->subAction > 3) {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
sub_0800445C(super);
|
sub_0800445C(super);
|
||||||
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
|
SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
|
||||||
|
@ -136,7 +136,7 @@ void OctorokBoss_Hit_SubAction0(OctorokBossEntity* this) {
|
||||||
if (this->bossPhase == 4) {
|
if (this->bossPhase == 4) {
|
||||||
super->subAction = 4;
|
super->subAction = 4;
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
SoundReq(SFX_BOSS_DIE);
|
SoundReq(SFX_BOSS_DIE);
|
||||||
} else {
|
} else {
|
||||||
if (IS_FROZEN(this) == FALSE) {
|
if (IS_FROZEN(this) == FALSE) {
|
||||||
|
@ -442,7 +442,7 @@ void OctorokBoss_Intro(OctorokBossEntity* this) {
|
||||||
OctorokBoss_Intro_SubAction0, OctorokBoss_Intro_SubAction1, OctorokBoss_Intro_SubAction2,
|
OctorokBoss_Intro_SubAction0, OctorokBoss_Intro_SubAction1, OctorokBoss_Intro_SubAction2,
|
||||||
OctorokBoss_Intro_SubAction3, OctorokBoss_Intro_SubAction4, OctorokBoss_Intro_SubAction5,
|
OctorokBoss_Intro_SubAction3, OctorokBoss_Intro_SubAction4, OctorokBoss_Intro_SubAction5,
|
||||||
};
|
};
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
sub_08036F60(this);
|
sub_08036F60(this);
|
||||||
OctorokBoss_Intro_SubActions[super->subAction](this);
|
OctorokBoss_Intro_SubActions[super->subAction](this);
|
||||||
|
@ -796,7 +796,7 @@ void OctorokBoss_Action1_Attack(OctorokBossEntity* this) {
|
||||||
gPlayerEntity.spriteSettings.draw = 0;
|
gPlayerEntity.spriteSettings.draw = 0;
|
||||||
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
||||||
gPlayerEntity.collisionLayer = 2;
|
gPlayerEntity.collisionLayer = 2;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
PutAwayItems();
|
PutAwayItems();
|
||||||
gPlayerEntity.parent = super;
|
gPlayerEntity.parent = super;
|
||||||
sub_08036914(&gPlayerEntity, (u8) - (this->angle.HALF.HI + 0x80), 0x3800);
|
sub_08036914(&gPlayerEntity, (u8) - (this->angle.HALF.HI + 0x80), 0x3800);
|
||||||
|
|
|
@ -105,7 +105,7 @@ void sub_080450A8(Entity* this) {
|
||||||
|
|
||||||
/* Can we create enough new entities? */
|
/* Can we create enough new entities? */
|
||||||
count = typeEntityCount[this->type];
|
count = typeEntityCount[this->type];
|
||||||
if (MAX_ENTITIES + 1 - count <= gEntCount)
|
if (MAX_ENTITIES - count <= gEntCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create 2-4 new MiniSlime */
|
/* Create 2-4 new MiniSlime */
|
||||||
|
|
|
@ -547,7 +547,7 @@ void VaatiTransfiguredType0Action7(Entity* this) {
|
||||||
Entity* pEVar3;
|
Entity* pEVar3;
|
||||||
u32 uVar4;
|
u32 uVar4;
|
||||||
|
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
if (this->timer) {
|
if (this->timer) {
|
||||||
if (--this->timer == 0) {
|
if (--this->timer == 0) {
|
||||||
SetRoomFlag(2);
|
SetRoomFlag(2);
|
||||||
|
|
|
@ -99,8 +99,8 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
|
||||||
Entity* child;
|
Entity* child;
|
||||||
u8 bVar2;
|
u8 bVar2;
|
||||||
|
|
||||||
bVar2 = gMessage.doTextBox & 0x7f;
|
bVar2 = gMessage.state & MESSAGE_ACTIVE;
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.draw = 0;
|
this->spriteSettings.draw = 0;
|
||||||
this->field_0x80.HALF.LO = bVar2;
|
this->field_0x80.HALF.LO = bVar2;
|
||||||
|
|
|
@ -634,7 +634,7 @@ void sub_08041D14(Entity* this) {
|
||||||
Entity* pEVar1;
|
Entity* pEVar1;
|
||||||
|
|
||||||
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
|
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
if (this->timer != 0) {
|
if (this->timer != 0) {
|
||||||
this->timer--;
|
this->timer--;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -189,7 +189,7 @@ void Subtask_PortalCutscene_0(void) {
|
||||||
gUsedPalettes |= 0x200000;
|
gUsedPalettes |= 0x200000;
|
||||||
EraseAllEntities();
|
EraseAllEntities();
|
||||||
LoadRoomEntityList(gUnk_080D4110[portalId]);
|
LoadRoomEntityList(gUnk_080D4110[portalId]);
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
gArea.filler3[0]++;
|
gArea.filler3[0]++;
|
||||||
SetFade(FADE_INSTANT, 8);
|
SetFade(FADE_INSTANT, 8);
|
||||||
}
|
}
|
||||||
|
|
60
src/entity.c
60
src/entity.c
|
@ -6,6 +6,12 @@
|
||||||
#include "npc.h"
|
#include "npc.h"
|
||||||
#include "manager/diggingCaveEntranceManager.h"
|
#include "manager/diggingCaveEntranceManager.h"
|
||||||
|
|
||||||
|
typedef struct Temp {
|
||||||
|
void* prev;
|
||||||
|
void* next;
|
||||||
|
u8 _0[0x38];
|
||||||
|
} Temp;
|
||||||
|
|
||||||
extern u8 gUpdateVisibleTiles;
|
extern u8 gUpdateVisibleTiles;
|
||||||
extern Manager gUnk_02033290;
|
extern Manager gUnk_02033290;
|
||||||
void UpdatePlayerInput(void);
|
void UpdatePlayerInput(void);
|
||||||
|
@ -89,7 +95,7 @@ void SetEntityPriority(Entity* ent, u32 prio) {
|
||||||
ent->updatePriority = prio;
|
ent->updatePriority = prio;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 EntityIsDeleted(Entity* this) {
|
bool32 EntityDisabled(Entity* this) {
|
||||||
u32 value;
|
u32 value;
|
||||||
|
|
||||||
if (this->flags & ENT_DELETED)
|
if (this->flags & ENT_DELETED)
|
||||||
|
@ -98,19 +104,19 @@ bool32 EntityIsDeleted(Entity* this) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// pick highest
|
// pick highest
|
||||||
if (gPriorityHandler.sys_priority > gPriorityHandler.ent_priority)
|
if (gPriorityHandler.event_priority > gPriorityHandler.ent_priority)
|
||||||
value = gPriorityHandler.sys_priority;
|
value = gPriorityHandler.event_priority;
|
||||||
else
|
else
|
||||||
value = gPriorityHandler.ent_priority;
|
value = gPriorityHandler.ent_priority;
|
||||||
|
|
||||||
if (gMessage.doTextBox & 0x7F)
|
if (gMessage.state & MESSAGE_ACTIVE)
|
||||||
value = max(value, PRIO_MESSAGE);
|
value = max(value, PRIO_MESSAGE);
|
||||||
return value > this->updatePriority;
|
return value > this->updatePriority;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 AnyPrioritySet(void) {
|
bool32 AnyPrioritySet(void) {
|
||||||
u32 prio = gPriorityHandler.sys_priority;
|
u32 prio = gPriorityHandler.event_priority;
|
||||||
if (gPriorityHandler.sys_priority <= gPriorityHandler.ent_priority)
|
if (gPriorityHandler.event_priority <= gPriorityHandler.ent_priority)
|
||||||
prio = gPriorityHandler.ent_priority;
|
prio = gPriorityHandler.ent_priority;
|
||||||
return prio != PRIO_MIN;
|
return prio != PRIO_MIN;
|
||||||
}
|
}
|
||||||
|
@ -180,12 +186,12 @@ static void UpdatePriorityTimer(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetPlayerEventPriority(void) {
|
void SetPlayerEventPriority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_PLAYER_EVENT;
|
gPriorityHandler.event_priority = PRIO_PLAYER_EVENT;
|
||||||
gPlayerEntity.updatePriority = PRIO_PLAYER_EVENT;
|
gPlayerEntity.updatePriority = PRIO_PLAYER_EVENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetPlayerEventPriority(void) {
|
void ResetPlayerEventPriority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_MIN;
|
gPriorityHandler.event_priority = PRIO_MIN;
|
||||||
gPlayerEntity.updatePriority = PRIO_PLAYER;
|
gPlayerEntity.updatePriority = PRIO_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,15 +201,15 @@ void RevokePriority(Entity* e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetRoomReloadPriority(void) {
|
void SetRoomReloadPriority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_PLAYER_EVENT;
|
gPriorityHandler.event_priority = PRIO_PLAYER_EVENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetInitializationPriority(void) {
|
void SetInitializationPriority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_HIGHEST;
|
gPriorityHandler.event_priority = PRIO_HIGHEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetSystemPriority(void) {
|
void ClearEventPriority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_MIN;
|
gPriorityHandler.event_priority = PRIO_MIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateEntities(void) {
|
void UpdateEntities(void) {
|
||||||
|
@ -241,8 +247,6 @@ void EraseAllEntities(void) {
|
||||||
gOAMControls.unk[1].unk6 = 1;
|
gOAMControls.unk[1].unk6 = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Entity gUnk_030015A0[0x48];
|
|
||||||
|
|
||||||
Entity* GetEmptyEntity() {
|
Entity* GetEmptyEntity() {
|
||||||
u8 flags_ip;
|
u8 flags_ip;
|
||||||
Entity* end;
|
Entity* end;
|
||||||
|
@ -253,9 +257,9 @@ Entity* GetEmptyEntity() {
|
||||||
LinkedList* listPtr;
|
LinkedList* listPtr;
|
||||||
LinkedList* endListPtr;
|
LinkedList* endListPtr;
|
||||||
|
|
||||||
if (gEntCount <= 0x46) {
|
if (gEntCount < MAX_ENTITIES - 1) {
|
||||||
currentEnt = gUnk_030015A0;
|
currentEnt = gEntities;
|
||||||
end = currentEnt + ARRAY_COUNT(gUnk_030015A0);
|
end = currentEnt + ARRAY_COUNT(gEntities);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (currentEnt->prev == 0) {
|
if (currentEnt->prev == 0) {
|
||||||
|
@ -267,7 +271,8 @@ Entity* GetEmptyEntity() {
|
||||||
currentEnt = &gPlayerEntity;
|
currentEnt = &gPlayerEntity;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((s32)currentEnt->prev < 0 && (currentEnt->flags & 0xc) && currentEnt != gUpdateContext.current_entity) {
|
if ((s32)currentEnt->prev < 0 && (currentEnt->flags & (ENT_UNUSED1 | ENT_UNUSED2)) &&
|
||||||
|
currentEnt != gUpdateContext.current_entity) {
|
||||||
ClearDeletedEntity(currentEnt);
|
ClearDeletedEntity(currentEnt);
|
||||||
return currentEnt;
|
return currentEnt;
|
||||||
}
|
}
|
||||||
|
@ -282,9 +287,10 @@ Entity* GetEmptyEntity() {
|
||||||
currentEnt = listPtr->first;
|
currentEnt = listPtr->first;
|
||||||
nextList = listPtr + 1;
|
nextList = listPtr + 1;
|
||||||
while ((u32)currentEnt != (u32)listPtr) {
|
while ((u32)currentEnt != (u32)listPtr) {
|
||||||
if (currentEnt->kind != MANAGER && flags_ip < (currentEnt->flags & 0x1c) &&
|
if (currentEnt->kind != MANAGER &&
|
||||||
|
flags_ip < (currentEnt->flags & (ENT_UNUSED1 | ENT_UNUSED2 | ENT_DELETED)) &&
|
||||||
gUpdateContext.current_entity != currentEnt) {
|
gUpdateContext.current_entity != currentEnt) {
|
||||||
flags_ip = currentEnt->flags & 0x1c;
|
flags_ip = currentEnt->flags & (ENT_UNUSED1 | ENT_UNUSED2 | ENT_DELETED);
|
||||||
rv = currentEnt;
|
rv = currentEnt;
|
||||||
}
|
}
|
||||||
currentEnt = currentEnt->next;
|
currentEnt = currentEnt->next;
|
||||||
|
@ -301,16 +307,16 @@ Entity* GetEmptyEntity() {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern Entity gItemGetEntities[7];
|
extern Entity gAuxPlayerEntities[7];
|
||||||
|
|
||||||
Entity* CreateItemGetEntity(void) {
|
Entity* CreateAuxPlayerEntity(void) {
|
||||||
Entity* ent = gItemGetEntities;
|
Entity* ent = gAuxPlayerEntities;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (ent->prev == NULL) {
|
if (ent->prev == NULL) {
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
} while (++ent < &gItemGetEntities[7]);
|
} while (++ent < &gAuxPlayerEntities[7]);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -407,12 +413,6 @@ void DeleteAllEntities(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct Temp {
|
|
||||||
void* prev;
|
|
||||||
void* next;
|
|
||||||
u8 _0[0x38];
|
|
||||||
} Temp;
|
|
||||||
|
|
||||||
// fix this
|
// fix this
|
||||||
Manager* GetEmptyManager(void) {
|
Manager* GetEmptyManager(void) {
|
||||||
Temp* it;
|
Temp* it;
|
||||||
|
|
|
@ -208,7 +208,7 @@ static void GameMain_ChangeRoom(void) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UpdatePlayerMapCoords();
|
UpdatePlayerMapCoords();
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
UpdateWindcrests();
|
UpdateWindcrests();
|
||||||
sub_080300C4();
|
sub_080300C4();
|
||||||
gMain.substate = GAMEMAIN_UPDATE;
|
gMain.substate = GAMEMAIN_UPDATE;
|
||||||
|
@ -252,8 +252,8 @@ static void GameMain_Update(void) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gMessage.doTextBox & 0x7f) || gPriorityHandler.priority_timer != 0)
|
if ((gMessage.state & MESSAGE_ACTIVE) || gPriorityHandler.priority_timer != 0)
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
|
|
||||||
FlushSprites();
|
FlushSprites();
|
||||||
UpdateEntities();
|
UpdateEntities();
|
||||||
|
@ -305,7 +305,7 @@ static void GameMain_BarrelUpdate(void) {
|
||||||
CheckGameOver();
|
CheckGameOver();
|
||||||
CopyOAM();
|
CopyOAM();
|
||||||
if (!gFadeControl.active)
|
if (!gFadeControl.active)
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void GameMain_ChangeArea(void) {
|
static void GameMain_ChangeArea(void) {
|
||||||
|
|
|
@ -204,7 +204,7 @@ void PlayerUpdate(Entity* this) {
|
||||||
else
|
else
|
||||||
gPlayerState.flags &= ~PL_DRUGGED;
|
gPlayerState.flags &= ~PL_DRUGGED;
|
||||||
|
|
||||||
if (!EntityIsDeleted(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
if (gPlayerState.flags & PL_MOLDWORM_CAPTURED) {
|
if (gPlayerState.flags & PL_MOLDWORM_CAPTURED) {
|
||||||
PutAwayItems();
|
PutAwayItems();
|
||||||
if (gPlayerState.flags & PL_MOLDWORM_RELEASED) {
|
if (gPlayerState.flags & PL_MOLDWORM_RELEASED) {
|
||||||
|
@ -258,7 +258,7 @@ static void HandlePlayerLife(Entity* this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gPlayerState.controlMode != CONTROL_ENABLED) || (gMessage.doTextBox & 0x7f))
|
if ((gPlayerState.controlMode != CONTROL_ENABLED) || (gMessage.state & 0x7f))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef EU
|
#ifdef EU
|
||||||
|
@ -274,7 +274,7 @@ static void HandlePlayerLife(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
gRoomVars.unk2 = gMessage.doTextBox & 0x7f;
|
gRoomVars.unk2 = gMessage.state & MESSAGE_ACTIVE;
|
||||||
temp = gSave.stats.maxHealth / 4;
|
temp = gSave.stats.maxHealth / 4;
|
||||||
if (temp > 24)
|
if (temp > 24)
|
||||||
temp = 24;
|
temp = 24;
|
||||||
|
|
|
@ -403,8 +403,8 @@ void EnableRandomDrops(void) {
|
||||||
gRoomVars.randomDropsDisabled = FALSE;
|
gRoomVars.randomDropsDisabled = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void sub_08000F14(s16*, const s16*, const s16*, const s16*);
|
extern void SumDropProbabilities(s16*, const s16*, const s16*, const s16*);
|
||||||
extern u32 sub_08000F2C(s16*, const s16*, const s16*, const s16*);
|
extern u32 SumDropProbabilities2(s16*, const s16*, const s16*, const s16*);
|
||||||
u32 CreateItemDrop(Entity* arg0, u32 itemId, u32 itemParameter);
|
u32 CreateItemDrop(Entity* arg0, u32 itemId, u32 itemParameter);
|
||||||
u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||||
extern const u8 gUnk_080FE1B4[] /* = {
|
extern const u8 gUnk_080FE1B4[] /* = {
|
||||||
|
@ -459,7 +459,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// vector addition, s0 = ptr4 + ptr2 + ptr3
|
// vector addition, s0 = ptr4 + ptr2 + ptr3
|
||||||
sub_08000F14(droptable.a, ptr4->a, ptr2->a, ptr3->a);
|
SumDropProbabilities(droptable.a, ptr4->a, ptr2->a, ptr3->a);
|
||||||
if (gSave.stats.health <= 8) {
|
if (gSave.stats.health <= 8) {
|
||||||
droptable.s.hearts += 5;
|
droptable.s.hearts += 5;
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||||
// vector addition, s0 = s0 + ptr2 + ptr3
|
// vector addition, s0 = s0 + ptr2 + ptr3
|
||||||
// resulting values are clamped to be >= 0
|
// resulting values are clamped to be >= 0
|
||||||
// returns sum over s0
|
// returns sum over s0
|
||||||
summOdds = sub_08000F2C(droptable.a, droptable.a, ptr2->a, ptr3->a);
|
summOdds = SumDropProbabilities2(droptable.a, droptable.a, ptr2->a, ptr3->a);
|
||||||
rand = Random();
|
rand = Random();
|
||||||
item = (rand >> 0x18);
|
item = (rand >> 0x18);
|
||||||
item &= 0xF;
|
item &= 0xF;
|
||||||
|
|
|
@ -61,6 +61,6 @@ void (*const gMiscManagerunctions[])() = { NULL,
|
||||||
EnterRoomTextboxManager_Main };
|
EnterRoomTextboxManager_Main };
|
||||||
|
|
||||||
void ManagerUpdate(Entity* this) {
|
void ManagerUpdate(Entity* this) {
|
||||||
if (!EntityIsDeleted(this))
|
if (!EntityDisabled(this))
|
||||||
gMiscManagerunctions[this->id](this);
|
gMiscManagerunctions[this->id](this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ void sub_0805E1F8(u32, bool32);
|
||||||
|
|
||||||
void EnterRoomTextboxManager_Main(EnterRoomTextboxManager* this) {
|
void EnterRoomTextboxManager_Main(EnterRoomTextboxManager* this) {
|
||||||
EnterRoomTextboxManager_Actions[super->action](this);
|
EnterRoomTextboxManager_Actions[super->action](this);
|
||||||
if ((gRoomControls.room != this->unk_20) || (gMessage.doTextBox & 0x7F)) {
|
if ((gRoomControls.room != this->unk_20) || (gMessage.state & MESSAGE_ACTIVE)) {
|
||||||
sub_0805E1D8(this);
|
sub_0805E1D8(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ void sub_0805E18C(EnterRoomTextboxManager* this) {
|
||||||
if (--super->subtimer == 0) {
|
if (--super->subtimer == 0) {
|
||||||
super->type2 = 0;
|
super->type2 = 0;
|
||||||
gPlayerState.controlMode = CONTROL_1;
|
gPlayerState.controlMode = CONTROL_1;
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (--super->timer == 0) {
|
if (--super->timer == 0) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ void EntitySpawnManager_Main(EntitySpawnManager* this) {
|
||||||
if (super->type2 != 0) {
|
if (super->type2 != 0) {
|
||||||
super->type2 = 0;
|
super->type2 = 0;
|
||||||
SetPlayerControl(0xff);
|
SetPlayerControl(0xff);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
if (this->spawnTimer == 0) {
|
if (this->spawnTimer == 0) {
|
||||||
if (this->sound != 0) {
|
if (this->sound != 0) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ static void EzloHintManager_Action2(EzloHintManager* this) {
|
||||||
if (!PlayerStateValid(this))
|
if (!PlayerStateValid(this))
|
||||||
return;
|
return;
|
||||||
SetPlayerControl(3);
|
SetPlayerControl(3);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
SetPlayerEventPriority();
|
SetPlayerEventPriority();
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
super->subAction = 0;
|
super->subAction = 0;
|
||||||
|
|
|
@ -20,8 +20,8 @@ extern void sub_0801E120(void);
|
||||||
extern void sub_0801E154(u32);
|
extern void sub_0801E154(u32);
|
||||||
extern void sub_0801E160(u32, u32, u32);
|
extern void sub_0801E160(u32, u32, u32);
|
||||||
|
|
||||||
bool32 sub_0805BA78();
|
bool32 LerpLightLevel();
|
||||||
void sub_0805BAD4();
|
void UpdateLightAlpha();
|
||||||
|
|
||||||
void LightManager_Main(LightManager* this) {
|
void LightManager_Main(LightManager* this) {
|
||||||
s32 sVar1;
|
s32 sVar1;
|
||||||
|
@ -43,8 +43,8 @@ void LightManager_Main(LightManager* this) {
|
||||||
}
|
}
|
||||||
if (gMain.substate == GAMEMAIN_UPDATE) {
|
if (gMain.substate == GAMEMAIN_UPDATE) {
|
||||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||||
sub_0805BA78();
|
LerpLightLevel();
|
||||||
sub_0805BAD4();
|
UpdateLightAlpha();
|
||||||
}
|
}
|
||||||
if (gArea.lightType == 2) {
|
if (gArea.lightType == 2) {
|
||||||
gScreen.lcd.displayControl &= ~DISPCNT_WIN0_ON;
|
gScreen.lcd.displayControl &= ~DISPCNT_WIN0_ON;
|
||||||
|
@ -87,44 +87,33 @@ void LightManager_Main(LightManager* this) {
|
||||||
|
|
||||||
#define ABS(x) ((unsigned)(x < 0 ? -(x) : x))
|
#define ABS(x) ((unsigned)(x < 0 ? -(x) : x))
|
||||||
|
|
||||||
bool32 sub_0805BA78() {
|
bool32 LerpLightLevel() {
|
||||||
u32 uVar1;
|
s32 tgt;
|
||||||
s32 iVar1;
|
s32 cur;
|
||||||
s32 iVar2;
|
|
||||||
|
|
||||||
iVar2 = (short)gArea.lightLevel;
|
cur = (short)gArea.lightLevel;
|
||||||
iVar1 = gRoomVars.lightLevel;
|
tgt = gRoomVars.lightLevel;
|
||||||
|
|
||||||
if (iVar1 < 0) {
|
tgt = max(tgt, 0);
|
||||||
iVar1 = 0;
|
tgt = min(tgt, 0x100);
|
||||||
}
|
|
||||||
|
|
||||||
if (0x100 < iVar1) {
|
if (cur != tgt) {
|
||||||
iVar1 = 0x100;
|
if (ABS(tgt - cur) <= 4) {
|
||||||
}
|
cur = tgt;
|
||||||
|
} else if (tgt < cur) {
|
||||||
if (iVar2 != iVar1) {
|
cur -= 4;
|
||||||
if (ABS(iVar1 - iVar2) <= 4) {
|
} else if (tgt > cur) {
|
||||||
iVar2 = iVar1;
|
cur += 4;
|
||||||
} else {
|
|
||||||
if (iVar1 < iVar2) {
|
|
||||||
iVar2 = iVar2 - 4;
|
|
||||||
} else {
|
|
||||||
if (iVar1 > iVar2) {
|
|
||||||
iVar2 = iVar2 + 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gArea.lightLevel = iVar2;
|
gArea.lightLevel = cur;
|
||||||
} else {
|
return TRUE;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern u16 gUnk_08108CA8[];
|
extern u16 gUnk_08108CA8[];
|
||||||
|
|
||||||
void sub_0805BAD4() {
|
void UpdateLightAlpha() {
|
||||||
static const u16 gUnk_08108CA8[] = { 0x10, 0x10f, 0x20e, 0x30d, 0x40c, 0x50b, 0x60a, 0x709, 0x808,
|
static const u16 gUnk_08108CA8[] = { 0x10, 0x10f, 0x20e, 0x30d, 0x40c, 0x50b, 0x60a, 0x709, 0x808,
|
||||||
0x907, 0xa06, 0xb05, 0xc04, 0xd03, 0xe02, 0xf01, 0x1000, 0x00 };
|
0x907, 0xa06, 0xb05, 0xc04, 0xd03, 0xe02, 0xf01, 0x1000, 0x00 };
|
||||||
if (gArea.lightType != 0) {
|
if (gArea.lightType != 0) {
|
||||||
|
@ -164,8 +153,8 @@ void sub_0805BB74(s32 lightLevel) {
|
||||||
if (manager) {
|
if (manager) {
|
||||||
LightManager_Main(manager);
|
LightManager_Main(manager);
|
||||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||||
sub_0805BA78();
|
LerpLightLevel();
|
||||||
sub_0805BAD4();
|
UpdateLightAlpha();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,9 +164,9 @@ bool32 UpdateLightLevel() {
|
||||||
iVar1 = FALSE;
|
iVar1 = FALSE;
|
||||||
if (gArea.lightType && gRoomVars.lightLevel < (s16)gArea.lightLevel) {
|
if (gArea.lightType && gRoomVars.lightLevel < (s16)gArea.lightLevel) {
|
||||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||||
iVar1 = sub_0805BA78();
|
iVar1 = LerpLightLevel();
|
||||||
if (iVar1) {
|
if (iVar1) {
|
||||||
sub_0805BAD4();
|
UpdateLightAlpha();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iVar1;
|
return iVar1;
|
||||||
|
@ -189,9 +178,9 @@ s32 sub_0805BC04(void) {
|
||||||
iVar1 = 0;
|
iVar1 = 0;
|
||||||
if (gArea.lightType && gRoomVars.lightLevel > (short)gArea.lightLevel) {
|
if (gArea.lightType && gRoomVars.lightLevel > (short)gArea.lightLevel) {
|
||||||
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
|
||||||
iVar1 = sub_0805BA78();
|
iVar1 = LerpLightLevel();
|
||||||
if (iVar1) {
|
if (iVar1) {
|
||||||
sub_0805BAD4();
|
UpdateLightAlpha();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iVar1;
|
return iVar1;
|
||||||
|
|
|
@ -70,7 +70,7 @@ void Vaati3StartManager_Type0_Action1(Vaati3StartManager* this) {
|
||||||
super->subAction = 0;
|
super->subAction = 0;
|
||||||
super->timer = 120;
|
super->timer = 120;
|
||||||
SetPlayerControl(2);
|
SetPlayerControl(2);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
object = CreateObject(THUNDERBOLT, 0, 0);
|
object = CreateObject(THUNDERBOLT, 0, 0);
|
||||||
if (object != NULL) {
|
if (object != NULL) {
|
||||||
object->x.HALF.HI = gRoomControls.origin_x + 0x88;
|
object->x.HALF.HI = gRoomControls.origin_x + 0x88;
|
||||||
|
@ -100,7 +100,7 @@ void Vaati3StartManager_Type0_Action2(Vaati3StartManager* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vaati3StartManager_Type0_Action3(Vaati3StartManager* this) {
|
void Vaati3StartManager_Type0_Action3(Vaati3StartManager* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
if (super->timer != 0) {
|
if (super->timer != 0) {
|
||||||
super->timer--;
|
super->timer--;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -331,7 +331,7 @@ void KinstoneMenu_Type5_Overlay0(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void KinstoneMenu_Type5_Overlay1(void) {
|
void KinstoneMenu_Type5_Overlay1(void) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
gMenu.overlayType = 2;
|
gMenu.overlayType = 2;
|
||||||
SoundReq(SFX_147);
|
SoundReq(SFX_147);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ static void StatusUpdate(u32 status);
|
||||||
static void SwitchChoice(u32 to, u32 from);
|
static void SwitchChoice(u32 to, u32 from);
|
||||||
|
|
||||||
static void MsgChangeLine(u32 lineNo);
|
static void MsgChangeLine(u32 lineNo);
|
||||||
static void SetDoTextBox(u32 doTextbox);
|
static void SetState(u32 status);
|
||||||
|
|
||||||
static void DeleteWindow(void);
|
static void DeleteWindow(void);
|
||||||
static u32 ChangeWindowSize(u32 delta);
|
static u32 ChangeWindowSize(u32 delta);
|
||||||
|
@ -122,14 +122,14 @@ s32 sub_08056338(void) {
|
||||||
s32 result;
|
s32 result;
|
||||||
|
|
||||||
result = -1;
|
result = -1;
|
||||||
if (((gMessage.doTextBox & 0x7f) == 0) && (gUnk_02000040.unk_00 == 3))
|
if (((gMessage.state & MESSAGE_ACTIVE) == 0) && (gUnk_02000040.unk_00 == 3))
|
||||||
result = gUnk_02000040.unk_01;
|
result = gUnk_02000040.unk_01;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageClose(void) {
|
void MessageClose(void) {
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
if (gMessage.state & MESSAGE_ACTIVE) {
|
||||||
gMessage.doTextBox = 0x88;
|
gMessage.state = 0x88;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ void MessageRequest(u32 index) {
|
||||||
gMessage.textWindowHeight = 4;
|
gMessage.textWindowHeight = 4;
|
||||||
gMessage.textWindowPosX = 1;
|
gMessage.textWindowPosX = 1;
|
||||||
gMessage.textWindowPosY = 12;
|
gMessage.textWindowPosY = 12;
|
||||||
gMessage.doTextBox = 1;
|
gMessage.state = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageInitialize(void) {
|
void MessageInitialize(void) {
|
||||||
|
@ -190,7 +190,7 @@ void MessageMain(void) {
|
||||||
[MSG_OPEN] = MsgOpen, [MSG_CLOSE] = MsgClose, [MSG_DIE] = MsgDie,
|
[MSG_OPEN] = MsgOpen, [MSG_CLOSE] = MsgClose, [MSG_DIE] = MsgDie,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (gMessage.doTextBox == 1) {
|
if (gMessage.state == 1) {
|
||||||
MemClear((u32*)&gTextRender, sizeof(gTextRender));
|
MemClear((u32*)&gTextRender, sizeof(gTextRender));
|
||||||
StatusUpdate(MSG_INIT);
|
StatusUpdate(MSG_INIT);
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ u32 MsgInit(void) {
|
||||||
gTextRender.curToken._c = &gUnk_08107BE0;
|
gTextRender.curToken._c = &gUnk_08107BE0;
|
||||||
gTextRender._50.unk8 = gTextGfxBuffer;
|
gTextRender._50.unk8 = gTextGfxBuffer;
|
||||||
gTextRender._50.unk4 = 0xd0;
|
gTextRender._50.unk4 = 0xd0;
|
||||||
SetDoTextBox(2);
|
SetState(2);
|
||||||
MsgChangeLine(0);
|
MsgChangeLine(0);
|
||||||
StatusUpdate(MSG_UPDATE);
|
StatusUpdate(MSG_UPDATE);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -295,7 +295,7 @@ static u32 MsgClose(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 MsgDie(void) {
|
static u32 MsgDie(void) {
|
||||||
SetDoTextBox(0);
|
SetState(0);
|
||||||
StatusUpdate(MSG_IDLE);
|
StatusUpdate(MSG_IDLE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +306,7 @@ static u32 MsgUpdate(void) {
|
||||||
[RENDER_WAIT] = TextDispWait, [RENDER_ROLL] = TextDispRoll, [RENDER_ENQUIRY] = TextDispEnquiry,
|
[RENDER_WAIT] = TextDispWait, [RENDER_ROLL] = TextDispRoll, [RENDER_ENQUIRY] = TextDispEnquiry,
|
||||||
};
|
};
|
||||||
|
|
||||||
SetDoTextBox(4);
|
SetState(4);
|
||||||
gTextDispFunctions[gTextRender.renderStatus](&gTextRender);
|
gTextDispFunctions[gTextRender.renderStatus](&gTextRender);
|
||||||
ChangeWindowSize(0);
|
ChangeWindowSize(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -604,7 +604,7 @@ static void TextDispRoll(TextRender* this) {
|
||||||
|
|
||||||
static void TextDispDie(TextRender* this) {
|
static void TextDispDie(TextRender* this) {
|
||||||
gMessage.unk = 0;
|
gMessage.unk = 0;
|
||||||
SetDoTextBox(7);
|
SetState(7);
|
||||||
if ((this->_8e != 1) && (this->_8e == 2 || MESSAGE_PRESS_ANY_ADVANCE_KEYS)) {
|
if ((this->_8e != 1) && (this->_8e == 2 || MESSAGE_PRESS_ANY_ADVANCE_KEYS)) {
|
||||||
StatusUpdate(MSG_CLOSE);
|
StatusUpdate(MSG_CLOSE);
|
||||||
}
|
}
|
||||||
|
@ -628,8 +628,8 @@ static void MsgChangeLine(u32 lineNo) {
|
||||||
PaletteChange(&gTextRender, gTextRender._8f | 0x40);
|
PaletteChange(&gTextRender, gTextRender._8f | 0x40);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetDoTextBox(u32 doTextbox) {
|
static void SetState(u32 status) {
|
||||||
gMessage.doTextBox = gTextRender.message.doTextBox = doTextbox;
|
gMessage.state = gTextRender.message.state = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DeleteWindow(void) {
|
static void DeleteWindow(void) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ void NPCUpdate(Entity* this) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
if (this->action == 0 && (this->flags & ENT_DID_INIT) == 0)
|
if (this->action == 0 && (this->flags & ENT_DID_INIT) == 0)
|
||||||
NPCInit(this);
|
NPCInit(this);
|
||||||
if (!EntityIsDeleted(this))
|
if (!EntityDisabled(this))
|
||||||
gNPCFunctions[this->id][0](this);
|
gNPCFunctions[this->id][0](this);
|
||||||
if (this->next != NULL) {
|
if (this->next != NULL) {
|
||||||
if (gNPCFunctions[this->id][1] != NULL)
|
if (gNPCFunctions[this->id][1] != NULL)
|
||||||
|
|
|
@ -94,7 +94,7 @@ void Beedle_Action1(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Beedle_Action2(Entity* this) {
|
void Beedle_Action2(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action++;
|
this->action++;
|
||||||
InitializeAnimation(this, 8);
|
InitializeAnimation(this, 8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ void sub_0806D274(BigGoronEntity* this) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->frameIndex = 2;
|
super->frameIndex = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ void sub_08063584(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063608(Entity* this) {
|
void sub_08063608(Entity* this) {
|
||||||
u8 tmp = gMessage.doTextBox & 0x7f;
|
u8 tmp = gMessage.state & MESSAGE_ACTIVE;
|
||||||
if (tmp == 0) {
|
if (tmp == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->subtimer = tmp;
|
this->subtimer = tmp;
|
||||||
|
|
|
@ -99,7 +99,7 @@ void sub_08064570(CastleMaidEntity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
|
|
|
@ -219,7 +219,7 @@ void sub_0806797C(CatEntity* this) {
|
||||||
|
|
||||||
void sub_0806799C(CatEntity* this) {
|
void sub_0806799C(CatEntity* this) {
|
||||||
UpdateAnimationSingleFrame(super);
|
UpdateAnimationSingleFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
sub_08067B08(this);
|
sub_08067B08(this);
|
||||||
SetEntityPriority(super, PRIO_PLAYER);
|
SetEntityPriority(super, PRIO_PLAYER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ void sub_08065A00(EponaEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08065A10(EponaEntity* this) {
|
void sub_08065A10(EponaEntity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
InitAnimationForceUpdate(super, super->animationState / 2);
|
InitAnimationForceUpdate(super, super->animationState / 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ void sub_08065D74(GhostBrothersEntity* this) {
|
||||||
void sub_08065DB8(GhostBrothersEntity* this) {
|
void sub_08065DB8(GhostBrothersEntity* this) {
|
||||||
switch (super->subAction) {
|
switch (super->subAction) {
|
||||||
case 0: {
|
case 0: {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->subAction++;
|
super->subAction++;
|
||||||
super->timer = 60;
|
super->timer = 60;
|
||||||
InitAnimationForceUpdate(super, 4);
|
InitAnimationForceUpdate(super, 4);
|
||||||
|
@ -188,7 +188,7 @@ void sub_08065DB8(GhostBrothersEntity* this) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4: {
|
case 4: {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->subAction++;
|
super->subAction++;
|
||||||
super->timer = 30;
|
super->timer = 30;
|
||||||
this->unk_6c = gUnk_0811022E;
|
this->unk_6c = gUnk_0811022E;
|
||||||
|
|
|
@ -72,7 +72,7 @@ void sub_08069328(Entity* this) {
|
||||||
|
|
||||||
void sub_08069390(Entity* this) {
|
void sub_08069390(Entity* this) {
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->interactType = INTERACTION_NONE;
|
this->interactType = INTERACTION_NONE;
|
||||||
RevokePriority(this);
|
RevokePriority(this);
|
||||||
|
|
|
@ -57,9 +57,9 @@ void sub_080695AC(Entity* this) {
|
||||||
|
|
||||||
void sub_080695E8(Entity* this) {
|
void sub_080695E8(Entity* this) {
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->interactType = gMessage.doTextBox & 0x7f;
|
this->interactType = gMessage.state & MESSAGE_ACTIVE;
|
||||||
RevokePriority(this);
|
RevokePriority(this);
|
||||||
InitAnimationForceUpdate(this, this->animationState);
|
InitAnimationForceUpdate(this, this->animationState);
|
||||||
}
|
}
|
||||||
|
|
|
@ -346,7 +346,7 @@ void sub_08063E54(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063E6C(Entity* this) {
|
void sub_08063E6C(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
InitializeAnimation(this, this->animationState + 4);
|
InitializeAnimation(this, this->animationState + 4);
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ void sub_08063F20(GuardEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063F78(GuardEntity* this) {
|
void sub_08063F78(GuardEntity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = super->action - 1;
|
super->action = super->action - 1;
|
||||||
InitializeAnimation(super, (super->animationState >> 1) + 4 + this->unk_70);
|
InitializeAnimation(super, (super->animationState >> 1) + 4 + this->unk_70);
|
||||||
}
|
}
|
||||||
|
|
|
@ -319,7 +319,7 @@ void sub_080621AC(KidEntity* this) {
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
GetNextFrame(super);
|
GetNextFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -150,7 +150,7 @@ void sub_08067EF0(MountainMinishEntity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0)
|
if ((gMessage.state & MESSAGE_ACTIVE) != 0)
|
||||||
break;
|
break;
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
InitializeAnimation(super, (super->animationState >> 1) + 4);
|
InitializeAnimation(super, (super->animationState >> 1) + 4);
|
||||||
|
|
|
@ -101,7 +101,7 @@ void sub_080663D4(NPC23Entity* this) {
|
||||||
}
|
}
|
||||||
ProcessMovement0(super);
|
ProcessMovement0(super);
|
||||||
}
|
}
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
GetNextFrame(super);
|
GetNextFrame(super);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ void sub_08062B48(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08062B70(Entity* this) {
|
void sub_08062B70(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
InitializeAnimation(this, 2);
|
InitializeAnimation(this, 2);
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
RevokePriority(this);
|
RevokePriority(this);
|
||||||
|
|
|
@ -149,13 +149,13 @@ void sub_0806B540(Entity* this) {
|
||||||
SetLocalFlag(0x3f);
|
SetLocalFlag(0x3f);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
context->unk_18 = 2;
|
context->unk_18 = 2;
|
||||||
MessageNoOverlap(TEXT_INDEX(TEXT_PERCY, 0x15), this);
|
MessageNoOverlap(TEXT_INDEX(TEXT_PERCY, 0x15), this);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
context->unk_18 = 3;
|
context->unk_18 = 3;
|
||||||
if (gSave.stats.hasAllFigurines != 0) {
|
if (gSave.stats.hasAllFigurines != 0) {
|
||||||
InitItemGetSequence(ITEM_RUPEE100, 0, 0);
|
InitItemGetSequence(ITEM_RUPEE100, 0, 0);
|
||||||
|
|
|
@ -74,7 +74,7 @@ void sub_08063AC0(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063B44(Entity* this) {
|
void sub_08063B44(Entity* this) {
|
||||||
u8 tmp = gMessage.doTextBox & 0x7f;
|
u8 tmp = gMessage.state & MESSAGE_ACTIVE;
|
||||||
if (tmp == 0) {
|
if (tmp == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->subtimer = tmp;
|
this->subtimer = tmp;
|
||||||
|
|
|
@ -273,7 +273,7 @@ void sub_08060528(PostmanEntity* this) {
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
UpdateAnimationSingleFrame(super);
|
UpdateAnimationSingleFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
|
|
|
@ -64,7 +64,7 @@ void sub_08062C24(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08062C54(Entity* this) {
|
void sub_08062C54(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 127) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
RevokePriority(this);
|
RevokePriority(this);
|
||||||
|
|
|
@ -108,8 +108,8 @@ void sub_080650CC(StockwellEntity* this) {
|
||||||
|
|
||||||
void sub_080651AC(StockwellEntity* this) {
|
void sub_080651AC(StockwellEntity* this) {
|
||||||
GetNextFrame(super);
|
GetNextFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->interactType = gMessage.doTextBox & 0x7f;
|
super->interactType = gMessage.state & MESSAGE_ACTIVE;
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
InitializeAnimation(super, 4);
|
InitializeAnimation(super, 4);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ void sub_0806528C(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080652B0(Entity* this) {
|
void sub_080652B0(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->subAction++;
|
this->subAction++;
|
||||||
this->timer = 10;
|
this->timer = 10;
|
||||||
gRoomVars.animFlags = this->subtimer;
|
gRoomVars.animFlags = this->subtimer;
|
||||||
|
@ -184,16 +184,16 @@ void sub_080652E4(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08065314(Entity* this) {
|
void sub_08065314(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->subAction++;
|
this->subAction++;
|
||||||
MenuFadeIn(3, 3);
|
MenuFadeIn(3, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08065338(Entity* this) {
|
void sub_08065338(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->subAction = gMessage.doTextBox & 0x7f;
|
this->subAction = gMessage.state & MESSAGE_ACTIVE;
|
||||||
gRoomVars.animFlags = this->subtimer;
|
gRoomVars.animFlags = this->subtimer;
|
||||||
InitializeAnimation(this, 4);
|
InitializeAnimation(this, 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ void sub_08064B88(SturgeonEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08064C2C(SturgeonEntity* this) {
|
void sub_08064C2C(SturgeonEntity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
InitializeAnimation(super, (u32)super->subtimer);
|
InitializeAnimation(super, (u32)super->subtimer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ void sub_08065680(TalonEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080656A4(TalonEntity* this) {
|
void sub_080656A4(TalonEntity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = this->unk_69;
|
super->action = this->unk_69;
|
||||||
InitAnimationForceUpdate(super, this->unk_6a);
|
InitAnimationForceUpdate(super, this->unk_6a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ void sub_0806ACC4(TownMinishEntity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (gMessage.doTextBox & 0x7f)
|
if (gMessage.state & MESSAGE_ACTIVE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
|
|
|
@ -153,7 +153,7 @@ void sub_08061D64(TownspersonEntity* this) {
|
||||||
|
|
||||||
void sub_08061E24(TownspersonEntity* this) {
|
void sub_08061E24(TownspersonEntity* this) {
|
||||||
GetNextFrame(super);
|
GetNextFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
super->action = 1;
|
super->action = 1;
|
||||||
InitializeAnimation(super, this->unk_69);
|
InitializeAnimation(super, this->unk_69);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void sub_0806C7D4(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806C834(Entity* this) {
|
void sub_0806C834(Entity* this) {
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
--this->action;
|
--this->action;
|
||||||
InitializeAnimation(this, (this->animationState / 2) + 4);
|
InitializeAnimation(this, (this->animationState / 2) + 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ void ObjectUpdate(Entity* this) {
|
||||||
ObjectInit(this);
|
ObjectInit(this);
|
||||||
if (this->iframes != 0)
|
if (this->iframes != 0)
|
||||||
this->iframes++;
|
this->iframes++;
|
||||||
if (!EntityIsDeleted(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
gObjectFunctions[this->id](this);
|
gObjectFunctions[this->id](this);
|
||||||
this->contactFlags &= ~0x80;
|
this->contactFlags &= ~0x80;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ void Bird_Type8(BirdEntity* this) {
|
||||||
super->speed = 0x300;
|
super->speed = 0x300;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gPlayerEntity.flags & ENT_COLLIDE) && (gMessage.doTextBox & 0x7f) == 0 &&
|
if ((gPlayerEntity.flags & ENT_COLLIDE) && (gMessage.state & MESSAGE_ACTIVE) == 0 &&
|
||||||
gPlayerEntity.action != PLAYER_SLEEP && gPlayerEntity.action != PLAYER_BOUNCE &&
|
gPlayerEntity.action != PLAYER_SLEEP && gPlayerEntity.action != PLAYER_BOUNCE &&
|
||||||
gPlayerEntity.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
|
gPlayerEntity.action != PLAYER_MINISH && gPlayerState.framestate != PL_STATE_CLIMB &&
|
||||||
gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_PARACHUTE &&
|
gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_PARACHUTE &&
|
||||||
|
@ -240,21 +240,21 @@ void Bird_Type8(BirdEntity* this) {
|
||||||
super->speed = 0x300;
|
super->speed = 0x300;
|
||||||
this->gravity = Q_8_8(-32.0);
|
this->gravity = Q_8_8(-32.0);
|
||||||
PlayerDropHeldObject();
|
PlayerDropHeldObject();
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
ResetPlayerAnimationAndAction();
|
ResetPlayerAnimationAndAction();
|
||||||
PutAwayItems();
|
PutAwayItems();
|
||||||
gPlayerState.swim_state = 0;
|
gPlayerState.swim_state = 0;
|
||||||
gPlayerState.jump_status = 0;
|
gPlayerState.jump_status = 0;
|
||||||
gPlayerEntity.flags &= ~0x80;
|
gPlayerEntity.flags &= ~0x80;
|
||||||
gPlayerEntity.spriteSettings.draw = 0;
|
gPlayerEntity.spriteSettings.draw = 0;
|
||||||
gPriorityHandler.sys_priority = 6;
|
gPriorityHandler.event_priority = 6;
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
gPlayerEntity.spriteSettings.draw = 0;
|
gPlayerEntity.spriteSettings.draw = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ void Bird_Type9(BirdEntity* this) {
|
||||||
SoundReq(SFX_123);
|
SoundReq(SFX_123);
|
||||||
super->spritePriority.b1 = 2;
|
super->spritePriority.b1 = 2;
|
||||||
InitAnimationForceUpdate(super, 0);
|
InitAnimationForceUpdate(super, 0);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
} else if (super->action == 1) {
|
} else if (super->action == 1) {
|
||||||
gPlayerEntity.spriteSettings.draw = 0;
|
gPlayerEntity.spriteSettings.draw = 0;
|
||||||
child = super->child;
|
child = super->child;
|
||||||
|
@ -324,7 +324,7 @@ void Bird_Type9(BirdEntity* this) {
|
||||||
child->spriteRendering.b3 = super->spriteRendering.b3;
|
child->spriteRendering.b3 = super->spriteRendering.b3;
|
||||||
child->spriteOrientation.flipY = super->spriteOrientation.flipY;
|
child->spriteOrientation.flipY = super->spriteOrientation.flipY;
|
||||||
}
|
}
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
if (gRoomControls.scroll_x + 0x78 < super->x.HALF.HI) {
|
if (gRoomControls.scroll_x + 0x78 < super->x.HALF.HI) {
|
||||||
super->action++;
|
super->action++;
|
||||||
super->spritePriority.b1 = 1;
|
super->spritePriority.b1 = 1;
|
||||||
|
|
|
@ -208,10 +208,10 @@ void Book_Action5(BookEntity* this) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
u8 doTextBox = gMessage.doTextBox & 0x7f;
|
u8 status = gMessage.state & MESSAGE_ACTIVE;
|
||||||
if (!doTextBox) {
|
if (!status) {
|
||||||
super->spriteSettings.draw = 1;
|
super->spriteSettings.draw = 1;
|
||||||
super->subAction = doTextBox;
|
super->subAction = status;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ void Bush(BushEntity* this) {
|
||||||
Bush_Action1,
|
Bush_Action1,
|
||||||
Bush_Action2,
|
Bush_Action2,
|
||||||
};
|
};
|
||||||
if (!EntityIsDeleted(super)) {
|
if (!EntityDisabled(super)) {
|
||||||
Bush_Actions[super->action](this);
|
Bush_Actions[super->action](this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ void CameraTarget(Entity* this) {
|
||||||
case FUSION_STATE_0:
|
case FUSION_STATE_0:
|
||||||
case FUSION_STATE_1:
|
case FUSION_STATE_1:
|
||||||
case FUSION_STATE_2:
|
case FUSION_STATE_2:
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -104,7 +104,7 @@ void sub_0809F5F0(CloudEntity* this) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
super->timer = 120;
|
super->timer = 120;
|
||||||
SetPlayerControl(3);
|
SetPlayerControl(3);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
gRoomControls.camera_target = super;
|
gRoomControls.camera_target = super;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ void CrenelBeanSprout_Action6(CrenelBeanSproutEntity* this) {
|
||||||
CrenelBeanSprout_Action6SubAction2,
|
CrenelBeanSprout_Action6SubAction2,
|
||||||
};
|
};
|
||||||
if (super->subAction != 2) {
|
if (super->subAction != 2) {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
CrenelBeanSprout_Action6SubActions[super->subAction](this);
|
CrenelBeanSprout_Action6SubActions[super->subAction](this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -457,7 +457,7 @@ void CutsceneMiscObject_Type7(CutsceneMiscObjectEntity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if ((gMessage.doTextBox & 0x7F) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
CreateItemEntity(ITEM_JABBERNUT, 0, 0);
|
CreateItemEntity(ITEM_JABBERNUT, 0, 0);
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,11 +81,11 @@ void EzloCap_Type0Action1(EzloCapEntity* this) {
|
||||||
static const u8 gUnk_0811F16C[] = { 4, 0, 2, 6, 10, 8, 9, 5, 1, 0, 0, 0 };
|
static const u8 gUnk_0811F16C[] = { 4, 0, 2, 6, 10, 8, 9, 5, 1, 0, 0, 0 };
|
||||||
u32 tmp = gPlayerEntity.palette.b.b0;
|
u32 tmp = gPlayerEntity.palette.b.b0;
|
||||||
super->palette.b.b0 = tmp;
|
super->palette.b.b0 = tmp;
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
DeleteEntity(super);
|
DeleteEntity(super);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((gMessage.doTextBox & 0x7f) != 5) {
|
if ((gMessage.state & MESSAGE_ACTIVE) != 5) {
|
||||||
if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) {
|
if (((gMessage.unk == 0xa) || (gMessage.unk == 0)) || ((gMessage.unk & 0xf) > 9)) {
|
||||||
if (super->animIndex != (super->subtimer | 3)) {
|
if (super->animIndex != (super->subtimer | 3)) {
|
||||||
InitAnimationForceUpdate(super, super->subtimer | 3);
|
InitAnimationForceUpdate(super, super->subtimer | 3);
|
||||||
|
|
|
@ -138,7 +138,7 @@ void FourElements_Action5(FourElementsEntity* this) {
|
||||||
|
|
||||||
void FourElements_Action6(FourElementsEntity* this) {
|
void FourElements_Action6(FourElementsEntity* this) {
|
||||||
RequestPriorityDuration(NULL, 10);
|
RequestPriorityDuration(NULL, 10);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
SetPriorityTimer(90);
|
SetPriorityTimer(90);
|
||||||
gPlayerState.controlMode = 1;
|
gPlayerState.controlMode = 1;
|
||||||
EnablePauseMenu();
|
EnablePauseMenu();
|
||||||
|
|
|
@ -267,7 +267,7 @@ void FrozenOctorok_Action1SubAction0(FrozenOctorokEntity* this) {
|
||||||
|
|
||||||
void FrozenOctorok_Action1SubAction1(FrozenOctorokEntity* this) {
|
void FrozenOctorok_Action1SubAction1(FrozenOctorokEntity* this) {
|
||||||
Entity* obj;
|
Entity* obj;
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
if (this->unk_79-- == 0) {
|
if (this->unk_79-- == 0) {
|
||||||
obj = CreateObjectWithParent(super, FROZEN_OCTOROK, 7, 0);
|
obj = CreateObjectWithParent(super, FROZEN_OCTOROK, 7, 0);
|
||||||
if (obj != NULL) {
|
if (obj != NULL) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ void sub_080921BC(GentariCurtainEntity* this) {
|
||||||
GenericEntity* pEVar1;
|
GenericEntity* pEVar1;
|
||||||
GenericEntity* end;
|
GenericEntity* end;
|
||||||
|
|
||||||
pEVar1 = (GenericEntity*)gItemGetEntities;
|
pEVar1 = (GenericEntity*)gAuxPlayerEntities;
|
||||||
end = pEVar1 + 0x4f;
|
end = pEVar1 + 0x4f;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -82,7 +82,7 @@ void GleerokParticle_Init(GleerokParticleEntity* this) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
return;
|
return;
|
||||||
case 0:
|
case 0:
|
||||||
super->direction = gUnk_081229D0[super->type2].direction;
|
super->direction = gUnk_081229D0[super->type2].direction;
|
||||||
|
|
|
@ -96,7 +96,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) {
|
||||||
if (super->interactType != INTERACTION_NONE) {
|
if (super->interactType != INTERACTION_NONE) {
|
||||||
super->interactType = INTERACTION_NONE;
|
super->interactType = INTERACTION_NONE;
|
||||||
super->subAction = 1;
|
super->subAction = 1;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
ResetActiveItems();
|
ResetActiveItems();
|
||||||
gPlayerState.heldObject = 4;
|
gPlayerState.heldObject = 4;
|
||||||
gNewPlayerEntity.unk_74 = super;
|
gNewPlayerEntity.unk_74 = super;
|
||||||
|
|
|
@ -325,7 +325,7 @@ void LilypadLarge_Action2(LilypadLargeEntity* this) {
|
||||||
};
|
};
|
||||||
subActionFuncs[super->subAction](this);
|
subActionFuncs[super->subAction](this);
|
||||||
gPlayerState.flags |= PL_FLAGS2;
|
gPlayerState.flags |= PL_FLAGS2;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08085A44(LilypadLargeEntity* this) {
|
void sub_08085A44(LilypadLargeEntity* this) {
|
||||||
|
@ -460,7 +460,7 @@ void sub_08085D28(LilypadLargeEntity* this) {
|
||||||
(GetRelativeCollisionTile(super, 0, 0x18) == 0x11)) {
|
(GetRelativeCollisionTile(super, 0, 0x18) == 0x11)) {
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
super->subAction = 0;
|
super->subAction = 0;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ void LinkAnimation_ItemGet(LinkAnimationEntity* this) {
|
||||||
break;
|
break;
|
||||||
case ITEMGET_WAIT:
|
case ITEMGET_WAIT:
|
||||||
UpdateAnimationSingleFrame(super);
|
UpdateAnimationSingleFrame(super);
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (super->frame & ANIM_DONE) {
|
if (super->frame & ANIM_DONE) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ void MoleMittsParticle(Entity* this) {
|
||||||
MoleMittsParticle_Init,
|
MoleMittsParticle_Init,
|
||||||
MoleMittsParticle_Action1,
|
MoleMittsParticle_Action1,
|
||||||
};
|
};
|
||||||
if (!EntityIsDeleted(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
MoleMittsParticle_Actions[this->action](this);
|
MoleMittsParticle_Actions[this->action](this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ void OctorokBossObject_Action1(OctorokBossObjectEntity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
if ((this->unk_78.WORD_U)-- == 0) {
|
if ((this->unk_78.WORD_U)-- == 0) {
|
||||||
gRoomControls.camera_target = &gPlayerEntity;
|
gRoomControls.camera_target = &gPlayerEntity;
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
|
|
|
@ -40,7 +40,7 @@ void Well_Init(WellEntity* this) {
|
||||||
void Well_Action1(WellEntity* this) {
|
void Well_Action1(WellEntity* this) {
|
||||||
u32 tileIndex = GetTileType(this->unk_80, 1);
|
u32 tileIndex = GetTileType(this->unk_80, 1);
|
||||||
if (tileIndex != 0x407D) {
|
if (tileIndex != 0x407D) {
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
gPlayerEntity.x.WORD = super->x.WORD;
|
gPlayerEntity.x.WORD = super->x.WORD;
|
||||||
gPlayerEntity.y.HALF.HI = super->y.HALF.HI + 4;
|
gPlayerEntity.y.HALF.HI = super->y.HALF.HI + 4;
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
|
|
|
@ -21,7 +21,7 @@ void WindTribeTeleporter_Action1(WindTribeTeleporterEntity*);
|
||||||
void WindTribeTeleporter_Action2(WindTribeTeleporterEntity*);
|
void WindTribeTeleporter_Action2(WindTribeTeleporterEntity*);
|
||||||
void WindTribeTeleporter_Action3(WindTribeTeleporterEntity*);
|
void WindTribeTeleporter_Action3(WindTribeTeleporterEntity*);
|
||||||
void sub_080A11E0(WindTribeTeleporterEntity*);
|
void sub_080A11E0(WindTribeTeleporterEntity*);
|
||||||
bool32 sub_080A11C0(WindTribeTeleporterEntity*);
|
static bool32 PlayerCollidingTeleporter(WindTribeTeleporterEntity*);
|
||||||
|
|
||||||
void WindTribeTeleporter(WindTribeTeleporterEntity* this) {
|
void WindTribeTeleporter(WindTribeTeleporterEntity* this) {
|
||||||
static void (*const WindTribeTeleporter_Actions[])(WindTribeTeleporterEntity*) = {
|
static void (*const WindTribeTeleporter_Actions[])(WindTribeTeleporterEntity*) = {
|
||||||
|
@ -40,11 +40,11 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
|
||||||
super->spritePriority.b0 = 7;
|
super->spritePriority.b0 = 7;
|
||||||
super->hitbox = (Hitbox*)&gHitbox_22;
|
super->hitbox = (Hitbox*)&gHitbox_22;
|
||||||
SetEntityPriority(super, 6);
|
SetEntityPriority(super, 6);
|
||||||
if (sub_080A11C0(this)) {
|
if (PlayerCollidingTeleporter(this)) {
|
||||||
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
|
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
|
||||||
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
|
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
|
||||||
SetPlayerControl(CONTROL_DISABLED);
|
SetPlayerControl(CONTROL_DISABLED);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
SetPlayerEventPriority();
|
SetPlayerEventPriority();
|
||||||
SoundReq(SFX_112);
|
SoundReq(SFX_112);
|
||||||
super->action = 3;
|
super->action = 3;
|
||||||
|
@ -54,12 +54,12 @@ void WindTribeTeleporter_Init(WindTribeTeleporterEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) {
|
void WindTribeTeleporter_Action1(WindTribeTeleporterEntity* this) {
|
||||||
if (sub_080A11C0(this)) {
|
if (PlayerCollidingTeleporter(this)) {
|
||||||
if (this->unk_68 == 0) {
|
if (this->unk_68 == 0) {
|
||||||
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
|
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
|
||||||
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
|
gPlayerEntity.y.HALF.HI = super->y.HALF.HI;
|
||||||
SetPlayerControl(CONTROL_DISABLED);
|
SetPlayerControl(CONTROL_DISABLED);
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
SetPlayerEventPriority();
|
SetPlayerEventPriority();
|
||||||
SoundReq(SFX_112);
|
SoundReq(SFX_112);
|
||||||
super->action = 2;
|
super->action = 2;
|
||||||
|
@ -177,7 +177,7 @@ void WindTribeTeleporter_Action3(WindTribeTeleporterEntity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 sub_080A11C0(WindTribeTeleporterEntity* this) {
|
static bool32 PlayerCollidingTeleporter(WindTribeTeleporterEntity* this) {
|
||||||
if (gPlayerEntity.z.HALF.HI != 0) {
|
if (gPlayerEntity.z.HALF.HI != 0) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -31,7 +31,7 @@ const s8 gUnk_08126EEC[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) {
|
Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) {
|
||||||
Entity* e = CreateItemGetEntity();
|
Entity* e = CreateAuxPlayerEntity();
|
||||||
if (e != NULL) {
|
if (e != NULL) {
|
||||||
LinkAnimationEntity* this = (LinkAnimationEntity*)e;
|
LinkAnimationEntity* this = (LinkAnimationEntity*)e;
|
||||||
e->id = LINK_ANIMATION;
|
e->id = LINK_ANIMATION;
|
||||||
|
@ -42,7 +42,7 @@ Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2) {
|
||||||
AppendEntityToList(e, 6);
|
AppendEntityToList(e, 6);
|
||||||
PrependEntityToList(e, 6);
|
PrependEntityToList(e, 6);
|
||||||
CopyPosition(&gPlayerEntity, e);
|
CopyPosition(&gPlayerEntity, e);
|
||||||
gPriorityHandler.sys_priority = 6;
|
gPriorityHandler.event_priority = 6;
|
||||||
gPauseMenuOptions.disabled = 1;
|
gPauseMenuOptions.disabled = 1;
|
||||||
|
|
||||||
// store player state
|
// store player state
|
||||||
|
|
14
src/player.c
14
src/player.c
|
@ -280,7 +280,7 @@ extern ScriptExecutionContext gPlayerScriptExecutionContext;
|
||||||
bool32 CheckInitPauseMenu(void) {
|
bool32 CheckInitPauseMenu(void) {
|
||||||
u32 framestate;
|
u32 framestate;
|
||||||
if (((gInput.newKeys & START_BUTTON) == 0 || gFadeControl.active || gPauseMenuOptions.disabled ||
|
if (((gInput.newKeys & START_BUTTON) == 0 || gFadeControl.active || gPauseMenuOptions.disabled ||
|
||||||
(gMessage.doTextBox & 0x7F) || gSave.stats.health == 0 || !gSave.inventory[0] ||
|
(gMessage.state & MESSAGE_ACTIVE) || gSave.stats.health == 0 || !gSave.inventory[0] ||
|
||||||
gPlayerState.controlMode != 0 || gPriorityHandler.priority_timer != 0)) {
|
gPlayerState.controlMode != 0 || gPriorityHandler.priority_timer != 0)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ static void sub_08070E9C(Entity* this) {
|
||||||
static void sub_08070EDC(Entity* this) {
|
static void sub_08070EDC(Entity* this) {
|
||||||
this->updatePriority = PRIO_MESSAGE;
|
this->updatePriority = PRIO_MESSAGE;
|
||||||
|
|
||||||
if ((gMessage.doTextBox & 0x7f) != 0)
|
if (gMessage.state & MESSAGE_ACTIVE)
|
||||||
this->subAction = 1;
|
this->subAction = 1;
|
||||||
|
|
||||||
if ((gPlayerState.flags & PL_MINISH) == 0)
|
if ((gPlayerState.flags & PL_MINISH) == 0)
|
||||||
|
@ -739,7 +739,7 @@ static void sub_08070EDC(Entity* this) {
|
||||||
|
|
||||||
static void sub_08070f24(Entity* this) {
|
static void sub_08070f24(Entity* this) {
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->updatePriority = this->updatePriorityPrev;
|
this->updatePriority = this->updatePriorityPrev;
|
||||||
ResetPlayerAnimationAndAction();
|
ResetPlayerAnimationAndAction();
|
||||||
}
|
}
|
||||||
|
@ -808,7 +808,7 @@ static void sub_08071038(Entity* this) {
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
|
|
||||||
// player is still reading message
|
// player is still reading message
|
||||||
if (CheckQueuedAction() || (gMessage.doTextBox & 0x7f))
|
if (CheckQueuedAction() || (gMessage.state & MESSAGE_ACTIVE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this->frame & ANIM_DONE) {
|
if (this->frame & ANIM_DONE) {
|
||||||
|
@ -1286,7 +1286,7 @@ static void PlayerTalkEzlo_Init(Entity* this) {
|
||||||
ResetActiveItems();
|
ResetActiveItems();
|
||||||
gActiveItems[ACTIVE_ITEM_LANTERN].animPriority = 0;
|
gActiveItems[ACTIVE_ITEM_LANTERN].animPriority = 0;
|
||||||
this->iframes = 0;
|
this->iframes = 0;
|
||||||
gPriorityHandler.sys_priority = PRIO_PLAYER_EVENT;
|
gPriorityHandler.event_priority = PRIO_PLAYER_EVENT;
|
||||||
this->updatePriority = PRIO_PLAYER_EVENT;
|
this->updatePriority = PRIO_PLAYER_EVENT;
|
||||||
|
|
||||||
if (gPlayerState.flags & PL_MINISH) {
|
if (gPlayerState.flags & PL_MINISH) {
|
||||||
|
@ -1335,7 +1335,7 @@ static void PlayerTalkEzlo_CreateMessage(Entity* this) {
|
||||||
static void PlayerTalkEzlo_MessageIdle(Entity* this) {
|
static void PlayerTalkEzlo_MessageIdle(Entity* this) {
|
||||||
u32 rightOrLeft;
|
u32 rightOrLeft;
|
||||||
|
|
||||||
if ((gMessage.doTextBox & 0x7f) == 0) {
|
if ((gMessage.state & MESSAGE_ACTIVE) == 0) {
|
||||||
this->subAction++;
|
this->subAction++;
|
||||||
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
if ((gPlayerState.flags & PL_MINISH) == 0) {
|
||||||
if (this->animationState == IdleEast)
|
if (this->animationState == IdleEast)
|
||||||
|
@ -1380,7 +1380,7 @@ static void PlayerTalkEzlo_Leave(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reset_priority(void) {
|
static void reset_priority(void) {
|
||||||
gPriorityHandler.sys_priority = PRIO_MIN;
|
gPriorityHandler.event_priority = PRIO_MIN;
|
||||||
gPlayerEntity.updatePriority = gPlayerEntity.updatePriorityPrev;
|
gPlayerEntity.updatePriority = gPlayerEntity.updatePriorityPrev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ void ItemUpdate(Entity* this) {
|
||||||
if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0 && this->subAction == 0)
|
if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0 && this->subAction == 0)
|
||||||
ItemInit(this);
|
ItemInit(this);
|
||||||
|
|
||||||
if (!EntityIsDeleted(this)) {
|
if (!EntityDisabled(this)) {
|
||||||
gPlayerItemFunctions[this->id](this);
|
gPlayerItemFunctions[this->id](this);
|
||||||
this->contactFlags &= ~0x80;
|
this->contactFlags &= ~0x80;
|
||||||
if (this->iframes != 0) {
|
if (this->iframes != 0) {
|
||||||
|
|
|
@ -36,7 +36,7 @@ static Entity* GiveItemWithCutscene(u32 item, u32 type2, u32 delay) {
|
||||||
item = ITEM_RUPEE50;
|
item = ITEM_RUPEE50;
|
||||||
type2 = 0;
|
type2 = 0;
|
||||||
}
|
}
|
||||||
e = CreateItemGetEntity();
|
e = CreateAuxPlayerEntity();
|
||||||
if (e != NULL) {
|
if (e != NULL) {
|
||||||
e->type = item;
|
e->type = item;
|
||||||
e->type2 = type2;
|
e->type2 = type2;
|
||||||
|
|
|
@ -462,7 +462,7 @@ Entity* CreatePlayerItemWithParent(ItemBehavior* this, u32 id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void* CreateItemGetPlayerItemWithParent(ItemBehavior* this) {
|
void* CreateItemGetPlayerItemWithParent(ItemBehavior* this) {
|
||||||
GenericEntity* playerItem = (GenericEntity*)CreateItemGetEntity();
|
GenericEntity* playerItem = (GenericEntity*)CreateAuxPlayerEntity();
|
||||||
if (playerItem != NULL) {
|
if (playerItem != NULL) {
|
||||||
playerItem->base.id = gItemDefinitions[this->behaviorId].playerItemId;
|
playerItem->base.id = gItemDefinitions[this->behaviorId].playerItemId;
|
||||||
playerItem->base.kind = PLAYER_ITEM;
|
playerItem->base.kind = PLAYER_ITEM;
|
||||||
|
@ -501,7 +501,7 @@ Entity* CreatePlayerItem(u32 id, u32 type, u32 type2, u32 unk) {
|
||||||
Entity* sub_08077CF8(u32 id, u32 type, u32 type2, u32 unk) {
|
Entity* sub_08077CF8(u32 id, u32 type, u32 type2, u32 unk) {
|
||||||
GenericEntity* ent;
|
GenericEntity* ent;
|
||||||
|
|
||||||
ent = (GenericEntity*)CreateItemGetEntity();
|
ent = (GenericEntity*)CreateAuxPlayerEntity();
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
ent->base.flags = ENT_COLLIDE;
|
ent->base.flags = ENT_COLLIDE;
|
||||||
ent->base.kind = PLAYER_ITEM;
|
ent->base.kind = PLAYER_ITEM;
|
||||||
|
@ -988,7 +988,7 @@ bool32 sub_08078140(ChargeState* info) {
|
||||||
void ForceSetPlayerState(u32 framestate) {
|
void ForceSetPlayerState(u32 framestate) {
|
||||||
gPlayerState.framestate = framestate;
|
gPlayerState.framestate = framestate;
|
||||||
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
gPlayerEntity.flags &= ~ENT_COLLIDE;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DetermineRButtonInteraction(void) {
|
void DetermineRButtonInteraction(void) {
|
||||||
|
@ -1504,7 +1504,7 @@ void SetPlayerItemGetState(Entity* item, u8 param_2, u8 param_3) {
|
||||||
DeleteClones();
|
DeleteClones();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08078B48(void) {
|
void PausePlayer(void) {
|
||||||
gPlayerState.field_0x7 |= 0x80;
|
gPlayerState.field_0x7 |= 0x80;
|
||||||
gPlayerState.keepFacing |= 0x80;
|
gPlayerState.keepFacing |= 0x80;
|
||||||
gPlayerState.field_0xa |= 0x80;
|
gPlayerState.field_0xa |= 0x80;
|
||||||
|
@ -2494,7 +2494,7 @@ u32 sub_08079FD4(Entity* this, u32 param_2) {
|
||||||
|
|
||||||
void UpdatePlayerPalette(void) {
|
void UpdatePlayerPalette(void) {
|
||||||
u32 palette;
|
u32 palette;
|
||||||
if ((gPlayerState.hurtBlinkSpeed != 0) && ((gMessage.doTextBox & 0x7f) == 0)) {
|
if ((gPlayerState.hurtBlinkSpeed != 0) && ((gMessage.state & MESSAGE_ACTIVE) == 0)) {
|
||||||
gPlayerState.hurtBlinkSpeed--;
|
gPlayerState.hurtBlinkSpeed--;
|
||||||
}
|
}
|
||||||
palette = GetPlayerPalette(FALSE);
|
palette = GetPlayerPalette(FALSE);
|
||||||
|
|
|
@ -1054,7 +1054,7 @@ void ScriptCommand_0807E858(Entity* entity, ScriptExecutionContext* context) {
|
||||||
|
|
||||||
void ScriptCommand_SetPlayerIdle(Entity* entity, ScriptExecutionContext* context) {
|
void ScriptCommand_SetPlayerIdle(Entity* entity, ScriptExecutionContext* context) {
|
||||||
gPlayerState.controlMode = CONTROL_DISABLED;
|
gPlayerState.controlMode = CONTROL_DISABLED;
|
||||||
sub_08078B48();
|
PausePlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptCommand_EnablePlayerControl(Entity* entity, ScriptExecutionContext* context) {
|
void ScriptCommand_EnablePlayerControl(Entity* entity, ScriptExecutionContext* context) {
|
||||||
|
@ -1129,7 +1129,7 @@ void ScriptCommand_0807E974(Entity* entity, ScriptExecutionContext* context) {
|
||||||
MessageFromTarget(context->scriptInstructionPointer[1]);
|
MessageFromTarget(context->scriptInstructionPointer[1]);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (gMessage.doTextBox & 0x7F)
|
if (gMessage.state & MESSAGE_ACTIVE)
|
||||||
break;
|
break;
|
||||||
context->unk_18 = 2;
|
context->unk_18 = 2;
|
||||||
context->unk_19 = 0xF;
|
context->unk_19 = 0xF;
|
||||||
|
@ -1191,7 +1191,7 @@ void ScriptCommand_AddInteractableFuser(Entity* entity, ScriptExecutionContext*
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptCommand_WaitUntilTextboxCloses(Entity* entity, ScriptExecutionContext* context) {
|
void ScriptCommand_WaitUntilTextboxCloses(Entity* entity, ScriptExecutionContext* context) {
|
||||||
if (gMessage.doTextBox & 0x7F) {
|
if (gMessage.state & MESSAGE_ACTIVE) {
|
||||||
gActiveScriptInfo.commandSize = 0;
|
gActiveScriptInfo.commandSize = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -268,7 +268,7 @@ void sub_0807FF1C(RoomControls* controls) {
|
||||||
gUpdateVisibleTiles = 3;
|
gUpdateVisibleTiles = 3;
|
||||||
if (++controls->unk_18 > 0x13) {
|
if (++controls->unk_18 > 0x13) {
|
||||||
controls->scrollAction = 0;
|
controls->scrollAction = 0;
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,7 +408,7 @@ void sub_080801BC(RoomControls* controls) {
|
||||||
if (controls->unk_1c == 0) {
|
if (controls->unk_1c == 0) {
|
||||||
controls->scrollAction = 0;
|
controls->scrollAction = 0;
|
||||||
controls->reload_flags = 0;
|
controls->reload_flags = 0;
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
gScreen.lcd.displayControl &= ~DISPCNT_WIN1_ON;
|
gScreen.lcd.displayControl &= ~DISPCNT_WIN1_ON;
|
||||||
gScreen.controls.windowInsideControl &= 0xff;
|
gScreen.controls.windowInsideControl &= 0xff;
|
||||||
gScreen.controls.windowOutsideControl &= 0xff00;
|
gScreen.controls.windowOutsideControl &= 0xff00;
|
||||||
|
|
|
@ -93,7 +93,7 @@ void StaffrollTask_State0(void) {
|
||||||
gScreen.bg1.control = 0x1e4d;
|
gScreen.bg1.control = 0x1e4d;
|
||||||
gScreen.bg2.control = 0x1dc3;
|
gScreen.bg2.control = 0x1dc3;
|
||||||
InitSoundPlayingInfo();
|
InitSoundPlayingInfo();
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
SetFade(FADE_IN_OUT | FADE_INSTANT, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ void Subtask_Die(void) {
|
||||||
gMain.substate = gUI.pauseFadeIn;
|
gMain.substate = gUI.pauseFadeIn;
|
||||||
gUI.nextToLoad = gFadeControl.active;
|
gUI.nextToLoad = gFadeControl.active;
|
||||||
gUI.lastState = gFadeControl.active;
|
gUI.lastState = gFadeControl.active;
|
||||||
ResetSystemPriority();
|
ClearEventPriority();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
7
src/ui.c
7
src/ui.c
|
@ -626,7 +626,8 @@ void ButtonUIElement_Action1(UIElement* element) {
|
||||||
|
|
||||||
MAX_MOVEMENT = (!element->type2) ? 4 : 8;
|
MAX_MOVEMENT = (!element->type2) ? 4 : 8;
|
||||||
|
|
||||||
if (element->type2 == 0 && (((gUnk_0200AF00.unk_1 >> element->type) & 1) || (gMessage.doTextBox & 0x7f) != 0)) {
|
if (element->type2 == 0 &&
|
||||||
|
(((gUnk_0200AF00.unk_1 >> element->type) & 1) || (gMessage.state & MESSAGE_ACTIVE) != 0)) {
|
||||||
y = (s16)gUnk_0200AF00.buttonY[element->type] - 0x28;
|
y = (s16)gUnk_0200AF00.buttonY[element->type] - 0x28;
|
||||||
} else {
|
} else {
|
||||||
y = (s16)gUnk_0200AF00.buttonY[element->type];
|
y = (s16)gUnk_0200AF00.buttonY[element->type];
|
||||||
|
@ -792,7 +793,7 @@ void HeartUIElement(UIElement* element) {
|
||||||
u32 health;
|
u32 health;
|
||||||
u32 frameIndex;
|
u32 frameIndex;
|
||||||
element->unk_0_1 = 0;
|
element->unk_0_1 = 0;
|
||||||
if (((gUnk_0200AF00.unk_1 & 0x10) == 0) && ((gMessage.doTextBox & 0x7f) == 0)) {
|
if (((gUnk_0200AF00.unk_1 & 0x10) == 0) && ((gMessage.state & MESSAGE_ACTIVE) == 0)) {
|
||||||
health = gUnk_0200AF00.health;
|
health = gUnk_0200AF00.health;
|
||||||
if (health != 0) {
|
if (health != 0) {
|
||||||
element->unk_0_1 = 1;
|
element->unk_0_1 = 1;
|
||||||
|
@ -845,7 +846,7 @@ void EzloNagUIElement_Action1(UIElement* element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EzloNagUIElement_Action2(UIElement* element) {
|
void EzloNagUIElement_Action2(UIElement* element) {
|
||||||
if (gUnk_0200AF00.ezloNagFuncIndex >= 5 || (gMessage.doTextBox & 0x7f)) {
|
if (gUnk_0200AF00.ezloNagFuncIndex >= 5 || (gMessage.state & MESSAGE_ACTIVE)) {
|
||||||
element->action = 0;
|
element->action = 0;
|
||||||
element->unk_0_1 = 0;
|
element->unk_0_1 = 0;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue