Skip to content

TriggerRule ​

Inherits: Resource

A rule on an effect that changes how one tag behaves whenever that effect is used, whatever the stats of the user say: "this attack always crits", "this attack cannot be dodged", "+30 % chance to crit", "+50 % crit damage". Effect.trigger_rules holds them; the calculation phases of the hit collect them before they roll. "Never" beats "always" when rules disagree. See docs/systems/entity-stats.md, section 24.1.

Properties ​

TriggerTagDefinitiontag
ForceforceForce.NORMAL
floatchance_bonus0.0
floatmagnitude_bonus0.0
floatmagnitude_multiplier1.0

Methods ​

Stringget_tag_name()
Array[String]validate()
Stringdescribe()

Enumerations ​

enum Force ​

The options of force: normal, always, never.

  • NORMAL = 0 - Roll as usual (only the bonuses below apply)
  • ALWAYS = 1 - The tag always fires, with no roll, even if nothing rolls it
  • NEVER = 2 - The tag never fires. Beats ALWAYS

Property descriptions ​

TriggerTagDefinition tag ​

The tag the rule is about. Empty = every tag (a luck-style chance bonus; not allowed with ALWAYS)

Force force = Force.NORMAL ​

Normal (rolled as usual), always (fires without a roll) or never (does not fire; never beats always)

float chance_bonus = 0.0 ​

Added to the chance of the tag, in percentage points (+30 = 30 more percent)

float magnitude_bonus = 0.0 ​

Added to the magnitude of the tag (crit: +50 = a +150 % crit instead of +100 %)

float magnitude_multiplier = 1.0 ​

The magnitude is multiplied by this after the bonuses are added ("more": 1.25 = 25 % more)

Method descriptions ​

String get_tag_name() ​

The name of the tag the rule is about (empty for every tag).

Array[String] validate() ​

Configuration problems as readable messages

String describe() ​

A text about what the rule does.