Skip to content

EffectScalingRule ​

Inherits: Resource

One rule that scales the damage or healing of an effect by something about the target (or the originator): more damage to a target that is nearly dead (execute), more for every point of missing health, more against a shielded target, more for every stack of an effect the target has (combo points as a stacking effect). The bonuses of all the rules of an effect add up to one multiplier: 1 + the bonuses / 100. See docs/systems/ability-mechanics-plan.md, section 7.

Properties ​

SourcesourceSource.TARGET_HEALTH_PERCENT
intpool_id0
inteffect_id0
boolonly_own_stackstrue
inttag_id0
Appliesapplies_whenApplies.ALWAYS
floatthreshold0.0
floatbonus_percent100.0
boolper_unitfalse

Methods ​

floatmeasure( effect_instance: EffectInstance )
floatget_bonus_percent( effect_instance: EffectInstance )
Stringget_summary()

Enumerations ​

enum Source ​

The options of source: target health percent, target missing health percent, target pool value, target pool percent, target has protective pool, target effect stacks, target has tag, originator health percent, originator pool percent.

  • TARGET_HEALTH_PERCENT = 0 - the target's health as a percentage (0 to 100)
  • TARGET_MISSING_HEALTH_PERCENT = 1 - 100 minus that
  • TARGET_POOL_VALUE = 2 - the current value of one of the target's pools
  • TARGET_POOL_PERCENT = 3 - the fill of one of the target's pools, as a percentage
  • TARGET_HAS_PROTECTIVE_POOL = 4 - 1 when a shield (a protective pool with something left) protects the target, else 0
  • TARGET_EFFECT_STACKS = 5 - the stacks of an effect on the target (combo points as a stacking aura)
  • TARGET_HAS_TAG = 6 - 1 when the target has an entity type (Undead ...), else 0
  • ORIGINATOR_HEALTH_PERCENT = 7 - the originator's health as a percentage
  • ORIGINATOR_POOL_PERCENT = 8 - the fill of one of the originator's pools, as a percentage

enum Applies ​

The options of applies: always, below, above.

  • ALWAYS = 0 - the rule always applies
  • BELOW = 1 - only while the measured value is below the threshold
  • ABOVE = 2 - only while it is above the threshold

Property descriptions ​

Source source = Source.TARGET_HEALTH_PERCENT ​

What the rule looks at (the health of the target, the health of the originator ...).

int pool_id = 0 ​

The pool measured (pool sources)

int effect_id = 0 ​

The effect whose stacks are counted (stack source)

bool only_own_stacks = true ​

Count only the stacks the originator put there (stack source)

int tag_id = 0 ​

The entity type looked for (tag source)

Applies applies_when = Applies.ALWAYS ​

When the rule applies (always, or only when a condition holds).

float threshold = 0.0 ​

The value the condition compares with (20 for "below 20 % health")

float bonus_percent = 100.0 ​

The bonus in percent: +100 doubles the damage

bool per_unit = false ​

Multiply the bonus by the measured value (+2 % per 1 % of missing health, +25 % per stack) instead of adding it once when the condition holds

Method descriptions ​

float measure( effect_instance: EffectInstance ) ​

The measured value for this rule (see Source)

float get_bonus_percent( effect_instance: EffectInstance ) ​

The bonus percent this rule gives for the effect instance (0 when its condition does not hold)

String get_summary() ​

A short text about what the rule scales from and when it applies.