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 666ebf0626ce1cc6799c532de85add23240f5c5a parent 7d851b30c88805cfdbab57ded7dd353552ba5a00 Auterice: Arthur Pons <arthur.pons@unistra.fr> Date: Fri, 21 Jun 2024 23:24:34 +0200 Catégorisation des cartes En jouant me suis rendu compte qu'on me proposait des statuts J'ai donc mieux rangé les cartes et pensé à modifier le code là où c'est nécessaire sauf que j'ai du oublier la moitié des endroits, on verra par la suite C'est pas catastrophique en tout cas Diffstat:
61 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/bdd/cards/infernal-blade b/bdd/cards/infernal-blade @@ -1,12 +0,0 @@ -_cost 1 -find bdd/cards/ -type f | shuf | head -n1 | - while read card;do - n=$(basename "$card") - c=$(grep -E '^_cost' $card | cut -d ' ' -f2) - _addcard 1 $n fight/hand - v=$(find fight/hand -name "$n-*" | sort -r | head -n1) - sed -i -E '/^_cost/ s/[0-9]/0/' "$v" - sed -i -E "$ a\sed -i -E '/^_cost/ s/[0-9]/$c/' fight/discard/$(basename $v)" "$v" - sed -i -E "$ a\sed -i -E '/_refreshUI/ {n;N;d}' fight/discard/$(basename $v)" "$v" - done -_exhaust diff --git a/bdd/cards/anger b/bdd/cards/red/anger diff --git a/bdd/cards/barricade b/bdd/cards/red/barricade diff --git a/bdd/cards/bash b/bdd/cards/red/bash diff --git a/bdd/cards/battle-trance b/bdd/cards/red/battle-trance diff --git a/bdd/cards/berserk b/bdd/cards/red/berserk diff --git a/bdd/cards/blood-for-blood b/bdd/cards/red/blood-for-blood diff --git a/bdd/cards/bloodletting b/bdd/cards/red/bloodletting diff --git a/bdd/cards/bludgeon b/bdd/cards/red/bludgeon diff --git a/bdd/cards/brutality b/bdd/cards/red/brutality diff --git a/bdd/cards/burning-pact b/bdd/cards/red/burning-pact diff --git a/bdd/cards/carnage b/bdd/cards/red/carnage diff --git a/bdd/cards/clothesline b/bdd/cards/red/clothesline diff --git a/bdd/cards/dark-embrace b/bdd/cards/red/dark-embrace diff --git a/bdd/cards/defend b/bdd/cards/red/defend diff --git a/bdd/cards/demon-form b/bdd/cards/red/demon-form diff --git a/bdd/cards/disarm b/bdd/cards/red/disarm diff --git a/bdd/cards/double-tap b/bdd/cards/red/double-tap diff --git a/bdd/cards/dropkick b/bdd/cards/red/dropkick diff --git a/bdd/cards/entrench b/bdd/cards/red/entrench diff --git a/bdd/cards/exhume b/bdd/cards/red/exhume diff --git a/bdd/cards/feed b/bdd/cards/red/feed diff --git a/bdd/cards/feel-no-pain b/bdd/cards/red/feel-no-pain diff --git a/bdd/cards/fiend-fire b/bdd/cards/red/fiend-fire diff --git a/bdd/cards/flame-barrier b/bdd/cards/red/flame-barrier diff --git a/bdd/cards/flex b/bdd/cards/red/flex diff --git a/bdd/cards/ghostly-armor b/bdd/cards/red/ghostly-armor diff --git a/bdd/cards/headbutt b/bdd/cards/red/headbutt diff --git a/bdd/cards/heavy-blade b/bdd/cards/red/heavy-blade diff --git a/bdd/cards/homokinesis b/bdd/cards/red/homokinesis diff --git a/bdd/cards/immolate b/bdd/cards/red/immolate diff --git a/bdd/cards/impervious b/bdd/cards/red/impervious diff --git a/bdd/cards/red/infernal-blade b/bdd/cards/red/infernal-blade @@ -0,0 +1,12 @@ +_cost 1 +find bdd/cards/red -type f | shuf | head -n1 | + while read card;do + n=$(basename "$card") + c=$(grep -E '^_cost' $card | cut -d ' ' -f2) + _addcard 1 $n fight/hand + v=$(find fight/hand -name "$n-*" | sort -r | head -n1) + sed -i -E '/^_cost/ s/[0-9]/0/' "$v" + sed -i -E "$ a\sed -i -E '/^_cost/ s/[0-9]/$c/' fight/discard/$(basename $v)" "$v" + sed -i -E "$ a\sed -i -E '/_refreshUI/ {n;N;d}' fight/discard/$(basename $v)" "$v" + done +_exhaust diff --git a/bdd/cards/inflame b/bdd/cards/red/inflame diff --git a/bdd/cards/iron-wave b/bdd/cards/red/iron-wave diff --git a/bdd/cards/juggernaut b/bdd/cards/red/juggernaut diff --git a/bdd/cards/limit-break b/bdd/cards/red/limit-break diff --git a/bdd/cards/metallicize b/bdd/cards/red/metallicize diff --git a/bdd/cards/offering b/bdd/cards/red/offering diff --git a/bdd/cards/perfected-strike b/bdd/cards/red/perfected-strike diff --git a/bdd/cards/pommel-strike b/bdd/cards/red/pommel-strike diff --git a/bdd/cards/power-through b/bdd/cards/red/power-through diff --git a/bdd/cards/pummel b/bdd/cards/red/pummel diff --git a/bdd/cards/rage b/bdd/cards/red/rage diff --git a/bdd/cards/rampage b/bdd/cards/red/rampage diff --git a/bdd/cards/reaper b/bdd/cards/red/reaper diff --git a/bdd/cards/reckless-charge b/bdd/cards/red/reckless-charge diff --git a/bdd/cards/rupture b/bdd/cards/red/rupture diff --git a/bdd/cards/seeing-red b/bdd/cards/red/seeing-red diff --git a/bdd/cards/sentinel b/bdd/cards/red/sentinel diff --git a/bdd/cards/shrug-it-off b/bdd/cards/red/shrug-it-off diff --git a/bdd/cards/spot-weakness b/bdd/cards/red/spot-weakness diff --git a/bdd/cards/strike b/bdd/cards/red/strike diff --git a/bdd/cards/true-grit b/bdd/cards/red/true-grit diff --git a/bdd/cards/twin-strike b/bdd/cards/red/twin-strike diff --git a/bdd/cards/uppercut b/bdd/cards/red/uppercut diff --git a/bdd/cards/warcry b/bdd/cards/red/warcry diff --git a/bdd/cards/burn b/bdd/cards/statuses/burn diff --git a/bdd/cards/dazed b/bdd/cards/statuses/dazed diff --git a/bdd/cards/wounds b/bdd/cards/statuses/wounds diff --git a/utils b/utils @@ -100,13 +100,14 @@ _addcard() { name="$2" dest="${3:-deck}" nbcard=$(find deck -name "$2-*" | wc -l) + location=$(find bdd/cards -type f -name "$name") for i in $(seq $(( $nbcard + 1 )) $(( $nbcard + $howmuch )));do if [ "$name" = "wounds" ];then cp bdd/cards/$name $dest/$name-$i else <<-. cat > $tmpdir/A . ./utils - $(cat bdd/cards/$name | + $(cat "$location" | sed -E '/^[ ]*_(cost|defend) / s/$/ player/; /^[ ]*_(attack|status) / s/$/ "${1:?need a target}" fight\/player "$0"/; /^[ ]*_(heal) / s/$/ "$0"/; @@ -140,6 +141,7 @@ _killennemie() { echo "end of combat" _hasrelic burning-blood && _heal +6 _wingold + _refreshUI _choosecard _makefight map/$(( $(cat fight/floor) + 1 )) exit 0 @@ -261,7 +263,7 @@ _shufflediscard() { } _choosecard() { - find bdd/cards -type f | + find bdd/cards/red -type f | grep -Ev '(strike|defend|bash)$' | shuf | head -n3 |