mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-07 02:10:14 -04:00
ItemService improvements (#2322)
* ItemService improvements * Move Poe increment to item
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* ItemService check names.
|
||||
*/
|
||||
|
||||
#define ITEM_CHECK_BOSS_PREFIX "boss:" /* <stage> */
|
||||
#define ITEM_CHECK_BUG_PREFIX "bug:" /* <insect_item> */
|
||||
#define ITEM_CHECK_CHEST_PREFIX "chest:" /* <stage>:<box> */
|
||||
#define ITEM_CHECK_FREESTANDING_PREFIX "freestanding:" /* <stage>:<bit> */
|
||||
#define ITEM_CHECK_POE_PREFIX "poe:" /* <stage>:<switch> */
|
||||
#define ITEM_CHECK_SHOP_PREFIX "shop:" /* <stage>:<item> */
|
||||
#define ITEM_CHECK_SKY_PREFIX "sky:" /* <stage>:<room> */
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_PREFIX "dungeon_reward:" /* <stage> */
|
||||
|
||||
#define ITEM_CHECK_ARCHERY_REWARD "archery_reward:F_SP109"
|
||||
#define ITEM_CHECK_ASHEI_SKETCH "ashei_sketch"
|
||||
#define ITEM_CHECK_AURU_MEMO "auru_memo"
|
||||
#define ITEM_CHECK_BALL_AND_CHAIN "ball_and_chain:D_MN11"
|
||||
#define ITEM_CHECK_BULBLIN_KEY "bulblin_key:D_MN09"
|
||||
#define ITEM_CHECK_CORAL_EARRING "coral_earring"
|
||||
#define ITEM_CHECK_CORO_BOTTLE "coro_bottle"
|
||||
#define ITEM_CHECK_DUNGEON_MAP_SNOWPEAK "dungeon_map:D_MN11"
|
||||
#define ITEM_CHECK_FAIRY_REWARD "fairy_reward:D_SB01"
|
||||
#define ITEM_CHECK_FISHING_BOTTLE "fishing_bottle"
|
||||
#define ITEM_CHECK_FISHING_HEART_PIECE "fishing_heart_piece"
|
||||
#define ITEM_CHECK_GOATS_REWARD "goats_reward"
|
||||
#define ITEM_CHECK_GORON_REWARD "goron_reward:F_SP113"
|
||||
#define ITEM_CHECK_ILIA_CHARM "ilia_charm"
|
||||
#define ITEM_CHECK_ILIA_MEMORY "ilia_memory"
|
||||
#define ITEM_CHECK_IZA_REWARD_1 "iza_reward_1"
|
||||
#define ITEM_CHECK_IZA_REWARD_2 "iza_reward_2"
|
||||
#define ITEM_CHECK_JOVANI_REWARD_1 "jovani_reward_1"
|
||||
#define ITEM_CHECK_JOVANI_REWARD_2 "jovani_reward_2"
|
||||
#define ITEM_CHECK_KEY_SHARD_1 "key_shard_1:D_MN04"
|
||||
#define ITEM_CHECK_KEY_SHARD_2 "key_shard_2:D_MN04"
|
||||
#define ITEM_CHECK_KEY_SHARD_3 "key_shard_3:D_MN04"
|
||||
#define ITEM_CHECK_ORDON_SHIELD "ordon_shield"
|
||||
#define ITEM_CHECK_ORDON_SWORD "ordon_sword"
|
||||
#define ITEM_CHECK_PLUMM_REWARD "plumm_minigame_reward"
|
||||
#define ITEM_CHECK_PRAYER_REWARD "prayer_reward"
|
||||
#define ITEM_CHECK_RENADO_LETTER "renado_letter"
|
||||
#define ITEM_CHECK_SERA_REWARD "sera_reward"
|
||||
#define ITEM_CHECK_SKYBOOK "skybook"
|
||||
#define ITEM_CHECK_SNOWBOARD_REWARD "snowboard_race_reward"
|
||||
#define ITEM_CHECK_STAR_REWARD_1 "star_reward_1"
|
||||
#define ITEM_CHECK_STAR_REWARD_2 "star_reward_2"
|
||||
#define ITEM_CHECK_TELMA_INVOICE "telma_invoice"
|
||||
#define ITEM_CHECK_ULI_CRADLE_REWARD "uli_cradle_reward"
|
||||
#define ITEM_CHECK_WOOD_STATUE "wood_statue"
|
||||
#define ITEM_CHECK_ZORA_ARMOR "zora_armor"
|
||||
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_FOREST "dungeon_reward:D_MN05"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_GORON "dungeon_reward:D_MN04"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_LAKEBED "dungeon_reward:D_MN01"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_ARBITERS "dungeon_reward:D_MN10"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_SNOWPEAK "dungeon_reward:D_MN11"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_TIME "dungeon_reward:D_MN06"
|
||||
#define ITEM_CHECK_DUNGEON_REWARD_CITY "dungeon_reward:D_MN07"
|
||||
|
||||
#define ITEM_CHECK_MASTER_SWORD "master_sword"
|
||||
#define ITEM_CHECK_SHADOW_CRYSTAL "shadow_crystal"
|
||||
@@ -17,10 +17,12 @@ typedef uint64_t ItemGiveHandle;
|
||||
/*
|
||||
* Item check resolution and inventory grants.
|
||||
*
|
||||
* Check names are case-sensitive. Resolvers must be free of side effects because the game may
|
||||
* resolve a check more than once, including once for display and again when granting the item.
|
||||
* Registrations and pending grants are removed when the calling mod is detached. Callbacks run
|
||||
* on the game thread.
|
||||
* Check names are case-sensitive. Resolvers must be free of side effects because previews may be
|
||||
* resolved repeatedly. For checks representing a non-item side effect, vanilla_item is 0xFF:
|
||||
* resolving to 0xFF preserves that side effect, while resolving to another item replaces it.
|
||||
*
|
||||
* Registrations and pending grants are removed when the calling mod is detached. Callbacks run on
|
||||
* the game thread. Check names are listed in <mods/items.h>.
|
||||
*/
|
||||
|
||||
/* Host-owned callback data, valid only for the duration of the callback. */
|
||||
@@ -72,14 +74,14 @@ typedef struct ItemService {
|
||||
|
||||
ModResult (*clear_check_resolver)(ModContext* ctx, ItemCheckHandle handle);
|
||||
|
||||
/* Resolve without granting an item or notifying give observers. */
|
||||
/* Resolve a live preview without granting an item or notifying give observers. */
|
||||
ModResult (*resolve_check)(
|
||||
ModContext* ctx, const char* name, uint8_t vanilla_item, uint8_t* out_item);
|
||||
|
||||
/*
|
||||
* Add a grant to the global FIFO. check_name may be NULL unless ITEM_GIVE_RESOLVE is set.
|
||||
* Returns MOD_UNAVAILABLE when the queue is full. Entries wait until gameplay is in a safe
|
||||
* state and are cleared when the active save slot changes.
|
||||
* Entries wait until gameplay is in a safe state and are cleared when the active save slot
|
||||
* changes.
|
||||
*/
|
||||
ModResult (*give_item)(
|
||||
ModContext* ctx, const char* check_name, uint8_t item_no, uint32_t flags);
|
||||
|
||||
Reference in New Issue
Block a user