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 061ec1a9002906907539e1d4285bcd6379db4b4a parent 48de2f509dbba54871a20484db149aaa9a79bfb8 Auterice: Arthur Pons <arthur.pons@unistra.fr> Date: Fri, 21 Jun 2024 20:07:47 +0200 Ajout rupture Diffstat:
A | bdd/cards/rupture | | | 2 | ++ |
M | utils | | | 10 | ++++++++-- |
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/bdd/cards/rupture b/bdd/cards/rupture @@ -0,0 +1,2 @@ +_cost 1 +_status rupture 1 player diff --git a/utils b/utils @@ -106,6 +106,7 @@ _addcard() { $(cat bdd/cards/$name | sed -E '/^_(cost|defend) / s/$/ player/; /^_(attack|status) / s/$/ "${1:?need a target}" fight\/player "$0"/; + /^_(heal) / s/$/ "$0"/; /^_exhaust$/ s/$/ "$0"/') _discard "\$0" _refreshUI @@ -261,8 +262,13 @@ _nodraw () { } _heal() { + amount="$1";src="$2" maxhealth=$(_getstat player maxhealth) - newhealth=$(( $(_getstat player health | cut -f2) + $1 )) + [ "$amount" -lt "0" ] \ + && echo "$src" | grep -q "fight/hand" \ + && _hasstatus player rupture && + _strength "1" player + newhealth=$(( $(_getstat player health | cut -f2) + $amount )) echo _setstat fight/player health $(( $newhealth > $maxhealth ? $maxhealth : $newhealth )) _setstat fight/player health $(( $newhealth > $maxhealth ? $maxhealth : $newhealth )) } @@ -362,7 +368,7 @@ _getstatuses() { grep -E '^(de)?bufs ' "$target" | cut -f2- | tr ' ' '\n' | - grep -Ev '(strength|dark-embrace|feel-no-pain|metallicize)' | + grep -Ev '(strength|dark-embrace|feel-no-pain|metallicize|rupture)' | cut -d',' -f1 }