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 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:
Dbdd/cards/infernal-blade | 12------------
Rbdd/cards/anger -> bdd/cards/red/anger | 0
Rbdd/cards/barricade -> bdd/cards/red/barricade | 0
Rbdd/cards/bash -> bdd/cards/red/bash | 0
Rbdd/cards/battle-trance -> bdd/cards/red/battle-trance | 0
Rbdd/cards/berserk -> bdd/cards/red/berserk | 0
Rbdd/cards/blood-for-blood -> bdd/cards/red/blood-for-blood | 0
Rbdd/cards/bloodletting -> bdd/cards/red/bloodletting | 0
Rbdd/cards/bludgeon -> bdd/cards/red/bludgeon | 0
Rbdd/cards/brutality -> bdd/cards/red/brutality | 0
Rbdd/cards/burning-pact -> bdd/cards/red/burning-pact | 0
Rbdd/cards/carnage -> bdd/cards/red/carnage | 0
Rbdd/cards/clothesline -> bdd/cards/red/clothesline | 0
Rbdd/cards/dark-embrace -> bdd/cards/red/dark-embrace | 0
Rbdd/cards/defend -> bdd/cards/red/defend | 0
Rbdd/cards/demon-form -> bdd/cards/red/demon-form | 0
Rbdd/cards/disarm -> bdd/cards/red/disarm | 0
Rbdd/cards/double-tap -> bdd/cards/red/double-tap | 0
Rbdd/cards/dropkick -> bdd/cards/red/dropkick | 0
Rbdd/cards/entrench -> bdd/cards/red/entrench | 0
Rbdd/cards/exhume -> bdd/cards/red/exhume | 0
Rbdd/cards/feed -> bdd/cards/red/feed | 0
Rbdd/cards/feel-no-pain -> bdd/cards/red/feel-no-pain | 0
Rbdd/cards/fiend-fire -> bdd/cards/red/fiend-fire | 0
Rbdd/cards/flame-barrier -> bdd/cards/red/flame-barrier | 0
Rbdd/cards/flex -> bdd/cards/red/flex | 0
Rbdd/cards/ghostly-armor -> bdd/cards/red/ghostly-armor | 0
Rbdd/cards/headbutt -> bdd/cards/red/headbutt | 0
Rbdd/cards/heavy-blade -> bdd/cards/red/heavy-blade | 0
Rbdd/cards/homokinesis -> bdd/cards/red/homokinesis | 0
Rbdd/cards/immolate -> bdd/cards/red/immolate | 0
Rbdd/cards/impervious -> bdd/cards/red/impervious | 0
Abdd/cards/red/infernal-blade | 12++++++++++++
Rbdd/cards/inflame -> bdd/cards/red/inflame | 0
Rbdd/cards/iron-wave -> bdd/cards/red/iron-wave | 0
Rbdd/cards/juggernaut -> bdd/cards/red/juggernaut | 0
Rbdd/cards/limit-break -> bdd/cards/red/limit-break | 0
Rbdd/cards/metallicize -> bdd/cards/red/metallicize | 0
Rbdd/cards/offering -> bdd/cards/red/offering | 0
Rbdd/cards/perfected-strike -> bdd/cards/red/perfected-strike | 0
Rbdd/cards/pommel-strike -> bdd/cards/red/pommel-strike | 0
Rbdd/cards/power-through -> bdd/cards/red/power-through | 0
Rbdd/cards/pummel -> bdd/cards/red/pummel | 0
Rbdd/cards/rage -> bdd/cards/red/rage | 0
Rbdd/cards/rampage -> bdd/cards/red/rampage | 0
Rbdd/cards/reaper -> bdd/cards/red/reaper | 0
Rbdd/cards/reckless-charge -> bdd/cards/red/reckless-charge | 0
Rbdd/cards/rupture -> bdd/cards/red/rupture | 0
Rbdd/cards/seeing-red -> bdd/cards/red/seeing-red | 0
Rbdd/cards/sentinel -> bdd/cards/red/sentinel | 0
Rbdd/cards/shrug-it-off -> bdd/cards/red/shrug-it-off | 0
Rbdd/cards/spot-weakness -> bdd/cards/red/spot-weakness | 0
Rbdd/cards/strike -> bdd/cards/red/strike | 0
Rbdd/cards/true-grit -> bdd/cards/red/true-grit | 0
Rbdd/cards/twin-strike -> bdd/cards/red/twin-strike | 0
Rbdd/cards/uppercut -> bdd/cards/red/uppercut | 0
Rbdd/cards/warcry -> bdd/cards/red/warcry | 0
Rbdd/cards/burn -> bdd/cards/statuses/burn | 0
Rbdd/cards/dazed -> bdd/cards/statuses/dazed | 0
Rbdd/cards/wounds -> bdd/cards/statuses/wounds | 0
Mutils | 6++++--
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 |