tuxemon.event.conditions.has_item module
- class tuxemon.event.conditions.has_item.HasItemCondition[source]
Bases:
EventCondition
Check to see if a NPC inventory contains something.
Script usage
is has_item <character>,<item>[,operator][,quantity]
- Script parameters:
character – Either “player” or npc slug name (e.g. “npc_maple”).
item – The item slug name (e.g. “item_cherry”).
operator – Numeric comparison operator. Accepted values are “less_than”, “greater_than”, “equals”, “less_or_equal” and “greater_or_equal”.
quantity – Quantity to compare with.
- name: ClassVar[str] = 'has_item'
- test(session, condition)[source]
Check to see a character has a particular number of items.
- Parameters:
session (Session) – The session object
condition (MapCondition) – The map condition object.
- Returns:
Whether the target character has the desired quantity of the specified item.
- Return type:
bool