Kristofer Rumeau 05/02

This commit is contained in:
FaycoTLS 2024-02-05 16:15:13 +01:00
parent f2f3515550
commit 02da0c339e
28 changed files with 110 additions and 20 deletions

View File

@ -17,22 +17,40 @@ ME="${0##*/}"
################################################################### ###################################################################
### CREER VOTRE PROPRE VERSION DU JEU ### CREER VOTRE PROPRE VERSION DU JEU
### CHOISIR SCENARIO ### CHOISIR SCENARIO
################################################################### ###################################################################
if hash uuidgen 2>/dev/null; then if hash uuidgen 2>/dev/null; then
homefolder=$(pwd) homefolder=$(pwd)
newplayer=$(uuidgen) newplayer=$(uuidgen)
## Copy Player Game Files ## Copy Player Game Files
mkdir -p $HOME/.zen/adventure/$newplayer mkdir -p "$HOME/.zen/adventure/$newplayer"
cp -r $MY_PATH/rooms $HOME/.zen/adventure/$newplayer/rooms if [ -d "$MY_PATH/rooms" ]; then
cp -r $MY_PATH/art $HOME/.zen/adventure/$newplayer/art cp -r "$MY_PATH/rooms" "$HOME/.zen/adventure/$newplayer/"
cp -r $MY_PATH/script $HOME/.zen/adventure/$newplayer/script else
cp -r $MY_PATH/logic $HOME/.zen/adventure/$newplayer/logic echo "Source directory $MY_PATH/rooms does not exist or is not a directory."
fi
if [ -d "$MY_PATH/art" ]; then
cp -r "$MY_PATH/art" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/art does not exist or is not a directory."
fi
if [ -d "$MY_PATH/script" ]; then
cp -r "$MY_PATH/script" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/script does not exist or is not a directory."
fi
if [ -d "$MY_PATH/logic" ]; then
cp -r "$MY_PATH/logic" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/logic does not exist or is not a directory."
fi
fi fi
################################################################### ###################################################################
echo "Loading..." echo "Loading..."
echo echo
sleep 4
################################################################### ###################################################################
if hash uuidgen 2>/dev/null; then if hash uuidgen 2>/dev/null; then
cd $HOME/.zen/adventure/$newplayer/rooms cd $HOME/.zen/adventure/$newplayer/rooms
@ -46,4 +64,4 @@ if hash uuidgen 2>/dev/null; then
rm -r $HOME/.zen/adventure/$newplayer rm -r $HOME/.zen/adventure/$newplayer
fi fi
echo "To continue..." echo "To continue..."
exit exit

View File

@ -0,0 +1,67 @@
#!/bin/bash
###################################################################
# This Launch script is based on BashVenture.
#
# Remember, kids - sharing is caring! Keep it open. Spread the love.
# - @BenNunney
# Thanks and gratitude to all living creatures and the whole creation.
# - @Fred
# $AGE×365,25×24×60×60×9,807÷299792458 = RELATIVE LIGHT GRAVITY SPEED
###################################################################
# Guide avancé d'écriture des scripts Bash : https://abs.traduc.org/abs-fr/
# GAMESHELL : https://github.com/phyver/GameShell/
###################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
###################################################################
### CREER VOTRE PROPRE VERSION DU JEU
### CHOISIR SCENARIO
###################################################################
if hash uuidgen 2>/dev/null; then
homefolder=$(pwd)
newplayer=$(uuidgen)
## Copy Player Game Files
mkdir -p "$HOME/.zen/adventure/$newplayer"
if [ -d "$MY_PATH/rooms" ]; then
cp -r "$MY_PATH/rooms" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/rooms does not exist or is not a directory."
fi
if [ -d "$MY_PATH/art" ]; then
cp -r "$MY_PATH/art" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/art does not exist or is not a directory."
fi
if [ -d "$MY_PATH/script" ]; then
cp -r "$MY_PATH/script" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/script does not exist or is not a directory."
fi
if [ -d "$MY_PATH/logic" ]; then
cp -r "$MY_PATH/logic" "$HOME/.zen/adventure/$newplayer/"
else
echo "Source directory $MY_PATH/logic does not exist or is not a directory."
fi
fi
###################################################################
echo "Loading..."
echo
###################################################################
if hash uuidgen 2>/dev/null; then
cd $HOME/.zen/adventure/$newplayer/rooms
else
cd rooms
fi
./start.sh
###################################################################
if hash uuidgen 2>/dev/null; then
cd "$homefolder"
rm -r $HOME/.zen/adventure/$newplayer
fi
echo "To continue..."
exit

