mirror of https://github.com/zeldaret/tmc.git
create object enum and update entity type struct
This commit is contained in:
parent
6596831a6b
commit
e3ee1058bb
|
@ -5,19 +5,22 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
PLAYER = 1,
|
||||||
|
ENEMY = 3,
|
||||||
|
PROJECTILE = 4,
|
||||||
|
OBJECT = 6,
|
||||||
|
NPC = 7,
|
||||||
|
PLAYER_ITEM = 8,
|
||||||
|
MANAGER = 9,
|
||||||
|
} EntityType;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void* entity1;
|
void* entity1;
|
||||||
void* entity2;
|
void* entity2;
|
||||||
u8 filler[14];
|
u8 filler[14];
|
||||||
} UnkStruct;
|
} UnkStruct;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
u8 type;
|
|
||||||
u8 subtype;
|
|
||||||
u8 form;
|
|
||||||
u8 parameter;
|
|
||||||
} EntityType;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
s8 offset_x;
|
s8 offset_x;
|
||||||
s8 offset_y;
|
s8 offset_y;
|
||||||
|
@ -39,7 +42,10 @@ typedef struct {
|
||||||
typedef struct Entity {
|
typedef struct Entity {
|
||||||
/*0x00*/ struct Entity* prev;
|
/*0x00*/ struct Entity* prev;
|
||||||
/*0x04*/ struct Entity* next;
|
/*0x04*/ struct Entity* next;
|
||||||
/*0x08*/ EntityType entityType;
|
/*0x08*/ u8 kind; // was: type
|
||||||
|
/*0x09*/ u8 id; // was: subtype
|
||||||
|
/*0x0a*/ u8 type; // was: form
|
||||||
|
/*0x0b*/ u8 type2; // was: parameter
|
||||||
/*0x0c*/ u8 action;
|
/*0x0c*/ u8 action;
|
||||||
/*0x0d*/ u8 previousActionFlag;
|
/*0x0d*/ u8 previousActionFlag;
|
||||||
/*0x0e*/ u8 actionDelay;
|
/*0x0e*/ u8 actionDelay;
|
||||||
|
|
197
include/object.h
197
include/object.h
|
@ -4,6 +4,203 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GROUND_ITEM,
|
||||||
|
DEATH_FX,
|
||||||
|
SHOP_ITEM,
|
||||||
|
BUTTON,
|
||||||
|
OBJECT_4,
|
||||||
|
POT,
|
||||||
|
OBJECT_6,
|
||||||
|
PUSHED_BLOCK,
|
||||||
|
LOCKED_DOOR,
|
||||||
|
OBJECT_9,
|
||||||
|
OBJECT_A,
|
||||||
|
OBJECT_B,
|
||||||
|
CHEST_SPAWNER,
|
||||||
|
OBJECT_D,
|
||||||
|
OBJECT_E,
|
||||||
|
SPECIAL_FX,
|
||||||
|
OBJECT_10,
|
||||||
|
OBJECT_11,
|
||||||
|
OBJECT_12,
|
||||||
|
RAILTRACK,
|
||||||
|
LILYPAD_LARGE,
|
||||||
|
OBJECT_15,
|
||||||
|
FLOATING_PLATFORM,
|
||||||
|
OBJECT_17,
|
||||||
|
EVIL_SPIRIT,
|
||||||
|
HOUSE_DOOR_EXT,
|
||||||
|
OBJECT_1A,
|
||||||
|
GREAT_FAIRY,
|
||||||
|
OBJECT_1C,
|
||||||
|
OBJECT_1D,
|
||||||
|
OBJECT_1E,
|
||||||
|
OBJECT_1F,
|
||||||
|
OBJECT_20,
|
||||||
|
OBJECT_21,
|
||||||
|
FIGURINE_DEVICE,
|
||||||
|
EYE_SWITCH,
|
||||||
|
OBJECT_24,
|
||||||
|
BIG_BARREL,
|
||||||
|
OBJECT_26,
|
||||||
|
PUSHABLE_STATUE,
|
||||||
|
OBJECT_28,
|
||||||
|
OBJECT_29,
|
||||||
|
OBJECT_2A,
|
||||||
|
OBJECT_2B,
|
||||||
|
BEANSTALK,
|
||||||
|
SMOKE,
|
||||||
|
PUSHABLE_ROCK,
|
||||||
|
HITTABLE_LEVER,
|
||||||
|
OBJECT_30,
|
||||||
|
OBJECT_31,
|
||||||
|
PULLABLE_MUSHROOM,
|
||||||
|
BOLLARD,
|
||||||
|
WARP_POINT,
|
||||||
|
OBJECT_35,
|
||||||
|
OBJECT_36,
|
||||||
|
OBJECT_37,
|
||||||
|
JAR_PORTAL,
|
||||||
|
BOSS_DOOR,
|
||||||
|
OBJECT_3A,
|
||||||
|
PORTAL_MUSHROOM_STALKS,
|
||||||
|
PORTAL_FALLING_PLAYER,
|
||||||
|
OBJECT_3D,
|
||||||
|
OBJECT_3E,
|
||||||
|
GIANT_LEAF,
|
||||||
|
FAIRY,
|
||||||
|
LADDER_UP,
|
||||||
|
OBJECT_42,
|
||||||
|
OBJECT_43,
|
||||||
|
OBJECT_44,
|
||||||
|
OBJECT_45,
|
||||||
|
GIANT_BOOK_LADDER,
|
||||||
|
HEART_CONTAINER,
|
||||||
|
FILE_SCREEN_OBJECTS,
|
||||||
|
OBJECT_49,
|
||||||
|
BACKGROUND_CLOUD,
|
||||||
|
OBJECT_4B,
|
||||||
|
PUSHABLE_FURNITURE,
|
||||||
|
FURNITURE,
|
||||||
|
MINISH_SIZED_ENTRANCE,
|
||||||
|
ARCHWAY,
|
||||||
|
GIANT_ROCK,
|
||||||
|
OBJECT_51,
|
||||||
|
OBJECT_52,
|
||||||
|
OBJECT_53,
|
||||||
|
PULLABLE_LEVER,
|
||||||
|
MINECART,
|
||||||
|
THOUGHT_BUBBLE,
|
||||||
|
HIDDEN_LADDER_DOWN,
|
||||||
|
GENTARI_CURTAIN,
|
||||||
|
LAVA_PLATFORM,
|
||||||
|
OBJECT_5A,
|
||||||
|
OBJECT_5B,
|
||||||
|
MASK,
|
||||||
|
HOUSE_DOOR_INT,
|
||||||
|
WHIRLWIND,
|
||||||
|
OBJECT_BLOCKING_STAIRS,
|
||||||
|
SWORDSMAN_NEWSLETTER,
|
||||||
|
OBJECT_61,
|
||||||
|
GIANT_TWIG,
|
||||||
|
OBJECT_63,
|
||||||
|
OBJECT_64,
|
||||||
|
LADDER_HOLE,
|
||||||
|
OBJECT_66,
|
||||||
|
OBJECT_67,
|
||||||
|
OBJECT_68,
|
||||||
|
OBJECT_69,
|
||||||
|
OBJECT_6A,
|
||||||
|
CRENAL_BEAN_SPROUT,
|
||||||
|
MINECART_DOOR,
|
||||||
|
OBJECT_ON_PILLAR,
|
||||||
|
MINERAL_WATER_SOURCE,
|
||||||
|
MINISH_SIZED_ARCHWAY,
|
||||||
|
OBJECT_70,
|
||||||
|
PUSHABLE_GRAVE,
|
||||||
|
OBJECT_72,
|
||||||
|
LILYPAD_SMALL,
|
||||||
|
OBJECT_74,
|
||||||
|
OBJECT_75,
|
||||||
|
OBJECT_76,
|
||||||
|
BELL,
|
||||||
|
HUGE_DECORATION,
|
||||||
|
OBJECT_79,
|
||||||
|
STEAM,
|
||||||
|
PUSHABLE_LEVER,
|
||||||
|
HUGE_SHOES,
|
||||||
|
OBJECT_ON_BEETLE,
|
||||||
|
OBJECT_7E,
|
||||||
|
PICO_BLOOM,
|
||||||
|
OBJECT_80,
|
||||||
|
OBJECT_81,
|
||||||
|
BIG_VORTEX,
|
||||||
|
BIG_PUSHABLE_LEVER,
|
||||||
|
SMALL_ICE_BLOCK,
|
||||||
|
BIG_ICE_BLOCK,
|
||||||
|
OBJECT_86,
|
||||||
|
OBJECT_87,
|
||||||
|
HUGE_BOOK,
|
||||||
|
OBJECT_89,
|
||||||
|
OBJECT_8A,
|
||||||
|
OBJECT_8B,
|
||||||
|
BOOK,
|
||||||
|
FIREPLACE,
|
||||||
|
OBJECT_8E,
|
||||||
|
FROZEN_WATER_ELEMENT,
|
||||||
|
OBJECT_90,
|
||||||
|
OBJECT_91,
|
||||||
|
BAKER_OVEN,
|
||||||
|
OBJECT_93,
|
||||||
|
WIND_TRIBE_FLAG,
|
||||||
|
BIRD,
|
||||||
|
OBJECT_96,
|
||||||
|
OBJECT_97,
|
||||||
|
OBJECT_98,
|
||||||
|
OBJECT_99,
|
||||||
|
HUGE_ACORN,
|
||||||
|
OBJECT_9B,
|
||||||
|
TREE_HIDING_PORTAL,
|
||||||
|
LIGHTABLE_SWITCH,
|
||||||
|
OBJECT_9E,
|
||||||
|
FAN,
|
||||||
|
OBJECT_A0,
|
||||||
|
PALACE_ARCHWAY,
|
||||||
|
OBJECT_A2,
|
||||||
|
CLOUD,
|
||||||
|
MINISH_LIGHT,
|
||||||
|
OBJECT_A5,
|
||||||
|
OBJECT_A6,
|
||||||
|
OBJECT_A7,
|
||||||
|
OBJECT_A8,
|
||||||
|
OBJECT_A9,
|
||||||
|
WATERFALL_OPENING,
|
||||||
|
OBJECT_AB,
|
||||||
|
FOUR_ELEMENTS,
|
||||||
|
OBJECT_AD,
|
||||||
|
FLOATING_BLOCK,
|
||||||
|
OBJECT_AF,
|
||||||
|
METAL_DOOR,
|
||||||
|
JAIL_BARS,
|
||||||
|
OBJECT_B2,
|
||||||
|
OBJECT_B3,
|
||||||
|
OBJECT_B4,
|
||||||
|
OBJECT_B5,
|
||||||
|
OBJECT_B6,
|
||||||
|
WELL,
|
||||||
|
WIND_TRIBE_TELEPORTER,
|
||||||
|
OBJECT_B9,
|
||||||
|
OBJECT_BA,
|
||||||
|
WINDCREST,
|
||||||
|
LIT_AREA,
|
||||||
|
OBJECT_BD,
|
||||||
|
PINWHEEL,
|
||||||
|
OBJECT_BF,
|
||||||
|
ENEMY_ITEM,
|
||||||
|
OBJECT_C1,
|
||||||
|
} Object;
|
||||||
|
|
||||||
extern void ItemOnGround(Entity*);
|
extern void ItemOnGround(Entity*);
|
||||||
extern void DeathFx(Entity*);
|
extern void DeathFx(Entity*);
|
||||||
extern void ItemForSale(Entity*);
|
extern void ItemForSale(Entity*);
|
||||||
|
|
|
@ -290,7 +290,7 @@ void ItemUpdate(Entity* this) {
|
||||||
ItemInit(this);
|
ItemInit(this);
|
||||||
|
|
||||||
if (!sub_0805E3B0(this)) {
|
if (!sub_0805E3B0(this)) {
|
||||||
gPlayerItemFunctions[this->entityType.subtype](this);
|
gPlayerItemFunctions[this->id](this);
|
||||||
this->bitfield &= ~0x80;
|
this->bitfield &= ~0x80;
|
||||||
if (this->hurtBlinkTime != 0) {
|
if (this->hurtBlinkTime != 0) {
|
||||||
if (this->hurtBlinkTime > 0)
|
if (this->hurtBlinkTime > 0)
|
||||||
|
@ -306,7 +306,7 @@ void ItemUpdate(Entity* this) {
|
||||||
NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this)) {
|
NONMATCH("asm/non_matching/arm_proxy/ItemInit.inc", void ItemInit(Entity* this)) {
|
||||||
ItemFrame* entry;
|
ItemFrame* entry;
|
||||||
|
|
||||||
entry = &gUnk_08126DA8[this->entityType.subtype];
|
entry = &gUnk_08126DA8[this->id];
|
||||||
if (entry->unk0 == 0xff) {
|
if (entry->unk0 == 0xff) {
|
||||||
u32 temp = entry->unk2;
|
u32 temp = entry->unk2;
|
||||||
ItemFrame* temp2 = gUnk_08126ED8[entry->unk1];
|
ItemFrame* temp2 = gUnk_08126ED8[entry->unk1];
|
||||||
|
@ -343,7 +343,7 @@ void ObjectUpdate(Entity* this) {
|
||||||
if (this->hurtBlinkTime != 0)
|
if (this->hurtBlinkTime != 0)
|
||||||
this->hurtBlinkTime++;
|
this->hurtBlinkTime++;
|
||||||
if (!sub_0805E3B0(this)) {
|
if (!sub_0805E3B0(this)) {
|
||||||
gObjectFunctions[this->entityType.subtype](this);
|
gObjectFunctions[this->id](this);
|
||||||
this->bitfield &= ~0x80;
|
this->bitfield &= ~0x80;
|
||||||
}
|
}
|
||||||
DrawEntity(this);
|
DrawEntity(this);
|
||||||
|
@ -351,7 +351,7 @@ void ObjectUpdate(Entity* this) {
|
||||||
|
|
||||||
void sub_08017508(Entity* this) {
|
void sub_08017508(Entity* this) {
|
||||||
if (!sub_0805E3B0(this))
|
if (!sub_0805E3B0(this))
|
||||||
gManagerFunctions[this->entityType.subtype](this);
|
gManagerFunctions[this->id](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// regalloc
|
// regalloc
|
||||||
|
@ -361,10 +361,10 @@ NONMATCH("asm/non_matching/arm_proxy/sub_08017530.inc", void NPCUpdate(Entity* t
|
||||||
if ((this->action == 0) && ((this->flags & 1) == 0))
|
if ((this->action == 0) && ((this->flags & 1) == 0))
|
||||||
sub_0806EC78(this);
|
sub_0806EC78(this);
|
||||||
if (!sub_0805E3B0(this))
|
if (!sub_0805E3B0(this))
|
||||||
gNPCFunctions[this->entityType.subtype][0](this);
|
gNPCFunctions[this->id][0](this);
|
||||||
if (this->next != NULL) {
|
if (this->next != NULL) {
|
||||||
if (gNPCFunctions[this->entityType.subtype][1] != NULL)
|
if (gNPCFunctions[this->id][1] != NULL)
|
||||||
gNPCFunctions[this->entityType.subtype][1](this);
|
gNPCFunctions[this->id][1](this);
|
||||||
if ((this->currentHealth & 0x7f) != 0) {
|
if ((this->currentHealth & 0x7f) != 0) {
|
||||||
u32 temp = this->currentHealth & 0x7f;
|
u32 temp = this->currentHealth & 0x7f;
|
||||||
gUnk_02031EC0[temp * 2 - 2].x = this->x.HALF.HI - gRoomControls.roomOriginX;
|
gUnk_02031EC0[temp * 2 - 2].x = this->x.HALF.HI - gRoomControls.roomOriginX;
|
||||||
|
|
|
@ -250,10 +250,10 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||||
} else {
|
} else {
|
||||||
itemEntity->actionDelay = 0;
|
itemEntity->actionDelay = 0;
|
||||||
}
|
}
|
||||||
if ((arg0->entityType).type == 6) {
|
if (arg0->kind == 6) {
|
||||||
if (arg0->entityType.subtype == 99) {
|
if (arg0->id == 99) {
|
||||||
arg0->attachedEntity = itemEntity;
|
arg0->attachedEntity = itemEntity;
|
||||||
} else if (arg0->entityType.subtype == 0x1e) {
|
} else if (arg0->id == 0x1e) {
|
||||||
itemEntity->direction = arg0->animationState << 3 | 0x80;
|
itemEntity->direction = arg0->animationState << 3 | 0x80;
|
||||||
itemEntity->nonPlanarMovement = 0xc0;
|
itemEntity->nonPlanarMovement = 0xc0;
|
||||||
itemEntity->field_0x20 = 0x18000;
|
itemEntity->field_0x20 = 0x18000;
|
||||||
|
|
|
@ -69,8 +69,8 @@ void* sub_08077C54(UnkItemStruct* unk) {
|
||||||
|
|
||||||
item = sub_0805E744();
|
item = sub_0805E744();
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
item->entityType.subtype = gUnk_0811BE48[unk->field_0x1].unk[3];
|
item->id = gUnk_0811BE48[unk->field_0x1].unk[3];
|
||||||
item->entityType.type = 8;
|
item->kind = 8;
|
||||||
item->flags = 0xa0;
|
item->flags = 0xa0;
|
||||||
item->parent = (Entity*)unk;
|
item->parent = (Entity*)unk;
|
||||||
item->field_0x68.HALF.LO = unk->field_0x1;
|
item->field_0x68.HALF.LO = unk->field_0x1;
|
||||||
|
@ -95,10 +95,10 @@ Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) {
|
||||||
ent = GetEmptyEntity();
|
ent = GetEmptyEntity();
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
ent->flags = 0x80;
|
ent->flags = 0x80;
|
||||||
(ent->entityType).type = 8;
|
ent->kind = 8;
|
||||||
(ent->entityType).subtype = subtype;
|
ent->id = subtype;
|
||||||
(ent->entityType).form = form;
|
ent->type = form;
|
||||||
(ent->entityType).parameter = parameter;
|
ent->type2 = parameter;
|
||||||
ent->field_0x68.HALF.LO = unk;
|
ent->field_0x68.HALF.LO = unk;
|
||||||
AppendEntityToList(ent, 2);
|
AppendEntityToList(ent, 2);
|
||||||
}
|
}
|
||||||
|
@ -111,10 +111,10 @@ Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) {
|
||||||
ent = sub_0805E744();
|
ent = sub_0805E744();
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
ent->flags = 0x80;
|
ent->flags = 0x80;
|
||||||
(ent->entityType).type = 8;
|
ent->kind = 8;
|
||||||
(ent->entityType).subtype = subtype;
|
ent->id = subtype;
|
||||||
(ent->entityType).form = form;
|
ent->type = form;
|
||||||
(ent->entityType).parameter = parameter;
|
ent->type2 = parameter;
|
||||||
ent->field_0x68.HALF.LO = unk;
|
ent->field_0x68.HALF.LO = unk;
|
||||||
AppendEntityToList(ent, 2);
|
AppendEntityToList(ent, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ typedef struct {
|
||||||
void sub_08077DF4(Entity* ent, u32 arg1) {
|
void sub_08077DF4(Entity* ent, u32 arg1) {
|
||||||
*(u16*)&ent->flags = arg1;
|
*(u16*)&ent->flags = arg1;
|
||||||
if ((arg1 & 0xff) > 0xb8) {
|
if ((arg1 & 0xff) > 0xb8) {
|
||||||
arg1 += (ent->entityType).form >> 1;
|
arg1 += ent->type >> 1;
|
||||||
}
|
}
|
||||||
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
|
gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
|
||||||
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
|
InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
|
||||||
|
|
|
@ -9,9 +9,9 @@ Entity* CreateEnemy(u32 subtype, u32 form) {
|
||||||
|
|
||||||
enemy = GetEmptyEntity();
|
enemy = GetEmptyEntity();
|
||||||
if (enemy != NULL) {
|
if (enemy != NULL) {
|
||||||
(enemy->entityType).type = 3;
|
enemy->kind = 3;
|
||||||
(enemy->entityType).subtype = subtype;
|
enemy->id = subtype;
|
||||||
(enemy->entityType).form = form;
|
enemy->type = form;
|
||||||
AppendEntityToList(enemy, 4);
|
AppendEntityToList(enemy, 4);
|
||||||
}
|
}
|
||||||
return enemy;
|
return enemy;
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
// (entity->entityType).form = param_1->entityform;
|
// (entity->entityType).form = param_1->entityform;
|
||||||
// RegisterRoomEntity(entity,param_1);
|
// RegisterRoomEntity(entity,param_1);
|
||||||
// if ((param_1->field_0x1 & 240) != 16) {
|
// if ((param_1->field_0x1 & 240) != 16) {
|
||||||
// (entity->entityType).parameter = *(u8 *)¶m_1->entityparameter;
|
// (entity->type2 = *(u8 *)¶m_1->entityparameter;
|
||||||
// entity->actionDelay = (u8)((u32)param_1->entityparameter >> 8);
|
// entity->actionDelay = (u8)((u32)param_1->entityparameter >> 8);
|
||||||
// if ((type != 9) && (sub_0804AF0C(entity,param_1), entity->field_0x4 != NULL)) {
|
// if ((type != 9) && (sub_0804AF0C(entity,param_1), entity->field_0x4 != NULL)) {
|
||||||
// if ((param_1->entityType & 16) == 0) {
|
// if ((param_1->entityType & 16) == 0) {
|
||||||
|
|
|
@ -4,17 +4,15 @@
|
||||||
extern Entity* GetEmptyEntity();
|
extern Entity* GetEmptyEntity();
|
||||||
extern void AppendEntityToList(Entity*, u8);
|
extern void AppendEntityToList(Entity*, u8);
|
||||||
|
|
||||||
Entity* CreateNPC(u32 subtype, u32 form, u32 parameter)
|
Entity* CreateNPC(u32 subtype, u32 form, u32 parameter) {
|
||||||
|
|
||||||
{
|
|
||||||
Entity* pEVar1;
|
Entity* pEVar1;
|
||||||
|
|
||||||
pEVar1 = GetEmptyEntity();
|
pEVar1 = GetEmptyEntity();
|
||||||
if (pEVar1 != NULL) {
|
if (pEVar1 != NULL) {
|
||||||
(pEVar1->entityType).type = 7;
|
pEVar1->kind = 7;
|
||||||
(pEVar1->entityType).subtype = subtype;
|
pEVar1->id = subtype;
|
||||||
(pEVar1->entityType).form = form;
|
pEVar1->type = form;
|
||||||
(pEVar1->entityType).parameter = parameter;
|
pEVar1->type2 = parameter;
|
||||||
AppendEntityToList(pEVar1, 7);
|
AppendEntityToList(pEVar1, 7);
|
||||||
}
|
}
|
||||||
return pEVar1;
|
return pEVar1;
|
||||||
|
|
|
@ -10,10 +10,10 @@ Entity* CreateObject(u32 subtype, u32 form, u32 parameter) {
|
||||||
|
|
||||||
ent = GetEmptyEntity();
|
ent = GetEmptyEntity();
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
ent->entityType.type = 6;
|
ent->kind = 6;
|
||||||
ent->entityType.subtype = subtype;
|
ent->id = subtype;
|
||||||
ent->entityType.form = form;
|
ent->type = form;
|
||||||
ent->entityType.parameter = parameter;
|
ent->type2 = parameter;
|
||||||
AppendEntityToList(ent, 6);
|
AppendEntityToList(ent, 6);
|
||||||
}
|
}
|
||||||
return ent;
|
return ent;
|
||||||
|
|
|
@ -47,14 +47,14 @@ void AcroBandit(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080318C4(Entity* this) {
|
void sub_080318C4(Entity* this) {
|
||||||
gUnk_080CE584[this->entityType.form](this);
|
gUnk_080CE584[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080318DC(Entity* this) {
|
void sub_080318DC(Entity* this) {
|
||||||
Entity* brother;
|
Entity* brother;
|
||||||
|
|
||||||
if (this->bitfield != 0x80 && this->bitfield != 0x81) {
|
if (this->bitfield != 0x80 && this->bitfield != 0x81) {
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
if (this->action < 7 && this->field_0x42) {
|
if (this->action < 7 && this->field_0x42) {
|
||||||
brother = this->attachedEntity;
|
brother = this->attachedEntity;
|
||||||
if (brother) {
|
if (brother) {
|
||||||
|
@ -85,13 +85,13 @@ void sub_080318DC(Entity* this) {
|
||||||
|
|
||||||
if (this->currentHealth == 0) {
|
if (this->currentHealth == 0) {
|
||||||
this->field_0x3e = ((this->field_0x3e + (7 & Random())) - 4) & 0x1f;
|
this->field_0x3e = ((this->field_0x3e + (7 & Random())) - 4) & 0x1f;
|
||||||
this->field_0x42 += this->entityType.parameter * 3;
|
this->field_0x42 += this->type2 * 3;
|
||||||
sub_08032338(this);
|
sub_08032338(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->field_0x42 && this->frames.all & 0x10) {
|
if (this->field_0x42 && this->frames.all & 0x10) {
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
this->action = 8;
|
this->action = 8;
|
||||||
} else {
|
} else {
|
||||||
this->action = 9;
|
this->action = 9;
|
||||||
|
@ -216,35 +216,35 @@ void sub_08031C58(Entity* this) {
|
||||||
tmp &= 3;
|
tmp &= 3;
|
||||||
|
|
||||||
a = CreateEnemy(0x2e, 1);
|
a = CreateEnemy(0x2e, 1);
|
||||||
a->entityType.parameter = 0;
|
a->type2 = 0;
|
||||||
a->parent = NULL;
|
a->parent = NULL;
|
||||||
a->field_0x74.HALF.LO = tmp;
|
a->field_0x74.HALF.LO = tmp;
|
||||||
sub_08031E48(this, a);
|
sub_08031E48(this, a);
|
||||||
a->attachedEntity = CreateEnemy(0x2e, 1);
|
a->attachedEntity = CreateEnemy(0x2e, 1);
|
||||||
|
|
||||||
b = a->attachedEntity;
|
b = a->attachedEntity;
|
||||||
b->entityType.parameter = 1;
|
b->type2 = 1;
|
||||||
b->parent = a;
|
b->parent = a;
|
||||||
b->field_0x74.HALF.LO = tmp;
|
b->field_0x74.HALF.LO = tmp;
|
||||||
sub_08031E48(this, b);
|
sub_08031E48(this, b);
|
||||||
b->attachedEntity = CreateEnemy(0x2e, 1);
|
b->attachedEntity = CreateEnemy(0x2e, 1);
|
||||||
|
|
||||||
a = b->attachedEntity;
|
a = b->attachedEntity;
|
||||||
a->entityType.parameter = 2;
|
a->type2 = 2;
|
||||||
a->parent = b;
|
a->parent = b;
|
||||||
a->field_0x74.HALF.LO = tmp;
|
a->field_0x74.HALF.LO = tmp;
|
||||||
sub_08031E48(this, a);
|
sub_08031E48(this, a);
|
||||||
a->attachedEntity = CreateEnemy(0x2e, 1);
|
a->attachedEntity = CreateEnemy(0x2e, 1);
|
||||||
|
|
||||||
b = a->attachedEntity;
|
b = a->attachedEntity;
|
||||||
b->entityType.parameter = 3;
|
b->type2 = 3;
|
||||||
b->parent = a;
|
b->parent = a;
|
||||||
b->field_0x74.HALF.LO = tmp;
|
b->field_0x74.HALF.LO = tmp;
|
||||||
sub_08031E48(this, b);
|
sub_08031E48(this, b);
|
||||||
b->attachedEntity = CreateEnemy(0x2e, 1);
|
b->attachedEntity = CreateEnemy(0x2e, 1);
|
||||||
|
|
||||||
a = b->attachedEntity;
|
a = b->attachedEntity;
|
||||||
a->entityType.parameter = 4;
|
a->type2 = 4;
|
||||||
a->parent = b;
|
a->parent = b;
|
||||||
a->attachedEntity = NULL;
|
a->attachedEntity = NULL;
|
||||||
a->field_0x74.HALF.LO = tmp;
|
a->field_0x74.HALF.LO = tmp;
|
||||||
|
@ -327,7 +327,7 @@ void sub_08031EA8(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spritePriority.b1 = 1;
|
this->spritePriority.b1 = 1;
|
||||||
this->field_0x20 = 0x40000;
|
this->field_0x20 = 0x40000;
|
||||||
this->height.HALF.HI = (4 - this->entityType.parameter) * 0xe;
|
this->height.HALF.HI = (4 - this->type2) * 0xe;
|
||||||
this->field_0x78.HALF.HI = Random();
|
this->field_0x78.HALF.HI = Random();
|
||||||
InitializeAnimation(this, 4);
|
InitializeAnimation(this, 4);
|
||||||
}
|
}
|
||||||
|
@ -358,11 +358,11 @@ void sub_08031EE8(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08031F54(Entity* this) {
|
void sub_08031F54(Entity* this) {
|
||||||
sub_08003FC4(this, gUnk_080CE5F0[this->entityType.parameter]);
|
sub_08003FC4(this, gUnk_080CE5F0[this->type2]);
|
||||||
if (this->entityType.parameter * -0xe <= this->height.HALF.HI) {
|
if (this->type2 * -0xe <= this->height.HALF.HI) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->actionDelay = 20;
|
this->actionDelay = 20;
|
||||||
this->height.HALF.HI = this->entityType.parameter * -0xe;
|
this->height.HALF.HI = this->type2 * -0xe;
|
||||||
if (this->parent != NULL)
|
if (this->parent != NULL)
|
||||||
this->spritePriority.b1 = 0;
|
this->spritePriority.b1 = 0;
|
||||||
InitializeAnimation(this, 6);
|
InitializeAnimation(this, 6);
|
||||||
|
@ -445,7 +445,7 @@ void sub_08032160(Entity* this) {
|
||||||
|
|
||||||
if (this->actionDelay == 0) {
|
if (this->actionDelay == 0) {
|
||||||
this->action = 7;
|
this->action = 7;
|
||||||
dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->entityType.parameter];
|
dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->type2];
|
||||||
this->direction = dir;
|
this->direction = dir;
|
||||||
if (dir >= 0x10) {
|
if (dir >= 0x10) {
|
||||||
this->spriteSettings.b.flipX = 1;
|
this->spriteSettings.b.flipX = 1;
|
||||||
|
|
|
@ -52,7 +52,7 @@ void sub_08021780(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08021818(Entity* this) {
|
void sub_08021818(Entity* this) {
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
sub_0804A7D4(this);
|
sub_0804A7D4(this);
|
||||||
} else {
|
} else {
|
||||||
Entity* ent = this->parent;
|
Entity* ent = this->parent;
|
||||||
|
@ -94,7 +94,7 @@ void Beetle_Initialize(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080218B4(Entity* this) {
|
void sub_080218B4(Entity* this) {
|
||||||
gUnk_080CB5D4[this->entityType.parameter](this);
|
gUnk_080CB5D4[this->type2](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080218CC(Entity* this) {
|
void sub_080218CC(Entity* this) {
|
||||||
|
@ -222,7 +222,7 @@ void sub_08021B64(Entity* this) {
|
||||||
int iVar4 = 1;
|
int iVar4 = 1;
|
||||||
if (gPlayerState.field_0xa8 != 11 && gPlayerState.field_0xa8 != 20) {
|
if (gPlayerState.field_0xa8 != 11 && gPlayerState.field_0xa8 != 20) {
|
||||||
if (sub_0807953C())
|
if (sub_0807953C())
|
||||||
iVar4 = this->entityType.form * 3 + 8;
|
iVar4 = this->type * 3 + 8;
|
||||||
|
|
||||||
iVar4 = this->actionDelay - iVar4;
|
iVar4 = this->actionDelay - iVar4;
|
||||||
if (iVar4 < 0)
|
if (iVar4 < 0)
|
||||||
|
|
|
@ -11,7 +11,7 @@ void BladeTrap(Entity* ent) {
|
||||||
u16* puVar3;
|
u16* puVar3;
|
||||||
if (ent->action == 0) {
|
if (ent->action == 0) {
|
||||||
ent->action = 1;
|
ent->action = 1;
|
||||||
pEVar2 = GetCurrentRoomProperty((u8)(ent->entityType).form);
|
pEVar2 = GetCurrentRoomProperty((u8)ent->type);
|
||||||
ent->attachedEntity = pEVar2;
|
ent->attachedEntity = pEVar2;
|
||||||
sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, &ent->field_0x74);
|
sub_080A2CC0((EntityData*)ent, &ent->attachedEntity, &ent->field_0x74);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ extern const Hitbox gUnk_080CD17C;
|
||||||
void BombPeahat(Entity* this) {
|
void BombPeahat(Entity* this) {
|
||||||
s32 iVar1;
|
s32 iVar1;
|
||||||
|
|
||||||
if ((this->entityType.form == 2) && (iVar1 = sub_080012DC(this), iVar1)) {
|
if ((this->type == 2) && (iVar1 = sub_080012DC(this), iVar1)) {
|
||||||
gUnk_080012C8[iVar1](this);
|
gUnk_080012C8[iVar1](this);
|
||||||
} else {
|
} else {
|
||||||
gUnk_080CD0F0[GetNextFunction(this)](this);
|
gUnk_080CD0F0[GetNextFunction(this)](this);
|
||||||
|
@ -47,7 +47,7 @@ void BombPeahat(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802A84C(Entity* this) {
|
void sub_0802A84C(Entity* this) {
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
default:
|
default:
|
||||||
gUnk_080CD108[this->action](this);
|
gUnk_080CD108[this->action](this);
|
||||||
sub_0802AD54(this);
|
sub_0802AD54(this);
|
||||||
|
@ -64,7 +64,7 @@ void sub_0802A84C(Entity* this) {
|
||||||
|
|
||||||
void sub_0802A8AC(Entity* this) {
|
void sub_0802A8AC(Entity* this) {
|
||||||
this->field_0x80.HALF.HI = 0;
|
this->field_0x80.HALF.HI = 0;
|
||||||
if (this->entityType.form < 2) {
|
if (this->type < 2) {
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ void sub_0802A924(Entity* this) {
|
||||||
this->spriteOrientation.flipY = 1;
|
this->spriteOrientation.flipY = 1;
|
||||||
this->spriteRendering.b3 = 1;
|
this->spriteRendering.b3 = 1;
|
||||||
this->spritePriority.b0 = 1;
|
this->spritePriority.b0 = 1;
|
||||||
InitializeAnimation(this, this->entityType.form + 1);
|
InitializeAnimation(this, this->type + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802A9A8(Entity* this) {
|
void sub_0802A9A8(Entity* this) {
|
||||||
|
@ -245,7 +245,7 @@ void sub_0802AB40(Entity* this) {
|
||||||
} else {
|
} else {
|
||||||
this->action = 5;
|
this->action = 5;
|
||||||
this->nonPlanarMovement = 0;
|
this->nonPlanarMovement = 0;
|
||||||
InitializeAnimation(this, this->entityType.form + 1);
|
InitializeAnimation(this, this->type + 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -341,14 +341,14 @@ void sub_0802AD54(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802ADDC(Entity* this) {
|
void sub_0802ADDC(Entity* this) {
|
||||||
Entity* ent = CreateEnemy(0x1b, this->entityType.form + 2);
|
Entity* ent = CreateEnemy(0x1b, this->type + 2);
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
ent->entityType.parameter = !!sub_0802B234(this);
|
ent->type2 = !!sub_0802B234(this);
|
||||||
ent->parent = this;
|
ent->parent = this;
|
||||||
this->attachedEntity = ent;
|
this->attachedEntity = ent;
|
||||||
CopyPosition(this, ent);
|
CopyPosition(this, ent);
|
||||||
this->field_0x80.HALF.HI = 1;
|
this->field_0x80.HALF.HI = 1;
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
this->field_0x7a.HALF.LO++;
|
this->field_0x7a.HALF.LO++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ void sub_0802AED4(Entity* this) {
|
||||||
sub_08078930(this);
|
sub_08078930(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->entityType.parameter != 0 && this->field_0x80.HALF.HI) {
|
if (this->type2 != 0 && this->field_0x80.HALF.HI) {
|
||||||
this->actionDelay = 0;
|
this->actionDelay = 0;
|
||||||
this->field_0xf = 1;
|
this->field_0xf = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,7 +335,7 @@ void sub_08028E84(Entity* this) {
|
||||||
bool32 sub_08029198(const struct SalesOffering*);
|
bool32 sub_08029198(const struct SalesOffering*);
|
||||||
|
|
||||||
void sub_08028E9C(Entity* this) {
|
void sub_08028E9C(Entity* this) {
|
||||||
const struct SalesOffering* offer = &gUnk_080CC954[this->entityType.form];
|
const struct SalesOffering* offer = &gUnk_080CC954[this->type];
|
||||||
if (sub_08029198(offer) && (offer->field_0x0 & 2)) {
|
if (sub_08029198(offer) && (offer->field_0x0 & 2)) {
|
||||||
offer = &gUnk_080CC954[offer->field_0xa];
|
offer = &gUnk_080CC954[offer->field_0xa];
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ void Chuchu(Entity* this) {
|
||||||
case 2:
|
case 2:
|
||||||
this->field_0x3a &= 0xfe;
|
this->field_0x3a &= 0xfe;
|
||||||
if (index != this->field_0x80.HALF.HI) {
|
if (index != this->field_0x80.HALF.HI) {
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
if (this->flags & 0x80) {
|
if (this->flags & 0x80) {
|
||||||
this->action = 6;
|
this->action = 6;
|
||||||
|
@ -73,13 +73,13 @@ void Chuchu(Entity* this) {
|
||||||
gUnk_080CA21C[GetNextFunction(this)](this);
|
gUnk_080CA21C[GetNextFunction(this)](this);
|
||||||
if (*(char*)(*(int*)&this->field_0x68 + 10) == 0x1c) {
|
if (*(char*)(*(int*)&this->field_0x68 + 10) == 0x1c) {
|
||||||
SetChildOffset(this, 0, 1, -0x10);
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
} else if (this->entityType.form == 2) {
|
} else if (this->type == 2) {
|
||||||
sub_0801FB34(this);
|
sub_0801FB34(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chuchu_OnTick(Entity* this) {
|
void Chuchu_OnTick(Entity* this) {
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
sub_0801F3AC(this);
|
sub_0801F3AC(this);
|
||||||
gUnk_080CA234[this->action](this);
|
gUnk_080CA234[this->action](this);
|
||||||
|
@ -97,7 +97,7 @@ void Chuchu_OnTick(Entity* this) {
|
||||||
void sub_0801EF40(Entity* this) {
|
void sub_0801EF40(Entity* this) {
|
||||||
u8 health;
|
u8 health;
|
||||||
|
|
||||||
if (this->entityType.form == 2) {
|
if (this->type == 2) {
|
||||||
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
|
if (this->bitfield == 0x8e || this->bitfield == 0x95) {
|
||||||
this->flags &= ~0x80;
|
this->flags &= ~0x80;
|
||||||
this->currentHealth = 0;
|
this->currentHealth = 0;
|
||||||
|
@ -146,9 +146,9 @@ void sub_0801F02C(Entity* this) {
|
||||||
void sub_0801F048(Entity* this) {
|
void sub_0801F048(Entity* this) {
|
||||||
sub_08003FC4(this, 0x1800);
|
sub_08003FC4(this, 0x1800);
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
sub_0804A7D4(this);
|
sub_0804A7D4(this);
|
||||||
} else if (this->entityType.form == 1) {
|
} else if (this->type == 1) {
|
||||||
CreateDeathFx(this, 0xf2, 0);
|
CreateDeathFx(this, 0xf2, 0);
|
||||||
} else {
|
} else {
|
||||||
CreateDeathFx(this, 0xf1, 0);
|
CreateDeathFx(this, 0xf1, 0);
|
||||||
|
@ -337,7 +337,7 @@ void sub_0801F428(Entity* this) {
|
||||||
this->actionDelay = Random();
|
this->actionDelay = Random();
|
||||||
this->field_0x80.HALF.LO = this->currentHealth;
|
this->field_0x80.HALF.LO = this->currentHealth;
|
||||||
this->field_0x82.HALF.LO = 0;
|
this->field_0x82.HALF.LO = 0;
|
||||||
if (this->entityType.parameter == 0)
|
if (this->type2 == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
|
@ -545,7 +545,7 @@ void sub_0801F884(Entity* this) {
|
||||||
} else {
|
} else {
|
||||||
Entity* ent = sub_0804A9FC(this, 0x1b);
|
Entity* ent = sub_0804A9FC(this, 0x1b);
|
||||||
if (ent) {
|
if (ent) {
|
||||||
ent->entityType.parameter = 64;
|
ent->type2 = 64;
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
this->damageType = 165;
|
this->damageType = 165;
|
||||||
EnqueueSFX(0x193);
|
EnqueueSFX(0x193);
|
||||||
|
@ -676,7 +676,7 @@ void sub_0801FB34(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0801FB68(Entity* this) {
|
void sub_0801FB68(Entity* this) {
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
this->action = 9;
|
this->action = 9;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,7 +29,7 @@ void ChuchuBoss(Entity* this) {
|
||||||
|
|
||||||
void sub_08025CBC(Entity* this) {
|
void sub_08025CBC(Entity* this) {
|
||||||
sub_08001324(this);
|
sub_08001324(this);
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
sub_08027870(this);
|
sub_08027870(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ void sub_08020BB8(Entity* this) {
|
||||||
switch (this->bitfield & 0x7f) {
|
switch (this->bitfield & 0x7f) {
|
||||||
case 0x1c:
|
case 0x1c:
|
||||||
this->action = 11;
|
this->action = 11;
|
||||||
this->actionDelay = gUnk_080CAB0C[this->entityType.form];
|
this->actionDelay = gUnk_080CAB0C[this->type];
|
||||||
this->damageType = 81;
|
this->damageType = 81;
|
||||||
sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10));
|
sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10));
|
||||||
sub_08021588(this);
|
sub_08021588(this);
|
||||||
|
@ -68,7 +68,7 @@ void sub_08020BB8(Entity* this) {
|
||||||
break;
|
break;
|
||||||
case 0x16:
|
case 0x16:
|
||||||
this->action = 11;
|
this->action = 11;
|
||||||
this->actionDelay = gUnk_080CAB10[this->entityType.form];
|
this->actionDelay = gUnk_080CAB10[this->type];
|
||||||
this->damageType = 81;
|
this->damageType = 81;
|
||||||
sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10));
|
sub_08021218(this, 8, DirectionToAnimationState(this->field_0x3e ^ 0x10));
|
||||||
sub_08021588(this);
|
sub_08021588(this);
|
||||||
|
@ -79,10 +79,10 @@ void sub_08020BB8(Entity* this) {
|
||||||
break;
|
break;
|
||||||
switch (this->field_0x78.HALF.HI) {
|
switch (this->field_0x78.HALF.HI) {
|
||||||
case 8 ... 12:
|
case 8 ... 12:
|
||||||
this->field_0x7a.HALF.LO = gUnk_080CAB04[this->entityType.form];
|
this->field_0x7a.HALF.LO = gUnk_080CAB04[this->type];
|
||||||
break;
|
break;
|
||||||
case 4 ... 6:
|
case 4 ... 6:
|
||||||
this->field_0x7a.HALF.LO = gUnk_080CAB00[this->entityType.form];
|
this->field_0x7a.HALF.LO = gUnk_080CAB00[this->type];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this->field_0x7a.HALF.LO = 0;
|
this->field_0x7a.HALF.LO = 0;
|
||||||
|
@ -100,7 +100,7 @@ void sub_08020BB8(Entity* this) {
|
||||||
bVar3 = this->attachedEntity->bitfield & 0x7f;
|
bVar3 = this->attachedEntity->bitfield & 0x7f;
|
||||||
}
|
}
|
||||||
if (bVar3 == 2) {
|
if (bVar3 == 2) {
|
||||||
sub_080213D0(this, gUnk_080CAB08[this->entityType.form]);
|
sub_080213D0(this, gUnk_080CAB08[this->type]);
|
||||||
} else {
|
} else {
|
||||||
sub_080213D0(this, 0);
|
sub_080213D0(this, 0);
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ void sub_080212B0(Entity* this) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.form < 2 && tmp == 2)
|
if (this->type < 2 && tmp == 2)
|
||||||
tmp = gUnk_080CAB52[Random() & 3];
|
tmp = gUnk_080CAB52[Random() & 3];
|
||||||
|
|
||||||
this->attachedEntity = NULL;
|
this->attachedEntity = NULL;
|
||||||
|
@ -421,7 +421,7 @@ void sub_080212B0(Entity* this) {
|
||||||
|
|
||||||
void sub_08021328(Entity* this) {
|
void sub_08021328(Entity* this) {
|
||||||
this->action = 13;
|
this->action = 13;
|
||||||
this->field_0x7c.BYTES.byte0 = gUnk_080CAB68[this->entityType.form];
|
this->field_0x7c.BYTES.byte0 = gUnk_080CAB68[this->type];
|
||||||
sub_08021218(this, 0xc, this->animationState);
|
sub_08021218(this, 0xc, this->animationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ extern s16 gUnk_080B4488[];
|
||||||
|
|
||||||
void DoorMimic(Entity* this) {
|
void DoorMimic(Entity* this) {
|
||||||
gUnk_080CB734[GetNextFunction(this)](this);
|
gUnk_080CB734[GetNextFunction(this)](this);
|
||||||
this->hitbox = (Hitbox*)gUnk_080CB8A4[this->entityType.parameter][this->frameIndex];
|
this->hitbox = (Hitbox*)gUnk_080CB8A4[this->type2][this->frameIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08021FDC(Entity* this) {
|
void sub_08021FDC(Entity* this) {
|
||||||
|
@ -44,11 +44,11 @@ void sub_08022004(Entity* this) {
|
||||||
|
|
||||||
void sub_08022034(Entity* this) {
|
void sub_08022034(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->entityType.parameter = this->entityType.form & 3;
|
this->type2 = this->type & 3;
|
||||||
this->spritePriority.b0 = 5;
|
this->spritePriority.b0 = 5;
|
||||||
this->field_0x78.HWORD = gUnk_080CB764[this->entityType.parameter * 2 + 0] + this->x.HALF.HI;
|
this->field_0x78.HWORD = gUnk_080CB764[this->type2 * 2 + 0] + this->x.HALF.HI;
|
||||||
this->field_0x7a.HWORD = gUnk_080CB764[this->entityType.parameter * 2 + 1] + this->y.HALF.HI;
|
this->field_0x7a.HWORD = gUnk_080CB764[this->type2 * 2 + 1] + this->y.HALF.HI;
|
||||||
InitializeAnimation(this, this->entityType.parameter);
|
InitializeAnimation(this, this->type2);
|
||||||
sub_080221C0(this);
|
sub_080221C0(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ void sub_0802209C(Entity* this) {
|
||||||
if (sub_0806FBFC(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) {
|
if (sub_0806FBFC(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = 0x12;
|
this->actionDelay = 0x12;
|
||||||
InitializeAnimation(this, this->entityType.parameter + 4);
|
InitializeAnimation(this, this->type2 + 4);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this->actionDelay = this->actionDelay - 1;
|
this->actionDelay = this->actionDelay - 1;
|
||||||
|
@ -78,7 +78,7 @@ void sub_080220F0(Entity* this) {
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
this->actionDelay = 0x78;
|
this->actionDelay = 0x78;
|
||||||
this->field_0x44 = 0;
|
this->field_0x44 = 0;
|
||||||
off = gUnk_080CB76C[this->entityType.parameter];
|
off = gUnk_080CB76C[this->type2];
|
||||||
for (i = 0; i < 6; i++, off++) {
|
for (i = 0; i < 6; i++, off++) {
|
||||||
Entity* fx = CreateFx(this, 0x11, 0);
|
Entity* fx = CreateFx(this, 0x11, 0);
|
||||||
if (fx) {
|
if (fx) {
|
||||||
|
@ -96,7 +96,7 @@ void sub_08022174(Entity* this) {
|
||||||
sub_0800445C(this);
|
sub_0800445C(this);
|
||||||
if (--this->actionDelay == 0) {
|
if (--this->actionDelay == 0) {
|
||||||
this->action = 5;
|
this->action = 5;
|
||||||
InitializeAnimation(this, this->entityType.parameter + 8);
|
InitializeAnimation(this, this->type2 + 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,10 +110,10 @@ void sub_08022198(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080221C0(Entity* this) {
|
void sub_080221C0(Entity* this) {
|
||||||
u32 tile = COORD_TO_TILE(this) + gUnk_080B4488[this->entityType.parameter];
|
u32 tile = COORD_TO_TILE(this) + gUnk_080B4488[this->type2];
|
||||||
this->field_0x7c.HALF.HI = tile;
|
this->field_0x7c.HALF.HI = tile;
|
||||||
this->field_0x7c.HALF.LO = sub_080001DA(tile, this->collisionLayer);
|
this->field_0x7c.HALF.LO = sub_080001DA(tile, this->collisionLayer);
|
||||||
SetTile(gUnk_080CB79C[this->entityType.parameter], tile, this->collisionLayer);
|
SetTile(gUnk_080CB79C[this->type2], tile, this->collisionLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
|
@ -31,7 +31,7 @@ void sub_0802C258(Entity* this) {
|
||||||
this->field_0x20 = 0x20000;
|
this->field_0x20 = 0x20000;
|
||||||
this->actionDelay = 2;
|
this->actionDelay = 2;
|
||||||
this->field_0x7a.HWORD = Random() & 0x70;
|
this->field_0x7a.HWORD = Random() & 0x70;
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 1:
|
case 1:
|
||||||
this->field_0x7a.HWORD |= 0x100;
|
this->field_0x7a.HWORD |= 0x100;
|
||||||
break;
|
break;
|
||||||
|
@ -86,7 +86,7 @@ void sub_0802C334(Entity* this) {
|
||||||
this->flags &= ~0x80;
|
this->flags &= ~0x80;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (this->entityType.parameter != 0 && !sub_08049FA0(this)) {
|
if (this->type2 != 0 && !sub_08049FA0(this)) {
|
||||||
u32 diff = 0;
|
u32 diff = 0;
|
||||||
s32 i;
|
s32 i;
|
||||||
for (i = 1; i > -1; i--) {
|
for (i = 1; i > -1; i--) {
|
||||||
|
@ -113,7 +113,7 @@ void sub_0802C334(Entity* this) {
|
||||||
if (this->height.HALF.HI - y > 0x38) {
|
if (this->height.HALF.HI - y > 0x38) {
|
||||||
sub_0802C62C(this);
|
sub_0802C62C(this);
|
||||||
this->field_0x7a.HWORD = (Random() & 0x7f) | 0x80;
|
this->field_0x7a.HWORD = (Random() & 0x7f) | 0x80;
|
||||||
if (this->entityType.form == 3) {
|
if (this->type == 3) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,13 +63,13 @@ void sub_08045454(Entity* this) {
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
/* Can we create enough new entities? */
|
/* Can we create enough new entities? */
|
||||||
count = gUnk_080D180C[this->entityType.form];
|
count = gUnk_080D180C[this->type];
|
||||||
if (72 - count <= gEntCount)
|
if (72 - count <= gEntCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create 2-5 new MiniFireballGuy */
|
/* Create 2-5 new MiniFireballGuy */
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
entities[i] = CreateEnemy(0x59, this->entityType.form);
|
entities[i] = CreateEnemy(0x59, this->type);
|
||||||
|
|
||||||
off = gUnk_080D1810;
|
off = gUnk_080D1810;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
@ -77,7 +77,7 @@ void sub_08045454(Entity* this) {
|
||||||
ent->attachedEntity = entities[(i + 1) % count];
|
ent->attachedEntity = entities[(i + 1) % count];
|
||||||
ent->parent = entities[(i + count - 1) % count];
|
ent->parent = entities[(i + count - 1) % count];
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
ent->entityType.parameter = 1;
|
ent->type2 = 1;
|
||||||
ent->height.HALF.HI = tmp;
|
ent->height.HALF.HI = tmp;
|
||||||
ent->hurtBlinkTime = -0x10;
|
ent->hurtBlinkTime = -0x10;
|
||||||
|
|
||||||
|
|
|
@ -374,7 +374,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th
|
||||||
Entity* E;
|
Entity* E;
|
||||||
E = CreateObject(0x2a, 3, 0);
|
E = CreateObject(0x2a, 3, 0);
|
||||||
if (E != 0) {
|
if (E != 0) {
|
||||||
E->entityType.parameter = this->actionDelay;
|
E->type2 = this->actionDelay;
|
||||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||||
E->spriteOffsetX = 0;
|
E->spriteOffsetX = 0;
|
||||||
E->spriteOffsetY = 0xfc;
|
E->spriteOffsetY = 0xfc;
|
||||||
|
@ -383,7 +383,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th
|
||||||
*(Entity**)&this->field_0x80.HWORD = E;
|
*(Entity**)&this->field_0x80.HWORD = E;
|
||||||
E = CreateObject(0x2a, 3, 0);
|
E = CreateObject(0x2a, 3, 0);
|
||||||
if (E != 0) {
|
if (E != 0) {
|
||||||
E->entityType.parameter = this->actionDelay;
|
E->type2 = this->actionDelay;
|
||||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||||
E->spriteOffsetX = 0xfd;
|
E->spriteOffsetX = 0xfd;
|
||||||
E->spriteOffsetY = 0xf8;
|
E->spriteOffsetY = 0xf8;
|
||||||
|
@ -392,7 +392,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* th
|
||||||
*(Entity**)&this->cutsceneBeh.HWORD = E;
|
*(Entity**)&this->cutsceneBeh.HWORD = E;
|
||||||
E = CreateObject(0x2a, 3, 0);
|
E = CreateObject(0x2a, 3, 0);
|
||||||
if (E != 0) {
|
if (E != 0) {
|
||||||
E->entityType.parameter = this->actionDelay;
|
E->type2 = this->actionDelay;
|
||||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||||
E->spriteOffsetX = 0x5;
|
E->spriteOffsetX = 0x5;
|
||||||
E->spriteOffsetY = 0xf5;
|
E->spriteOffsetY = 0xf5;
|
||||||
|
|
|
@ -114,7 +114,7 @@ void sub_08046898(Entity* this) {
|
||||||
u32 tmp2;
|
u32 tmp2;
|
||||||
if (!tmp)
|
if (!tmp)
|
||||||
return;
|
return;
|
||||||
tmp->entityType.form = 1;
|
tmp->type = 1;
|
||||||
tmp->parent = this;
|
tmp->parent = this;
|
||||||
this->attachedEntity = tmp;
|
this->attachedEntity = tmp;
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
|
@ -141,7 +141,7 @@ void sub_08046910(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08046930(Entity* this) {
|
void sub_08046930(Entity* this) {
|
||||||
if (this->entityType.form) {
|
if (this->type) {
|
||||||
this->previousActionFlag = 5;
|
this->previousActionFlag = 5;
|
||||||
this->direction = 0x20;
|
this->direction = 0x20;
|
||||||
this->nonPlanarMovement = 0x280;
|
this->nonPlanarMovement = 0x280;
|
||||||
|
@ -806,7 +806,7 @@ void sub_08047914(Entity* this) {
|
||||||
} else {
|
} else {
|
||||||
this->previousActionFlag = 3;
|
this->previousActionFlag = 3;
|
||||||
this->field_0x70.HALF.LO = 0x3C;
|
this->field_0x70.HALF.LO = 0x3C;
|
||||||
this->field_0x7c.HALF.HI = ((this->entityType.form * 0xF) << 2) + 0x78;
|
this->field_0x7c.HALF.HI = ((this->type * 0xF) << 2) + 0x78;
|
||||||
sub_080A1D70(((Entity*)this->myHeap)->prev, this->animationState);
|
sub_080A1D70(((Entity*)this->myHeap)->prev, this->animationState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,7 +816,7 @@ void sub_08047978(Entity* this) {
|
||||||
if (this->currentHealth != 0) {
|
if (this->currentHealth != 0) {
|
||||||
if (--this->field_0x70.HALF_U.LO == 0) {
|
if (--this->field_0x70.HALF_U.LO == 0) {
|
||||||
this->field_0x70.HALF.HI = 1;
|
this->field_0x70.HALF.HI = 1;
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
this->field_0x70.HALF.LO = 0xB4;
|
this->field_0x70.HALF.LO = 0xB4;
|
||||||
} else {
|
} else {
|
||||||
this->field_0x70.HALF.LO = 0x168;
|
this->field_0x70.HALF.LO = 0x168;
|
||||||
|
@ -849,7 +849,7 @@ void sub_08047978(Entity* this) {
|
||||||
if (this->attachedEntity->action != 1)
|
if (this->attachedEntity->action != 1)
|
||||||
return;
|
return;
|
||||||
this->previousActionFlag = 4;
|
this->previousActionFlag = 4;
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
if ((((Entity*)this->myHeap)->next->animationState >> 6) == 1) {
|
if ((((Entity*)this->myHeap)->next->animationState >> 6) == 1) {
|
||||||
this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x1C0;
|
this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x1C0;
|
||||||
this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x250;
|
this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x250;
|
||||||
|
@ -880,7 +880,7 @@ void sub_08047B08(Entity* this) {
|
||||||
sub_08047E58(this);
|
sub_08047E58(this);
|
||||||
if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4))
|
if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4))
|
||||||
return;
|
return;
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
this->action = 7;
|
this->action = 7;
|
||||||
this->previousActionFlag = 0;
|
this->previousActionFlag = 0;
|
||||||
this->direction ^= 0x80;
|
this->direction ^= 0x80;
|
||||||
|
@ -968,7 +968,7 @@ void sub_08047BF0(Entity* this) {
|
||||||
void sub_08047D24(Entity* this) {
|
void sub_08047D24(Entity* this) {
|
||||||
this->field_0x7c.HALF_U.HI += 8;
|
this->field_0x7c.HALF_U.HI += 8;
|
||||||
if (this->field_0x7c.HALF_U.HI > 0x800) {
|
if (this->field_0x7c.HALF_U.HI > 0x800) {
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
((u32*)this->myHeap)[2] = 0;
|
((u32*)this->myHeap)[2] = 0;
|
||||||
} else {
|
} else {
|
||||||
((u32*)this->myHeap)[3] = 0;
|
((u32*)this->myHeap)[3] = 0;
|
||||||
|
|
|
@ -26,7 +26,7 @@ void nullsub_7(Entity* this) {
|
||||||
void HangingSeed_Initialize(Entity* this) {
|
void HangingSeed_Initialize(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
this->frameIndex = this->entityType.form;
|
this->frameIndex = this->type;
|
||||||
this->spriteRendering.b3 = 1;
|
this->spriteRendering.b3 = 1;
|
||||||
this->spritePriority.b0 = 3;
|
this->spritePriority.b0 = 3;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ extern const s8 gUnk_080CD45C[];
|
||||||
extern const s8 gUnk_080CD464[];
|
extern const s8 gUnk_080CD464[];
|
||||||
|
|
||||||
void Helmasaur(Entity* this) {
|
void Helmasaur(Entity* this) {
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
EnemyFunctionHandler(this, gUnk_080CD3E4);
|
EnemyFunctionHandler(this, gUnk_080CD3E4);
|
||||||
SetChildOffset(this, 0, 1, -0x10);
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -63,7 +63,7 @@ void sub_08021DDC(Entity* this) {
|
||||||
|
|
||||||
void Keese_Initialize(Entity* this) {
|
void Keese_Initialize(Entity* this) {
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
this->spritePriority.b1 = 1;
|
this->spritePriority.b1 = 1;
|
||||||
this->height.HALF.HI = -0x10;
|
this->height.HALF.HI = -0x10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ void sub_0803CD6C(Entity* this) {
|
||||||
this->height.HALF.HI = -2;
|
this->height.HALF.HI = -2;
|
||||||
|
|
||||||
// Set parent to lakitu
|
// Set parent to lakitu
|
||||||
lakitu = GetCurrentRoomProperty(this->entityType.form);
|
lakitu = GetCurrentRoomProperty(this->type);
|
||||||
this->attachedEntity = lakitu;
|
this->attachedEntity = lakitu;
|
||||||
this->parent = lakitu;
|
this->parent = lakitu;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ void sub_0801FC40(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0801FC7C(Entity* this) {
|
void sub_0801FC7C(Entity* this) {
|
||||||
if (this->entityType.form == LeeverForm_Red) {
|
if (this->type == LeeverForm_Red) {
|
||||||
sub_0804A7D4(this);
|
sub_0804A7D4(this);
|
||||||
} else {
|
} else {
|
||||||
CreateDeathFx(this, 0xf1, 0);
|
CreateDeathFx(this, 0xf1, 0);
|
||||||
|
@ -89,7 +89,7 @@ void Leever_DigUp(Entity* this) {
|
||||||
|
|
||||||
if (this->frames.b.f3 != 0) {
|
if (this->frames.b.f3 != 0) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
if (this->entityType.form == LeeverForm_Red) {
|
if (this->type == LeeverForm_Red) {
|
||||||
this->field_0x74.HWORD = 180;
|
this->field_0x74.HWORD = 180;
|
||||||
} else {
|
} else {
|
||||||
this->field_0x74.HWORD = 110;
|
this->field_0x74.HWORD = 110;
|
||||||
|
@ -173,7 +173,7 @@ void Leever_Move(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->nonPlanarMovement = (this->frames.all & 0xf) * 0x20;
|
this->nonPlanarMovement = (this->frames.all & 0xf) * 0x20;
|
||||||
if (this->entityType.form == LeeverForm_Red) {
|
if (this->type == LeeverForm_Red) {
|
||||||
if ((this->field_0xf++ & 0xf) == 0) {
|
if ((this->field_0xf++ & 0xf) == 0) {
|
||||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ void nullsub_139(Entity* this) {
|
||||||
void sub_08027E70(Entity* this) {
|
void sub_08027E70(Entity* this) {
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
|
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
|
|
|
@ -27,7 +27,7 @@ extern const u8 gUnk_080CCDC8[];
|
||||||
extern const u16 gUnk_080CCDD4[];
|
extern const u16 gUnk_080CCDD4[];
|
||||||
|
|
||||||
void Madderpillar(Entity* this) {
|
void Madderpillar(Entity* this) {
|
||||||
gUnk_080CCD44[this->entityType.form](this);
|
gUnk_080CCD44[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08029870(Entity* this) {
|
void sub_08029870(Entity* this) {
|
||||||
|
@ -167,7 +167,7 @@ void sub_08029B2C(Entity* this) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this->flags &= ~0x80;
|
this->flags &= ~0x80;
|
||||||
this->actionDelay = -(this->entityType.form * 15 - 90);
|
this->actionDelay = -(this->type * 15 - 90);
|
||||||
this->field_0x86.HALF.LO = 1;
|
this->field_0x86.HALF.LO = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -179,7 +179,7 @@ void sub_08029B90(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
sub_0802A058(this);
|
sub_0802A058(this);
|
||||||
if (this->entityType.form < 2) {
|
if (this->type < 2) {
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
} else {
|
} else {
|
||||||
InitializeAnimation(this, 4);
|
InitializeAnimation(this, 4);
|
||||||
|
@ -195,7 +195,7 @@ void sub_08029BC4(Entity* this) {
|
||||||
uVar2 = this->y.HALF.HI;
|
uVar2 = this->y.HALF.HI;
|
||||||
if (sub_08029FE4(this)) {
|
if (sub_08029FE4(this)) {
|
||||||
u32 index;
|
u32 index;
|
||||||
if (this->entityType.form < 2) {
|
if (this->type < 2) {
|
||||||
index = 0;
|
index = 0;
|
||||||
} else {
|
} else {
|
||||||
index = 4;
|
index = 4;
|
||||||
|
@ -207,7 +207,7 @@ void sub_08029BC4(Entity* this) {
|
||||||
|
|
||||||
void sub_08029C08(Entity* this) {
|
void sub_08029C08(Entity* this) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->actionDelay = gUnk_080CCDA0[this->entityType.form];
|
this->actionDelay = gUnk_080CCDA0[this->type];
|
||||||
this->damageType = 0x6b;
|
this->damageType = 0x6b;
|
||||||
this->attachedEntity->action = 2;
|
this->attachedEntity->action = 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ void sub_080452A4(Entity* this) {
|
||||||
this->nonPlanarMovement = 0x100;
|
this->nonPlanarMovement = 0x100;
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
InitializeAnimation(this, 6);
|
InitializeAnimation(this, 6);
|
||||||
if (this->entityType.parameter) {
|
if (this->type2) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = 1;
|
this->actionDelay = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern u8 gEntCount;
|
||||||
extern const s8 gUnk_080CBBC4[];
|
extern const s8 gUnk_080CBBC4[];
|
||||||
|
|
||||||
void Moldorm(Entity* this) {
|
void Moldorm(Entity* this) {
|
||||||
gUnk_080CBB90[this->entityType.form](this);
|
gUnk_080CBB90[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08022BA0(Entity* this) {
|
void sub_08022BA0(Entity* this) {
|
||||||
|
@ -133,8 +133,8 @@ void sub_08022DE8(Entity* this) {
|
||||||
this->animationState = this->parent->animationState;
|
this->animationState = this->parent->animationState;
|
||||||
*(u32*)&this->cutsceneBeh = this->animationState * 0x11111111;
|
*(u32*)&this->cutsceneBeh = this->animationState * 0x11111111;
|
||||||
|
|
||||||
if (this->entityType.form != 3) {
|
if (this->type != 3) {
|
||||||
this->frameIndex = this->entityType.form + 7;
|
this->frameIndex = this->type + 7;
|
||||||
} else {
|
} else {
|
||||||
this->frameIndex = this->animationState + 10;
|
this->frameIndex = this->animationState + 10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ void Moldworm(Entity* this) {
|
||||||
u16 prevX = this->x.HALF.HI;
|
u16 prevX = this->x.HALF.HI;
|
||||||
u16 prevY = this->y.HALF.HI;
|
u16 prevY = this->y.HALF.HI;
|
||||||
|
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
if (this->action != 0) {
|
if (this->action != 0) {
|
||||||
sub_0802390C(this);
|
sub_0802390C(this);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ void Moldworm(Entity* this) {
|
||||||
EnemyFunctionHandler(this, gUnk_080CBC38);
|
EnemyFunctionHandler(this, gUnk_080CBC38);
|
||||||
} else {
|
} else {
|
||||||
if (this->parent->next) {
|
if (this->parent->next) {
|
||||||
if (this->entityType.form != 8) {
|
if (this->type != 8) {
|
||||||
sub_080235BC(this);
|
sub_080235BC(this);
|
||||||
} else {
|
} else {
|
||||||
sub_08023730(this);
|
sub_08023730(this);
|
||||||
|
@ -76,10 +76,10 @@ void sub_080230E4(Entity* this) {
|
||||||
this->field_0x7c.BYTES.byte3 = 0;
|
this->field_0x7c.BYTES.byte3 = 0;
|
||||||
this->field_0x7a.HALF.HI = 0;
|
this->field_0x7a.HALF.HI = 0;
|
||||||
if (this->bitfield == 0x80 || this->bitfield == 0x9e) {
|
if (this->bitfield == 0x80 || this->bitfield == 0x9e) {
|
||||||
this->entityType.parameter = 0;
|
this->type2 = 0;
|
||||||
this->field_0x80.HALF.LO = 0x14;
|
this->field_0x80.HALF.LO = 0x14;
|
||||||
} else {
|
} else {
|
||||||
this->entityType.parameter = 1;
|
this->type2 = 1;
|
||||||
this->field_0x80.HALF.LO = 8;
|
this->field_0x80.HALF.LO = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ void sub_080234D8(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0802351C(Entity* this) {
|
void sub_0802351C(Entity* this) {
|
||||||
if (this->actionDelay != 0 && (this->entityType.parameter == 1 || gPlayerEntity.frameIndex == 0xff)) {
|
if (this->actionDelay != 0 && (this->type2 == 1 || gPlayerEntity.frameIndex == 0xff)) {
|
||||||
this->actionDelay = 0;
|
this->actionDelay = 0;
|
||||||
this->attachedEntity->action = 3;
|
this->attachedEntity->action = 3;
|
||||||
this->attachedEntity->field_0xf = this->field_0x80.HALF.LO;
|
this->attachedEntity->field_0xf = this->field_0x80.HALF.LO;
|
||||||
|
@ -268,7 +268,7 @@ void sub_0802351C(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->field_0x7c.BYTES.byte3 == 0) {
|
if (this->field_0x7c.BYTES.byte3 == 0) {
|
||||||
if (this->entityType.parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
gPlayerEntity.animationState = this->animationState & 7;
|
gPlayerEntity.animationState = this->animationState & 7;
|
||||||
gPlayerState.flags.all |= 0x80000;
|
gPlayerState.flags.all |= 0x80000;
|
||||||
PositionRelative(this, &gPlayerEntity, 0, gUnk_080CBC90[this->animationState & 7] << 0x10);
|
PositionRelative(this, &gPlayerEntity, 0, gUnk_080CBC90[this->animationState & 7] << 0x10);
|
||||||
|
@ -291,7 +291,7 @@ void sub_080235D4(Entity* this) {
|
||||||
this->x.HALF.HI = parent->x.HALF.HI;
|
this->x.HALF.HI = parent->x.HALF.HI;
|
||||||
this->y.HALF.HI = parent->y.HALF.HI;
|
this->y.HALF.HI = parent->y.HALF.HI;
|
||||||
sub_080239F0(this);
|
sub_080239F0(this);
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
this->animationState = 0x10;
|
this->animationState = 0x10;
|
||||||
} else {
|
} else {
|
||||||
this->animationState = 0x12;
|
this->animationState = 0x12;
|
||||||
|
@ -404,7 +404,7 @@ void sub_08023894(Entity* this) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->parent->field_0x7c.BYTES.byte3 = 1;
|
this->parent->field_0x7c.BYTES.byte3 = 1;
|
||||||
InitializeAnimation(this, this->animationState);
|
InitializeAnimation(this, this->animationState);
|
||||||
if ((this->parent->entityType).parameter == 0) {
|
if (this->parent->type2 == 0) {
|
||||||
gPlayerState.flags.all |= 0x200000;
|
gPlayerState.flags.all |= 0x200000;
|
||||||
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
|
gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
|
||||||
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
|
gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
|
||||||
|
|
|
@ -47,7 +47,7 @@ void sub_0801EAE8(Entity* this) {
|
||||||
|
|
||||||
// Death
|
// Death
|
||||||
void sub_0801EB0C(Entity* this) {
|
void sub_0801EB0C(Entity* this) {
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
sub_0804A7D4(this);
|
sub_0804A7D4(this);
|
||||||
} else {
|
} else {
|
||||||
CreateDeathFx(this, 241, 0);
|
CreateDeathFx(this, 241, 0);
|
||||||
|
@ -97,8 +97,8 @@ void sub_0801EB9C(Entity* this) {
|
||||||
// Init
|
// Init
|
||||||
void Octorok_Initialize(Entity* this) {
|
void Octorok_Initialize(Entity* this) {
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
if (this->entityType.form == 2) {
|
if (this->type == 2) {
|
||||||
this->animationState = this->entityType.form;
|
this->animationState = this->type;
|
||||||
} else {
|
} else {
|
||||||
this->animationState = Random() & 3;
|
this->animationState = Random() & 3;
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ void Octorok_Move(Entity* this) {
|
||||||
ProcessMovement(this);
|
ProcessMovement(this);
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if (--this->actionDelay == 0) {
|
if (--this->actionDelay == 0) {
|
||||||
if (Octorok_FacesPlayer(this) && gOctorokSpitChanceModifier[this->entityType.form] <= (Random() & 3)) {
|
if (Octorok_FacesPlayer(this) && gOctorokSpitChanceModifier[this->type] <= (Random() & 3)) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
InitializeAnimation(this, this->animationState + 4);
|
InitializeAnimation(this, this->animationState + 4);
|
||||||
} else {
|
} else {
|
||||||
|
@ -155,9 +155,9 @@ void Octorok_Pause(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octorok_Turn(Entity* this) {
|
void Octorok_Turn(Entity* this) {
|
||||||
if (this->entityType.form != 2) {
|
if (this->type != 2) {
|
||||||
if (sub_08049FA0(this)) {
|
if (sub_08049FA0(this)) {
|
||||||
if (this->entityType.form == 1 && (Random() & 3) == 0 && sub_08049FDC(this, 1)) {
|
if (this->type == 1 && (Random() & 3) == 0 && sub_08049FDC(this, 1)) {
|
||||||
this->direction = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
this->direction = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
||||||
} else {
|
} else {
|
||||||
this->direction = DirectionRound(Random());
|
this->direction = DirectionRound(Random());
|
||||||
|
|
|
@ -32,7 +32,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
void Peahat(Entity* this) {
|
void Peahat(Entity* this) {
|
||||||
if (this->entityType.form == PeahatForm_Torso) {
|
if (this->type == PeahatForm_Torso) {
|
||||||
EnemyFunctionHandler(this, gPeahatFunctions);
|
EnemyFunctionHandler(this, gPeahatFunctions);
|
||||||
SetChildOffset(this, 0, 1, -0x10);
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -137,7 +137,7 @@ void sub_080240B8(Entity* this) {
|
||||||
this->x.HALF.HI += (direction & 0x10) ? -0x20 : 0x20;
|
this->x.HALF.HI += (direction & 0x10) ? -0x20 : 0x20;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
this->field_0x78.HWORD = -0x10;
|
this->field_0x78.HWORD = -0x10;
|
||||||
this->height.HALF.HI = -0x10;
|
this->height.HALF.HI = -0x10;
|
||||||
|
@ -164,7 +164,7 @@ void sub_080240B8(Entity* this) {
|
||||||
this->direction = direction;
|
this->direction = direction;
|
||||||
sub_080249DC(this);
|
sub_080249DC(this);
|
||||||
|
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
Entity* ent;
|
Entity* ent;
|
||||||
|
|
||||||
this->field_0x82.HALF.HI = 0;
|
this->field_0x82.HALF.HI = 0;
|
||||||
|
@ -192,7 +192,7 @@ void sub_080241C0(Entity* this) {
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (--this->field_0xf == 0) {
|
if (--this->field_0xf == 0) {
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
u8 tmp = this->field_0x82.HALF.HI & 0x80;
|
u8 tmp = this->field_0x82.HALF.HI & 0x80;
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
sub_08024C94(this);
|
sub_08024C94(this);
|
||||||
|
@ -535,7 +535,7 @@ void sub_08024940(Entity* this) {
|
||||||
this->height.HALF.HI += 2;
|
this->height.HALF.HI += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.parameter != 0 || CheckIsDungeon()) {
|
if (this->type2 != 0 || CheckIsDungeon()) {
|
||||||
if (!sub_08049FA0(this)) {
|
if (!sub_08049FA0(this)) {
|
||||||
this->direction = sub_08049EE4(this);
|
this->direction = sub_08049EE4(this);
|
||||||
sub_080249F4(this);
|
sub_080249F4(this);
|
||||||
|
|
|
@ -60,9 +60,9 @@ void sub_08025020(Entity* this) {
|
||||||
case 0x1b:
|
case 0x1b:
|
||||||
sub_0804AA1C(this);
|
sub_0804AA1C(this);
|
||||||
|
|
||||||
tmp = gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->entityType.form];
|
tmp = gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type];
|
||||||
if (tmp < this->field_0x82.HALF.LO) {
|
if (tmp < this->field_0x82.HALF.LO) {
|
||||||
this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->entityType.form];
|
this->field_0x82.HALF.LO -= gUnk_080CBFE8[(*(Entity**)&this->field_0x4c)->type];
|
||||||
} else {
|
} else {
|
||||||
this->cutsceneBeh.HWORD = 0x294;
|
this->cutsceneBeh.HWORD = 0x294;
|
||||||
this->damageType = 0x83;
|
this->damageType = 0x83;
|
||||||
|
|
|
@ -42,7 +42,7 @@ void sub_08022254(Entity* this) {
|
||||||
CreateFx(this, 4, 0);
|
CreateFx(this, 4, 0);
|
||||||
ent = CreateEnemy(1, 1);
|
ent = CreateEnemy(1, 1);
|
||||||
if (ent) {
|
if (ent) {
|
||||||
ent->entityType.parameter = 1;
|
ent->type2 = 1;
|
||||||
ent->hurtBlinkTime = -8;
|
ent->hurtBlinkTime = -8;
|
||||||
sub_0804A4E4(this, ent);
|
sub_0804A4E4(this, ent);
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
|
|
|
@ -26,7 +26,7 @@ extern Hitbox gUnk_080FD260;
|
||||||
void RupeeLike(Entity* this) {
|
void RupeeLike(Entity* this) {
|
||||||
u32 uVar1;
|
u32 uVar1;
|
||||||
|
|
||||||
if (this->entityType.parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
uVar1 = (u8)sub_080043E8(this);
|
uVar1 = (u8)sub_080043E8(this);
|
||||||
if (uVar1 != 0) {
|
if (uVar1 != 0) {
|
||||||
if (this->action == 4) {
|
if (this->action == 4) {
|
||||||
|
@ -75,7 +75,7 @@ void sub_08029318(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080293B4(Entity* this) {
|
void sub_080293B4(Entity* this) {
|
||||||
CreateDeathFx(this, 0xff, gUnk_080CCC34[this->cutsceneBeh.HALF.LO * 3 + this->entityType.form]);
|
CreateDeathFx(this, 0xff, gUnk_080CCC34[this->cutsceneBeh.HALF.LO * 3 + this->type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void nullsub_141() {
|
void nullsub_141() {
|
||||||
|
@ -91,11 +91,11 @@ void sub_080293DC(Entity* this) {
|
||||||
void sub_0802940C(Entity* this) {
|
void sub_0802940C(Entity* this) {
|
||||||
Entity* ent;
|
Entity* ent;
|
||||||
|
|
||||||
ent = CreateEnemy(0x17, this->entityType.form);
|
ent = CreateEnemy(0x17, this->type);
|
||||||
if (ent != NULL) {
|
if (ent != NULL) {
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
ent->parent = this;
|
ent->parent = this;
|
||||||
ent->entityType.parameter = 1;
|
ent->type2 = 1;
|
||||||
this->attachedEntity = ent;
|
this->attachedEntity = ent;
|
||||||
this->field_0x80.HALF.HI = 0;
|
this->field_0x80.HALF.HI = 0;
|
||||||
this->cutsceneBeh.HALF.LO = 0;
|
this->cutsceneBeh.HALF.LO = 0;
|
||||||
|
@ -172,7 +172,7 @@ void sub_0802953C(Entity* this) {
|
||||||
if (--this->field_0x82.HALF.HI == 0) {
|
if (--this->field_0x82.HALF.HI == 0) {
|
||||||
this->field_0x82.HALF.HI = 0x41;
|
this->field_0x82.HALF.HI = 0x41;
|
||||||
if (gSave.stats.rupees != 0) {
|
if (gSave.stats.rupees != 0) {
|
||||||
ModRupees(gUnk_080CCC44[this->entityType.form]);
|
ModRupees(gUnk_080CCC44[this->type]);
|
||||||
this->cutsceneBeh.HALF.LO = 1;
|
this->cutsceneBeh.HALF.LO = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +200,7 @@ void sub_08029660(Entity* this) {
|
||||||
u32 temp;
|
u32 temp;
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteIndex = 0xd1;
|
this->spriteIndex = 0xd1;
|
||||||
temp = gUnk_080CCC47[this->entityType.form];
|
temp = gUnk_080CCC47[this->type];
|
||||||
this->palette.b.b0 = temp;
|
this->palette.b.b0 = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ void sub_080297F0(Entity* this) {
|
||||||
this->damageType = 0x8e;
|
this->damageType = 0x8e;
|
||||||
sub_080AE068(this);
|
sub_080AE068(this);
|
||||||
this->spriteIndex = 0x143;
|
this->spriteIndex = 0x143;
|
||||||
temp = gUnk_080CCC47[this->entityType.form];
|
temp = gUnk_080CCC47[this->type];
|
||||||
this->palette.b.b0 = temp;
|
this->palette.b.b0 = temp;
|
||||||
this->spriteVramOffset = 9;
|
this->spriteVramOffset = 9;
|
||||||
InitializeAnimation(this, 0x54);
|
InitializeAnimation(this, 0x54);
|
||||||
|
|
|
@ -21,7 +21,7 @@ void SensorBladeTrap(Entity* this) {
|
||||||
|
|
||||||
void sub_0802B9EC(Entity* this) {
|
void sub_0802B9EC(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->field_0x78.HWORD = gUnk_080CD3D4[this->entityType.form];
|
this->field_0x78.HWORD = gUnk_080CD3D4[this->type];
|
||||||
this->field_0x7c.HALF.LO = this->cutsceneBeh.HWORD;
|
this->field_0x7c.HALF.LO = this->cutsceneBeh.HWORD;
|
||||||
this->field_0x7c.HALF.HI = this->field_0x86.HWORD;
|
this->field_0x7c.HALF.HI = this->field_0x86.HWORD;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,20 +102,20 @@ void sub_080450A8(Entity* this) {
|
||||||
PosOffset* off;
|
PosOffset* off;
|
||||||
|
|
||||||
/* Can we create enough new entities? */
|
/* Can we create enough new entities? */
|
||||||
count = gUnk_080D16D0[this->entityType.form];
|
count = gUnk_080D16D0[this->type];
|
||||||
if (72 - count <= gEntCount)
|
if (72 - count <= gEntCount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Create 2-4 new MiniSlime */
|
/* Create 2-4 new MiniSlime */
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
entities[i] = CreateEnemy(0x57, this->entityType.form);
|
entities[i] = CreateEnemy(0x57, this->type);
|
||||||
|
|
||||||
off = gUnk_080D16D4;
|
off = gUnk_080D16D4;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
ent = entities[i];
|
ent = entities[i];
|
||||||
ent->attachedEntity = entities[(i + 1) % count];
|
ent->attachedEntity = entities[(i + 1) % count];
|
||||||
ent->parent = entities[(i + count - 1) % count];
|
ent->parent = entities[(i + count - 1) % count];
|
||||||
ent->entityType.parameter = 1;
|
ent->type2 = 1;
|
||||||
ent->height.HALF.HI = 0;
|
ent->height.HALF.HI = 0;
|
||||||
ent->hurtBlinkTime = -0x10;
|
ent->hurtBlinkTime = -0x10;
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@ extern const s8 gUnk_080CBDF7[];
|
||||||
extern const s8 gUnk_080CBDFF[];
|
extern const s8 gUnk_080CBDFF[];
|
||||||
|
|
||||||
void Sluggula(Entity* this) {
|
void Sluggula(Entity* this) {
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
EnemyFunctionHandler(this, gUnk_080CBDBC);
|
EnemyFunctionHandler(this, gUnk_080CBDBC);
|
||||||
|
|
||||||
SetChildOffset(this, 0, 1, -0x10);
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
} else if (this->entityType.form == 0) {
|
} else if (this->type == 0) {
|
||||||
if (this->height.HALF.HI == 0) {
|
if (this->height.HALF.HI == 0) {
|
||||||
u32 idx = sub_080012DC(this);
|
u32 idx = sub_080012DC(this);
|
||||||
if (idx != 0) {
|
if (idx != 0) {
|
||||||
|
@ -49,7 +49,7 @@ void sub_08023C20(Entity* this) {
|
||||||
if (this->field_0x43)
|
if (this->field_0x43)
|
||||||
sub_0804A9FC(this, 0x1c);
|
sub_0804A9FC(this, 0x1c);
|
||||||
|
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
sub_0804AA30(this, gUnk_080CBDBC);
|
sub_0804AA30(this, gUnk_080CBDBC);
|
||||||
} else {
|
} else {
|
||||||
sub_0804AA30(this, gUnk_080CBDD4);
|
sub_0804AA30(this, gUnk_080CBDD4);
|
||||||
|
@ -89,7 +89,7 @@ void sub_08023CE0(Entity* this) {
|
||||||
switch (this->action) {
|
switch (this->action) {
|
||||||
case 0:
|
case 0:
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
if (this->entityType.parameter == 1) {
|
if (this->type2 == 1) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
if (this->actionDelay == 0) {
|
if (this->actionDelay == 0) {
|
||||||
this->actionDelay = 1;
|
this->actionDelay = 1;
|
||||||
|
|
|
@ -130,11 +130,11 @@ void sub_080317F8(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08031840(Entity* this) {
|
void sub_08031840(Entity* this) {
|
||||||
Entity* enemy = CreateEnemy(0x2d, this->entityType.form);
|
Entity* enemy = CreateEnemy(0x2d, this->type);
|
||||||
if (enemy != NULL) {
|
if (enemy != NULL) {
|
||||||
CopyPosition(this, enemy);
|
CopyPosition(this, enemy);
|
||||||
enemy->parent = this;
|
enemy->parent = this;
|
||||||
this->attachedEntity = enemy;
|
this->attachedEntity = enemy;
|
||||||
enemy->entityType.parameter = 1;
|
enemy->type2 = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ void nullsub_15(Entity* this) {
|
||||||
void sub_0802B33C(Entity* this) {
|
void sub_0802B33C(Entity* this) {
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->direction = (this->entityType).parameter;
|
this->direction = this->type2;
|
||||||
this->field_0xf = 0x78;
|
this->field_0xf = 0x78;
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void sub_0802B35C(Entity* this) {
|
||||||
|
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
ProcessMovement(this);
|
ProcessMovement(this);
|
||||||
is_head = this->entityType.form == 0;
|
is_head = this->type == 0;
|
||||||
if (this->collisions == 0) {
|
if (this->collisions == 0) {
|
||||||
if (--this->field_0xf == 0) {
|
if (--this->field_0xf == 0) {
|
||||||
this->field_0xf = 0x78;
|
this->field_0xf = 0x78;
|
||||||
|
|
|
@ -84,7 +84,7 @@ void sub_08028314(Entity* this) {
|
||||||
this->field_0x82.HALF.LO = 1;
|
this->field_0x82.HALF.LO = 1;
|
||||||
|
|
||||||
if (this->actionDelay) {
|
if (this->actionDelay) {
|
||||||
this->animationState = this->entityType.parameter << 1;
|
this->animationState = this->type2 << 1;
|
||||||
this->actionDelay = 0x1e;
|
this->actionDelay = 0x1e;
|
||||||
this->nonPlanarMovement = 0x80;
|
this->nonPlanarMovement = 0x80;
|
||||||
this->direction = this->animationState << 2;
|
this->direction = this->animationState << 2;
|
||||||
|
|
|
@ -30,7 +30,7 @@ void sub_0802F150(Entity* this) {
|
||||||
case 0x14:
|
case 0x14:
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->previousActionFlag = 0;
|
this->previousActionFlag = 0;
|
||||||
if ((this->entityType).form != 0) {
|
if (this->type != 0) {
|
||||||
this->actionDelay = 0xc0;
|
this->actionDelay = 0xc0;
|
||||||
} else {
|
} else {
|
||||||
this->actionDelay = gUnk_080CDEF8[Random() & 3];
|
this->actionDelay = gUnk_080CDEF8[Random() & 3];
|
||||||
|
@ -76,9 +76,9 @@ void sub_0802F210(Entity* this) {
|
||||||
this->field_0xf = 0;
|
this->field_0xf = 0;
|
||||||
*(u8*)&this->field_0x7c = 0;
|
*(u8*)&this->field_0x7c = 0;
|
||||||
|
|
||||||
this->field_0x80.HWORD = this->entityType.form == 0 ? 0x1800 : 0x2800;
|
this->field_0x80.HWORD = this->type == 0 ? 0x1800 : 0x2800;
|
||||||
|
|
||||||
this->field_0x82.HWORD = this->entityType.form == 0 ? 0x2800 : 0x3000;
|
this->field_0x82.HWORD = this->type == 0 ? 0x2800 : 0x3000;
|
||||||
|
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ void sub_0802F284(Entity* this) {
|
||||||
if ((this->frames.b.f3) != 0) {
|
if ((this->frames.b.f3) != 0) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = 0x10;
|
this->actionDelay = 0x10;
|
||||||
this->field_0xf = this->entityType.form;
|
this->field_0xf = this->type;
|
||||||
this->field_0x20 = this->field_0x82.HWORD << 4;
|
this->field_0x20 = this->field_0x82.HWORD << 4;
|
||||||
sub_0802F45C(this);
|
sub_0802F45C(this);
|
||||||
InitializeAnimation(this, 2);
|
InitializeAnimation(this, 2);
|
||||||
|
@ -120,7 +120,7 @@ void sub_0802F300(Entity* this) {
|
||||||
if (sub_080044EC(this, this->field_0x80.HWORD) == 1) {
|
if (sub_080044EC(this, this->field_0x80.HWORD) == 1) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->previousActionFlag = 0;
|
this->previousActionFlag = 0;
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
rand = 0;
|
rand = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,10 +165,10 @@ void sub_0802F3F4(Entity* this) {
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
|
|
||||||
if ((this->frames.b.f3) != 0) {
|
if ((this->frames.b.f3) != 0) {
|
||||||
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->entityType.form % 2) != 0)) {
|
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = 0x10;
|
this->actionDelay = 0x10;
|
||||||
this->field_0xf = this->entityType.form;
|
this->field_0xf = this->type;
|
||||||
this->field_0x20 = this->field_0x82.HWORD << 4;
|
this->field_0x20 = this->field_0x82.HWORD << 4;
|
||||||
(*(u8*)&this->field_0x7c.HALF.LO)++;
|
(*(u8*)&this->field_0x7c.HALF.LO)++;
|
||||||
sub_0802F45C(this);
|
sub_0802F45C(this);
|
||||||
|
|
|
@ -45,9 +45,9 @@ void sub_08037F58(Entity* this) {
|
||||||
u32 uVar1;
|
u32 uVar1;
|
||||||
|
|
||||||
if ((this->field_0x3a & 2) == 0) {
|
if ((this->field_0x3a & 2) == 0) {
|
||||||
SetGlobalFlag(this->entityType.parameter);
|
SetGlobalFlag(this->type2);
|
||||||
}
|
}
|
||||||
if ((this->entityType).form != 0) {
|
if (this->type != 0) {
|
||||||
uVar1 = 0x59;
|
uVar1 = 0x59;
|
||||||
} else {
|
} else {
|
||||||
uVar1 = 0x58;
|
uVar1 = 0x58;
|
||||||
|
@ -64,7 +64,7 @@ void sub_08037F84(Entity* this) {
|
||||||
|
|
||||||
void sub_08037FA0(Entity* this) {
|
void sub_08037FA0(Entity* this) {
|
||||||
|
|
||||||
if (CheckGlobalFlag(this->entityType.parameter)) {
|
if (CheckGlobalFlag(this->type2)) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
sub_0804A720(this);
|
sub_0804A720(this);
|
||||||
|
|
|
@ -17,7 +17,7 @@ void TreeItem(Entity* this) {
|
||||||
|
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
this->action++;
|
this->action++;
|
||||||
this->field_0x68.HALF.LO = sub_080028F4(gUnk_080D29E0[this->entityType.form]);
|
this->field_0x68.HALF.LO = sub_080028F4(gUnk_080D29E0[this->type]);
|
||||||
if (this->field_0x68.HALF.LO > 8) {
|
if (this->field_0x68.HALF.LO > 8) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ void sub_0804468C(Entity* this) {
|
||||||
this->spriteRendering.b3 = 2;
|
this->spriteRendering.b3 = 2;
|
||||||
this->spritePriority.b0 = 5;
|
this->spritePriority.b0 = 5;
|
||||||
this->cutsceneBeh.HALF.LO = 0;
|
this->cutsceneBeh.HALF.LO = 0;
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0:
|
case 0:
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->actionDelay = 1;
|
this->actionDelay = 1;
|
||||||
|
@ -183,7 +183,7 @@ void sub_08044868(Entity* this) {
|
||||||
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
|
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
|
||||||
vaati = sub_0804A98C(this, 0x18, 0);
|
vaati = sub_0804A98C(this, 0x18, 0);
|
||||||
if (vaati) {
|
if (vaati) {
|
||||||
vaati->entityType.parameter = 1;
|
vaati->type2 = 1;
|
||||||
vaati->parent = this;
|
vaati->parent = this;
|
||||||
this->cutsceneBeh.HALF.LO = 1;
|
this->cutsceneBeh.HALF.LO = 1;
|
||||||
this->damageType = 0;
|
this->damageType = 0;
|
||||||
|
|
|
@ -58,7 +58,7 @@ void sub_0802A4E4(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->collisionLayer = 3;
|
this->collisionLayer = 3;
|
||||||
this->field_0x7c.BYTES.byte1 = Random();
|
this->field_0x7c.BYTES.byte1 = Random();
|
||||||
this->field_0x7a.HWORD = this->entityType.parameter * 0x3c;
|
this->field_0x7a.HWORD = this->type2 * 0x3c;
|
||||||
this->field_0x7c.BYTES.byte0 = this->actionDelay;
|
this->field_0x7c.BYTES.byte0 = this->actionDelay;
|
||||||
this->field_0x78.HWORD = this->actionDelay * 0x3c;
|
this->field_0x78.HWORD = this->actionDelay * 0x3c;
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
|
@ -184,7 +184,7 @@ void sub_0802A78C(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this->field_0x7a.HWORD = this->entityType.parameter * 0x3c + 1;
|
this->field_0x7a.HWORD = this->type2 * 0x3c + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,9 +36,9 @@ void sub_08033564(Entity* this) {
|
||||||
this->flags &= 0x7f;
|
this->flags &= 0x7f;
|
||||||
this->field_0x7c.HALF.LO = 0x27c;
|
this->field_0x7c.HALF.LO = 0x27c;
|
||||||
gPlayerState.flags.all |= 0x4000;
|
gPlayerState.flags.all |= 0x4000;
|
||||||
gSave.stats.effect = this->entityType.form + 1;
|
gSave.stats.effect = this->type + 1;
|
||||||
gSave.stats.effectTimer = 600;
|
gSave.stats.effectTimer = 600;
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
|
@ -90,7 +90,7 @@ void sub_08033674(Entity* this) {
|
||||||
this->field_0x80.HWORD = this->x.HALF.HI;
|
this->field_0x80.HWORD = this->x.HALF.HI;
|
||||||
this->field_0x82.HWORD = this->y.HALF.HI;
|
this->field_0x82.HWORD = this->y.HALF.HI;
|
||||||
sub_08033744(this);
|
sub_08033744(this);
|
||||||
InitializeAnimation(this, this->entityType.parameter);
|
InitializeAnimation(this, this->type2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080336A8(Entity* this) {
|
void sub_080336A8(Entity* this) {
|
||||||
|
|
22
src/entity.c
22
src/entity.c
|
@ -61,7 +61,7 @@ typedef void (*Deleter)(void*);
|
||||||
|
|
||||||
void DeleteEntityAny(Entity* ent) {
|
void DeleteEntityAny(Entity* ent) {
|
||||||
Deleter deleter = NULL;
|
Deleter deleter = NULL;
|
||||||
if (ent->entityType.type == 9) {
|
if (ent->kind == 9) {
|
||||||
deleter = (Deleter)DeleteManager;
|
deleter = (Deleter)DeleteManager;
|
||||||
} else {
|
} else {
|
||||||
deleter = (Deleter)DeleteEntity;
|
deleter = (Deleter)DeleteEntity;
|
||||||
|
@ -97,7 +97,7 @@ void DeleteEntity(Entity* ent) {
|
||||||
UnloadHitbox(ent);
|
UnloadHitbox(ent);
|
||||||
sub_0801DA0C(ent->myHeap);
|
sub_0801DA0C(ent->myHeap);
|
||||||
ent->myHeap = NULL;
|
ent->myHeap = NULL;
|
||||||
if ((ent->entityType).type == 3) {
|
if (ent->kind == 3) {
|
||||||
sub_0804AA1C(ent);
|
sub_0804AA1C(ent);
|
||||||
}
|
}
|
||||||
ent->flags = ent->flags & 0x7f;
|
ent->flags = ent->flags & 0x7f;
|
||||||
|
@ -132,8 +132,6 @@ void ClearDeletedEntity(Entity* ent) {
|
||||||
gEntCount--;
|
gEntCount--;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern EntityType gHitboxCount;
|
|
||||||
|
|
||||||
void DeleteAllEntities(void) {
|
void DeleteAllEntities(void) {
|
||||||
Entity* ent;
|
Entity* ent;
|
||||||
Entity* next;
|
Entity* next;
|
||||||
|
@ -248,7 +246,7 @@ void AppendEntityToList(Entity* ent, int listIndex) {
|
||||||
ent->prev = list->last;
|
ent->prev = list->last;
|
||||||
list->last->next = ent;
|
list->last->next = ent;
|
||||||
list->last = ent;
|
list->last = ent;
|
||||||
if (ent->entityType.type != 9) {
|
if (ent->kind != 9) {
|
||||||
ent->spritePriority.b0 = 4;
|
ent->spritePriority.b0 = 4;
|
||||||
gEntCount++;
|
gEntCount++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -283,8 +281,7 @@ bool32 DoesSimilarEntityExist(Entity* ent) {
|
||||||
list = &gEntityLists[0];
|
list = &gEntityLists[0];
|
||||||
do {
|
do {
|
||||||
for (i = list->first; (u32)i != (u32)list; i = i->next) {
|
for (i = list->first; (u32)i != (u32)list; i = i->next) {
|
||||||
if ((u32)i != (u32)ent && i->entityType.type == ent->entityType.type &&
|
if ((u32)i != (u32)ent && i->kind == ent->kind && i->id == ent->id) {
|
||||||
i->entityType.subtype == ent->entityType.subtype) {
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,7 +296,7 @@ Entity* FindEntityInListBySubtype(int type, int subtype, int listIndex) {
|
||||||
|
|
||||||
list = &gEntityLists[listIndex];
|
list = &gEntityLists[listIndex];
|
||||||
for (it = list->first; (u32)it != (u32)list; it = it->next) {
|
for (it = list->first; (u32)it != (u32)list; it = it->next) {
|
||||||
if (type == it->entityType.type && subtype == it->entityType.subtype)
|
if (type == it->kind && subtype == it->id)
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -311,8 +308,7 @@ Entity* FindEntityInListByForm(int type, int subtype, int listIndex, int form, i
|
||||||
|
|
||||||
list = &gEntityLists[listIndex];
|
list = &gEntityLists[listIndex];
|
||||||
for (i = list->first; (u32)i != (u32)list; i = i->next) {
|
for (i = list->first; (u32)i != (u32)list; i = i->next) {
|
||||||
if (type == i->entityType.type && subtype == i->entityType.subtype && form == i->entityType.form &&
|
if (type == i->kind && subtype == i->id && form == i->type && parameter == i->type2)
|
||||||
parameter == i->entityType.parameter)
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -324,7 +320,7 @@ Entity* FindNextEntityOfSameSubtype(Entity* ent, int listIndex) {
|
||||||
|
|
||||||
list = &gEntityLists[listIndex];
|
list = &gEntityLists[listIndex];
|
||||||
for (i = ent->next; (u32)i != (u32)list; i = i->next) {
|
for (i = ent->next; (u32)i != (u32)list; i = i->next) {
|
||||||
if (i->entityType.type == ent->entityType.type && i->entityType.subtype == ent->entityType.subtype)
|
if (i->kind == ent->kind && i->id == ent->id)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -337,7 +333,7 @@ Entity* FindEntityBySubtype(int type, int subtype) {
|
||||||
list = &gEntityLists[0];
|
list = &gEntityLists[0];
|
||||||
do {
|
do {
|
||||||
for (i = (Entity*)list->first; (u32)i != (u32)list; i = i->next) {
|
for (i = (Entity*)list->first; (u32)i != (u32)list; i = i->next) {
|
||||||
if ((type == (i->entityType).type) && (subtype == (i->entityType).subtype))
|
if (type == i->kind && (subtype == i->id))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
} while (++list < &gEntityLists[9]);
|
} while (++list < &gEntityLists[9]);
|
||||||
|
@ -354,7 +350,7 @@ void DeleteAllEnemies(void) {
|
||||||
do {
|
do {
|
||||||
for (ent = list->first; (u32)ent != (u32)list; ent = next) {
|
for (ent = list->first; (u32)ent != (u32)list; ent = next) {
|
||||||
next = ent->next;
|
next = ent->next;
|
||||||
if (ent->entityType.type == 3)
|
if (ent->kind == 3)
|
||||||
DeleteEntity(ent);
|
DeleteEntity(ent);
|
||||||
}
|
}
|
||||||
} while (++list < &gEntityLists[9]);
|
} while (++list < &gEntityLists[9]);
|
||||||
|
|
|
@ -94,7 +94,7 @@ void sub_0806DA1C(Entity* this, u32* param_2) {
|
||||||
u8 sub_0806DA3C(Entity* this) {
|
u8 sub_0806DA3C(Entity* this) {
|
||||||
u32 result;
|
u32 result;
|
||||||
|
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
default:
|
default:
|
||||||
result = 0;
|
result = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -141,7 +141,7 @@ void sub_0806DAD0(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806DAE8(Entity* this) {
|
void sub_0806DAE8(Entity* this) {
|
||||||
switch (this->entityType.form - 1) {
|
switch (this->type - 1) {
|
||||||
case 0:
|
case 0:
|
||||||
SetLocalFlag(0xee);
|
SetLocalFlag(0xee);
|
||||||
break;
|
break;
|
||||||
|
@ -253,7 +253,7 @@ void sub_0806DCC0() {
|
||||||
void NPC4E_Fusion(Entity* this) {
|
void NPC4E_Fusion(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
this->action += 1;
|
this->action += 1;
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
|
|
|
@ -274,7 +274,7 @@ void InitializePlayer(void) {
|
||||||
case 0xc:
|
case 0xc:
|
||||||
gPlayerState.field_0x34[4] = 4;
|
gPlayerState.field_0x34[4] = 4;
|
||||||
}
|
}
|
||||||
pl->entityType.type = 1;
|
pl->kind = 1;
|
||||||
pl->flags |= 0xa0;
|
pl->flags |= 0xa0;
|
||||||
pl->spritePriority.b0 = 4;
|
pl->spritePriority.b0 = 4;
|
||||||
pl->currentHealth = gSave.stats.health;
|
pl->currentHealth = gSave.stats.health;
|
||||||
|
|
10
src/item11.c
10
src/item11.c
|
@ -55,15 +55,15 @@ void sub_08018CBC(Entity* this) {
|
||||||
this->spriteIndex = 0xa6;
|
this->spriteIndex = 0xa6;
|
||||||
this->palette.raw = 0x33;
|
this->palette.raw = 0x33;
|
||||||
this->spriteVramOffset = 0;
|
this->spriteVramOffset = 0;
|
||||||
(this->entityType).form = gPlayerState.field_0x1d[0] - 1;
|
this->type = gPlayerState.field_0x1d[0] - 1;
|
||||||
this->actionDelay = gUnk_080B3DE0[(this->entityType).form * 2];
|
this->actionDelay = gUnk_080B3DE0[this->type * 2];
|
||||||
this->field_0x44 = gUnk_080B3DE0[(this->entityType).form * 2 + 1];
|
this->field_0x44 = gUnk_080B3DE0[this->type * 2 + 1];
|
||||||
this->field_0x40 = 0x1b;
|
this->field_0x40 = 0x1b;
|
||||||
this->hitbox = gUnk_080B3DE8[(this->entityType).form];
|
this->hitbox = gUnk_080B3DE8[this->type];
|
||||||
(u32*)gPlayerEntity.field_0x70.WORD = this;
|
(u32*)gPlayerEntity.field_0x70.WORD = this;
|
||||||
sub_08078CD0(&gPlayerEntity);
|
sub_08078CD0(&gPlayerEntity);
|
||||||
(u32*)gPlayerEntity.field_0x70.WORD = pEVar3;
|
(u32*)gPlayerEntity.field_0x70.WORD = pEVar3;
|
||||||
InitializeAnimation(this, (this->entityType).form + 10);
|
InitializeAnimation(this, this->type + 10);
|
||||||
sub_08018FA0(this);
|
sub_08018FA0(this);
|
||||||
}
|
}
|
||||||
sub_0801766C(this);
|
sub_0801766C(this);
|
||||||
|
|
|
@ -22,7 +22,7 @@ void sub_0805FBE8(Entity* this) {
|
||||||
this->nonPlanarMovement = 0x380;
|
this->nonPlanarMovement = 0x380;
|
||||||
this->animationState = this->animationState & 0x7f;
|
this->animationState = this->animationState & 0x7f;
|
||||||
if (this->collisionLayer == 2) {
|
if (this->collisionLayer == 2) {
|
||||||
this->entityType.parameter = 1;
|
this->type2 = 1;
|
||||||
}
|
}
|
||||||
this->direction = this->animationState << 2;
|
this->direction = this->animationState << 2;
|
||||||
*(u32*)&this->field_0x6c = 0x3c;
|
*(u32*)&this->field_0x6c = 0x3c;
|
||||||
|
@ -40,7 +40,7 @@ void sub_0805FC74(Entity* this) {
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
sub_0806F69C(this);
|
sub_0806F69C(this);
|
||||||
++this->actionDelay;
|
++this->actionDelay;
|
||||||
if (this->entityType.parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
sub_0800451C(this);
|
sub_0800451C(this);
|
||||||
}
|
}
|
||||||
if (!sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) &&
|
if (!sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) &&
|
||||||
|
|
|
@ -37,7 +37,7 @@ void sub_0804B058(EntityData* dat) {
|
||||||
if ((uVar2 < 0x20) && ((dat->type) == 3)) {
|
if ((uVar2 < 0x20) && ((dat->type) == 3)) {
|
||||||
if (sub_08049D1C(uVar2) != 0) {
|
if (sub_08049D1C(uVar2) != 0) {
|
||||||
ent = LoadRoomEntity(dat);
|
ent = LoadRoomEntity(dat);
|
||||||
if ((ent != NULL) && ((ent->entityType).type == 3)) {
|
if ((ent != NULL) && (ent->kind == 3)) {
|
||||||
ent->field_0x6c.HALF.LO = uVar2 | 0x80;
|
ent->field_0x6c.HALF.LO = uVar2 | 0x80;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ void sub_0805A370(Manager15* this) {
|
||||||
void sub_0805A394(Manager15* this) {
|
void sub_0805A394(Manager15* this) {
|
||||||
Entity* ent;
|
Entity* ent;
|
||||||
if ((ent = FindEntityInListBySubtype(0x3, 0x13, 0x4))) {
|
if ((ent = FindEntityInListBySubtype(0x3, 0x13, 0x4))) {
|
||||||
if (ent->entityType.form != 4) {
|
if (ent->type != 4) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,10 @@ const u8 gUnk_08108D20[] = { 0x6F, 0x70, 0x71, 0x72, 0x71, 0x70 };
|
||||||
void Manager27(Entity* this) {
|
void Manager27(Entity* this) {
|
||||||
|
|
||||||
gUnk_08108D10[this->action](this);
|
gUnk_08108D10[this->action](this);
|
||||||
if (CheckLocalFlagByOffset(0x300, this->entityType.form + 0x67)) {
|
if (CheckLocalFlagByOffset(0x300, this->type + 0x67)) {
|
||||||
gScreenTransition.field_0xac |= (1 << (this->entityType).form);
|
gScreenTransition.field_0xac |= (1 << this->type);
|
||||||
} else {
|
} else {
|
||||||
gScreenTransition.field_0xac &= ~(1 << (this->entityType).form);
|
gScreenTransition.field_0xac &= ~(1 << this->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,5 +75,5 @@ void sub_0805C908(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sub_0805C920(Entity* this) {
|
u32 sub_0805C920(Entity* this) {
|
||||||
return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67);
|
return CheckLocalFlagByOffset(0x300, this->type + 0x67);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,7 @@ Entity* Manager28_FindMatchingEntity(EntityData* unk1) {
|
||||||
y = unk1->yPos + gRoomControls.roomOriginY;
|
y = unk1->yPos + gRoomControls.roomOriginY;
|
||||||
tmp = &gUnk_03003D90;
|
tmp = &gUnk_03003D90;
|
||||||
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
for (i = tmp->first; (u32)i != (u32)tmp; i = i->next) {
|
||||||
if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->subtype == i->entityType.subtype &&
|
if (x == i->x.HALF.HI && y == i->y.HALF.HI && unk1->subtype == i->id && 3 == i->kind && unk1->form == i->type) {
|
||||||
3 == i->entityType.type && unk1->form == i->entityType.form) {
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ extern void (*const gUnk_08108D3C[])(Entity*);
|
||||||
extern void (*const gUnk_08108D44[])(Entity*);
|
extern void (*const gUnk_08108D44[])(Entity*);
|
||||||
|
|
||||||
void sub_0805D250(Entity* this) {
|
void sub_0805D250(Entity* this) {
|
||||||
gUnk_08108D3C[this->entityType.form](this);
|
gUnk_08108D3C[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0805D268(Entity* this) {
|
void sub_0805D268(Entity* this) {
|
||||||
|
|
|
@ -101,7 +101,7 @@ void ManagerB_LoadFight(Manager* this) {
|
||||||
if (prop) {
|
if (prop) {
|
||||||
while (*((u8*)prop) != 0xFF) {
|
while (*((u8*)prop) != 0xFF) {
|
||||||
ent = LoadRoomEntity(prop++);
|
ent = LoadRoomEntity(prop++);
|
||||||
if (ent && (ent->entityType.type == 3)) {
|
if (ent && (ent->kind == 3)) {
|
||||||
ent->field_0x6c.HALF.HI |= 0x40;
|
ent->field_0x6c.HALF.HI |= 0x40;
|
||||||
ManagerBHelper_Monitor(monitor, ent, counter++);
|
ManagerBHelper_Monitor(monitor, ent, counter++);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,14 +99,14 @@ void sub_08063410(Entity* this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->action++;
|
this->action++;
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
this->hitbox = &gUnk_0810C894;
|
this->hitbox = &gUnk_0810C894;
|
||||||
this->entityType.parameter = 0;
|
this->type2 = 0;
|
||||||
}
|
}
|
||||||
sub_0807DD64(this);
|
sub_0807DD64(this);
|
||||||
sub_08078778(this);
|
sub_08078778(this);
|
||||||
}
|
}
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
sub_0806346C(this);
|
sub_0806346C(this);
|
||||||
}
|
}
|
||||||
sub_0807DDAC(this, NULL);
|
sub_0807DDAC(this, NULL);
|
||||||
|
@ -141,24 +141,24 @@ void sub_0806346C(Entity* this) {
|
||||||
iVar2 >>= 4;
|
iVar2 >>= 4;
|
||||||
|
|
||||||
bVar1 = gUnk_0810C8F0[(gPlayerEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
|
bVar1 = gUnk_0810C8F0[(gPlayerEntity.animationState >> 1) + iVar3 * 4 + iVar2 * 0x18];
|
||||||
if (bVar1 != this->entityType.parameter) {
|
if (bVar1 != this->type2) {
|
||||||
gUnk_0810C89C_struct* temp = &gUnk_0810C89C[bVar1];
|
gUnk_0810C89C_struct* temp = &gUnk_0810C89C[bVar1];
|
||||||
sub_08078850(this, 1, temp->unk_04, temp);
|
sub_08078850(this, 1, temp->unk_04, temp);
|
||||||
this->entityType.parameter = bVar1;
|
this->type2 = bVar1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080634E4(Entity* this, u32* param_1) {
|
void sub_080634E4(Entity* this, u32* param_1) {
|
||||||
param_1[1] = this->entityType.parameter;
|
param_1[1] = this->type2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080634EC(Entity* this) {
|
void sub_080634EC(Entity* this) {
|
||||||
gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->entityType.parameter];
|
gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->type2];
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063504(Entity* this, u32* param_2) {
|
void sub_08063504(Entity* this, u32* param_2) {
|
||||||
u32 uVar1;
|
u32 uVar1;
|
||||||
|
|
||||||
uVar1 = sub_080544DC(gUnk_0810C88C[this->entityType.parameter]);
|
uVar1 = sub_080544DC(gUnk_0810C88C[this->type2]);
|
||||||
param_2[5] = BOOLCAST(uVar1);
|
param_2[5] = BOOLCAST(uVar1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ extern void sub_0806D02C(Entity*);
|
||||||
extern Entity* FindEntityInListByForm(u32, u32, u32, u32, u32);
|
extern Entity* FindEntityInListByForm(u32, u32, u32, u32, u32);
|
||||||
|
|
||||||
void BigGoron(Entity* this) {
|
void BigGoron(Entity* this) {
|
||||||
gUnk_081140D4[this->entityType.form](this);
|
gUnk_081140D4[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806CF30(Entity* this) {
|
void sub_0806CF30(Entity* this) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ void sub_08068A1C(Entity* this) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
(this->entityType).parameter = (this->entityType).form;
|
this->type2 = this->type;
|
||||||
if (gScreenTransition.field_0x24[8] != 0) {
|
if (gScreenTransition.field_0x24[8] != 0) {
|
||||||
offset = 6;
|
offset = 6;
|
||||||
bVar1 = 3;
|
bVar1 = 3;
|
||||||
|
@ -92,13 +92,13 @@ void sub_08068AA4(Entity* this) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
|
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
if (this->entityType.form != 0) {
|
if (this->type != 0) {
|
||||||
this->entityType.parameter++;
|
this->type2++;
|
||||||
this->entityType.parameter &= 7;
|
this->type2 &= 7;
|
||||||
if (this->entityType.parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
this->entityType.parameter += 1;
|
this->type2 += 1;
|
||||||
}
|
}
|
||||||
sub_0801D2B4(this, gUnk_081115DC[this->entityType.parameter]);
|
sub_0801D2B4(this, gUnk_081115DC[this->type2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,8 +175,8 @@ void sub_08068C28(Entity* this) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
u32 uVar2;
|
u32 uVar2;
|
||||||
|
|
||||||
this->actionDelay = gUnk_08111623[(this->entityType).form];
|
this->actionDelay = gUnk_08111623[this->type];
|
||||||
if ((this->entityType).form == 1) {
|
if (this->type == 1) {
|
||||||
if (GetInventoryValue(0x48)) { // spin attack
|
if (GetInventoryValue(0x48)) { // spin attack
|
||||||
if (!GetInventoryValue(0x4b)) { // rock breaker
|
if (!GetInventoryValue(0x4b)) { // rock breaker
|
||||||
this->actionDelay = 1;
|
this->actionDelay = 1;
|
||||||
|
@ -205,7 +205,7 @@ void sub_08068CA0(Entity* param_1, Entity* param_2) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
u32 uVar2;
|
u32 uVar2;
|
||||||
|
|
||||||
bVar1 = (param_1->entityType).form;
|
bVar1 = param_1->type;
|
||||||
if (bVar1 == 1) {
|
if (bVar1 == 1) {
|
||||||
*(u32*)¶m_2->animationState = bVar1;
|
*(u32*)¶m_2->animationState = bVar1;
|
||||||
uVar2 = GetInventoryValue(0x48); // spin attack
|
uVar2 = GetInventoryValue(0x48); // spin attack
|
||||||
|
|
|
@ -23,7 +23,7 @@ void Carpenter(Entity* this) {
|
||||||
}
|
}
|
||||||
switch (this->action) {
|
switch (this->action) {
|
||||||
case 0:
|
case 0:
|
||||||
if (!LoadExtraSpriteData(this, gUnk_08110CA8 + this->entityType.form * 4))
|
if (!LoadExtraSpriteData(this, gUnk_08110CA8 + this->type * 4))
|
||||||
break;
|
break;
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->field_0x68.HALF.HI = 0;
|
this->field_0x68.HALF.HI = 0;
|
||||||
|
@ -35,8 +35,8 @@ void Carpenter(Entity* this) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->interactType = 0;
|
this->interactType = 0;
|
||||||
this->field_0x68.HALF.HI = this->animIndex;
|
this->field_0x68.HALF.HI = this->animIndex;
|
||||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 +
|
InitializeAnimation(this,
|
||||||
(this->entityType.form * 8));
|
sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->type * 8));
|
||||||
sub_0806F118(this);
|
sub_0806F118(this);
|
||||||
} else {
|
} else {
|
||||||
sub_0807DDAC(this, 0);
|
sub_0807DDAC(this, 0);
|
||||||
|
@ -54,7 +54,7 @@ void Carpenter(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Carpenter_Head(Entity* this) {
|
void Carpenter_Head(Entity* this) {
|
||||||
if ((this->entityType).form < 2) {
|
if (this->type < 2) {
|
||||||
SetExtraSpriteFrame(this, 0, this->frames.all & 0xffffff7f);
|
SetExtraSpriteFrame(this, 0, this->frames.all & 0xffffff7f);
|
||||||
SetExtraSpriteFrame(this, 1, this->frameIndex);
|
SetExtraSpriteFrame(this, 1, this->frameIndex);
|
||||||
SetExtraSpriteFrame(this, 2, this->frameSpriteSettings & 0x3f);
|
SetExtraSpriteFrame(this, 2, this->frameSpriteSettings & 0x3f);
|
||||||
|
@ -70,5 +70,5 @@ void Carpenter_Head(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080672b0(Entity* this, u32 param_2) {
|
void sub_080672b0(Entity* this, u32 param_2) {
|
||||||
InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->entityType.form * 8);
|
InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->type * 8);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ extern void (*gCat[9])(Entity*);
|
||||||
void Cat(Entity* ent) {
|
void Cat(Entity* ent) {
|
||||||
gCat[ent->action](ent);
|
gCat[ent->action](ent);
|
||||||
sub_08067C44(ent);
|
sub_08067C44(ent);
|
||||||
if (((ent->flags & 128) == 0) && ((ent->entityType).form != 5)) {
|
if (((ent->flags & 128) == 0) && (ent->type != 5)) {
|
||||||
sub_0806ED78(ent);
|
sub_0806ED78(ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ void sub_08068FC0(Entity* ent) {
|
||||||
u32 r2;
|
u32 r2;
|
||||||
|
|
||||||
ent->action = 1;
|
ent->action = 1;
|
||||||
ent->animationState = ent->entityType.parameter;
|
ent->animationState = ent->type2;
|
||||||
ent->nonPlanarMovement = 0x40;
|
ent->nonPlanarMovement = 0x40;
|
||||||
|
|
||||||
ent->field_0x6c.HALF.HI = 0xFF;
|
ent->field_0x6c.HALF.HI = 0xFF;
|
||||||
|
@ -181,7 +181,7 @@ void sub_080691E0(Entity* ent) {
|
||||||
|
|
||||||
// Show dialogue
|
// Show dialogue
|
||||||
void Cow_ShowDialogue(Entity* ent) {
|
void Cow_ShowDialogue(Entity* ent) {
|
||||||
ShowNPCDialogue(ent, &gUnk_08111938[ent->entityType.form]);
|
ShowNPCDialogue(ent, &gUnk_08111938[ent->type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806920C(Entity* ent) {
|
void sub_0806920C(Entity* ent) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ void sub_08065A34(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08065A50(Entity* this) {
|
void sub_08065A50(Entity* this) {
|
||||||
ShowNPCDialogue(this, &gUnk_08110080[this->entityType.form]);
|
ShowNPCDialogue(this, &gUnk_08110080[this->type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08065A64(Entity* this) {
|
void sub_08065A64(Entity* this) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ void ForestMinish(Entity* this) {
|
||||||
this->field_0x68.HALF.HI = this->animationState = this->actionDelay << 1;
|
this->field_0x68.HALF.HI = this->animationState = this->actionDelay << 1;
|
||||||
this->actionDelay = 0;
|
this->actionDelay = 0;
|
||||||
sub_0805E3A0(this, 2);
|
sub_0805E3A0(this, 2);
|
||||||
StartCutscene(this, (u16*)gUnk_08109D18[this->entityType.parameter]);
|
StartCutscene(this, (u16*)gUnk_08109D18[this->type2]);
|
||||||
sub_0807DD50(this);
|
sub_0807DD50(this);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -161,7 +161,7 @@ void sub_080601D4(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08060208(Entity* this) {
|
void sub_08060208(Entity* this) {
|
||||||
ShowNPCDialogue(this, &gUnk_08109DC8[this->entityType.parameter * 0x4]);
|
ShowNPCDialogue(this, &gUnk_08109DC8[this->type2 * 0x4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806021C(Entity* this) {
|
void sub_0806021C(Entity* this) {
|
||||||
|
@ -181,11 +181,11 @@ void sub_0806021C(Entity* this) {
|
||||||
if (GetInventoryValue(0x13)) {
|
if (GetInventoryValue(0x13)) {
|
||||||
uVar2 = 3;
|
uVar2 = 3;
|
||||||
}
|
}
|
||||||
ShowNPCDialogue(this, gUnk_08109DC8 + this->entityType.parameter * 0x4 + uVar2);
|
ShowNPCDialogue(this, gUnk_08109DC8 + this->type2 * 0x4 + uVar2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806025C(Entity* this) {
|
void sub_0806025C(Entity* this) {
|
||||||
ShowNPCDialogue(this, &gUnk_08109DC8[this->entityType.parameter * 0x4]);
|
ShowNPCDialogue(this, &gUnk_08109DC8[this->type2 * 0x4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08060270(Entity* this) {
|
void sub_08060270(Entity* this) {
|
||||||
|
|
|
@ -112,7 +112,7 @@ void sub_080694B0(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080694D8(Entity* this) {
|
void sub_080694D8(Entity* this) {
|
||||||
ShowNPCDialogue(this, &gUnk_08111A94[this->entityType.form]);
|
ShowNPCDialogue(this, &gUnk_08111A94[this->type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080694EC(Entity* this) {
|
void sub_080694EC(Entity* this) {
|
||||||
|
|
|
@ -66,15 +66,15 @@ void sub_08063D44(Entity* this) {
|
||||||
if (gEntCount > 0x46)
|
if (gEntCount > 0x46)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
temp = this->entityType.subtype;
|
temp = this->id;
|
||||||
temp ^= 0x15;
|
temp ^= 0x15;
|
||||||
idx = BOOLCAST(temp) * 4;
|
idx = BOOLCAST(temp) * 4;
|
||||||
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
InitializeAnimation(this, 4);
|
InitializeAnimation(this, 4);
|
||||||
sub_0806EE04(this, gUnk_0810F6BC[this->entityType.form], 0);
|
sub_0806EE04(this, gUnk_0810F6BC[this->type], 0);
|
||||||
switch (this->entityType.form) {
|
switch (this->type) {
|
||||||
case 0 ... 3:
|
case 0 ... 3:
|
||||||
ent = sub_080A7EE0(0xc);
|
ent = sub_080A7EE0(0xc);
|
||||||
ent->parent = this;
|
ent->parent = this;
|
||||||
|
@ -85,12 +85,12 @@ void sub_08063D44(Entity* this) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this->action++;
|
this->action++;
|
||||||
this->entityType.form = 0;
|
this->type = 0;
|
||||||
sub_08063DC8(this);
|
sub_08063DC8(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08063DC8(Entity* this) {
|
void sub_08063DC8(Entity* this) {
|
||||||
if ((this->entityType).form == 0xff) {
|
if (this->type == 0xff) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = 0x1e;
|
this->actionDelay = 0x1e;
|
||||||
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
|
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity));
|
||||||
|
@ -130,7 +130,7 @@ void sub_08063E90(Entity* this) {
|
||||||
u32 temp, idx;
|
u32 temp, idx;
|
||||||
u32 unk;
|
u32 unk;
|
||||||
|
|
||||||
temp = this->entityType.subtype;
|
temp = this->id;
|
||||||
temp ^= 0x15;
|
temp ^= 0x15;
|
||||||
idx = BOOLCAST(temp) * 4;
|
idx = BOOLCAST(temp) * 4;
|
||||||
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
||||||
|
@ -188,7 +188,7 @@ void Guard_Head(Entity* this) {
|
||||||
uVar2 = this->frames.all & 0x3f;
|
uVar2 = this->frames.all & 0x3f;
|
||||||
pbVar5 = (this->frameIndex & 0x3f);
|
pbVar5 = (this->frameIndex & 0x3f);
|
||||||
uVar4 = this->frameSpriteSettings & 0x3f;
|
uVar4 = this->frameSpriteSettings & 0x3f;
|
||||||
if ((this->entityType).subtype == 0x15) {
|
if (this->id == 0x15) {
|
||||||
if ((this->frameIndex & 0x40) != 0) {
|
if ((this->frameIndex & 0x40) != 0) {
|
||||||
pbVar5 = pbVar5 + 0x21;
|
pbVar5 = pbVar5 + 0x21;
|
||||||
pbVar3 = 0xffffffff;
|
pbVar3 = 0xffffffff;
|
||||||
|
@ -227,7 +227,7 @@ void sub_08064050(Entity* arg0, struct_08064050* arg1) {
|
||||||
u32 unk;
|
u32 unk;
|
||||||
|
|
||||||
arg1->unk2 = 0;
|
arg1->unk2 = 0;
|
||||||
switch (arg0->entityType.parameter) {
|
switch (arg0->type2) {
|
||||||
case 0x11:
|
case 0x11:
|
||||||
arg1->unk2 = 1;
|
arg1->unk2 = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -72,7 +72,7 @@ void sub_08068780(Entity* this) {
|
||||||
}
|
}
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
this->animationState = this->entityType.form;
|
this->animationState = this->type;
|
||||||
sub_0805E3A0(this, 2);
|
sub_0805E3A0(this, 2);
|
||||||
sub_0807DD50(this);
|
sub_0807DD50(this);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -60,7 +60,7 @@ void sub_0806B41C(Entity* this) {
|
||||||
if (LoadExtraSpriteData(this, &gUnk_08112E1C)) {
|
if (LoadExtraSpriteData(this, &gUnk_08112E1C)) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
if (this->entityType.parameter == 2) {
|
if (this->type2 == 2) {
|
||||||
CreateFx(this, 0x25, 0);
|
CreateFx(this, 0x25, 0);
|
||||||
}
|
}
|
||||||
sub_0807DD50(this);
|
sub_0807DD50(this);
|
||||||
|
@ -90,7 +90,7 @@ void sub_0806B41C(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806B4F0(Entity* this) {
|
void sub_0806B4F0(Entity* this) {
|
||||||
ShowNPCDialogue(this, &gUnk_08112E2C[this->entityType.parameter]);
|
ShowNPCDialogue(this, &gUnk_08112E2C[this->type2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806B504(Entity* this) {
|
void sub_0806B504(Entity* this) {
|
||||||
|
|
|
@ -53,8 +53,8 @@ void sub_08060428(Entity* this) {
|
||||||
|
|
||||||
this->actionDelay = 0x5a;
|
this->actionDelay = 0x5a;
|
||||||
this->nonPlanarMovement = 0x180;
|
this->nonPlanarMovement = 0x180;
|
||||||
if (this->entityType.parameter != 0) {
|
if (this->type2 != 0) {
|
||||||
data = GetCurrentRoomProperty(this->entityType.parameter);
|
data = GetCurrentRoomProperty(this->type2);
|
||||||
} else {
|
} else {
|
||||||
data = NULL;
|
data = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ extern void (*gUnk_08112278[])(Entity*);
|
||||||
extern void gUnk_08012F0C;
|
extern void gUnk_08012F0C;
|
||||||
|
|
||||||
void Rem(Entity* this) {
|
void Rem(Entity* this) {
|
||||||
gUnk_08112260[this->entityType.form](this);
|
gUnk_08112260[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806a370(Entity* this) {
|
void sub_0806a370(Entity* this) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ void sub_0806A1F8(Entity* this) {
|
||||||
u32 iVar1;
|
u32 iVar1;
|
||||||
SpriteLoadData* paVar2;
|
SpriteLoadData* paVar2;
|
||||||
|
|
||||||
(this->entityType).form == 0 ? (paVar2 = &gUnk_081121B4) : (paVar2 = &gUnk_081121C4);
|
this->type == 0 ? (paVar2 = &gUnk_081121B4) : (paVar2 = &gUnk_081121C4);
|
||||||
|
|
||||||
iVar1 = LoadExtraSpriteData(this, paVar2);
|
iVar1 = LoadExtraSpriteData(this, paVar2);
|
||||||
if (iVar1) {
|
if (iVar1) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ extern Dialog gUnk_08113930[];
|
||||||
void Teachers(Entity* this) {
|
void Teachers(Entity* this) {
|
||||||
switch (this->action) {
|
switch (this->action) {
|
||||||
case 0:
|
case 0:
|
||||||
if (LoadExtraSpriteData(this, &gUnk_08113910[this->entityType.form * 4])) {
|
if (LoadExtraSpriteData(this, &gUnk_08113910[this->type * 4])) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
this->animationState = this->actionDelay;
|
this->animationState = this->actionDelay;
|
||||||
|
@ -61,7 +61,7 @@ void Teachers_Head(Entity* this) {
|
||||||
uVar3 = this->frames.all & -0x81;
|
uVar3 = this->frames.all & -0x81;
|
||||||
bVar1 = this->frameIndex;
|
bVar1 = this->frameIndex;
|
||||||
bVar2 = this->frameSpriteSettings & 0x3f;
|
bVar2 = this->frameSpriteSettings & 0x3f;
|
||||||
if ((this->entityType).form == 0) {
|
if (this->type == 0) {
|
||||||
SetExtraSpriteFrame(this, 0, (uVar3 + 3));
|
SetExtraSpriteFrame(this, 0, (uVar3 + 3));
|
||||||
SetExtraSpriteFrame(this, 1, bVar1);
|
SetExtraSpriteFrame(this, 1, bVar1);
|
||||||
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
||||||
|
@ -83,12 +83,12 @@ void sub_0806C70C(Entity* this) {
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
ShowNPCDialogue(this, gUnk_08113930 + this->entityType.form * 8 + offset);
|
ShowNPCDialogue(this, gUnk_08113930 + this->type * 8 + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Teachers_Fusion(Entity* this) {
|
void Teachers_Fusion(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
if (LoadExtraSpriteData(this, &gUnk_08113910[this->entityType.form * 4])) {
|
if (LoadExtraSpriteData(this, &gUnk_08113910[this->type * 4])) {
|
||||||
this->action++;
|
this->action++;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
InitializeAnimation(this, 2);
|
InitializeAnimation(this, 2);
|
||||||
|
|
|
@ -43,7 +43,7 @@ void TownMinish(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806ABFC(Entity* this) {
|
void sub_0806ABFC(Entity* this) {
|
||||||
SpriteLoadData* SpriteLoadData = &gUnk_08112674[this->entityType.form * 4];
|
SpriteLoadData* SpriteLoadData = &gUnk_08112674[this->type * 4];
|
||||||
if (!LoadExtraSpriteData(this, SpriteLoadData)) {
|
if (!LoadExtraSpriteData(this, SpriteLoadData)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ void sub_0806ACC4(Entity* this) {
|
||||||
u8 delay;
|
u8 delay;
|
||||||
switch (this->action) {
|
switch (this->action) {
|
||||||
case 0:
|
case 0:
|
||||||
if (LoadExtraSpriteData(this, &gUnk_08112674[this->entityType.form * 4]) == 0)
|
if (LoadExtraSpriteData(this, &gUnk_08112674[this->type * 4]) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
|
@ -114,13 +114,13 @@ void sub_0806ACC4(Entity* this) {
|
||||||
} else {
|
} else {
|
||||||
sub_0807DDAC(this, NULL);
|
sub_0807DDAC(this, NULL);
|
||||||
sub_0806AEA8(this);
|
sub_0806AEA8(this);
|
||||||
if (this->entityType.parameter == 10 && this->interactType) {
|
if (this->type2 == 10 && this->interactType) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->interactType = 0;
|
this->interactType = 0;
|
||||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8);
|
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8);
|
||||||
sub_0806AFE8(this, *(s32**)&this->cutsceneBeh);
|
sub_0806AFE8(this, *(s32**)&this->cutsceneBeh);
|
||||||
}
|
}
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
u8 idx = gPlayerEntity.animationState >> 1;
|
u8 idx = gPlayerEntity.animationState >> 1;
|
||||||
sub_08078850(this, 1, gUnk_081126E4[idx], &gUnk_081126D4[idx]);
|
sub_08078850(this, 1, gUnk_081126E4[idx], &gUnk_081126D4[idx]);
|
||||||
}
|
}
|
||||||
|
@ -250,12 +250,12 @@ void sub_0806AFBC(Entity* this) {
|
||||||
if (idx < 0)
|
if (idx < 0)
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
|
||||||
ShowNPCDialogue(this, gUnk_081126F0 + this->entityType.parameter * 8 + idx);
|
ShowNPCDialogue(this, gUnk_081126F0 + this->type2 * 8 + idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806AFE8(Entity* this, s32* unk) {
|
void sub_0806AFE8(Entity* this, s32* unk) {
|
||||||
unk[5] = 0;
|
unk[5] = 0;
|
||||||
gUnk_08112BF0[this->entityType.parameter](this, unk);
|
gUnk_08112BF0[this->type2](this, unk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806B004(Entity* this, int* unk) {
|
void sub_0806B004(Entity* this, int* unk) {
|
||||||
|
@ -304,7 +304,7 @@ void sub_0806B098(Entity* this) {
|
||||||
idx = BOOLCAST(f);
|
idx = BOOLCAST(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextboxNoOverlap(gUnk_08112C50[(this->entityType.parameter - 7) * 3 + idx], this);
|
TextboxNoOverlap(gUnk_08112C50[(this->type2 - 7) * 3 + idx], this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806B0E0(Entity* this) {
|
void sub_0806B0E0(Entity* this) {
|
||||||
|
@ -339,7 +339,7 @@ void sub_0806B134(Entity* this) {
|
||||||
|
|
||||||
void TownMinish_Fusion(Entity* this) {
|
void TownMinish_Fusion(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
if (LoadExtraSpriteData(this, &gUnk_08112674[this->entityType.form * 4])) {
|
if (LoadExtraSpriteData(this, &gUnk_08112674[this->type * 4])) {
|
||||||
this->action++;
|
this->action++;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
InitializeAnimation(this, 6);
|
InitializeAnimation(this, 6);
|
||||||
|
|
|
@ -58,9 +58,9 @@ void Townsperson(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08061BC8(Entity* this) {
|
void sub_08061BC8(Entity* this) {
|
||||||
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->entityType.form])) {
|
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->type])) {
|
||||||
this->animationState = 2;
|
this->animationState = 2;
|
||||||
this->field_0xf = this->entityType.form + 1;
|
this->field_0xf = this->type + 1;
|
||||||
this->action++;
|
this->action++;
|
||||||
sub_08061CB4(this, 2);
|
sub_08061CB4(this, 2);
|
||||||
}
|
}
|
||||||
|
@ -84,15 +84,14 @@ void sub_08061C00(Entity* this) {
|
||||||
sub_0806ED78(this);
|
sub_0806ED78(this);
|
||||||
if (this->interactType != 0) {
|
if (this->interactType != 0) {
|
||||||
this->interactType = 0;
|
this->interactType = 0;
|
||||||
TextboxNoOverlapFollow(this->entityType.parameter + 0xa01);
|
TextboxNoOverlapFollow(this->type2 + 0xa01);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NON_MATCHING
|
#if NON_MATCHING
|
||||||
void Townsperson_Head(Entity* this) {
|
void Townsperson_Head(Entity* this) {
|
||||||
SetExtraSpriteFrame(this, 0,
|
SetExtraSpriteFrame(this, 0, *(gUnk_0810B78C + (this->animIndex & 3)) + gUnk_0810B680[this->type].frame1);
|
||||||
*(gUnk_0810B78C + (this->animIndex & 3)) + gUnk_0810B680[this->entityType.form].frame1);
|
SetExtraSpriteFrame(this, 1, this->frameIndex + gUnk_0810B680[this->type].frame2);
|
||||||
SetExtraSpriteFrame(this, 1, this->frameIndex + gUnk_0810B680[this->entityType.form].frame2);
|
|
||||||
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
||||||
sub_0807000C(this);
|
sub_0807000C(this);
|
||||||
}
|
}
|
||||||
|
@ -110,14 +109,14 @@ void sub_08061CB4(Entity* this, u32 arg1) {
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
}
|
}
|
||||||
if (this->frameDuration == 0xff) {
|
if (this->frameDuration == 0xff) {
|
||||||
this->frameDuration = gUnk_0810B680[this->entityType.form].unk2;
|
this->frameDuration = gUnk_0810B680[this->type].unk2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08061CEC(Entity* this) {
|
void sub_08061CEC(Entity* this) {
|
||||||
u32 uVar2;
|
u32 uVar2;
|
||||||
|
|
||||||
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->entityType.form])) {
|
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->type])) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
this->animationState = this->actionDelay;
|
this->animationState = this->actionDelay;
|
||||||
|
@ -147,7 +146,7 @@ void sub_08061D64(Entity* this) {
|
||||||
sub_0807DDAC(this, NULL);
|
sub_0807DDAC(this, NULL);
|
||||||
sub_0807DDE4(this);
|
sub_0807DDE4(this);
|
||||||
if (this->frameDuration == 0xff) {
|
if (this->frameDuration == 0xff) {
|
||||||
this->frameDuration = gUnk_0810B680[this->entityType.form].unk2;
|
this->frameDuration = gUnk_0810B680[this->type].unk2;
|
||||||
}
|
}
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if (this->interactType != 0) {
|
if (this->interactType != 0) {
|
||||||
|
@ -177,7 +176,7 @@ void sub_08061E50(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08061E70(Entity* this) {
|
void sub_08061E70(Entity* this) {
|
||||||
if ((this->entityType).subtype == 6) {
|
if (this->id == 6) {
|
||||||
sub_08078784(this, this->field_0x68.HALF.LO);
|
sub_08078784(this, this->field_0x68.HALF.LO);
|
||||||
} else {
|
} else {
|
||||||
sub_08078778(this);
|
sub_08078778(this);
|
||||||
|
@ -215,7 +214,7 @@ void sub_08061E90(Entity* this, Entity* arg1) {
|
||||||
}
|
}
|
||||||
this->direction = (u8)animIndex;
|
this->direction = (u8)animIndex;
|
||||||
this->animationState = sub_0806F5B0(animIndex);
|
this->animationState = sub_0806F5B0(animIndex);
|
||||||
this->nonPlanarMovement = gUnk_0810B74A[this->entityType.form];
|
this->nonPlanarMovement = gUnk_0810B74A[this->type];
|
||||||
}
|
}
|
||||||
animIndex = (this->animationState >> 1) + 4;
|
animIndex = (this->animationState >> 1) + 4;
|
||||||
if (animIndex != this->animIndex) {
|
if (animIndex != this->animIndex) {
|
||||||
|
@ -274,7 +273,7 @@ void sub_08061FE4(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08061FF4(Entity* this) {
|
void sub_08061FF4(Entity* this) {
|
||||||
TextboxNoOverlap(gUnk_0810B790[this->entityType.form], this);
|
TextboxNoOverlap(gUnk_0810B790[this->type], this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806200C(Entity* this) {
|
void sub_0806200C(Entity* this) {
|
||||||
|
@ -296,12 +295,12 @@ void sub_0806200C(Entity* this) {
|
||||||
void sub_08062048(Entity* this) {
|
void sub_08062048(Entity* this) {
|
||||||
int iVar1;
|
int iVar1;
|
||||||
|
|
||||||
if ((this->entityType).subtype == 6) {
|
if (this->id == 6) {
|
||||||
iVar1 = gSave.unk8 - 2;
|
iVar1 = gSave.unk8 - 2;
|
||||||
if (iVar1 < 0) {
|
if (iVar1 < 0) {
|
||||||
iVar1 = 0;
|
iVar1 = 0;
|
||||||
}
|
}
|
||||||
ShowNPCDialogue(this, gUnk_0810B7C0 + this->entityType.form * 0x8 + iVar1);
|
ShowNPCDialogue(this, gUnk_0810B7C0 + this->type * 0x8 + iVar1);
|
||||||
} else {
|
} else {
|
||||||
TextboxNoOverlap(0, this);
|
TextboxNoOverlap(0, this);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +308,7 @@ void sub_08062048(Entity* this) {
|
||||||
|
|
||||||
void Townsperson_Fusion(Entity* this) {
|
void Townsperson_Fusion(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->entityType.form]) == 0) {
|
if (LoadExtraSpriteData(this, gUnk_0810B6EC[this->type]) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->action++;
|
this->action++;
|
||||||
|
|
|
@ -35,7 +35,7 @@ void WindTribespeople(Entity* this) {
|
||||||
void sub_0806C798(Entity* this) {
|
void sub_0806C798(Entity* this) {
|
||||||
s32 iVar1;
|
s32 iVar1;
|
||||||
|
|
||||||
iVar1 = LoadExtraSpriteData(this, gUnk_08113A1C + (this->entityType.form * 4));
|
iVar1 = LoadExtraSpriteData(this, gUnk_08113A1C + (this->type * 4));
|
||||||
if (iVar1 != 0) {
|
if (iVar1 != 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
|
@ -55,9 +55,8 @@ void sub_0806C7D4(Entity* this) {
|
||||||
sub_0806F118(this);
|
sub_0806F118(this);
|
||||||
} else {
|
} else {
|
||||||
sub_0807DD94(this, NULL);
|
sub_0807DD94(this, NULL);
|
||||||
if ((this->entityType.parameter == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) &&
|
if ((this->type2 == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) && (CheckRoomFlag(0))) {
|
||||||
(CheckRoomFlag(0))) {
|
this->type2 = 7;
|
||||||
(this->entityType).parameter = 7;
|
|
||||||
sub_0807DD80(this, &gUnk_08014A80);
|
sub_0807DD80(this, &gUnk_08014A80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +89,7 @@ void WindTribespeople_Head(Entity* this) {
|
||||||
u8 pbVar3;
|
u8 pbVar3;
|
||||||
|
|
||||||
pbVar3 = (this->frames.all & 0x3F);
|
pbVar3 = (this->frames.all & 0x3F);
|
||||||
if (this->entityType.form == 4) {
|
if (this->type == 4) {
|
||||||
SetExtraSpriteFrame(this, 0, 9);
|
SetExtraSpriteFrame(this, 0, 9);
|
||||||
SetExtraSpriteFrame(this, 1, pbVar3);
|
SetExtraSpriteFrame(this, 1, pbVar3);
|
||||||
SetExtraSpriteFrame(this, 2, this->frameIndex);
|
SetExtraSpriteFrame(this, 2, this->frameIndex);
|
||||||
|
@ -115,7 +114,7 @@ void WindTribespeople_Head(Entity* this) {
|
||||||
// body and head entities?
|
// body and head entities?
|
||||||
void sub_0806C90C(Entity* param_1, Entity* param_2) {
|
void sub_0806C90C(Entity* param_1, Entity* param_2) {
|
||||||
*(u32*)¶m_2->animationState = 0;
|
*(u32*)¶m_2->animationState = 0;
|
||||||
gUnk_08113A8C[param_1->entityType.parameter](param_1, param_2);
|
gUnk_08113A8C[param_1->type2](param_1, param_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0806C928(Entity* this) {
|
void sub_0806C928(Entity* this) {
|
||||||
|
|
388
src/object.c
388
src/object.c
|
@ -3,198 +3,198 @@
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
|
||||||
void (*const gObjectFunctions[])(Entity*) = {
|
void (*const gObjectFunctions[])(Entity*) = {
|
||||||
/*0x00*/ ItemOnGround,
|
[GROUND_ITEM] = ItemOnGround,
|
||||||
/*0x01*/ DeathFx,
|
[DEATH_FX] = DeathFx,
|
||||||
/*0x02*/ ItemForSale,
|
[SHOP_ITEM] = ItemForSale,
|
||||||
/*0x03*/ Button,
|
[BUTTON] = Button,
|
||||||
/*0x04*/ Object4,
|
[OBJECT_4] = Object4,
|
||||||
/*0x05*/ Pot,
|
[POT] = Pot,
|
||||||
/*0x06*/ Object6,
|
[OBJECT_6] = Object6,
|
||||||
/*0x07*/ BlockPushed,
|
[PUSHED_BLOCK] = BlockPushed,
|
||||||
/*0x08*/ LockedDoor,
|
[LOCKED_DOOR] = LockedDoor,
|
||||||
/*0x09*/ Object9,
|
[OBJECT_9] = Object9,
|
||||||
/*0x0a*/ ObjectA,
|
[OBJECT_A] = ObjectA,
|
||||||
/*0x0b*/ ObjectB,
|
[OBJECT_B] = ObjectB,
|
||||||
/*0x0c*/ ChestSpawner,
|
[CHEST_SPAWNER] = ChestSpawner,
|
||||||
/*0x0d*/ ObjectD,
|
[OBJECT_D] = ObjectD,
|
||||||
/*0x0e*/ ObjectE,
|
[OBJECT_E] = ObjectE,
|
||||||
/*0x0f*/ SpecialFx,
|
[SPECIAL_FX] = SpecialFx,
|
||||||
/*0x10*/ Object10,
|
[OBJECT_10] = Object10,
|
||||||
/*0x11*/ Object11,
|
[OBJECT_11] = Object11,
|
||||||
/*0x12*/ Object12,
|
[OBJECT_12] = Object12,
|
||||||
/*0x13*/ Railtrack,
|
[RAILTRACK] = Railtrack,
|
||||||
/*0x14*/ LilypadLarge,
|
[LILYPAD_LARGE] = LilypadLarge,
|
||||||
/*0x15*/ Object15,
|
[OBJECT_15] = Object15,
|
||||||
/*0x16*/ FloatingPlatform,
|
[FLOATING_PLATFORM] = FloatingPlatform,
|
||||||
/*0x17*/ Object17,
|
[OBJECT_17] = Object17,
|
||||||
/*0x18*/ EvilSpirit,
|
[EVIL_SPIRIT] = EvilSpirit,
|
||||||
/*0x19*/ HouseDoorExterior,
|
[HOUSE_DOOR_EXT] = HouseDoorExterior,
|
||||||
/*0x1a*/ Object1A,
|
[OBJECT_1A] = Object1A,
|
||||||
/*0x1b*/ GreatFairy,
|
[GREAT_FAIRY] = GreatFairy,
|
||||||
/*0x1c*/ Object1C,
|
[OBJECT_1C] = Object1C,
|
||||||
/*0x1d*/ Object1D,
|
[OBJECT_1D] = Object1D,
|
||||||
/*0x1e*/ Object1E,
|
[OBJECT_1E] = Object1E,
|
||||||
/*0x1f*/ Object1F,
|
[OBJECT_1F] = Object1F,
|
||||||
/*0x20*/ Object20,
|
[OBJECT_20] = Object20,
|
||||||
/*0x21*/ Object21,
|
[OBJECT_21] = Object21,
|
||||||
/*0x22*/ FigurineDevice,
|
[FIGURINE_DEVICE] = FigurineDevice,
|
||||||
/*0x23*/ EyeSwitch,
|
[EYE_SWITCH] = EyeSwitch,
|
||||||
/*0x24*/ Object24,
|
[OBJECT_24] = Object24,
|
||||||
/*0x25*/ BigBarrel,
|
[BIG_BARREL] = BigBarrel,
|
||||||
/*0x26*/ Object26,
|
[OBJECT_26] = Object26,
|
||||||
/*0x27*/ PushableStatue,
|
[PUSHABLE_STATUE] = PushableStatue,
|
||||||
/*0x28*/ Object28,
|
[OBJECT_28] = Object28,
|
||||||
/*0x29*/ Object29,
|
[OBJECT_29] = Object29,
|
||||||
/*0x2a*/ Object2A,
|
[OBJECT_2A] = Object2A,
|
||||||
/*0x2b*/ Object2B,
|
[OBJECT_2B] = Object2B,
|
||||||
/*0x2c*/ Beanstalk,
|
[BEANSTALK] = Beanstalk,
|
||||||
/*0x2d*/ Smoke,
|
[SMOKE] = Smoke,
|
||||||
/*0x2e*/ PushableRock,
|
[PUSHABLE_ROCK] = PushableRock,
|
||||||
/*0x2f*/ HittableLever,
|
[HITTABLE_LEVER] = HittableLever,
|
||||||
/*0x30*/ Object30,
|
[OBJECT_30] = Object30,
|
||||||
/*0x31*/ Object31,
|
[OBJECT_31] = Object31,
|
||||||
/*0x32*/ PullableMushroom,
|
[PULLABLE_MUSHROOM] = PullableMushroom,
|
||||||
/*0x33*/ Bollard,
|
[BOLLARD] = Bollard,
|
||||||
/*0x34*/ WarpPoint,
|
[WARP_POINT] = WarpPoint,
|
||||||
/*0x35*/ Object35,
|
[OBJECT_35] = Object35,
|
||||||
/*0x36*/ Object36,
|
[OBJECT_36] = Object36,
|
||||||
/*0x37*/ Object37,
|
[OBJECT_37] = Object37,
|
||||||
/*0x38*/ JarPortal,
|
[JAR_PORTAL] = JarPortal,
|
||||||
/*0x39*/ BossDoor,
|
[BOSS_DOOR] = BossDoor,
|
||||||
/*0x3a*/ Object3A,
|
[OBJECT_3A] = Object3A,
|
||||||
/*0x3b*/ MacroMushromStalks,
|
[PORTAL_MUSHROOM_STALKS] = MacroMushromStalks,
|
||||||
/*0x3c*/ MacroPlayer,
|
[PORTAL_FALLING_PLAYER] = MacroPlayer,
|
||||||
/*0x3d*/ Object3D,
|
[OBJECT_3D] = Object3D,
|
||||||
/*0x3e*/ Object3E,
|
[OBJECT_3E] = Object3E,
|
||||||
/*0x3f*/ GiantLeaf,
|
[GIANT_LEAF] = GiantLeaf,
|
||||||
/*0x40*/ Fairy,
|
[FAIRY] = Fairy,
|
||||||
/*0x41*/ LadderUp,
|
[LADDER_UP] = LadderUp,
|
||||||
/*0x42*/ Object42,
|
[OBJECT_42] = Object42,
|
||||||
/*0x43*/ Object43,
|
[OBJECT_43] = Object43,
|
||||||
/*0x44*/ Object44,
|
[OBJECT_44] = Object44,
|
||||||
/*0x45*/ Object45,
|
[OBJECT_45] = Object45,
|
||||||
/*0x46*/ GiantBookLadder,
|
[GIANT_BOOK_LADDER] = GiantBookLadder,
|
||||||
/*0x47*/ HeartContainer,
|
[HEART_CONTAINER] = HeartContainer,
|
||||||
/*0x48*/ FileScreenObjects,
|
[FILE_SCREEN_OBJECTS] = FileScreenObjects,
|
||||||
/*0x49*/ Object49,
|
[OBJECT_49] = Object49,
|
||||||
/*0x4a*/ BackgroundCloud,
|
[BACKGROUND_CLOUD] = BackgroundCloud,
|
||||||
/*0x4b*/ Object4B,
|
[OBJECT_4B] = Object4B,
|
||||||
/*0x4c*/ PushableFurniture,
|
[PUSHABLE_FURNITURE] = PushableFurniture,
|
||||||
/*0x4d*/ Furniture,
|
[FURNITURE] = Furniture,
|
||||||
/*0x4e*/ MinishSizedEntrance,
|
[MINISH_SIZED_ENTRANCE] = MinishSizedEntrance,
|
||||||
/*0x4f*/ Archway,
|
[ARCHWAY] = Archway,
|
||||||
/*0x50*/ GiantRock,
|
[GIANT_ROCK] = GiantRock,
|
||||||
/*0x51*/ Object51,
|
[OBJECT_51] = Object51,
|
||||||
/*0x52*/ Object52,
|
[OBJECT_52] = Object52,
|
||||||
/*0x53*/ Object53,
|
[OBJECT_53] = Object53,
|
||||||
/*0x54*/ PullableLever,
|
[PULLABLE_LEVER] = PullableLever,
|
||||||
/*0x55*/ Minecart,
|
[MINECART] = Minecart,
|
||||||
/*0x56*/ ThoughtBubble,
|
[THOUGHT_BUBBLE] = ThoughtBubble,
|
||||||
/*0x57*/ HiddenLadderDown,
|
[HIDDEN_LADDER_DOWN] = HiddenLadderDown,
|
||||||
/*0x58*/ GentariCurtain,
|
[GENTARI_CURTAIN] = GentariCurtain,
|
||||||
/*0x59*/ LavaPlatform,
|
[LAVA_PLATFORM] = LavaPlatform,
|
||||||
/*0x5a*/ Object5A,
|
[OBJECT_5A] = Object5A,
|
||||||
/*0x5b*/ Object5B,
|
[OBJECT_5B] = Object5B,
|
||||||
/*0x5c*/ Mask,
|
[MASK] = Mask,
|
||||||
/*0x5d*/ HouseDoorInterior,
|
[HOUSE_DOOR_INT] = HouseDoorInterior,
|
||||||
/*0x5e*/ Whirlwind,
|
[WHIRLWIND] = Whirlwind,
|
||||||
/*0x5f*/ ObjectBlockingStairs,
|
[OBJECT_BLOCKING_STAIRS] = ObjectBlockingStairs,
|
||||||
/*0x60*/ SwordsmanNewsletter,
|
[SWORDSMAN_NEWSLETTER] = SwordsmanNewsletter,
|
||||||
/*0x61*/ Object61,
|
[OBJECT_61] = Object61,
|
||||||
/*0x62*/ GiantTwig,
|
[GIANT_TWIG] = GiantTwig,
|
||||||
/*0x63*/ Object63,
|
[OBJECT_63] = Object63,
|
||||||
/*0x64*/ Object64,
|
[OBJECT_64] = Object64,
|
||||||
/*0x65*/ LadderHoleInBookshelf,
|
[LADDER_HOLE] = LadderHoleInBookshelf,
|
||||||
/*0x66*/ Object66,
|
[OBJECT_66] = Object66,
|
||||||
/*0x67*/ Object67,
|
[OBJECT_67] = Object67,
|
||||||
/*0x68*/ Object68,
|
[OBJECT_68] = Object68,
|
||||||
/*0x69*/ Object69,
|
[OBJECT_69] = Object69,
|
||||||
/*0x6a*/ Object6A,
|
[OBJECT_6A] = Object6A,
|
||||||
/*0x6b*/ CrenalBeanSprout,
|
[CRENAL_BEAN_SPROUT] = CrenalBeanSprout,
|
||||||
/*0x6c*/ MinecartDoor,
|
[MINECART_DOOR] = MinecartDoor,
|
||||||
/*0x6d*/ ObjectOnPillar,
|
[OBJECT_ON_PILLAR] = ObjectOnPillar,
|
||||||
/*0x6e*/ MineralWaterSource,
|
[MINERAL_WATER_SOURCE] = MineralWaterSource,
|
||||||
/*0x6f*/ MinishSizedArchway,
|
[MINISH_SIZED_ARCHWAY] = MinishSizedArchway,
|
||||||
/*0x70*/ Object70,
|
[OBJECT_70] = Object70,
|
||||||
/*0x71*/ PushableGrave,
|
[PUSHABLE_GRAVE] = PushableGrave,
|
||||||
/*0x72*/ Object72,
|
[OBJECT_72] = Object72,
|
||||||
/*0x73*/ LilypadSmall,
|
[LILYPAD_SMALL] = LilypadSmall,
|
||||||
/*0x74*/ Object74,
|
[OBJECT_74] = Object74,
|
||||||
/*0x75*/ Object75,
|
[OBJECT_75] = Object75,
|
||||||
/*0x76*/ Object76,
|
[OBJECT_76] = Object76,
|
||||||
/*0x77*/ Bell,
|
[BELL] = Bell,
|
||||||
/*0x78*/ MacroDecoration,
|
[HUGE_DECORATION] = MacroDecoration,
|
||||||
/*0x79*/ Object79,
|
[OBJECT_79] = Object79,
|
||||||
/*0x7a*/ Steam,
|
[STEAM] = Steam,
|
||||||
/*0x7b*/ PushableLever,
|
[PUSHABLE_LEVER] = PushableLever,
|
||||||
/*0x7c*/ MacroShoes,
|
[HUGE_SHOES] = MacroShoes,
|
||||||
/*0x7d*/ ObjectOnSpinyBeetle,
|
[OBJECT_ON_BEETLE] = ObjectOnSpinyBeetle,
|
||||||
/*0x7e*/ Object7E,
|
[OBJECT_7E] = Object7E,
|
||||||
/*0x7f*/ PicoBloom,
|
[PICO_BLOOM] = PicoBloom,
|
||||||
/*0x80*/ Object80,
|
[OBJECT_80] = Object80,
|
||||||
/*0x81*/ Object81,
|
[OBJECT_81] = Object81,
|
||||||
/*0x82*/ BigVortex,
|
[BIG_VORTEX] = BigVortex,
|
||||||
/*0x83*/ BigPushableLever,
|
[BIG_PUSHABLE_LEVER] = BigPushableLever,
|
||||||
/*0x84*/ SmallIceBlock,
|
[SMALL_ICE_BLOCK] = SmallIceBlock,
|
||||||
/*0x85*/ BigIceBlock,
|
[BIG_ICE_BLOCK] = BigIceBlock,
|
||||||
/*0x86*/ Object86,
|
[OBJECT_86] = Object86,
|
||||||
/*0x87*/ Object87,
|
[OBJECT_87] = Object87,
|
||||||
/*0x88*/ MacroBook,
|
[HUGE_BOOK] = MacroBook,
|
||||||
/*0x89*/ Object89,
|
[OBJECT_89] = Object89,
|
||||||
/*0x8a*/ Object8A,
|
[OBJECT_8A] = Object8A,
|
||||||
/*0x8b*/ Object8B,
|
[OBJECT_8B] = Object8B,
|
||||||
/*0x8c*/ Book,
|
[BOOK] = Book,
|
||||||
/*0x8d*/ Fireplace,
|
[FIREPLACE] = Fireplace,
|
||||||
/*0x8e*/ Object8E,
|
[OBJECT_8E] = Object8E,
|
||||||
/*0x8f*/ FrozenWaterElement,
|
[FROZEN_WATER_ELEMENT] = FrozenWaterElement,
|
||||||
/*0x90*/ Object90,
|
[OBJECT_90] = Object90,
|
||||||
/*0x91*/ Object91,
|
[OBJECT_91] = Object91,
|
||||||
/*0x92*/ BakerOven,
|
[BAKER_OVEN] = BakerOven,
|
||||||
/*0x93*/ Object93,
|
[OBJECT_93] = Object93,
|
||||||
/*0x94*/ WindTribeFlag,
|
[WIND_TRIBE_FLAG] = WindTribeFlag,
|
||||||
/*0x95*/ Bird,
|
[BIRD] = Bird,
|
||||||
/*0x96*/ Object96,
|
[OBJECT_96] = Object96,
|
||||||
/*0x97*/ Object97,
|
[OBJECT_97] = Object97,
|
||||||
/*0x98*/ Object98,
|
[OBJECT_98] = Object98,
|
||||||
/*0x99*/ Object99,
|
[OBJECT_99] = Object99,
|
||||||
/*0x9a*/ MacroAcorn,
|
[HUGE_ACORN] = MacroAcorn,
|
||||||
/*0x9b*/ Object9B,
|
[OBJECT_9B] = Object9B,
|
||||||
/*0x9c*/ TreeHidingPortal,
|
[TREE_HIDING_PORTAL] = TreeHidingPortal,
|
||||||
/*0x9d*/ LightableSwitch,
|
[LIGHTABLE_SWITCH] = LightableSwitch,
|
||||||
/*0x9e*/ Object9E,
|
[OBJECT_9E] = Object9E,
|
||||||
/*0x9f*/ Fan,
|
[FAN] = Fan,
|
||||||
/*0xa0*/ ObjectA0,
|
[OBJECT_A0] = ObjectA0,
|
||||||
/*0xa1*/ PalaceArchway,
|
[PALACE_ARCHWAY] = PalaceArchway,
|
||||||
/*0xa2*/ ObjectA2,
|
[OBJECT_A2] = ObjectA2,
|
||||||
/*0xa3*/ Cloud,
|
[CLOUD] = Cloud,
|
||||||
/*0xa4*/ MinishLight,
|
[MINISH_LIGHT] = MinishLight,
|
||||||
/*0xa5*/ ObjectA5,
|
[OBJECT_A5] = ObjectA5,
|
||||||
/*0xa6*/ ObjectA6,
|
[OBJECT_A6] = ObjectA6,
|
||||||
/*0xa7*/ ObjectA7,
|
[OBJECT_A7] = ObjectA7,
|
||||||
/*0xa8*/ ObjectA8,
|
[OBJECT_A8] = ObjectA8,
|
||||||
/*0xa9*/ ObjectA9,
|
[OBJECT_A9] = ObjectA9,
|
||||||
/*0xaa*/ WaterfallOpening,
|
[WATERFALL_OPENING] = WaterfallOpening,
|
||||||
/*0xab*/ ObjectAB,
|
[OBJECT_AB] = ObjectAB,
|
||||||
/*0xac*/ FourElements,
|
[FOUR_ELEMENTS] = FourElements,
|
||||||
/*0xad*/ ObjectAD,
|
[OBJECT_AD] = ObjectAD,
|
||||||
/*0xae*/ FloatingBlock,
|
[FLOATING_BLOCK] = FloatingBlock,
|
||||||
/*0xaf*/ ObjectAF,
|
[OBJECT_AF] = ObjectAF,
|
||||||
/*0xb0*/ MetalDoor,
|
[METAL_DOOR] = MetalDoor,
|
||||||
/*0xb1*/ JailBars,
|
[JAIL_BARS] = JailBars,
|
||||||
/*0xb2*/ ObjectB2,
|
[OBJECT_B2] = ObjectB2,
|
||||||
/*0xb3*/ ObjectB3,
|
[OBJECT_B3] = ObjectB3,
|
||||||
/*0xb4*/ ObjectB4,
|
[OBJECT_B4] = ObjectB4,
|
||||||
/*0xb5*/ ObjectB5,
|
[OBJECT_B5] = ObjectB5,
|
||||||
/*0xb6*/ ObjectB6,
|
[OBJECT_B6] = ObjectB6,
|
||||||
/*0xb7*/ Well,
|
[WELL] = Well,
|
||||||
/*0xb8*/ WindTribeTeleporter,
|
[WIND_TRIBE_TELEPORTER] = WindTribeTeleporter,
|
||||||
/*0xb9*/ ObjectB9,
|
[OBJECT_B9] = ObjectB9,
|
||||||
/*0xba*/ ObjectBA,
|
[OBJECT_BA] = ObjectBA,
|
||||||
/*0xbb*/ Windcrest,
|
[WINDCREST] = Windcrest,
|
||||||
/*0xbc*/ LitArea,
|
[LIT_AREA] = LitArea,
|
||||||
/*0xbd*/ ObjectBD,
|
[OBJECT_BD] = ObjectBD,
|
||||||
/*0xbe*/ Pinwheel,
|
[PINWHEEL] = Pinwheel,
|
||||||
/*0xbf*/ ObjectBF,
|
[OBJECT_BF] = ObjectBF,
|
||||||
/*0xc0*/ EnemyItem,
|
[ENEMY_ITEM] = EnemyItem,
|
||||||
/*0xc1*/ ObjectC1
|
[OBJECT_C1] = ObjectC1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ void Archway(Entity* this) {
|
||||||
v1 = v1 - 0x5;
|
v1 = v1 - 0x5;
|
||||||
v1 = v1 & v2;
|
v1 = v1 & v2;
|
||||||
this->spriteSettings.raw = v1 | 1;
|
this->spriteSettings.raw = v1 | 1;
|
||||||
this->frameIndex = this->entityType.parameter;
|
this->frameIndex = this->type2;
|
||||||
this->collisionLayer = 2;
|
this->collisionLayer = 2;
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
v3 = CheckIsDungeon();
|
v3 = CheckIsDungeon();
|
||||||
|
|
|
@ -15,10 +15,10 @@ void sub_0808F658(Entity* this) {
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
this->spriteOrientation.flipY = 3;
|
this->spriteOrientation.flipY = 3;
|
||||||
this->spriteRendering.b3 = 3;
|
this->spriteRendering.b3 = 3;
|
||||||
this->spritePriority.b0 = this->entityType.form;
|
this->spritePriority.b0 = this->type;
|
||||||
this->frameIndex = this->entityType.form;
|
this->frameIndex = this->type;
|
||||||
this->direction = 8;
|
this->direction = 8;
|
||||||
this->nonPlanarMovement = gUnk_08121EB0[(this->entityType).form];
|
this->nonPlanarMovement = gUnk_08121EB0[this->type];
|
||||||
this->field_0x78.HWORD = gRoomControls.roomOriginX - 0x60;
|
this->field_0x78.HWORD = gRoomControls.roomOriginX - 0x60;
|
||||||
this->field_0x7a.HWORD = gRoomControls.roomOriginX + gRoomControls.width + 0x60;
|
this->field_0x7a.HWORD = gRoomControls.roomOriginX + gRoomControls.width + 0x60;
|
||||||
this->animationState = 0;
|
this->animationState = 0;
|
||||||
|
@ -45,8 +45,8 @@ void sub_0808F70C(Entity* this) {
|
||||||
this->x.HALF.HI = this->field_0x78.HWORD;
|
this->x.HALF.HI = this->field_0x78.HWORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.form == 2)
|
if (this->type == 2)
|
||||||
this->y.HALF.HI = gUnk_08121EB3[this->entityType.parameter * 2 + (Random() & 1)];
|
this->y.HALF.HI = gUnk_08121EB3[this->type2 * 2 + (Random() & 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->previousActionFlag == 1) {
|
if (this->previousActionFlag == 1) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ void sub_0809CC74(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
|
|
||||||
if (this->entityType.form == 0) {
|
if (this->type == 0) {
|
||||||
this->spritePriority.b0 = 5;
|
this->spritePriority.b0 = 5;
|
||||||
/* Create steam clouds */
|
/* Create steam clouds */
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
@ -31,12 +31,12 @@ void sub_0809CC74(Entity* this) {
|
||||||
}
|
}
|
||||||
sub_0809CDF0(this);
|
sub_0809CDF0(this);
|
||||||
} else {
|
} else {
|
||||||
if (this->entityType.parameter & 1) {
|
if (this->type2 & 1) {
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
this->actionDelay = 20;
|
this->actionDelay = 20;
|
||||||
} else {
|
} else {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->actionDelay = (this->entityType.parameter & 2) ? 20 : 18;
|
this->actionDelay = (this->type2 & 2) ? 20 : 18;
|
||||||
}
|
}
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ void sub_0809CC74(Entity* this) {
|
||||||
void sub_0809CD0C(Entity* this) {
|
void sub_0809CD0C(Entity* this) {
|
||||||
u8* frames;
|
u8* frames;
|
||||||
|
|
||||||
if (this->entityType.form) {
|
if (this->type) {
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
frames = &this->frames.all;
|
frames = &this->frames.all;
|
||||||
if (*frames & 1) {
|
if (*frames & 1) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ extern void (*const gUnk_0812367C[])(Entity*);
|
||||||
extern u16 gUnk_08123690[];
|
extern u16 gUnk_08123690[];
|
||||||
|
|
||||||
void BigVortex(Entity* this) {
|
void BigVortex(Entity* this) {
|
||||||
if ((this->entityType).form == 0) {
|
if (this->type == 0) {
|
||||||
gUnk_0812367C[this->action](this);
|
gUnk_0812367C[this->action](this);
|
||||||
} else {
|
} else {
|
||||||
sub_08098E3C(this);
|
sub_08098E3C(this);
|
||||||
|
@ -67,9 +67,9 @@ void sub_08098DC4(Entity* this) {
|
||||||
ResolveEntityOnTop(this, &gPlayerEntity);
|
ResolveEntityOnTop(this, &gPlayerEntity);
|
||||||
gPlayerState.playerAction = 0x1f;
|
gPlayerState.playerAction = 0x1f;
|
||||||
gPlayerState.field_0x34[4] = 1;
|
gPlayerState.field_0x34[4] = 1;
|
||||||
gPlayerState.field_0x34[5] = this->entityType.parameter;
|
gPlayerState.field_0x34[5] = this->type2;
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
if (this->entityType.parameter == 1) {
|
if (this->type2 == 1) {
|
||||||
SetGlobalFlag(0x23);
|
SetGlobalFlag(0x23);
|
||||||
}
|
}
|
||||||
sub_08077B20();
|
sub_08077B20();
|
||||||
|
@ -87,9 +87,9 @@ void sub_08098E3C(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
InitAnimationForceUpdate(this, this->entityType.form);
|
InitAnimationForceUpdate(this, this->type);
|
||||||
}
|
}
|
||||||
temp = &gUnk_08123690[this->entityType.form & 2];
|
temp = &gUnk_08123690[this->type & 2];
|
||||||
sub_0805EC9C(this, temp[0], temp[1], 0);
|
sub_0805EC9C(this, temp[0], temp[1], 0);
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ extern void (*const gUnk_08123EFC[])(Entity*);
|
||||||
extern void (*const gUnk_08123F04[])(Entity*);
|
extern void (*const gUnk_08123F04[])(Entity*);
|
||||||
|
|
||||||
void Bird(Entity* this) {
|
void Bird(Entity* this) {
|
||||||
gUnk_08123EC0[this->entityType.form](this);
|
gUnk_08123EC0[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809CF3C(Entity* this) {
|
void sub_0809CF3C(Entity* this) {
|
||||||
|
@ -90,7 +90,7 @@ void sub_0809D0AC(Entity* this) {
|
||||||
Entity* fx;
|
Entity* fx;
|
||||||
|
|
||||||
if (sub_080044EC(this, 0x1800) < 2) {
|
if (sub_080044EC(this, 0x1800) < 2) {
|
||||||
(this->entityType).form = 2;
|
this->type = 2;
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->height.WORD = 0;
|
this->height.WORD = 0;
|
||||||
this->collisionLayer = 1;
|
this->collisionLayer = 1;
|
||||||
|
|
|
@ -22,7 +22,7 @@ void sub_08081AE0(Entity* this) {
|
||||||
this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
|
this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
|
||||||
((((this->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6);
|
((((this->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6);
|
||||||
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
|
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
|
||||||
if (this->entityType.form == 0 && CheckFlags(this->field_0x86.HWORD)) {
|
if (this->type == 0 && CheckFlags(this->field_0x86.HWORD)) {
|
||||||
this->action = 5;
|
this->action = 5;
|
||||||
SetTileType(0x7A, this->field_0x74.HWORD, this->collisionLayer);
|
SetTileType(0x7A, this->field_0x74.HWORD, this->collisionLayer);
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,7 +51,7 @@ void sub_08081BAC(Entity* this) {
|
||||||
this->actionDelay = 0xA;
|
this->actionDelay = 0xA;
|
||||||
sub_0805E4E0(this, 0xA);
|
sub_0805E4E0(this, 0xA);
|
||||||
sub_08081FF8(this);
|
sub_08081FF8(this);
|
||||||
if (this->entityType.form == 1) {
|
if (this->type == 1) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
} else {
|
} else {
|
||||||
this->action = 5;
|
this->action = 5;
|
||||||
|
@ -211,7 +211,7 @@ void sub_08081E6C(Entity* this) {
|
||||||
if (tile < 0x4000)
|
if (tile < 0x4000)
|
||||||
return;
|
return;
|
||||||
r1 = GetLayerByIndex(r5);
|
r1 = GetLayerByIndex(r5);
|
||||||
r4 = (this->entityType.form == 0 ? 0x7a : 0x78);
|
r4 = (this->type == 0 ? 0x7a : 0x78);
|
||||||
tmp = r1 + 0x3802;
|
tmp = r1 + 0x3802;
|
||||||
r1 += 0x3002 + r4;
|
r1 += 0x3002 + r4;
|
||||||
tmp = tmp + (*r1 << 2);
|
tmp = tmp + (*r1 << 2);
|
||||||
|
|
|
@ -12,7 +12,7 @@ extern void (*const gUnk_0811F818[])(Entity*);
|
||||||
|
|
||||||
extern u32 gUnk_0811F8B0;
|
extern u32 gUnk_0811F8B0;
|
||||||
void ChestSpawner(Entity* this) {
|
void ChestSpawner(Entity* this) {
|
||||||
gUnk_0811F7E8[this->entityType.form](this);
|
gUnk_0811F7E8[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08083DF0(Entity* this) {
|
void sub_08083DF0(Entity* this) {
|
||||||
|
|
|
@ -31,11 +31,11 @@ extern u16 gUnk_081247C8[];
|
||||||
extern u32 gUnk_081247D0;
|
extern u32 gUnk_081247D0;
|
||||||
|
|
||||||
void Cloud(Entity* this) {
|
void Cloud(Entity* this) {
|
||||||
gUnk_08124798[(this->entityType).form](this);
|
gUnk_08124798[this->type](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809F4DC(Entity* this) {
|
void sub_0809F4DC(Entity* this) {
|
||||||
if ((this->entityType).parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
gUnk_081247A0[this->action](this);
|
gUnk_081247A0[this->action](this);
|
||||||
} else {
|
} else {
|
||||||
gUnk_081247AC[this->action](this);
|
gUnk_081247AC[this->action](this);
|
||||||
|
@ -100,7 +100,7 @@ void sub_0809F61C(Entity* this) {
|
||||||
|
|
||||||
if ((gRoomControls.unk6 & 4) == 0) {
|
if ((gRoomControls.unk6 & 4) == 0) {
|
||||||
if (this->actionDelay == 30) {
|
if (this->actionDelay == 30) {
|
||||||
SetLocalFlag(this->entityType.parameter);
|
SetLocalFlag(this->type2);
|
||||||
}
|
}
|
||||||
if (--this->actionDelay == 0) {
|
if (--this->actionDelay == 0) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
|
|
|
@ -16,10 +16,10 @@ void Fan(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809ED30(Entity* this) {
|
void sub_0809ED30(Entity* this) {
|
||||||
this->direction = (this->entityType.form ^ 2) << 3;
|
this->direction = (this->type ^ 2) << 3;
|
||||||
sub_0809EE34(this);
|
sub_0809EE34(this);
|
||||||
sub_0809EFB0(this);
|
sub_0809EFB0(this);
|
||||||
InitializeAnimation(this, this->entityType.form);
|
InitializeAnimation(this, this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809ED54(Entity* this) {
|
void sub_0809ED54(Entity* this) {
|
||||||
|
@ -27,7 +27,7 @@ void sub_0809ED54(Entity* this) {
|
||||||
u32 iVar2;
|
u32 iVar2;
|
||||||
|
|
||||||
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
|
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
|
||||||
((this->entityType.parameter != 1 || (--this->field_0x74.HWORD == 0)))) {
|
((this->type2 != 1 || (--this->field_0x74.HWORD == 0)))) {
|
||||||
sub_0809EE08(this);
|
sub_0809EE08(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ void sub_0809ED88(Entity* this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sub_0809EE24(this);
|
sub_0809EE24(this);
|
||||||
} else if (((this->entityType).parameter == 1) && (--this->field_0x74.HWORD == 0)) {
|
} else if ((this->type2 == 1) && (--this->field_0x74.HWORD == 0)) {
|
||||||
sub_0809EE24(this);
|
sub_0809EE24(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,12 +60,12 @@ void sub_0809EDE4(Entity* this) {
|
||||||
void sub_0809EE08(Entity* this) {
|
void sub_0809EE08(Entity* this) {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->field_0x74.HWORD = *((u8*)&this->field_0x7c + 3) << 2;
|
this->field_0x74.HWORD = *((u8*)&this->field_0x7c + 3) << 2;
|
||||||
InitializeAnimation(this, this->entityType.form);
|
InitializeAnimation(this, this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809EE24(Entity* this) {
|
void sub_0809EE24(Entity* this) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
InitializeAnimation(this, this->entityType.form + 4);
|
InitializeAnimation(this, this->type + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0809EE34(Entity* this) {
|
void sub_0809EE34(Entity* this) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ void FileScreenObjects(Entity* this) {
|
||||||
if (this->currentHealth == 0) {
|
if (this->currentHealth == 0) {
|
||||||
sub_0808EFF0(this);
|
sub_0808EFF0(this);
|
||||||
}
|
}
|
||||||
gUnk_08121C64[this->entityType.form](this);
|
gUnk_08121C64[this->type](this);
|
||||||
if (this->animIndex < 64) {
|
if (this->animIndex < 64) {
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ void sub_0808E7F0(Entity* this) {
|
||||||
sub_080AE008(this, 1, 2);
|
sub_080AE008(this, 1, 2);
|
||||||
this->palette.b.b0 = 0xF;
|
this->palette.b.b0 = 0xF;
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
this->entityType.parameter = 0xFF;
|
this->type2 = 0xFF;
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,15 +75,15 @@ void sub_0808E818(Entity* this) {
|
||||||
|
|
||||||
if (!sub_0808E950()) {
|
if (!sub_0808E950()) {
|
||||||
int var2 = -1;
|
int var2 = -1;
|
||||||
this->entityType.parameter = var2;
|
this->type2 = var2;
|
||||||
this->field_0x68.HWORD = var2;
|
this->field_0x68.HWORD = var2;
|
||||||
this->field_0x6a.HWORD = var2;
|
this->field_0x6a.HWORD = var2;
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.parameter != gUnk_02019EE0.unk6) {
|
if (this->type2 != gUnk_02019EE0.unk6) {
|
||||||
this->entityType.parameter = gUnk_02019EE0.unk6;
|
this->type2 = gUnk_02019EE0.unk6;
|
||||||
this->field_0x68.HWORD = CheckGlobalFlag(EZERO_1ST) == 0 ? 0x400 : 0x100;
|
this->field_0x68.HWORD = CheckGlobalFlag(EZERO_1ST) == 0 ? 0x400 : 0x100;
|
||||||
this->field_0x70.BYTES.byte0 = 4;
|
this->field_0x70.BYTES.byte0 = 4;
|
||||||
this->animationState = 2;
|
this->animationState = 2;
|
||||||
|
@ -142,7 +142,7 @@ void sub_0808E988(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->spriteIndex = 0x142;
|
this->spriteIndex = 0x142;
|
||||||
this->entityType.parameter = 0xFF;
|
this->type2 = 0xFF;
|
||||||
sub_080AE008(this, 1, 3);
|
sub_080AE008(this, 1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ void sub_0808E988(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
if (this->entityType.parameter != i) {
|
if (this->type2 != i) {
|
||||||
InitAnimationForceUpdate(this, i);
|
InitAnimationForceUpdate(this, i);
|
||||||
}
|
}
|
||||||
this->spriteSettings.b.draw = 2;
|
this->spriteSettings.b.draw = 2;
|
||||||
|
@ -178,7 +178,7 @@ void sub_0808EA28(Entity* this) {
|
||||||
u32 var0;
|
u32 var0;
|
||||||
u32 var1;
|
u32 var1;
|
||||||
|
|
||||||
if (this->entityType.form == 3) {
|
if (this->type == 3) {
|
||||||
if (gUnk_02000000->gameLanguage > LANGUAGE_EN) {
|
if (gUnk_02000000->gameLanguage > LANGUAGE_EN) {
|
||||||
this->spriteSettings.b.draw = 2;
|
this->spriteSettings.b.draw = 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -186,11 +186,11 @@ void sub_0808EA28(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.form == gUnk_02019EE0.unk6) {
|
if (this->type == gUnk_02019EE0.unk6) {
|
||||||
var0 = 12;
|
var0 = 12;
|
||||||
var1 = 1;
|
var1 = 1;
|
||||||
} else {
|
} else {
|
||||||
if (gUnk_02032EC0.lastState == 5 && this->entityType.form == gUnk_02019EE0.unk7) {
|
if (gUnk_02032EC0.lastState == 5 && this->type == gUnk_02019EE0.unk7) {
|
||||||
var0 = 13;
|
var0 = 13;
|
||||||
var1 = 2;
|
var1 = 2;
|
||||||
} else {
|
} else {
|
||||||
|
@ -207,8 +207,8 @@ void sub_0808EA28(Entity* this) {
|
||||||
|
|
||||||
void sub_0808EABC(Entity* this) {
|
void sub_0808EABC(Entity* this) {
|
||||||
int var0 = -72;
|
int var0 = -72;
|
||||||
int var1 = this->entityType.form * 32 + 40;
|
int var1 = this->type * 32 + 40;
|
||||||
int var2 = gUnk_02019EE0.unk6 == this->entityType.form;
|
int var2 = gUnk_02019EE0.unk6 == this->type;
|
||||||
switch (gUnk_02032EC0.lastState) {
|
switch (gUnk_02032EC0.lastState) {
|
||||||
case 0:
|
case 0:
|
||||||
var0 = 24;
|
var0 = 24;
|
||||||
|
@ -223,7 +223,7 @@ void sub_0808EABC(Entity* this) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
switch (gMenu.focusCoords[this->entityType.form]) {
|
switch (gMenu.focusCoords[this->type]) {
|
||||||
case 0:
|
case 0:
|
||||||
var0 = 42;
|
var0 = 42;
|
||||||
var1 = 40;
|
var1 = 40;
|
||||||
|
@ -232,7 +232,7 @@ void sub_0808EABC(Entity* this) {
|
||||||
case 2:
|
case 2:
|
||||||
var0 = 20;
|
var0 = 20;
|
||||||
var1 = 144;
|
var1 = 144;
|
||||||
var1 -= (gMenu.unk16 - gMenu.focusCoords[this->entityType.form]) * 32;
|
var1 -= (gMenu.unk16 - gMenu.focusCoords[this->type]) * 32;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -326,8 +326,7 @@ static Entity* sub_0808EC80(int form) {
|
||||||
Entity* entityA = (Entity*)&gUnk_03003DA0;
|
Entity* entityA = (Entity*)&gUnk_03003DA0;
|
||||||
Entity* entityB = entityA->next;
|
Entity* entityB = entityA->next;
|
||||||
while (entityB != entityA) {
|
while (entityB != entityA) {
|
||||||
if ((entityB->entityType.type == 0x6 && entityB->entityType.subtype == 0x48) &&
|
if ((entityB->kind == 0x6 && entityB->id == 0x48) && form == entityB->type) {
|
||||||
form == entityB->entityType.form) {
|
|
||||||
return entityB;
|
return entityB;
|
||||||
}
|
}
|
||||||
entityB = entityB->next;
|
entityB = entityB->next;
|
||||||
|
@ -361,7 +360,7 @@ void sub_0808ECBC(Entity* this) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var2 = this->entityType.form - 4;
|
var2 = this->type - 4;
|
||||||
var3 = &gUnk_08121CD4[var1][var2];
|
var3 = &gUnk_08121CD4[var1][var2];
|
||||||
this->field_0x68.HWORD = var3->unk1;
|
this->field_0x68.HWORD = var3->unk1;
|
||||||
this->field_0x6a.HWORD = var3->unk2;
|
this->field_0x6a.HWORD = var3->unk2;
|
||||||
|
@ -408,7 +407,7 @@ void sub_0808EE00(Entity* this) {
|
||||||
int var0, var1, var2;
|
int var0, var1, var2;
|
||||||
|
|
||||||
var0 = ((struct_02000000*)0x2000000)->gameLanguage != 0;
|
var0 = ((struct_02000000*)0x2000000)->gameLanguage != 0;
|
||||||
var1 = this->entityType.form - 10;
|
var1 = this->type - 10;
|
||||||
this->frameIndex = gUnk_08121D38[var0][var1];
|
this->frameIndex = gUnk_08121D38[var0][var1];
|
||||||
this->x.HALF.HI = gUnk_08121D18[var0][var1];
|
this->x.HALF.HI = gUnk_08121D18[var0][var1];
|
||||||
this->field_0x68.HWORD = gUnk_08121D18[var0][var1];
|
this->field_0x68.HWORD = gUnk_08121D18[var0][var1];
|
||||||
|
@ -445,7 +444,7 @@ void sub_0808EED8(Entity* this) {
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
} else {
|
} else {
|
||||||
this->spriteSettings.b.draw = 2;
|
this->spriteSettings.b.draw = 2;
|
||||||
var0 = this->entityType.form - 19;
|
var0 = this->type - 19;
|
||||||
this->palette.b.b0 = gMenu.column_idx == var0 ? 4 : 3;
|
this->palette.b.b0 = gMenu.column_idx == var0 ? 4 : 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -456,7 +455,7 @@ void sub_0808EF24(Entity* this) {
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
} else {
|
} else {
|
||||||
this->spriteSettings.b.draw = 2;
|
this->spriteSettings.b.draw = 2;
|
||||||
if (this->entityType.form == 21) {
|
if (this->type == 21) {
|
||||||
var0 = ((struct_02000000*)0x2000000)->messageSpeed;
|
var0 = ((struct_02000000*)0x2000000)->messageSpeed;
|
||||||
} else {
|
} else {
|
||||||
var0 = ((struct_02000000*)0x2000000)->brightnessPref;
|
var0 = ((struct_02000000*)0x2000000)->brightnessPref;
|
||||||
|
@ -522,7 +521,7 @@ static void sub_0808EFF0(Entity* this) {
|
||||||
this->currentHealth = 1;
|
this->currentHealth = 1;
|
||||||
this->frameIndex = 0xFF;
|
this->frameIndex = 0xFF;
|
||||||
this->animIndex = 0xFF;
|
this->animIndex = 0xFF;
|
||||||
var0 = &gUnk_08121D54[this->entityType.form];
|
var0 = &gUnk_08121D54[this->type];
|
||||||
this->x.HALF.HI = var0->unk2;
|
this->x.HALF.HI = var0->unk2;
|
||||||
this->field_0x68.HWORD = var0->unk2;
|
this->field_0x68.HWORD = var0->unk2;
|
||||||
this->y.HALF.HI = var0->unk4;
|
this->y.HALF.HI = var0->unk4;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
void FloatingBlock(Entity* this) {
|
void FloatingBlock(Entity* this) {
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->frameIndex = this->entityType.form;
|
this->frameIndex = this->type;
|
||||||
this->spritePriority.b0 = 0xe;
|
this->spritePriority.b0 = 0xe;
|
||||||
this->collisionLayer = 1;
|
this->collisionLayer = 1;
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
|
|
|
@ -15,7 +15,7 @@ void GiantLeaf(Entity* ent) {
|
||||||
ent->spriteSettings.b.draw = 1;
|
ent->spriteSettings.b.draw = 1;
|
||||||
ent->spriteRendering.b3 = 3;
|
ent->spriteRendering.b3 = 3;
|
||||||
ent->spritePriority.b0 = 7;
|
ent->spritePriority.b0 = 7;
|
||||||
ent->frameIndex = ent->entityType.form;
|
ent->frameIndex = ent->type;
|
||||||
sub_0808D618(ent);
|
sub_0808D618(ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ void sub_0808D618(Entity* ent) {
|
||||||
s16* arr;
|
s16* arr;
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
arr = (ent->entityType.form != 0) ? gUnk_0812176A : gUnk_08121750;
|
arr = (ent->type != 0) ? gUnk_0812176A : gUnk_08121750;
|
||||||
tilePos = (((ent->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
|
tilePos = (((ent->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
|
||||||
((((ent->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) * 64);
|
((((ent->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) * 64);
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@ void GreatFairy(Entity* this) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
|
|
||||||
if (this->action == 0) {
|
if (this->action == 0) {
|
||||||
bVar1 = __modsi3(this->entityType.form, 11);
|
bVar1 = __modsi3(this->type, 11);
|
||||||
this->entityType.parameter = bVar1;
|
this->type2 = bVar1;
|
||||||
}
|
}
|
||||||
GreatFairy_Main[(this->entityType).parameter](this);
|
GreatFairy_Main[this->type2](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Behaviors
|
// Behaviors
|
||||||
|
@ -366,7 +366,7 @@ void GreatFairy_EnergyUpdate(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08087114(Entity* this) {
|
void sub_08087114(Entity* this) {
|
||||||
if ((this->entityType).parameter == 0) {
|
if (this->type2 == 0) {
|
||||||
GreatFairy_Form1Behaviors[this->action](this);
|
GreatFairy_Form1Behaviors[this->action](this);
|
||||||
} else {
|
} else {
|
||||||
GreatFairy_Form2Behaviors[this->action](this);
|
GreatFairy_Form2Behaviors[this->action](this);
|
||||||
|
@ -485,10 +485,10 @@ void GreatFairy_InitializeAnimation(Entity* this) {
|
||||||
s32 temp;
|
s32 temp;
|
||||||
|
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
temp = this->entityType.form;
|
temp = this->type;
|
||||||
this->entityType.parameter = temp % 11;
|
this->type2 = temp % 11;
|
||||||
this->collisionLayer = 2;
|
this->collisionLayer = 2;
|
||||||
InitializeAnimation(this, this->entityType.parameter);
|
InitializeAnimation(this, this->type2);
|
||||||
sub_0805E3A0(this, 2);
|
sub_0805E3A0(this, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ Entity* GreatFairy_CreateForm(Entity* this, u32 curForm, u32 parameter) {
|
||||||
s32 nextForm;
|
s32 nextForm;
|
||||||
Entity* ent;
|
Entity* ent;
|
||||||
|
|
||||||
nextForm = this->entityType.form;
|
nextForm = this->type;
|
||||||
nextForm /= 11;
|
nextForm /= 11;
|
||||||
|
|
||||||
ent = CreateObject(0x1b, (u8)nextForm * 11 + curForm, parameter);
|
ent = CreateObject(0x1b, (u8)nextForm * 11 + curForm, parameter);
|
||||||
|
|
|
@ -29,7 +29,7 @@ static void sub_0808E6A0(Entity* this) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->entityType.form = 0x62;
|
this->type = 0x62;
|
||||||
this->spriteSettings.b.draw = 0;
|
this->spriteSettings.b.draw = 0;
|
||||||
this->hitbox = &gUnk_08121C58;
|
this->hitbox = &gUnk_08121C58;
|
||||||
this->collisionLayer = 3;
|
this->collisionLayer = 3;
|
||||||
|
|
|
@ -32,7 +32,7 @@ extern void (*const gUnk_081206B4[])(Entity*);
|
||||||
extern Hitbox gUnk_081206AC; // TODO: should be const
|
extern Hitbox gUnk_081206AC; // TODO: should be const
|
||||||
|
|
||||||
void HouseDoorExterior(Entity* this) {
|
void HouseDoorExterior(Entity* this) {
|
||||||
gUnk_081206B4[this->entityType.parameter](this);
|
gUnk_081206B4[this->type2](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080866D8(Entity* this) {
|
void sub_080866D8(Entity* this) {
|
||||||
|
@ -156,7 +156,7 @@ static void sub_080868EC(Entity* entity, unk_80868EC* arg1) {
|
||||||
|
|
||||||
void sub_0808692C(Entity* this) {
|
void sub_0808692C(Entity* this) {
|
||||||
this->flags &= 0xFD;
|
this->flags &= 0xFD;
|
||||||
this->entityType.parameter = 2;
|
this->type2 = 2;
|
||||||
this->action = this->frameIndex == 0 ? 1 : 2;
|
this->action = this->frameIndex == 0 ? 1 : 2;
|
||||||
this->previousActionFlag = 0;
|
this->previousActionFlag = 0;
|
||||||
this->actionDelay = 8;
|
this->actionDelay = 8;
|
||||||
|
|
|
@ -75,7 +75,7 @@ void ItemOnGround(Entity* this) {
|
||||||
gUnk_0811E7D4[this->action](this);
|
gUnk_0811E7D4[this->action](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.form == 0x5C) {
|
if (this->type == 0x5C) {
|
||||||
gRoomVars.field_0x4++;
|
gRoomVars.field_0x4++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ void sub_08080F20(Entity* this) {
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->entityType.form != 0x60) {
|
if (this->type != 0x60) {
|
||||||
this->spriteSettings.b.draw = 1;
|
this->spriteSettings.b.draw = 1;
|
||||||
this->spritePriority.b1 = 3;
|
this->spritePriority.b1 = 3;
|
||||||
this->spriteSettings.b.shadow = 0;
|
this->spriteSettings.b.shadow = 0;
|
||||||
|
@ -96,7 +96,7 @@ void sub_08080F20(Entity* this) {
|
||||||
this->field_0x40 = 0x44;
|
this->field_0x40 = 0x44;
|
||||||
this->currentHealth = 0xFF;
|
this->currentHealth = 0xFF;
|
||||||
this->hitbox = &gUnk_080FD1A8;
|
this->hitbox = &gUnk_080FD1A8;
|
||||||
switch (this->entityType.form - 0x3F) {
|
switch (this->type - 0x3F) {
|
||||||
case 0:
|
case 0:
|
||||||
case 21:
|
case 21:
|
||||||
case 22:
|
case 22:
|
||||||
|
@ -120,14 +120,14 @@ void sub_08080F20(Entity* this) {
|
||||||
this->field_0x68.HALF.LO = 0;
|
this->field_0x68.HALF.LO = 0;
|
||||||
this->actionDelay = 0;
|
this->actionDelay = 0;
|
||||||
sub_0805E3A0(this, 3);
|
sub_0805E3A0(this, 3);
|
||||||
this->field_0x1c = sub_0808147C(this->entityType.form);
|
this->field_0x1c = sub_0808147C(this->type);
|
||||||
gUnk_0811E7E8[this->field_0x68.HALF.HI](this);
|
gUnk_0811E7E8[this->field_0x68.HALF.HI](this);
|
||||||
} else {
|
} else {
|
||||||
Entity* entity = CreateObject(0x40, 0x60, 0);
|
Entity* entity = CreateObject(0x40, 0x60, 0);
|
||||||
if (entity) {
|
if (entity) {
|
||||||
entity->actionDelay = 0;
|
entity->actionDelay = 0;
|
||||||
if (this->actionDelay == 1) {
|
if (this->actionDelay == 1) {
|
||||||
entity->entityType.parameter = 2;
|
entity->type2 = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CopyPosition(this, entity);
|
CopyPosition(this, entity);
|
||||||
|
@ -158,7 +158,7 @@ static void sub_080810A8(Entity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_080810FC(Entity* this) {
|
static void sub_080810FC(Entity* this) {
|
||||||
if (this->entityType.form != 0x5F) {
|
if (this->type != 0x5F) {
|
||||||
sub_08081598(this);
|
sub_08081598(this);
|
||||||
} else {
|
} else {
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
|
@ -278,7 +278,7 @@ void nullsub_510(Entity* this) {
|
||||||
|
|
||||||
void sub_08081328(Entity* this) {
|
void sub_08081328(Entity* this) {
|
||||||
Entity* other = this->attachedEntity;
|
Entity* other = this->attachedEntity;
|
||||||
if (!(other->entityType.type == 8 && other->entityType.subtype == 3)) {
|
if (!(other->kind == 8 && other->id == 3)) {
|
||||||
sub_08081404(this, 0);
|
sub_08081404(this, 0);
|
||||||
} else {
|
} else {
|
||||||
CopyPosition(other, this);
|
CopyPosition(other, this);
|
||||||
|
@ -334,17 +334,17 @@ void sub_08081404(Entity* this, u32 arg1) {
|
||||||
bool32 sub_08081420(Entity* this) {
|
bool32 sub_08081420(Entity* this) {
|
||||||
if (CheckShouldPlayItemGetCutscene(this)) {
|
if (CheckShouldPlayItemGetCutscene(this)) {
|
||||||
sub_0805E3A0(this, 6);
|
sub_0805E3A0(this, 6);
|
||||||
CreateItemEntity(this->entityType.form, this->entityType.parameter, 0);
|
CreateItemEntity(this->type, this->type2, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
GiveItem(this->entityType.form, this->entityType.parameter);
|
GiveItem(this->type, this->type2);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool32 CheckShouldPlayItemGetCutscene(Entity* this) {
|
static bool32 CheckShouldPlayItemGetCutscene(Entity* this) {
|
||||||
bool32 result = FALSE;
|
bool32 result = FALSE;
|
||||||
if ((gUnk_080FD5B4[this->entityType.form].unk0[3] & 0x2) || !GetInventoryValue(this->entityType.form)) {
|
if ((gUnk_080FD5B4[this->type].unk0[3] & 0x2) || !GetInventoryValue(this->type)) {
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -391,7 +391,7 @@ static void sub_08081500(Entity* this) {
|
||||||
this->field_0x68.HALF.LO = 1;
|
this->field_0x68.HALF.LO = 1;
|
||||||
} else {
|
} else {
|
||||||
if (var0 == 1) {
|
if (var0 == 1) {
|
||||||
sub_0808148C(this->entityType.form);
|
sub_0808148C(this->type);
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,13 +408,13 @@ static void sub_0808153C(Entity* this) {
|
||||||
if (!sub_08003FC4(this, 0x1000) && !sub_0800442E(this)) {
|
if (!sub_08003FC4(this, 0x1000) && !sub_0800442E(this)) {
|
||||||
this->field_0x68.HALF.LO = 1;
|
this->field_0x68.HALF.LO = 1;
|
||||||
this->field_0x20 = 0x1E000;
|
this->field_0x20 = 0x1E000;
|
||||||
sub_0808148C(this->entityType.form);
|
sub_0808148C(this->type);
|
||||||
UpdateSpriteForCollisionLayer(this);
|
UpdateSpriteForCollisionLayer(this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!sub_08003FC4(this, 0x2800)) {
|
if (!sub_08003FC4(this, 0x2800)) {
|
||||||
this->field_0x68.HALF.LO = 2;
|
this->field_0x68.HALF.LO = 2;
|
||||||
sub_0808148C(this->entityType.form);
|
sub_0808148C(this->type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ static void sub_08081598(Entity* this) {
|
||||||
this->attachedEntity = &gPlayerEntity;
|
this->attachedEntity = &gPlayerEntity;
|
||||||
CopyPosition(this->attachedEntity, this);
|
CopyPosition(this->attachedEntity, this);
|
||||||
this->height.HALF.HI -= 4;
|
this->height.HALF.HI -= 4;
|
||||||
if (this->entityType.form != 0x5F && sub_08081420(this)) {
|
if (this->type != 0x5F && sub_08081420(this)) {
|
||||||
sub_08081404(this, 1);
|
sub_08081404(this, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ extern void (*const gUnk_081243C4[])(Entity*);
|
||||||
extern Hitbox gUnk_080FD150;
|
extern Hitbox gUnk_080FD150;
|
||||||
|
|
||||||
void LightableSwitch(Entity* this) {
|
void LightableSwitch(Entity* this) {
|
||||||
gUnk_081243B4[this->entityType.form](this);
|
gUnk_081243B4[this->type](this);
|
||||||
sub_0809EB30(this);
|
sub_0809EB30(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,9 +69,9 @@ void sub_0809EAD8(Entity* this) {
|
||||||
u8 bVar1;
|
u8 bVar1;
|
||||||
Entity* pEVar2;
|
Entity* pEVar2;
|
||||||
|
|
||||||
if (this->entityType.parameter != 0) {
|
if (this->type2 != 0) {
|
||||||
|
|
||||||
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
|
this->attachedEntity = GetCurrentRoomProperty(this->type2);
|
||||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,7 +83,7 @@ void sub_0809EB30(Entity* this) {
|
||||||
u16 uVar1;
|
u16 uVar1;
|
||||||
u16* puVar2;
|
u16* puVar2;
|
||||||
|
|
||||||
if (this->entityType.parameter != 0) {
|
if (this->type2 != 0) {
|
||||||
if ((this->direction & 0x80) == 0) {
|
if ((this->direction & 0x80) == 0) {
|
||||||
sub_0806F69C(this);
|
sub_0806F69C(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ void LilypadSmall(Entity* this) {
|
||||||
this->frameIndex = (rand >> 0x10) & 3;
|
this->frameIndex = (rand >> 0x10) & 3;
|
||||||
this->spriteSettings.b.draw = TRUE;
|
this->spriteSettings.b.draw = TRUE;
|
||||||
this->spritePriority.b0 = 7;
|
this->spritePriority.b0 = 7;
|
||||||
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
|
this->attachedEntity = GetCurrentRoomProperty(this->type2);
|
||||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
|
||||||
}
|
}
|
||||||
sub_080A2BE4(this, sub_08097ADC(this));
|
sub_080A2BE4(this, sub_08097ADC(this));
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue