diff options
| author | Aetias <144526980+AetiasHax@users.noreply.github.com> | 2026-05-11 23:32:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-11 23:32:28 +0200 |
| commit | 1570b7d2d63aed0a77fc2077618b766eebaba56e (patch) | |
| tree | 3101c185752a22ae5e1f394af8e29263771862d7 /src/31_Shop | |
| parent | e704ec994219540b71da323a61ffa930f80ce492 (diff) | |
ActorItemSellerBase OK (#163)
* ActorItemSellerBase OK
* Fix broken matches
Diffstat (limited to 'src/31_Shop')
| -rw-r--r-- | src/31_Shop/Actor/ActorBeedle.cpp | 10 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorItemSeller.cpp | 2 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorItemSellerBase.cpp | 471 | ||||
| -rw-r--r-- | src/31_Shop/Actor/ActorShopItem.cpp | 67 |
4 files changed, 467 insertions, 83 deletions
diff --git a/src/31_Shop/Actor/ActorBeedle.cpp b/src/31_Shop/Actor/ActorBeedle.cpp index 0daf9d03..9a31a491 100644 --- a/src/31_Shop/Actor/ActorBeedle.cpp +++ b/src/31_Shop/Actor/ActorBeedle.cpp @@ -4,7 +4,7 @@ ActorBeedle *ActorBeedle::Create() {} bool ActorBeedle::Init() {} void ActorBeedle::vfunc_c4() {} -void ActorBeedle::vfunc_114() {} +unk32 ActorBeedle::vfunc_114(unk32 param1) {} unk32 ActorBeedle::vfunc_d4() {} static unk32 func_ov031_02180e44(unk32 param1, unk32 param2) {} @@ -14,9 +14,9 @@ void ActorBeedle::vfunc_f8() {} void ActorBeedle::vfunc_fc() {} void ActorBeedle::vfunc_100() {} void ActorBeedle::vfunc_104() {} -unk32 ActorBeedle::vfunc_d8() {} -unk32 ActorBeedle::vfunc_dc() {} -unk32 ActorBeedle::vfunc_e0() {} +unk32 ActorBeedle::vfunc_d8(unk32 param1) {} +unk32 ActorBeedle::vfunc_dc(unk32 param1) {} +unk32 ActorBeedle::vfunc_e0(unk32 param1) {} bool ActorBeedle::vfunc_70() {} bool ActorBeedle::vfunc_6c() {} void ActorBeedle::vfunc_108() {} @@ -26,6 +26,6 @@ void ActorBeedle::vfunc_110() {} unk32 ActorBeedle::func_ov031_021812e4(unk32 param1) {} void ActorBeedle::func_ov031_0218132c(unk32 param1) {} -void ActorBeedle::vfunc_11c() {} +bool ActorBeedle::vfunc_11c() {} void ActorBeedle::vfunc_118() {} ActorBeedle::~ActorBeedle() {} diff --git a/src/31_Shop/Actor/ActorItemSeller.cpp b/src/31_Shop/Actor/ActorItemSeller.cpp index c6d746af..fd1f9a4d 100644 --- a/src/31_Shop/Actor/ActorItemSeller.cpp +++ b/src/31_Shop/Actor/ActorItemSeller.cpp @@ -5,7 +5,7 @@ ActorItemSeller *ActorItemSeller2::Create() {} ActorItemSeller *ActorItemSeller3::Create() {} bool ActorItemSeller::Init() {} -void ActorItemSeller::vfunc_114() {} +unk32 ActorItemSeller::vfunc_114(unk32 param1) {} void ActorItemSeller::vfunc_f4() {} void ActorItemSeller::vfunc_f8() {} void ActorItemSeller::vfunc_fc() {} diff --git a/src/31_Shop/Actor/ActorItemSellerBase.cpp b/src/31_Shop/Actor/ActorItemSellerBase.cpp index d051a075..9309f0d7 100644 --- a/src/31_Shop/Actor/ActorItemSellerBase.cpp +++ b/src/31_Shop/Actor/ActorItemSellerBase.cpp @@ -1,39 +1,436 @@ +#include "Actor/ActorShopItem.hpp" +#include "Actor/ActorSpawner.hpp" +#include "Actor/ActorTypeId.hpp" #include "Actor/Character/ActorItemSeller.hpp" +#include "DTCM/UnkStruct_027e0c54.hpp" +#include "DTCM/UnkStruct_027e0f64.hpp" +#include "Item/Item.hpp" +#include "Item/ItemManager.hpp" +#include "Message/MessageManager.hpp" +#include "Message/MsgProc.hpp" +#include "Player/PlayerLinkBase.hpp" +#include "Player/TouchControl.hpp" +#include "Unknown/UnkStruct_02037628.hpp" +#include "Unknown/UnkStruct_027e0dbc.hpp" +#include "nds/math.h" -ActorItemSellerBase::ActorItemSellerBase() {} -ActorItemSellerBase::~ActorItemSellerBase() {} - -bool ActorItemSellerBase::Init() {} -void ActorItemSellerBase::vfunc_20(bool param1) {} -bool ActorItemSellerBase::vfunc_c0() {} -void ActorItemSellerBase::vfunc_c4() {} - -void ActorItemSellerBase::func_ov031_0217d588() {} -void ActorItemSellerBase::func_ov031_0217d5c0() {} -void ActorItemSellerBase::func_ov031_0217d5c4() {} -void ActorItemSellerBase::func_ov031_0217d5e8() {} -void ActorItemSellerBase::func_ov031_0217d610() {} -void ActorItemSellerBase::func_ov031_0217d62c() {} -void ActorItemSellerBase::func_ov031_0217d638() {} -void ActorItemSellerBase::func_ov031_0217d6ac() {} -void ActorItemSellerBase::func_ov031_0217d6d0() {} -void ActorItemSellerBase::func_ov031_0217d760() {} -void ActorItemSellerBase::func_ov031_0217d784() {} -void ActorItemSellerBase::func_ov031_0217d7ac() {} -void ActorItemSellerBase::func_ov031_0217d830() {} -void ActorItemSellerBase::func_ov031_0217d858() {} -void ActorItemSellerBase::func_ov031_0217d890() {} -void ActorItemSellerBase::func_ov031_0217d8d0() {} -void ActorItemSellerBase::func_ov031_0217d8dc() {} -void ActorItemSellerBase::func_ov031_0217d93c() {} -void ActorItemSellerBase::func_ov031_0217d974() {} - -unk32 ActorItemSellerBase::vfunc_d4() {} -bool ActorItemSellerBase::vfunc_8c() {} - -void ActorItemSellerBase::func_ov031_0217da20(unk32 param1) {} - -void ActorItemSellerBase::vfunc_68() {} -bool ActorItemSellerBase::CollidesWithLink() {} -void ActorItemSellerBase::vfunc_11c() {} -bool ActorItemSellerBase::IsHitboxTouched(bool param1) {} +static ActorItemSellerBase *sCurrentSeller; + +ARM ActorItemSellerBase *ActorItemSellerBase::GetCurrentSeller() { + return sCurrentSeller; +} + +ARM ActorItemSellerBase::ActorItemSellerBase() { + mUnk_470 = 3; + sCurrentSeller = this; +} + +ARM ActorItemSellerBase::~ActorItemSellerBase() { + sCurrentSeller = NULL; +} + +static const ActorTypeId sShopItemActorTypes[ShopItem_BASE_COUNT] = { + [ShopItem_Test] = ActorTypeId_ShopItemDM, + [ShopItem_SoldOut] = ActorTypeId_ShopItemSoldOut, + [ShopItem_Bombs] = ActorTypeId_ShopItemBombs, + [ShopItem_Arrows] = ActorTypeId_ShopItemArrows, + [ShopItem_Bombchus] = ActorTypeId_ShopItemBombchus, + [ShopItem_HeartContainer] = ActorTypeId_ShopItemHeartContainer, + [ShopItem_BombBag] = ActorTypeId_ShopItemBombBag, + [ShopItem_Quiver] = ActorTypeId_ShopItemQuiver, + [ShopItem_BombchuBag] = ActorTypeId_ShopItemBombchuBag, + [ShopItem_ShipPart] = ActorTypeId_ShopItemShipPart, + [ShopItem_Treasure] = ActorTypeId_ShopItemTreasure, + [ShopItem_CourageGem] = ActorTypeId_ShopItemGem, + [ShopItem_PowerGem] = ActorTypeId_ShopItemGem, + [ShopItem_WisdomGem] = ActorTypeId_ShopItemGem, + [ShopItem_Shield] = ActorTypeId_ShopItemShield, + [ShopItem_RedPotion] = ActorTypeId_ShopItemPotion, + [ShopItem_PurplePotion] = ActorTypeId_ShopItemPotion, + [ShopItem_YellowPotion] = ActorTypeId_ShopItemPotion, +}; + +ARM bool ActorItemSellerBase::Init() { + UnkStruct_ov031_02183e80 *pUVar2; + unk32 numShipParts; + s32 numTreasure; + + ActorCharacter_1d8 *pUnk_1d8 = &mUnk_1d8; + pUnk_1d8->mUnk_020.mUnk_5c = 0x3800; + pUnk_1d8->mUnk_020.mUnk_64 = 0x4000; + pUnk_1d8->mUnk_020.mUnk_60 = 0x5000; + pUnk_1d8->mUnk_020.mUnk_66 = 0x5555; + mUnk_1d8.mUnk_020.mUnk_8d = 0; + mUnk_1d8.func_ov014_02145e48(0); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; + this->func_ov031_0217d588(); + + ActorSpawnOptions options; + Vec3p pos = mPos; + pos.x -= FLOAT_TO_Q20(0.8); + pos.y += FLOAT_TO_Q20(0.65); + pos.z += FLOAT_TO_Q20(1.2); + numShipParts = 0; + numTreasure = 0; + for (s32 i = 0; i < 5; ++i) { + ShopItem shopItem = this->vfunc_114(i); + options.mUnk_24 = 0; + ActorTypeId actorType = sShopItemActorTypes[shopItem]; + switch (actorType) { + case ActorTypeId_ShopItemBombBag: + if (!gItemManager->HasItem(ItemFlag_BombBag)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemQuiver: + if (!gItemManager->HasItem(ItemFlag_Bow)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemBombchuBag: + if (!gItemManager->HasItem(ItemFlag_BombchuBag)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + break; + case ActorTypeId_ShopItemShipPart: + options.mUnk_24 = numShipParts; + if (data_027e0dbc.func_ov003_020f3d5c(numShipParts + 8)) { + actorType = ActorTypeId_ShopItemSoldOut; + } + numShipParts++; + break; + case ActorTypeId_ShopItemTreasure: { + bool unk; + if (mUnk_470 == 2) { + options.mUnk_24 = numTreasure + 2; + unk = data_027e0dbc.func_ov003_020f3d5c(numTreasure + 7); + } else { + options.mUnk_24 = numTreasure; + unk = data_027e0dbc.func_ov003_020f3d5c(numTreasure + 5); + } + if (unk) { + actorType = ActorTypeId_ShopItemSoldOut; + } + numTreasure++; + break; + } + case ActorTypeId_ShopItemGem: + options.mUnk_24 = shopItem - ShopItem_CourageGem; + break; + case ActorTypeId_ShopItemPotion: + options.mUnk_24 = shopItem - ShopItem_RedPotion; + break; + } + gActorSpawner->Spawn(actorType, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefs[i]); + pos.x += FLOAT_TO_Q20(0.4); + if (i % 2 == 0) { + pos.z += FLOAT_TO_Q20(0.8); + } else { + pos.z -= FLOAT_TO_Q20(0.8); + } + } + options.mUnk_24 = 0; + pos.x = mPos.x - FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemBK, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefBK); + pos.x = mPos.x + FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemCC, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefCC); + pos.x = mPos.x + FLOAT_TO_Q20(1.0); + pos.y = mPos.y + FLOAT_TO_Q20(0.5); + pos.z = mPos.z + FLOAT_TO_Q20(2.5); + gActorSpawner->Spawn(ActorTypeId_ShopItemBY, &pos, &options, &UnkStruct_ov031_02183e80::GetInstance()->mShopItemRefBY); + mUnk_478 = 0; + mUnk_47c = data_027e0dbc.GetUnk_24()->mUnk_0b; + mUnk_480 = 0; + return ActorCharacter::Init(); +} + +ARM void ActorItemSellerBase::vfunc_20(bool param1) { + if (!data_027e0c54.func_020361d0()) { + ActorCharacter::vfunc_20(param1); + } +} + +ARM bool ActorItemSellerBase::vfunc_c0() { + if (ActorCharacterBase::vfunc_c0()) { + return true; + } + return mUnk_474 != 0; +} + +ARM void ActorItemSellerBase::vfunc_c4() { + Vec3p offsetPos; + if (mInactive) { + mAngle = mUnk_012; + mUnk_1d8.mUnk_020.mUnk_8d = 0; + return; + } + mPrevPos.x = mPos.x; + mPrevPos.y = mPos.y; + mPrevPos.z = mPos.z; + mUnk_1d8.mActor->GetOffsetPos(&offsetPos); + mUnk_1d8.mUnk_020.func_ov014_0214aa0c(&offsetPos, mUnk_1d8.mActor->mAngle); + switch (mUnk_474) { + case 0: + this->func_ov031_0217d5c0(); + break; + case 1: + this->func_ov031_0217d5e8(); + break; + case 2: + this->func_ov031_0217d638(); + break; + case 3: + case 4: + this->func_ov031_0217d6d0(); + break; + case 5: + this->func_ov031_0217d784(); + break; + case 6: + this->func_ov031_0217d830(); + break; + case 7: + this->func_ov031_0217d890(); + break; + case 8: + this->func_ov031_0217d8dc(); + break; + } + mUnk_1d8.func_ov014_02145cac(); + this->func_ov014_02145178(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d588() { + mUnk_474 = 0; + mUnk_1d8.func_ov014_02145f0c(0); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; + this->vfunc_b4(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d5c0() {} + +ARM void ActorItemSellerBase::func_ov031_0217d5c4() { + mUnk_474 = 1; + this->func_ov014_0214591c(); + mUnk_1d8.mUnk_10->mUnk_0c.mUnk_04 = 0x1000; +} + +ARM void ActorItemSellerBase::func_ov031_0217d5e8() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d610() { + mUnk_474 = 2; + this->vfunc_118(); +} + +ARM void ActorItemSellerBase::func_ov031_0217d62c() { + mUnk_474 = 2; +} + +ARM void ActorItemSellerBase::func_ov031_0217d638() { + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_000 != 5) { + return; + } + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_194 != -1) { + this->func_ov031_0217d858(); + return; + } + if (mUnk_470 == 0 && this->vfunc_11c()) { + this->func_ov031_0217d6ac(); + return; + } + this->func_ov031_0217d760(); +} + +ARM bool ActorItemSellerBase::func_ov031_0217d6ac() { + mUnk_474 = 3; + return data_027e0e28.func_ov018_02160a64(-1, 1); +} + +ARM void ActorItemSellerBase::func_ov031_0217d6d0() { + UnkStruct_02037628 auStack_20; + + switch (mUnk_474) { + case 3: + auStack_20.func_02037628(); + if (auStack_20.mUnk_15 == 0) { + mUnk_474 = 4; + this->vfunc_b4(); + this->SetUnk_11c(1); + } + break; + case 4: + default: + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d760() { + mUnk_474 = 5; + data_027e0e28.func_ov018_02160a64(-1, 1); +} + +ARM void ActorItemSellerBase::func_ov031_0217d784() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d7ac() { + mUnk_474 = 6; + data_027e0f64->mUnk_4->func_ov000_0208726c(0); + data_027e0f64->mUnk_8->func_ov000_0208726c(0); + this->vfunc_b4(); + this->SetUnk_11c(1); + for (s32 i = 0; i < 5; ++i) { + ActorShopItem *shopItem = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cdd8(i); + if (shopItem != NULL) { + shopItem->func_ov031_0217f0b4(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d830() { + if (this->vfunc_bc()) { + this->func_ov031_0217d588(); + } +} + +extern "C" bool HasFreebieCard(); +ARM void ActorItemSellerBase::func_ov031_0217d858() { + + mUnk_474 = 7; + unk32 unk = UnkStruct_ov031_02183e80::GetInstance()->mUnk_194; + data_027e0e28.func_ov018_02160a64(unk, !HasFreebieCard()); +} + +ARM void ActorItemSellerBase::func_ov031_0217d890() { + PlayerLinkBase *pPlayerLink = gPlayerLink; + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 || pPlayerLink->GetStateId() == 6) { + this->func_ov031_0217d8d0(); + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d8d0() { + mUnk_474 = 8; +} + +ARM void ActorItemSellerBase::func_ov031_0217d8dc() { + PlayerLinkBase *pPlayerLink = gPlayerLink; + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 || pPlayerLink->GetStateId() != 6) { + UnkStruct_ov031_02183e80::GetInstance()->mUnk_198 = false; + if (HasFreebieCard()) { + this->func_ov031_0217d7ac(); + } else { + this->func_ov031_0217d62c(); + } + } +} + +ARM void ActorItemSellerBase::func_ov031_0217d93c() { + UnkStruct_027e0f64_04 *unk = data_027e0f64->mUnk_4; + mUnk_1d8.mUnk_020.mUnk_78.x = unk->mUnk_260.x; + mUnk_1d8.mUnk_020.mUnk_78.y = unk->mUnk_260.y; + mUnk_1d8.mUnk_020.mUnk_78.z = unk->mUnk_260.z; + mUnk_1d8.mUnk_020.mUnk_8c = true; + mUnk_1d8.mUnk_020.mUnk_8f = true; +} + +ARM void ActorItemSellerBase::func_ov031_0217d974() { + mUnk_1d8.mUnk_020.mUnk_8c = false; + mUnk_1d8.mUnk_020.mUnk_8f = true; +} + +ARM unk32 ActorItemSellerBase::vfunc_d4() { + return ActorCharacterBase::vfunc_d4(); +} + +ARM bool ActorItemSellerBase::vfunc_8c() { + switch (mUnk_474) { + case 1: + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217ce18()) { + return true; + } + if (mUnk_480) { + mUnk_480 = false; + return true; + } + this->func_ov031_0217d610(); + return false; + case 2: + case 7: + case 8: + return false; + } + return true; +} + +ARM void ActorItemSellerBase::func_ov031_0217da20(unk32 param1) { + UnkStruct_020397f8 *iVar1; + UnkStruct_02037628 auStack_28; + auStack_28.func_020376c0(&mPos); + auStack_28.mUnk_15 = 0; + auStack_28.mUnk_16 = 1; + iVar1 = gMessageManager.func_02036f68(param1, &auStack_28, &mUnk_158); + iVar1->mUnk_38 = &mUnk_478; + iVar1->mUnk_3c = 2; +} + +ARM void ActorItemSellerBase::vfunc_68(unk32 param1, UnkStruct_020397f8 *param2) { + param2->mUnk_38 = &mUnk_478; + param2->mUnk_3c = 2; + ActorCharacterBase::vfunc_68(param1, param2); + if (!mUnk_474) { + this->func_ov031_0217d5c4(); + } +} + +ARM bool ActorItemSellerBase::CollidesWithLink() { + Vec3p pos = mPos; + Vec3p playerPos = gPlayerPos; + if (playerPos.z < pos.z - FLOAT_TO_Q20(1.0)) { + return false; + } + if (playerPos.z > pos.z + FLOAT_TO_Q20(4.0)) { + return false; + } + if (playerPos.x < pos.x - FLOAT_TO_Q20(3.0)) { + return false; + } + if (playerPos.x > pos.x + FLOAT_TO_Q20(3.0)) { + return false; + } + return true; +} + +ARM bool ActorItemSellerBase::vfunc_11c() { + return false; +} + +ARM bool ActorItemSellerBase::IsHitboxTouched(bool param1) { + if (ActorCharacter::IsHitboxTouched(param1)) { + return true; + } + for (s32 i = 0; i < 5; ++i) { + ActorShopItem *shopItem = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cdd8(i); + if (param1) { + if (TouchControl::func_0202b864(&shopItem->mPos, 0x4cd, 8)) { + return true; + } + } else { + if (TouchControl::func_0202b894(&shopItem->mPos, 0x4cd, 8)) { + return true; + } + } + } + return false; +} diff --git a/src/31_Shop/Actor/ActorShopItem.cpp b/src/31_Shop/Actor/ActorShopItem.cpp index 9b10209b..903c9e8a 100644 --- a/src/31_Shop/Actor/ActorShopItem.cpp +++ b/src/31_Shop/Actor/ActorShopItem.cpp @@ -1,5 +1,6 @@ #include "Actor/ActorShopItem.hpp" #include "Actor/ActorTypeId.hpp" +#include "Actor/Character/ActorItemSeller.hpp" #include "DTCM/UnkStruct_027e0c54.hpp" #include "DTCM/UnkStruct_027e0f64.hpp" #include "Item/Item.hpp" @@ -566,8 +567,6 @@ ARM void ActorShopItemBase::vfunc_14(u32 param1) { mUnk_0a4.func_ov000_0207a1c8(param1, &mPos); } -extern "C" UnkStruct_ov031_02183e80 *func_ov031_0217bdb8(); - ARM void ActorShopItem::vfunc_14(u32 param1) { Vec3p subroutine_arg0; Vec3p sp24; @@ -575,7 +574,7 @@ ARM void ActorShopItem::vfunc_14(u32 param1) { Vec3p *temp_r0_2; UnkStruct_027e0f64_04 *temp_r3; - if ((this->func_ov00_020c313c(param1) != 0) && (func_ov031_0217bdb8()->mUnk_19a == 0)) { + if ((this->func_ov00_020c313c(param1) != 0) && (UnkStruct_ov031_02183e80::GetInstance()->mUnk_19a == 0)) { temp_r3 = data_027e0f64->mUnk_8; sp24 = temp_r3->mUnk_260; sp24.y = FLOAT_TO_Q20(2.3); @@ -603,7 +602,7 @@ ARM void ActorShopItem::vfunc_14(u32 param1) { } ARM void ActorShopItemShipPart::vfunc_14(u32 param1) { - if (func_ov031_0217bdb8()->mUnk_19a != 0 && mUnk_174 == true) { + if (UnkStruct_ov031_02183e80::GetInstance()->mUnk_19a != 0 && mUnk_174 == true) { mModel = mUnk_178; mPos.x = 0; mPos.y = FLOAT_TO_Q20(10.0); @@ -736,8 +735,6 @@ ARM void ActorShopItem::vfunc_20(bool param1) { data_ov000_020e9c88.func_ov000_0207b89c(param1, &mPos, &func_ov031_0217f114, this); } -extern "C" unk32 func_ov031_0217bda0(); -extern "C" unk32 func_ov031_0217bdac(); extern "C" void CopySingle288(void *src, void *dest); extern "C" void func_ov009_0211d090(Vec3p *, Vec3p *); extern "C" void func_ov009_0211d00c(Mat3p *, Vec3p *); @@ -746,17 +743,15 @@ ARM void ActorShopItemShipPart::vfunc_20(bool param1) { return; } if (mUnk_174 == true && mModel == mUnk_178) { - func_ov031_0217bdb8(); - unk32 size = func_ov031_0217bda0(); + unk32 size = UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bda0(); UnkStruct_027e0f64_04 *unk1 = data_027e0f64->func_ov000_0208b180(); Mat4x3p MStack_44 = unk1->mUnk_01c; Mat3p tempMatrix; CopySingle288(&MStack_44, &tempMatrix); Mat3p rotation2; Mat3p_func_01ff83a0(&tempMatrix, &rotation2); - func_ov031_0217bdb8(); Vec3p translation; - translation.z = -func_ov031_0217bdac(); + translation.z = -UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bdac(); translation.x = 0; translation.y = 0; Mat3p_MultiplyVec(&translation, &rotation2, &translation); @@ -767,7 +762,7 @@ ARM void ActorShopItemShipPart::vfunc_20(bool param1) { scale2.z = size; sShip2Model->SetTransform(&scale2, &rotation2, &translation); - Vec3p tempVec = func_ov031_0217bdb8()->mUnk_178; + Vec3p tempVec = UnkStruct_ov031_02183e80::GetInstance()->mUnk_178; translation = tempVec; Vec3p_Add(&mPos, &translation, &translation); Vec3p scale; @@ -837,14 +832,8 @@ ARM void ActorShopItemBY::vfunc_1c(u16 *param1) { } } -struct UnkStruct_ov031_02183e84 { - /* 000 */ PAD(0x000, 0x470); - /* 470 */ unk32 mUnk_470; - /* 474 */ -}; -extern UnkStruct_ov031_02183e84 *func_ov031_0217cf1c(); ARM unk32 ActorShopItem::GetSoldOutMessageId() { - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x57); } else { return BMG_ID(BMG_FILE_INDEX_SHIP, 0xff); @@ -860,7 +849,7 @@ ARM unk32 ActorShopItemSoldOut::GetMessageId() { } ARM unk32 ActorShopItemHeartContainer::GetMessageId() { - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x44); } else { return BMG_ID(BMG_FILE_INDEX_SHIP, 0x8e); @@ -881,7 +870,7 @@ ARM unk32 ActorShopItemBombs::GetMessageId() { extern "C" bool HasFreebieCard(); ARM unk32 ActorShopItemBombBag::GetMessageId() { - unk32 unk = func_ov031_0217cf1c()->mUnk_470; + unk32 unk = ActorItemSellerBase::GetCurrentSeller()->mUnk_470; if (unk == 2) { return BMG_ID(BMG_FILE_INDEX_FIELD, 0x48); } else if (HasFreebieCard()) { @@ -896,7 +885,7 @@ ARM unk32 ActorShopItemBombchus::GetMessageId() { } ARM unk32 ActorShopItemBombchuBag::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x49); case 1: @@ -908,7 +897,7 @@ ARM unk32 ActorShopItemBombchuBag::GetMessageId() { } ARM unk32 ActorShopItemShipPart::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x46); case 0: @@ -935,7 +924,7 @@ ARM unk32 ActorShopItemShipPart::GetMessageId() { } ARM unk32 ActorShopItemTreasure::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4a); case 0: @@ -962,7 +951,7 @@ ARM unk32 ActorShopItemTreasure::GetMessageId() { } ARM unk32 ActorShopItemGem::GetMessageId() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4b); case 0: @@ -985,7 +974,7 @@ ARM unk32 ActorShopItemShield::GetMessageId() { ARM unk32 ActorShopItemPotion::GetMessageId() { int iVar1; - if (func_ov031_0217cf1c()->mUnk_470 == 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 2) { switch (mShopItemId) { case ShopItem_RedPotion: return BMG_ID(BMG_FILE_INDEX_FIELD, 0x4d); @@ -1022,7 +1011,7 @@ ARM s32 ActorShopItem::GetPrice() { } ARM s32 ActorShopItemHeartContainer::GetPrice() { - if (func_ov031_0217cf1c()->mUnk_470 == 1) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 == 1) { return 1500; } else { return 2000; @@ -1030,7 +1019,7 @@ ARM s32 ActorShopItemHeartContainer::GetPrice() { } ARM s32 ActorShopItemPotion::GetPrice() { - if (func_ov031_0217cf1c()->mUnk_470 != 2) { + if (ActorItemSellerBase::GetCurrentSeller()->mUnk_470 != 2) { if (mShopItemId == ShopItem_RedPotion) { return 80; } else { @@ -1055,14 +1044,12 @@ ARM s32 ActorShopItemShipPart::GetPrice() { ARM s32 ActorShopItemTreasure::GetPrice() { unk32 unk = mUnk_17c; - return func_ov031_0217bdb8()->mUnk_038[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_038[unk]; } -extern "C" unk32 func_ov031_0217ce6c(); ARM unk32 ActorShopItem::vfunc_c0() { s32 price = this->GetPrice(); - func_ov031_0217bdb8(); - unk32 unk = (price * (10 - func_ov031_0217ce6c()) / 10 + 5) / 10 * 10; + unk32 unk = (price * (10 - UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217ce6c()) / 10 + 5) / 10 * 10; if (unk < 10) { unk = 10; } @@ -1073,13 +1060,13 @@ ARM void ActorShopItem::vfunc_c4() { if (mItemId == ItemId_None) { return; } - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { mUnk_175 = true; } } ARM void ActorShopItemHeartContainer::vfunc_c4() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: gAdventureFlags->Set(AdventureFlag_Unk_103, true); break; @@ -1130,7 +1117,7 @@ ARM void ActorShopItemShipPart::vfunc_c4() { ShipPart part = this->func_ov031_02180248(); ShipType type = this->func_ov031_02180260(); GiveShipPart(part, type); - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { data_027e0dbc.func_ov003_020f3d74(mUnk_180 + 8); } ActorShopItem::vfunc_c4(); @@ -1140,14 +1127,14 @@ extern "C" void func_ov009_0211cac0(u32); ARM void ActorShopItemTreasure::vfunc_c4() { unk32 unk = this->func_ov031_02180278(); func_ov009_0211cac0(unk); - if (func_ov031_0217bdb8()->func_ov031_0217bd80()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217bd80()) { data_027e0dbc.func_ov003_020f3d74(mUnk_17c + 5); } ActorShopItem::vfunc_c4(); } ARM void ActorShopItemGem::vfunc_c4() { - switch (func_ov031_0217cf1c()->mUnk_470) { + switch (ActorItemSellerBase::GetCurrentSeller()->mUnk_470) { case 2: gAdventureFlags->Set(AdventureFlag_Unk_105, true); break; @@ -1240,17 +1227,17 @@ ARM bool ActorShopItemBY::vfunc_b8() { ARM unk32 ActorShopItemShipPart::func_ov031_02180248() { s32 unk = mUnk_180; - return func_ov031_0217bdb8()->mUnk_01c[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_01c[unk]; } ARM unk32 ActorShopItemShipPart::func_ov031_02180260() { s32 unk = mUnk_180; - return func_ov031_0217bdb8()->mUnk_024[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_024[unk]; } ARM unk32 ActorShopItemTreasure::func_ov031_02180278() { s32 unk = mUnk_17c; - return func_ov031_0217bdb8()->mUnk_02c[unk]; + return UnkStruct_ov031_02183e80::GetInstance()->mUnk_02c[unk]; } ARM bool ActorShopItemDM::vfunc_d0() { @@ -1318,7 +1305,7 @@ ARM bool ActorShopItemPotion::vfunc_d0() { } void ActorShopItemUnk::func_ov031_02180418() { - if (func_ov031_0217bdb8()->func_ov031_0217cec0()) { + if (UnkStruct_ov031_02183e80::GetInstance()->func_ov031_0217cec0()) { return; } mUnk_164 = true; |
