mirror of
https://github.com/zeldaret/ph
synced 2026-09-02 17:53:12 -04:00
Decomp 3 Inventory functions
This commit is contained in:
+51
-3
@@ -1,10 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "lib/math.h"
|
||||
#include "global.h"
|
||||
#include "SysNew.hpp"
|
||||
#include "Item.hpp"
|
||||
#include "Player/EquipItem.hpp"
|
||||
#include "Player/EquipBomb.hpp"
|
||||
#include "Player/EquipBombchu.hpp"
|
||||
#include "Player/EquipBoomerang.hpp"
|
||||
#include "Player/EquipBow.hpp"
|
||||
#include "Player/EquipHammer.hpp"
|
||||
#include "Player/EquipItem.hpp"
|
||||
#include "Player/EquipPotion.hpp"
|
||||
#include "Player/EquipRope.hpp"
|
||||
#include "Player/EquipScoop.hpp"
|
||||
#include "Player/EquipShield.hpp"
|
||||
#include "Player/EquipSword.hpp"
|
||||
#include "Actors/Navi/Navi.hpp"
|
||||
#include "OverlayManager.hpp"
|
||||
|
||||
#define MAX_HOURGLASS_SECONDS 1500 // 25 minutes
|
||||
|
||||
@@ -95,6 +109,26 @@ struct ShipParts {
|
||||
/* 9 */
|
||||
};
|
||||
|
||||
struct UnkStruct_027e0d38 {
|
||||
/* 00 */ unk8 mUnk_00;
|
||||
/* 01 */ unk8 mUnk_01[3]; // padding?
|
||||
/* 04 */ unk32 mUnk_04;
|
||||
/* 08 */ unk32 mUnk_08;
|
||||
/* 0c */ unk32 mUnk_0c;
|
||||
/* 10 */ unk32 mUnk_10;
|
||||
/* 14 */ unk32 mUnk_14;
|
||||
/* 18 */ unk32 mUnk_18;
|
||||
/* 1c */ unk16 mUnk_1c;
|
||||
/* 1e */ unk8 mUnk_1e;
|
||||
/* 1f */ unk8 mUnk_1f;
|
||||
/* 20 */ unk8 mUnk_20;
|
||||
/* 21 */ unk8 mUnk_21;
|
||||
/* 22 */ unk8 mUnk_22[2]; // padding?
|
||||
/* 24 */ void *mUnk_24;
|
||||
/* 28 */ void *mUnk_28;
|
||||
/* 2c */
|
||||
};
|
||||
|
||||
struct SaveInventory {
|
||||
/* 00 */ ItemFlags itemFlags;
|
||||
/* 10 */ u32 salvagedTreasureFlags;
|
||||
@@ -131,9 +165,7 @@ private:
|
||||
/* 008 */ ItemFlag mForcedItem; // game crashes when any item besides this one is equipped
|
||||
/* 00c */ u32 mHourglassSandFrames;
|
||||
/* 010 */ FairyId mEquippedFairy;
|
||||
/* 014 */ Navi *mNaviCourage;
|
||||
/* 018 */ Navi *mNaviPower;
|
||||
/* 01c */ Navi *mNaviWisdom;
|
||||
/* 014 */ Navi *mFairies[FairyId_COUNT];
|
||||
/* 020 */ u16 mEquipLoadTimer;
|
||||
/* 022 */ u16 mNumRupees;
|
||||
/* 024 */ u8 mNumGems[Gem_COUNT];
|
||||
@@ -175,6 +207,22 @@ public:
|
||||
void ClearPrevEquippedItem();
|
||||
void Save(SaveInventory *save);
|
||||
void Load(const SaveInventory *save);
|
||||
|
||||
FairyId GetEquippedFairy() const;
|
||||
Navi* GetFairy(FairyId id) const;
|
||||
|
||||
void TickEquipItem();
|
||||
ItemFlag GetEquippedItem() const; // 020ae390
|
||||
void Sword_vfunc_38(); // 020ad5bc
|
||||
void Shield_vfunc_38(); // 020ad5d8
|
||||
void EquipItem_vfunc_38(unk32 param1, unk32 param2, unk32 param3); // 020ad5f4
|
||||
|
||||
void* GetIslandData(u32 index); // 020ad52c
|
||||
void* GetDungeonData(u32 index); // 020ad588
|
||||
|
||||
void func_020ad538(unk32 param1); // 020ad538
|
||||
void func_020ad560(unk32 param1); // 020ad560
|
||||
void func_020ad594(unk32 param1); // 020ad594
|
||||
|
||||
bool HasItem(ItemFlag item);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
#include "Item.hpp"
|
||||
|
||||
typedef u32 OverlayId;
|
||||
enum OverlayId_ {
|
||||
OverlayId_Core,
|
||||
OverlayId_01,
|
||||
OverlayId_02,
|
||||
OverlayId_03,
|
||||
OverlayId_Memory,
|
||||
OverlayId_05,
|
||||
OverlayId_06,
|
||||
OverlayId_07,
|
||||
OverlayId_08,
|
||||
OverlayId_09,
|
||||
OverlayId_10,
|
||||
OverlayId_11,
|
||||
OverlayId_12,
|
||||
OverlayId_13,
|
||||
OverlayId_14,
|
||||
OverlayId_15,
|
||||
OverlayId_16,
|
||||
OverlayId_17,
|
||||
OverlayId_18,
|
||||
OverlayId_19,
|
||||
OverlayId_20,
|
||||
OverlayId_21,
|
||||
OverlayId_22,
|
||||
OverlayId_23,
|
||||
OverlayId_24,
|
||||
OverlayId_25,
|
||||
OverlayId_26,
|
||||
OverlayId_27,
|
||||
OverlayId_28,
|
||||
OverlayId_29,
|
||||
OverlayId_30,
|
||||
OverlayId_31,
|
||||
OverlayId_32,
|
||||
OverlayId_33,
|
||||
OverlayId_34,
|
||||
OverlayId_35,
|
||||
OverlayId_36,
|
||||
OverlayId_37,
|
||||
OverlayId_38,
|
||||
OverlayId_39,
|
||||
OverlayId_40,
|
||||
OverlayId_41,
|
||||
OverlayId_42,
|
||||
OverlayId_43,
|
||||
OverlayId_44,
|
||||
OverlayId_45,
|
||||
OverlayId_46,
|
||||
OverlayId_47,
|
||||
OverlayId_48,
|
||||
OverlayId_49,
|
||||
OverlayId_50,
|
||||
OverlayId_51,
|
||||
OverlayId_52,
|
||||
OverlayId_PlayerBoomerang,
|
||||
OverlayId_PlayerScoop,
|
||||
OverlayId_PlayerBomb,
|
||||
OverlayId_PlayerBow,
|
||||
OverlayId_PlayerRope,
|
||||
OverlayId_PlayerBombchu,
|
||||
OverlayId_PlayerHammer,
|
||||
OverlayId_60,
|
||||
OverlayId_61,
|
||||
};
|
||||
|
||||
typedef u32 OverlayIndex;
|
||||
enum OverlayIndex_ {
|
||||
OverlayIndex_Core,
|
||||
OverlayIndex_1,
|
||||
OverlayIndex_2,
|
||||
OverlayIndex_3,
|
||||
OverlayIndex_4,
|
||||
OverlayIndex_5,
|
||||
OverlayIndex_6,
|
||||
OverlayIndex_7,
|
||||
OverlayIndex_8,
|
||||
OverlayIndex_9,
|
||||
OverlayIndex_10,
|
||||
OverlayIndex_EquipItem,
|
||||
OverlayIndex_12,
|
||||
OverlayIndex_COUNT,
|
||||
};
|
||||
|
||||
class OverlayManager {
|
||||
OverlayId mLoadedOverlays[OverlayIndex_COUNT];
|
||||
|
||||
public:
|
||||
void Unload(OverlayIndex index);
|
||||
void Load(OverlayIndex index, OverlayId id);
|
||||
void LoadIfNotLoaded(OverlayIndex index, OverlayId id);
|
||||
void LoadEquipItem(ItemFlag equipId);
|
||||
};
|
||||
|
||||
extern OverlayManager gOverlayManager;
|
||||
Reference in New Issue
Block a user