Stim
A buff paid in health that hastens attacks
cost Healthcooldown ... clock STATtemplate abilityA buff paid in health that hastens attacks, lifted from the RTS slice's content\rifle.ledger (Stim, Stimmed and the rifle's Shot), with the Attack template and the attack clock of content\rules.ledger. Stim trades 10 health for 11 seconds of half again the attack speed and the movement, and is refused where the 10 would kill. The shot's cooldown runs on its holder's AttackSpeed, so a stimmed rifle fires every 0.4 s, not 0.6. The slice's attack also requires the target in its side's sight, a fact its fog answers; that line is left out here.
1
# A buff paid in health that hastens attacks, lifted from the RTS slice's content\rifle.ledger (Stim, Stimmed and the2
# rifle's Shot), with the Attack template and the attack clock of content\rules.ledger. Stim trades 10 health for 113
# seconds of half again the attack speed and the movement, and is refused where the 10 would kill. The shot's4
# cooldown runs on its holder's AttackSpeed, so a stimmed rifle fires every 0.4 s, not 0.6. The slice's attack also5
# requires the target in its side's sight, a fact its fog answers; that line is left out here.7
rate 208
stat MaxHealth9
stat MoveSpeed10
stat AttackSpeed default 111
pool Health max MaxHealth12
damage Health13
link team14
allegiance team15
tags Unit Attack17
template ability Attack(reach, cool, amount)18
tags Attack19
target one enemy within reach20
cooldown 1s * cool clock AttackSpeed21
deal amount to target23
ability Shot from Attack(5, 0.6, 6)25
ability Stim26
requires holder.Health > 10 else "it would kill"27
cost Health 1028
apply Stimmed to holder30
effect Stimmed31
stack refresh32
lasts 11s33
AttackSpeed + 50%34
MoveSpeed + 50%36
archetype Side38
archetype Rifle39
tags Unit40
base MaxHealth 4541
base MoveSpeed 3.1542
full Health43
grants Shot Stim1
catalog stim.ledger3
# The stim's numbers, from Stim (10 health), Stimmed (50% on AttackSpeed and MoveSpeed for 11 s) and Shot (6 every4
# 0.6 s of the attack clock); the Rifle's 45 Health.6
play "stimmed: 10 health paid, the feet half again as fast, and a shot every 0.4 s"7
make a Side8
make b Side9
make r Rifle with team = a at 0 010
make t Rifle with team = b at 3 011
act r Stim12
expect done13
expect r.Health = 35 from content: 45 less the stim's 1014
expect r.MoveSpeed = 4.725 from content: 3.15 and Stimmed's 50%15
act r Shot at t16
expect done17
expect t.Health = 39 from content: 45 less 618
advance 0.4s19
act r Shot at t20
expect done21
expect t.Health = 33 from content: the cooldown's 0.6 s at AttackSpeed 1.5 is 0.4 s: 39 less 622
save23
advance 11s24
expect r lacks Stimmed25
act r Shot at t26
expect done27
advance 0.4s28
act r Shot at t29
expect refused OnCooldown31
play "at 10 health or less, the stim is refused in its words"32
make a Side33
make r Rifle with team = a34
deal 35 to r35
act r Stim36
expect refused Requirement "it would kill"Run it yourself
ledger check content/cookbook/mechanics/stim.ledger content/cookbook/mechanics/stim.play
ledger play content/cookbook/mechanics/stim.play