Use (Items & Effects)¶
Handles consuming items and applying their effects from inventory.
Purpose¶
Provide a bridge between inventory storage and gameplay effect execution.
What Lives Here¶
ItemUseSystem→ consumes items and applies effectsIUseEffect→ effect contractUseEffectResolver→ resolves effects from data- Adapters → optional bridges for external effect systems
Important Notes¶
- This system coordinates effect execution and item consumption
- It does not define gameplay effect logic itself
- Final item removal is handled through service-level APIs
Usage Guidance¶
Item use flow¶
Item use typically involves:
- resolving the container and slot
- resolving configured effects
- executing applicable effects
- removing a single item when execution succeeds
Effects¶
Effects implement a shared contract and are resolved before execution.
- effects may be implemented in code or as ScriptableObjects
- execution order follows configured effect lists
Effect resolution¶
Effects are resolved through a central resolver that may:
- use native implementations
- use registered adapters
- skip unsupported effects
Target resolution¶
Targets are determined from configured or default objects and may resolve a compatible component for effect application.
Consumption behaviour¶
- items are consumed only when at least one effect executes successfully
- removal is performed through service-level APIs
- authority rules may apply to final removal
⚠ Ordering caveat (multiplayer). Effects are applied before the authority-checked consume. If the consume is rejected (e.g. by inventory authority), the effects have already run and are not rolled back. Drive item use only from the authoritative instance so a non-authoritative caller cannot apply effects it is not allowed to consume. This is intentional, non-transactional behaviour.
Optional integrations¶
Adapters may allow external systems to participate in item use behaviour.
Not for Production Use¶
A bridge to effects; it neither defines them nor guarantees they run
This folder does not:
- Define gameplay effect logic
- Guarantee execution of all configured effects
- Replace authority or service mutation rules
- Provide networking or replication behaviour