Ledger v3 · C# · Godot 4.7 Get started

Portions

More than one kind of damage in a hit.

✓ 3 plays, 16 steps, all passingFrom v2's cookbook

v2's cookbook, more than one kind of damage (G285-G287): a sword's hit in two portions, each through its own defence; a skill that turns half its physical into fire before the defences; a state that does the same to every hit, the two conversions one after the other.

content/cookbook/portions.ledgerthe content
1# v2's cookbook, more than one kind of damage (G285-G287): a sword's hit in two portions, each through its own defence;
2# a skill that turns half its physical into fire before the defences; a state that does the same to every hit, the two
3# conversions one after the other.
4
5rate 60
6stat MaxHealth
7stat Armor
8stat FireResist max 0.75
9pool Health max MaxHealth
10damage Health
11stages Convert Mitigation
12portions Physical Fire
13tags Infernal
15archetype Swordsman
16 base MaxHealth 100
17 full Health
18 has InfernalTechnique
19 grants Swing InfernalBlow
21archetype Knight
22 base MaxHealth 500
23 base Armor 100
24 base FireResist 0.25
25 full Health
26 has Defences
28effect Defences
29 before Damage of holder having Physical at Mitigation
30 scale 1 - holder.Armor / (holder.Armor + 100)
31 before Damage of holder having Fire at Mitigation
32 scale 1 - holder.FireResist
34# ---- G285 flametongue: a swing of 20 physical and 8 fire, each through its own defence ----
36ability Swing
37 target one
38 deal 20 Physical + 8 Fire to target
40# ---- G286 infernal blow: half its physical becomes fire before the defences ----
42ability InfernalBlow
43 target one
44 deal 20 Physical + 8 Fire Infernal to target
46effect InfernalTechnique
47 before Damage by holder having Infernal at Convert
48 convert 50% of Physical to Fire
50# ---- G287 the avatar of fire: half of every hit's physical becomes fire, whatever the skill; with infernal blow the two
51# conversions run one after the other ----
53effect AvatarOfFire
54 before Damage by holder at Convert
55 convert 50% of Physical to Fire
content/cookbook/portions.playwhat it must do
1catalog portions.ledger
2row G285 Defences Swing Swordsman Knight
3row G286 InfernalTechnique InfernalBlow Swordsman Knight
4row G287 AvatarOfFire Swing InfernalBlow Swordsman Knight
5
6play G285 "Flametongue's swing, 20 physical and 8 fire, is 10 through the knight's 100 armour and 6 through its quarter fire resistance, 16"
7 make s Swordsman
8 make k Knight
9 act s Swing at k
10 expect k.Health = 484 from G285: k.Health - "= 16. Like"
12play G286 "Infernal blow turns half the physical into fire first: 10 and 18, 5 and 13.5 through the defences, 18.5"
13 make s Swordsman
14 make k Knight
15 act s InfernalBlow at k
16 expect k.Health = 481.5 from G286: k.Health - ("5 physical" + "13.5 fire")
18play G287 "As an avatar of fire every swing is 18.5; infernal blow too converts again, 5 physical of the 10 left, 2.5 and 17.25 through, 19.75"
19 make s Swordsman
20 make k Knight
21 apply AvatarOfFire to s
22 act s Swing at k
23 expect k.Health = 481.5 from G287: k.Health - "any swing is 18.5"
24 save
25 act s InfernalBlow at k
26 expect k.Health = 461.75 from G287: k.Health - "any swing is 18.5" - ("2.5 physical" + "17.25 fire")

What a change to Health meets

Every rule in this recipe a change to Health passes through, in order. Each line is a link to the rule.

> ledger pipeline content/cookbook/portions.ledger Health
Health: a change to it meets 4 rules, in this order
before, at Convert
  InfernalTechnique: Damage by holder having Infernal at Convert (content/cookbook/portions.ledger:47)
    converts Physical to Fire; held by Swordsman
  AvatarOfFire: Damage by holder at Convert (content/cookbook/portions.ledger:54)
    converts Physical to Fire; held by no archetype and applied by no content: the game or a play puts it on
before, at Mitigation
  Defences: Damage of holder having Physical at Mitigation (content/cookbook/portions.ledger:29)
    scales it; held by Knight
  Defences: Damage of holder having Fire at Mitigation (content/cookbook/portions.ledger:31)
    scales it; held by Knight
no archetype lacks a layer its like hold

Run it yourself

ledger check content/cookbook/portions.ledger content/cookbook/portions.play
ledger play content/cookbook/portions.play
ledger pipeline content/cookbook/portions.ledger Health