Ledger v3 · C# · Godot 4.7 Get started

Time

How long things last.

✓ 10 plays, 149 steps, all passingFrom v2's cookbook

v2's cookbook, how long things last (G326-G334): tenacity shortening a stun, stuns diminishing within a window, a cap on a stun's length, a stun counted in its holder's turns, haste on a cooldown, potions with their own clocks and a shared one, givers who lengthen what they give, a damage over time that ticks faster for a hasted caster, and a refresh that keeps some of the time left. The game raises TurnEnded of each actor as its turn ends. Then an actor's own time: a frost field slowing the enemies around its holder, every timer on them with them.

content/cookbook/time.ledgerthe content
1# v2's cookbook, how long things last (G326-G334): tenacity shortening a stun, stuns diminishing within a window, a
2# cap on a stun's length, a stun counted in its holder's turns, haste on a cooldown, potions with their own clocks and a
3# shared one, givers who lengthen what they give, a damage over time that ticks faster for a hasted caster, and a
4# refresh that keeps some of the time left. The game raises TurnEnded of each actor as its turn ends. Then an actor's
5# own time: a frost field slowing the enemies around its holder, every timer on them with them.
6
7rate 60
8stat MaxHealth
9stat Tenacity
10stat AbilityHaste
11stat Haste
12stat TimeRate
13time TimeRate
14link team
15allegiance team
16pool Health max MaxHealth
17damage Health
18# v2's time channel, in its order: tenacity and diminishing returns ahead of ability haste, since shortening a stun and
19# refusing one are about the stun; a giver's longer buffs and extra turns after; the stun cap last.
20stages Tenacity Diminishing Haste Buff Turns Cap
21tags Stun Buff
22event TurnEnded
23turn TurnEnded
25archetype Hero
26 base MaxHealth 1000
27 full Health
28 has CooldownHaste
29 grants Bash Imprison Flash HealingPotion ManaPotion Inspire Rally Corrupt Wither
31effect CooldownHaste
32 before Apply having Cooldown of holder at Haste
33 scale duration 100 / (100 + holder.AbilityHaste)
35effect Stunned
36 tags Stun
37 stack replace
39ability Bash
40 target one
41 apply Stunned to target for 2s
43# ---- G326 tenacity: mercury treads' 35% take that much off every stun ----
45effect MercuryTreads
46 Tenacity + 0.35
48effect Tenacious
49 before Apply of holder having Stun at Tenacity
50 scale duration 1 - holder.Tenacity floor
52# ---- G327 diminishing returns: each stun in the last 18 seconds halves the next; the fourth is refused, until the
53# window, restarted by each stun, lapses ----
55curve Diminish steps
56 0 1
57 1 0.5
58 2 0.25
60effect StunDR
61 stack add
62 lasts 18s
64effect Diminishing
65 before Apply of holder having Stun at Diminishing when stacks(holder, StunDR) >= 3
66 prevent
67 before Apply of holder having Stun Timed at Diminishing
68 scale duration Diminish(stacks(holder, StunDR))
69 after Apply of holder having Stun
70 apply StunDR
72# ---- G328 hibernate: no stun lasts more than 5 seconds ----
74effect StunCap
75 before Apply having Stun of holder at Cap
76 at most duration 5s
78# ---- G329 the frost prison: a stun of two of its holder's turns, which tenacity shortens to a whole number of them,
79# 1.3 rounded down to one ----
81effect FrostPrison
82 tags Stun
83 lasts 2 turns
85ability Imprison
86 target one
87 apply FrostPrison to target
89# ---- G330 ionian boots: 25 haste makes a cooldown 100 / 125 of itself, flash's 20 seconds 16 ----
91effect IonianBoots
92 AbilityHaste + 25
94ability Flash
95 cooldown 20s
97# ---- G331 potions: each its own 60 seconds, which haste shortens, and a shared 30 that it doesn't ----
99effect PotionShared
100 lasts 30s
102ability HealingPotion
103 cooldown 60s
104 requires not has(holder, PotionShared) else "potions shared"
105 heal 100 to holder
106 apply PotionShared to holder
108ability ManaPotion
109 cooldown 60s
110 requires not has(holder, PotionShared) else "potions shared"
111 apply PotionShared to holder
113# ---- G332 a bard's buffs last half again as long, and a tactician's a turn longer; each touches only its own kind ----
115effect Inspired
116 tags Buff
117 lasts 10s
119effect Rallied
120 tags Buff
121 lasts 2 turns
123ability Inspire
124 target one
125 apply Inspired to target
127ability Rally
128 target one
129 apply Rallied to target
131effect BardicLore
132 before Apply by holder having Buff Timed at Buff
133 scale duration 1.5
135effect Tactics
136 before Apply by holder having Buff at Turns
137 add duration 1 turn
139# ---- G333 a hasted caster's corruption: 5 every 2 seconds for 12, the gap shortened by the caster's haste as it was
140# when cast ----
142effect Corruption
143 lasts 12s
144 var gap = 2 * 100 / (100 + source.Haste)
145 every self.gap * 1s
146 deal 5 to holder
148ability Corrupt
149 target one
150 apply Corruption to target
152effect Bloodlust
153 Haste + 25
155# ---- G334 pandemic: a refresh keeps what was left, up to 30% of the length ----
157effect Withering
158 stack refresh keep up to 30%
159 lasts 12s
160 every 1s
161 deal 1 to holder
163ability Wither
164 target one
165 apply Withering to target
167# ---- an actor's time: an outside author's mechanic (design round, A1). A frost field slows the enemies within 5 of its
168# holder to half their pace while they stand in it, and with them every timer on them: a burn's ticks and its end come
169# at their pace, not the world's, and one walked out of the field runs on at its own, keeping what it had run ----
171archetype Team
173archetype Ghoul
174 base MaxHealth 100
175 full Health
177effect FrostField
178 aura Chilled on all enemies within 5
180effect Chilled
181 TimeRate x 0.5
183effect Scorched
184 lasts 2s
185 every 1s
186 deal 10 to holder
content/cookbook/time.playwhat it must do
1catalog time.ledger
2row G326 Stunned MercuryTreads Tenacious Bash Hero
3row G327 Stunned MercuryTreads Tenacious StunDR Diminishing Bash Hero
4row G328 Stunned StunCap Hero
5row G329 MercuryTreads Tenacious FrostPrison Imprison Hero
6row G330 CooldownHaste IonianBoots Flash Hero
7row G331 CooldownHaste IonianBoots PotionShared HealingPotion ManaPotion Hero
8row G332 Inspired Rallied BardicLore Tactics Inspire Rally Hero
9row G333 Corruption Bloodlust Corrupt Hero
10row G334 Withering Wither Hero
12play G326 "In mercury treads a 2 second bash stuns for 1.3"
13 make h Hero
14 make t Hero
15 apply MercuryTreads to t
16 apply Tenacious to t
17 act h Bash at t
18 expect t remaining Stunned = 1.3s from G326: "stuns for 1.3 seconds"
19 save
20 advance 1.3s
21 expect t lacks Stunned
23play G327 "With tenacity, bashes two seconds apart stun 1.3, 0.65 and a third of a second; the fourth is refused; 18 seconds after the third, a bash stuns 1.3 again"
24 make h Hero
25 make t Hero
26 apply MercuryTreads to t
27 apply Tenacious to t
28 apply Diminishing to t
29 act h Bash at t
30 expect t remaining Stunned = 1.3s from G327: "tenacity, 1.3"
31 advance 2s
32 act h Bash at t
33 expect t remaining Stunned = 0.65s from G327: "0.65 and"
34 advance 2s
35 act h Bash at t
36 expect t remaining Stunned = 20t from content: G327 halves 0.65 to 0.325 s, written 0.33; the content's clock of 60 ticks a second rounds the 19.5 ticks up to 20
37 save
38 advance 2s
39 act h Bash at t
40 expect t lacks Stunned
41 expect t has StunDR 3 from content: G327 halves each stun within its window but keeps no count of them; the content holds one StunDR stack for each of the three stuns, the refused fourth adding none
42 advance 15.9s
43 act h Bash at t
44 expect t lacks Stunned
45 advance 2.1s
46 expect t lacks StunDR
47 act h Bash at t
48 expect t remaining Stunned = 1.3s from G327: "tenacity, 1.3"
50play G328 "Hibernating, an 8 second stun lasts 5"
51 make h Hero
52 apply StunCap to h
53 apply Stunned to h for 8s
54 expect h remaining Stunned = 5s from G328: "cut to 5 seconds"
55 save
56 apply Stunned to h for 3s
57 expect h remaining Stunned = 3s from content: G328's cap leaves the 3 s stun whole, and the content's new stun replaces the 5 s left rather than keeping the longer
59play G329 "The frost prison holds a hero for two of its turns, and one in mercury treads for one, 1.3 rounded down"
60 make h Hero
61 make t Hero
62 make u Hero
63 apply MercuryTreads to u
64 apply Tenacious to u
65 act h Imprison at t
66 expect t remaining FrostPrison = 2 turns from G329: "lasting two of the holder's turns"
67 act h Imprison at u
68 expect u remaining FrostPrison = 1 turn from G329: "so one turn"
69 raise TurnEnded of t
70 raise TurnEnded of u
71 expect t remaining FrostPrison = 1 turn from G329: "lasting two of the holder's turns" - count "TurnEnded of t"
72 expect u lacks FrostPrison
73 save
74 advance 60s
75 expect t has FrostPrison
76 raise TurnEnded of t
77 expect t lacks FrostPrison
79play G330 "In ionian boots flash's 20 second cooldown is 16"
80 make h Hero
81 apply IonianBoots to h
82 act h Flash
83 expect h remaining Flash.cooldown = 16s from G330: "becomes 16 seconds"
84 save
85 advance 15.9s
86 expect h cannot Flash OnCooldown
87 advance 0.1s
88 expect h can Flash
90play G331 "Hasted, a healing potion's own clock is 48 and the shared one 30: the mana potion waits for the 30, and the healing one for its 48 and then the mana potion's 30"
91 make h Hero
92 apply IonianBoots to h
93 act h HealingPotion
94 expect h remaining HealingPotion.cooldown = 48s from G331: "48 seconds and the shared"
95 expect h remaining PotionShared = 30s from G331: "30 second clock"
96 advance 10s
97 act h ManaPotion
98 expect refused Requirement "potions shared"
99 advance 20s
100 act h ManaPotion
101 expect done
102 save
103 advance 18s
104 expect h cannot HealingPotion Requirement
105 advance 12s
106 act h HealingPotion
107 expect done
109play G332 "A bard's inspire lasts 15 seconds and its rally the plain 2 turns; a tactician's inspire the plain 10 seconds and its rally 3 turns"
110 make bard Hero
111 make tac Hero
112 make a Hero
113 make b Hero
114 apply BardicLore to bard
115 apply Tactics to tac
116 act bard Inspire at a
117 expect a remaining Inspired = 15s from G332: "15 seconds from a bard"
118 act bard Rally at a
119 expect a remaining Rallied = 2 turns from G332: "2 turn"
120 act tac Inspire at b
121 expect b remaining Inspired = 10s from G332: "10 second inspire"
122 act tac Rally at b
123 expect b remaining Rallied = 3 turns from G332: "lasts 3"
124 save
125 raise TurnEnded of b
126 raise TurnEnded of b
127 expect b has Rallied
128 raise TurnEnded of b
129 expect b lacks Rallied
130 covers strain 19
132play G333 "Corruption ticks every 2 seconds, six times in 12; from a caster in bloodlust every 1.6, seven times, kept as cast when the bloodlust goes"
133 make h Hero
134 make t Hero
135 make u Hero
136 act h Corrupt at t
137 advance 12s
138 expect t.Health = 970 from G333: t.Health - "5 damage" * "for 12 seconds" / "every 2 seconds"
139 apply Bloodlust to h
140 act h Corrupt at u
141 save
142 advance 1.6s
143 expect u.Health = 995 from G333: u.Health - "5 damage"
144 remove Bloodlust from h
145 advance 10.4s
146 expect u.Health = 965 from content: G333 doesn't say whether a running damage over time keeps its pace when the haste goes; the content's keeps 1.6 s, seven ticks of 5 off its 1000
148play G334 "A 12 second wither refreshed with 2 left lasts 14, and refreshed again at once 15.6"
149 make h Hero
150 make t Hero
151 act h Wither at t
152 advance 10s
153 act h Wither at t
154 expect t remaining Withering = 14s from G334: "lasts 14 seconds"
155 save
156 act h Wither at t
157 expect t remaining Withering = 15.6s from G334: "back (15.6 seconds)"
159play "A frost field slows a ghoul 3 off to half its pace: its 2 second burn ticks every 2 seconds of the world's, where one 10 off is burnt every second and done at 2; walked out of the field at 2 seconds, the slowed one's burn runs on at its own pace, its second tick and its end a second later"
160 make a Team
161 make b Team
162 make p Hero with team = a at 0
163 make g Ghoul with team = b at 3
164 make far Ghoul with team = b at 10
165 apply FrostField to p
166 apply Scorched to g
167 apply Scorched to far
168 advance 1s
169 expect far.Health = 90 from content: the play names no row; the content's burn takes 10 a second of the world's off its ghoul's 100, one tick by 1 s
170 expect g.Health = 100 from content: the play names no row; the content's frost field halves the slowed ghoul's pace, so its burn's first 2 s tick hasn't come, keeping its 100
171 advance 1s
172 expect far.Health = 80 from content: the play names no row; the content's burn takes a second 10 at 2 s, two off its ghoul's 100, and is done
173 expect far lacks Scorched
174 expect g.Health = 90 from content: the play names no row; the slowed ghoul's first burn tick of 10 at 2 s of the world's, off its 100
175 expect g has Scorched
176 save
177 place g 20
178 advance 1s
179 expect g.Health = 80 from content: the play names no row; out of the field the ghoul's burn runs at its own pace, its second 10 a second later onto 90, and ends
180 expect g lacks Scorched

Run it yourself

ledger check content/cookbook/time.ledger content/cookbook/time.play
ledger play content/cookbook/time.play