View File

@ -1,13 +1,17 @@
#!/bin/bash #!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
clear clear
# Initialise the Title Art # Initialise the Title Art
file1="../art/titleart.ben" file1="$MY_PATH/../art/titleart.ben"
while IFS= read -r line while IFS= read -r line
do do
echo "$line" echo "$line"
done <"$file1" done <"$file1"
echo echo
sleep 1
# Here's this room's script. # Here's this room's script.
@ -21,7 +25,7 @@ echo "Il ressemble à une grosse calculatrice"
# Here we tell the player whether the lever is on or off. # Here we tell the player whether the lever is on or off.
leverstate=`cat ../logic/leverlogic.ben` leverstate=$(cat $MY_PATH/../logic/leverlogic.ben)
if [ "$leverstate" = "on" ]; then if [ "$leverstate" = "on" ]; then
echo "'VISA SVP' clignote sur l'écran..." echo "'VISA SVP' clignote sur l'écran..."
else else
@ -42,13 +46,11 @@ while true; do
s ) echo "Si vous continuez à marcher dans la forêt. Vous allez vous perdre. Demi tour." ;; s ) echo "Si vous continuez à marcher dans la forêt. Vous allez vous perdre. Demi tour." ;;
e ) echo "Le chemin qui part à l'Est est plein de boue... Impossble d'aller par là." ;; e ) echo "Le chemin qui part à l'Est est plein de boue... Impossble d'aller par là." ;;
w ) echo "Une rivière vous empêche de passer." ;; w ) echo "Une rivière vous empêche de passer." ;;
u ) leverstate=`cat ../logic/leverlogic.ben` u ) if [ "$leverstate" = "on" ]; then
if [ "$leverstate" = "on" ]; then
echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'." echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'."
else else
sed -i='' 's/off/on/' ../logic/leverlogic.ben sed -i 's/off/on/' $MY_PATH/../logic/leverlogic.ben
echo "Vous pianotez sur l'appareil..." echo "Vous pianotez sur l'appareil..."
sleep 3
echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..." echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..."
echo "Puis le message 'ACTIVATION STATION' défile sur les caractères lumineux." echo "Puis le message 'ACTIVATION STATION' défile sur les caractères lumineux."
fi fi

View File

@ -1,16 +1,20 @@
#!/bin/bash #!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
clear clear
# Logic in the game is stored in .ben files. This sample has just one 'logic' file. # Logic in the game is stored in .ben files. This sample has just one 'logic' file.
# You can add more logic files by simply adding a 'sed' command and appropriate .ben file. # You can add more logic files by simply adding a 'sed' command and appropriate .ben file.
# First off, let us reset the game logic. Use this as an example. # First off, let us reset the game logic. Use this as an example.
sed -i='' 's/on/off/' ../logic/leverlogic.ben sed -i '' 's/on/off/' ../logic/leverlogic.ben
# Who doen't love ASCII text, right? # Who doen't love ASCII text, right?
# Next up, let's initialise the Title Art # Next up, let's initialise the Title Art
file1="../art/titleart.ben" file1="$MY_PATH/../art/titleart.ben"
while IFS= read -r line while IFS= read -r line
do do
echo "$line" echo "$line"
@ -18,8 +22,7 @@ done <"$file1"
echo echo
# Next up, let's load in the initial introduction. Script is also stored in .ben files. # Next up, let's load in the initial introduction. Script is also stored in .ben files.
sleep 5 file2="$MY_PATH/../script/opening.ben"
file2="../script/opening.ben"
while IFS= read -r line while IFS= read -r line
do do
echo "$line" echo "$line"

View File

@ -46,7 +46,7 @@ while true; do
if [ "$leverstate" = "on" ]; then if [ "$leverstate" = "on" ]; then
echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'." echo "A chaque frappe d'une touche. l'écran fait défiler le texte 'SCANNEZ VISA SVP'."
else else
sed -i='' 's/off/on/' ../logic/leverlogic.ben sed -i '' 's/off/on/' ../logic/leverlogic.ben
echo "Vous pianotez sur l'appareil..." echo "Vous pianotez sur l'appareil..."
sleep 3 sleep 3
echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..." echo "A moment où vous touchez la touche '#' L'écran se met à clignoter..."