Expressions - League-of-Fabulous-Developers/FoundryVTT-Fabula-Ultima GitHub Wiki

The system supports a custom syntax for expressions within the following contexts:

  • Inline commands in a ChatMessage such as @DMG, @GAIN, @LOSS, @CHECK.
  • Active Effect values.

Syntax

Reference Functions and Properties

One can invoke functions on the item or the actor:

  • @actor.computeSomething(...) ` @item.getSomething(...)

One can reference properties on the item or the actor that owns the item:

  • @actor.bonuses.damage.sword
  • @item.level.value

Note that actor is a direct reference to CharacterDataModel or NpcDataModel whereas item is a reference to one of the data models that an item can have depending on its type, such as WeaponDataModel or SkillDataModel and so on...

Variables

  • $(minor|heavy|massive): Uses the actor's level to compute the value from the standard improvised effect table.
  • $cl: Returns the character level
  • $il, $sl: Returns item/skill level

Macros

  • &sl(...): Returns the level of the given skill owned by the actor by its fuid. For example &sl("defensive-mastery")
  • &step(L5, L20, L40): Chooses one of the given values depending on the level of the actor. For example &step(40,50,60)

Examples

  • @HEAL[$minor hp]
  • @DMG[&step(15,25,35) fire]
  • @GAIN(10*&sl('regen-skill') mp]
  • @LOSS[$heavy+5 mp]
  • @CHECK[dex mig], @CHECK[dex mig easy], @CHECK[mig wlp ($sl)]