Ledger v3 · C# · Godot 4.7 Get started

Bounty

A bounty paid to whoever owns the killer

✓ 1 play, 20 steps, all passingFrom TD, content\td.ledger
after Diedevent.credit.ownergain ... on

A bounty paid to whoever owns the killer, lifted from the tower-defense slice's content\td.ledger (Mortal and Bountied) and the archer's shot from content\towers.ledger. A creep killed pays its bounty to the owner of what killed it: a tower, or anything a tower made, since a kill is credited through what the hit came from.

content/cookbook/mechanics/bounty.ledgerthe content
1# A bounty paid to whoever owns the killer, lifted from the tower-defense slice's content\td.ledger (Mortal and
2# Bountied) and the archer's shot from content\towers.ledger. A creep killed pays its bounty to the owner of what
3# killed it: a tower, or anything a tower made, since a kill is credited through what the hit came from.
4
5rate 60
6link team owner
7allegiance team
8stat MaxHealth
9stat Bounty
10stat Damage
11pool Health max MaxHealth
12pool Gold whole
13damage Health
14tags Tower Creep Physical
15event Died
17effect Mortal
18 dies at no Health raising Died
20effect Bountied
21 after Died of holder
22 gain Gold holder.Bounty on event.credit.owner
24ability Shoot
25 target one enemy within 4
26 deal holder.Damage Physical to target
28archetype Archer
29 tags Tower
30 base Damage 6
31 grants Shoot
33archetype Side
35archetype Player
36 pools Gold
38archetype Runner
39 tags Creep
40 base MaxHealth 12
41 base Bounty 3
42 full Health
43 has Mortal
44 has Bountied
content/cookbook/mechanics/bounty.playwhat it must do
1catalog bounty.ledger
2
3# The bounty's numbers, from Bountied and the Runner: 12 Health, a bounty of 3. Two players of side a, each owning an
4# archer of 6 a shot.
5
6play "a runner killed by p's archer pays p its 3, and q nothing; a runner only hurt pays none"
7 make a Side
8 make b Side
9 make p Player with team = a
10 make q Player with team = a
11 make ap Archer with team = a, owner = p at 0
12 make aq Archer with team = a, owner = q at 0
13 make r Runner with team = b at 2
14 make s Runner with team = b at 3
15 act aq Shoot at r
16 expect done
17 act ap Shoot at r
18 expect done
19 expect r gone
20 expect p.Gold = 3 from content: the Runner's bounty 3, to the owner of the archer whose shot killed it
21 expect q.Gold = 0 from content: its shot hurt and didn't kill
22 save
23 act ap Shoot at s
24 expect done
25 expect s alive
26 expect p.Gold = 3 from content: no death, no bounty: still 3

Run it yourself

ledger check content/cookbook/mechanics/bounty.ledger content/cookbook/mechanics/bounty.play
ledger play content/cookbook/mechanics/bounty.play