tuxemon.item.conditions.current_hp module
- class tuxemon.item.conditions.current_hp.CurrentHitPointsCondition(comparison, value)[source]
Bases:
ItemCondition
Compares the target Monster’s current hitpoints against the given value.
If an integer is passed, it will compare against the number directly, if a decimal between 0.0 and 1.0 is passed it will compare the current hp against the total hp.
Example: To make an item only usable if a monster is at less than full health, you would use the condition “is current_hp target,<,1.0”
- Parameters:
comparison (str) –
value (int | float) –
- comparison: str
- name: ClassVar[str] = 'current_hp'
- test(target)[source]
Return True if satisfied, or False if not.
- Parameters:
target (Monster) – The target of the item’s use.
- Return type:
bool
- value: int | float