Prices
Prices, scaled, cut and turned away.
v2's cookbook, prices (G257-G263). A price is a change to its payer's pool that carries the ability's tags, so a rule the payer holds can scale it, take a flat sum off it after the percentages, or turn it away; a stock of charges refills by itself a charge at a time; a free shot is a round given back once it was paid, so an empty gun can't fire.
1
# v2's cookbook, prices (G257-G263). A price is a change to its payer's pool that carries the ability's tags, so a rule2
# the payer holds can scale it, take a flat sum off it after the percentages, or turn it away; a stock of charges3
# refills by itself a charge at a time; a free shot is a round given back once it was paid, so an empty gun can't fire.5
rate 606
stat MaxHealth7
stat CostCut8
pool Health max MaxHealth9
pool Mana max 10010
pool Charges max 2 refill 1 every 5s11
pool Actions max 212
pool Ammo max 513
damage Health14
stages Percent Flat15
tags Spell Move Shot16
event TurnEnded18
archetype Mage19
base MaxHealth 10020
full Health Mana21
has Thrifty22
grants Frostbolt24
archetype Dummy25
base MaxHealth 50026
full Health28
ability Frostbolt29
tags Spell30
target one31
cost Mana 4032
deal 10 to target34
# ---- G257 innervate: for 8 seconds every spell is free ----36
effect Innervated37
lasts 8s38
before Cost Mana by holder having Spell39
scale 041
# ---- G258 clearcasting: the next spell in 15 seconds is free, and is spent by it, innervated or not; a rule before a42
# cost changes the cost and nothing else, so it spends itself after the cost (09-abilities.md, iteration 3j, b6) ----44
effect Clearcasting45
lasts 15s46
before Cost Mana by holder having Spell47
scale 048
after Cost Mana by holder having Spell49
remove self51
# ---- G259 the arcane rune: 30% off for 50 seconds; discounts add into the one rule every caster holds, and a preview52
# shows the price ----54
effect Thrifty55
before Cost Mana by holder at Percent56
scale 1 - holder.CostCut58
effect ArcaneRune59
lasts 50s60
CostCut + 0.362
effect FrugalTalent63
CostCut + 0.165
# ---- G260 preparation: the next spell in 30 seconds costs 20 less, after the percentages ----67
effect Preparation68
lasts 30s69
before Cost Mana by holder having Spell at Flat70
reduce 2071
after Cost Mana by holder having Spell72
remove self74
# ---- G261 a dash spends one of two charges, which come back a charge every 5 seconds ----76
ability Dash77
target self78
cost Charges 180
archetype Skirmisher81
base MaxHealth 10082
full Health Charges83
grants Dash85
# ---- G262 a free move: this turn's next move costs no action, and the turn's end takes it ----87
ability Move88
tags Move89
target self90
cost Actions 192
effect FreeMove93
ends on TurnEnded of holder94
before Cost Actions by holder having Move95
prevent96
after Cost Actions by holder having Move prevented97
remove self99
archetype Ranger100
base MaxHealth 100101
full Health Actions102
grants Move104
# ---- G263 the ammo box: a fifth of shots give their round back; the round is paid first, so an empty gun can't fire ----106
ability Shoot107
tags Shot108
target one109
cost Ammo 1110
deal 10 to target112
effect AmmoBox113
after Activate by holder having Shot when chance(20%)114
gain Ammo 1116
archetype Gunner117
base MaxHealth 100118
full Health Ammo119
grants Shoot1
catalog prices.ledger2
row G257 Innervated Frostbolt Mage Dummy3
row G258 Innervated Clearcasting Frostbolt Mage4
row G259 Thrifty ArcaneRune FrugalTalent Frostbolt Mage5
row G260 Preparation Frostbolt Mage6
row G261 Dash Skirmisher7
row G262 FreeMove Move Ranger8
row G263 AmmoBox Shoot Gunner10
play G257 "A frostbolt costs 40 mana; innervated, nothing for 8 seconds, and then 40 again"11
make m Mage12
make t Dummy13
act m Frostbolt at t14
expect m.Mana = 60 from G257: m.Mana - Frostbolt.cost15
apply Innervated to m16
act m Frostbolt at t17
expect m.Mana = 60 from G257: m.Mana - Frostbolt.cost18
save19
advance 8s20
act m Frostbolt at t21
expect m.Mana = 20 from content: G257 leaves open whether a cast at the 8th second is inside the window; the content's window has closed, so the content's 40 is paid: 60 - 40 = 2023
play G258 G257 "Clearcasting makes the next spell free and is spent by it; innervated as well, the spell is free once over and the proc still spent"24
make m Mage25
make t Dummy26
apply Clearcasting to m27
act m Frostbolt at t28
expect m.Mana = 100 from G258: m.Mana29
expect m lacks Clearcasting30
act m Frostbolt at t31
expect m.Mana = 60 from G258: m.Mana - Frostbolt.cost32
save33
apply Clearcasting to m34
apply Innervated to m35
act m Frostbolt at t36
expect m.Mana = 60 from G258: m.Mana - Frostbolt.cost37
expect m lacks Clearcasting38
expect m has Innervated40
play G259 "The arcane rune takes 30% off: a frostbolt of 40 costs 28, and a preview shows it; a frugal talent's 10% more adds to it, 24"41
make m Mage42
make t Dummy43
apply ArcaneRune to m44
expect preview m Frostbolt at t m.Mana = 72 from G259: m.Mana - Frostbolt.cost * (1 - "30% less")45
act m Frostbolt at t46
expect m.Mana = 72 from G259: m.Mana - Frostbolt.cost * (1 - "30% less")47
save48
apply FrugalTalent to m49
act m Frostbolt at t50
expect m.Mana = 48 from content: G259 adds discounts into one multiplier but gives the frugal talent no amount; the content's 10% with the rune's 30% makes 40 cost 24: 72 - 24 = 4852
play G260 G259 "Preparation takes 20 off the next spell after the rune's 30%: 40 is 28, less 20, 8; the one after is 28"53
make m Mage54
make t Dummy55
apply ArcaneRune to m56
apply Preparation to m57
act m Frostbolt at t58
expect m.Mana = 92 from G260: m.Mana - (Frostbolt.cost * (1 - "30% less" in G259) - "costs 20 less")59
expect m lacks Preparation60
save61
act m Frostbolt at t62
expect m.Mana = 64 from G260: m.Mana - (Frostbolt.cost * (1 - "30% less" in G259) - "costs 20 less") - Frostbolt.cost * (1 - "30% less" in G259)64
play G261 "A dash spends one of two charges; with both spent it is refused until 5 seconds bring one back"65
make s Skirmisher66
act s Dash67
act s Dash68
expect s.Charges = 0 from G261: "two charges" - count "act s Dash"69
act s Dash70
expect refused CannotAfford71
save72
advance 4.9s73
act s Dash74
expect refused CannotAfford75
advance 0.1s76
act s Dash77
expect done78
expect s.Charges = 0 from G261: "refills one charge" - "dash that uses one"80
play G262 "With a free move the turn's next move costs no action of two, and the move spends it; one unused goes with the turn's end"81
make r Ranger82
apply FreeMove to r83
act r Move84
expect r.Actions = 2 from G262: "point (of two)"85
expect r lacks FreeMove86
act r Move87
expect r.Actions = 1 from G262: "point (of two)" - Move.cost88
save89
apply FreeMove to r90
raise TurnEnded of r91
expect r lacks FreeMove93
play G263 "With the ammo box a fifth of shots give their round back: of five rounds, this gunner fires seven, and with none left it can't fire"94
seed 6 # a run's: the draws under it fall as the play says95
make g Gunner96
apply AmmoBox to g97
make t Dummy98
act g Shoot at t99
act g Shoot at t100
act g Shoot at t101
act g Shoot at t102
act g Shoot at t103
act g Shoot at t104
act g Shoot at t105
expect t.Health = 430 from a run: under seed 6 the gunner's 1st and 3rd shots draw free, so 7 shots of the content's 10 land on the dummy's 500: 500 - 70 = 430106
expect g.Ammo = 0 from a run: under seed 6 two of the 7 shots draw free, so the 5 rounds are all spent: 5 - 7 + 2 = 0107
save108
act g Shoot at t109
expect refused CannotAfford110
expect coverage AmmoBox rule 1 heard = 7 from a run: under seed 6 the 5-round gun fires 7 shots, the 1st and 3rd drawing free, and the ammo box's rule hears each one111
expect coverage AmmoBox rule 1 fired = 2 from a run: under seed 6 the ammo box's draw comes up free on the 1st and 3rd of the gunner's shots, and on no other112
expect coverage Shoot used = 7 from a run: under seed 6 the 1st and 3rd shots give their round back, so the 5 rounds carry 7 shots113
expect coverage Shoot refused = 1 from a run: under seed 6 the 7 shots spend all 5 rounds, so the 8th order is refused114
covers gap 6Run it yourself
ledger check content/cookbook/prices.ledger content/cookbook/prices.play
ledger play content/cookbook/prices.play