new item code

This commit is contained in:
MelonSpeedruns
2026-04-24 16:01:15 -04:00
parent 5fab665f21
commit c42d10a74b
10 changed files with 46 additions and 19 deletions
+1
View File
@@ -2383,6 +2383,7 @@ public:
void setGroundFishingRodActor();
int procFishingCastInit();
int procFishingCast();
void procLensOfTruthOn();
int procFishingFoodInit();
int procFishingFood();
f32 getCrawlMoveAnmSpeed();
+2
View File
@@ -71,6 +71,7 @@ void item_func_WOOD_STICK();
void item_func_BOOMERANG();
void item_func_SPINNER();
void item_func_IRONBALL();
void item_func_LENS_OF_TRUTH();
void item_func_BOW();
void item_func_HOOKSHOT();
void item_func_HVY_BOOTS();
@@ -260,6 +261,7 @@ int item_getcheck_func_WOOD_STICK();
int item_getcheck_func_BOOMERANG();
int item_getcheck_func_SPINNER();
int item_getcheck_func_IRONBALL();
int item_getcheck_func_LENS_OF_TRUTH();
int item_getcheck_func_BOW();
int item_getcheck_func_HOOKSHOT();
int item_getcheck_func_HVY_BOOTS();
+1 -1
View File
@@ -317,7 +317,7 @@ enum {
/* 0xDE */ dItemNo_NOENTRY_222_e,
/* 0xDF */ dItemNo_NOENTRY_223_e,
/* 0xE0 */ dItemNo_POU_SPIRIT_e,
/* 0xE1 */ dItemNo_NOENTRY_225_e,
/* 0xE1 */ dItemNo_LENS_OF_TRUTH_e,
/* 0xE2 */ dItemNo_NOENTRY_226_e,
/* 0xE3 */ dItemNo_NOENTRY_227_e,
/* 0xE4 */ dItemNo_NOENTRY_228_e,
+2 -2
View File
@@ -86,8 +86,8 @@ public:
/* 0x047 */ u8 field_0x47;
/* 0x048 */ u8 mPoes;
/* 0x049 */ u8 mPoesCopy;
/* 0x04A */ u8 mItems[24];
/* 0x062 */ u8 mItemsCopy[24];
/* 0x04A */ u8 mItems[25];
/* 0x062 */ u8 mItemsCopy[25];
/* 0x07A */ u8 field_0x7a[24];
/* 0x092 */ u8 mSwords[4];
/* 0x096 */ u8 mShields[3];
+5 -4
View File
@@ -15,7 +15,7 @@ static const int MAX_SELECT_ITEM = 4;
static const int SELECT_ITEM_NUM = 2;
static const int MAX_EQUIPMENT = 6;
static const int MAX_EVENTS = 256;
static const int MAX_ITEM_SLOTS = 24;
static const int MAX_ITEM_SLOTS = 25;
static const int LIGHT_DROP_STAGE = 4;
static const int LETTER_INFO_BIT = 64;
static const int MAX_INSECT_NUM = 24;
@@ -75,7 +75,8 @@ enum ItemSlots {
/* 0x14 */ SLOT_20,
/* 0x15 */ SLOT_21,
/* 0x16 */ SLOT_22,
/* 0x17 */ SLOT_23
/* 0x17 */ SLOT_23,
/* 0x18 */ SLOT_24,
};
enum CollectItem {
@@ -349,8 +350,8 @@ public:
static const int BOMB_BAG_MAX = 3;
static const int BOTTLE_MAX = 4;
/* 0x00 */ u8 mItems[24];
/* 0x18 */ u8 mItemSlots[24];
/* 0x00 */ u8 mItems[25];
/* 0x18 */ u8 mItemSlots[25];
}; // Size: 0x30
class dSv_player_get_item_c {
+14
View File
@@ -14480,8 +14480,17 @@ enum daAlink_ItemProc {
/* 13 */ ITEM_PROC_BOTTLE_SWING,
/* 14 */ ITEM_PROC_NOT_USE_ITEM,
/* 15 */ ITEM_PROC_GRASS_WHISTLE,
/* 16 */ ITEM_PROC_LENS_OF_TRUTH,
};
void daAlink_c::procLensOfTruthOn() {
if (!checkWolfEyeUp()) {
onWolfEyeUp();
} else {
offWolfEyeUp();
}
}
int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
u32 sel_item = dComIfGp_getSelectItem(i_selItemIdx);
mSelectItemId = i_selItemIdx;
@@ -14504,6 +14513,9 @@ int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
} else {
procKandelaarPourInit();
}
}
else if (i_procType == ITEM_PROC_LENS_OF_TRUTH) {
procLensOfTruthOn();
} else if (i_procType == ITEM_PROC_FISHING_FOOD) {
procFishingFoodInit();
} else if (i_procType == ITEM_PROC_BOOTS_EQUIP) {
@@ -14572,6 +14584,8 @@ int daAlink_c::checkNewItemChange(u8 i_selItemIdx) {
)
{
return ITEM_PROC_NONE;
} else if (sel_item == dItemNo_LENS_OF_TRUTH_e) {
return ITEM_PROC_LENS_OF_TRUTH;
} else if (sel_item == dItemNo_HVY_BOOTS_e
|| checkDungeonWarpItem(sel_item)
|| checkTradeItem(sel_item)
+1 -1
View File
@@ -2182,7 +2182,7 @@ void daAlink_c::setGetSubBgm(int i_itemNo) {
/* dItemNo_NOENTRY_222_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_223_e */ SETYPE_NONE,
/* dItemNo_POU_SPIRIT_e */ SETYPE_ITEM_GET_POU,
/* dItemNo_NOENTRY_225_e */ SETYPE_NONE,
/* dItemNo_LENS_OF_TRUTH_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_226_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_227_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_228_e */ SETYPE_NONE,
+10 -2
View File
@@ -236,7 +236,7 @@ static void (*item_func_ptr[256])() = {
item_func_noentry,
item_func_noentry,
item_func_POU_SPIRIT,
item_func_noentry,
item_func_LENS_OF_TRUTH,
item_func_noentry,
item_func_noentry,
item_func_noentry,
@@ -504,7 +504,7 @@ static int (*item_getcheck_func_ptr[256])() = {
item_getcheck_func_noentry,
item_getcheck_func_noentry,
item_getcheck_func_POU_SPIRIT,
item_getcheck_func_noentry,
item_getcheck_func_LENS_OF_TRUTH,
item_getcheck_func_noentry,
item_getcheck_func_noentry,
item_getcheck_func_noentry,
@@ -791,6 +791,10 @@ void item_func_IRONBALL() {
dComIfGs_setItem(SLOT_6, dItemNo_IRONBALL_e);
}
void item_func_LENS_OF_TRUTH() {
dComIfGs_setItem(SLOT_24, dItemNo_LENS_OF_TRUTH_e);
}
void item_func_BOW() {
dComIfGs_setItem(SLOT_4, dItemNo_BOW_e);
dComIfGs_setArrowNum(30);
@@ -1453,6 +1457,10 @@ int item_getcheck_func_IRONBALL() {
return dComIfGs_getItem(SLOT_6, true) == dItemNo_IRONBALL_e ? TRUE : FALSE;
}
int item_getcheck_func_LENS_OF_TRUTH() {
return dComIfGs_getItem(SLOT_24, true) == dItemNo_LENS_OF_TRUTH_e ? TRUE : FALSE;
}
int item_getcheck_func_BOW() {
return dComIfGs_getItem(SLOT_4, false) == dItemNo_BOW_e ? TRUE : FALSE;
}
+4 -4
View File
@@ -422,20 +422,20 @@ u8 dSv_player_item_c::getItem(int i_slotNo, bool i_checkCombo) const {
}
void dSv_player_item_c::setLineUpItem() {
static u8 i_item_lst[23] = {
static u8 i_item_lst[24] = {
10, 8, 6, 2, 9, 4, 3,
0, 1, 23, 20, 5, 15, 16,
17, 11, 12, 13, 14, 19, 18,
22, 21
22, 21, 24
};
int slot_idx = 0;
for (int i = 0; i < 24; i++) {
for (int i = 0; i < 25; i++) {
mItemSlots[i] = dItemNo_NONE_e;
}
for (int i = 0; i < 23; i++) {
for (int i = 0; i < 24; i++) {
u8 current = i_item_lst[i];
if (mItems[current] != dItemNo_NONE_e) {
mItemSlots[slot_idx] = current;
+6 -5
View File
@@ -251,7 +251,7 @@ namespace dusk {
{ dItemNo_NOENTRY_222_e, {"Reserved"} },
{ dItemNo_NOENTRY_223_e, {"Reserved"} },
{ dItemNo_POU_SPIRIT_e, {"Poe Soul"} },
{ dItemNo_NOENTRY_225_e, {"Reserved"} },
{ dItemNo_LENS_OF_TRUTH_e, {"Lens of Truth", ITEMTYPE_EQUIP_e} },
{ dItemNo_NOENTRY_226_e, {"Reserved"} },
{ dItemNo_NOENTRY_227_e, {"Reserved"} },
{ dItemNo_NOENTRY_228_e, {"Reserved"} },
@@ -408,6 +408,7 @@ namespace dusk {
{ SLOT_21, dItemNo_HORSE_FLUTE_e },
{ SLOT_22, dItemNo_ANCIENT_DOCUMENT_e },
{ SLOT_23, dItemNo_PACHINKO_e },
{ SLOT_24, dItemNo_LENS_OF_TRUTH_e},
};
ImGuiSaveEditor::ImGuiSaveEditor() {}
@@ -533,7 +534,7 @@ namespace dusk {
selectItemData = 0xFF;
}
for (int i = 0; i < 24; i++) {
for (int i = 0; i < 25; i++) {
u8 itemNo = item.mItems[i];
if (ImGui::Selectable(fmt::format("Slot {0} ({1})", i, itemMap.find(itemNo)->second.m_name).c_str())) {
selectItemData = i;
@@ -820,19 +821,19 @@ namespace dusk {
if (ImGui::TreeNode("Item Wheel")) {
if (ImGui::Button("Default All##inv_default_all")) {
for (int slot = 0; slot < 24; slot++) {
for (int slot = 0; slot < 25; slot++) {
dComIfGs_setItem(slot, getSlotDefault(slot));
}
}
ImGui::SameLine();
if (ImGui::Button("Clear All##inv_clear_all")) {
for (int slot = 0; slot < 24; slot++) {
for (int slot = 0; slot < 25; slot++) {
dComIfGs_setItem(slot, dItemNo_NONE_e);
}
}
ImGuiBeginGroupPanel("Items", { 200, 100 });
for (int slot = 0; slot < 24; slot++) {
for (int slot = 0; slot < 25; slot++) {
ImGui::Text("Slot %02d (%s): ", slot, itemMap.find(getSlotDefault(slot))->second.m_name.c_str());
ImGui::SameLine(240.0f);
if (ImGui::BeginCombo(fmt::format("##ItemComboBox{}", slot).c_str(), itemMap.find(item.mItems[slot])->second.m_name.c_str())) {