VendorInteraction ​
Inherits: Interaction < Resource
Vendor interaction that opens the shop interface when activated
Properties ​
int | vendor_definition_id | |
SFXSelection | shop_open_sfx | |
AnimationSelectionSocial | shop_interaction_animation |
Variables ​
VendorInventoryComponent | vendor_inventory_instance | |
bool | shop_is_active | false |
Player | current_customer |
Methods ​
void | initialize_vendor() |
bool | can_interact( player: Player ) |
void | start_interaction( player: Player ) |
void | end_interaction() |
void | restock_vendor() |
void | check_auto_restock() |
Dictionary | get_vendor_summary() |
VendorDefinition | get_vendor_definition() |
void | set_entity_reference( new_entity: Variant, p_system_hub: GameHost.SystemHub ) |
int | get_item_stock( item_id: int ) |
bool | is_item_available( item_id: int ) |
Array[Dictionary] | get_available_items() |
void | set_item_stock( item_id: int, quantity: int ) |
void | cleanup() |
Property descriptions ​
int vendor_definition_id ​
The vendor definition that defines this vendor's shop configuration
SFXSelection shop_open_sfx ​
Optional audio to play when opening shop
AnimationSelectionSocial shop_interaction_animation ​
Optional animation to play when shop opens
Variable descriptions ​
VendorInventoryComponent vendor_inventory_instance ​
The runtime vendor inventory instance created from the definition
bool shop_is_active = false ​
Whether the shop is currently active
Player current_customer ​
Reference to the player currently shopping (if any)
Method descriptions ​
void initialize_vendor() ​
Initialize the vendor inventory from the definition Called when the entity is ready and components are set up
bool can_interact( player: Player ) ​
Check if the player can interact with this vendor
void start_interaction( player: Player ) ​
Start the vendor interaction - opens the shop UI
void end_interaction() ​
End the vendor interaction - closes the shop UI
void restock_vendor() ​
Manually trigger vendor restocking
void check_auto_restock() ​
Check if vendor needs restocking and do it automatically
Dictionary get_vendor_summary() ​
Get vendor summary for debugging
VendorDefinition get_vendor_definition() ​
Get the vendor definition
void set_entity_reference( new_entity: Variant, p_system_hub: GameHost.SystemHub ) ​
Set the entity reference and initialize vendor (called when adding interaction to entity)
int get_item_stock( item_id: int ) ​
Get current stock for a specific item
bool is_item_available( item_id: int ) ​
Check if an item is available for purchase
Array[Dictionary] get_available_items() ​
Get all items currently available for purchase
void set_item_stock( item_id: int, quantity: int ) ​
Manually set stock for an item (for testing/debugging)
void cleanup() ​
Give the timers back (the object is going away)