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 3a3935149ef9595f5bcb7db6a214abf92747dd47
parent bfabb1a6eec4ad5841eac25a6e64f9089ae392aa
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Fri, 21 Jun 2024 18:34:41 +0200

Ajout flame-barrier

Diffstat:
Abdd/cards/flame-barrier | 3+++
Mutils | 9++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/bdd/cards/flame-barrier b/bdd/cards/flame-barrier @@ -0,0 +1,3 @@ +_cost 2 +_defend 12 +_status flame-barrier 4 player diff --git a/utils b/utils @@ -176,8 +176,13 @@ _decrbfbcost() { _dodamage() { #ffplay -nodisp -autoexit -loglevel panic -i sounds/hit.ogg + local damage target hitter card targetblock targethealth newblock str; damage="$1";target="$2";hitter="$3";card="$4" echo "$target" | grep -q "player" && _decrbfbcost + $(echo "$target" | grep -q "player") && $(echo "$hitter" | grep -vq "player") && $(_hasstatus player flame-barrier) && { + echo returning damage : _dodamage $(_getremainingstatusturns player flame-barrier) "$hitter" player; + _dodamage $(_getremainingstatusturns player flame-barrier) "$hitter" player; } + echo "$target" | grep -q "player" && _decrbfbcost targethealth=$(_getstat "$target" health);targetblock=$(_getstat "$target" block) _hasstatus "$hitter" strength && str=$(_getremainingstatusturns "$hitter" strength) || str='0' echo "using card $card" @@ -189,7 +194,8 @@ _dodamage() { # Si la quantité de block qui reste est négative c'est qu'on prend cette # quantité de dégât # On remet le block à 0 - [ "$newblock" -lt '0' ] && { _changestat "$target" health $newblock;newblock=0 ; } + [ "$newblock" -lt '0' ] && { echo _changestat "$target" health $newblock;_changestat "$target" health $newblock;newblock=0 ; } + echo _setstat "$target" block "$newblock" _setstat "$target" block "$newblock" } @@ -278,6 +284,7 @@ endturn() { _removestatus player strength-down fi _decreasestatuses + _removestatus player flame-barrier _nextmove _newhand echo "$(( $(cat fight/turn) + 1 ))" > fight/turn