Progress
Experience filling a bar, levels spilling over.
v2's cookbook, progress (G292): experience fills a bar 100 times the level wide; full, the level's price comes out and a level goes in, what spilled over carrying toward the next, again if it fills again; a wider bar isn't handed its new room; each level past the first is 10 health, read live.
1
# v2's cookbook, progress (G292): experience fills a bar 100 times the level wide; full, the level's price comes out2
# and a level goes in, what spilled over carrying toward the next, again if it fills again; a wider bar isn't handed its3
# new room; each level past the first is 10 health, read live.5
rate 606
stat MaxHealth7
stat Level8
stat XPCap9
stat XpWorth default 5010
pool Health max MaxHealth11
pool XP max XPCap12
damage Health13
event Died15
effect Mortal16
after Depleted Health of holder17
raise Died of holder18
destroy holder20
# ---- G292 a kill is worth what the kill says, 50 unless it says otherwise; a full bar is a level, its spill kept ----22
effect Learning23
after Died credited to holder24
gain XP event.subject.XpWorth25
after Change XP of holder having Gain when event.overflow > 0 or holder.XP >= holder.XPCap26
let over = event.overflow27
apply LevelUp28
set XP 029
gain XP over31
effect LevelUp32
stack add33
Level + 135
archetype Recruit36
base Level 137
base XPCap 100 * holder.Level38
base MaxHealth 100 + 10 * (holder.Level - 1)39
full Health40
pools XP41
has Learning43
archetype Grunt44
base MaxHealth 1045
full Health46
has Mortal48
archetype Warlord49
base MaxHealth 1050
base XpWorth 35051
full Health52
has Mortal1
catalog progress.ledger2
row G292 Mortal Learning LevelUp Recruit Grunt Warlord4
play G292 "Two grunts, 50 each, fill level 1's 100 and the recruit is level 2, 110 health; a warlord's 350 at level 2 fills 200 with 150 over, level 3 at 150 of 300; another warlord, level 4 with 200 of 400; a grunt more is 250"5
make r Recruit6
make g1 Grunt7
make g2 Grunt8
deal 10 to g1 from r9
expect r.XP = 50 from G292: "50 by default"10
deal 10 to g2 from r11
expect r.Level = 2 from G292: r.Level + "one level is added"12
expect r.XP = 0 from G292: "50 by default" + "50 by default" - "costs 100"13
expect max r.XP = 200 from G292: "costs 200"14
expect max r.Health = 110 from G292: max r.Health + "adds 10 max health"15
make w1 Warlord16
deal 10 to w1 from r17
expect r.Level = 3 from G292: r.Level + "one level is added" + "one level is added"18
expect r.XP = 150 from G292: w1.XpWorth - "costs 200"19
save20
make w2 Warlord21
deal 10 to w2 from r22
expect r.Level = 4 from G292: r.Level + "one level is added" + "one level is added" + "one level is added"23
expect r.XP = 200 from G292: w1.XpWorth - "costs 200" + w2.XpWorth - "100 times" * "3 costs"24
expect max r.Health = 130 from G292: max r.Health + "adds 10 max health" + "adds 10 max health" + "adds 10 max health"25
make g3 Grunt26
deal 10 to g3 from r27
expect r.XP = 250 from G292: w1.XpWorth - "costs 200" + w2.XpWorth - "100 times" * "3 costs" + "50 by default"Run it yourself
ledger check content/cookbook/progress.ledger content/cookbook/progress.play
ledger play content/cookbook/progress.play