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

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
  • $(mig|dex|wlp|ins): Returns attribute size
  • $tsc: Returns the number of status effects on target

Macros

  • &sl(...): Returns the level of the given skill owned by the actor by its fuid. For example, &sl("defensive-mastery"). You can find the fuid of an item in the Effects tab of an item sheet.
  • &step(L5, L20, L40, L60): Chooses one of the given values depending on the level of the actor. For example &step(0, 5, 10, 15)

Reference Functions and Properties

One can invoke functions that return a Number on the item or the actor:

  • @source.computeSomething(...)
  • @target.DoSomething(..)
  • @item.getSomething(...)

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

  • @source.bonuses.damage.sword
  • @target.level.value
  • @item.level.value

Note that source, target 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...

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)]

Active Effect Duration

Duration for active effects in inline commands is controlled by the following variables:

  • e (event): Determines when the effect expires.

    • Supported value:
      • eot: End of turn
      • sot: Start of turn
      • eor: End of round
      • eos: End of scene
      • rest: On rest
  • i (interval): Indicates how many occurrences of the event must pass before the effect expires.

    • Example: i:2 with e:eot means the effect expires at the end of the your next turn after effect is applied.
  • t (tracking): Defines whose turn is used to track the duration.

    • Supported value:
      • self: The affected actor's turn
      • source: The source actor's turn

Example

Breach uses @EFFECT[uuid e:sot i:1 t:source].

If you drag and drop the effect from the player's sheet onto a target, the effect will expire at the start of the source’s next turn, not the target’s.
This is because t:source means the duration is tracked from the source actor’s turn.