Stances
States taken and given up.
v2's cookbook, states taken and given up (G324-G325): two stances, each taking off the other, the one held reading as pressed; and a sprint that drains stamina, ends when its runner is winded, and can't be taken up again until the runner has caught its breath.
1
# v2's cookbook, states taken and given up (G324-G325): two stances, each taking off the other, the one held reading2
# as pressed; and a sprint that drains stamina, ends when its runner is winded, and can't be taken up again until the3
# runner has caught its breath.5
rate 606
stat MaxHealth7
stat Attack8
stat Armor9
stat MaxStamina10
stat StaminaRegen11
pool Health max MaxHealth12
pool Stamina max MaxStamina regen StaminaRegen13
damage Health14
tags Stance16
archetype Soldier17
base MaxHealth 10018
base Attack 10019
base Armor 5020
base MaxStamina 10021
base StaminaRegen 1022
full Health Stamina23
grants TakeDefensive TakeAggressive Sprint25
# ---- G324 a defensive stance, 50 more armour and 30% less attack; an aggressive one, 30% more attack and 20 less26
# armour; taking one takes off the other, and the one held can't be taken again ----28
effect Defensive29
tags Stance30
exclusive Stance31
stack ignore32
Armor + 5033
Attack - 30%35
effect Aggressive36
tags Stance37
exclusive Stance38
stack ignore39
Attack + 30%40
Armor - 2042
ability TakeDefensive43
requires not has(holder, Defensive) else "held"44
apply Defensive to holder46
ability TakeAggressive47
requires not has(holder, Aggressive) else "held"48
apply Aggressive to holder50
# ---- G325 the sprint: 30 off the stamina's 10 a second, so it falls 20 a second; under 5% the runner is winded,51
# which ends the sprint and refuses another until stamina is back to 30%; pressed again, it stops ----53
effect Sprinting54
StaminaRegen - 3056
effect Breathing57
aura Winded on holder while Stamina < 0.05 * holder.MaxStamina until Stamina >= 0.3 * holder.MaxStamina59
effect Winded60
start61
remove Sprinting63
ability Sprint64
requires not has(holder, Winded) else "winded"65
if has(holder, Sprinting)66
remove Sprinting67
else68
apply Sprinting to holder1
catalog stances.ledger2
row G324 Defensive Aggressive TakeDefensive TakeAggressive Soldier3
row G325 Sprinting Breathing Winded Sprint Soldier5
play G324 "Defensive, the soldier has 100 armour and 70 attack, and can't take it again; aggressive, 130 attack and 30 armour, the defensive stance gone"6
make s Soldier7
act s TakeDefensive8
expect s.Armor = 100 from G324: s.Armor + "+50 armor"9
expect s.Attack = 70 from G324: s.Attack * (1 - "30% attack")10
expect s cannot TakeDefensive Requirement11
apply Defensive to s12
expect already13
save14
act s TakeAggressive15
expect s lacks Defensive16
expect s.Attack = 130 from G324: s.Attack * (1 + "+30% attack")17
expect s.Armor = 30 from G324: s.Armor - "20 armor"18
expect s can TakeDefensive20
play G325 "Sprinting, stamina falls 20 a second; just under 5 the runner is winded and stops, can't sprint until stamina is back to 30, 2.5 seconds later; pressed again a sprint stops"21
make s Soldier22
apply Breathing to s23
act s Sprint24
advance 1s25
expect s.Stamina = 80 from G325: s.Stamina - "falls 20 per second" * "advance 1s"26
advance 3.7s27
expect s has Sprinting28
advance 0.1s29
expect s has Winded30
expect s lacks Sprinting31
act s Sprint32
expect refused Requirement "winded"33
save34
advance 2.4s35
expect s has Winded36
advance 0.2s37
expect s lacks Winded38
act s Sprint39
advance 0.5s40
expect s has Sprinting41
act s Sprint42
expect s lacks SprintingRun it yourself
ledger check content/cookbook/stances.ledger content/cookbook/stances.play
ledger play content/cookbook/stances.play