Skip to content

@charges

@charges <object>[=<integer>]
@runout <object>[=<action list>]

These attributes can limit how many times an object can be successfully “use”d. When you “use” an object with a CHARGES attribute set, the object’s AUSE attribute is only triggered if CHARGES is a positive integer. When CHARGES is less than 1 (or not a number), the object’s RUNOUT attribute is triggered instead.

When the CHARGES attribute is present and AUSE is triggered, the value of the CHARGES attribute is automatically decreased by 1. When no CHARGES attribute is set, AUSE is always triggered.

::: seealso

> @create Revolver
> @use Revolver=You pull the trigger.
> @ouse Revolver=pulls the trigger.
> @charges Revolver=6
> @ause Revolver=POSE fires into the air.
> @runout Revolver=POSE clicks, but is out of bullets.
> use revolver
You pull the trigger.
Revolver fires into the air.
> ex revolver/charges
CHARGES [#6$]: 5

The next 5 “use revolver”s work the same way, decrementing CHARGES each time.

> ex revolver/charges
CHARGES [#6$]: 0
> use revolver
You pull the trigger.
Revolver clicks, but is out of bullets.
> ex revolver/charges
CHARGES [#6$]: 0