* Dowsing.

* d_t_dowsing

* d_t_holy_water OK
This commit is contained in:
robojumper
2024-09-12 22:23:11 +02:00
committed by GitHub
parent 9aa30ee499
commit e2c4bb7be7
40 changed files with 1041 additions and 160 deletions
+4 -25
View File
@@ -1,26 +1,5 @@
#include <toBeSorted/counters/counter.h>
// TODO use the item flag manager once it exists
class ItemFlagManager {
public:
ItemFlagManager() {}
/** 0x08 */ virtual ~ItemFlagManager();
/** 0x0C */ virtual void setFlagszptr();
/** 0x10 */ virtual void onDirty();
/** 0x14 */ virtual void copyFlagsFromSave() = 0;
/** 0x18 */ virtual void setupUnkFlagsStuff() = 0;
/** 0x1C */ virtual bool doCommit() = 0;
/** 0x20 */ virtual void setFlag(u16 flag);
/** 0x24 */ virtual void unsetFlag(u16 flag);
/** 0x28 */ virtual void setFlagOrCounterToValue(u16 flag, u16 value);
/** 0x2C */ virtual u16 getCounterOrFlag(u16 flag);
/** 0x30 */ virtual u16 getUncommittedValue(u16 flag);
/** 0x34 */ virtual void unk3();
/** 0x38 */ virtual u16 *getSaveFlagSpace() = 0;
};
// TODO set up item flag manager
extern "C" ItemFlagManager *lbl_80575400;
#include <toBeSorted/item_story_flag_manager.h>
/* 8016cc40 */ s32 Counter::checkedAdd(s32 num) {
@@ -43,13 +22,13 @@ extern "C" ItemFlagManager *lbl_80575400;
}
/* 8016cd30 */ u16 Counter::getCommittedValue() {
return lbl_80575400->getCounterOrFlag(counterId | 0x4000);
return ItemFlagManager::sInstance->getCounterOrFlag(counterId | 0x4000);
}
/* 8016cd50 */ u16 Counter::getUncommittedValue() {
return lbl_80575400->getUncommittedValue(counterId | 0x4000);
return ItemFlagManager::sInstance->getUncommittedValue(counterId | 0x4000);
}
/* 8016cd70 */ void Counter::setValue(u16 num) {
lbl_80575400->setFlagOrCounterToValue(counterId | 0x4000, num);
ItemFlagManager::sInstance->setFlagOrCounterToValue(counterId | 0x4000, num);
}
+2 -5
View File
@@ -1,4 +1,5 @@
#include <toBeSorted/counters/counter.h>
#include <toBeSorted/item_story_flag_manager.h>
static u16 getBaseCapacity();
static u16 getExtraWalletCapacity();
@@ -17,10 +18,6 @@ struct WalletStruct {
u16 capacity;
};
// TODO set up item flag manager
extern "C" void *lbl_80575400;
extern "C" u16 fn_800BF5E0(void *data, u16 flag);
/* 8016DE10 */ static u16 getBaseCapacity() {
int i = 0;
/* 804E91B0 */ WalletStruct wallet_definitions[4] = {
@@ -31,7 +28,7 @@ extern "C" u16 fn_800BF5E0(void *data, u16 flag);
};
const WalletStruct *wallet = &wallet_definitions[3];
for (; i < 4; i++, wallet--) {
if (fn_800BF5E0(lbl_80575400, wallet->flag)) {
if (ItemFlagManager::sInstance->getFlag(wallet->flag)) {
return wallet->capacity;
}
}