summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/14_Land/Actor/Character/ActorCharacter.cpp4
-rw-r--r--src/14_Land/Actor/Character/ActorGenericCharacter.cpp2
-rw-r--r--src/31_Shop/Actor/ActorBeedle.cpp14
-rw-r--r--src/31_Shop/Actor/ActorItemSeller.cpp155
4 files changed, 146 insertions, 29 deletions
diff --git a/src/14_Land/Actor/Character/ActorCharacter.cpp b/src/14_Land/Actor/Character/ActorCharacter.cpp
index 1b679778..d3755391 100644
--- a/src/14_Land/Actor/Character/ActorCharacter.cpp
+++ b/src/14_Land/Actor/Character/ActorCharacter.cpp
@@ -102,7 +102,7 @@ ARM void ActorCharacter::func_ov014_02145178() {
func_ov005_021082e4(data_027e0ff8, &mRef, &mPos, &mPrevPos, &unk, mUnk_448, -1);
}
-ARM void ActorCharacter::func_ov014_021451f0(unk32 *param1) {
+ARM void ActorCharacter::func_ov014_021451f0(const unk32 *param1) {
unk32 iVar1 = param1[0];
mHitbox.pos.x = 0;
mHitbox.pos.y = iVar1;
@@ -373,7 +373,7 @@ ARM void ActorCharacter::vfunc_ec(unk32 param1) {
}
}
-ARM void ActorCharacter::vfunc_f0(unk32 param1, unk32 param2) {
+ARM void ActorCharacter::vfunc_f0(bool param1, unk32 param2) {
mUnk_1d8.func_ov014_02145f0c(param1 ? 2 : 0);
}
diff --git a/src/14_Land/Actor/Character/ActorGenericCharacter.cpp b/src/14_Land/Actor/Character/ActorGenericCharacter.cpp
index a378ed48..98498916 100644
--- a/src/14_Land/Actor/Character/ActorGenericCharacter.cpp
+++ b/src/14_Land/Actor/Character/ActorGenericCharacter.cpp
@@ -4,7 +4,7 @@
ActorGenericCharacter::ActorGenericCharacter() {}
bool ActorGenericCharacter::Init() {}
-void ActorGenericCharacter::vfunc_68() {}
+void ActorGenericCharacter::vfunc_68(unk32 param1, UnkStruct_020397f8 *param2) {}
bool ActorGenericCharacter::vfunc_c0() {}
void ActorGenericCharacter::vfunc_c4() {}
void ActorGenericCharacter::func_ov014_02147940() {}
diff --git a/src/31_Shop/Actor/ActorBeedle.cpp b/src/31_Shop/Actor/ActorBeedle.cpp
index 9a31a491..d74dbbbc 100644
--- a/src/31_Shop/Actor/ActorBeedle.cpp
+++ b/src/31_Shop/Actor/ActorBeedle.cpp
@@ -9,23 +9,23 @@ unk32 ActorBeedle::vfunc_d4() {}
static unk32 func_ov031_02180e44(unk32 param1, unk32 param2) {}
-void ActorBeedle::vfunc_f4() {}
-void ActorBeedle::vfunc_f8() {}
-void ActorBeedle::vfunc_fc() {}
-void ActorBeedle::vfunc_100() {}
-void ActorBeedle::vfunc_104() {}
+unk32 ActorBeedle::GetPromptMessage() {}
+unk32 ActorBeedle::GetPurchaseMessage() {}
+unk32 ActorBeedle::GetNotEnoughMoneyMessage() {}
+unk32 ActorBeedle::GetGoodbyeMessage() {}
+unk32 ActorBeedle::GetInventoryFullMessage() {}
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() {}
-void ActorBeedle::vfunc_10c() {}
+void ActorBeedle::vfunc_10c(bool param1) {}
void ActorBeedle::vfunc_110() {}
unk32 ActorBeedle::func_ov031_021812e4(unk32 param1) {}
void ActorBeedle::func_ov031_0218132c(unk32 param1) {}
bool ActorBeedle::vfunc_11c() {}
-void ActorBeedle::vfunc_118() {}
+bool ActorBeedle::vfunc_118() {}
ActorBeedle::~ActorBeedle() {}
diff --git a/src/31_Shop/Actor/ActorItemSeller.cpp b/src/31_Shop/Actor/ActorItemSeller.cpp
index fd1f9a4d..16fc017c 100644
--- a/src/31_Shop/Actor/ActorItemSeller.cpp
+++ b/src/31_Shop/Actor/ActorItemSeller.cpp
@@ -1,21 +1,138 @@
#include "Actor/Character/ActorItemSeller.hpp"
+#include "Actor/ActorType.hpp"
+#include "Actor/ActorTypeId.hpp"
+#include "Item/ItemManager.hpp"
+#include "Message/BMG.hpp"
+#include "Message/MsgProc.hpp"
+#include "Save/AdventureFlags.hpp"
+#include "Unknown/UnkStruct_ov000_020e8b08.hpp"
-ActorItemSeller *ActorItemSeller1::Create() {}
-ActorItemSeller *ActorItemSeller2::Create() {}
-ActorItemSeller *ActorItemSeller3::Create() {}
-
-bool ActorItemSeller::Init() {}
-unk32 ActorItemSeller::vfunc_114(unk32 param1) {}
-void ActorItemSeller::vfunc_f4() {}
-void ActorItemSeller::vfunc_f8() {}
-void ActorItemSeller::vfunc_fc() {}
-void ActorItemSeller::vfunc_100() {}
-void ActorItemSeller::vfunc_104() {}
-void ActorItemSeller::vfunc_118() {}
-
-unk32 ActorItemSeller::vfunc_d4() {}
-
-void ActorItemSeller::vfunc_108() {}
-void ActorItemSeller::vfunc_10c() {}
-void ActorItemSeller::vfunc_110() {}
-ActorItemSeller::~ActorItemSeller() {}
+extern u32 **data_027e0fe0[];
+ARM ActorItemSeller *ActorItemSeller1::Create() {
+ return new(*data_027e0fe0[0], 4) ActorItemSeller();
+}
+
+ARM ActorItemSeller *ActorItemSeller2::Create() {
+ return new(*data_027e0fe0[0], 4) ActorItemSeller();
+}
+
+ARM ActorItemSeller *ActorItemSeller3::Create() {
+ return new(*data_027e0fe0[0], 4) ActorItemSeller();
+}
+
+static const char *sShipTypes[8] = {
+ [7] = "brg", [6] = "fnl", [5] = "pdl", [4] = "dco", [3] = "can", [2] = "hul", [1] = "bow", [0] = "anc"};
+
+ActorType ActorItemSeller1::gType = ActorType(ActorTypeId_ItemSeller1, (ActorCreateFunc) ActorItemSeller1::Create, NULL);
+ActorType ActorItemSeller2::gType = ActorType(ActorTypeId_ItemSeller2, (ActorCreateFunc) ActorItemSeller2::Create, NULL);
+ActorType ActorItemSeller3::gType = ActorType(ActorTypeId_ItemSeller3, (ActorCreateFunc) ActorItemSeller3::Create, NULL);
+
+ARM bool ActorItemSeller::Init() {
+ unk32 unk;
+ switch (mType) {
+ case ActorTypeId_ItemSeller2:
+ unk = 0x3d;
+ break;
+ case ActorTypeId_ItemSeller3:
+ unk = 0x3e;
+ break;
+ case ActorTypeId_ItemSeller1:
+ default:
+ unk = 0x3c;
+ break;
+ }
+ mUnk_1d8.func_ov014_02145a74(unk, 0x3f);
+ static const unk32 sUnk1[] = {0x800, 0x4cd, 0x14cd};
+ static const ActorCharacter_1d8_230 sUnk2[] = {{"choice", 0}, {"bow", 1}};
+ mUnk_1d8.mUnk_230 = sUnk2;
+ this->func_ov014_021451f0(sUnk1);
+ mUnk_470 = 2;
+ return ActorItemSellerBase::Init();
+}
+
+ARM unk32 ActorItemSeller::vfunc_114(unk32 param1) {
+ u16 uVar1;
+ int iVar2;
+ unk32 uVar3;
+
+ uVar1 = mUnk_020.mUnk_00[0];
+ switch (param1) {
+ case 0:
+ return uVar1 == 2 ? 0x4 : 0x2;
+ case 1:
+ return uVar1 == 0 ? 0xa : 0x3;
+ case 2:
+ return uVar1 == 2 ? 0x11 : 0xf;
+ case 3:
+ if (!gAdventureFlags->Get(AdventureFlag_Unk_105)) {
+ return 0xc;
+ }
+ if (!gAdventureFlags->Get(AdventureFlag_Unk_107)) {
+ return 0x7;
+ }
+ if (!gAdventureFlags->Get(AdventureFlag_Unk_108)) {
+ return 0x8;
+ }
+ if (!gAdventureFlags->Get(AdventureFlag_Unk_103)) {
+ return 0x5;
+ }
+ return uVar1 == 2 ? 0xa : 0x1;
+ case 4:
+ if (gItemManager->HasItem(ItemFlag_WoodenShield)) {
+ return 0x10;
+ }
+ return 0xe;
+ default:
+ return 0x1;
+ }
+}
+
+ARM unk32 ActorItemSeller::GetPromptMessage() {
+ return BMG_ID(BMG_FILE_INDEX_FIELD, 0x41);
+}
+
+ARM unk32 ActorItemSeller::GetPurchaseMessage() {
+ return BMG_ID(BMG_FILE_INDEX_FIELD, 0x50);
+}
+
+ARM unk32 ActorItemSeller::GetNotEnoughMoneyMessage() {
+ return BMG_ID(BMG_FILE_INDEX_FIELD, 0x52);
+}
+
+ARM unk32 ActorItemSeller::GetGoodbyeMessage() {
+ return BMG_ID(BMG_FILE_INDEX_FIELD, 0x51);
+}
+
+ARM unk32 ActorItemSeller::GetInventoryFullMessage() {
+ return BMG_ID(BMG_FILE_INDEX_FIELD, 0x56);
+}
+
+ARM bool ActorItemSeller::vfunc_118() {
+ return data_027e0e28.func_ov018_02160a54(2);
+}
+
+ARM unk32 ActorItemSeller::vfunc_d4() {
+ return ActorItemSellerBase::vfunc_d4();
+}
+
+ARM void ActorItemSeller::vfunc_108() {
+ this->vfunc_ec(3);
+}
+
+ARM void ActorItemSeller::vfunc_10c(bool param1) {
+ if (param1) {
+ mUnk_1d8.func_ov014_02145f0c(4);
+ return;
+ }
+ this->vfunc_ec(4);
+}
+
+ARM void ActorItemSeller::vfunc_110() {
+ bool unk;
+ if (data_ov000_020e8b08 != NULL) {
+ unk = mRef.id == data_ov000_020e8b08->mUnk_20[data_ov000_020e8b08->mUnk_55].id;
+ } else {
+ unk = true;
+ }
+ this->vfunc_f0(unk, 0);
+}