sts-term

Une version rudimentaire de Slay The Spire dans le terminal - retour accueil

git clone git://bebou.netlib.re/sts-term
Log | Files | Refs | README |

commit 56c3b26bda326dc06bffed79ec2fb5fefb836673
parent c782d3412d4021358d85e799ebc818602f3073b6
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Fri, 21 Jun 2024 15:03:14 +0200

Ajout heavy blade

Pour que ça fonctionne faut savoir quelle carte on joue donc maintenant
on sait

Diffstat:
Abdd/cards/heavy-blade | 2++
Mutils | 9++++++---
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/bdd/cards/heavy-blade b/bdd/cards/heavy-blade @@ -0,0 +1,2 @@ +_cost 2 +_attack 14 1 diff --git a/utils b/utils @@ -101,7 +101,7 @@ _addcard() { . ./utils $(cat bdd/cards/$name | sed -E '/^_(cost|defend) / s/$/ player/; - /^_(attack|status) / s/$/ "${1:?need a target}" fight\/player/; + /^_(attack|status) / s/$/ "${1:?need a target}" fight\/player "$0"/; /^_exhaust$/ s/$/ "$0"/') _discard "\$0" _refreshUI @@ -167,9 +167,11 @@ _gameover() { _dodamage() { #ffplay -nodisp -autoexit -loglevel panic -i sounds/hit.ogg - damage="$1";target="$2";hitter="$3" + damage="$1";target="$2";hitter="$3";card="$4" targethealth=$(_getstat "$target" health);targetblock=$(_getstat "$target" block) _hasstatus "$hitter" strength && str=$(_getremainingstatusturns "$hitter" strength) || str='0' + echo "using card $card" + echo "$card" | grep -q "heavy-blade" && str=$(( str*3 )) _hasstatus "$hitter" weak && multiplier=0.75 || multiplier=1 _hasstatus "$target" vulnerable && multiplier=$(echo "$multiplier*1.5" | bc -l) echo "($targetblock - ($damage+$str)*$multiplier)/1" @@ -186,9 +188,10 @@ _attack() { times="$2" target="$3" hitter="$4" + card="$5" for i in $(seq $times);do echo _dodamage "$damage" "$target" "$hitter" - _dodamage "$damage" "$target" "$hitter" + _dodamage "$damage" "$target" "$hitter" "$card" done; }