mirror of
https://github.com/zeldaret/tmc
synced 2026-08-01 00:08:54 -04:00
merge master
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ s32 sub_080633C8(Entity* this);
|
||||
void sub_0806346C(Entity* this);
|
||||
|
||||
void Beedle(Entity* this) {
|
||||
if (this->flags & 0x2) {
|
||||
if (this->flags & ENT_SCRIPTED) {
|
||||
sub_08063410(this);
|
||||
} else {
|
||||
sub_080632C8(this);
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ void sub_0806D4C0(Entity* this, u32 param) {
|
||||
if (npc != NULL) {
|
||||
npc->parent = this;
|
||||
CopyPosition(this, npc);
|
||||
ResolveEntityOnTop(this, npc);
|
||||
SortEntityAbove(this, npc);
|
||||
SetDefaultPriority(npc, PRIO_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ extern EntityData gUnk_080F3494;
|
||||
static void sub_08068BEC(Entity* this, u32 unused);
|
||||
|
||||
void BladeBrothers(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_081115D0[this->action](this);
|
||||
} else {
|
||||
gUnk_081115C0[this->action](this);
|
||||
@@ -167,7 +167,7 @@ static void sub_08068BEC(Entity* this, u32 unused) {
|
||||
target = CreateFx(this, FX_WHITE_SPLASH, 0);
|
||||
if (target) {
|
||||
target->spritePriority.b0 = 1;
|
||||
PositionRelative(this, target, 0, -0x100000);
|
||||
PositionRelative(this, target, 0, Q_16_16(-16.0));
|
||||
SoundReq(SFX_FA);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ extern void (*gUnk_0810CAA0[])(Entity*);
|
||||
extern Dialog gUnk_0810CAAC[];
|
||||
|
||||
void Brocco(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_0806362C(this);
|
||||
} else {
|
||||
sub_08063544(this);
|
||||
|
||||
+2
-2
@@ -12,11 +12,11 @@ void Carlov(Entity* this) {
|
||||
}
|
||||
if ((this->frame & 0x10) != 0) {
|
||||
this->frame = this->frame & 0xef;
|
||||
EnqueueSFX(0x104);
|
||||
EnqueueSFX(SFX_104);
|
||||
InitScreenShake(0x10, 0);
|
||||
}
|
||||
if ((this->frame & 0x20) != 0) {
|
||||
this->frame = this->frame & 0xdf;
|
||||
EnqueueSFX(0x7c);
|
||||
EnqueueSFX(SFX_PLY_JUMP);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ extern SpriteLoadData gUnk_0810F874[];
|
||||
extern u32 _call_via_r0(u32*);
|
||||
|
||||
void Maid(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08064570(this);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
|
||||
@@ -23,7 +23,7 @@ extern PosOffset gUnk_08110E78[];
|
||||
extern PosOffset gUnk_08110E8A[];
|
||||
|
||||
void CastorWildsStatue(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_08110E5C[this->action](this);
|
||||
} else {
|
||||
gUnk_08110E4C[this->action](this);
|
||||
@@ -103,7 +103,7 @@ void sub_08067534(Entity* this) {
|
||||
entity->y.HALF.HI += 0x1c;
|
||||
}
|
||||
}
|
||||
EnqueueSFX(0x14c);
|
||||
EnqueueSFX(SFX_14C);
|
||||
InitScreenShake(0x28, 4);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void sub_080675D4(Entity* this) {
|
||||
ent->collisionLayer = this->collisionLayer;
|
||||
ent->spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
ent->spriteRendering.b3 = this->spriteRendering.b3;
|
||||
ResolveEntityOnTop(this, ent);
|
||||
SortEntityAbove(this, ent);
|
||||
}
|
||||
};
|
||||
gUnk = gUnk_08110E8A;
|
||||
@@ -147,7 +147,7 @@ void sub_080675D4(Entity* this) {
|
||||
ent->collisionLayer = this->collisionLayer;
|
||||
ent->spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
ent->spriteRendering.b3 = this->spriteRendering.b3;
|
||||
ResolveEntityOnTop(this, ent);
|
||||
SortEntityAbove(this, ent);
|
||||
}
|
||||
};
|
||||
if (this->subAction > 2) {
|
||||
|
||||
+1
-3
@@ -40,8 +40,6 @@ extern u16 gUnk_08111104[];
|
||||
|
||||
extern u32 sub_0806FCA0(Entity*, Entity*);
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void sub_08067790(Entity* this) {
|
||||
ShowNPCDialogue(this, &gUnk_08110EF8 + this->type * 10 + gSave.global_progress);
|
||||
}
|
||||
@@ -50,7 +48,7 @@ void sub_08067790(Entity* this) {
|
||||
void Cat(Entity* ent) {
|
||||
gCat[ent->action](ent);
|
||||
sub_08067C44(ent);
|
||||
if (((ent->flags & 128) == 0) && (ent->type != 5)) {
|
||||
if (((ent->flags & ENT_COLLIDE) == 0) && (ent->type != 5)) {
|
||||
sub_0806ED78(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ void CuccoChick_Fusion(Entity* this) {
|
||||
this->frameIndex = 1;
|
||||
} else {
|
||||
if (GravityUpdate(this, 0x3000) == 0) {
|
||||
this->zVelocity = 0x10000;
|
||||
this->zVelocity = Q_16_16(1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ void sub_08069B44(Entity* this) {
|
||||
this->field_0x74.HALF.LO = sub_0801E99C(this);
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
InitAnimationForceUpdate(this, 10);
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_0807DD50(this);
|
||||
}
|
||||
if (((this->type == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) && (GetInventoryValue(0x36) != 2)) {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ void DrLeft(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action += 1;
|
||||
this->frameIndex = 0;
|
||||
ResolveEntityBelow(this, this);
|
||||
SortEntityBelow(this, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ void sub_0806D96C(Entity* this) {
|
||||
Entity* fx = CreateFx(this, FX_STEAM_EFC, 0);
|
||||
if (fx != NULL) {
|
||||
fx->spritePriority.b0 = 1;
|
||||
PositionRelative(this, fx, 0, 0xFFE80000);
|
||||
PositionRelative(this, fx, 0, Q_16_16(-24.0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ void sub_08065C0C(Entity* this);
|
||||
static EntityAction* const gUnk_08110164[];
|
||||
|
||||
void GhostBrothers(Entity* this) {
|
||||
if (this->flags & 0x2) {
|
||||
if (this->flags & ENT_SCRIPTED) {
|
||||
sub_08065C0C(this);
|
||||
} else {
|
||||
gUnk_08110164[this->type](this);
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ void sub_08069888(Entity* this);
|
||||
extern u16 gUnk_08111C50[];
|
||||
|
||||
void Gorman(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08069838(this);
|
||||
} else {
|
||||
sub_080697A4(this);
|
||||
|
||||
+7
-7
@@ -10,7 +10,7 @@ extern void (*gUnk_08111A8C[])(Entity*);
|
||||
extern Dialog gUnk_08111A94[];
|
||||
|
||||
void Goron(Entity* this) {
|
||||
if (this->flags & 2) {
|
||||
if (this->flags & ENT_SCRIPTED) {
|
||||
gUnk_08111A8C[this->action](this);
|
||||
} else {
|
||||
gUnk_08111A80[this->action](this);
|
||||
@@ -70,11 +70,11 @@ void sub_080693D0(Entity* this) {
|
||||
|
||||
if (this->frame == 1) {
|
||||
this->frame = 0;
|
||||
sub_08069428(this, 0xFFF80000, createFx65);
|
||||
sub_08069428(this, Q_16_16(-8.0), createFx65);
|
||||
}
|
||||
if (this->frame == 2) {
|
||||
this->frame = 0;
|
||||
sub_08069428(this, 0x80 << 12, createFx65);
|
||||
sub_08069428(this, Q_16_16(8.0), createFx65);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,14 +82,14 @@ void sub_080693D0(Entity* this) {
|
||||
void sub_08069428(Entity* this, s32 offsetX, bool32 createFx65) {
|
||||
Entity* fx = CreateFx(this, FX_ROCK, 0);
|
||||
if (fx) {
|
||||
PositionRelative(this, fx, offsetX, 0xFFF00000);
|
||||
ResolveEntityOnTop(this, fx);
|
||||
PositionRelative(this, fx, offsetX, Q_16_16(-16.0));
|
||||
SortEntityAbove(this, fx);
|
||||
}
|
||||
if (createFx65 != 0) {
|
||||
fx = CreateFx(this, FX_REFLECT4, 0);
|
||||
if (fx) {
|
||||
PositionRelative(this, fx, offsetX, 0xFFF00000);
|
||||
ResolveEntityOnTop(this, fx);
|
||||
PositionRelative(this, fx, offsetX, Q_16_16(-16.0));
|
||||
SortEntityAbove(this, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ static const u16 sKinstonePrices[];
|
||||
extern u32 sub_0801E7D0(u32);
|
||||
|
||||
void GoronMerchant(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_08111B98[this->action](this);
|
||||
} else {
|
||||
gUnk_08111B88[this->action](this);
|
||||
|
||||
+2
-2
@@ -22,13 +22,13 @@ void sub_0806CAF4(Entity* this) {
|
||||
if (npc != NULL) {
|
||||
npc->parent = this;
|
||||
CopyPosition(this, npc);
|
||||
ResolveEntityBelow(this, npc);
|
||||
SortEntityBelow(this, npc);
|
||||
}
|
||||
npc = CreateNPC(0x4a, 2, 0);
|
||||
if (npc != NULL) {
|
||||
npc->parent = this;
|
||||
CopyPosition(this, npc);
|
||||
ResolveEntityOnTop(this, npc);
|
||||
SortEntityAbove(this, npc);
|
||||
}
|
||||
sub_0807DD64(this);
|
||||
sub_08078778(this);
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ extern SpriteLoadData gUnk_0810F524[];
|
||||
extern void* gUnk_0810F6BC[];
|
||||
|
||||
void Guard(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_0810F544[this->action](this);
|
||||
} else {
|
||||
sub_08063D24(this);
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ extern Dialog gUnk_0810BE10[];
|
||||
extern u8 gUnk_0810C0A0[];
|
||||
|
||||
void Kid(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_080621AC(this);
|
||||
} else {
|
||||
gUnk_0810BE0C[this->action](this);
|
||||
@@ -243,7 +243,7 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
|
||||
uVar4 = Random();
|
||||
this->direction = (this->direction + uVar4 % 0xb) - 5;
|
||||
}
|
||||
sub_0806F62C(this, (s32)this->speed, (u32)this->direction);
|
||||
LinearMoveAngle(this, (s32)this->speed, (u32)this->direction);
|
||||
if ((u32)((this->x.HALF.HI - context->x.HALF.HI) * 0x100 + ((s32)((u32)(u16)this->speed << 0x10) >> 0x11)) <=
|
||||
(u32)(s32)this->speed) {
|
||||
this->x.HALF.HI = context->x.HALF.HI;
|
||||
|
||||
@@ -9,7 +9,7 @@ extern void (*const gUnk_081104E0[])(Entity*);
|
||||
extern void (*const gUnk_081104EC[])(Entity*);
|
||||
|
||||
void KingDaltus(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
if (this->interactType == 2) {
|
||||
this->interactType = 0;
|
||||
this->action = 2;
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ extern void (*gUnk_0810FF5C[])(Entity* this);
|
||||
extern void (*gUnk_0810FF64[])(Entity* this);
|
||||
|
||||
void Malon(Entity* this) {
|
||||
if (this->flags & 0x2) {
|
||||
if (this->flags & ENT_SCRIPTED) {
|
||||
gUnk_0810FF64[this->action](this);
|
||||
} else {
|
||||
gUnk_0810FF5C[this->action](this);
|
||||
@@ -58,12 +58,12 @@ void sub_08065914(Entity* this) {
|
||||
|
||||
target = FindEntityByID(7, 0x1F, 7);
|
||||
if (target != NULL) {
|
||||
PositionRelative(this, target, 0x180000, -0x10000);
|
||||
PositionRelative(this, target, Q_16_16(24.0), Q_16_16(-1.0));
|
||||
target->parent = this;
|
||||
}
|
||||
target = FindEntityByID(7, 0x20, 7);
|
||||
if (target != NULL) {
|
||||
PositionRelative(this, target, 0x280000, 0);
|
||||
PositionRelative(this, target, Q_16_16(40.0), 0);
|
||||
target->parent = this;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ extern u16 gUnk_0811153E[];
|
||||
extern u16 gUnk_08111538[];
|
||||
|
||||
void Melari(Entity* this) {
|
||||
if ((this->flags & 2) == 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) == 0) {
|
||||
gUnk_08111530[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
} else {
|
||||
@@ -86,7 +86,7 @@ void sub_08068780(Entity* this) {
|
||||
}
|
||||
ent = CreateFx(this, FX_STARS2, 0x20);
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, 0x180000, -0xa0000);
|
||||
PositionRelative(this, ent, Q_16_16(24.0), Q_16_16(-10.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ void sub_08066864(Entity*);
|
||||
extern u16 gUnk_08110650[];
|
||||
|
||||
void MinisterPotho(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08066864(this);
|
||||
} else {
|
||||
gUnk_08110644[this->action](this);
|
||||
|
||||
@@ -13,7 +13,7 @@ void sub_08067EF0(Entity*);
|
||||
extern u16 gUnk_0811130E[];
|
||||
|
||||
void MountainMinish(Entity* this) {
|
||||
if ((this->flags & 2) == 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) == 0) {
|
||||
gUnk_08111368[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ void nullsub_110(void) {
|
||||
|
||||
void sub_080663D4(Entity* this) {
|
||||
if (this->x.HALF.HI == this->field_0x7c.HALF_U.HI - 8) {
|
||||
if (gPlayerEntity.action != 0xf) {
|
||||
if (gPlayerEntity.action != PLAYER_080720DC) {
|
||||
this->action = 4;
|
||||
this->direction = 0;
|
||||
this->speed = 0;
|
||||
@@ -95,7 +95,7 @@ void sub_0806643C(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08066474(void) {
|
||||
if (gPlayerEntity.action != 0xf) {
|
||||
if (gPlayerEntity.action != PLAYER_080720DC) {
|
||||
gUnk_02034490.unk0 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ static void (*const gUnk_081106D4[])(Entity*);
|
||||
static void (*const gUnk_081106E0[])(Entity*);
|
||||
|
||||
void NPC26(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_081106E0[this->action](this);
|
||||
} else {
|
||||
gUnk_081106D4[this->action](this);
|
||||
|
||||
+2
-2
@@ -140,12 +140,12 @@ void sub_0806DB84(Entity* this, ScriptExecutionContext* context) {
|
||||
this->hitbox = (Hitbox*)&gUnk_08114154;
|
||||
ent = CreateObject(OBJECT_3E, 4, 0);
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, -0x80000, 0);
|
||||
PositionRelative(this, ent, Q_16_16(-8.0), 0);
|
||||
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ELeftStoneOpening);
|
||||
}
|
||||
ent = CreateObject(OBJECT_3E, 5, 0);
|
||||
if (ent != NULL) {
|
||||
PositionRelative(this, ent, 0x80000, 0);
|
||||
PositionRelative(this, ent, Q_16_16(8.0), 0);
|
||||
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ERightStoneOpening);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-10
@@ -37,7 +37,7 @@ void sub_08061358(Entity*);
|
||||
|
||||
void sub_08060E94(Entity*);
|
||||
|
||||
u32 sub_0806FCD0(u32, u32, u32);
|
||||
u32 PointInsideRadius(s32, s32, s32);
|
||||
|
||||
extern Entity gUnk_0200D654;
|
||||
extern Entity gUnk_02027EB4;
|
||||
@@ -53,7 +53,6 @@ extern struct {
|
||||
s8 unk_1;
|
||||
} gUnk_0810AC4C[];
|
||||
extern u8 gUnk_0810AC54[8];
|
||||
extern u32 sub_080002B4(Entity*, u32, u32);
|
||||
|
||||
extern u8 gUnk_0810AC5D;
|
||||
|
||||
@@ -86,7 +85,7 @@ void CreateZeldaFollower(void) {
|
||||
npc = CreateNPC(0x2e, 0, 0);
|
||||
if (npc != NULL) {
|
||||
CopyPosition(&gPlayerEntity, npc);
|
||||
npc->flags |= 0x20;
|
||||
npc->flags |= ENT_PERSIST;
|
||||
npc->animationState = GetAnimationState(npc);
|
||||
}
|
||||
}
|
||||
@@ -183,12 +182,13 @@ void sub_08060BA0(Entity* this) {
|
||||
this->speed = 0x1e0;
|
||||
sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 0xc);
|
||||
sub_08061170(this);
|
||||
if (sub_0806FCB8(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != 0) {
|
||||
if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != 0) {
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xf7;
|
||||
}
|
||||
} else {
|
||||
if (sub_08060FD0(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6) != 0) {
|
||||
if (sub_0806FCB8(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6, 4) != 0) {
|
||||
if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6, 4) !=
|
||||
0) {
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xfb;
|
||||
this->action = 5;
|
||||
this->direction = r5->direction;
|
||||
@@ -215,7 +215,8 @@ void sub_08060BA0(Entity* this) {
|
||||
this->speed = 0x1e0;
|
||||
sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 0xc);
|
||||
sub_08061170(this);
|
||||
if (sub_0806FCB8(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != 0) {
|
||||
if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) !=
|
||||
0) {
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xf7;
|
||||
}
|
||||
} else {
|
||||
@@ -228,7 +229,8 @@ void sub_08060BA0(Entity* this) {
|
||||
this->speed = 0x1e0;
|
||||
sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4, 0xc);
|
||||
sub_08061170(this);
|
||||
if (sub_0806FCB8(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4, 4) != 0) {
|
||||
if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4,
|
||||
4) != 0) {
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xfd;
|
||||
}
|
||||
} else {
|
||||
@@ -344,8 +346,8 @@ u32 sub_08060F80(Entity* this) {
|
||||
return 0;
|
||||
}
|
||||
((UnkHeap*)this->myHeap)->unk_0 &= 0xfb;
|
||||
if (sub_0806FCD0(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI,
|
||||
((UnkHeap*)this->myHeap)->unk_0b) != 0) {
|
||||
if (PointInsideRadius(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI,
|
||||
((UnkHeap*)this->myHeap)->unk_0b) != 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -818,7 +820,7 @@ void sub_08061AA8(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08061ACC(Entity* this) {
|
||||
this->flags = this->flags | 0x20;
|
||||
this->flags = this->flags | ENT_PERSIST;
|
||||
this->action = 1;
|
||||
this->subAction = 0xff;
|
||||
this->actionDelay = 0;
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ void Percy_Head(Entity* this) {
|
||||
}
|
||||
|
||||
void Percy(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_0806B41C(this);
|
||||
} else {
|
||||
sub_0806B3CC(this);
|
||||
@@ -132,7 +132,7 @@ void sub_0806B540(Entity* this) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((gPlayerEntity.action != 8)) {
|
||||
if ((gPlayerEntity.action != PLAYER_ITEMGET)) {
|
||||
context->wait = 0x2d;
|
||||
return;
|
||||
}
|
||||
|
||||
+165
-4
@@ -3,9 +3,18 @@
|
||||
#include "functions.h"
|
||||
#include "fileselect.h"
|
||||
#include "screen.h"
|
||||
#include "common.h"
|
||||
#include "flags.h"
|
||||
|
||||
#ifdef EU
|
||||
void sub_0806EABC(Entity* this);
|
||||
#else
|
||||
void sub_0806EABC(Entity* this, u32 param);
|
||||
#endif
|
||||
|
||||
extern void sub_08057044(u32, struct_020227E8*, u32);
|
||||
extern u32 gUnk_081146B8;
|
||||
extern s8 gUnk_081145E4[];
|
||||
|
||||
void Phonograph(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
@@ -20,15 +29,167 @@ void Phonograph(Entity* this) {
|
||||
HandleEntity0x82Actions(this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/phonograph/sub_0806E964.inc",
|
||||
void sub_0806E964(Entity* this, ScriptExecutionContext* context))
|
||||
#ifdef EU
|
||||
void sub_0806E964(Entity* this, ScriptExecutionContext* context) {
|
||||
if (gInput.newKeys & B_BUTTON) {
|
||||
sub_08050384();
|
||||
return;
|
||||
}
|
||||
|
||||
if (context->unk_18 == 0) {
|
||||
context->unk_18++;
|
||||
this->field_0x6c.HWORD = 0;
|
||||
sub_0806EABC(this);
|
||||
}
|
||||
|
||||
if (gInput.unk4 & 0xc0) {
|
||||
s32 val2, val3;
|
||||
s32 val = (s16)this->field_0x68.HWORD;
|
||||
if (gInput.unk4 & 0x40) {
|
||||
val++;
|
||||
} else {
|
||||
val--;
|
||||
}
|
||||
|
||||
if (val <= 0) {
|
||||
val = 1;
|
||||
}
|
||||
|
||||
val2 = 0x1c;
|
||||
if (CheckGlobalFlag(0x55)) {
|
||||
val2 = 0x34;
|
||||
}
|
||||
|
||||
if (val > val2) {
|
||||
val = val2;
|
||||
}
|
||||
|
||||
this->field_0x68.HWORD = val;
|
||||
sub_0806EABC(this);
|
||||
if ((s16)this->field_0x6c.HWORD > 0) {
|
||||
this->field_0x6c.HWORD--;
|
||||
}
|
||||
}
|
||||
|
||||
if (gInput.newKeys & A_BUTTON) {
|
||||
if ((s16)this->field_0x68.HWORD != (s16)this->field_0x6a.HWORD || (s16)this->field_0x6c.HWORD == 0) {
|
||||
s8* ptr2 = gUnk_081145E4;
|
||||
s32 field_0x68;
|
||||
SoundReq(*(s16*)(ptr2 + (s16)this->field_0x68.HWORD * 4));
|
||||
this->field_0x6a.HWORD = this->field_0x68.HWORD;
|
||||
field_0x68 = (s16)this->field_0x68.HWORD * 4;
|
||||
ptr2 += 2;
|
||||
this->field_0x6c.HWORD = *(s16*)(((ptr2 + field_0x68)));
|
||||
} else {
|
||||
SoundReq(SONG_STOP_ALL);
|
||||
this->field_0x6a.HWORD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((s16)this->field_0x6c.HWORD > 0) {
|
||||
if ((s16)-- this->field_0x6c.HWORD <= 0) {
|
||||
this->field_0x6a.HWORD = 0;
|
||||
this->field_0x6c.HWORD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
gActiveScriptInfo.commandSize = 0;
|
||||
}
|
||||
#else
|
||||
void sub_0806E964(Entity* this, ScriptExecutionContext* context) {
|
||||
s32 val, val2, val3;
|
||||
if (gInput.newKeys & B_BUTTON) {
|
||||
sub_08050384();
|
||||
return;
|
||||
}
|
||||
|
||||
if (context->unk_18 == 0) {
|
||||
context->unk_18++;
|
||||
this->field_0x6c.HWORD = 0;
|
||||
sub_0806EABC(this, (s16)this->field_0x68.HWORD);
|
||||
}
|
||||
|
||||
val2 = 0x1c;
|
||||
if (CheckGlobalFlag(0x55)) {
|
||||
val2 = 0x34;
|
||||
}
|
||||
val = (s16)this->field_0x68.HWORD;
|
||||
if (gInput.newKeys & 0xc0) {
|
||||
if (gInput.newKeys & 0x40) {
|
||||
val++;
|
||||
} else {
|
||||
val--;
|
||||
}
|
||||
|
||||
if (val <= 0) {
|
||||
val = val2;
|
||||
}
|
||||
|
||||
if (val > val2) {
|
||||
val = 1;
|
||||
}
|
||||
} else if (gInput.unk4 & 0xc0) {
|
||||
if (gInput.unk4 & 0x40) {
|
||||
val++;
|
||||
} else {
|
||||
val--;
|
||||
}
|
||||
|
||||
if (val <= 0) {
|
||||
val = 1;
|
||||
}
|
||||
|
||||
if (val > val2) {
|
||||
val = val2;
|
||||
}
|
||||
}
|
||||
|
||||
if (val != (s16)this->field_0x68.HWORD) {
|
||||
sub_0806EABC(this, val);
|
||||
if ((s16)this->field_0x6c.HWORD > 0) {
|
||||
this->field_0x6c.HWORD--;
|
||||
}
|
||||
}
|
||||
|
||||
this->field_0x68.HWORD = val;
|
||||
|
||||
if (gInput.newKeys & A_BUTTON) {
|
||||
if ((s16)this->field_0x68.HWORD != (s16)this->field_0x6a.HWORD || (s16)this->field_0x6c.HWORD == 0) {
|
||||
s8* ptr2 = gUnk_081145E4;
|
||||
s32 field_0x68;
|
||||
SoundReq(*(s16*)(ptr2 + (s16)this->field_0x68.HWORD * 4));
|
||||
this->field_0x6a.HWORD = this->field_0x68.HWORD;
|
||||
field_0x68 = (s16)this->field_0x68.HWORD * 4;
|
||||
ptr2 += 2;
|
||||
this->field_0x6c.HWORD = *(s16*)(((ptr2 + field_0x68)));
|
||||
} else {
|
||||
SoundReq(SONG_STOP_ALL);
|
||||
this->field_0x6a.HWORD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((s16)this->field_0x6c.HWORD > 0) {
|
||||
if ((s16)-- this->field_0x6c.HWORD <= 0) {
|
||||
this->field_0x6a.HWORD = 0;
|
||||
this->field_0x6c.HWORD = 0;
|
||||
}
|
||||
}
|
||||
|
||||
gActiveScriptInfo.commandSize = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_0806EABC.inc", void sub_0806EABC(Entity* this, u32 param))
|
||||
void sub_0806EABC(Entity* this) {
|
||||
sub_08050384();
|
||||
sub_08057044((s16)this->field_0x68.HWORD, gUnk_020227E8, 0x202020);
|
||||
sub_0805F46C(0x3302, &gUnk_081146B8);
|
||||
gScreen.bg0.updated = 1;
|
||||
}
|
||||
#else
|
||||
void sub_0806EABC(Entity* this, u32 param) {
|
||||
sub_08050384();
|
||||
sub_08057044(param, &gUnk_020227E8[0], 0x202020);
|
||||
sub_08057044(param, gUnk_020227E8, 0x202020);
|
||||
sub_0805F46C(0x3302, &gUnk_081146B8);
|
||||
gScreen.bg0.updated = 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ extern void (*gUnk_0810CDF8[])(Entity*);
|
||||
extern Dialog gUnk_0810CE04[];
|
||||
|
||||
void Pina(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08063B68(this);
|
||||
} else {
|
||||
sub_08063A80(this);
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ void Pita(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action += 1;
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
ResolveEntityOnTop(this, this);
|
||||
SortEntityAbove(this, this);
|
||||
this->hitbox = &gUnk_0810C428;
|
||||
sub_0807DD64(this);
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ extern void (*const gUnk_0810AA24[])(Entity*);
|
||||
extern Dialog gUnk_0810AA30[];
|
||||
|
||||
void Postman(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08060528(this);
|
||||
} else {
|
||||
gUnk_0810AA24[this->action](this);
|
||||
@@ -143,7 +143,7 @@ void sub_08060528(Entity* this) {
|
||||
if (0 < (s16)this->field_0x6a.HWORD) {
|
||||
if ((s16)this->field_0x6a.HWORD > 0x12b) {
|
||||
this->field_0x6a.HWORD = 0;
|
||||
this->zVelocity = 0x20000;
|
||||
this->zVelocity = Q_16_16(2.0);
|
||||
this->field_0x6c.HALF.HI = 1;
|
||||
sub_080788E0(this);
|
||||
EnqueueSFX(0x7c);
|
||||
|
||||
+2
-2
@@ -235,7 +235,7 @@ void sub_0806A914(Entity* this) {
|
||||
Entity* npc = CreateNPC(0x37, 1, 0);
|
||||
if (npc != NULL) {
|
||||
CopyPosition(this, npc);
|
||||
ResolveEntityOnTop(this, npc);
|
||||
SortEntityAbove(this, npc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void sub_0806A9E8(Entity* this) {
|
||||
Entity* npc = CreateNPC(0x37, 4, 0);
|
||||
if (npc != NULL) {
|
||||
CopyPosition(this, npc);
|
||||
ResolveEntityBelow(this, npc);
|
||||
SortEntityBelow(this, npc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ extern u32 gUnk_081103E0;
|
||||
void Smith(Entity* this) {
|
||||
u32 index;
|
||||
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
if (this->interactType == 2) {
|
||||
this->action = 4;
|
||||
this->interactType = 0;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ extern void (*gStampBehaviors2[2])(Entity*);
|
||||
extern Dialog gUnk_0810C2E4[2];
|
||||
|
||||
void Stamp(Entity* ent) {
|
||||
if ((ent->flags & 2) != 0) {
|
||||
if ((ent->flags & ENT_SCRIPTED) != 0) {
|
||||
gStampBehaviors2[ent->action](ent);
|
||||
} else {
|
||||
gStampBehaviors1[ent->action](ent);
|
||||
|
||||
+1
-3
@@ -11,8 +11,6 @@ extern void (*const gUnk_0810FDC8[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0810FDA4[])(Entity*);
|
||||
|
||||
extern bool32 sub_08056338(void);
|
||||
|
||||
extern void sub_08078850(Entity*, u32, u8, u32*);
|
||||
extern u32 gUnk_0810FDA0;
|
||||
extern u16 script_Stockwell;
|
||||
@@ -107,7 +105,7 @@ void sub_080652E4(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay -= 1;
|
||||
} else {
|
||||
if (gPlayerEntity.action != 8) {
|
||||
if (gPlayerEntity.action != PLAYER_ITEMGET) {
|
||||
this->subAction += 1;
|
||||
MessageNoOverlap(0x2c19, this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ extern void (*const gUnk_0810FA44[])(Entity*);
|
||||
void sub_08064C9C(Entity* this);
|
||||
|
||||
void Sturgeon(Entity* this) {
|
||||
if ((this->flags & 2) == 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) == 0) {
|
||||
gUnk_0810FA44[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ extern u8 gUnk_0810FED8[];
|
||||
void sub_0806574C(Entity* this);
|
||||
|
||||
void Talon(Entity* this) {
|
||||
if (this->flags & 2) {
|
||||
if (this->flags & ENT_SCRIPTED) {
|
||||
gUnk_0810FEC4[this->action](this);
|
||||
} else {
|
||||
gUnk_0810FEBC[this->action](this);
|
||||
|
||||
@@ -10,7 +10,7 @@ extern void sub_08064EE8(Entity*);
|
||||
extern void (*const gUnk_0810FBFC[])(Entity*);
|
||||
|
||||
void TingleSiblings(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_08064DE4(this);
|
||||
} else {
|
||||
sub_08064D78(this);
|
||||
|
||||
@@ -24,7 +24,7 @@ extern u16 gUnk_08112C5C[2];
|
||||
extern u16 gUnk_08112C60[4];
|
||||
|
||||
void TownMinish(Entity* this) {
|
||||
if ((this->flags & 2) == 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) == 0) {
|
||||
gUnk_081126E8[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
} else {
|
||||
@@ -139,7 +139,7 @@ void sub_0806ADFC(Entity* this) {
|
||||
void TownMinish_Head(Entity* this) {
|
||||
u32 frames;
|
||||
|
||||
if ((this->flags & 2) == 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) == 0) {
|
||||
frames = this->field_0x68.HALF.HI / 2;
|
||||
if ((this->frameSpriteSettings & 1)) {
|
||||
SetExtraSpriteFrame(this, 0, frames + 0x1c);
|
||||
@@ -216,7 +216,7 @@ void sub_0806AF60(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
|
||||
void sub_0806AF70(Entity* this, ScriptExecutionContext* context) {
|
||||
this->zVelocity = 0x24000;
|
||||
this->zVelocity = Q_16_16(2.25);
|
||||
}
|
||||
|
||||
void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
|
||||
@@ -229,7 +229,7 @@ void sub_0806AF78(Entity* this, ScriptExecutionContext* context) {
|
||||
|
||||
void sub_0806AFA0(Entity* this) {
|
||||
if (sub_0806ED78(this)) {
|
||||
sub_0806F62C(this, -this->speed, this->direction);
|
||||
LinearMoveAngle(this, -this->speed, this->direction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ extern u16 gUnk_0810B7BA[];
|
||||
extern Dialog gUnk_0810B7C0[];
|
||||
|
||||
void Townsperson(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
gUnk_0810B77C[this->action](this);
|
||||
} else {
|
||||
gUnk_0810B774[this->action](this);
|
||||
@@ -220,7 +220,7 @@ void sub_08061F94(Entity* this) {
|
||||
|
||||
ent = CreateFx(this, FX_BIG_EXPLOSION, 0);
|
||||
if (ent != NULL) {
|
||||
ResolveEntityOnTop(this, ent);
|
||||
SortEntityAbove(this, ent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void VaatiRebornAction0(Entity* this) {
|
||||
entity = CreateNPC(VAATI_REBORN, 1, 0);
|
||||
entity->parent = this;
|
||||
entity->spriteOffsetY = -1;
|
||||
PositionRelative(this, entity, 0, 0x10000);
|
||||
PositionRelative(this, entity, 0, Q_16_16(1.0));
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 1:
|
||||
@@ -115,7 +115,7 @@ void VaatiRebornAction1(Entity* this) {
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
PositionRelative(entity, this, 0, 0x210000);
|
||||
PositionRelative(entity, this, 0, Q_16_16(33.0));
|
||||
UpdateAnimationSingleFrame(this);
|
||||
break;
|
||||
case 2:
|
||||
@@ -194,7 +194,7 @@ void sub_0806B96C(Entity* this) {
|
||||
}
|
||||
ptr = &gUnk_08112F80[this->type2];
|
||||
this->spriteSettings.draw = entity->spriteSettings.draw;
|
||||
PositionRelative(entity, this, ptr->x << 0x10, (ptr->y + 0x21) << 0x10);
|
||||
PositionRelative(entity, this, Q_16_16(ptr->x), Q_16_16(ptr->y + 0x21));
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ void Wheaton(Entity* this) {
|
||||
this->action++;
|
||||
|
||||
SetDefaultPriority(this, PRIO_MESSAGE);
|
||||
ResolveEntityOnTop(this, this);
|
||||
SortEntityAbove(this, this);
|
||||
this->hitbox = &gUnk_0810C3C0;
|
||||
this->spriteOffsetY = 0xfe;
|
||||
sub_0807DD64(this);
|
||||
|
||||
+4
-4
@@ -73,7 +73,7 @@ void sub_08066D94(Entity* this) {
|
||||
npc = CreateNPC(0x2E, 0, 0);
|
||||
if (npc != NULL) {
|
||||
npc->animationState = gPlayerEntity.animationState;
|
||||
npc->flags |= 0x20;
|
||||
npc->flags |= ENT_PERSIST;
|
||||
npc->animationState = GetAnimationState(this);
|
||||
room = gRoomControls.room;
|
||||
npc->field_0x74.HWORD = room;
|
||||
@@ -127,13 +127,13 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (this->frame & 1) {
|
||||
context->unk_18++;
|
||||
this->zVelocity = 0x20000;
|
||||
this->zVelocity = Q_16_16(2.0);
|
||||
this->frame &= 0xFE;
|
||||
SoundReq(SFX_PLY_JUMP);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sub_0806F62C(this, 0x100, 0x80);
|
||||
LinearMoveAngle(this, 0x100, 0x80);
|
||||
GravityUpdate(this, 0x2000);
|
||||
if (!(this->frame & 1)) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -143,7 +143,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sub_0806F62C(this, 0x100, 0x80);
|
||||
LinearMoveAngle(this, 0x100, 0x80);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (GravityUpdate(this, 0x2000) == 0) {
|
||||
context->unk_18++;
|
||||
|
||||
Reference in New Issue
Block a user