mirror of
https://github.com/zeldaret/tmc
synced 2026-07-02 04:25:56 -04:00
Use metatile enum
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "projectile.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void AngryStatue_Init(Entity*);
|
||||
void AngryStatue_Action1(Entity*);
|
||||
@@ -29,7 +30,7 @@ void AngryStatue(Entity* this) {
|
||||
void AngryStatue_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD178;
|
||||
SetMetaTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(this), this->collisionLayer);
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern void SoundReqClipped(Entity*, u32);
|
||||
void sub_0809CDF0(Entity*);
|
||||
@@ -95,18 +96,18 @@ void BakerOven_Action2(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_0809CDF0(Entity* this) {
|
||||
u32 y;
|
||||
u32 metaTilePos;
|
||||
|
||||
this->field_0x80.HWORD = (((this->x.HALF.HI - gRoomControls.origin_x) >> 4) & 0x3f) |
|
||||
(((this->y.HALF.HI - gRoomControls.origin_y) >> 4 & 0x3f) << 6);
|
||||
|
||||
y = this->field_0x80.HWORD;
|
||||
SetMetaTile(0x402e, y - 0x01, this->collisionLayer);
|
||||
SetMetaTile(0x4022, y - 0x00, this->collisionLayer);
|
||||
SetMetaTile(0x4022, y + 0x01, this->collisionLayer);
|
||||
SetMetaTile(0x4026, y - 0x41, this->collisionLayer);
|
||||
SetMetaTile(0x4026, y - 0x40, this->collisionLayer);
|
||||
SetMetaTile(0x4024, y - 0x3f, this->collisionLayer);
|
||||
SetMetaTile(0x4026, y - 0x81, this->collisionLayer);
|
||||
SetMetaTile(0x4026, y - 0x80, this->collisionLayer);
|
||||
metaTilePos = this->field_0x80.HWORD;
|
||||
SetMetaTile(SPECIAL_META_TILE_46, metaTilePos + TILE_POS(-1, 0), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(0, 0), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos + TILE_POS(1, 0), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(-1, -1), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(0, -1), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_36, metaTilePos + TILE_POS(1, -1), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(-1, -2), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, metaTilePos + TILE_POS(0, -2), this->collisionLayer);
|
||||
}
|
||||
|
||||
+14
-14
@@ -5,15 +5,15 @@
|
||||
* @brief Beanstalk object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[4];
|
||||
/*0x6c*/ u32 unk_6c;
|
||||
/*0x70*/ u16 unk_70;
|
||||
/*0x70*/ u16 tilePos;
|
||||
/*0x72*/ u16 unk_72;
|
||||
} BeanstalkEntity;
|
||||
|
||||
@@ -256,11 +256,11 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
|
||||
return;
|
||||
}
|
||||
this->unk_6c = gRoomControls.origin_y;
|
||||
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
|
||||
this->tilePos = TILE(super->x.HALF.HI, this->unk_6c);
|
||||
while (TRUE) {
|
||||
this->unk_70 = TILE(super->x.HALF.HI, this->unk_6c);
|
||||
SetMetaTile(0x4017, this->unk_70, 2);
|
||||
SetMetaTile(0x4017, this->unk_70, 1);
|
||||
this->tilePos = TILE(super->x.HALF.HI, this->unk_6c);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_TOP);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_BOTTOM);
|
||||
this->unk_6c += 0x10;
|
||||
if (this->unk_6c >= gRoomControls.origin_y + gRoomControls.height)
|
||||
break;
|
||||
@@ -308,8 +308,8 @@ void Beanstalk_Action1Type8SubAction0(BeanstalkEntity* this) {
|
||||
Entity* obj;
|
||||
|
||||
super->spriteOrientation.flipY = 2;
|
||||
this->unk_70 = COORD_TO_TILE(super);
|
||||
SetMetaTile(0x4017, this->unk_70, 1);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, LAYER_BOTTOM);
|
||||
super->subAction = 1;
|
||||
obj = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
|
||||
if (obj != NULL) {
|
||||
@@ -334,19 +334,19 @@ void Beanstalk_Action1Type9(BeanstalkEntity* this) {
|
||||
if (super->subAction == 0) {
|
||||
super->subAction = 1;
|
||||
super->y.HALF.HI += 0x28;
|
||||
this->unk_72 = sub_080B1A0C(super, 0, -0x18);
|
||||
this->unk_72 = sub_080B1A0C(super, 0, -24);
|
||||
}
|
||||
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
|
||||
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
|
||||
if (gPlayerState.floor_type == SURFACE_LADDER) {
|
||||
super->spritePriority.b0 = 0;
|
||||
if (sub_080B1A0C(super, 0, -0x18) != 0x4014) {
|
||||
SetMetaTile(0x4014, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
|
||||
if (sub_080B1A0C(super, 0, -24) != SPECIAL_META_TILE_20) {
|
||||
SetMetaTile(SPECIAL_META_TILE_20, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
|
||||
}
|
||||
} else {
|
||||
super->spritePriority.b0 = 5;
|
||||
if (this->unk_72 != sub_080B1A0C(super, 0, -0x18)) {
|
||||
SetMetaTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 0x18), 1);
|
||||
if (this->unk_72 != sub_080B1A0C(super, 0, -24)) {
|
||||
SetMetaTile(this->unk_72, COORD_TO_TILE_OFFSET(super, 0, 24), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,12 @@
|
||||
#include "common.h"
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "save.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -293,7 +295,7 @@ void sub_08088F20(BigBarrelEntity* this) {
|
||||
pEVar3->collisionLayer = 2;
|
||||
pEVar3->spritePriority.b0 = 2;
|
||||
}
|
||||
SetMetaTileType(0x76, COORD_TO_TILE(super), 2);
|
||||
SetMetaTileType(META_TILE_TYPE_118, COORD_TO_TILE(super), LAYER_TOP);
|
||||
break;
|
||||
case 2:
|
||||
if (--super->timer) {
|
||||
|
||||
+41
-41
@@ -140,116 +140,116 @@ void sub_08099910(BigIceBlockEntity* this) {
|
||||
|
||||
switch (uVar2) {
|
||||
default:
|
||||
SetMetaTile(0x4022, metaTilePos - 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos - 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x41, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
|
||||
break;
|
||||
case 1:
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
|
||||
tileIndex = 0x4024;
|
||||
tileIndex = SPECIAL_META_TILE_36;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4079;
|
||||
tileIndex = SPECIAL_META_TILE_121;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos - 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 0x40, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer);
|
||||
tileIndex = 0x4025;
|
||||
tileIndex = SPECIAL_META_TILE_37;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407b;
|
||||
tileIndex = SPECIAL_META_TILE_123;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer);
|
||||
tileIndex = 0x4024;
|
||||
tileIndex = SPECIAL_META_TILE_36;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4079;
|
||||
tileIndex = SPECIAL_META_TILE_121;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer);
|
||||
tileIndex = 0x4025;
|
||||
tileIndex = SPECIAL_META_TILE_37;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407b;
|
||||
tileIndex = SPECIAL_META_TILE_123;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer);
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
|
||||
tileIndex = 0x4023;
|
||||
tileIndex = SPECIAL_META_TILE_35;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4077;
|
||||
tileIndex = SPECIAL_META_TILE_119;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer);
|
||||
tileIndex = 0x4023;
|
||||
tileIndex = SPECIAL_META_TILE_35;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4077;
|
||||
tileIndex = SPECIAL_META_TILE_119;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer);
|
||||
tileIndex = 0x4026;
|
||||
tileIndex = SPECIAL_META_TILE_38;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407c;
|
||||
tileIndex = SPECIAL_META_TILE_124;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer);
|
||||
tileIndex = 0x4026;
|
||||
tileIndex = SPECIAL_META_TILE_38;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407c;
|
||||
tileIndex = SPECIAL_META_TILE_124;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer);
|
||||
break;
|
||||
case 3:
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x41, super->collisionLayer);
|
||||
tileIndex = 0x4027;
|
||||
tileIndex = SPECIAL_META_TILE_39;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4075;
|
||||
tileIndex = SPECIAL_META_TILE_117;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x41, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x40, super->collisionLayer);
|
||||
tileIndex = 0x4023;
|
||||
tileIndex = SPECIAL_META_TILE_35;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4077;
|
||||
tileIndex = SPECIAL_META_TILE_119;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x40, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 0x3f, super->collisionLayer);
|
||||
tileIndex = 0x4028;
|
||||
tileIndex = SPECIAL_META_TILE_40;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4076;
|
||||
tileIndex = SPECIAL_META_TILE_118;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 0x3f, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos - 1, super->collisionLayer);
|
||||
tileIndex = 0x4024;
|
||||
tileIndex = SPECIAL_META_TILE_36;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4079;
|
||||
tileIndex = SPECIAL_META_TILE_121;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, metaTilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 1, super->collisionLayer);
|
||||
tileIndex = 0x4025;
|
||||
tileIndex = SPECIAL_META_TILE_37;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407b;
|
||||
tileIndex = SPECIAL_META_TILE_123;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 1, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x3f, super->collisionLayer);
|
||||
tileIndex = 0x4029;
|
||||
tileIndex = SPECIAL_META_TILE_41;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x4078;
|
||||
tileIndex = SPECIAL_META_TILE_120;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 0x3f, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x40, super->collisionLayer);
|
||||
tileIndex = 0x4026;
|
||||
tileIndex = SPECIAL_META_TILE_38;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407c;
|
||||
tileIndex = SPECIAL_META_TILE_124;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 0x40, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(metaTilePos + 0x41, super->collisionLayer);
|
||||
tileIndex = 0x402a;
|
||||
tileIndex = SPECIAL_META_TILE_42;
|
||||
if (vvv == VVV_18) {
|
||||
tileIndex = 0x407a;
|
||||
tileIndex = SPECIAL_META_TILE_122;
|
||||
}
|
||||
SetMetaTile(tileIndex, metaTilePos + 0x41, super->collisionLayer);
|
||||
break;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -38,9 +38,6 @@ bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity*);
|
||||
void BigPushableLever_SetMetaTiles(BigPushableLeverEntity*);
|
||||
void BigPushableLever_CalculateSpriteOffsets(BigPushableLeverEntity*);
|
||||
|
||||
#define TILE_INITIAL 0x4058
|
||||
#define TILE_PUSHED 0x4056
|
||||
|
||||
void BigPushableLever(BigPushableLeverEntity* this) {
|
||||
BigPushableLever_Actions[super->action](this);
|
||||
}
|
||||
@@ -93,8 +90,8 @@ void BigPushableLever_SetMetaTiles(BigPushableLeverEntity* this) {
|
||||
this->tilePositionLower = this->tilePositionUpper - 0x40;
|
||||
this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer);
|
||||
this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer);
|
||||
SetMetaTile(0x4057, this->tilePositionUpper, super->collisionLayer);
|
||||
SetMetaTile(0x4058, this->tilePositionLower, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_87, this->tilePositionUpper, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_88, this->tilePositionLower, super->collisionLayer);
|
||||
InitializeAnimation(super, 1);
|
||||
} else {
|
||||
super->type2 = 1;
|
||||
@@ -102,14 +99,14 @@ void BigPushableLever_SetMetaTiles(BigPushableLeverEntity* this) {
|
||||
this->tilePositionLower = this->tilePositionUpper - 1;
|
||||
this->tileIndexUpper = GetMetaTileIndex(this->tilePositionUpper, super->collisionLayer);
|
||||
this->tileIndexLower = GetMetaTileIndex(this->tilePositionLower, super->collisionLayer);
|
||||
SetMetaTile(0x4055, this->tilePositionUpper, super->collisionLayer);
|
||||
SetMetaTile(0x4056, this->tilePositionLower, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_85, this->tilePositionUpper, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_86, this->tilePositionLower, super->collisionLayer);
|
||||
InitializeAnimation(super, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 BigPushableLever_ShouldStartPushing(BigPushableLeverEntity* this) {
|
||||
if (GetMetaTileIndex(this->tilePositionLower, super->collisionLayer) == 0x4059) {
|
||||
if (GetMetaTileIndex(this->tilePositionLower, super->collisionLayer) == SPECIAL_META_TILE_89) {
|
||||
if (--this->timer == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
@@ -144,8 +141,8 @@ void (*const BigPushableLever_Actions[])(BigPushableLeverEntity*) = {
|
||||
BigPushableLever_Pushing,
|
||||
};
|
||||
const u16 gUnk_081236E8[] = {
|
||||
TILE_INITIAL,
|
||||
TILE_PUSHED,
|
||||
SPECIAL_META_TILE_88,
|
||||
SPECIAL_META_TILE_86,
|
||||
};
|
||||
const u8 BigPushableLever_InitialOffsets[] = {
|
||||
0, 0, 0, 0, 255, 0, 0, 0,
|
||||
|
||||
+42
-41
@@ -6,9 +6,10 @@
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -27,11 +28,11 @@ void BlockPushed(BlockPushedEntity* this) {
|
||||
|
||||
void BlockPushed_Init(BlockPushedEntity* this) {
|
||||
u16 tmp;
|
||||
u32 pos;
|
||||
u32 metaTilePos;
|
||||
|
||||
if (gRoomControls.area == 0x11) {
|
||||
if (gRoomControls.area == AREA_MINISH_PATHS) {
|
||||
UnloadGFXSlots(super);
|
||||
if (LoadFixedGFX(super, 0x1c1) == 0) {
|
||||
if (LoadFixedGFX(super, 449) == 0) {
|
||||
super->spriteSettings.draw = 0;
|
||||
return;
|
||||
}
|
||||
@@ -41,50 +42,50 @@ void BlockPushed_Init(BlockPushedEntity* this) {
|
||||
super->timer = 32;
|
||||
super->speed = 0x80;
|
||||
super->spritePriority.b0 = 6;
|
||||
pos = COORD_TO_TILE(super);
|
||||
metaTilePos = COORD_TO_TILE(super);
|
||||
tmp = super->type * 8;
|
||||
super->x.HALF.HI += tmp;
|
||||
super->y.HALF.HI += tmp;
|
||||
super->hitbox = (Hitbox*)gUnk_0811F64C[super->type];
|
||||
this->unk_68 = GetMetaTileType(pos, (u32)super->collisionLayer);
|
||||
this->unk_68 = GetMetaTileType(metaTilePos, super->collisionLayer);
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
sub_080832D8(pos, this);
|
||||
sub_080832D8(metaTilePos, this);
|
||||
break;
|
||||
case 1:
|
||||
sub_080832D8(pos, this);
|
||||
sub_080832D8(pos + 1, this);
|
||||
sub_080832D8(pos + 0x40, this);
|
||||
sub_080832D8(pos + 0x41, this);
|
||||
sub_080832D8(metaTilePos, this);
|
||||
sub_080832D8(metaTilePos + 1, this);
|
||||
sub_080832D8(metaTilePos + 0x40, this);
|
||||
sub_080832D8(metaTilePos + 0x41, this);
|
||||
break;
|
||||
case 2:
|
||||
sub_080832D8(pos, this);
|
||||
sub_080832D8(pos + 1, this);
|
||||
sub_080832D8(pos + 2, this);
|
||||
sub_080832D8(pos + 0x40, this);
|
||||
sub_080832D8(pos + 0x41, this);
|
||||
sub_080832D8(pos + 0x42, this);
|
||||
sub_080832D8(pos + 0x80, this);
|
||||
sub_080832D8(pos + 0x81, this);
|
||||
sub_080832D8(pos + 0x82, this);
|
||||
sub_080832D8(metaTilePos, this);
|
||||
sub_080832D8(metaTilePos + 1, this);
|
||||
sub_080832D8(metaTilePos + 2, this);
|
||||
sub_080832D8(metaTilePos + 0x40, this);
|
||||
sub_080832D8(metaTilePos + 0x41, this);
|
||||
sub_080832D8(metaTilePos + 0x42, this);
|
||||
sub_080832D8(metaTilePos + 0x80, this);
|
||||
sub_080832D8(metaTilePos + 0x81, this);
|
||||
sub_080832D8(metaTilePos + 0x82, this);
|
||||
break;
|
||||
default:
|
||||
sub_080832D8(pos, this);
|
||||
sub_080832D8(pos + 1, this);
|
||||
sub_080832D8(pos + 2, this);
|
||||
sub_080832D8(pos + 3, this);
|
||||
sub_080832D8(pos + 0x40, this);
|
||||
sub_080832D8(pos + 0x41, this);
|
||||
sub_080832D8(pos + 0x42, this);
|
||||
sub_080832D8(pos + 0x43, this);
|
||||
sub_080832D8(pos + 0x80, this);
|
||||
sub_080832D8(pos + 0x81, this);
|
||||
sub_080832D8(pos + 0x82, this);
|
||||
sub_080832D8(pos + 0x83, this);
|
||||
sub_080832D8(pos + 0xc0, this);
|
||||
sub_080832D8(pos + 0xc1, this);
|
||||
sub_080832D8(pos + 0xc2, this);
|
||||
sub_080832D8(pos + 0xc3, this);
|
||||
sub_080832D8(metaTilePos, this);
|
||||
sub_080832D8(metaTilePos + 1, this);
|
||||
sub_080832D8(metaTilePos + 2, this);
|
||||
sub_080832D8(metaTilePos + 3, this);
|
||||
sub_080832D8(metaTilePos + 0x40, this);
|
||||
sub_080832D8(metaTilePos + 0x41, this);
|
||||
sub_080832D8(metaTilePos + 0x42, this);
|
||||
sub_080832D8(metaTilePos + 0x43, this);
|
||||
sub_080832D8(metaTilePos + 0x80, this);
|
||||
sub_080832D8(metaTilePos + 0x81, this);
|
||||
sub_080832D8(metaTilePos + 0x82, this);
|
||||
sub_080832D8(metaTilePos + 0x83, this);
|
||||
sub_080832D8(metaTilePos + 0xc0, this);
|
||||
sub_080832D8(metaTilePos + 0xc1, this);
|
||||
sub_080832D8(metaTilePos + 0xc2, this);
|
||||
sub_080832D8(metaTilePos + 0xc3, this);
|
||||
break;
|
||||
}
|
||||
EnqueueSFX(SFX_10F);
|
||||
@@ -148,18 +149,18 @@ void sub_080830B8(BlockPushedEntity* this) {
|
||||
DeleteEntity(super);
|
||||
}
|
||||
|
||||
void sub_080832D8(u32 param_1, BlockPushedEntity* this) {
|
||||
void sub_080832D8(u32 metaTilePos, BlockPushedEntity* this) {
|
||||
if (super->collisionLayer != 2) {
|
||||
if ((super->direction & 8) != 0) {
|
||||
sub_0807B7D8(0x21, param_1, super->collisionLayer);
|
||||
sub_0807B7D8(META_TILE_TYPE_33, metaTilePos, super->collisionLayer);
|
||||
} else {
|
||||
sub_0807B7D8(0x20, param_1, super->collisionLayer);
|
||||
sub_0807B7D8(META_TILE_TYPE_32, metaTilePos, super->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
if ((super->direction & 8) != 0) {
|
||||
sub_0807B7D8(0x2f, param_1, super->collisionLayer);
|
||||
sub_0807B7D8(META_TILE_TYPE_47, metaTilePos, super->collisionLayer);
|
||||
} else {
|
||||
sub_0807B7D8(0x2e, param_1, super->collisionLayer);
|
||||
sub_0807B7D8(META_TILE_TYPE_46, metaTilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -54,7 +55,7 @@ void Board_Init(BoardEntity* this) {
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
super->spritePriority.b0 = 6;
|
||||
if (super->type == 0) {
|
||||
SetMetaTile(0x4074, this->tile - 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_116, this->tile + TILE_POS(0, -1), super->collisionLayer);
|
||||
}
|
||||
sub_08098BE8(this);
|
||||
}
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0x8];
|
||||
u16 tile;
|
||||
u16 tileIndex;
|
||||
u8 unk74;
|
||||
u16 metaTilePos;
|
||||
u16 metaTileIndex;
|
||||
u8 collisionData;
|
||||
u8 unk75;
|
||||
u8 filler2[0x10];
|
||||
u16 flags;
|
||||
@@ -59,7 +60,7 @@ void Bollard_Action1(BollardEntity* this) {
|
||||
}
|
||||
super->action = 2;
|
||||
InitializeAnimation(super, 3);
|
||||
SetMetaTile(this->tileIndex, this->tile, super->collisionLayer);
|
||||
SetMetaTile(this->metaTileIndex, this->metaTilePos, super->collisionLayer);
|
||||
EnqueueSFX(SFX_1A5);
|
||||
}
|
||||
|
||||
@@ -93,10 +94,10 @@ void Bollard_Action4(BollardEntity* this) {
|
||||
|
||||
void sub_0808B3AC(BollardEntity* this) {
|
||||
super->spritePriority.b0 = 4;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetMetaTileIndex(this->tile, super->collisionLayer);
|
||||
this->unk74 = GetCollisionDataAtMetaTilePos(this->tile, super->collisionLayer);
|
||||
SetMetaTile(0x400b, this->tile, super->collisionLayer);
|
||||
this->metaTilePos = COORD_TO_TILE(super);
|
||||
this->metaTileIndex = GetMetaTileIndex(this->metaTilePos, super->collisionLayer);
|
||||
this->collisionData = GetCollisionDataAtMetaTilePos(this->metaTilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_11, this->metaTilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0808B41C(BollardEntity* this) {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -180,16 +180,16 @@ void sub_0808C500(BossDoorEntity* this) {
|
||||
this->unk_78 = GetMetaTileIndex(this->unk_74 - 1, super->collisionLayer);
|
||||
this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer);
|
||||
this->unk_7c = GetMetaTileIndex(this->unk_74 + 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74 - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74 + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 + 1, super->collisionLayer);
|
||||
} else {
|
||||
this->unk_78 = GetMetaTileIndex(this->unk_74 - 0x40, super->collisionLayer);
|
||||
this->unk_7a = GetMetaTileIndex(this->unk_74, super->collisionLayer);
|
||||
this->unk_7c = GetMetaTileIndex(this->unk_74 + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74 - 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->unk_74 + 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 - 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_74 + 0x40, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -5,10 +5,10 @@
|
||||
* @brief Bush object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -70,7 +70,7 @@ void Bush_Init(BushEntity* this) {
|
||||
super->hitbox = (Hitbox*)&gUnk_081205B4;
|
||||
this->unk_72 = 0;
|
||||
this->unk_70 = GetMetaTileIndex(COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
|
||||
InitializeAnimation(super, gUnk_08120588[super->type].unk_0);
|
||||
}
|
||||
|
||||
|
||||
+24
-23
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void Button_Init(Entity*);
|
||||
void Button_Action1(Entity*);
|
||||
@@ -35,7 +36,7 @@ void Button_Init(Entity* this) {
|
||||
this->field_0x70.HALF.HI = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer);
|
||||
if (this->type == 0 && CheckFlags(this->field_0x86.HWORD)) {
|
||||
this->action = 5;
|
||||
SetMetaTileType(0x7A, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_122, this->field_0x74.HWORD, this->collisionLayer);
|
||||
} else {
|
||||
if (sub_08081E3C(this)) {
|
||||
this->action = 2;
|
||||
@@ -69,12 +70,12 @@ void Button_Action2(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08081F7C(Entity*, u32);
|
||||
u32 sub_08081F7C(Entity*, u32 metaTileType);
|
||||
u32 sub_08081D28(Entity*);
|
||||
void sub_08081E6C(Entity*);
|
||||
|
||||
void Button_Action3(Entity* this) {
|
||||
if (!sub_08081F7C(this, 0x78))
|
||||
if (!sub_08081F7C(this, META_TILE_TYPE_120))
|
||||
return;
|
||||
if (!sub_08081D28(this)) {
|
||||
this->action = 4;
|
||||
@@ -94,7 +95,7 @@ void Button_Action4(Entity* this) {
|
||||
this->timer--;
|
||||
if (this->subtimer != 0) {
|
||||
this->subtimer = 0;
|
||||
SetMetaTile(0x4035, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_53, this->field_0x74.HWORD, this->collisionLayer);
|
||||
}
|
||||
if (sub_08081CB0(this)) {
|
||||
this->action = 3;
|
||||
@@ -103,13 +104,13 @@ void Button_Action4(Entity* this) {
|
||||
} else {
|
||||
this->action = 2;
|
||||
ClearFlag(this->field_0x86.HWORD);
|
||||
SetMetaTileType(0x77, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_119, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SoundReq(SFX_BUTTON_PRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void Button_Action5(Entity* this) {
|
||||
if (sub_08081F7C(this, 0x7a)) {
|
||||
if (sub_08081F7C(this, META_TILE_TYPE_122)) {
|
||||
sub_08081E6C(this);
|
||||
}
|
||||
}
|
||||
@@ -117,16 +118,16 @@ void Button_Action5(Entity* this) {
|
||||
Entity* sub_08081D74(Entity*);
|
||||
|
||||
u32 sub_08081CB0(Entity* this) {
|
||||
u16 tmp;
|
||||
u16 tileType;
|
||||
if (sub_08081D74(this)) {
|
||||
this->field_0x70.HALF.LO = -1;
|
||||
if (GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer) == 0x4035) {
|
||||
if (GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer) == SPECIAL_META_TILE_53) {
|
||||
sub_0807B7D8(0x78, this->field_0x74.HWORD, this->collisionLayer);
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
tmp = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer);
|
||||
if (tmp != 0x77 && tmp != 0x79 && tmp != 0x4035) {
|
||||
tileType = GetMetaTileType(this->field_0x74.HWORD, this->collisionLayer);
|
||||
if (tileType != 0x77 && tileType != 0x79 && tileType != SPECIAL_META_TILE_53) {
|
||||
this->field_0x70.HALF.LO = GetMetaTileIndex(this->field_0x74.HWORD, this->collisionLayer);
|
||||
return 1;
|
||||
}
|
||||
@@ -154,8 +155,8 @@ u32 sub_08081E0C(Entity*);
|
||||
|
||||
Entity* sub_08081D74(Entity* this) {
|
||||
Entity* ent;
|
||||
if (GetCollisionDataAtMetaTilePos(this->field_0x74.HWORD, this->collisionLayer) == 0xF) {
|
||||
return 0;
|
||||
if (GetCollisionDataAtMetaTilePos(this->field_0x74.HWORD, this->collisionLayer) == COLLISION_DATA_15) {
|
||||
return NULL;
|
||||
}
|
||||
ent = 0;
|
||||
if (sub_08081E0C(this)) {
|
||||
@@ -208,27 +209,27 @@ extern u16 gMapDataTopSpecial[0x2000];
|
||||
extern u16 gMapDataBottomSpecial[];
|
||||
|
||||
void sub_08081E6C(Entity* this) {
|
||||
u32 tileType;
|
||||
u32 metaTileType;
|
||||
MapLayer* mapLayer;
|
||||
u16* tmp2;
|
||||
u16* tmp;
|
||||
u16* tmp3;
|
||||
u32 tilePosition = this->field_0x74.HWORD;
|
||||
u32 metaTilePos = this->field_0x74.HWORD;
|
||||
u32 layer = this->collisionLayer;
|
||||
u32 tile = GetMetaTileType(tilePosition, layer);
|
||||
u32 specialMetaTile = GetMetaTileType(metaTilePos, layer);
|
||||
|
||||
if (tile < 0x4000)
|
||||
if (specialMetaTile < 0x4000)
|
||||
return;
|
||||
mapLayer = GetLayerByIndex(layer);
|
||||
tileType = (this->type == 0 ? 0x7a : 0x78);
|
||||
metaTileType = (this->type == 0 ? META_TILE_TYPE_122 : META_TILE_TYPE_120);
|
||||
tmp = mapLayer->metatiles;
|
||||
tmp = tmp + (mapLayer->unkData2[tileType] << 2);
|
||||
tmp = tmp + (mapLayer->unkData2[metaTileType] << 2);
|
||||
tmp2 = (layer == 2 ? gMapDataTopSpecial : gMapDataBottomSpecial);
|
||||
tmp2 += (((0x3f & tilePosition) << 1) + ((0xfc0 & tilePosition) << 2));
|
||||
tmp2 += (((0x3f & metaTilePos) << 1) + ((0xfc0 & metaTilePos) << 2));
|
||||
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
|
||||
return;
|
||||
SetMetaTileType(tileType, tilePosition, layer);
|
||||
SetMetaTile(tile, tilePosition, layer);
|
||||
SetMetaTileType(metaTileType, metaTilePos, layer);
|
||||
SetMetaTile(specialMetaTile, metaTilePos, layer);
|
||||
}
|
||||
|
||||
// Are the two tiles already set to the correct one
|
||||
@@ -255,7 +256,7 @@ void sub_08081F24(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08081F7C(Entity* this, u32 r7) {
|
||||
u32 sub_08081F7C(Entity* this, u32 metaTileType) {
|
||||
u16 tmp;
|
||||
if (this->timer == 0)
|
||||
return 1;
|
||||
@@ -265,7 +266,7 @@ u32 sub_08081F7C(Entity* this, u32 r7) {
|
||||
} else {
|
||||
if (this->timer == 6) {
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
SetMetaTileType(r7, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTileType(metaTileType, this->field_0x74.HWORD, this->collisionLayer);
|
||||
sub_08081F24(this);
|
||||
SoundReq(SFX_BUTTON_PRESS);
|
||||
if (this->field_0x70.HALF_U.LO != 0xFFFF)
|
||||
|
||||
+23
-22
@@ -9,6 +9,7 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -31,12 +32,12 @@ void CabinFurniture(Entity* this) {
|
||||
}
|
||||
|
||||
void CabinFurniture_Init(CabinFurnitureEntity* this) {
|
||||
u32 uVar1;
|
||||
u32 layer;
|
||||
u32 uVar6;
|
||||
u32 uVar7;
|
||||
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
uVar1 = super->collisionLayer;
|
||||
layer = super->collisionLayer;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
@@ -44,38 +45,38 @@ void CabinFurniture_Init(CabinFurnitureEntity* this) {
|
||||
super->spritePriority.b0 = 6;
|
||||
uVar7 = this->tile;
|
||||
uVar6 = uVar7 - 1;
|
||||
SetMetaTile(0x4022, uVar6, uVar1);
|
||||
SetMetaTile(0x4022, uVar7, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 + 1, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 + 0x3f, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 + 0x40, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 + 0x41, uVar1);
|
||||
SetMetaTile(0x403d, uVar7 - 0x41, uVar1);
|
||||
SetMetaTile(0x403d, uVar7 - 0x40, uVar1);
|
||||
SetMetaTile(0x4026, uVar7 - 0x3f, uVar1);
|
||||
SetMetaTile(0x4026, uVar7 - 0x81, uVar1);
|
||||
SetMetaTile(0x4026, uVar7 - 0x80, uVar1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x3f, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x40, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 + 0x41, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, uVar7 - 0x41, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, uVar7 - 0x40, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x3f, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x81, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, uVar7 - 0x80, layer);
|
||||
break;
|
||||
case 1:
|
||||
super->action = 1;
|
||||
uVar6 = this->tile;
|
||||
SetMetaTile(0x4022, uVar6, uVar1);
|
||||
SetMetaTile(0x4022, uVar6 + 0x40, uVar1);
|
||||
SetMetaTile(0x4025, uVar6 + 0x41, uVar1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar6 + 0x40, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_37, uVar6 + 0x41, layer);
|
||||
if (CheckLocalFlag(0x4f) == 0) {
|
||||
SetMetaTile(0x402f, uVar6 + 1, uVar1);
|
||||
SetMetaTile(SPECIAL_META_TILE_47, uVar6 + 1, layer);
|
||||
} else {
|
||||
SetMetaTile(0x402d, uVar6 + 1, uVar1);
|
||||
SetMetaTile(SPECIAL_META_TILE_45, uVar6 + 1, layer);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
super->action = 1;
|
||||
uVar7 = this->tile;
|
||||
uVar6 = uVar7 - 0x41;
|
||||
SetMetaTile(0x4022, uVar6, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 - 0x40, uVar1);
|
||||
SetMetaTile(0x4022, uVar7 - 1, uVar1);
|
||||
SetMetaTile(0x4022, uVar7, uVar1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar6, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 - 0x40, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7 - 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, uVar7, layer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -99,7 +99,7 @@ void CarlovObject_Type1Init(CarlovObjectEntity* this) {
|
||||
if (super->timer == 0) {
|
||||
super->action = 1;
|
||||
super->subtimer = 120;
|
||||
SetMetaTile(0x4022, this->unk_76, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
|
||||
} else {
|
||||
super->action = 3;
|
||||
super->spriteSettings.draw = 0;
|
||||
@@ -142,7 +142,7 @@ void CarlovObject_Type1Action4(CarlovObjectEntity* this) {
|
||||
super->action = 5;
|
||||
sub_08083814(super, 2);
|
||||
EnqueueSFX(SFX_10B);
|
||||
SetMetaTile(0x4022, this->unk_76, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_76, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -7,11 +7,11 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "structures.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -29,7 +29,7 @@ void sub_080842D8(ChestSpawnerEntity*);
|
||||
void AddInteractableChest(ChestSpawnerEntity*);
|
||||
void sub_08083E20(ChestSpawnerEntity*);
|
||||
void sub_08084074(u32);
|
||||
void sub_080840A8(s32, s32);
|
||||
void sub_080840A8(s32 x, s32 y);
|
||||
void ChestSpawner_Type0(ChestSpawnerEntity*);
|
||||
void ChestSpawner_Type2(ChestSpawnerEntity*);
|
||||
void ChestSpawner_Type0Init(ChestSpawnerEntity*);
|
||||
@@ -164,7 +164,7 @@ void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) {
|
||||
GetNextFrame(super);
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
if (--super->subtimer == 0) {
|
||||
if (super->timer == 0x18) {
|
||||
if (super->timer == 24) {
|
||||
super->action = 6;
|
||||
super->timer = 8;
|
||||
super->subtimer = 16;
|
||||
@@ -189,18 +189,18 @@ void sub_08084074(u32 param_1) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080840A8(s32 param_1, s32 param_2) {
|
||||
void sub_080840A8(s32 x, s32 y) {
|
||||
static const u8 gUnk_0811F838[] = { 84, 84, 84, 84, 85, 85, 85, 86 };
|
||||
static const s32 gUnk_0811F840[] = { 393216, 458752, 524288, 589824 };
|
||||
static const s8 gUnk_0811F850[] = { -6, 0, 0, 6 };
|
||||
static const s32 zVelocities[] = { 0x60000, 0x70000, 0x80000, 0x90000 };
|
||||
static const s8 xOffsets[] = { -6, 0, 0, 6 };
|
||||
Entity* obj = CreateObject(GROUND_ITEM, gUnk_0811F838[Random() & 7], 0);
|
||||
if (obj != NULL) {
|
||||
obj->timer = 6;
|
||||
obj->direction = ((Random() & 7) + 0xc) | 0x80;
|
||||
obj->speed = (Random() & 0xf) * 2 + 0x20;
|
||||
obj->zVelocity = gUnk_0811F840[Random() & 3];
|
||||
obj->x.HALF.HI = gUnk_0811F850[Random() & 3] + param_1;
|
||||
obj->y.HALF.HI = param_2 + 1;
|
||||
obj->zVelocity = zVelocities[Random() & 3];
|
||||
obj->x.HALF.HI = xOffsets[Random() & 3] + x;
|
||||
obj->y.HALF.HI = y + 1;
|
||||
obj->z.HALF.HI = -8;
|
||||
ResolveCollisionLayer(obj);
|
||||
obj = CreateFx(obj, FX_DASH, 0);
|
||||
@@ -232,7 +232,7 @@ void ChestSpawner_Type0Init(ChestSpawnerEntity* this) {
|
||||
super->action++;
|
||||
this->tilePosition = COORD_TO_TILE(super);
|
||||
super->hitbox = (Hitbox*)&gUnk_0811F8A8;
|
||||
if (GetMetaTileTypeByEntity(super) == 0x74) {
|
||||
if (GetMetaTileTypeByEntity(super) == META_TILE_TYPE_116) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (CheckFlags(this->unk_86)) {
|
||||
@@ -271,7 +271,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) {
|
||||
|
||||
void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) {
|
||||
if ((super->type == 1) || (super->type == 7)) {
|
||||
if (GetMetaTileTypeByEntity(super) == 0x74) {
|
||||
if (GetMetaTileTypeByEntity(super) == META_TILE_TYPE_116) {
|
||||
DeleteEntity(super);
|
||||
} else {
|
||||
if (!CheckFlags(this->unk_86)) {
|
||||
|
||||
@@ -56,13 +56,13 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
|
||||
if (CheckGlobalFlag(WATERBEAN_OUT)) {
|
||||
if (CheckGlobalFlag(WATERBEAN_PUT) == 0) {
|
||||
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
|
||||
SetMetaTile(0x4022, 0xdc, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, 0xdc, super->collisionLayer);
|
||||
} else {
|
||||
if (CheckLocalFlag(super->type2) == 0) {
|
||||
InitializeAnimation(super, 10);
|
||||
super->y.HALF.HI += 4;
|
||||
super->action = 4;
|
||||
SetMetaTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
|
||||
return;
|
||||
}
|
||||
super->type2 = 0;
|
||||
@@ -109,7 +109,7 @@ void CrenelBeanSprout_Init(CrenelBeanSproutEntity* this) {
|
||||
InitializeAnimation(super, 0xb);
|
||||
super->y.HALF.HI += 4;
|
||||
super->action = 4;
|
||||
SetMetaTile(0x4032, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_50, COORD_TO_TILE(super), super->collisionLayer);
|
||||
return;
|
||||
} else {
|
||||
super->type2 = 0;
|
||||
@@ -234,7 +234,7 @@ void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) {
|
||||
}
|
||||
|
||||
void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) {
|
||||
static const u16 gUnk_0812319C[] = { 0x403c, 0x4033 };
|
||||
static const u16 gUnk_0812319C[] = { SPECIAL_META_TILE_60, SPECIAL_META_TILE_51 };
|
||||
if (gUnk_0812319C[super->type >> 1] == GetMetaTileTypeByEntity(super)) {
|
||||
GetNextFrame(super);
|
||||
gPlayerState.keepFacing |= 0x80;
|
||||
@@ -331,5 +331,5 @@ void sub_08096A78(CrenelBeanSproutEntity* this) {
|
||||
sub_08004168(super);
|
||||
super->y.HALF.HI += 4;
|
||||
super->action = 3;
|
||||
SetMetaTile(0x403b, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_59, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
+12
-11
@@ -10,10 +10,11 @@
|
||||
#include "entity.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "npc.h"
|
||||
#include "object.h"
|
||||
#include "script.h"
|
||||
#include "item.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -363,17 +364,17 @@ void CuccoMinigame_TellObjective(void) {
|
||||
}
|
||||
|
||||
void sub_080A1648(void) {
|
||||
SetMetaTileType(0x407f, 0xd36, 1);
|
||||
SetMetaTileType(0x407f, 0xd37, 1);
|
||||
SetMetaTileType(0x407f, 0xd38, 1);
|
||||
SetMetaTileType(0x407e, 0xd75, 1);
|
||||
SetMetaTileType(0x407e, 0xe75, 1);
|
||||
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(54, 52), LAYER_BOTTOM);
|
||||
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(55, 52), LAYER_BOTTOM);
|
||||
SetMetaTileType(SPECIAL_META_TILE_127, TILE_POS(56, 52), LAYER_BOTTOM);
|
||||
SetMetaTileType(SPECIAL_META_TILE_126, TILE_POS(53, 53), LAYER_BOTTOM);
|
||||
SetMetaTileType(SPECIAL_META_TILE_126, TILE_POS(53, 57), LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void sub_080A169C(void) {
|
||||
RestorePrevTileEntity(0xd36, 1);
|
||||
RestorePrevTileEntity(0xd37, 1);
|
||||
RestorePrevTileEntity(0xd38, 1);
|
||||
RestorePrevTileEntity(0xd75, 1);
|
||||
RestorePrevTileEntity(0xe75, 1);
|
||||
RestorePrevTileEntity(TILE_POS(54, 52), LAYER_BOTTOM);
|
||||
RestorePrevTileEntity(TILE_POS(55, 52), LAYER_BOTTOM);
|
||||
RestorePrevTileEntity(TILE_POS(56, 52), LAYER_BOTTOM);
|
||||
RestorePrevTileEntity(TILE_POS(53, 53), LAYER_BOTTOM);
|
||||
RestorePrevTileEntity(TILE_POS(53, 57), LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "script.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern u8 gUnk_08122AE0[];
|
||||
extern u16 gUnk_08122AE8[];
|
||||
@@ -335,7 +336,7 @@ void sub_08094E30(CutsceneMiscObjectEntity* this) {
|
||||
super->zVelocity = 0;
|
||||
SetDefaultPriority(super, PRIO_PLAYER_EVENT);
|
||||
InitializeAnimation(super, 0);
|
||||
if (GetVvvAtEntity(super) == 13) {
|
||||
if (GetVvvAtEntity(super) == VVV_13) {
|
||||
super->action = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[0x18];
|
||||
/*0x80*/ u16 unk_80;
|
||||
/*0x80*/ u16 metaTilePos;
|
||||
/*0x82*/ u16 unk_82;
|
||||
/*0x84*/ u8 unk_84;
|
||||
/*0x85*/ u8 unk_85;
|
||||
@@ -43,7 +43,7 @@ void DoubleBookshelf(DoubleBookshelfEntity* this) {
|
||||
void DoubleBookshelf_Init(DoubleBookshelfEntity* this) {
|
||||
DoubleBookshelfEntity* child;
|
||||
super->frameIndex = super->type;
|
||||
this->unk_80 = COORD_TO_TILE(super);
|
||||
this->metaTilePos = COORD_TO_TILE(super);
|
||||
if (super->type != 0) {
|
||||
super->action = 1;
|
||||
if (this->unk_84 == 0) {
|
||||
@@ -82,7 +82,7 @@ void DoubleBookshelf_Action2(DoubleBookshelfEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
if (--super->timer == 0) {
|
||||
super->action = 1;
|
||||
this->unk_80 = COORD_TO_TILE(super);
|
||||
this->metaTilePos = COORD_TO_TILE(super);
|
||||
SetPlayerControl(CONTROL_ENABLED);
|
||||
sub_0809B0B0(this);
|
||||
EnqueueSFX(SFX_BUTTON_PRESS);
|
||||
@@ -94,45 +94,45 @@ void DoubleBookshelf_Action3(DoubleBookshelfEntity* this) {
|
||||
}
|
||||
|
||||
void sub_0809B0B0(DoubleBookshelfEntity* this) {
|
||||
u32 position = this->unk_80 - 1;
|
||||
u32 tilePos = this->metaTilePos - 1;
|
||||
u32 layer = super->collisionLayer;
|
||||
switch (super->subAction) {
|
||||
case 0:
|
||||
this->unk_84 = 0;
|
||||
this->unk_82 = position + 2;
|
||||
SetMetaTile(0x4082, position - 1, layer);
|
||||
SetMetaTile(0x4022, position, layer);
|
||||
SetMetaTile(0x4022, position + 1, layer);
|
||||
SetMetaTile(0x4022, position + 2, layer);
|
||||
this->unk_82 = tilePos + 2;
|
||||
SetMetaTile(SPECIAL_META_TILE_130, tilePos - 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
|
||||
break;
|
||||
case 1:
|
||||
this->unk_84 = 1;
|
||||
this->unk_82 = position;
|
||||
SetMetaTile(0x405f, position, layer);
|
||||
SetMetaTile(0x4022, position + 1, layer);
|
||||
SetMetaTile(0x4022, position + 2, layer);
|
||||
SetMetaTile(0x4082, position + 3, layer);
|
||||
this->unk_82 = tilePos;
|
||||
SetMetaTile(SPECIAL_META_TILE_95, tilePos, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_130, tilePos + 3, layer);
|
||||
break;
|
||||
case 2:
|
||||
this->unk_84 = 1;
|
||||
this->unk_82 = position;
|
||||
SetMetaTile(0x4082, position + 3, layer);
|
||||
SetMetaTile(0x4022, position + 2, layer);
|
||||
SetMetaTile(0x405f, position, layer);
|
||||
this->unk_82 = tilePos;
|
||||
SetMetaTile(SPECIAL_META_TILE_130, tilePos + 3, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_95, tilePos, layer);
|
||||
SetFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
|
||||
break;
|
||||
case 3:
|
||||
this->unk_84 = 0;
|
||||
this->unk_82 = position + 2;
|
||||
SetMetaTile(0x4082, position - 1, layer);
|
||||
SetMetaTile(0x4022, position, layer);
|
||||
SetMetaTile(0x405f, position + 2, layer);
|
||||
this->unk_82 = tilePos + 2;
|
||||
SetMetaTile(SPECIAL_META_TILE_130, tilePos - 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_95, tilePos + 2, layer);
|
||||
ClearFlag(((DoubleBookshelfEntity*)super->parent)->unk_86);
|
||||
break;
|
||||
case 4:
|
||||
SetMetaTile(0x4022, position, layer);
|
||||
SetMetaTile(0x4022, position + 1, layer);
|
||||
SetMetaTile(0x4022, position + 2, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 1, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + 2, layer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
|
||||
case 1:
|
||||
if (player->x.HALF.HI + 0x1c > super->x.HALF.HI) {
|
||||
this->unk_84 = 2;
|
||||
SetMetaTile(0x4022, this->unk_80 + 2, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->metaTilePos + 2, LAYER_BOTTOM);
|
||||
sub_0809B358((DoubleBookshelfEntity*)super->child);
|
||||
return;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
|
||||
return;
|
||||
}
|
||||
this->unk_84 = 1;
|
||||
RestorePrevTileEntity(this->unk_80 + 2, 1);
|
||||
RestorePrevTileEntity(this->metaTilePos + 2, 1);
|
||||
sub_0809B38C((DoubleBookshelfEntity*)super->child);
|
||||
return;
|
||||
}
|
||||
@@ -182,33 +182,34 @@ void sub_0809B274(DoubleBookshelfEntity* this) {
|
||||
|
||||
void sub_0809B334(DoubleBookshelfEntity* this) {
|
||||
s32 index;
|
||||
u32 position = this->unk_80 - 0x81;
|
||||
for (index = 2; index >= 0; index--, position++) {
|
||||
SetMetaTile(0x4026, position, 1);
|
||||
u32 tilePos = this->metaTilePos - 0x81;
|
||||
for (index = 2; index >= 0; index--, tilePos++) {
|
||||
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809B358(DoubleBookshelfEntity* this) {
|
||||
static const u16 gUnk_08123D68[] = {
|
||||
0x4022, 0x4022, 0x4074, 0x4026, 0x4074, 0x4074, 0x4026, 0x4074, 0x4022, 0x4022
|
||||
};
|
||||
static const u16 gUnk_08123D68[] = { SPECIAL_META_TILE_34, SPECIAL_META_TILE_34, SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_38, SPECIAL_META_TILE_116, SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_38, SPECIAL_META_TILE_116, SPECIAL_META_TILE_34,
|
||||
SPECIAL_META_TILE_34 };
|
||||
s32 index;
|
||||
const u16* array = &gUnk_08123D68[this->unk_84];
|
||||
u32 position = this->unk_80 - 0x82;
|
||||
u32 metaTilePos = this->metaTilePos + TILE_POS(-2, -2);
|
||||
for (index = 4; index >= 0;) {
|
||||
SetMetaTile(*array, position, 1);
|
||||
SetMetaTile(*array, metaTilePos, LAYER_BOTTOM);
|
||||
index--;
|
||||
position++;
|
||||
metaTilePos++;
|
||||
array += 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809B38C(DoubleBookshelfEntity* this) {
|
||||
s32 index;
|
||||
u32 uVar1 = this->unk_80 - 0x82;
|
||||
u32 metaTilePos = this->metaTilePos + TILE_POS(-2, -2);
|
||||
for (index = 4; index >= 0;) {
|
||||
RestorePrevTileEntity(uVar1, 1);
|
||||
RestorePrevTileEntity(metaTilePos, 1);
|
||||
index--;
|
||||
uVar1++;
|
||||
metaTilePos++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
#include "figurineMenu.h"
|
||||
#include "fileselect.h"
|
||||
#include "functions.h"
|
||||
#include "kinstone.h"
|
||||
#include "item.h"
|
||||
#include "kinstone.h"
|
||||
#include "message.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -307,9 +308,9 @@ void sub_08087F58(FigurineDeviceEntity* this) {
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
case 1:
|
||||
SetMetaTile(0x4022, this->unk_78 - 1, 1);
|
||||
SetMetaTile(0x4022, this->unk_78, 1);
|
||||
SetMetaTile(0x4022, this->unk_78 + 1, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78 - 1, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->unk_78 + 1, LAYER_BOTTOM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void Fireplace_Action1(Entity* this);
|
||||
void sub_0809B7DC(Entity* this);
|
||||
@@ -29,7 +30,7 @@ void Fireplace_Init(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
sub_0807B7D8(0x30b, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
|
||||
SetMetaTile(0x4061, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_97, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
}
|
||||
Fireplace_Action1(this);
|
||||
}
|
||||
@@ -44,13 +45,13 @@ void Fireplace_Action1(Entity* this) {
|
||||
|
||||
void sub_0809B7C0(Entity* this) {
|
||||
u32 tileType = GetMetaTileTypeByEntity(this);
|
||||
if (tileType != 0x4061 && tileType != 0x4062) {
|
||||
if (tileType != SPECIAL_META_TILE_97 && tileType != SPECIAL_META_TILE_98) {
|
||||
sub_0809B7DC(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809B7DC(Entity* this) {
|
||||
sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
|
||||
SetMetaTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_98, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
this->timer = 1;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -115,62 +115,62 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
|
||||
|
||||
void sub_0809C0A8(FrozenWaterElementEntity* this) {
|
||||
u32 position = COORD_TO_TILE(super);
|
||||
SetMetaTile(0x4022, position - 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position - 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position - 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position - 2, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 2, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x3e, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x42, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x7f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x80, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x81, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x13f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x140, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x141, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x17f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x181, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1bd, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1be, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1bf, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1c1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1c2, super->collisionLayer);
|
||||
SetMetaTile(0x4022, position + 0x1c3, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 5), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 5), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 5), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 6), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 6), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-3, 7), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 7), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 7), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 7), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(2, 7), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(3, 7), super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0809C23C(FrozenWaterElementEntity* this) {
|
||||
u32 position = COORD_TO_TILE(super);
|
||||
RestorePrevTileEntity(position - 0x41, super->collisionLayer);
|
||||
RestorePrevTileEntity(position - 0x40, super->collisionLayer);
|
||||
RestorePrevTileEntity(position - 0x3f, super->collisionLayer);
|
||||
RestorePrevTileEntity(position - 2, super->collisionLayer);
|
||||
RestorePrevTileEntity(position - 1, super->collisionLayer);
|
||||
RestorePrevTileEntity(position, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 1, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 2, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x3e, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x3f, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x40, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x41, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x42, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x7f, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x80, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x81, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x13f, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x140, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x141, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x17f, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x181, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1bd, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1be, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1bf, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1c1, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1c2, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + 0x1c3, super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, -1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(0, -1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, -1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-2, 0), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 0), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(0, 0), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 0), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(2, 0), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-2, 1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(0, 1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(2, 1), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 2), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(0, 2), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 2), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 5), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(0, 5), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 5), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 6), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 6), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-3, 7), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-2, 7), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(-1, 7), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(1, 7), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(2, 7), super->collisionLayer);
|
||||
RestorePrevTileEntity(position + TILE_POS(3, 7), super->collisionLayer);
|
||||
}
|
||||
|
||||
+84
-84
@@ -99,7 +99,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
Entity base;
|
||||
/* 0x68 */ u8 pad[0x10];
|
||||
/* 0x78 */ u16 tile;
|
||||
/* 0x78 */ u16 tilePos;
|
||||
/* 0x7a */ u16 unk1;
|
||||
/* 0x7c */ u16 unk2;
|
||||
/* 0x7e */ u16 unk3;
|
||||
@@ -202,11 +202,11 @@ void Furniture(Entity* this) {
|
||||
}
|
||||
|
||||
static void FurnitureInit(FurnitureEntity* this) {
|
||||
u32 i, tile, cnt;
|
||||
u32 i, tilePos, cnt;
|
||||
Entity* e;
|
||||
|
||||
super->action = FURNITURE_UPDATE;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
sub_08090DC4(this);
|
||||
switch (this->flags & 0x7fff) {
|
||||
case 0x100:
|
||||
@@ -217,14 +217,14 @@ static void FurnitureInit(FurnitureEntity* this) {
|
||||
break;
|
||||
case 0x40:
|
||||
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 4;
|
||||
SetMetaTile(0x4017, this->tile - 128, 1);
|
||||
SetMetaTile(0x4017, this->tile - 64, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos - 128, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos - 64, LAYER_BOTTOM);
|
||||
break;
|
||||
case 0x80:
|
||||
super->frameIndex = 0;
|
||||
super->y.HALF.HI = (super->y.HALF.HI & ~0xF) | 6;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
SetMetaTile(0x4026, this->tile, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePos, super->collisionLayer);
|
||||
break;
|
||||
case 0x200:
|
||||
break;
|
||||
@@ -242,14 +242,14 @@ static void FurnitureInit(FurnitureEntity* this) {
|
||||
if (this->height != 16) {
|
||||
switch (this->height & 0x70) {
|
||||
case 0x30:
|
||||
this->tile -= 64;
|
||||
this->tilePos -= 64;
|
||||
sub_08090B6C(this);
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
case 0x20:
|
||||
this->tile += 64;
|
||||
this->tilePos += 64;
|
||||
sub_08090B6C(this);
|
||||
}
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
}
|
||||
|
||||
switch (this->flags & 0x7fff) {
|
||||
@@ -257,12 +257,12 @@ static void FurnitureInit(FurnitureEntity* this) {
|
||||
ChangeObjPalette(super, 0x7E);
|
||||
break;
|
||||
case 0x2:
|
||||
tile = this->tile - 129;
|
||||
tilePos = this->tilePos - 129;
|
||||
cnt = super->type != 26 ? 3 : 2;
|
||||
for (i = 0; i < cnt; ++i, ++tile) {
|
||||
SetMetaTile(0x4026, tile, 2);
|
||||
SetMetaTile(0x4026, tile, 1);
|
||||
SetVvvAtMetaTilePos(VVV_0, tile + 64, 1);
|
||||
for (i = 0; i < cnt; ++i, ++tilePos) {
|
||||
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_TOP);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, tilePos, LAYER_BOTTOM);
|
||||
SetVvvAtMetaTilePos(VVV_0, tilePos + TILE_POS(0, 1), 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -282,27 +282,27 @@ static void FurnitureInit(FurnitureEntity* this) {
|
||||
}
|
||||
break;
|
||||
case SHOE_DESK:
|
||||
sub_0807B7D8(774, this->tile + 65, 2);
|
||||
sub_0807B7D8(774, this->tilePos + 65, 2);
|
||||
break;
|
||||
case STAIRCASE:
|
||||
super->collisionLayer = 1;
|
||||
super->spriteOrientation.flipY = 2;
|
||||
SetMetaTile(0x4074, this->tile - 64, super->collisionLayer);
|
||||
SetVvvAtMetaTilePos(VVV_63, this->tile - 64, super->collisionLayer);
|
||||
SetMetaTile(0x4017, this->tile, super->collisionLayer);
|
||||
SetMetaTile(0x4017, this->tile + 64, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_116, this->tilePos - 64, super->collisionLayer);
|
||||
SetVvvAtMetaTilePos(VVV_63, this->tilePos - 64, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos + 64, super->collisionLayer);
|
||||
break;
|
||||
case MINISH_CHEESE:
|
||||
if (super->type2 != 0)
|
||||
super->spriteOffsetX = -4;
|
||||
break;
|
||||
case WOODEN_TABLE:
|
||||
SetMetaTile(0x4023, this->tile - 65, super->collisionLayer);
|
||||
SetMetaTile(0x4023, this->tile - 64, super->collisionLayer);
|
||||
SetMetaTile(0x4023, this->tile - 63, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 65, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 64, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_35, this->tilePos - 63, super->collisionLayer);
|
||||
break;
|
||||
case LOW_BOOKSHELF:
|
||||
SetMetaTile(0x4022, this->tile + 65, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePos + 65, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,20 +338,21 @@ static void FurnitureUpdate(FurnitureEntity* this) {
|
||||
break;
|
||||
case 0x80:
|
||||
if (gPlayerEntity.y.HALF.HI < super->y.HALF.HI + 8) {
|
||||
if (gPlayerState.floor_type != SURFACE_LADDER && GetMetaTileTypeByEntity(super) == 0x4017) {
|
||||
SetMetaTile(0x4026, this->tile, super->collisionLayer);
|
||||
SetMetaTile(0x403D, this->tile - 64, super->collisionLayer);
|
||||
SetMetaTile(0x403D, this->tile - 128, super->collisionLayer);
|
||||
if (gPlayerState.floor_type != SURFACE_LADDER &&
|
||||
GetMetaTileTypeByEntity(super) == SPECIAL_META_TILE_23) {
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
if (gPlayerEntity.collisionLayer & 2) {
|
||||
gPlayerEntity.collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(&gPlayerEntity);
|
||||
}
|
||||
if (GetMetaTileTypeByEntity(super) != 0x4017) {
|
||||
SetMetaTile(0x4017, this->tile, super->collisionLayer);
|
||||
SetMetaTile(0x4017, this->tile - 64, super->collisionLayer);
|
||||
SetMetaTile(0x4014, this->tile - 128, super->collisionLayer);
|
||||
if (GetMetaTileTypeByEntity(super) != SPECIAL_META_TILE_23) {
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, this->tilePos + TILE_POS(0, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_20, this->tilePos + TILE_POS(0, -2), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -365,8 +366,8 @@ static void sub_08090B6C(FurnitureEntity* this) {
|
||||
if (width != 0) {
|
||||
u8 w2 = width / 8;
|
||||
u32 px = super->x.HALF.HI & 0xF;
|
||||
u32 tile = this->tile;
|
||||
u32 cl = super->collisionLayer;
|
||||
u32 tilePos = this->tilePos;
|
||||
u32 layer = super->collisionLayer;
|
||||
int i;
|
||||
|
||||
switch ((u32)w2 & 3) {
|
||||
@@ -376,104 +377,103 @@ static void sub_08090B6C(FurnitureEntity* this) {
|
||||
num = 2;
|
||||
}
|
||||
for (i = -num; i <= num; ++i) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
}
|
||||
if (px & 8) {
|
||||
sub_08090CDC(0x4024, tile - i, cl);
|
||||
sub_08090CDC(0x4025, tile + i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
|
||||
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
|
||||
} else {
|
||||
SetMetaTile(0x4022, tile - i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos - i, layer);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
num = w2 / 8;
|
||||
for (i = -num; i <= num; i++) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
}
|
||||
if (px & 8) {
|
||||
sub_08090CDC(0x4024, tile - i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
|
||||
if (i != 0) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
}
|
||||
} else {
|
||||
if (i != 0) {
|
||||
SetMetaTile(0x4022, tile - i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos - i, layer);
|
||||
}
|
||||
sub_08090CDC(0x4025, tile + i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
num = w2 / 4;
|
||||
for (i = -num; i < num; ++i) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
}
|
||||
if (px & 8) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
} else {
|
||||
sub_08090CDC(0x4024, tile - i - 1, cl);
|
||||
sub_08090CDC(0x4025, tile + i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i - 1, layer);
|
||||
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
num = w2 / 4;
|
||||
for (i = -num; i <= num; ++i) {
|
||||
SetMetaTile(0x4022, tile + i, cl);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePos + i, layer);
|
||||
}
|
||||
if (px & 8) {
|
||||
sub_08090CDC(0x4025, tile + i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_37, tilePos + i, layer);
|
||||
} else {
|
||||
sub_08090CDC(0x4024, tile - i, cl);
|
||||
sub_08090CDC(SPECIAL_META_TILE_36, tilePos - i, layer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_08090CDC(u32 id, u32 pos, u32 layer) {
|
||||
u16 cur = GetMetaTileIndex(pos, layer);
|
||||
static void sub_08090CDC(u32 metaTileIndex, u32 metaTilePos, u32 layer) {
|
||||
u16 cur = GetMetaTileIndex(metaTilePos, layer);
|
||||
u32 next = cur;
|
||||
u32 id2;
|
||||
|
||||
if ((cur & 0x4000) == 0) {
|
||||
SetMetaTile(id, pos, layer);
|
||||
SetMetaTile(metaTileIndex, metaTilePos, layer);
|
||||
} else {
|
||||
switch (cur) {
|
||||
case 0x4025:
|
||||
if (id == 0x4024)
|
||||
next = 0x4022;
|
||||
if (id == 0x402c)
|
||||
next = 0x4022;
|
||||
case SPECIAL_META_TILE_37:
|
||||
if (metaTileIndex == SPECIAL_META_TILE_36)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
if (metaTileIndex == SPECIAL_META_TILE_44)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
break;
|
||||
case 0x402D:
|
||||
if (id == 0x402c)
|
||||
next = 0x402b;
|
||||
if (id == 0x4024)
|
||||
next = 0x4022;
|
||||
case SPECIAL_META_TILE_45:
|
||||
if (metaTileIndex == SPECIAL_META_TILE_44)
|
||||
next = SPECIAL_META_TILE_43;
|
||||
if (metaTileIndex == SPECIAL_META_TILE_36)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
break;
|
||||
case 0x4024:
|
||||
if (id == 0x4025)
|
||||
next = 0x4022;
|
||||
if (id == 0x402d)
|
||||
next = 0x4022;
|
||||
case SPECIAL_META_TILE_36:
|
||||
if (metaTileIndex == SPECIAL_META_TILE_37)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
if (metaTileIndex == SPECIAL_META_TILE_45)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
break;
|
||||
case 0x402C:
|
||||
if (id == 0x402d)
|
||||
next = 0x402b;
|
||||
if (id == 0x4025)
|
||||
next = 0x4022;
|
||||
case SPECIAL_META_TILE_44:
|
||||
if (metaTileIndex == SPECIAL_META_TILE_45)
|
||||
next = SPECIAL_META_TILE_43;
|
||||
if (metaTileIndex == SPECIAL_META_TILE_37)
|
||||
next = SPECIAL_META_TILE_34;
|
||||
break;
|
||||
case 0x4022:
|
||||
case 0x4023:
|
||||
case 0x4026:
|
||||
case 0x4027:
|
||||
case 0x4028:
|
||||
case 0x4029:
|
||||
case 0x402a:
|
||||
case 0x402b:
|
||||
case SPECIAL_META_TILE_34:
|
||||
case SPECIAL_META_TILE_35:
|
||||
case SPECIAL_META_TILE_38:
|
||||
case SPECIAL_META_TILE_39:
|
||||
case SPECIAL_META_TILE_40:
|
||||
case SPECIAL_META_TILE_41:
|
||||
case SPECIAL_META_TILE_42:
|
||||
case SPECIAL_META_TILE_43:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
SetMetaTile(next, pos, layer);
|
||||
SetMetaTile(next, metaTilePos, layer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -58,10 +59,10 @@ void GentariCurtain_Init(GentariCurtainEntity* this) {
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
this->tile = COORD_TO_TILE_OFFSET(super, 0, 8);
|
||||
this->tile2 = COORD_TO_TILE_OFFSET(super, 0, -8);
|
||||
this->tileIndex = GetMetaTileIndex(this->tile, 1);
|
||||
this->tileIndex2 = GetMetaTileIndex(this->tile2, 1);
|
||||
SetMetaTile(0x4022, this->tile, 1);
|
||||
SetMetaTile(0x4022, this->tile2, 1);
|
||||
this->tileIndex = GetMetaTileIndex(this->tile, LAYER_BOTTOM);
|
||||
this->tileIndex2 = GetMetaTileIndex(this->tile2, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tile, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tile2, LAYER_BOTTOM);
|
||||
InitAnimationForceUpdate(super, 0);
|
||||
} else {
|
||||
super->action = 1;
|
||||
@@ -81,8 +82,8 @@ void GentariCurtain_Action2(GentariCurtainEntity* this) {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
super->action = 3;
|
||||
SetMetaTile(this->tileIndex, this->tile, 1);
|
||||
SetMetaTile(this->tileIndex2, this->tile2, 1);
|
||||
SetMetaTile(this->tileIndex, this->tile, LAYER_BOTTOM);
|
||||
SetMetaTile(this->tileIndex2, this->tile2, LAYER_BOTTOM);
|
||||
sub_08092214(this);
|
||||
sub_0809223C(this);
|
||||
InitAnimationForceUpdate(super, 1);
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
* @brief Giant Book Ladder object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
#include "manager.h"
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -44,43 +46,43 @@ void sub_0808E55C(GiantBookLadderEntity* this) {
|
||||
u32 uVar4;
|
||||
u32 unaff_r9;
|
||||
u32 uVar5;
|
||||
u32 position;
|
||||
u32 tilePos;
|
||||
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
case 2:
|
||||
position = this->unk74;
|
||||
unaff_r9 = position - 0x101;
|
||||
SetMetaTile(0x408f, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(0x408f, position - 0x100, super->collisionLayer);
|
||||
SetMetaTile(0x406c, position - 0x102, super->collisionLayer);
|
||||
SetMetaTile(0x406d, position - 0xff, super->collisionLayer);
|
||||
tilePos = this->unk74;
|
||||
unaff_r9 = tilePos + TILE_POS(-1, -4);
|
||||
SetMetaTile(SPECIAL_META_TILE_143, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_143, tilePos + TILE_POS(0, -4), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, tilePos + TILE_POS(-2, -4), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, tilePos + TILE_POS(1, -4), super->collisionLayer);
|
||||
type = super->type;
|
||||
uVar5 = 6;
|
||||
if (type != 0) {
|
||||
uVar5 = 4;
|
||||
SetMetaTile(0x4072, position + 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x4072, position + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4072, position + 0x7f, super->collisionLayer);
|
||||
SetMetaTile(0x4072, position + 0x80, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(-1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_114, tilePos + TILE_POS(0, 2), super->collisionLayer);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
position = this->unk74;
|
||||
unaff_r9 = position - 1;
|
||||
SetMetaTile(0x408e, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(0x408e, position, super->collisionLayer);
|
||||
tilePos = this->unk74;
|
||||
unaff_r9 = tilePos - 1;
|
||||
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_142, tilePos, super->collisionLayer);
|
||||
uVar5 = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
for (uVar4 = 0; uVar4 < uVar5; uVar4++) {
|
||||
unaff_r9 += 0x40;
|
||||
SetMetaTile(0x408e, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(0x408e, unaff_r9 + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_142, unaff_r9 + 1, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0808E670(GiantBookLadderEntity* this) {
|
||||
return GetMetaTileType(this->unk74 - 0x101, 1);
|
||||
return GetMetaTileType(this->unk74 - 0x101, LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*
|
||||
* @brief Giant Leaf object
|
||||
*/
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
|
||||
void sub_0808D618(Entity* ent);
|
||||
@@ -35,6 +36,6 @@ void sub_0808D618(Entity* ent) {
|
||||
((((ent->y.HALF.HI - gRoomControls.origin_y) >> 4) & 0x3F) * 64);
|
||||
|
||||
for (i = 0; i < 13; i++) {
|
||||
SetMetaTile(16500, tilePos + arr[i], 1);
|
||||
SetMetaTile(16500, tilePos + arr[i], LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-10
@@ -8,11 +8,12 @@
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 filler[0xC];
|
||||
u16 tile;
|
||||
u16 metaTilePos;
|
||||
} GiantRock2Entity;
|
||||
|
||||
void GiantRock2_Init(GiantRock2Entity*);
|
||||
@@ -28,22 +29,22 @@ void GiantRock2(Entity* this) {
|
||||
|
||||
void GiantRock2_Init(GiantRock2Entity* this) {
|
||||
u32 collisionLayer;
|
||||
u16 position;
|
||||
u16 metaTilePos;
|
||||
int index;
|
||||
u32 tileIndex;
|
||||
|
||||
super->action = 1;
|
||||
this->tile = COORD_TO_TILE(super);
|
||||
this->metaTilePos = COORD_TO_TILE(super);
|
||||
collisionLayer = super->collisionLayer;
|
||||
super->spritePriority.b0 = 7;
|
||||
position = (this->tile - 0x80);
|
||||
tileIndex = 0x4022;
|
||||
metaTilePos = (this->metaTilePos - TILE_POS(0, 2));
|
||||
tileIndex = SPECIAL_META_TILE_34;
|
||||
for (index = 4; index > -1; index--) {
|
||||
SetMetaTile(tileIndex, position - 2, collisionLayer);
|
||||
SetMetaTile(tileIndex, position - 1, collisionLayer);
|
||||
SetMetaTile(tileIndex, position, collisionLayer);
|
||||
SetMetaTile(tileIndex, position + 1, collisionLayer);
|
||||
position += 0x40;
|
||||
SetMetaTile(tileIndex, metaTilePos - 2, collisionLayer);
|
||||
SetMetaTile(tileIndex, metaTilePos - 1, collisionLayer);
|
||||
SetMetaTile(tileIndex, metaTilePos, collisionLayer);
|
||||
SetMetaTile(tileIndex, metaTilePos + 1, collisionLayer);
|
||||
metaTilePos += TILE_POS(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+58
-52
@@ -7,8 +7,8 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -143,22 +143,28 @@ void GiantTwig_Type2Idle(GiantTwigEntity* this) {
|
||||
|
||||
void sub_08093984(GiantTwigEntity* this) {
|
||||
u32 index;
|
||||
const s16* array;
|
||||
const s16* metaTileOffsets;
|
||||
|
||||
if (super->type2 != 0) {
|
||||
static const s16 gUnk_081228F8[] = {
|
||||
-130, -129, -128, -127, -66, -65, -64, -63, -62, -2, -1, 0, 1, 2, 63, 64, 65, 66, 67,
|
||||
TILE_POS(-2, -2), TILE_POS(-1, -2), TILE_POS(0, -2), TILE_POS(1, -2), TILE_POS(-2, -1),
|
||||
TILE_POS(-1, -1), TILE_POS(0, -1), TILE_POS(1, -1), TILE_POS(2, -1), TILE_POS(-2, 0),
|
||||
TILE_POS(-1, 0), TILE_POS(0, 0), TILE_POS(1, 0), TILE_POS(2, 0), TILE_POS(-1, 1),
|
||||
TILE_POS(0, 1), TILE_POS(1, 1), TILE_POS(2, 1), TILE_POS(3, 1),
|
||||
};
|
||||
array = gUnk_081228F8;
|
||||
metaTileOffsets = gUnk_081228F8;
|
||||
} else {
|
||||
static const s16 gUnk_0812291E[] = {
|
||||
-129, -128, -127, -126, -66, -65, -64, -63, -62, -2, -1, 0, 1, 2, 61, 62, 63, 64, 65,
|
||||
TILE_POS(-1, -2), TILE_POS(0, -2), TILE_POS(1, -2), TILE_POS(2, -2), TILE_POS(-2, -1),
|
||||
TILE_POS(-1, -1), TILE_POS(0, -1), TILE_POS(1, -1), TILE_POS(2, -1), TILE_POS(-2, 0),
|
||||
TILE_POS(-1, 0), TILE_POS(0, 0), TILE_POS(1, 0), TILE_POS(2, 0), TILE_POS(-3, 1),
|
||||
TILE_POS(-2, 1), TILE_POS(-1, 1), TILE_POS(0, 1), TILE_POS(1, 1),
|
||||
};
|
||||
array = gUnk_0812291E;
|
||||
metaTileOffsets = gUnk_0812291E;
|
||||
}
|
||||
|
||||
for (index = 0; index < 0x13; index++) {
|
||||
SetMetaTile(0x4074, array[index] + this->tilePosition, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_116, metaTileOffsets[index] + this->tilePosition, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,47 +183,47 @@ void GiantTwig_Type3Idle(GiantTwigEntity* this) {
|
||||
void sub_08093A1C(GiantTwigEntity* this) {
|
||||
switch (super->type) {
|
||||
case 0:
|
||||
SetMetaTile(0x4024, this->tilePosition + 0x3c, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x3d, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x3e, super->collisionLayer);
|
||||
SetMetaTile(0x4029, this->tilePosition + 0x7c, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x7d, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x7e, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
|
||||
SetMetaTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4023, this->tilePosition + 0x42, super->collisionLayer);
|
||||
SetMetaTile(0x406d, this->tilePosition + 0x43, super->collisionLayer);
|
||||
SetMetaTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x82, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x83, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_36, this->tilePosition + TILE_POS(-4, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-3, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-2, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(-4, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-3, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-2, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_39, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_35, this->tilePosition + TILE_POS(2, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(3, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(2, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(3, 2), super->collisionLayer);
|
||||
break;
|
||||
case 1:
|
||||
if ((super->type2 & 1) != 0) {
|
||||
SetMetaTile(0x406d, this->tilePosition - 0x81, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition - 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4029, this->tilePosition - 2, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(0x406d, this->tilePosition + 1, super->collisionLayer);
|
||||
SetMetaTile(0x406e, this->tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x406d, this->tilePosition + 0x42, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(-1, -2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(-2, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_110, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, this->tilePosition + TILE_POS(2, 1), super->collisionLayer);
|
||||
} else {
|
||||
SetMetaTile(0x406c, this->tilePosition - 0x7f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition - 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x406c, this->tilePosition - 1, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 1, super->collisionLayer);
|
||||
SetMetaTile(0x402a, this->tilePosition + 2, super->collisionLayer);
|
||||
SetMetaTile(0x406c, this->tilePosition + 0x3e, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x406f, this->tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(1, -2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, -1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(-1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(1, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_42, this->tilePosition + TILE_POS(2, 0), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, this->tilePosition + TILE_POS(-2, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_111, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
SetMetaTile(0x4022, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition, super->collisionLayer);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -226,12 +232,12 @@ void sub_08093C70(GiantTwigEntity* this) {
|
||||
if (this->unk_78 != 0) {
|
||||
if (gPlayerState.heldObject != 0) {
|
||||
this->unk_78 = 0;
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4022, this->tilePosition + 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x7f, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x80, super->collisionLayer);
|
||||
SetMetaTile(0x4026, this->tilePosition + 0x81, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(-1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -239,12 +245,12 @@ void sub_08093C70(GiantTwigEntity* this) {
|
||||
if (--this->unk_7a == 0) {
|
||||
this->unk_78++;
|
||||
this->unk_7a = 0x3c;
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x3f, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTile(0x4027, this->tilePosition + 0x41, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x7f, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePosition + 0x80, super->collisionLayer);
|
||||
SetMetaTile(0x4029, this->tilePosition + 0x81, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_39, this->tilePosition + TILE_POS(1, 1), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(-1, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePosition + TILE_POS(0, 2), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_41, this->tilePosition + TILE_POS(1, 2), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void HiddenLadderDown_Init(Entity*);
|
||||
void HiddenLadderDown_Action1(Entity*);
|
||||
@@ -34,15 +34,15 @@ void HiddenLadderDown_Init(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86.HWORD) != 0) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.draw = TRUE;
|
||||
SetMetaTileType(0x1a2, *puVar3 - 0x41, this->collisionLayer);
|
||||
SetMetaTileType(0x1a3, *puVar3 - 0x40, this->collisionLayer);
|
||||
SetMetaTileType(0x1a4, *puVar3 - 0x3f, this->collisionLayer);
|
||||
SetMetaTileType(0x1a5, *puVar3 - 1, this->collisionLayer);
|
||||
SetMetaTileType(0x1a6, *puVar3, this->collisionLayer);
|
||||
SetMetaTileType(0x1a7, *puVar3 + 1, this->collisionLayer);
|
||||
SetMetaTileType(0x1a8, *puVar3 + 0x3f, this->collisionLayer);
|
||||
SetMetaTileType(0x1a9, *puVar3 + 0x40, this->collisionLayer);
|
||||
SetMetaTileType(0x1aa, *puVar3 + 0x41, this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_418, *puVar3 + TILE_POS(-1, -1), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_419, *puVar3 + TILE_POS(0, -1), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_420, *puVar3 + TILE_POS(1, -1), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_421, *puVar3 + TILE_POS(-1, 0), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_422, *puVar3 + TILE_POS(0, 0), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_423, *puVar3 + TILE_POS(1, 0), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_424, *puVar3 + TILE_POS(-1, 1), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_425, *puVar3 + TILE_POS(0, 1), this->collisionLayer);
|
||||
SetMetaTileType(META_TILE_TYPE_426, *puVar3 + TILE_POS(1, 1), this->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
#include "itemMetaData.h"
|
||||
#include "object.h"
|
||||
#include "player.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08081150(Entity*);
|
||||
u8 sub_0808147C(u32);
|
||||
@@ -282,7 +282,8 @@ void sub_080812A0(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080812A8(Entity* this) {
|
||||
if (GetCollisionDataAtEntity(this) != 0xF && this->field_0x6e.HWORD != GetMetaTileTypeByEntity(this)) {
|
||||
if (GetCollisionDataAtEntity(this) != COLLISION_DATA_15 &&
|
||||
this->field_0x6e.HWORD != GetMetaTileTypeByEntity(this)) {
|
||||
this->direction = 0;
|
||||
this->speed = 0;
|
||||
this->spriteSettings.draw = 1;
|
||||
|
||||
+31
-5
@@ -7,9 +7,9 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
static void SetJailBarTiles(Entity*, u32);
|
||||
void JailBars_Init(Entity*);
|
||||
@@ -61,10 +61,36 @@ void JailBars_Action3(Entity* this) {
|
||||
}
|
||||
|
||||
static void SetJailBarTiles(Entity* this, u32 arg1) {
|
||||
static const s16 gUnk_08124960[] = { 0x4023, -0x3, 0x4023, -0x2, 0x4023, -0x1, 0x4023,
|
||||
0x0, 0x4023, 0x1, 0x4023, 0x2, -0x1 };
|
||||
static const s16 gUnk_0812497A[] = { 0x4023, -0x3, 0x4023, -0x2, 0x4088, -0x1, 0x4087,
|
||||
0x0, 0x4023, 0x1, 0x4023, 0x2, -0x1 };
|
||||
static const s16 gUnk_08124960[] = {
|
||||
SPECIAL_META_TILE_35,
|
||||
-0x3,
|
||||
SPECIAL_META_TILE_35,
|
||||
-0x2,
|
||||
SPECIAL_META_TILE_35,
|
||||
-0x1,
|
||||
SPECIAL_META_TILE_35,
|
||||
0x0,
|
||||
SPECIAL_META_TILE_35,
|
||||
0x1,
|
||||
SPECIAL_META_TILE_35,
|
||||
0x2,
|
||||
-0x1,
|
||||
};
|
||||
static const s16 gUnk_0812497A[] = {
|
||||
SPECIAL_META_TILE_35,
|
||||
-0x3,
|
||||
SPECIAL_META_TILE_35,
|
||||
-0x2,
|
||||
SPECIAL_META_TILE_136,
|
||||
-0x1,
|
||||
SPECIAL_META_TILE_135,
|
||||
0x0,
|
||||
SPECIAL_META_TILE_35,
|
||||
0x1,
|
||||
SPECIAL_META_TILE_35,
|
||||
0x2,
|
||||
-0x1,
|
||||
};
|
||||
const s16* puVar1;
|
||||
|
||||
puVar1 = gUnk_08124960;
|
||||
|
||||
+17
-18
@@ -7,6 +7,7 @@
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern u32 PortalReadyForMinish(void);
|
||||
|
||||
@@ -17,7 +18,7 @@ void JarPortal_Action1(Entity*);
|
||||
void JarPortal_Action2(Entity*);
|
||||
void JarPortal_Action3(Entity*);
|
||||
void JarPortal_Action4(Entity*);
|
||||
void sub_0808C148(Entity*, u32);
|
||||
void sub_0808C148(Entity*, bool32);
|
||||
void sub_0808C01C(Entity*, u32);
|
||||
|
||||
void JarPortal(Entity* this) {
|
||||
@@ -62,7 +63,7 @@ void JarPortal_Action1(Entity* this) {
|
||||
} else {
|
||||
ClearLocalFlag(this->type);
|
||||
}
|
||||
sub_0808C148(this, 0);
|
||||
sub_0808C148(this, FALSE);
|
||||
}
|
||||
sub_0808C01C(this, 0);
|
||||
}
|
||||
@@ -89,7 +90,7 @@ void JarPortal_Action2(Entity* this) {
|
||||
++this->action;
|
||||
this->subtimer = 0;
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
sub_0808C148(this, 1);
|
||||
sub_0808C148(this, TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -103,7 +104,7 @@ void JarPortal_Action3(Entity* this) {
|
||||
ClearLocalFlag(this->type);
|
||||
else
|
||||
SetLocalFlag(this->type);
|
||||
sub_0808C148(this, 0);
|
||||
sub_0808C148(this, FALSE);
|
||||
}
|
||||
sub_0808C01C(this, 1);
|
||||
}
|
||||
@@ -156,7 +157,7 @@ void JarPortal_Action4(Entity* this) {
|
||||
if (!this->z.HALF.HI) {
|
||||
this->action = 1;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
sub_0808C148(this, 1);
|
||||
sub_0808C148(this, TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -171,19 +172,17 @@ void sub_0808C13C(Entity* this) {
|
||||
this->zVelocity = Q_16_16(2.5);
|
||||
}
|
||||
|
||||
void sub_0808C148(Entity* this, u32 a2) {
|
||||
u32 pos;
|
||||
|
||||
pos = COORD_TO_TILE(this);
|
||||
if (!a2) {
|
||||
SetMetaTile(0x4092, pos - 1, this->collisionLayer);
|
||||
SetMetaTile(0x4093, pos, this->collisionLayer);
|
||||
SetMetaTile(0x4094, pos + 63, this->collisionLayer);
|
||||
SetMetaTile(0x4095, pos + 64, this->collisionLayer);
|
||||
void sub_0808C148(Entity* this, bool32 setTiles) {
|
||||
u32 tilePos = COORD_TO_TILE(this);
|
||||
if (!setTiles) {
|
||||
SetMetaTile(SPECIAL_META_TILE_146, tilePos + TILE_POS(-1, 0), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_147, tilePos + TILE_POS(0, 0), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_148, tilePos + TILE_POS(-1, 1), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_149, tilePos + TILE_POS(0, 1), this->collisionLayer);
|
||||
} else {
|
||||
RestorePrevTileEntity(pos - 1, this->collisionLayer);
|
||||
RestorePrevTileEntity(pos, this->collisionLayer);
|
||||
RestorePrevTileEntity(pos + 63, this->collisionLayer);
|
||||
RestorePrevTileEntity(pos + 64, this->collisionLayer);
|
||||
RestorePrevTileEntity(tilePos + TILE_POS(-1, 0), this->collisionLayer);
|
||||
RestorePrevTileEntity(tilePos + 0, this->collisionLayer);
|
||||
RestorePrevTileEntity(tilePos + TILE_POS(-1, 1), this->collisionLayer);
|
||||
RestorePrevTileEntity(tilePos + TILE_POS(0, 1), this->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-8
@@ -11,6 +11,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void LadderUp(Entity* this) {
|
||||
Entity* fxEnt;
|
||||
@@ -37,7 +38,7 @@ void LadderUp(Entity* this) {
|
||||
return;
|
||||
}
|
||||
this->y.HALF.HI = (this->y.HALF.HI & 0xfff0) + 0xc;
|
||||
SetMetaTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
|
||||
break;
|
||||
case 1:
|
||||
if (GravityUpdate(this, Q_8_8(16.0)) == 0) {
|
||||
@@ -65,17 +66,18 @@ void LadderUp(Entity* this) {
|
||||
default:
|
||||
if (this->type2 == 0) {
|
||||
if (gPlayerEntity.y.HALF.HI < this->y.HALF.HI) {
|
||||
if (gPlayerState.floor_type != SURFACE_LADDER && (GetMetaTileTypeByEntity(this) == 0x4017)) {
|
||||
SetMetaTile(0x4023, COORD_TO_TILE(this), this->collisionLayer);
|
||||
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
|
||||
if (gPlayerState.floor_type != SURFACE_LADDER &&
|
||||
(GetMetaTileTypeByEntity(this) == SPECIAL_META_TILE_23)) {
|
||||
SetMetaTile(SPECIAL_META_TILE_35, COORD_TO_TILE(this), this->collisionLayer);
|
||||
RestorePrevTileEntity(COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
if (GetMetaTileTypeByEntity(this) != 0x4017) {
|
||||
SetMetaTile(0x4017, COORD_TO_TILE(this), this->collisionLayer);
|
||||
if (GetMetaTileTypeByEntity(this) != SPECIAL_META_TILE_23) {
|
||||
SetMetaTile(SPECIAL_META_TILE_23, COORD_TO_TILE(this), this->collisionLayer);
|
||||
if (this->type == 0) {
|
||||
SetMetaTile(0x4017, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_23, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
|
||||
} else {
|
||||
SetMetaTile(0x4014, COORD_TO_TILE_OFFSET(this, 0, 0x10), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_20, COORD_TO_TILE_OFFSET(this, 0, 16), this->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -7,9 +7,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -88,15 +88,15 @@ void LightDoor_Action4(LightDoorEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080850FC(LightDoorEntity* this) {
|
||||
u32 position = COORD_TO_TILE(super);
|
||||
u32 tilePos = COORD_TO_TILE(super);
|
||||
u32 layer = super->collisionLayer;
|
||||
SetMetaTile(0x403d, position - 0x41, layer);
|
||||
SetMetaTile(0x403d, position - 0x40, layer);
|
||||
SetMetaTile(0x403d, position - 0x3f, layer);
|
||||
SetMetaTile(0x403d, position - 1, layer);
|
||||
SetMetaTile(0x403d, position, layer);
|
||||
SetMetaTile(0x403d, position + 1, layer);
|
||||
SetMetaTile(0x403d, position + 0x3f, layer);
|
||||
SetMetaTile(0x403d, position + 0x40, layer);
|
||||
SetMetaTile(0x403d, position + 0x41, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, -1), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, -1), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, -1), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, 0), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, 0), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, 0), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(-1, 1), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(0, 1), layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, tilePos + TILE_POS(1, 1), layer);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
static void sub_0809EB30(Entity*);
|
||||
static void sub_0809EAD8(Entity*);
|
||||
@@ -91,7 +91,7 @@ static void sub_0809EAD8(Entity* this) {
|
||||
UpdateRailMovement(this, (u16**)&this->child, &this->field_0x74.HWORD);
|
||||
|
||||
} else {
|
||||
SetMetaTile(0x4050, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_80, COORD_TO_TILE(this), this->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ void sub_08085504(LilypadLargeEntity* this) {
|
||||
super->type = 0;
|
||||
}
|
||||
if (super->type != 0) {
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
if (gArea.locationIndex == 27) { // AREA_TEMPLE_OF_DROPLETS
|
||||
if (CheckLocalFlag(super->type2) == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
|
||||
}
|
||||
if (GetVvvRelativeToEntity(super, 0, 0x18) != VVV_17) {
|
||||
super->subAction = 2;
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
if (gArea.locationIndex == 27) { // AREA_TEMPLE_OF_DROPLETS
|
||||
super->y.HALF.HI += 0xd0;
|
||||
super->z.HALF.HI = -0xd0;
|
||||
this->unk_82 = 0x46;
|
||||
@@ -394,7 +394,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
|
||||
SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
|
||||
}
|
||||
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
if (gArea.locationIndex == 27) { // AREA_TEMPLE_OF_DROPLETS
|
||||
gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0xd0 - gPlayerEntity.y.HALF.HI;
|
||||
} else {
|
||||
gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0x40 - gPlayerEntity.y.HALF.HI;
|
||||
@@ -510,7 +510,7 @@ void sub_08085D60(LilypadLargeEntity* this) {
|
||||
tmp = r4 >> 2;
|
||||
tmpX = gUnk_08120638[tmp];
|
||||
tmpY = gUnk_08120638[tmp + 1];
|
||||
if (GetCollisionDataRelativeTo(super, tmpX, tmpY) == 0xff) {
|
||||
if (GetCollisionDataRelativeTo(super, tmpX, tmpY) == COLLISION_DATA_255) {
|
||||
|
||||
if (sub_080806BC((super->x.HALF.HI - gRoomControls.origin_x) + tmpX,
|
||||
(super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) {
|
||||
@@ -529,7 +529,7 @@ void sub_08085D60(LilypadLargeEntity* this) {
|
||||
tmp = r6 >> 2;
|
||||
tmpX2 = gUnk_08120638[tmp];
|
||||
tmpY2 = gUnk_08120638[tmp + 1];
|
||||
if (GetCollisionDataRelativeTo(super, tmpX2, tmpY2) == 0xff) {
|
||||
if (GetCollisionDataRelativeTo(super, tmpX2, tmpY2) == COLLISION_DATA_255) {
|
||||
if (sub_0807BD14(&gPlayerEntity, r6 >> 3) != 0) {
|
||||
super->direction = (u8)r6;
|
||||
sub_08085E74(this);
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -46,8 +46,8 @@ void sub_08094774(LinkEmptyingBottleEntity* this) {
|
||||
gUnk_08122A18[gPlayerEntity.animationState | 1] << 0x10);
|
||||
}
|
||||
CopyPosition(super->child, super);
|
||||
sub_08094980(this, 0x4032, 0x4033);
|
||||
sub_08094980(this, 0x4061, 0x4022);
|
||||
sub_08094980(this, SPECIAL_META_TILE_50, SPECIAL_META_TILE_51);
|
||||
sub_08094980(this, SPECIAL_META_TILE_97, SPECIAL_META_TILE_34);
|
||||
break;
|
||||
case 1:
|
||||
effect = CreateFx(super, FX_GREEN_SPLASH2, 0);
|
||||
@@ -61,8 +61,8 @@ void sub_08094774(LinkEmptyingBottleEntity* this) {
|
||||
super->timer = 0;
|
||||
super->spritePriority.b0 = 0;
|
||||
super->spriteRendering.b3 = 0;
|
||||
sub_08094980(this, 0x403b, 0x403c);
|
||||
sub_08094980(this, 0x4061, 0x4022);
|
||||
sub_08094980(this, SPECIAL_META_TILE_59, SPECIAL_META_TILE_60);
|
||||
sub_08094980(this, SPECIAL_META_TILE_97, SPECIAL_META_TILE_34);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -120,7 +120,7 @@ void sub_08094980(LinkEmptyingBottleEntity* this, u32 searchTileIndex, u32 repla
|
||||
yOffset = gUnk_08122A28[index + 1];
|
||||
if (searchTileIndex == sub_080B1A0C(super, xOffset, yOffset)) {
|
||||
SetMetaTile(replaceTileIndex, TILE(super->x.HALF.HI + xOffset, super->y.HALF.HI + yOffset),
|
||||
super->collisionLayer);
|
||||
super->collisionLayer);
|
||||
}
|
||||
index += 2;
|
||||
}
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void LockedDoor_Init(Entity*);
|
||||
void LockedDoor_Action1(Entity*);
|
||||
@@ -251,12 +251,12 @@ void sub_080836A0(Entity* this) {
|
||||
this->spriteSettings.draw = 1;
|
||||
this->x.HALF.HI = this->field_0x70.HALF.LO;
|
||||
this->y.HALF.HI = this->field_0x70.HALF.HI;
|
||||
SetMetaTile(0x4022, this->field_0x76.HWORD, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->field_0x76.HWORD, this->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_080836DC(Entity* this, u32 unk_0, u32 unk_1) {
|
||||
const struct_0811F680* tmp;
|
||||
SetMetaTile(0x4022, unk_1, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, unk_1, this->collisionLayer);
|
||||
this->timer = 7;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->direction = (unk_0 << 3) ^ 0x10;
|
||||
|
||||
+30
-28
@@ -5,8 +5,10 @@
|
||||
* @brief Macro Acorn object
|
||||
*/
|
||||
#include "entity.h"
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
#include "physics.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void MacroAcorn_Init(Entity*);
|
||||
void MacroAcorn_Action1(Entity*);
|
||||
@@ -68,38 +70,38 @@ void sub_0809E5F0(Entity* this) {
|
||||
this->field_0x80.HWORD = position;
|
||||
switch (this->type) {
|
||||
case 2:
|
||||
SetMetaTile(0x4022, position - 0x3d, 1);
|
||||
SetMetaTile(0x406d, position - 0x3c, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(3, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, position + TILE_POS(4, -1), LAYER_BOTTOM);
|
||||
case 0:
|
||||
SetMetaTile(0x406c, position - 0x42, 1);
|
||||
SetMetaTile(0x4022, position - 0x41, 1);
|
||||
SetMetaTile(0x4022, position - 0x40, 1);
|
||||
SetMetaTile(0x4022, position - 0x3f, 1);
|
||||
SetMetaTile(0x4022, position - 2, 1);
|
||||
SetMetaTile(0x4022, position - 1, 1);
|
||||
SetMetaTile(0x4022, position, 1);
|
||||
SetMetaTile(0x4022, position + 1, 1);
|
||||
SetMetaTile(0x406e, position + 0x3e, 1);
|
||||
SetMetaTile(0x4022, position + 0x3f, 1);
|
||||
SetMetaTile(0x4022, position + 0x40, 1);
|
||||
SetMetaTile(0x406f, position + 0x41, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, position + TILE_POS(-2, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_110, position + TILE_POS(-2, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_111, position + TILE_POS(1, 1), LAYER_BOTTOM);
|
||||
break;
|
||||
case 3:
|
||||
SetMetaTile(0x4022, position - 0x44, 1);
|
||||
SetMetaTile(0x406c, position - 0x45, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-4, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_108, position + TILE_POS(-5, -1), LAYER_BOTTOM);
|
||||
case 1:
|
||||
SetMetaTile(0x4022, position - 0x42, 1);
|
||||
SetMetaTile(0x4022, position - 0x41, 1);
|
||||
SetMetaTile(0x4022, position - 0x40, 1);
|
||||
SetMetaTile(0x406d, position - 0x3f, 1);
|
||||
SetMetaTile(0x4022, position - 2, 1);
|
||||
SetMetaTile(0x4022, position - 1, 1);
|
||||
SetMetaTile(0x4022, position, 1);
|
||||
SetMetaTile(0x4022, position + 1, 1);
|
||||
SetMetaTile(0x406e, position + 0x3e, 1);
|
||||
SetMetaTile(0x4022, position + 0x3f, 1);
|
||||
SetMetaTile(0x4022, position + 0x40, 1);
|
||||
SetMetaTile(0x406f, position + 0x41, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_109, position + TILE_POS(1, -1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-2, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(1, 0), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_110, position + TILE_POS(-2, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(-1, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, position + TILE_POS(0, 1), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_111, position + TILE_POS(1, 1), LAYER_BOTTOM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-3
@@ -10,6 +10,7 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "npc.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -136,8 +137,26 @@ void MacroBook_Action3(MacroBookEntity* this) {
|
||||
void sub_0809A958(MacroBookEntity* this) {
|
||||
|
||||
static const u16 tileIndices[] = {
|
||||
0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074,
|
||||
0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0x4074, 0, 0, 0x4022, 0x4022,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
SPECIAL_META_TILE_116,
|
||||
0,
|
||||
0,
|
||||
SPECIAL_META_TILE_34,
|
||||
SPECIAL_META_TILE_34,
|
||||
};
|
||||
int index;
|
||||
int index2;
|
||||
@@ -151,7 +170,7 @@ void sub_0809A958(MacroBookEntity* this) {
|
||||
for (index = 0; index < 5; index++, tilePos += 0x40) {
|
||||
for (index2 = 0; index2 < 4; index2++, tileIndexPtr++) {
|
||||
if ((*tileIndexPtr & 0x4000) != 0) {
|
||||
SetMetaTile(*tileIndexPtr, tilePos + index2, 1);
|
||||
SetMetaTile(*tileIndexPtr, tilePos + index2, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "map.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -82,14 +84,21 @@ void MacroDecoration_Action1(MacroDecorationEntity* this) {
|
||||
|
||||
void sub_08097EB8(MacroDecorationEntity* this) {
|
||||
static const s16 tilePosArray[] = {
|
||||
0xff7e, 0x4089, 0xff7f, 0x4022, 0xff80, 0x4022, 0xff81, 0x408a, 0xffbe, 0x4022, 0xffbf, 0x4022, 0xffc0, 0x4022,
|
||||
0xffc1, 0x4022, 0xfffe, 0x4022, 0xffff, 0x4022, 0, 0x4022, 1, 0x4022, 2, 0x408b, 0x3e, 0x4022,
|
||||
0x3f, 0x4022, 0x40, 0x4026, 0x41, 0x4022, 0x7e, 0x408c, 0x7f, 0x408c, 0x7fff, 0xffff,
|
||||
0xff7e, SPECIAL_META_TILE_137, 0xff7f, SPECIAL_META_TILE_34,
|
||||
0xff80, SPECIAL_META_TILE_34, 0xff81, SPECIAL_META_TILE_138,
|
||||
0xffbe, SPECIAL_META_TILE_34, 0xffbf, SPECIAL_META_TILE_34,
|
||||
0xffc0, SPECIAL_META_TILE_34, 0xffc1, SPECIAL_META_TILE_34,
|
||||
0xfffe, SPECIAL_META_TILE_34, 0xffff, SPECIAL_META_TILE_34,
|
||||
0, SPECIAL_META_TILE_34, 1, SPECIAL_META_TILE_34,
|
||||
2, SPECIAL_META_TILE_139, 0x3e, SPECIAL_META_TILE_34,
|
||||
0x3f, SPECIAL_META_TILE_34, 0x40, SPECIAL_META_TILE_38,
|
||||
0x41, SPECIAL_META_TILE_34, 0x7e, SPECIAL_META_TILE_140,
|
||||
0x7f, SPECIAL_META_TILE_140, 0x7fff, 0xffff,
|
||||
};
|
||||
const s16* tilePosPtr;
|
||||
u16 tile = COORD_TO_TILE(super);
|
||||
for (tilePosPtr = tilePosArray; *tilePosPtr != 0x7fff; tilePosPtr += 2) {
|
||||
SetMetaTile((u16)tilePosPtr[1], tile + tilePosPtr[0], 1);
|
||||
SetMetaTile((u16)tilePosPtr[1], tile + tilePosPtr[0], LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "tiles.h"
|
||||
#include "map.h"
|
||||
|
||||
void MacroShoe_Init(Entity*);
|
||||
void MacroShoe_Idle(Entity*);
|
||||
@@ -39,9 +41,9 @@ void MacroShoe_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->hitbox = (Hitbox*)MacroShoe_TypeHitboxes[this->type];
|
||||
if (this->type2 == 1) {
|
||||
SetMetaTile(0x4024, 0x410, 1);
|
||||
SetMetaTile(0x4026, 0x411, 1);
|
||||
SetMetaTile(0x4025, 0x412, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_36, TILE_POS(16, 16), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_38, TILE_POS(17, 16), LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_37, TILE_POS(18, 16), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void Mask_Init(Entity*);
|
||||
void Mask_Action1(Entity*);
|
||||
@@ -59,11 +60,11 @@ void Mask_Init(Entity* this) {
|
||||
this->frameIndex = this->type2 & 0x3f;
|
||||
|
||||
this->field_0x7c.HALF_U.HI = COORD_TO_TILE(this);
|
||||
this->field_0x7c.HALF_U.LO = GetMetaTileIndex(this->field_0x7c.HALF_U.HI, 1);
|
||||
this->field_0x7c.HALF_U.LO = GetMetaTileIndex(this->field_0x7c.HALF_U.HI, LAYER_BOTTOM);
|
||||
|
||||
this->field_0x7a.HWORD = GetCollisionDataAtMetaTilePos((u16)this->field_0x7c.HALF.HI, 1);
|
||||
this->field_0x7a.HWORD = GetCollisionDataAtMetaTilePos((u16)this->field_0x7c.HALF.HI, LAYER_BOTTOM);
|
||||
|
||||
SetMetaTile(0x4022, this->field_0x7c.HALF_U.HI, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->field_0x7c.HALF_U.HI, LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
// Probably related to knocking it down
|
||||
@@ -88,7 +89,7 @@ void Mask_Action1(Entity* this) {
|
||||
}
|
||||
|
||||
// Presumably, make the mask fall
|
||||
SetMetaTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, 1);
|
||||
SetMetaTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, LAYER_BOTTOM);
|
||||
|
||||
SetCollisionData(this->field_0x7a.HWORD, (u16)this->field_0x7c.HALF.HI, 1);
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "entity.h"
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern u32 sub_08083734(Entity*, u32);
|
||||
void sub_080A080C(Entity*);
|
||||
@@ -106,9 +106,9 @@ void sub_080A080C(Entity* this) {
|
||||
this->field_0x76.HWORD = GetMetaTileIndex(this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||
this->field_0x78.HWORD = GetMetaTileIndex(this->field_0x74.HWORD, this->collisionLayer);
|
||||
this->field_0x7a.HWORD = GetMetaTileIndex(this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||
SetMetaTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||
SetMetaTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->field_0x74.HWORD, this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_080A0870(Entity* this) {
|
||||
|
||||
@@ -61,7 +61,7 @@ void Minecart_Init(MinecartEntity* this) {
|
||||
super->speed = 0x700;
|
||||
super->spritePriority.b1 = 3;
|
||||
InitAnimationForceUpdate(super, super->type2 + 4 + super->animationState);
|
||||
SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
|
||||
void Minecart_Action1(MinecartEntity* this) {
|
||||
@@ -290,7 +290,7 @@ void Minecart_Action6(MinecartEntity* this) {
|
||||
minecartData->room = gRoomControls.room;
|
||||
minecartData->animationState = super->animationState;
|
||||
InitAnimationForceUpdate(super, super->animationState + 0x10);
|
||||
SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(super);
|
||||
gPlayerEntity.spritePriority.b0 = super->spritePriority.b0 - 1;
|
||||
@@ -312,7 +312,7 @@ void Minecart_Action7(MinecartEntity* this) {
|
||||
bool32 sub_08091DDC(MinecartEntity* this) {
|
||||
static const s8 gUnk_081223D0[] = { 0, -8, 8, 0, 0, 8, -8, 0 };
|
||||
if ((GetCollisionDataRelativeTo(super, gUnk_081223D0[super->animationState * 2],
|
||||
gUnk_081223D0[super->animationState * 2 + 1]) == 0xff) &&
|
||||
gUnk_081223D0[super->animationState * 2 + 1]) == COLLISION_DATA_255) &&
|
||||
(sub_0807BD14(&gPlayerEntity, super->animationState))) {
|
||||
super->updatePriority = 6;
|
||||
super->action = 5;
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[8];
|
||||
/*0x70*/ u16 unk_70;
|
||||
/*0x72*/ u16 unk_72;
|
||||
/*0x74*/ u16 unk_74;
|
||||
/*0x76*/ u16 unk_76;
|
||||
/*0x74*/ u16 metaTileIndex;
|
||||
/*0x76*/ u16 metaTilePos;
|
||||
/*0x78*/ u8 unk_78[0x6];
|
||||
/*0x7e*/ u8 unk_7e;
|
||||
/*0x7f*/ u8 unk_7f[0x7];
|
||||
@@ -54,8 +54,8 @@ void MinecartDoor_Init(MinecartDoorEntity* this) {
|
||||
this->unk_70 = super->x.HALF.HI;
|
||||
this->unk_72 = super->y.HALF.HI;
|
||||
super->spritePriority.b0 = 5;
|
||||
this->unk_76 = COORD_TO_TILE(super);
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_76, super->collisionLayer);
|
||||
this->metaTilePos = COORD_TO_TILE(super);
|
||||
this->metaTileIndex = GetMetaTileIndex(this->metaTilePos, super->collisionLayer);
|
||||
super->frameIndex = super->type;
|
||||
if (sub_08096CEC(this)) {
|
||||
if (this->unk_7e != 0) {
|
||||
@@ -66,7 +66,7 @@ void MinecartDoor_Init(MinecartDoorEntity* this) {
|
||||
} else {
|
||||
super->action = 1;
|
||||
super->spriteSettings.draw = 1;
|
||||
SetMetaTile(0x4022, this->unk_76, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, this->metaTilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void MinecartDoor_Action1(MinecartDoorEntity* this) {
|
||||
super->action = 2;
|
||||
super->timer = 7;
|
||||
super->direction = super->type << 3;
|
||||
SetMetaTile(this->unk_74, this->unk_76, super->collisionLayer);
|
||||
SetMetaTile(this->metaTileIndex, this->metaTilePos, super->collisionLayer);
|
||||
EnqueueSFX(SFX_10B);
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ void MinecartDoor_Action3(MinecartDoorEntity* this) {
|
||||
}
|
||||
if (bVar3 == FALSE) {
|
||||
super->action = 4;
|
||||
sub_080836DC(super, super->type, this->unk_76);
|
||||
sub_080836DC(super, super->type, this->metaTilePos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "screen.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -90,7 +90,7 @@ void MinishVillageObject_Type1(MinishVillageObjectEntity* this) {
|
||||
super->subtimer = 0;
|
||||
super->frameIndex = 0;
|
||||
super->spritePriority.b0 = 7;
|
||||
SetMetaTile(0x4069, COORD_TO_TILE(super) - 0x40, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_105, COORD_TO_TILE(super) - TILE_POS(0, 1), LAYER_BOTTOM);
|
||||
break;
|
||||
case 2:
|
||||
if ((gRoomTransition.frameCount & 3U) == 0) {
|
||||
@@ -224,7 +224,7 @@ void MinishVillageObject_Type8_Init(MinishVillageObjectEntity* this) {
|
||||
if (super->type2 != 0) {
|
||||
tilePosition -= 0x40;
|
||||
}
|
||||
SetMetaTile(0x4069, tilePosition, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_105, tilePosition, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ void MinishVillageObject_Type8_Action1(MinishVillageObjectEntity* this) {
|
||||
super->timer = 8;
|
||||
super->spriteRendering.alphaBlend = 0;
|
||||
gScreen.controls.layerFXControl = 0;
|
||||
SetMetaTile(0x4069, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_105, COORD_TO_TILE(super), super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ void MoleMittsParticle_Init(Entity* this) {
|
||||
}
|
||||
sub_08087640(this);
|
||||
} else {
|
||||
if (gArea.locationIndex == 0x10) {
|
||||
if (gArea.locationIndex == 16) { // AREA_CLOUD_TOPS
|
||||
palette = 0x16a;
|
||||
} else {
|
||||
palette = 4;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -81,18 +82,16 @@ void Object1F_Action1(Object1FEntity* this) {
|
||||
}
|
||||
|
||||
void Object1F_Action2(Object1FEntity* this) {
|
||||
u8 bVar1;
|
||||
|
||||
bVar1 = GetCollisionDataAtEntity(super);
|
||||
switch (bVar1) {
|
||||
case 0x21:
|
||||
u8 collisionData = GetCollisionDataAtEntity(super);
|
||||
switch (collisionData) {
|
||||
case COLLISION_DATA_33:
|
||||
CreateFx(super, FX_FALL_DOWN, 0);
|
||||
break;
|
||||
case 0x25:
|
||||
case COLLISION_DATA_37:
|
||||
CreateFx(super, FX_LAVA_SPLASH, 0);
|
||||
break;
|
||||
case 0x24:
|
||||
case 0x30:
|
||||
case COLLISION_DATA_36:
|
||||
case COLLISION_DATA_48:
|
||||
CreateFx(super, FX_WATER_SPLASH, 0);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "flags.h"
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
|
||||
@@ -21,10 +21,10 @@ void ObjectA(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->hitbox = (Hitbox*)&gHitbox_2;
|
||||
if (this->collisionLayer == 1) {
|
||||
uVar2 = 0x26;
|
||||
if (this->collisionLayer == LAYER_BOTTOM) {
|
||||
uVar2 = META_TILE_TYPE_38;
|
||||
} else {
|
||||
uVar2 = 0x34;
|
||||
uVar2 = META_TILE_TYPE_52;
|
||||
}
|
||||
this->field_0x70.HALF.LO = uVar2;
|
||||
if (CheckFlags(this->field_0x86.HWORD) != 0) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -115,8 +116,8 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
|
||||
}
|
||||
|
||||
switch (tileType) {
|
||||
case 0x4030:
|
||||
case 0x4031:
|
||||
case SPECIAL_META_TILE_48:
|
||||
case SPECIAL_META_TILE_49:
|
||||
super->action = 3;
|
||||
super->direction = Direction8FromAnimationState(gPlayerEntity.animationState);
|
||||
super->speed = 0x80;
|
||||
@@ -135,23 +136,23 @@ void ObjectBlockingStairs_Action1(ObjectBlockingStairsEntity* this) {
|
||||
if (this->unk7b & 0x80) {
|
||||
this->unk7b &= ~0x80;
|
||||
if ((this->unk7b & 0x40) != 0) {
|
||||
SetMetaTile(0x402c, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePos + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_44, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + 1, super->collisionLayer);
|
||||
} else {
|
||||
SetMetaTile(0x403d, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x402d, this->tilePos + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_45, this->tilePos + 1, super->collisionLayer);
|
||||
}
|
||||
} else if (this->unk7b & 0x40) {
|
||||
if (xDist >= 5) {
|
||||
this->unk7b &= ~(0x40 | 0x80);
|
||||
SetMetaTile(0x403d, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x402d, this->tilePos + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_45, this->tilePos + 1, super->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
if (-xDist > 4) {
|
||||
this->unk7b |= 0x40;
|
||||
SetMetaTile(0x402c, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(0x403d, this->tilePos + 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_44, this->tilePos - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_61, this->tilePos + 1, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,10 +193,18 @@ void ObjectBlockingStairs_Action4(ObjectBlockingStairsEntity* this) {
|
||||
}
|
||||
|
||||
void sub_080931A4(ObjectBlockingStairsEntity* this, u32 param_2) {
|
||||
static const u16 gUnk_08122850[] = { 0x4027, 0x4023, 0x4028, 0x402c, 0x402b, 0x402d, 0x4029, 0x4026, 0x402a };
|
||||
static const u16 gUnk_08122862[] = { 0x4027, 0x4023, 0x4028, 0x4024, 0x4022, 0x4025, 0x4029, 0x4026, 0x402a };
|
||||
static const u16 gUnk_08122874[] = { 0x4027, 0x4023, 0x4023, 0x4024, 0x4022, 0x4022, 0x4029, 0x4026, 0x4026 };
|
||||
static const u16 gUnk_08122886[] = { 0x4023, 0x4023, 0x4028, 0x4022, 0x4022, 0x4025, 0x4026, 0x4026, 0x402a };
|
||||
static const u16 gUnk_08122850[] = { SPECIAL_META_TILE_39, SPECIAL_META_TILE_35, SPECIAL_META_TILE_40,
|
||||
SPECIAL_META_TILE_44, SPECIAL_META_TILE_43, SPECIAL_META_TILE_45,
|
||||
SPECIAL_META_TILE_41, SPECIAL_META_TILE_38, SPECIAL_META_TILE_42 };
|
||||
static const u16 gUnk_08122862[] = { SPECIAL_META_TILE_39, SPECIAL_META_TILE_35, SPECIAL_META_TILE_40,
|
||||
SPECIAL_META_TILE_36, SPECIAL_META_TILE_34, SPECIAL_META_TILE_37,
|
||||
SPECIAL_META_TILE_41, SPECIAL_META_TILE_38, SPECIAL_META_TILE_42 };
|
||||
static const u16 gUnk_08122874[] = { SPECIAL_META_TILE_39, SPECIAL_META_TILE_35, SPECIAL_META_TILE_35,
|
||||
SPECIAL_META_TILE_36, SPECIAL_META_TILE_34, SPECIAL_META_TILE_34,
|
||||
SPECIAL_META_TILE_41, SPECIAL_META_TILE_38, SPECIAL_META_TILE_38 };
|
||||
static const u16 gUnk_08122886[] = { SPECIAL_META_TILE_35, SPECIAL_META_TILE_35, SPECIAL_META_TILE_40,
|
||||
SPECIAL_META_TILE_34, SPECIAL_META_TILE_34, SPECIAL_META_TILE_37,
|
||||
SPECIAL_META_TILE_38, SPECIAL_META_TILE_38, SPECIAL_META_TILE_42 };
|
||||
|
||||
u32 collisionLayer;
|
||||
const u16* pTileTypes;
|
||||
|
||||
+20
-19
@@ -16,7 +16,7 @@ typedef struct {
|
||||
/*0x68*/ u8 unk_68[8];
|
||||
/*0x70*/ u16 tileIndex;
|
||||
/*0x72*/ u16 unk_72;
|
||||
/*0x74*/ u16 tilePosition;
|
||||
/*0x74*/ u16 tilePos;
|
||||
/*0x76*/ u16 unk_76;
|
||||
/*0x78*/ u8 unk_78[0x4];
|
||||
/*0x7c*/ u8 unk_7c;
|
||||
@@ -25,7 +25,7 @@ typedef struct {
|
||||
/*0x7f*/ u8 unk_7f;
|
||||
/*0x80*/ u8 unk_80[0x4];
|
||||
/*0x84*/ u16 hitFlag;
|
||||
/*0x86*/ u16 unk_86;
|
||||
/*0x86*/ u16 flag;
|
||||
} ObjectOnPillarEntity;
|
||||
|
||||
extern bool32 sub_080896B0(void); // pushableStatue
|
||||
@@ -66,7 +66,7 @@ void ObjectOnPillar_Init(ObjectOnPillarEntity* this) {
|
||||
static const u8 gUnk_08123264[] = {
|
||||
0, 2, 4, 3, 7, 5, 0, 0,
|
||||
};
|
||||
if (CheckFlags(this->unk_86) == 0) {
|
||||
if (CheckFlags(this->flag) == 0) {
|
||||
super->action = 1;
|
||||
super->speed = 0x80;
|
||||
super->updatePriority = 3;
|
||||
@@ -150,8 +150,8 @@ void ObjectOnPillar_Action4(ObjectOnPillarEntity* this) {
|
||||
|
||||
bool32 sub_08097008(ObjectOnPillarEntity* this) {
|
||||
Entity* effect;
|
||||
u32 tileType = GetMetaTileType(this->tilePosition, super->collisionLayer);
|
||||
if (tileType != 0x4036) {
|
||||
u32 tileType = GetMetaTileType(this->tilePos, super->collisionLayer);
|
||||
if (tileType != SPECIAL_META_TILE_54) {
|
||||
switch (sub_08097074(tileType)) {
|
||||
case 1:
|
||||
super->direction = (((tileType - 0x37) & 3) << 3);
|
||||
@@ -175,7 +175,8 @@ bool32 sub_08097008(ObjectOnPillarEntity* this) {
|
||||
u32 sub_08097074(u32 tileType) {
|
||||
|
||||
static const KeyValuePair gUnk_0812327C[] = {
|
||||
{ 0x4037, 1 }, { 0x4038, 1 }, { 0x4039, 1 }, { 0x403a, 1 }, { 0x7a, 2 }, { 0x78, 2 },
|
||||
{ SPECIAL_META_TILE_55, 1 }, { SPECIAL_META_TILE_56, 1 }, { SPECIAL_META_TILE_57, 1 },
|
||||
{ SPECIAL_META_TILE_58, 1 }, { META_TILE_TYPE_122, 2 }, { META_TILE_TYPE_120, 2 },
|
||||
};
|
||||
static const u16 gUnk_0812327CEnd = 0;
|
||||
const KeyValuePair* entry = gUnk_0812327C;
|
||||
@@ -191,17 +192,17 @@ void sub_08097098(ObjectOnPillarEntity* this) {
|
||||
u16 tileType;
|
||||
this->unk_76 = 0x20;
|
||||
EnqueueSFX(SFX_10F);
|
||||
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
tileType = GetMetaTileType(gUnk_080B4488[super->direction >> 3] + this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
tileType = GetMetaTileType(gUnk_080B4488[super->direction >> 3] + this->tilePos, super->collisionLayer);
|
||||
if ((tileType == 0x79) || tileType == 0x77) {
|
||||
super->spriteOffsetY = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080970F4(ObjectOnPillarEntity* this) {
|
||||
this->tilePosition = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(0x4036, this->tilePosition, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_54, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
bool32 sub_08097144(ObjectOnPillarEntity* this) {
|
||||
@@ -224,8 +225,8 @@ bool32 sub_08097194(ObjectOnPillarEntity* this) {
|
||||
return TRUE;
|
||||
} else {
|
||||
u32 tileType = GetMetaTileTypeByEntity(super);
|
||||
if (tileType == 0x71 || tileType == 0x72 || (tileType == 0x4020)) {
|
||||
SetFlag(this->unk_86);
|
||||
if (tileType == META_TILE_TYPE_113 || tileType == META_TILE_TYPE_114 || tileType == SPECIAL_META_TILE_32) {
|
||||
SetFlag(this->flag);
|
||||
EnqueueSFX(SFX_10B);
|
||||
sub_080971E0(this);
|
||||
return TRUE;
|
||||
@@ -238,7 +239,7 @@ bool32 sub_08097194(ObjectOnPillarEntity* this) {
|
||||
|
||||
void sub_080971E0(ObjectOnPillarEntity* this) {
|
||||
EntityWithHitFlag* entity;
|
||||
u32 tilePosition;
|
||||
u32 tilePos;
|
||||
|
||||
entity = (EntityWithHitFlag*)CreateObject(SPECIAL_FX, FX_DASH, 0x40);
|
||||
if (entity != NULL) {
|
||||
@@ -258,9 +259,9 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
|
||||
DeleteThisEntity();
|
||||
break;
|
||||
case 1:
|
||||
tilePosition = COORD_TO_TILE(super);
|
||||
if (sub_08097348(tilePosition) == 0) {
|
||||
SetMetaTileType(0x73, tilePosition, super->collisionLayer);
|
||||
tilePos = COORD_TO_TILE(super);
|
||||
if (sub_08097348(tilePos) == 0) {
|
||||
SetMetaTileType(META_TILE_TYPE_115, tilePos, super->collisionLayer);
|
||||
}
|
||||
DeleteThisEntity();
|
||||
break;
|
||||
@@ -287,11 +288,11 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_08097348(u32 tilePosition) {
|
||||
bool32 sub_08097348(u32 tilePos) {
|
||||
u32 index;
|
||||
TileEntity* tileEntity = gSmallChests;
|
||||
for (index = 0; index < ARRAY_COUNT(gSmallChests); index++, tileEntity++) {
|
||||
if (tileEntity->tilePos == tilePosition) {
|
||||
if (tileEntity->tilePos == tilePos) {
|
||||
return CheckLocalFlag(tileEntity->localFlag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,8 @@ bool32 sub_0809A6F8(u32 param_1, u32 param_2, u32 param_3, u32 param_4) {
|
||||
if (sub_0809A758(param_1, param_2) != 0) {
|
||||
if (gUnk_081238A0[param_3] != 0) {
|
||||
if ((param_4 & 1) != 0) {
|
||||
SetMetaTileByIndex(gUnk_081238A0[param_3], (param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6, 1);
|
||||
SetMetaTileByIndex(gUnk_081238A0[param_3], (param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6,
|
||||
LAYER_BOTTOM);
|
||||
} else {
|
||||
RestorePrevTileEntity((param_1 >> 4 & 0x3f) | (param_2 >> 4 & 0x3f) << 6, 1);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* @brief Palace Archway object
|
||||
*/
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void PalaceArchway_Init(Entity*);
|
||||
void PalaceArchway_Action1(Entity*);
|
||||
@@ -22,7 +23,7 @@ void PalaceArchway_Init(Entity* this) {
|
||||
this->frameIndex = this->type2;
|
||||
this->spriteRendering.b3 = 3;
|
||||
this->spritePriority.b0 = 7;
|
||||
SetMetaTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_105, COORD_TO_TILE(this), this->collisionLayer);
|
||||
}
|
||||
|
||||
void PalaceArchway_Action1(Entity* this) {
|
||||
|
||||
+5
-4
@@ -7,8 +7,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "map.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void Paper_Init(Entity*);
|
||||
void Paper_Action1(Entity*);
|
||||
@@ -43,7 +44,7 @@ void Paper_Type0(Entity* this) {
|
||||
}
|
||||
this->spriteSettings.draw = 0;
|
||||
}
|
||||
SetMetaTile(0x4051, COORD_TO_TILE(this), 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_81, COORD_TO_TILE(this), LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void Paper_Type1(Entity* this) {
|
||||
@@ -63,8 +64,8 @@ void Paper_Type2(Entity* this) {
|
||||
this->action = 1;
|
||||
this->y.HALF.HI++;
|
||||
this->spriteOffsetY = -1;
|
||||
SetMetaTile(0x4051, COORD_TO_TILE(this) - 1, 1);
|
||||
SetMetaTile(0x4051, COORD_TO_TILE(this), 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_81, COORD_TO_TILE(this) - 1, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_81, COORD_TO_TILE(this), LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void Paper_Action1(Entity* this) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -52,7 +53,7 @@ void PlayerClone_Init(PlayerCloneEntity* this) {
|
||||
super->y.HALF.HI = (super->y.HALF.HI & 0xfff0) | 8;
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
InitializeAnimation(super, 8);
|
||||
SetMetaTile(0x4016, this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_22, this->tilePos, super->collisionLayer);
|
||||
SoundReq(SFX_112);
|
||||
}
|
||||
|
||||
@@ -78,7 +79,7 @@ void PlayerClone_Action1(PlayerCloneEntity* this) {
|
||||
if ((this->unk78 != 0) && (this->unk7a != 0)) {
|
||||
((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 = 1;
|
||||
}
|
||||
CloneTile(0x315, this->tilePos, super->collisionLayer);
|
||||
CloneTile(META_TILE_TYPE_789, this->tilePos, super->collisionLayer);
|
||||
super->child = sub_08077CF8(1, super->type + 1, 0, ((GenericEntity*)gPlayerState.item)->field_0x68.HALF.LO);
|
||||
if (super->child != NULL) {
|
||||
super->child->parent = super;
|
||||
@@ -87,7 +88,7 @@ void PlayerClone_Action1(PlayerCloneEntity* this) {
|
||||
sub_0806FDA0(super);
|
||||
PlayerClone_Action2(this);
|
||||
} else if (gPlayerState.chargeState.action != 4) {
|
||||
CloneTile(0x315, this->tilePos, super->collisionLayer);
|
||||
CloneTile(META_TILE_TYPE_789, this->tilePos, super->collisionLayer);
|
||||
gPlayerClones[super->type] = NULL;
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
@@ -191,7 +192,8 @@ void sub_08084CAC(PlayerCloneEntity* this) {
|
||||
|
||||
if (((PlayerCloneEntity*)gPlayerClones[super->type])->unk70 == 0) {
|
||||
ptr = &gUnk_080B4468[super->animationState & 6];
|
||||
if (sub_080B1B54(GetMetaTileType(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == 0x72) {
|
||||
if (GetVvvForMetaTileType(
|
||||
GetMetaTileType(COORD_TO_TILE_OFFSET(super, -ptr[0], -ptr[1]), super->collisionLayer)) == VVV_114) {
|
||||
((PlayerCloneEntity*)gPlayerClones[0])->unk6c |= (1 << super->type);
|
||||
} else {
|
||||
((PlayerCloneEntity*)gPlayerClones[0])->unk6c &= ~(1 << super->type);
|
||||
|
||||
+11
-11
@@ -69,11 +69,11 @@ void Pot_Init(Entity* this) {
|
||||
}
|
||||
|
||||
this->field_0x70.HALF.LO = GetMetaTileIndex(COORD_TO_TILE(this), this->collisionLayer);
|
||||
if ((u16)this->field_0x70.HALF.LO == 0x4000) {
|
||||
if ((u16)this->field_0x70.HALF.LO == SPECIAL_META_TILE_0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_0, COORD_TO_TILE(this), this->collisionLayer);
|
||||
InitializeAnimation(this, 5);
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ void Pot_Action1(Entity* this) {
|
||||
tileType = GetMetaTileTypeByEntity(this);
|
||||
if (tileType != 0x4000) {
|
||||
switch (tileType) {
|
||||
case 0x4004:
|
||||
case 0x4003:
|
||||
case 0x4002:
|
||||
case 0x4001:
|
||||
this->direction = (tileType - 0x4001) * 8;
|
||||
case SPECIAL_META_TILE_4:
|
||||
case SPECIAL_META_TILE_3:
|
||||
case SPECIAL_META_TILE_2:
|
||||
case SPECIAL_META_TILE_1:
|
||||
this->direction = (tileType - SPECIAL_META_TILE_1) * 8;
|
||||
this->timer = 32;
|
||||
this->action = 4;
|
||||
if (gPlayerState.flags & PL_MINISH) {
|
||||
@@ -113,14 +113,14 @@ void Pot_Action1(Entity* this) {
|
||||
SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
EnqueueSFX(SFX_10F);
|
||||
break;
|
||||
case 0x4067:
|
||||
case SPECIAL_META_TILE_103:
|
||||
SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
DeleteThisEntity();
|
||||
break;
|
||||
default:
|
||||
if (GetVvvAtEntity(this) == VVV_13) {
|
||||
CreateFx(this, FX_FALL_DOWN, 0);
|
||||
} else if (tileType == 0x4005) {
|
||||
} else if (tileType == SPECIAL_META_TILE_5) {
|
||||
gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT;
|
||||
SetMetaTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void Pot_Action4(Entity* this) {
|
||||
sub_08082850(this, NULL);
|
||||
break;
|
||||
default:
|
||||
SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_0, COORD_TO_TILE(this), this->collisionLayer);
|
||||
RegisterCarryEntity(this);
|
||||
break;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ void sub_0808270C(Entity* this) {
|
||||
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->contactFlags & 0x7F) != 0x13) {
|
||||
this->spriteOffsetX = 0;
|
||||
this->action = 1;
|
||||
SetMetaTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_0, COORD_TO_TILE(this), this->collisionLayer);
|
||||
} else {
|
||||
sub_0806F4E8(this);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -62,7 +62,7 @@ void PullableMushroom_Init(PullableMushroomEntity* this) {
|
||||
super->spritePriority.b0 = 4;
|
||||
super->hitbox = (Hitbox*)&gUnk_080FD224;
|
||||
super->carryFlags = 1;
|
||||
SetMetaTile(0x4022, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, COORD_TO_TILE(super), super->collisionLayer);
|
||||
super->health = 1;
|
||||
super->collisionFlags = 7;
|
||||
super->hitType = 0x6e;
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -171,8 +171,8 @@ void PushableFurniture_Action1(PushableFurnitureEntity* this) {
|
||||
void sub_0808FB68(PushableFurnitureEntity* this) {
|
||||
u32 tileIndex = GetMetaTileIndex(this->unk_70, super->collisionLayer);
|
||||
switch (tileIndex) {
|
||||
case 0x4030:
|
||||
case 0x4031:
|
||||
case SPECIAL_META_TILE_48:
|
||||
case SPECIAL_META_TILE_49:
|
||||
super->action = 2;
|
||||
super->direction = (((tileIndex - 0x30) & 1) << 4) | 8;
|
||||
SetPlayerControl(CONTROL_1);
|
||||
@@ -181,8 +181,8 @@ void sub_0808FB68(PushableFurnitureEntity* this) {
|
||||
default:
|
||||
tileIndex = GetMetaTileIndex(this->unk_72, super->collisionLayer);
|
||||
switch (tileIndex) {
|
||||
case 0x4030:
|
||||
case 0x4031:
|
||||
case SPECIAL_META_TILE_48:
|
||||
case SPECIAL_META_TILE_49:
|
||||
super->action = 2;
|
||||
super->direction = (((tileIndex - 0x30) & 1) << 4) | 8;
|
||||
SetPlayerControl(CONTROL_1);
|
||||
@@ -196,7 +196,7 @@ void sub_0808FB68(PushableFurnitureEntity* this) {
|
||||
|
||||
void sub_0808FBFC(PushableFurnitureEntity* this) {
|
||||
u32 tileIndex = GetMetaTileIndex(this->unk_7c, super->collisionLayer);
|
||||
if (tileIndex != 0x404a) {
|
||||
if (tileIndex != SPECIAL_META_TILE_74) {
|
||||
super->action = 2;
|
||||
super->direction = ((tileIndex - 0x4bU) & 3) << 3;
|
||||
SetPlayerControl(CONTROL_1);
|
||||
@@ -309,32 +309,32 @@ void sub_0808FD44(PushableFurnitureEntity* this, u32 param_2) {
|
||||
void sub_0808FDE8(PushableFurnitureEntity* this) {
|
||||
u32 uVar1;
|
||||
s32 iVar2;
|
||||
u32 uVar3;
|
||||
u32 metaTilePos;
|
||||
|
||||
uVar3 = (u32)this->unk_70;
|
||||
uVar1 = GetCollisionDataAtMetaTilePos(uVar3 - 1, 1);
|
||||
iVar2 = GetMetaTileIndex(uVar3, 1);
|
||||
if (iVar2 == 0x402e) {
|
||||
metaTilePos = (u32)this->unk_70;
|
||||
uVar1 = GetCollisionDataAtMetaTilePos(metaTilePos - 1, LAYER_BOTTOM);
|
||||
iVar2 = GetMetaTileIndex(metaTilePos, LAYER_BOTTOM);
|
||||
if (iVar2 == SPECIAL_META_TILE_46) {
|
||||
if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 5) == 0)) {
|
||||
SetMetaTile(0x402c, uVar3, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_44, metaTilePos, LAYER_BOTTOM);
|
||||
}
|
||||
} else {
|
||||
iVar2 = GetCollisionDataAtMetaTilePos(uVar3, 1);
|
||||
iVar2 = GetCollisionDataAtMetaTilePos(metaTilePos, LAYER_BOTTOM);
|
||||
if ((iVar2 == 5) && ((((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)) && ((uVar1 & 5) != 0)))) {
|
||||
SetMetaTile(0x402e, uVar3, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_46, metaTilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
uVar3 = (u32)this->unk_72;
|
||||
uVar1 = GetCollisionDataAtMetaTilePos(uVar3 + 1, 1);
|
||||
iVar2 = GetMetaTileIndex(uVar3, 1);
|
||||
if (iVar2 == 0x402f) {
|
||||
metaTilePos = (u32)this->unk_72;
|
||||
uVar1 = GetCollisionDataAtMetaTilePos(metaTilePos + 1, LAYER_BOTTOM);
|
||||
iVar2 = GetMetaTileIndex(metaTilePos, LAYER_BOTTOM);
|
||||
if (iVar2 == SPECIAL_META_TILE_47) {
|
||||
if ((((uVar1 & 0xf0) != 0) && ((uVar1 & 0xf0) != 0x50)) || ((uVar1 & 10) == 0)) {
|
||||
SetMetaTile(0x402d, uVar3, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_45, metaTilePos, LAYER_BOTTOM);
|
||||
}
|
||||
} else {
|
||||
iVar2 = GetCollisionDataAtMetaTilePos(uVar3, 1);
|
||||
iVar2 = GetCollisionDataAtMetaTilePos(metaTilePos, LAYER_BOTTOM);
|
||||
if (((iVar2 == 10) && (((uVar1 & 0xf0) == 0 || ((uVar1 & 0xf0) == 0x50)))) && ((uVar1 & 10) != 0)) {
|
||||
SetMetaTile(0x402f, uVar3, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_47, metaTilePos, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -380,24 +380,24 @@ void sub_0808FF50(PushableFurnitureEntity* this) {
|
||||
switch (this->unk_80) {
|
||||
case 0:
|
||||
this->unk_70 = tmp;
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, 1);
|
||||
SetMetaTile(0x404a, tmp, 1);
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, LAYER_BOTTOM);
|
||||
SetMetaTile(SPECIAL_META_TILE_74, tmp, LAYER_BOTTOM);
|
||||
break;
|
||||
case 1:
|
||||
if ((tmp2 & 8) != 0) {
|
||||
this->unk_70 = this->unk_7c;
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, 1);
|
||||
SetMetaTile(gUnk_08121EE4[this->unk_81], position, 1);
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, LAYER_BOTTOM);
|
||||
SetMetaTile(gUnk_08121EE4[this->unk_81], position, LAYER_BOTTOM);
|
||||
this->unk_72 = tmp + 1;
|
||||
this->unk_76 = GetMetaTileIndex(this->unk_72, 1);
|
||||
this->unk_76 = GetMetaTileIndex(this->unk_72, LAYER_BOTTOM);
|
||||
sub_08090094(this, gUnk_08121EE4[this->unk_81 + 4], this->unk_72);
|
||||
sub_0809028C(this, 1);
|
||||
} else {
|
||||
this->unk_72 = this->unk_7c;
|
||||
this->unk_76 = GetMetaTileIndex(this->unk_72, 1);
|
||||
SetMetaTile(gUnk_08121EE4[this->unk_81], position, 1);
|
||||
this->unk_76 = GetMetaTileIndex(this->unk_72, LAYER_BOTTOM);
|
||||
SetMetaTile(gUnk_08121EE4[this->unk_81], position, LAYER_BOTTOM);
|
||||
this->unk_70 = tmp - 1;
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, 1);
|
||||
this->unk_74 = GetMetaTileIndex(this->unk_70, LAYER_BOTTOM);
|
||||
sub_08090094(this, gUnk_08121EE4[this->unk_81 + 2], this->unk_70);
|
||||
sub_0809028C(this, 0);
|
||||
}
|
||||
@@ -405,92 +405,92 @@ void sub_0808FF50(PushableFurnitureEntity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
|
||||
void sub_08090094(PushableFurnitureEntity* this, u32 tileIndex, u32 tilePos) {
|
||||
FORCE_REGISTER(u32 tmp1, r4);
|
||||
|
||||
u32 index;
|
||||
u32 newTileIndex;
|
||||
u32 tmp2;
|
||||
|
||||
tmp1 = GetCollisionDataAtMetaTilePos(tilePos, 1);
|
||||
index = GetMetaTileIndex(tilePos, 1);
|
||||
if ((index & 0x4000) == 0) {
|
||||
index = param_2;
|
||||
switch (index) {
|
||||
case 0x4025:
|
||||
newTileIndex = GetMetaTileIndex(tilePos, LAYER_BOTTOM);
|
||||
if ((newTileIndex & 0x4000) == 0) {
|
||||
newTileIndex = tileIndex;
|
||||
switch (newTileIndex) {
|
||||
case SPECIAL_META_TILE_37:
|
||||
if (tmp1 == 5) {
|
||||
index = 0x4022;
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
}
|
||||
SetMetaTile(index, tilePos, 1);
|
||||
SetMetaTile(newTileIndex, tilePos, LAYER_BOTTOM);
|
||||
return;
|
||||
case 0x402d:
|
||||
case 0x402f:
|
||||
case SPECIAL_META_TILE_45:
|
||||
case SPECIAL_META_TILE_47:
|
||||
if (tmp1 == 5) {
|
||||
index = 0x4022;
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
}
|
||||
SetMetaTile(index, tilePos, 1);
|
||||
SetMetaTile(newTileIndex, tilePos, LAYER_BOTTOM);
|
||||
return;
|
||||
case 0x4024:
|
||||
case 0x402c:
|
||||
case 0x402e:
|
||||
case SPECIAL_META_TILE_36:
|
||||
case SPECIAL_META_TILE_44:
|
||||
case SPECIAL_META_TILE_46:
|
||||
if (tmp1 == 10) {
|
||||
index = 0x4022;
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
}
|
||||
SetMetaTile(index, tilePos, 1);
|
||||
SetMetaTile(newTileIndex, tilePos, LAYER_BOTTOM);
|
||||
return;
|
||||
default:
|
||||
SetMetaTile(index, tilePos, 1);
|
||||
SetMetaTile(newTileIndex, tilePos, LAYER_BOTTOM);
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch (index) {
|
||||
case 0x4022:
|
||||
switch (newTileIndex) {
|
||||
case SPECIAL_META_TILE_34:
|
||||
default:
|
||||
return;
|
||||
case 0x4025:
|
||||
if (param_2 == 0x4024) {
|
||||
index = 0x4022;
|
||||
case SPECIAL_META_TILE_37:
|
||||
if (tileIndex == SPECIAL_META_TILE_36) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x10;
|
||||
}
|
||||
if (param_2 == 0x402c) {
|
||||
index = 0x4022;
|
||||
if (tileIndex == SPECIAL_META_TILE_44) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x10;
|
||||
}
|
||||
break;
|
||||
case 0x402d:
|
||||
case 0x402f:
|
||||
if (param_2 == 0x402c) {
|
||||
index = 0x402b;
|
||||
case SPECIAL_META_TILE_45:
|
||||
case SPECIAL_META_TILE_47:
|
||||
if (tileIndex == SPECIAL_META_TILE_44) {
|
||||
newTileIndex = SPECIAL_META_TILE_43;
|
||||
this->unk_83 |= 0x10;
|
||||
}
|
||||
if (param_2 == 0x4024) {
|
||||
index = 0x4022;
|
||||
if (tileIndex == SPECIAL_META_TILE_36) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x10;
|
||||
}
|
||||
break;
|
||||
case 0x4024:
|
||||
if (param_2 == 0x4025) {
|
||||
index = 0x4022;
|
||||
case SPECIAL_META_TILE_36:
|
||||
if (tileIndex == SPECIAL_META_TILE_37) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x20;
|
||||
}
|
||||
if (param_2 == 0x402d) {
|
||||
index = 0x4022;
|
||||
if (tileIndex == SPECIAL_META_TILE_45) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x20;
|
||||
}
|
||||
break;
|
||||
case 0x402c:
|
||||
case 0x402e:
|
||||
if (param_2 == 0x402d) {
|
||||
index = 0x402b;
|
||||
case SPECIAL_META_TILE_44:
|
||||
case SPECIAL_META_TILE_46:
|
||||
if (tileIndex == SPECIAL_META_TILE_45) {
|
||||
newTileIndex = SPECIAL_META_TILE_43;
|
||||
this->unk_83 |= 0x20;
|
||||
}
|
||||
if (param_2 == 0x4025) {
|
||||
index = 0x4022;
|
||||
if (tileIndex == SPECIAL_META_TILE_37) {
|
||||
newTileIndex = SPECIAL_META_TILE_34;
|
||||
this->unk_83 |= 0x20;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SetMetaTile(index, tilePos, 1);
|
||||
SetMetaTile(newTileIndex, tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void sub_08090254(PushableFurnitureEntity* this) {
|
||||
@@ -591,8 +591,8 @@ void sub_0809028C(PushableFurnitureEntity* this, u32 param_2) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08090480(u32 param_1, u32 param_2) {
|
||||
SetMetaTile(gUnk_08121EF0[param_1], param_2, 1);
|
||||
void sub_08090480(u32 param_1, u32 tilePos) {
|
||||
SetMetaTile(gUnk_08121EF0[param_1], tilePos, LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void sub_08090498(PushableFurnitureEntity* this) {
|
||||
@@ -637,11 +637,12 @@ void (*const PushableFurniture_Actions[])(PushableFurnitureEntity*) = {
|
||||
PushableFurniture_Action2,
|
||||
};
|
||||
const u16 gUnk_08121EE4[] = {
|
||||
0x402b, 0x4022, 0x402c, 0x4024, 0x402d, 0x4025,
|
||||
SPECIAL_META_TILE_43, SPECIAL_META_TILE_34, SPECIAL_META_TILE_44,
|
||||
SPECIAL_META_TILE_36, SPECIAL_META_TILE_45, SPECIAL_META_TILE_37,
|
||||
};
|
||||
const u16 gUnk_08121EF0[] = {
|
||||
0x4026,
|
||||
0x4065,
|
||||
0x4066,
|
||||
SPECIAL_META_TILE_38,
|
||||
SPECIAL_META_TILE_101,
|
||||
SPECIAL_META_TILE_102,
|
||||
0,
|
||||
};
|
||||
|
||||
+16
-15
@@ -7,9 +7,9 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -136,9 +136,9 @@ void sub_080977F4(PushableGraveEntity* this) {
|
||||
super->action = 4;
|
||||
super->spriteOffsetY = 0;
|
||||
tilePosition = COORD_TO_TILE(super);
|
||||
SetMetaTile(0x4022, tilePosition, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePosition, super->collisionLayer);
|
||||
if (super->type == 0) {
|
||||
SetMetaTile(0x4022, tilePosition - 1, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, tilePosition - 1, super->collisionLayer);
|
||||
}
|
||||
if (this->pushedFlag != 0) {
|
||||
SetFlag(this->pushedFlag);
|
||||
@@ -150,7 +150,8 @@ bool32 sub_0809785C(PushableGraveEntity* this) {
|
||||
|
||||
if (super->type != 0) {
|
||||
if (super->type2 != 0) {
|
||||
if ((CheckFlags(this->pushedFlag) != 0) || GetMetaTileType(this->unk_68, super->collisionLayer) == 0x403f) {
|
||||
if ((CheckFlags(this->pushedFlag) != 0) ||
|
||||
GetMetaTileType(this->unk_68, super->collisionLayer) == SPECIAL_META_TILE_63) {
|
||||
super->action = 3;
|
||||
super->timer = 64;
|
||||
super->subtimer = 0;
|
||||
@@ -159,14 +160,14 @@ bool32 sub_0809785C(PushableGraveEntity* this) {
|
||||
tilePosition = this->unk_68;
|
||||
SetMetaTileByIndex(this->unk_72, tilePosition, super->collisionLayer);
|
||||
if (super->type2 == 2) {
|
||||
SetMetaTileByIndex(this->unk_6a, tilePosition - 0x41, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_6c, tilePosition - 0x40, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_6e, tilePosition - 0x3f, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_70, tilePosition - 1, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_74, tilePosition + 1, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_76, tilePosition + 0x3f, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_78, tilePosition + 0x40, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_7a, tilePosition + 0x41, super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_6a, tilePosition + TILE_POS(-1, -1), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_6c, tilePosition + TILE_POS(0, -1), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_6e, tilePosition + TILE_POS(1, -1), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_70, tilePosition + TILE_POS(-1, 0), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_74, tilePosition + TILE_POS(1, 0), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_76, tilePosition + TILE_POS(-1, 1), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_78, tilePosition + TILE_POS(0, 1), super->collisionLayer);
|
||||
SetMetaTileByIndex(this->unk_7a, tilePosition + TILE_POS(1, 1), super->collisionLayer);
|
||||
}
|
||||
SoundReq(SFX_10F);
|
||||
return TRUE;
|
||||
@@ -207,7 +208,7 @@ const u8 gUnk_081232C0[] = {
|
||||
255, 61, 64, 1, 0, 61, 64, 63, 0, 61, 64, 65, 0, 255, 255,
|
||||
};
|
||||
const u16 PushableGrave_Tiles[] = {
|
||||
0x4022,
|
||||
0x403e,
|
||||
0x403e,
|
||||
SPECIAL_META_TILE_34,
|
||||
SPECIAL_META_TILE_62,
|
||||
SPECIAL_META_TILE_62,
|
||||
};
|
||||
|
||||
+13
-16
@@ -7,13 +7,13 @@
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[8];
|
||||
/*0x70*/ u16 tilePosition;
|
||||
/*0x70*/ u16 tilePos;
|
||||
/*0x72*/ u16 tileIndex;
|
||||
/*0x74*/ u16 timer;
|
||||
/*0x76*/ u8 unk_76[16];
|
||||
@@ -36,9 +36,6 @@ bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this);
|
||||
void PushableLever_SetMetaTiles(PushableLeverEntity*);
|
||||
void PushableLever_CalculateSpriteOffsets(PushableLeverEntity*);
|
||||
|
||||
#define TILE_INITIAL 0x4053
|
||||
#define TILE_PUSHED 0x4052
|
||||
|
||||
void PushableLever(PushableLeverEntity* this) {
|
||||
PushableLever_Actions[super->action](this);
|
||||
}
|
||||
@@ -53,7 +50,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
|
||||
super->action = PUSHING;
|
||||
super->spriteOffsetX = 0;
|
||||
super->spriteOffsetY = 0;
|
||||
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
EnqueueSFX(SFX_16A);
|
||||
RequestPriorityDuration(super, 30);
|
||||
if (PlayerCanBeMoved()) {
|
||||
@@ -88,26 +85,26 @@ void PushableLever_SetIdle(PushableLeverEntity* this) {
|
||||
void PushableLever_SetMetaTiles(PushableLeverEntity* this) {
|
||||
if (CheckFlags(this->pushedFlag) == FALSE) {
|
||||
super->type2 = 0;
|
||||
this->tilePosition = COORD_TO_TILE_OFFSET(super, 0, 0x10);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(TILE_INITIAL, this->tilePosition, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE_OFFSET(super, 0, 0x10);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_83, this->tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 1);
|
||||
} else {
|
||||
super->type2 = 1;
|
||||
this->tilePosition = COORD_TO_TILE_OFFSET(super, 0x10, 0);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(TILE_PUSHED, this->tilePosition, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE_OFFSET(super, 0x10, 0);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_82, this->tilePos, super->collisionLayer);
|
||||
InitializeAnimation(super, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool32 PushableLever_ShouldStartPushing(PushableLeverEntity* this) {
|
||||
if (GetMetaTileIndex(this->tilePosition, super->collisionLayer) == 0x4054) {
|
||||
if (GetMetaTileIndex(this->tilePos, super->collisionLayer) == SPECIAL_META_TILE_84) {
|
||||
if (--this->timer == 0) {
|
||||
return TRUE;
|
||||
}
|
||||
PushableLever_CalculateSpriteOffsets(this);
|
||||
SetMetaTile(PushableLever_Tiles[super->type2], this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(PushableLever_Tiles[super->type2], this->tilePos, super->collisionLayer);
|
||||
} else {
|
||||
this->timer = 60;
|
||||
super->spriteOffsetX = 0;
|
||||
@@ -137,8 +134,8 @@ void (*const PushableLever_Actions[])(PushableLeverEntity*) = {
|
||||
PushableLever_Pushing,
|
||||
};
|
||||
const u16 PushableLever_Tiles[] = {
|
||||
TILE_INITIAL,
|
||||
TILE_PUSHED,
|
||||
SPECIAL_META_TILE_83,
|
||||
SPECIAL_META_TILE_82,
|
||||
};
|
||||
const u8 PushableLever_InitialOffsets[] = {
|
||||
0, 0, 0, 0, 255, 0, 0, 0,
|
||||
|
||||
+14
-14
@@ -14,9 +14,9 @@ typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[8];
|
||||
/*0x70*/ u16 tileIndex;
|
||||
/*0x72*/ u8 unk_72;
|
||||
/*0x72*/ u8 collisionData;
|
||||
/*0x73*/ u8 unk_73;
|
||||
/*0x74*/ u16 tilePosition;
|
||||
/*0x74*/ u16 tilePos;
|
||||
/*0x76*/ u8 unk_76[0x10];
|
||||
/*0x86*/ u16 pushedFlag;
|
||||
} PushableRockEntity;
|
||||
@@ -43,12 +43,12 @@ void PushableRock_Action1(PushableRockEntity* this) {
|
||||
u32 tileType;
|
||||
u32 tmp;
|
||||
|
||||
tileType = GetMetaTileType(this->tilePosition, super->collisionLayer);
|
||||
tileType = GetMetaTileType(this->tilePos, super->collisionLayer);
|
||||
switch (tileType) {
|
||||
case 0x401c:
|
||||
case 0x401d:
|
||||
case 0x401e:
|
||||
case 0x401f:
|
||||
case SPECIAL_META_TILE_28:
|
||||
case SPECIAL_META_TILE_29:
|
||||
case SPECIAL_META_TILE_30:
|
||||
case SPECIAL_META_TILE_31:
|
||||
tmp = (tileType - 0x1c);
|
||||
super->animationState = tmp * 2;
|
||||
super->direction = tmp * 8;
|
||||
@@ -57,7 +57,7 @@ void PushableRock_Action1(PushableRockEntity* this) {
|
||||
} else {
|
||||
super->spriteSettings.flipX = 0;
|
||||
}
|
||||
SetMetaTile(this->tileIndex, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(this->tileIndex, this->tilePos, super->collisionLayer);
|
||||
super->action = 2;
|
||||
InitializeAnimation(super, (super->animationState >> 1) + 1);
|
||||
EnqueueSFX(SFX_10F);
|
||||
@@ -90,12 +90,12 @@ void PushableRock_Action3(PushableRockEntity* this) {
|
||||
|
||||
void sub_0808A644(PushableRockEntity* this) {
|
||||
u32 vvv;
|
||||
this->tilePosition = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePosition, super->collisionLayer);
|
||||
this->unk_72 = GetCollisionDataAtMetaTilePos(this->tilePosition, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(this->tilePosition, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->tileIndex = GetMetaTileIndex(this->tilePos, super->collisionLayer);
|
||||
this->collisionData = GetCollisionDataAtMetaTilePos(this->tilePos, super->collisionLayer);
|
||||
vvv = GetVvvAtMetaTilePos(this->tilePos, super->collisionLayer);
|
||||
if ((vvv == VVV_25) || (vvv == VVV_240)) {
|
||||
SetMetaTile(0x4015, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_21, this->tilePos, super->collisionLayer);
|
||||
super->action = 3;
|
||||
if (!CheckFlags(this->pushedFlag)) {
|
||||
SetFlag(this->pushedFlag);
|
||||
@@ -105,7 +105,7 @@ void sub_0808A644(PushableRockEntity* this) {
|
||||
InitializeAnimation(super, 6);
|
||||
}
|
||||
} else {
|
||||
SetMetaTile(0x401b, this->tilePosition, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_27, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+46
-33
@@ -5,9 +5,10 @@
|
||||
* @brief Pushable Statue object
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "object.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -30,7 +31,7 @@ extern const u16 gUnk_08120CBC[];
|
||||
extern const u16 gUnk_08120CCC[];
|
||||
extern const u16 gUnk_08120D6C[];
|
||||
|
||||
u32 sub_0808968C(u32);
|
||||
u32 sub_0808968C(u32 metaTileType);
|
||||
bool32 sub_0808965C(PushableStatueEntity*);
|
||||
void sub_08089454(PushableStatueEntity*);
|
||||
void sub_080894C8(PushableStatueEntity*);
|
||||
@@ -58,16 +59,16 @@ void PushableStatue_Init(PushableStatueEntity* this) {
|
||||
}
|
||||
|
||||
void PushableStatue_Action1(PushableStatueEntity* this) {
|
||||
u16 tileType;
|
||||
u16 metaTileType;
|
||||
Entity* obj;
|
||||
|
||||
if (sub_0800442E(super) == 0) {
|
||||
tileType = GetMetaTileType(this->unk_84, super->collisionLayer);
|
||||
if (tileType != 0x400b) {
|
||||
switch (sub_0808968C(tileType)) {
|
||||
metaTileType = GetMetaTileType(this->unk_84, super->collisionLayer);
|
||||
if (metaTileType != SPECIAL_META_TILE_11) {
|
||||
switch (sub_0808968C(metaTileType)) {
|
||||
case 1:
|
||||
super->action = 3;
|
||||
super->direction = ((tileType - 0xc) & 3) << 3;
|
||||
super->direction = ((metaTileType - 0xc) & 3) << 3;
|
||||
sub_08089538(this);
|
||||
break;
|
||||
case 0:
|
||||
@@ -78,7 +79,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) {
|
||||
sub_080894FC(this);
|
||||
break;
|
||||
case 2:
|
||||
this->unk_80 = tileType;
|
||||
this->unk_80 = metaTileType;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -99,7 +100,7 @@ void PushableStatue_Action2(PushableStatueEntity* this) {
|
||||
}
|
||||
|
||||
void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
u16 tileType;
|
||||
u16 metaTileType;
|
||||
Entity* obj;
|
||||
u32 index;
|
||||
const s8* ptr;
|
||||
@@ -110,11 +111,11 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
ptr = &gUnk_08120CB4[index];
|
||||
PositionRelative(super, &gPlayerEntity, *(ptr) << 0x10, *(ptr + 1) << 0x10);
|
||||
}
|
||||
tileType = GetMetaTileType(this->unk_84, super->collisionLayer);
|
||||
if (tileType != 0x400b) {
|
||||
switch (sub_0808968C(tileType)) {
|
||||
metaTileType = GetMetaTileType(this->unk_84, super->collisionLayer);
|
||||
if (metaTileType != SPECIAL_META_TILE_11) {
|
||||
switch (sub_0808968C(metaTileType)) {
|
||||
case 1:
|
||||
super->direction = (((tileType - 0xc) & 3) << 3);
|
||||
super->direction = (((metaTileType - 0xc) & 3) << 3);
|
||||
sub_08089538(this);
|
||||
break;
|
||||
case 0:
|
||||
@@ -125,7 +126,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
|
||||
sub_080894FC(this);
|
||||
return;
|
||||
case 2:
|
||||
this->unk_80 = tileType;
|
||||
this->unk_80 = metaTileType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -157,7 +158,7 @@ void PushableStatue_Action4(PushableStatueEntity* this) {
|
||||
} else {
|
||||
super->spriteSettings.draw = 1;
|
||||
super->action = 1;
|
||||
SetMetaTile(0x400b, this->unk_84, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_11, this->unk_84, super->collisionLayer);
|
||||
sub_080894C8(this);
|
||||
}
|
||||
}
|
||||
@@ -165,9 +166,9 @@ void PushableStatue_Action4(PushableStatueEntity* this) {
|
||||
void sub_08089454(PushableStatueEntity* this) {
|
||||
this->unk_84 = COORD_TO_TILE(super);
|
||||
this->unk_80 = GetMetaTileIndex(this->unk_84, super->collisionLayer);
|
||||
SetMetaTile(0x400b, this->unk_84, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_11, this->unk_84, super->collisionLayer);
|
||||
if (super->collisionLayer == 2 && GetMetaTileType(this->unk_84, 1) == 0x310) {
|
||||
SetMetaTile(0x400b, this->unk_84, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_11, this->unk_84, LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,32 +194,32 @@ void sub_080894FC(PushableStatueEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08089538(PushableStatueEntity* this) {
|
||||
u16 tileType;
|
||||
u16 metaTileType;
|
||||
this->unk_86 = 0x20;
|
||||
EnqueueSFX(SFX_10F);
|
||||
SetMetaTile(this->unk_80, this->unk_84, super->collisionLayer);
|
||||
if ((super->collisionLayer == 2) && (GetMetaTileType(this->unk_84, 1) == 0x400b)) {
|
||||
CloneTile(0x310, this->unk_84, 1);
|
||||
if ((super->collisionLayer == 2) && (GetMetaTileType(this->unk_84, LAYER_BOTTOM) == SPECIAL_META_TILE_11)) {
|
||||
CloneTile(META_TILE_TYPE_784, this->unk_84, 1);
|
||||
}
|
||||
tileType = GetMetaTileType(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
|
||||
if ((tileType == 0x79) || (tileType == 0x77)) {
|
||||
metaTileType = GetMetaTileType(this->unk_84 + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
|
||||
if ((metaTileType == META_TILE_TYPE_121) || (metaTileType == META_TILE_TYPE_119)) {
|
||||
super->spriteOffsetY = -2;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_080895C0(PushableStatueEntity* this) {
|
||||
Entity* obj;
|
||||
Entity* rockFx;
|
||||
|
||||
LinearMoveUpdate(super);
|
||||
if ((--this->unk_86 == 0) && (sub_0800442E(super) == 0)) {
|
||||
super->spriteOffsetY = 0;
|
||||
if (!GetCollisionDataAtEntity(super)) {
|
||||
if (GetCollisionDataAtEntity(super) == 0) {
|
||||
sub_08089454(this);
|
||||
return TRUE;
|
||||
}
|
||||
obj = CreateObject(SPECIAL_FX, FX_ROCK, 0);
|
||||
if (obj != NULL) {
|
||||
CopyPosition(super, obj);
|
||||
rockFx = CreateObject(SPECIAL_FX, FX_ROCK, 0);
|
||||
if (rockFx != NULL) {
|
||||
CopyPosition(super, rockFx);
|
||||
}
|
||||
super->spriteSettings.draw = 0;
|
||||
super->x.HALF.HI += gUnk_08120CBC[super->direction >> 2];
|
||||
@@ -232,18 +233,18 @@ bool32 sub_080895C0(PushableStatueEntity* this) {
|
||||
}
|
||||
|
||||
bool32 sub_0808965C(PushableStatueEntity* this) {
|
||||
if (gRoomControls.area < 0x40) {
|
||||
return LoadFixedGFX(super, 0xe9);
|
||||
if (gRoomControls.area < AREA_40) {
|
||||
return LoadFixedGFX(super, 233);
|
||||
} else {
|
||||
return LoadFixedGFX(super, gUnk_08120CCC[gRoomControls.area - 0x40]);
|
||||
return LoadFixedGFX(super, gUnk_08120CCC[gRoomControls.area - AREA_40]);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0808968C(u32 param_1) {
|
||||
u32 sub_0808968C(u32 metaTileType) {
|
||||
const u16* it;
|
||||
|
||||
for (it = gUnk_08120D6C; *it != 0; it += 2) {
|
||||
if (*it == param_1) {
|
||||
if (*it == metaTileType) {
|
||||
return it[1];
|
||||
}
|
||||
}
|
||||
@@ -297,5 +298,17 @@ const u16 gUnk_08120CCC[] = {
|
||||
78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81,
|
||||
};
|
||||
const u16 gUnk_08120D6C[] = {
|
||||
0x400c, 1, 0x400d, 1, 0x400e, 1, 0x400f, 1, 0x7a, 2, 0x78, 2, 0,
|
||||
SPECIAL_META_TILE_12,
|
||||
1,
|
||||
SPECIAL_META_TILE_13,
|
||||
1,
|
||||
SPECIAL_META_TILE_14,
|
||||
1,
|
||||
SPECIAL_META_TILE_15,
|
||||
1,
|
||||
META_TILE_TYPE_122,
|
||||
2,
|
||||
META_TILE_TYPE_120,
|
||||
2,
|
||||
0,
|
||||
};
|
||||
|
||||
+20
-19
@@ -11,6 +11,7 @@
|
||||
#include "global.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void sub_08085394(Entity*);
|
||||
void sub_0808543C(Entity*);
|
||||
@@ -114,39 +115,39 @@ void Railtrack_Action3(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
static const u16 gUnk_081205E0[] = { 0x4018, 0x4019 };
|
||||
static const u16 gUnk_081205E0[] = { SPECIAL_META_TILE_24, SPECIAL_META_TILE_25 };
|
||||
|
||||
void sub_08085394(Entity* this) {
|
||||
u32 uVar1;
|
||||
u32 specialTile;
|
||||
u16* layerData;
|
||||
u32 tile;
|
||||
s8 off;
|
||||
u32 tilePos;
|
||||
s8 offset;
|
||||
|
||||
uVar1 = gUnk_081205E0[this->animationState / 2];
|
||||
off = gUnk_080B4488[this->animationState / 2][0];
|
||||
specialTile = gUnk_081205E0[this->animationState / 2];
|
||||
offset = gUnk_080B4488[this->animationState / 2][0];
|
||||
layerData = (u16*)this->field_0x70.WORD;
|
||||
tile = COORD_TO_TILE(this);
|
||||
tilePos = COORD_TO_TILE(this);
|
||||
|
||||
this->field_0x74.HWORD = *(layerData - off);
|
||||
SetMetaTile(uVar1, tile - off, this->collisionLayer);
|
||||
this->field_0x74.HWORD = *(layerData - offset);
|
||||
SetMetaTile(specialTile, tilePos - offset, this->collisionLayer);
|
||||
|
||||
this->field_0x76.HWORD = layerData[0x0];
|
||||
SetMetaTile(uVar1, tile - 0x0, this->collisionLayer);
|
||||
SetMetaTile(specialTile, tilePos, this->collisionLayer);
|
||||
|
||||
this->field_0x78.HWORD = layerData[off];
|
||||
SetMetaTile(uVar1, tile + off, this->collisionLayer);
|
||||
this->field_0x78.HWORD = layerData[offset];
|
||||
SetMetaTile(specialTile, tilePos + offset, this->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_0808543C(Entity* this) {
|
||||
s8* cVar1;
|
||||
u32 uVar2;
|
||||
s8 temp;
|
||||
u32 metaTilePos;
|
||||
s8 offset;
|
||||
|
||||
temp = gUnk_080B4488[this->animationState / 2][0];
|
||||
uVar2 = COORD_TO_TILE(this);
|
||||
SetMetaTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer);
|
||||
SetMetaTile(this->field_0x76.HWORD, uVar2, this->collisionLayer);
|
||||
SetMetaTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
||||
offset = gUnk_080B4488[this->animationState / 2][0];
|
||||
metaTilePos = COORD_TO_TILE(this);
|
||||
SetMetaTile(this->field_0x74.HWORD, metaTilePos - offset, this->collisionLayer);
|
||||
SetMetaTile(this->field_0x76.HWORD, metaTilePos, this->collisionLayer);
|
||||
SetMetaTile(this->field_0x78.HWORD, metaTilePos + offset, this->collisionLayer);
|
||||
}
|
||||
|
||||
u32 sub_080854A8(Entity* this) {
|
||||
|
||||
+27
-15
@@ -6,19 +6,19 @@
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "collision.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "hitbox.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
/*0x68*/ u8 unk_68[0x4];
|
||||
/*0x6c*/ u16 unk_6c;
|
||||
/*0x6e*/ u8 unk_6e[0x2];
|
||||
/*0x70*/ u16 unk_70;
|
||||
/*0x70*/ u16 tilePos;
|
||||
/*0x72*/ u8 unk_72[0x14];
|
||||
/*0x86*/ u16 unk_86;
|
||||
} SmallIceBlockEntity;
|
||||
@@ -87,8 +87,8 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
|
||||
}
|
||||
} else {
|
||||
if (!sub_0800442E(super)) {
|
||||
tileType = GetMetaTileType(this->unk_70, super->collisionLayer);
|
||||
if (tileType != 0x405a) {
|
||||
tileType = GetMetaTileType(this->tilePos, super->collisionLayer);
|
||||
if (tileType != SPECIAL_META_TILE_90) {
|
||||
switch (sub_08099618(tileType)) {
|
||||
case 1:
|
||||
super->action = 2;
|
||||
@@ -102,7 +102,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
|
||||
if (obj != NULL) {
|
||||
CopyPosition(super, obj);
|
||||
}
|
||||
SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer);
|
||||
SetMetaTile(this->unk_6c, this->tilePos, super->collisionLayer);
|
||||
DeleteEntity(super);
|
||||
break;
|
||||
|
||||
@@ -161,7 +161,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
if (super->timer == 0x30) {
|
||||
SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer);
|
||||
SetMetaTile(this->unk_6c, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0);
|
||||
if ((super->timer & 1) != 0) {
|
||||
@@ -178,20 +178,20 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
|
||||
}
|
||||
|
||||
void sub_08099468(SmallIceBlockEntity* this) {
|
||||
this->unk_70 = COORD_TO_TILE(super);
|
||||
this->unk_6c = GetMetaTileIndex(this->unk_70, super->collisionLayer);
|
||||
SetMetaTile(0x405a, this->unk_70, super->collisionLayer);
|
||||
this->tilePos = COORD_TO_TILE(super);
|
||||
this->unk_6c = GetMetaTileIndex(this->tilePos, super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_90, this->tilePos, super->collisionLayer);
|
||||
}
|
||||
|
||||
void sub_080994B8(SmallIceBlockEntity* this) {
|
||||
u16 tileType;
|
||||
|
||||
EnqueueSFX(SFX_ICE_BLOCK_SLIDE);
|
||||
SetMetaTile(this->unk_6c, this->unk_70, super->collisionLayer);
|
||||
if ((super->collisionLayer == 2) && (GetMetaTileType(this->unk_70, 1) == 0x405a)) {
|
||||
CloneTile(0x310, this->unk_70, 1);
|
||||
SetMetaTile(this->unk_6c, this->tilePos, super->collisionLayer);
|
||||
if ((super->collisionLayer == 2) && (GetMetaTileType(this->tilePos, 1) == SPECIAL_META_TILE_90)) {
|
||||
CloneTile(META_TILE_TYPE_784, this->tilePos, 1);
|
||||
}
|
||||
tileType = GetMetaTileType(this->unk_70 + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
|
||||
tileType = GetMetaTileType(this->tilePos + gUnk_080B4488[super->direction >> 3], super->collisionLayer);
|
||||
if (tileType == 0x79 || tileType == 0x77) {
|
||||
super->spriteOffsetY = -2;
|
||||
}
|
||||
@@ -328,5 +328,17 @@ const u16 gUnk_08123748[] = {
|
||||
277,
|
||||
};
|
||||
const u16 gUnk_08123750[] = {
|
||||
0x405b, 1, 0x405c, 1, 0x405d, 1, 0x405e, 1, 0x7a, 2, 0x78, 2, 0,
|
||||
SPECIAL_META_TILE_91,
|
||||
1,
|
||||
SPECIAL_META_TILE_92,
|
||||
1,
|
||||
SPECIAL_META_TILE_93,
|
||||
1,
|
||||
SPECIAL_META_TILE_94,
|
||||
1,
|
||||
META_TILE_TYPE_122,
|
||||
2,
|
||||
META_TILE_TYPE_120,
|
||||
2,
|
||||
0,
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ void sub_080878CC(Entity* this) {
|
||||
sub_08008796(this, 3, x + itX, y + itY);
|
||||
break;
|
||||
default:
|
||||
SetMetaTile(0x4022, metaTilePos, layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_34, metaTilePos, layer);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void StoneTablet_Init(Entity*);
|
||||
void StoneTablet_Action1(Entity*);
|
||||
@@ -22,9 +23,23 @@ void StoneTablet(Entity* this) {
|
||||
|
||||
void StoneTablet_Init(Entity* this) {
|
||||
// TODO recreate as TileData[]
|
||||
static const u16 gUnk_081232EC[] = { 0x4022, -2, 0x4022, -1, 0x4022, 0, 0x4022, 1, 0xffff };
|
||||
static const u16 gUnk_081232EC[] = {
|
||||
SPECIAL_META_TILE_34, -2, SPECIAL_META_TILE_34, -1, SPECIAL_META_TILE_34, 0, SPECIAL_META_TILE_34, 1, 0xffff,
|
||||
};
|
||||
static const u16 gUnk_081232FE[] = {
|
||||
0x4065, -65, 0x4022, -64, 0x4066, -63, 0x4029, -1, 0x4026, 0, 0x402a, 1, 0xffff
|
||||
SPECIAL_META_TILE_101,
|
||||
-65,
|
||||
SPECIAL_META_TILE_34,
|
||||
-64,
|
||||
SPECIAL_META_TILE_102,
|
||||
-63,
|
||||
SPECIAL_META_TILE_41,
|
||||
-1,
|
||||
SPECIAL_META_TILE_38,
|
||||
0,
|
||||
SPECIAL_META_TILE_42,
|
||||
1,
|
||||
0xffff,
|
||||
};
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
* @brief Three Thorns object
|
||||
*/
|
||||
#include "entity.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "physics.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void TreeThorns(Entity* this) {
|
||||
Entity* ent;
|
||||
@@ -30,8 +30,8 @@ void TreeThorns(Entity* this) {
|
||||
this->flags2 = 1;
|
||||
this->hitbox = (Hitbox*)&gHitbox_1;
|
||||
tilePos = COORD_TO_TILE(this);
|
||||
SetMetaTile(0x4066, tilePos - 1, *layer);
|
||||
SetMetaTile(0x4065, tilePos, *layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_102, tilePos - 1, *layer);
|
||||
SetMetaTile(SPECIAL_META_TILE_101, tilePos, *layer);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
ent = CreateObject(TREE_THORNS, 1, 0);
|
||||
if (ent != NULL) {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
#define NENT_DEPRECATED
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "hitbox.h"
|
||||
#include "object.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
/*0x00*/ Entity base;
|
||||
@@ -40,7 +40,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) {
|
||||
super->hurtType = 0x47;
|
||||
super->flags2 = 2;
|
||||
super->hitbox = (Hitbox*)&gHitbox_4;
|
||||
SetMetaTile(0x4050, COORD_TO_TILE(super), super->collisionLayer);
|
||||
SetMetaTile(SPECIAL_META_TILE_80, COORD_TO_TILE(super), super->collisionLayer);
|
||||
if (super->type == 1 || CheckFlags(this->unk_86)) {
|
||||
super->action = 3;
|
||||
SetFlag(this->unk_86);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "menu.h"
|
||||
#include "room.h"
|
||||
#include "sound.h"
|
||||
#include "tiles.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
@@ -77,7 +78,7 @@ void WaterfallOpening(Entity* this) {
|
||||
case 2:
|
||||
if ((this->subAction == 0)) {
|
||||
this->subAction = 1;
|
||||
SetMetaTileType(0x39, COORD_TO_TILE(this), 1);
|
||||
SetMetaTileType(META_TILE_TYPE_57, COORD_TO_TILE(this), LAYER_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -7,9 +7,9 @@
|
||||
#include "asm.h"
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "global.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "tiles.h"
|
||||
|
||||
void Well_Init(Entity*);
|
||||
void Well_Action1(Entity*);
|
||||
@@ -28,14 +28,12 @@ void Well_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
tilePos = COORD_TO_TILE(this);
|
||||
this->field_0x80.HWORD = tilePos;
|
||||
SetMetaTile(0x407d, this->field_0x80.HWORD, 1);
|
||||
SetMetaTile(SPECIAL_META_TILE_125, this->field_0x80.HWORD, LAYER_BOTTOM);
|
||||
}
|
||||
|
||||
void Well_Action1(Entity* this) {
|
||||
s32 tileIndex;
|
||||
|
||||
tileIndex = GetMetaTileType(this->field_0x80.HWORD, 1);
|
||||
if (tileIndex != 0x407d) {
|
||||
s32 tileIndex = GetMetaTileType(this->field_0x80.HWORD, LAYER_BOTTOM);
|
||||
if (tileIndex != SPECIAL_META_TILE_125) {
|
||||
sub_08078B48();
|
||||
gPlayerEntity.x.WORD = this->x.WORD;
|
||||
gPlayerEntity.y.HALF.HI = this->y.HALF.HI + 4;
|
||||
|
||||
Reference in New Issue
Block a user