Variables and Items
Variable Definition
@var hp = 100
@var gold = 50
@var name = "林晓"
@var is_alive = trueVariable Modification
@set hp = 80
@set gold = gold + 10
@set hp = hp - 20Item Definition
@item healing_potion
name: Healing Potion
description: Restores 50 HP
rarity: common
@endItem Operations
Give Item
@give healing_potion 1
@give gold 100Remove Item
@take healing_potion 1Check Items
Use in conditions:
@check has_item("healing_potion")
@success
> You used a healing potion.
@take healing_potion 1
@set hp = hp + 50
@fail
> You don't have any potions.
@endcheckCheck Item Count
@check item_count("gold") >= 100
@success
> You have enough gold.
@fail
> Not enough gold.
@endcheckBuilt-in Functions
| Function | Description |
|---|---|
has_item("item_id") | Check if player has item |
item_count("item_id") | Get item count |
has_ending("ending_id") | Check if ending was triggered |
has_flag("flag_id") | Check if flag was set |
roll("2d6+3") | Dice check |
random(1, hp) | Generate a random integer in range |
chance(0.25) | Return a boolean by probability |
Last updated on