summaryrefslogtreecommitdiff
path: root/src/d/d_save/d_save.cpp
diff options
context:
space:
mode:
authorunknown <pheenoh@gmail.com>2020-11-23 00:31:50 -0500
committerunknown <pheenoh@gmail.com>2020-11-23 00:31:50 -0500
commit8b358fdf8dc692d155edfa66b0c98a83a57ba28a (patch)
tree168f47e98e6cbb4a2cad61c491f86c9e23730971 /src/d/d_save/d_save.cpp
parente956a55a26ca13adee1c45cbd68943ceb1a4d841 (diff)
dSv_player_item_max_c::init ok dSv_player_item_max_c::setBombNum ok
Diffstat (limited to 'src/d/d_save/d_save.cpp')
-rw-r--r--src/d/d_save/d_save.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/d/d_save/d_save.cpp b/src/d/d_save/d_save.cpp
index ede793cbc2..8f1a2693ab 100644
--- a/src/d/d_save/d_save.cpp
+++ b/src/d/d_save/d_save.cpp
@@ -607,3 +607,66 @@ asm u8 dSv_player_item_record_c::addBottleNum(u8 param_1, short param_2) {
u8 dSv_player_item_record_c::getBottleNum(u8 bottle_index) const {
return bottles[bottle_index];
}
+
+void dSv_player_item_max_c::init(void) {
+
+ for (int i = 0; i < 7; i++) {
+ this->unk0[i] = 30;
+ }
+ setBombNum(REGULAR_BOMBS,30);
+ setBombNum(WATER_BOMBS,15);
+ setBombNum(BOMBLINGS,10);
+ this->unk0[7] = 0;
+}
+
+void dSv_player_item_max_c::setBombNum(u8 bomb_id,u8 bomb_max) {
+ switch (bomb_id) {
+ case REGULAR_BOMBS: this->unk0[1] = bomb_max; return;
+ case WATER_BOMBS: this->unk0[2] = bomb_max; return;
+ case BOMBLINGS: this->unk0[6] = bomb_max; return;
+ }
+}
+
+// this is close, the isFirstBit keeps screwing everything up :(
+// u8 dSv_player_item_max_c::getBombNum(u8 param_1) const {
+// u8 uVar2;
+// u8 iVar3;
+
+// iVar3 = 0x1;
+// if (isFirstBit(79)) {
+// iVar3 = 0x2;
+// }
+
+// switch (param_1) {
+// case WATER_BOMBS: return (u8)(this->bomb_bags_ammo_max[0x1] * iVar3); break;
+// case REGULAR_BOMBS: return (u8)(this->bomb_bags_ammo_max[0x1] * iVar3); break;
+// case BOMBLINGS: return (u8)(this->unk_ammo_max[0x2] * iVar3); break;
+// default: uVar2 = 0;
+// }
+// return uVar2;
+// }
+
+asm u8 dSv_player_item_max_c::getBombNum(u8 param_1) const {
+ nofralloc
+ #include "func_800340F8.s"
+}
+
+// This is a match but the linker refuses to find it's reference. Thank u metrowerks
+// void dSv_player_collect_c::init(void) {
+
+// for (int i = 0; i < 8; i++) {
+// this->unk0[i] = 0;
+// }
+
+// this->unk8 = 0;
+// this->crystal = 0;
+// this->mirror = 0;
+// this->unk11 = 0xFF;
+// this->poe_count = 0;
+// }
+
+asm void dSv_player_collect_c::init(void) {
+ nofralloc
+ #include "func_800341AC.s"
+}
+