summaryrefslogtreecommitdiff
path: root/soh/include/z64item.h
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2024-08-01 21:24:24 -0700
committerGitHub <noreply@github.com>2024-08-01 21:24:24 -0700
commitaeb85c81aa824e2b88b519f465dd9e1988691cf3 (patch)
tree2c072a04d612a49eca2264d8e66262f24ceaca45 /soh/include/z64item.h
parentcab0871fe7b97dd27563be95fb315c00a7fdb11d (diff)
Item SaveContext Logic (#4237)
* Port initial framework up to latest dev-rando. Includes about 15 items using the SCL structure for tracking. * Most other item variables ported to SaveContext in UpdateHelpers. * Removed individual Context retrievals in favor of single local variable in Logic to reference. * start of some diagnostics. caught some reverse logic with ApplyItemEffect. * more diagnostics * Resolve major logic issue with SetInventory flow in ApplyItemEffect. Other small logic issues in ApplyItemEffect. * Added a bit of logging. Add Double Defense to item effects. * revert hint gen bypass * item_list *actually* divorced from logicVar pointers. Several missed options for ApplyItemEffect, HasItem, and UpdateHelpers added in. Changed HasItem to a switch block for more performance. Seeds generate within 10-20 seconds in release mode. Further optimization is assumed possible. * Some formatting * Bit more formatting. * Couple review changes. * Incorporate progressive upgrades and skeleton key into SCL. Bit of cleanup. * Change `inLogic` to static array. * Fix bug in `BottleCount()` preventing Jabu Jabu from ever being in logic. * Fix bomb bag HasItem check. * Fix Gerudo Fortress and Ganon's Castle SmallKeys checks. * Change all logic use of `bool remove` to be `bool state` and work on the affirmative assumption. * Forgot the `Set(x)` uses in `Logic::Reset()`. * Fix fishing pole effect application. * fishing pole tweak * Add `RG_BOMB_BAG`, `RG_NUTS` and `RG_STICKS` to `HasItem()`. Fix silver and gold gauntlet checks in `HasItem()`. Change Nuts and Sticks helpers to use non-progressive RGs in `UpdateHelpers()`. * Change mSaveContext to simple pointer. Set `mSaveContext` to `&gSaveContext` when loading a save file. Modify `Item::GetGIEntry()` to use rando context's SaveContext pointer instead of the gSaveContext macros. Utilize `Item::GetGIEntry()` to get real RG of infinite upgrades and set rando infs accordingly, skipping upgrade level incrementing (which was causing overflow of wallets for some reason). * Rename all remaining references of LogicVar to variants of LogicVal. * Change final references to song LogicVars to CanUse calls, and remove them. * Separate equip and rand inf flag maps. Add Zelda's Letter and Weird Egg rand infs to map. Consolidate `HasItem` rand inf lookups using rand inf map and equips using equip flag map. Maps are static, so can be referenced with `Context::` instead of ctx pointer.
Diffstat (limited to 'soh/include/z64item.h')
-rw-r--r--soh/include/z64item.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/soh/include/z64item.h b/soh/include/z64item.h
index 92ce499ba..ceba11d09 100644
--- a/soh/include/z64item.h
+++ b/soh/include/z64item.h
@@ -311,6 +311,21 @@ typedef enum {
/* 0xFF */ ITEM_NONE = 0xFF
} ItemID;
+typedef enum {
+ EQUIP_FLAG_SWORD_KOKIRI = 1 << 0,
+ EQUIP_FLAG_SWORD_MASTER = 1 << 1,
+ EQUIP_FLAG_SWORD_BGS = 1 << 2,
+ EQUIP_FLAG_SHIELD_DEKU = 1 << 4,
+ EQUIP_FLAG_SHIELD_HYLIAN = 1 << 5,
+ EQUIP_FLAG_SHIELD_MIRROR = 1 << 6,
+ EQUIP_FLAG_TUNIC_KOKIRI = 1 << 8,
+ EQUIP_FLAG_TUNIC_GORON = 1 << 9,
+ EQUIP_FLAG_TUNIC_ZORA = 1 << 10,
+ EQUIP_FLAG_BOOTS_KOKIRI = 1 << 12,
+ EQUIP_FLAG_BOOTS_IRON = 1 << 13,
+ EQUIP_FLAG_BOOTS_HOVER = 1 << 14,
+} EquipmentFlag;
+
#define ITEM_TRADE_CHILD ITEM_WEIRD_EGG
#define ITEM_TRADE_ADULT ITEM_POCKET_EGG