summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/d/a/d_a_salbage_obj.h8
-rw-r--r--include/d/a/obj/d_a_obj_base.h4
-rw-r--r--include/d/flag/storyflag_map.h30
-rw-r--r--include/toBeSorted/salvage_mgr.h42
4 files changed, 66 insertions, 18 deletions
diff --git a/include/d/a/d_a_salbage_obj.h b/include/d/a/d_a_salbage_obj.h
index 742224bd..70b1d082 100644
--- a/include/d/a/d_a_salbage_obj.h
+++ b/include/d/a/d_a_salbage_obj.h
@@ -17,11 +17,17 @@
class dAcSalbageObj_c;
enum SalvageObj_e {
+ SALVAGE_OBJ_NONE = -1,
+
SALVAGE_OBJ_PROPERA = 0,
SALVAGE_OBJ_ROULETTE = 1,
SALVAGE_OBJ_DIVINER_CRYSTAL = 2,
+ SALVAGE_OBJ_SALVAGE_MORRY = 3,
+ SALVAGE_OBJ_MOLE_ELDER = 4,
SALVAGE_OBJ_WATER_JAR = 5,
SALVAGE_OBJ_POT = 6,
+
+ SALVAGE_OBJ_MAX = 7,
};
class dSalvageIfObj_c : public dSalvageIf_c {
@@ -176,7 +182,7 @@ protected:
/* 0x908 */ mMtx_c mWorldSRMtx;
/* 0x938 */ f32 field_0x938;
/* 0x93C */ DowsingTarget mDowsingTarget;
- /* 0x95C */ mVec3_c field_0x95C;
+ /* 0x95C */ mVec3_c mDowsingOffset;
/* 0x968 */ bool mIsDowsingRegistered;
/* 0x96C */ const sStateID_c *mpNextStateId;
};
diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h
index fab81e6d..ccd41832 100644
--- a/include/d/a/obj/d_a_obj_base.h
+++ b/include/d/a/obj/d_a_obj_base.h
@@ -167,6 +167,10 @@ public:
mLinkage.field_0xA0 = pCol;
}
+ dSalvageIf_c *getSalvageIf() const {
+ return mpSalvageIf;
+ }
+
// could be their own thing?
static void *getOarcFile(const char *oarcName, const char *fileName);
static void *getOarcSubEntry(const char *oarcName, const char *fileName);
diff --git a/include/d/flag/storyflag_map.h b/include/d/flag/storyflag_map.h
index a8c617a8..785184a9 100644
--- a/include/d/flag/storyflag_map.h
+++ b/include/d/flag/storyflag_map.h
@@ -1640,12 +1640,12 @@ enum StoryFlags_e {
/** [Windmill Propeller picked up]
* Story Flag #324 (0x0144) - JP 805ACD7F 0x04 / US 805A9AFF 0x04
*/
- STORYFLAG_324,
+ STORYFLAG_PROPERA_PICKUP,
/** [Village Windmill reparation cutscene]
* Story Flag #325 (0x0145) - JP 805ACD7F 0x08 / US 805A9AFF 0x08
*/
- STORYFLAG_325,
+ STORYFLAG_WINDMILL_REPAIRED,
/** [Wyrna's 5 gratitude crystals collected (not the crystals themselves)]
* Story Flag #326 (0x0146) - JP 805ACD7F 0x10 / US 805A9AFF 0x10
@@ -1842,12 +1842,12 @@ enum StoryFlags_e {
/** [Spiral Charge Ability]
* Story Flag #364 (0x016C) - JP 805ACD83 0x04 / US 805A9B03 0x04
*/
- STORYFLAG_364,
+ STORYFLAG_SPIRAL_CHARGE_UNLOCKED,
/** [Pumpkin Soup for Levias Collected, unset by picking up something else]
* Story Flag #365 (0x016D) - JP 805ACD83 0x08 / US 805A9B03 0x08
*/
- STORYFLAG_365,
+ STORYFLAG_PUMPKIN_SOUP_PICKUP,
/** [Unset when Scrapper has a job, set when he has finished it]
* Story Flag #366 (0x016E) - JP 805ACD83 0x10 / US 805A9B03 0x10
@@ -1877,17 +1877,17 @@ enum StoryFlags_e {
/** [Accepting the Fortune Teller Crystal Sidequest]
* Story Flag #371 (0x0173) - JP 805ACD82 0x02 / US 805A9B02 0x02
*/
- STORYFLAG_371,
+ STORYFLAG_CRYSTAL_QUEST_STARTED,
/** [Sets after Sprapper picked the Crystal Ball up]
* Story Flag #372 (0x0174) - JP 805ACD82 0x04 / US 805A9B02 0x04
*/
- STORYFLAG_372,
+ STORYFLAG_CRYSTAL_PICKUP,
/** [Sets before the Fortune Teller gives his Crystals]
* Story Flag #373 (0x0175) - JP 805ACD82 0x08 / US 805A9B02 0x08
*/
- STORYFLAG_373,
+ STORYFLAG_CRYSTAL_DELIVERED,
/** [Sets when talking to the Fortune Teller in the Bazzar after 8x08 (Fortunes only cost half)]
* Story Flag #374 (0x0176) - JP 805ACD82 0x10 / US 805A9B02 0x10
@@ -2002,17 +2002,17 @@ enum StoryFlags_e {
/** [Search for Party Wheel Crystal Quest started]
* Story Flag #396 (0x018C) - JP 805ACD8F 0x20 / US 805A9B0F 0x20
*/
- STORYFLAG_396,
+ STORYFLAG_PARTY_WHEEL_QUEST_STARTED,
/** [Set after Scrapper picks up Party Wheel]
* Story Flag #397 (0x018D) - JP 805ACD8F 0x80 / US 805A9B0F 0x80
*/
- STORYFLAG_397,
+ STORYFLAG_PARTY_WHEEL_PICKUP,
/** [Set before Fun Fun Owner gives his Crystals]
* Story Flag #398 (0x018E) - JP 805ACD8E 0x01 / US 805A9B0E 0x01
*/
- STORYFLAG_398,
+ STORYFLAG_PARTY_WHEEL_DELIVERED,
/** [Sets after you get a free try at Diveing game]
* Story Flag #399 (0x018F) - JP 805ACD91 0x80 / US 805A9B11 0x80
@@ -2357,7 +2357,7 @@ enum StoryFlags_e {
/** [Goron Text near Big Frog]
* Story Flag #467 (0x01D3) - JP 805ACD8F 0x10 / US 805A9B0F 0x10
*/
- STORYFLAG_467,
+ STORYFLAG_WATER_BASIN_QUEST_STARTED,
/** [Goron Text after Watering 1st Frog]
* Story Flag #468 (0x01D4) - JP 805ACD8F 0x40 / US 805A9B0F 0x40
@@ -2372,17 +2372,17 @@ enum StoryFlags_e {
/** [Kina's Crystal Quest started]
* Story Flag #470 (0x01D6) - JP 805ACD8E 0x04 / US 805A9B0E 0x04
*/
- STORYFLAG_470,
+ STORYFLAG_MOLE_ELDER_QUEST_STARTED,
/** [Guld picked up (unsets after)]
* Story Flag #471 (0x01D7) - JP 805ACD8E 0x08 / US 805A9B0E 0x08
*/
- STORYFLAG_471,
+ STORYFLAG_MOLE_ELDER_PICKUP,
/** [Kina's Crystal Quest related]
* Story Flag #472 (0x01D8) - JP 805ACD8E 0x10 / US 805A9B0E 0x10
*/
- STORYFLAG_472,
+ STORYFLAG_MOLE_ELDER_DELIVERED,
/** [Kina's Crystal Quest related]
* Story Flag #473 (0x01D9) - JP 805ACD8E 0x20 / US 805A9B0E 0x20
@@ -2417,7 +2417,7 @@ enum StoryFlags_e {
/** [Owlans Crystal Sidequest started]
* Story Flag #479 (0x01DF) - JP 805ACD91 0x08 / US 805A9B11 0x08
*/
- STORYFLAG_479,
+ STORYFLAG_PLANT_SPECIES_QUEST_STARTED,
/** []
* Story Flag #480 (0x01E0) - JP 805ACD91 0x10 / US 805A9B11 0x10
diff --git a/include/toBeSorted/salvage_mgr.h b/include/toBeSorted/salvage_mgr.h
index 3e268936..a30633ff 100644
--- a/include/toBeSorted/salvage_mgr.h
+++ b/include/toBeSorted/salvage_mgr.h
@@ -3,6 +3,8 @@
#include "common.h"
#include "d/a/d_a_base.h"
+#include "d/a/d_a_salbage_obj.h"
+#include "d/a/npc/d_a_npc_salbage_robot.h"
#include "m/m_mtx.h"
class dAcSalbageObj_c;
@@ -15,8 +17,11 @@ public:
// return sInstance;
// }
- bool checkDeliveredStoryflag(const s32& id) const;
- bool startedQuestForSalvageObj(const dAcSalbageObj_c *obj) const;
+ // TODO a fun theory is that all those `const s32 &`s are just `const SalvageObj_e &`s.
+
+ bool checkDeliveredStoryflag(const s32 &id) const;
+ bool checkPickupStoryflag(const s32 &id) const;
+ bool hasStartedQuestForSalvageObj(const dAcSalbageObj_c *obj) const;
bool hasDowsingForSalvageObj(const dAcSalbageObj_c *obj) const;
mMtx_c getCarryRotMtx(const s32 &id) const;
mMtx_c getCarryRotMtx2(const s32 &id) const {
@@ -26,13 +31,46 @@ public:
void deleteObjAndSlb();
static dSalvageMgr_c *sInstance;
+ static void create();
+ static void remove();
+
+ void init();
+ void execute();
+
+ void setPickupIndex(const s32 &id);
+ void unsetPickupStoryflag(const s32 &id);
+ void handlePickupIndex();
+ void setupDeliverToTarget();
+ bool checkIsOnDeliveryStage() const;
+ bool checkIsOnDeliveryStage2() const;
+ u16 getDeliverToActorId(s32 id);
+ dAcObjBase_c *findDeliveryTarget();
+ bool hasStartedQuestForId(const s32 &id) const;
+ bool hasDowsingForId(const s32 &id) const;
+
+ void noop();
+
+ bool triggerDeliveryEvent();
+
+ u16 getTalkEntryPoint1ForPickup(dAcObjBase_c *obj);
+ u16 getTalkEntryPoint2ForPickup(dAcObjBase_c *obj);
+ u16 getTalkEntryPoint3ForPickup(dAcObjBase_c *obj);
bool hasObjAndSlb() const {
return mObjRef.isLinked() && mSlbRef.isLinked();
}
+ bool checkPickupMask(const s32 &id) const {
+ return (mCurrentPickupMaskBit & (1 << id)) != 0;
+ }
+
/* 0x00 */ dAcRef_c<dAcSalbageObj_c> mObjRef;
/* 0x0C */ dAcRef_c<dAcNpcSlb_c> mSlbRef;
+ /* 0x18 */ dAcRef_c<dAcObjBase_c> mDeliverToRef;
+ /* 0x24 */ s32 mCurrentPickupIdx;
+ /* 0x28 */ s32 mCurrentPickupMaskBit;
+ /* 0x2C */ s16 field_0x2C;
+
private:
};