Skip to content

AmountSource ​

Inherits: Resource

One part of an EffectAmount: a number that is read from the situation when the effect runs and added to the amount. A stat of the user ("1.5 x Attack Power"), the weapon in hand, the health of the target, or what an earlier effect of the same cast did.

Properties ​

KindkindKind.STAT
intstat_id0
CalculationFormulaformula
DiminishingReturnsreturns
floatmultiplier1.0
floatmaximum0.0
intsource_effect_id0

Methods ​

floatevaluate( effect_instance: EffectInstance, overrides: Dictionary = {} )
boolis_stat_part()
Stringdescribe()
Array[String]validate()

Enumerations ​

enum Kind ​

The options of kind: stat, weapon damage, target max health, target health, user max health, cast damage, cast healing, cast absorbed, ability rank, user level ....

  • STAT = 0 - A stat of the user: points x multiplier, or through a formula
  • WEAPON_DAMAGE = 1 - The damage of the weapon the user holds x multiplier (1 = 100 %)
  • TARGET_MAX_HEALTH = 2 - The maximum health of the target x multiplier
  • TARGET_HEALTH = 3 - The current health of the target x multiplier
  • USER_MAX_HEALTH = 4 - The maximum health of the user x multiplier
  • CAST_DAMAGE = 5 - The damage the effects of this cast have dealt so far x multiplier
  • CAST_HEALING = 6 - The healing the effects of this cast have done so far x multiplier
  • CAST_ABSORBED = 7 - The damage the shields of the targets absorbed from this cast so far x multiplier
  • ABILITY_RANK = 8 - The ranks of the ability above the first x multiplier: "+10 per rank" (rank 1 adds nothing, rank 3 adds 20). Needs an effect of an ability
  • USER_LEVEL = 9 - The level of the user x multiplier: "+2 per level"
  • SOURCE_ITEM_LEVEL = 10 - The item level of the item whose effect this is x multiplier. Needs an effect of an item (equipment, a potion, a gem)

Property descriptions ​

Kind kind = Kind.STAT ​

What is measured

int stat_id = 0 ​

The stat of the user (stat kind)

CalculationFormula formula ​

Points of the stat -> amount (stat kind). Empty = multiplier per point. A formula reads the levels of the user and the target too

DiminishingReturns returns ​

Optional diminishing returns on the points, before the formula

float multiplier = 1.0 ​

Per point of the stat (no formula), or the share of the measured value (1 = 100 %, 0.5 = half)

float maximum = 0.0 ​

The most this part can add (0 = no limit)

int source_effect_id = 0 ​

Only the effect with this id counts (cast kinds). 0 = every effect of the cast

Method descriptions ​

float evaluate( effect_instance: EffectInstance, overrides: Dictionary = {} ) ​

The value of this part for an effect that runs now. overrides can name a number the effect knows better: "target_max_health" (a heal limited to one pool uses the maximum of that pool)

bool is_stat_part() ​

Is this a stat of the user? (The base and the stat parts are what the variance applies to)

String describe() ​

A short readable text: "1.50x Attack Power", "50% of the damage dealt so far"

Array[String] validate() ​

Checks the settings of the effect. Gives the problems found (empty when it is fine).