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 |

makeplayer (547B)


      1 #! /bin/sh
      2 
      3 addcard() {
      4 	nbcard=$(find deck -name "$2-*" | wc -l)
      5 	[ "$nbcard" = '0' ] && count=1 || count=$nbcard
      6 	for i in $(seq $count $(( $count + $1 - 1)));do
      7 		cp bdd/cards/$2 deck/$2-$i
      8 		cp bdd/cards/$2 stack/$2-$i
      9 	done
     10 }
     11 
     12 addrelic() {
     13 	cp bdd/relics/$1 relic/$1
     14 }
     15 
     16 mkdir -p deck relics discard stack hand
     17 
     18 c=$(./pickrandom characters)
     19 < $c grep -Ev "(deck|relic)" > player
     20 < $c grep deck |
     21 	cut -f2- |
     22 	tr '	' '\n' |
     23 	uniq -c |
     24 	while read line;do
     25 		addcard $line
     26 	done
     27 < $c grep relic |
     28 	cut -f2- |
     29 	xargs -I{} cp bdd/relics/{} relics
     30