diff --git a/data/scripts/castorWilds/script_GreatFairyRupees.inc b/data/scripts/castorWilds/script_GreatFairyRupees.inc index b9374fa2..908c2fcd 100644 --- a/data/scripts/castorWilds/script_GreatFairyRupees.inc +++ b/data/scripts/castorWilds/script_GreatFairyRupees.inc @@ -15,6 +15,7 @@ script_0800B6D4: WaitForSyncFlagAndClear 0x00000004 SetRoomFlag 0x0000 WaitForSyncFlagAndClear 0x00000004 + //30 CheckLocalFlag 0x009f JumpIf script_0800B7A2 MessageNoOverlap TEXT_ITEM_GET, 0x7b @@ -22,7 +23,7 @@ script_0800B6D4: CallWithArg CheckMessageEqual, TEXT_ITEM_GET << 8 | 0x7d JumpIf script_0800B6A6 WaitUntilTextboxCloses - SetLocalFlag 0x009f + SetLocalFlag IZUMI_01_FAIRY GivePlayerItem ITEM_WALLET Jump script_0800B698 .2byte 0x0000 diff --git a/data/scripts/cloudTops/script_GregalHealthy.inc b/data/scripts/cloudTops/script_GregalHealthy.inc index 10e0f160..e82f4888 100644 --- a/data/scripts/cloudTops/script_GregalHealthy.inc +++ b/data/scripts/cloudTops/script_GregalHealthy.inc @@ -17,9 +17,9 @@ script_08014C4C: script_08014C56: Call sub_0806CCB4 JumpIfNot script_08014C56 - CheckLocalFlag 0x0066 + CheckLocalFlag SORA_ELDER_TALK2ND JumpIf script_08014C7C - SetLocalFlag 0x0066 + SetLocalFlag SORA_ELDER_TALK2ND MessageNoOverlap TEXT_WIND_TRIBE, 0x0d WaitUntilTextboxCloses GivePlayerItem ITEM_LIGHT_ARROW diff --git a/data/scripts/cloudTops/script_GregalSick.inc b/data/scripts/cloudTops/script_GregalSick.inc index 1466280d..2d0a85d1 100644 --- a/data/scripts/cloudTops/script_GregalSick.inc +++ b/data/scripts/cloudTops/script_GregalSick.inc @@ -4,7 +4,7 @@ SCRIPT_START script_GregalSick DoPostScriptAction 0x000a SetAnimation 0x0000 EndBlock - CheckLocalFlag 0x0063 + CheckLocalFlag SORA_ELDER_RECOVER JumpIf script_08014BE8 script_08014B48: EndBlock @@ -54,9 +54,9 @@ script_08014BF2: CheckEntityInteractType JumpIfNot script_08014BF2 SetPlayerIdle - CheckLocalFlag 0x0065 + CheckLocalFlag SORA_ELDER_TALK1ST JumpIf script_08014C1C - SetLocalFlag 0x0065 + SetLocalFlag SORA_ELDER_TALK1ST MessageNoOverlap TEXT_WIND_TRIBE, 0x07 WaitUntilTextboxCloses SetIntVariable 100 diff --git a/data/scripts/dhc/script_KingDaltusStone.inc b/data/scripts/dhc/script_KingDaltusStone.inc index 0cc87638..bc7550b9 100644 --- a/data/scripts/dhc/script_KingDaltusStone.inc +++ b/data/scripts/dhc/script_KingDaltusStone.inc @@ -3,9 +3,9 @@ SCRIPT_START script_KingDaltusStone BeginBlock SetAnimationState 0x0004 DoPostScriptAction 0x000a - CheckLocalFlag 0x0071 + CheckLocalFlag LV6_1d_KEYGET JumpIf script_0800E3E8 - CheckLocalFlag 0x0096 + CheckLocalFlag LV6_39_KING JumpIf script_0800E3BE SetAnimation 0x000c CallWithArg sub_0807F8E8, 0x00000000 @@ -28,7 +28,7 @@ script_0800E37A: Wait 0x001e DoPostScriptAction 0x0000 FacePlayer - SetLocalFlag 0x0096 + SetLocalFlag LV6_39_KING script_0800E3BE: DoPostScriptAction 0x0000 _0807E9D4 @@ -44,7 +44,7 @@ script_0800E3C8: Wait 0x000f GivePlayerItem ITEM_SMALL_KEY WaitPlayerGetItem - SetLocalFlag 0x0071 + SetLocalFlag LV6_1d_KEYGET EnablePlayerControl script_0800E3E8: _0807E9D4 diff --git a/data/scripts/graveyard/script_GreatFairyArrows.inc b/data/scripts/graveyard/script_GreatFairyArrows.inc index 1e95b4fd..f08ea598 100644 --- a/data/scripts/graveyard/script_GreatFairyArrows.inc +++ b/data/scripts/graveyard/script_GreatFairyArrows.inc @@ -31,7 +31,7 @@ script_0800B684: Jump script_0800B6A6 script_0800B68E: WaitUntilTextboxCloses - SetLocalFlag 0x009e + SetLocalFlag IZUMI_00_FAIRY GivePlayerItem ITEM_LARGE_QUIVER script_0800B698: WaitPlayerGetItem diff --git a/data/scripts/hyruleTown/script_Carlov.inc b/data/scripts/hyruleTown/script_Carlov.inc index 418511d1..756fd845 100644 --- a/data/scripts/hyruleTown/script_Carlov.inc +++ b/data/scripts/hyruleTown/script_Carlov.inc @@ -1,4 +1,4 @@ -@ Hyrule Town Carlov +@ Hyrule Town ~~Carlov~~ Burlov SCRIPT_START script_Carlov BeginBlock _0807E9D4 diff --git a/data/scripts/hyruleTown/script_Librari.inc b/data/scripts/hyruleTown/script_Librari.inc index 2dedaf31..5bd9c952 100644 --- a/data/scripts/hyruleTown/script_Librari.inc +++ b/data/scripts/hyruleTown/script_Librari.inc @@ -28,12 +28,12 @@ script_0800E974: SetAnimation 0x0000 StartPlayerScript script_PlayerActivatedTrapCard WaitForSyncFlagAndClear 0x00000001 - SetLocalFlag 0x0074 + SetLocalFlag MIZUKAKI_STAIR PlaySound SFX_SECRET Wait 0x00f0 MessageFromTarget TEXT_TOWN_MINISH1, 0x26 WaitUntilTextboxCloses - SetLocalFlag 0x0075 + SetLocalFlag MIZUKAKI_STAIR_WARP_OK script_0800E9E4: WaitUntilTextboxCloses Wait 0x000f diff --git a/data/scripts/hyruleTown/script_LibrariLater.inc b/data/scripts/hyruleTown/script_LibrariLater.inc index 1363035f..11a781b9 100644 --- a/data/scripts/hyruleTown/script_LibrariLater.inc +++ b/data/scripts/hyruleTown/script_LibrariLater.inc @@ -1,4 +1,4 @@ -@ Library if you talk to him later? +@ Librari at the lake SCRIPT_START script_LibrariLater BeginBlock DoPostScriptAction 0x000a @@ -14,9 +14,9 @@ script_08012440: SetAnimation 0x0009 Call sub_0806B2B4 WaitUntilTextboxCloses - CheckLocalFlag 0x00b3 + CheckLocalFlag KHOUSE23_TALK1ST JumpIf script_08012474 - SetLocalFlag 0x00b3 + SetLocalFlag KHOUSE23_TALK1ST GivePlayerItem ITEM_HEART_CONTAINER WaitPlayerGetItem .ifdef USA diff --git a/data/scripts/hyruleTown/script_Rem.inc b/data/scripts/hyruleTown/script_Rem.inc index a7384e2a..56f3d368 100644 --- a/data/scripts/hyruleTown/script_Rem.inc +++ b/data/scripts/hyruleTown/script_Rem.inc @@ -6,7 +6,7 @@ SCRIPT_START script_Rem SetAnimation 0x0002 CheckInventory1 ITEM_PEGASUS_BOOTS JumpIf script_080130B6 - CheckLocalFlag 0x0060 + CheckLocalFlag SHOP02_KUTSU_00 JumpIf script_08012FD2 CheckGlobalFlag DASHBOOTS JumpIf script_RemFallingAsleep diff --git a/data/scripts/hyruleTown/script_RemFallingAsleep.inc b/data/scripts/hyruleTown/script_RemFallingAsleep.inc index 08b5211f..26816dbc 100644 --- a/data/scripts/hyruleTown/script_RemFallingAsleep.inc +++ b/data/scripts/hyruleTown/script_RemFallingAsleep.inc @@ -84,7 +84,7 @@ script_0801309E: SetAction 0x0001 Jump script_0801308A script_080130B6: - CheckLocalFlag 0x0062 + CheckLocalFlag NPC37_REM_SLEEP JumpIfNot script_080130C4 Call sub_0806A9B0 script_080130C4: diff --git a/data/scripts/minishWoods/script_BombMinish.inc b/data/scripts/minishWoods/script_BombMinish.inc index 5f2b461a..8375de4a 100644 --- a/data/scripts/minishWoods/script_BombMinish.inc +++ b/data/scripts/minishWoods/script_BombMinish.inc @@ -55,7 +55,7 @@ script_08009FB6: Jump script_08009F86 script_08009FD2: EndBlock - CheckLocalFlag 0x00b0 + CheckLocalFlag KHOUSE26_REMOCON JumpIf script_0800A024 script_08009FDC: EndBlock diff --git a/data/scripts/mtCrenel/script_CutsceneMiscObjectBrokenSword.inc b/data/scripts/mtCrenel/script_CutsceneMiscObjectBrokenSword.inc index 89efa304..de8d6243 100644 --- a/data/scripts/mtCrenel/script_CutsceneMiscObjectBrokenSword.inc +++ b/data/scripts/mtCrenel/script_CutsceneMiscObjectBrokenSword.inc @@ -3,7 +3,7 @@ SCRIPT_START script_CutsceneMiscObjectBrokenSword BeginBlock CheckInventory1 ITEM_FIRE_ELEMENT JumpIf script_0800D24C - CheckLocalFlag 0x007e + CheckLocalFlag OYAKATA_DEMO JumpIf script_0800D242 DoPostScriptAction 0x0008 EndBlock diff --git a/data/scripts/mtCrenel/script_GreatFairyBombs.inc b/data/scripts/mtCrenel/script_GreatFairyBombs.inc index 311d82d7..9f44c339 100644 --- a/data/scripts/mtCrenel/script_GreatFairyBombs.inc +++ b/data/scripts/mtCrenel/script_GreatFairyBombs.inc @@ -24,7 +24,7 @@ script_0800B734: Jump script_0800B6A6 script_0800B794: WaitUntilTextboxCloses - SetLocalFlag 0x00a0 + SetLocalFlag IZUMI_02_FAIRY GivePlayerItem ITEM_BOMBBAG Jump script_0800B698 script_0800B7A2: diff --git a/data/scripts/mtCrenel/script_Melari.inc b/data/scripts/mtCrenel/script_Melari.inc index 74632ed9..5cd27f46 100644 --- a/data/scripts/mtCrenel/script_Melari.inc +++ b/data/scripts/mtCrenel/script_Melari.inc @@ -8,7 +8,7 @@ SCRIPT_START script_Melari EndBlock CheckInventory1 ITEM_FIRE_ELEMENT JumpIf script_0800CFD2 - CheckLocalFlag 0x007e + CheckLocalFlag OYAKATA_DEMO JumpIfNot script_0800CFD2 SetAnimation 0x0008 script_0800CFD2: @@ -19,7 +19,7 @@ script_0800CFD2: SetSyncFlag 0x00000020 Jump script_0800CFFA script_0800CFEC: - CheckLocalFlag 0x007e + CheckLocalFlag OYAKATA_DEMO JumpIfNot script_0800CFFA SetSyncFlag 0x00000010 script_0800CFFA: @@ -60,7 +60,7 @@ script_0800D032: MessageFromTargetPos TEXT_MINISH2, 0x5d, 0x0002 Jump script_0800D17C script_0800D098: - CheckLocalFlag 0x007e + CheckLocalFlag OYAKATA_DEMO JumpIfNot script_0800D0A8 MessageFromTarget TEXT_MINISH2, 0x3e Jump script_0800D17C @@ -88,7 +88,7 @@ script_0800D108: JumpIf script_0800D108 PlaySound SFX_F8 SetSyncFlag 0x00000010 - SetLocalFlag 0x007e + SetLocalFlag OYAKATA_DEMO MessageFromTargetPos TEXT_MINISH2, 0x3e, 0x0002 WaitUntilTextboxCloses Wait 0x000f diff --git a/data/scripts/mtCrenel/script_MountainMinish3.inc b/data/scripts/mtCrenel/script_MountainMinish3.inc index a1d0f57c..08d59543 100644 --- a/data/scripts/mtCrenel/script_MountainMinish3.inc +++ b/data/scripts/mtCrenel/script_MountainMinish3.inc @@ -7,7 +7,7 @@ SCRIPT_START script_MountainMinish3 script_0800D282: CheckInventory1 ITEM_FIRE_ELEMENT JumpIf script_0800D292 - CheckLocalFlag 0x007e + CheckLocalFlag OYAKATA_DEMO JumpIf script_0800D2EA script_0800D292: BeginBlock diff --git a/data/scripts/westernWood/script_MoblinLady.inc b/data/scripts/westernWood/script_MoblinLady.inc index 14b466f9..551be084 100644 --- a/data/scripts/westernWood/script_MoblinLady.inc +++ b/data/scripts/westernWood/script_MoblinLady.inc @@ -12,9 +12,9 @@ script_08012338: SetPlayerIdle MessageFromTarget TEXT_PERCY, 0x04 WaitUntilTextboxCloses - CheckLocalFlag 0x0042 + CheckLocalFlag MHOUSE08_03 JumpIf script_0801235A - SetLocalFlag 0x0042 + SetLocalFlag MHOUSE08_03 GivePlayerItem ITEM_RUPEE50 WaitPlayerGetItem script_0801235A: diff --git a/include/room.h b/include/room.h index 0da81c3e..57999ae2 100644 --- a/include/room.h +++ b/include/room.h @@ -237,7 +237,7 @@ void* GetRoomProperty(u32 area, u32 room, u32 property); bool32 LoadFixedGFX(Entity*, u32); void UnloadGFXSlots(Entity*); -void sub_0804B3C4(TileEntity*); +void LoadSmallChestTile2(TileEntity*); void sub_0804B0B0(u32 arg0, u32 arg1); void DoExitTransition(const ScreenTransitionData* data); diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index aa1001a5..823a8740 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -24,14 +24,14 @@ void sub_08029078(Entity*); void sub_080290E0(Entity*, u32); void sub_080290FC(Entity*); bool32 sub_0802915C(Entity*); -bool32 sub_080291DC(Entity*); +bool32 BusinessScrub_CheckRefillFitsBag(Entity*); void sub_0802922C(Entity*); void sub_0802925C(Entity*); extern const struct SalesOffering gUnk_080CC954[]; extern const u8 kinstoneTypes[]; extern void (*const BusinessScrub_Functions[])(Entity*); -extern void (*const gUnk_080CC9E0[])(Entity*); +extern void (*const BusinessScrub_Actions[])(Entity*); extern const u8 gUnk_080CCA04[]; struct SalesOffering { @@ -41,8 +41,8 @@ struct SalesOffering { u16 field_0x4; u16 field_0x6; u8 offeredItem; /**< @see Item */ - u8 field_0x9; - u16 field_0xa; + u8 item_subtype; + u16 local_flag; }; void BusinessScrub(Entity* this) { @@ -50,7 +50,7 @@ void BusinessScrub(Entity* this) { } void BusinessScrub_OnTick(Entity* this) { - gUnk_080CC9E0[this->action](this); + BusinessScrub_Actions[this->action](this); } void BusinessScrub_OnCollision(Entity* this) { @@ -74,7 +74,7 @@ void BusinessScrub_OnGrabbed(Entity* this) { /* ... */ } -void sub_08028994(Entity* this) { +void BusinessScrub_Action0(Entity* this) { this->subtimer = 0; this->field_0x78.HWORD = this->x.HALF.HI; this->field_0x7a.HWORD = this->y.HALF.HI; @@ -96,7 +96,7 @@ void sub_08028994(Entity* this) { } } -void sub_08028A48(Entity* this) { +void BusinessScrub_Action1(Entity* this) { if (this->timer != 0) { this->timer--; } else if (sub_08028F98(this, 0)) { @@ -106,7 +106,7 @@ void sub_08028A48(Entity* this) { } } -void sub_08028A74(Entity* this) { +void BusinessScrub_Action2(Entity* this) { u32 unk; GetNextFrame(this); @@ -184,7 +184,7 @@ void sub_08028A74(Entity* this) { } } -void sub_08028BC4(Entity* this) { +void BusinessScrub_Action3(Entity* this) { Entity* iVar1; switch (this->subAction) { @@ -226,7 +226,7 @@ void sub_08028BC4(Entity* this) { extern void sub_0804AA1C(Entity*); void sub_08028F0C(Entity*); -void sub_08028C84(Entity* this) { +void BusinessScrub_Action4(Entity* this) { if (--this->timer == 0) { this->timer = 48; if (this->subtimer) { @@ -243,21 +243,21 @@ void sub_08028C84(Entity* this) { sub_08028F0C(this); } -void sub_08028CE8(Entity* this) { +void BusinessScrub_Action5(Entity* this) { struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD; u32 subtype; if ((gMessage.doTextBox & 0x7f) == 0 && sub_0802915C(this) && !sub_08056338()) { if (offer->price <= gSave.stats.rupees) { - if (sub_080291DC(this)) { + if (BusinessScrub_CheckRefillFitsBag(this)) { /* Bag full. */ MessageFromTarget(TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x04)); SetPlayerControl(0); } else { ModRupees(-offer->price); switch (offer->field_0x0 >> 2) { - case 0: - subtype = offer->field_0x9; + case 0: // random kinstone + subtype = offer->item_subtype; if (subtype == KINSTONE_RANDOM) { subtype = kinstoneTypes[Random() & 7]; } @@ -272,13 +272,13 @@ void sub_08028CE8(Entity* this) { SetLocalFlag(KS_B06); #endif return; - case 1: - CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); + case 1: // refill, bottle, specific kinstone + CreateItemEntity(offer->offeredItem, offer->item_subtype, 0); this->timer = 4; sub_0802922C(this); return; - case 2: - CreateItemEntity(offer->offeredItem, offer->field_0x9, 0); + case 2: // grip ring + CreateItemEntity(offer->offeredItem, offer->item_subtype, 0); this->timer = 8; sub_0802922C(this); return; @@ -297,7 +297,7 @@ void sub_08028CE8(Entity* this) { sub_080290E0(this, 0); } -void sub_08028DE8(Entity* this) { +void BusinessScrub_Action6(Entity* this) { if (gPlayerEntity.action == PLAYER_ITEMGET) { if (this->field_0x80.HALF.HI == 0) { SetPlayerControl(1); @@ -315,15 +315,15 @@ void sub_08028DE8(Entity* this) { } } -void sub_08028E40(Entity* this) { +void BusinessScrub_Action7(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) { struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD; this->action = 4; this->subAction = gMessage.doTextBox & 0x7f; this->timer = 1; - if (CheckLocalFlag(offer->field_0xa) == 0) { - SetLocalFlag(offer->field_0xa); + if (!CheckLocalFlag(offer->local_flag)) { + SetLocalFlag(offer->local_flag); } SetPlayerControl(0); } @@ -331,7 +331,7 @@ void sub_08028E40(Entity* this) { GetNextFrame(this); } -void sub_08028E84(Entity* this) { +void BusinessScrub_Action8(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 4; this->timer = 1; @@ -343,7 +343,7 @@ bool32 sub_08029198(const struct SalesOffering*); void sub_08028E9C(Entity* this) { const struct SalesOffering* offer = &gUnk_080CC954[this->type]; if (sub_08029198(offer) && (offer->field_0x0 & 2)) { - offer = &gUnk_080CC954[offer->field_0xa]; + offer = &gUnk_080CC954[offer->local_flag]; } this->field_0x7c.WORD = (u32)offer; this->field_0x80.HALF.LO = 0; @@ -352,7 +352,7 @@ void sub_08028E9C(Entity* this) { void sub_08028EDC(Entity* this) { const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD; if (sub_08029198(offer) && (offer->field_0x0 & 2)) { - offer = &gUnk_080CC954[offer->field_0xa]; + offer = &gUnk_080CC954[offer->local_flag]; this->field_0x7c.WORD = (u32)offer; } } @@ -501,7 +501,7 @@ bool32 sub_08029198(const struct SalesOffering* offer) { return 0; } } else { - tmp = CheckLocalFlag(offer->field_0xa); + tmp = CheckLocalFlag(offer->local_flag); } if (tmp == 0) { @@ -511,7 +511,7 @@ bool32 sub_08029198(const struct SalesOffering* offer) { return TRUE; } -bool32 sub_080291DC(Entity* this) { +bool32 BusinessScrub_CheckRefillFitsBag(Entity* this) { const struct SalesOffering* offer = (const struct SalesOffering*)this->field_0x7c.WORD; switch (offer->offeredItem) { @@ -539,7 +539,7 @@ void sub_0802922C(Entity* this) { SetGlobalFlag(AKINDO_BOTTLE_SELL); // It only matters here that ITEM_BOMBS10 is here and some item that is higher // Not sure about the original code - case ITEM_ARROWS10: + case ITEM_ARROWS30: case ITEM_BOMBS10: default: sub_080290E0(this, 3); @@ -563,18 +563,18 @@ void sub_08029270(Entity* this) { // clang-format off const struct SalesOffering gUnk_080CC954[] = { - {0x06, 0x00, 0xffff, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0f), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x09, 0xff, 0x0001}, - {0x04, 0x00, 0x001e, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0e), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x6f, 0xff, 0xffff}, - {0x04, 0x00, 0x001e, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0b), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x6c, 0xff, 0xffff}, - {0x08, 0x00, 0x0028, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0c), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x11), 0x44, 0xff, 0xffff}, - {0x00, 0x00, 0x0064, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x5c, 0xff, 0xffff}, - {0x04, 0x00, 0x0014, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x10), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x11), 0x1c, 0xff, 0xffff}, + {0x06, 0x00, 0xffff, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0f), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_BOW, 0xff, 0x0001}, + {0x04, 0x00, 30, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0e), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_ARROWS30, 0xff, 0xffff}, + {0x04, 0x00, 30, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0b), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_BOMBS10, 0xff, 0xffff}, + {0x08, 0x00, 40, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0c), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x11), ITEM_GRIP_RING, 0xff, 0xffff}, + {0x00, 0x00, 100, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_KINSTONE, 0xff, 0xffff}, + {0x04, 0x00, 20, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x10), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x11), ITEM_BOTTLE1, 0xff, 0xffff}, {0x0c, 0x00, 0xffff, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x12), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x13), 0xff, 0xff, 0x0046}, - {0x04, 0x00, 0x0064, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x13), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x5c, 0x75, 0xffff}, + {0x04, 0x00, 100, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x13), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_KINSTONE, 0x75, 0xffff}, #ifdef EU - {0x00, 0x00, 0x0064, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x5c, 0xff, 0xffff}, + {0x00, 0x00, 100, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_KINSTONE, 0xff, 0xffff}, #else - {0x00, 0x00, 0x00C8, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), 0x5c, 0xff, 0xffff}, + {0x00, 0x00, 200, TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x0d), TEXT_INDEX(TEXT_BUSINESS_SCRUB, 0x02), ITEM_KINSTONE, 0xff, 0xffff}, #endif }; @@ -589,16 +589,16 @@ void (*const BusinessScrub_Functions[])(Entity*) = { BusinessScrub_OnGrabbed, }; -void (*const gUnk_080CC9E0[])(Entity*) = { - sub_08028994, - sub_08028A48, - sub_08028A74, - sub_08028BC4, - sub_08028C84, - sub_08028CE8, - sub_08028DE8, - sub_08028E40, - sub_08028E84, +void (*const BusinessScrub_Actions[])(Entity*) = { + BusinessScrub_Action0, + BusinessScrub_Action1, + BusinessScrub_Action2, + BusinessScrub_Action3, + BusinessScrub_Action4, + BusinessScrub_Action5, + BusinessScrub_Action6, + BusinessScrub_Action7, + BusinessScrub_Action8, }; const u8 gUnk_080CCA04[] = { diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c index 815c7411..12be6a8f 100644 --- a/src/enemy/octorokGolden.c +++ b/src/enemy/octorokGolden.c @@ -2,6 +2,7 @@ #include "map.h" #include "enemy.h" #include "player.h" +#include "item.h" void (*const OctorokGolden_Functions[])(Entity*); void (*const gUnk_080CF484[])(Entity*); @@ -40,7 +41,7 @@ void OctorokGolden_OnDeath(Entity* this) { SetGlobalFlag(this->type2); } - CreateDeathFx(this, 0xff, 0x58); + CreateDeathFx(this, 0xff, ITEM_RUPEE100); } void sub_08037CE4(Entity* this) { diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c index b8921b9a..b5d0f886 100644 --- a/src/enemy/ropeGolden.c +++ b/src/enemy/ropeGolden.c @@ -10,6 +10,7 @@ #include "enemy.h" #include "physics.h" #include "player.h" +#include "item.h" void RopeGolden_OnTick(Entity*); void RopeGolden_OnCollision(Entity*); @@ -58,7 +59,7 @@ void RopeGolden_OnDeath(Entity* this) { if ((this->gustJarState & 2) == 0) { SetGlobalFlag(this->type2); } - CreateDeathFx(this, 0xff, 0x58); + CreateDeathFx(this, 0xff, ITEM_RUPEE100); } void sub_08038258(Entity* this) { diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index beaffd3f..b6ffdca9 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -7,6 +7,7 @@ #include "collision.h" #include "enemy.h" +#include "item.h" #include "functions.h" void sub_08038168(Entity*); @@ -70,9 +71,9 @@ void TektiteGolden_OnDeath(Entity* this) { SetGlobalFlag(this->type2); } if (this->type != 0) { - uVar1 = 0x59; + uVar1 = ITEM_RUPEE200; } else { - uVar1 = 0x58; + uVar1 = ITEM_RUPEE100; } CreateDeathFx(this, 0xff, uVar1); } diff --git a/src/gameData.c b/src/gameData.c index 3009474c..152dfbcb 100644 --- a/src/gameData.c +++ b/src/gameData.c @@ -490,9 +490,9 @@ const WorldEvent gWorldEvents[] = { // { NONE, 0, 0, 0, 0x0, 0, 0 }, // }; extern TileEntity gUnk_080FEAC8[]; // TODO differs jp, demo_jp, eu -extern EntityData gUnk_080FEBE8[]; -extern EntityData gUnk_080FEC28[]; +extern const EntityData gUnk_080FEBE8[]; extern EntityData gUnk_080FECC8[]; +extern EntityData gUnk_080FEC28[]; extern const EntityData gUnk_080FED18[]; extern EntityData gUnk_080FED58[]; // TODO need to find out what gRoomVars.field_0x8c[ptr->entity_idx] is. diff --git a/src/kinstone.c b/src/kinstone.c index e6b8f054..1dff20c6 100644 --- a/src/kinstone.c +++ b/src/kinstone.c @@ -12,11 +12,11 @@ #include "subtask.h" extern const struct_gUnk_080B3D20 gUnk_080B3D20[]; -extern EntityData gUnk_080FEC28[]; -extern EntityData gUnk_080FEBE8[]; -extern EntityData gUnk_080FECC8[]; -extern EntityData gUnk_080FEE78[]; -extern EntityData gUnk_080FED58[]; +extern const EntityData gUnk_080FEC28[]; +extern const EntityData gUnk_080FEBE8[]; +extern const EntityData gUnk_080FECC8[]; +extern const EntityData gUnk_080FEE78[]; +extern const EntityData gUnk_080FED58[]; extern const EntityData gUnk_080FED18[]; extern const EntityData gUnk_080FEE38[]; extern const EntityData gUnk_080FEE18[]; @@ -505,7 +505,7 @@ void sub_08018BB4(u32 worldEventId) { MemCopy(gUnk_080FEAC8 + worldEventId, &tile, sizeof(TileEntity)); ptr = &gWorldEvents[worldEventId]; tile.tilePos = (ptr->x >> 4 & 0x3f) | (((ptr->y) >> 4 & 0x3f) << 6); - sub_0804B3C4(&tile); + LoadSmallChestTile2(&tile); if (CheckLocalFlag(tile.localFlag) == 0) { position = tile.tilePos; if ((tile._6 & 1) == 0) { diff --git a/src/menu/pauseMenu.c b/src/menu/pauseMenu.c index 29c4f3ab..7561c19a 100644 --- a/src/menu/pauseMenu.c +++ b/src/menu/pauseMenu.c @@ -905,37 +905,37 @@ void sub_080A59AC(void) { } void sub_080A59C8(void) { - u32 uVar2; - u32 bVar3; + u32 cursor_position; + u32 select_option; if (!sub_080A51F4()) { return; } - uVar2 = gMenu.field_0x3; - bVar3 = FALSE; + cursor_position = gMenu.field_0x3; + select_option = FALSE; switch (gInput.newKeys) { case DPAD_UP: - uVar2 = 0; + cursor_position = 0; break; case B_BUTTON: if (gMenu.field_0x3 == 0) { - uVar2 = 1; + cursor_position = 1; } else { - bVar3 = TRUE; + select_option = TRUE; } break; case DPAD_DOWN: - uVar2 = 1; + cursor_position = 1; break; case A_BUTTON: - bVar3 = TRUE; + select_option = TRUE; break; } - if (bVar3) { + if (select_option) { gMenu.transitionTimer = 255; - if (uVar2 == 0) { + if (cursor_position == 0) { CreateDialogBox(8, 0); SetMenuType(2); SoundReq(SFX_TEXTBOX_SELECT); @@ -943,9 +943,9 @@ void sub_080A59C8(void) { SetMenuType(3); SoundReq(SFX_MENU_CANCEL); } - } else if (gMenu.field_0x3 != uVar2) { - gMenu.field_0x3 = uVar2; - SetPopupState(0, uVar2); + } else if (gMenu.field_0x3 != cursor_position) { + gMenu.field_0x3 = cursor_position; + SetPopupState(0, cursor_position); SoundReq(SFX_TEXTBOX_CHOICE); } } diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 4532cfaf..2133d809 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -62,9 +62,9 @@ const u8 gUnk_0811162B[] = { ITEM_SKILL_SWORD_BEAM, ITEM_SKILL_PERIL_BEAM, ITEM_SKILL_GREAT_SPIN, - 243, - 244, - 245, + ITEM_SKILL_FAST_SPIN | 0x80, + ITEM_SKILL_FAST_SPLIT | 0x80, + ITEM_SKILL_LONG_SPIN | 0x80, 0, 0, 0, @@ -424,22 +424,22 @@ void sub_08068CFC(Entity* this, ScriptExecutionContext* context) { context->condition = 1; return; case 1: - itemID = 0x2; + itemID = ITEM_GREEN_SWORD; break; case 2: - itemID = 0x15; + itemID = ITEM_PEGASUS_BOOTS; break; case 3: - itemID = 0x14; + itemID = ITEM_ROCS_CAPE; break; case 5: - if (CheckLocalFlag(3) == 0) { + if (CheckLocalFlag(DOUKUTU_05_EVENT) == 0) { return; } context->condition = 1; return; case 6: - if (gSave.stats.maxHealth < 0x50) + if (gSave.stats.maxHealth < (10 * 8)) // ten hearts return; context->condition = 1; return; diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index bfa0e17c..44739b9d 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -224,7 +224,7 @@ void sub_08068190(Entity* this) { } uVar2 = 0; - if (CheckLocalFlag(0x7e)) { + if (CheckLocalFlag(OYAKATA_DEMO)) { uVar2 = 1; } if (GetInventoryValue(ITEM_FIRE_ELEMENT) != 0) { diff --git a/src/npc/percy.c b/src/npc/percy.c index 21a205f4..145bbea7 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -3,6 +3,7 @@ #include "npc.h" #include "functions.h" #include "kinstone.h" +#include "item.h" static const SpriteLoadData gUnk_08112E1C[] = { { 0x30f6, 0x47, 0x4 }, @@ -143,9 +144,9 @@ void sub_0806B540(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) { context->unk_18 = 3; if (gSave.stats.hasAllFigurines != 0) { - InitItemGetSequence(0x58, 0, 0); + InitItemGetSequence(ITEM_RUPEE100, 0, 0); } else { - InitItemGetSequence(0x3f, 100, 0); + InitItemGetSequence(ITEM_SHELLS, 100, 0); } SetRoomFlag(0xf); } diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index 7230bd7a..fa1e1305 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -222,10 +222,10 @@ void sub_08065370(Entity* this, ScriptExecutionContext* context) { } break; case ITEM_WALLET: - localFlag = 0x55; + localFlag = SHOP00_SAIFU; break; case ITEM_LARGE_QUIVER: - localFlag = 0x56; + localFlag = SHOP00_YAZUTSU; break; #ifndef EU case ITEM_BOMBBAG: @@ -251,7 +251,7 @@ void sub_08065370(Entity* this, ScriptExecutionContext* context) { if (localFlag) { SetLocalFlag(localFlag); } - if (gSave.unk5C <= -2) { + if (gSave.unk5C <= ~1u) { gSave.unk5C++; } diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index a8cb574b..721c800f 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -732,7 +732,7 @@ void sub_0806B004(Entity* this, ScriptExecutionContext* context) { int idx = 0; if (CheckGlobalFlag(MIZUKAKI_START)) { - if (CheckLocalFlag(0x73)) { + if (CheckLocalFlag(MIZUKAKI_BOOK_ALLBACK)) { if (GetInventoryValue(ITEM_FLIPPERS) == 0) { idx = 3; if (CheckLocalFlag(KHOUSE51_00) == 0) { diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index aa4f9b31..aa5c9c86 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -58,7 +58,8 @@ void sub_0806C7D4(Entity* this) { sub_0806F118(this); } else { sub_0807DD94(this, NULL); - if ((this->type2 == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) && (CheckRoomFlag(0))) { + if ((this->type2 == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(SORA_ELDER_RECOVER)) && + (CheckRoomFlag(0))) { this->type2 = 7; sub_0807DD80(this, &script_WindTribespeople6); } @@ -201,7 +202,7 @@ void sub_0806C99C(Entity* this, ScriptExecutionContext* context) { if (CheckGlobalFlag(WARP_EVENT_END)) { flagAsBool = 2; } - if (CheckLocalFlag(99) != 0) { + if (CheckLocalFlag(SORA_ELDER_RECOVER)) { flagAsBool++; } MessageNoOverlap(messageIndices[flagAsBool], this); diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 8a721a58..96702b71 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -177,12 +177,12 @@ void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) { } } -void sub_08084074(u32 param_1) { - u8* arr = (u8*)GetCurrentRoomProperty(3); - if (arr != NULL) { - for (; arr[0] != 0; arr += 8) { - if ((arr[0] == 3) && (param_1 == arr[1])) { - CreateItemEntity(arr[2], arr[3], 0); +void sub_08084074(u32 flag) { + TileEntity* tileEntity = (TileEntity*)GetCurrentRoomProperty(3); + if (tileEntity != NULL) { + for (; tileEntity->type != 0; tileEntity++) { + if ((tileEntity->type == BIG_CHEST) && (flag == tileEntity->localFlag)) { + CreateItemEntity(tileEntity->_2, tileEntity->_3, 0); return; } } @@ -190,7 +190,9 @@ void sub_08084074(u32 param_1) { } void sub_080840A8(s32 param_1, s32 param_2) { - static const u8 gUnk_0811F838[] = { 84, 84, 84, 84, 85, 85, 85, 86 }; + static const u8 gUnk_0811F838[] = { + ITEM_RUPEE1, ITEM_RUPEE1, ITEM_RUPEE1, ITEM_RUPEE1, ITEM_RUPEE5, ITEM_RUPEE5, ITEM_RUPEE5, ITEM_RUPEE20, + }; static const s32 gUnk_0811F840[] = { 393216, 458752, 524288, 589824 }; static const s8 gUnk_0811F850[] = { -6, 0, 0, 6 }; Entity* obj = CreateObject(GROUND_ITEM, gUnk_0811F838[Random() & 7], 0); diff --git a/src/object/cutsceneOrchestrator.c b/src/object/cutsceneOrchestrator.c index cdd0a4eb..aee672f1 100644 --- a/src/object/cutsceneOrchestrator.c +++ b/src/object/cutsceneOrchestrator.c @@ -2,7 +2,7 @@ * @file cutsceneOrchestrator.c * @ingroup Objects * - * @brief CutsceneO rchestrator object + * @brief Cutscene Orchestrator object */ #include "entity.h" #include "functions.h" diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c index e4c4f2ef..3a4d664c 100644 --- a/src/object/graveyardKey.c +++ b/src/object/graveyardKey.c @@ -45,21 +45,26 @@ void GraveyardKey_Action2(Entity*, const struct_gUnk_08123FB0*); void GraveyardKey_Action3(Entity*, const struct_gUnk_08123FB0*); static const struct_gUnk_08123FB0 gUnk_08123FB0[] = { - { sub_0809D91C, sub_0809D93C, 0, 0, 0x30, 0x30, 0x1, 0x3c, 0x3c, 0x13, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, - 0x1, 0x0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x63, 0x63, 0x10, 0, 0x1800, 0, 0x18, + { sub_0809D91C, sub_0809D93C, 0, 0, 0x30, 0x30, 0x1, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0x13, + Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_HEART_PIECE, ITEM_HEART_PIECE, 0x10, 0, 0x1800, 0, 0x18, #if defined(JP) || defined(DEMO_JP) || defined(EU) 0xCD, #else 0xd0, #endif 0, 0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0xf, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0, 0x3c, 0x3c, 0x2, Q_16_16(1.0), 0x1800, 0x140, 0x40, 0x4021, 0x1, 0x0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0xd, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x1a, Q_16_16(1.0), 0x1800, 0x100, 0x40, 0x4021, 0x1, 0x0 }, - { sub_0809D91C, NULL, 0, 0, 0, 0, 0x0, 0x3c, 0x3c, 0x13, Q_16_16(1.0), 0x1800, 0x60, 0x40, 0x4021, 0x1, 0x0 }, - { NULL, NULL, 0, 0, 0, 0, 0x0, 0x5c, 0x5c, 0x81, 0, 0x1800, 0x100, 0x20, 0x0, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0xf, Q_16_16(1.0), 0x1800, + 0x60, 0x40, 0x4021, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0x2, Q_16_16(1.0), 0x1800, + 0x140, 0x40, 0x4021, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0xd, Q_16_16(1.0), 0x1800, + 0x60, 0x40, 0x4021, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0x1a, Q_16_16(1.0), 0x1800, + 0x100, 0x40, 0x4021, 0x1, 0x0 }, + { sub_0809D91C, NULL, 0, 0, 0, 0, 0, ITEM_QST_GRAVEYARD_KEY, ITEM_QST_GRAVEYARD_KEY, 0x13, Q_16_16(1.0), 0x1800, + 0x60, 0x40, 0x4021, 0x1, 0x0 }, + { NULL, NULL, 0, 0, 0, 0, 0, ITEM_KINSTONE, ITEM_KINSTONE, 0x81, 0, 0x1800, 0x100, 0x20, 0x0, 0x1, 0x0 }, }; void GraveyardKey(Entity* this) { diff --git a/src/object/trapdoor.c b/src/object/trapdoor.c index c28517e9..34622516 100644 --- a/src/object/trapdoor.c +++ b/src/object/trapdoor.c @@ -37,7 +37,7 @@ void Trapdoor_Init(Entity* this) { } void Trapdoor_Action1(Entity* this) { - if (CheckLocalFlag(0x74)) { + if (CheckLocalFlag(MIZUKAKI_STAIR)) { GetNextFrame(this); if ((this->frame == 1) && (this->subAction == 0)) { this->frame = 0; @@ -68,7 +68,7 @@ void Trapdoor_Action3(Entity* this) { sub_08099ECC(this); RequestPriorityDuration(this, 30); } - if (CheckLocalFlag(0x75)) { + if (CheckLocalFlag(MIZUKAKI_STAIR_WARP_OK)) { CreateHoleManager(0x7); } } diff --git a/src/room.c b/src/room.c index 12ac101a..57cfab46 100644 --- a/src/room.c +++ b/src/room.c @@ -376,6 +376,6 @@ void sub_0804B388(u32 a1, u32 a2) { ModDungeonKeys(-1); } -void sub_0804B3C4(TileEntity* tile) { +void LoadSmallChestTile2(TileEntity* tile) { LoadSmallChestTile(tile); } diff --git a/src/roomInit.c b/src/roomInit.c index fe040744..51b92921 100644 --- a/src/roomInit.c +++ b/src/roomInit.c @@ -1580,7 +1580,7 @@ extern EntityData gUnk_080DB4D0; extern EntityData gUnk_080DB4A0; void sub_StateChange_TownMinishHoles_MayorsHouse(void) { - if (!GetInventoryValue(ITEM_FLIPPERS) && !GetInventoryValue(ITEM_QST_BOOK3) && CheckLocalFlag(KOBITO_DOUKUTU_04_T0)) + if (!GetInventoryValue(ITEM_FLIPPERS) && !GetInventoryValue(ITEM_QST_BOOK3) && CheckLocalFlag(MIZUKAKI_HINT3_MAYOR)) LoadRoomEntityList(&gUnk_080DB4D0); else LoadRoomEntityList(&gUnk_080DB4A0); @@ -1631,7 +1631,7 @@ void sub_StateChange_TownMinishHoles_5(void) { extern u32 gUnk_080DB910; u32 sub_unk3_TownMinishHoles_LibraryBookshelf(void) { - if (CheckGlobalFlag(MIZUKAKI_START) && !CheckLocalFlag(KOBITO_DOUKUTU_09_T0)) { + if (CheckGlobalFlag(MIZUKAKI_START) && !CheckLocalFlag(MIZUKAKI_BOOK_ALLBACK)) { gRoomVars.field_0x6c[1] = &gUnk_080DB910; } return 1; @@ -1655,7 +1655,7 @@ u32 sub_unk3_TownMinishHoles_LibrariBookHouse(void) { extern EntityData gUnk_080DBA08; void sub_StateChange_TownMinishHoles_LibrariBookHouse(void) { - if (GetInventoryValue(ITEM_FLIPPERS) || !CheckLocalFlag(KOBITO_DOUKUTU_09_T0)) { + if (GetInventoryValue(ITEM_FLIPPERS) || !CheckLocalFlag(MIZUKAKI_BOOK_ALLBACK)) { LoadRoomEntityList(&gUnk_080DBA08); } sub_0801AFE4(); @@ -1779,7 +1779,7 @@ extern EntityData gUnk_080DC4C0; void sub_StateChange_MinishVillage_Main(void) { if (!GetInventoryValue(ITEM_JABBERNUT)) { LoadRoomEntityList(&gUnk_080DC390); - if (!CheckLocalFlagByBank(FLAG_BANK_2, 0x80)) { + if (!CheckLocalFlagByBank(FLAG_BANK_2, M_PRIEST_TALK)) { LoadRoomEntityList(&gUnk_080DC3F0); } } else { @@ -1791,7 +1791,7 @@ void sub_StateChange_MinishVillage_Main(void) { if ((!CheckLocalFlagByBank(FLAG_BANK_2, M_ELDER_TALK2ND)) && GetInventoryValue(ITEM_GUST_JAR)) { LoadRoomEntityList(&gUnk_080DC470); } - if (!CheckLocalFlag(0x8d)) { + if (!CheckLocalFlag(KOBITO_MORI_1ST)) { LoadRoomEntityList(&gUnk_080DC4C0); } sub_08057E64(); @@ -1988,12 +1988,12 @@ void sub_StateChange_MelarisMine_Main(void) { if (!CheckGlobalFlag(WHITE_SWORD_END)) { LoadRoomEntityList(&gUnk_additional_8_MelarisMine_Main); } - if (!CheckLocalFlag(0x7f)) { + if (!CheckLocalFlag(YAMAKOBITO_OPEN)) { LoadRoomEntityList(&gUnk_additional_9_MelarisMine_Main); } else { LoadRoomEntityList(&gUnk_080DD294); } - SetLocalFlag(0x8e); + SetLocalFlag(KOBITO_YAMA_ENTER); } u32 sub_unk3_CloudTops_House(void) { @@ -2725,7 +2725,7 @@ void sub_StateChange_FortressOfWindsTop_Main(void) { SetGlobalFlag(LV3_CLEAR); UpdateGlobalProgress(); LoadStaticBackground(3); - if (!GetInventoryValue(ITEM_OCARINA) && CheckLocalFlag(0x45)) { + if (!GetInventoryValue(ITEM_OCARINA) && CheckLocalFlag(LV3_OCARINA_FALL)) { LoadRoomEntityList(&gUnk_080E3850); } } @@ -4657,7 +4657,7 @@ void sub_StateChange_SimonsSimulation_Main(void) { SetLocalFlag(0xC6); index = 0xE; } - sub_0804B3C4(&gUnk_080F0E1C[index]); + LoadSmallChestTile2(&gUnk_080F0E1C[index]); SoundReq(SONG_STOP_BGM); } @@ -4798,14 +4798,14 @@ extern EntityData gUnk_080F2798; void sub_StateChange_HouseInteriors2_Percy(void) { if (CheckKinstoneFused(KINSTONE_21)) { - if (!CheckLocalFlag(0x42)) { - if (!CheckLocalFlag(0x43)) { + if (!CheckLocalFlag(MHOUSE08_03)) { + if (!CheckLocalFlag(MHOUSE08_04)) { LoadRoomEntityList(&gUnk_additional_9_HouseInteriors2_Percy); LoadRoomTileEntities(&gUnk_080F2860); } else { LoadRoomEntityList(&gUnk_additional_a_HouseInteriors2_Percy); } - } else if (!CheckLocalFlag(0x3f)) { + } else if (!CheckLocalFlag(MHOUSE08_00)) { LoadRoomEntityList(&gUnk_080F27D8); } else { LoadRoomEntityList(&gUnk_080F2798); @@ -4894,7 +4894,7 @@ u32 sub_unk3_HouseInteriors2_Dampe(void) { extern EntityData gUnk_080F2FD4; void sub_StateChange_HouseInteriors2_Dampe(void) { - if (!CheckLocalFlag(0x69) || GetInventoryValue(ITEM_QST_GRAVEYARD_KEY) > 1) { + if (!CheckLocalFlag(DANPEI_TALK1ST) || GetInventoryValue(ITEM_QST_GRAVEYARD_KEY) > 1) { LoadRoomEntityList(&gUnk_080F2FD4); } } @@ -5351,10 +5351,10 @@ extern EntityData gUnk_080F5788; void sub_StateChange_HouseInteriors3_StockwellShop(void) { LoadRoomEntityList(&gUnk_080F5758); - if (!GetInventoryValue(ITEM_QST_DOGFOOD) && CheckLocalFlagByBank(FLAG_BANK_2, 0x8f)) { + if (!GetInventoryValue(ITEM_QST_DOGFOOD) && CheckLocalFlagByBank(FLAG_BANK_2, KHOUSE52_KINOKO)) { LoadRoomEntityList(&gUnk_080F57E8); } - if (!CheckLocalFlag(0x55)) { + if (!CheckLocalFlag(SHOP00_SAIFU)) { LoadRoomEntityList(&gUnk_080F57A8); } else { if (gBombBagSizes[gSave.stats.bombBagType] >= 30) { @@ -5364,7 +5364,7 @@ void sub_StateChange_HouseInteriors3_StockwellShop(void) { LoadRoomEntityList(&gUnk_080F5888); #ifndef EU } else { - if (!CheckLocalFlag(0xcd)) { + if (!CheckLocalFlag(SHOP00_BOMBBAG)) { LoadRoomEntityList(&gUnk_080F58A8); } #endif @@ -5372,7 +5372,7 @@ void sub_StateChange_HouseInteriors3_StockwellShop(void) { } if (GetInventoryValue(ITEM_BOW) || CheckGlobalFlag(LV3_CLEAR)) { LoadRoomEntityList(&gUnk_080F5868); - if (!CheckLocalFlag(0x56)) { + if (!CheckLocalFlag(SHOP00_YAZUTSU)) { LoadRoomEntityList(&gUnk_080F5828); } else { LoadRoomEntityList(&gUnk_080F5848); @@ -5508,7 +5508,7 @@ void sub_StateChange_WindTribeTower_Floor2(void) { if (!CheckGlobalFlag(WARP_EVENT_END)) { LoadRoomEntityList(&gUnk_080F62E4); } else { - if (CheckLocalFlag(99)) { + if (CheckLocalFlag(SORA_ELDER_RECOVER)) { LoadRoomEntityList(&gUnk_080F6324); } } @@ -5719,9 +5719,8 @@ extern EntityData gUnk_080F7860; extern EntityData gUnk_080F78A0; void sub_StateChange_HyruleField_LonLonRanch(void) { - - CloudOverlayManager_Main(0); - if (CheckLocalFlagByBank(FLAG_BANK_2, 0x8f)) { + CloudOverlayManager_Main(NULL); + if (CheckLocalFlagByBank(FLAG_BANK_2, KHOUSE52_KINOKO)) { if (!CheckGlobalFlag(INLOCK)) { LoadRoomEntityList(&gUnk_080F77C0); } diff --git a/src/script.c b/src/script.c index 23387340..d5101f4a 100644 --- a/src/script.c +++ b/src/script.c @@ -1368,6 +1368,7 @@ void ScriptCommand_0807ED24(Entity* entity, ScriptExecutionContext* context) { gActiveScriptInfo.commandSize = 0; } +// player movement? void ScriptCommand_0807EDD4(Entity* entity, ScriptExecutionContext* context) { if (!context->unk_18) { context->unk_18 = 1; @@ -1485,7 +1486,7 @@ void ScriptCommand_IncreaseMaxHealth(Entity* entity, ScriptExecutionContext* con void ScriptCommand_GivePlayerItem(Entity* entity, ScriptExecutionContext* context) { u32 tmp = 0; - if (context->scriptInstructionPointer[1] == 0x3F) { + if (context->scriptInstructionPointer[1] == ITEM_SHELLS) { tmp = context->intVariable; } InitItemGetSequence(context->scriptInstructionPointer[1], tmp, 0);