From 0bfa38773be26ce8fdc6e29ebd2c5912324c8dcc Mon Sep 17 00:00:00 2001 From: Vansxur Date: Mon, 5 Feb 2024 12:20:17 +0100 Subject: [PATCH] [Feat] new lever --- .../logic/leverlogictwo.ben | 1 + .../logic/leverlogictwo.ben= | 1 + .../games/tom.vanschendel@ynov.com/read.me | 1 + .../tom.vanschendel@ynov.com/rooms/brown.sh | 3 +- .../tom.vanschendel@ynov.com/rooms/end.sh | 1 + .../tom.vanschendel@ynov.com/rooms/purple.sh | 51 +++++++++++++++++++ .../tom.vanschendel@ynov.com/rooms/start.sh | 1 + 7 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben create mode 100644 adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben= create mode 100644 adventure/games/tom.vanschendel@ynov.com/read.me create mode 100755 adventure/games/tom.vanschendel@ynov.com/rooms/purple.sh diff --git a/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben b/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben new file mode 100644 index 00000000..e8fd9030 --- /dev/null +++ b/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben @@ -0,0 +1 @@ +on \ No newline at end of file diff --git a/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben= b/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben= new file mode 100644 index 00000000..b5a9a3b3 --- /dev/null +++ b/adventure/games/tom.vanschendel@ynov.com/logic/leverlogictwo.ben= @@ -0,0 +1 @@ +off \ No newline at end of file diff --git a/adventure/games/tom.vanschendel@ynov.com/read.me b/adventure/games/tom.vanschendel@ynov.com/read.me new file mode 100644 index 00000000..de341b6c --- /dev/null +++ b/adventure/games/tom.vanschendel@ynov.com/read.me @@ -0,0 +1 @@ +Ce jeu a été créé par Tom Van Schendel :) \ No newline at end of file diff --git a/adventure/games/tom.vanschendel@ynov.com/rooms/brown.sh b/adventure/games/tom.vanschendel@ynov.com/rooms/brown.sh index 673e5d43..5bca58f7 100755 --- a/adventure/games/tom.vanschendel@ynov.com/rooms/brown.sh +++ b/adventure/games/tom.vanschendel@ynov.com/rooms/brown.sh @@ -39,7 +39,8 @@ while true; do case $nsewuh in n ) ./mainroom.sh exit ;; - s ) echo "Si vous continuez à marcher dans la forêt. Vous allez vous perdre. Demi tour." ;; + s ) ./purple.sh + exit ;; 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." ;; u ) leverstate=`cat ../logic/leverlogic.ben` diff --git a/adventure/games/tom.vanschendel@ynov.com/rooms/end.sh b/adventure/games/tom.vanschendel@ynov.com/rooms/end.sh index 5a84c0bd..125647ee 100755 --- a/adventure/games/tom.vanschendel@ynov.com/rooms/end.sh +++ b/adventure/games/tom.vanschendel@ynov.com/rooms/end.sh @@ -6,6 +6,7 @@ clear # Let's reset the lever, now that we're done with it. sed -i='' 's/on/off/' ../logic/leverlogic.ben +sed -i='' 's/on/off/' ../logic/leverlogictwo.ben # Initialise the Title Art file1="../art/titleart.ben" diff --git a/adventure/games/tom.vanschendel@ynov.com/rooms/purple.sh b/adventure/games/tom.vanschendel@ynov.com/rooms/purple.sh new file mode 100755 index 00000000..83402ab9 --- /dev/null +++ b/adventure/games/tom.vanschendel@ynov.com/rooms/purple.sh @@ -0,0 +1,51 @@ +#!/bin/bash +clear +# Initialise the Title Art +file1="../art/titleart.ben" +while IFS= read -r line +do + echo "$line" +done <"$file1" +echo +sleep 1 + +# Here's this room's script. + +echo "Vous vous enfoncez dans la foret. Le chemin est étroit et sinueux." +echo "Vous entendez des bruits d'animaux dans les buissons." +echo "Il y a un nouveau levier devant vous sur un poteau." + +# Here we tell the player whether the lever is on or off. +levertwostate=`cat ../logic/leverlogictwo.ben` + if [ "$leverstatewo" = "on" ]; then + echo "Le levier est en position ON." + else + echo "Le levier est en position OFF." + fi +echo +echo "Que faites vous?" + +# In this set of actons lies the logic switch used later in the game. +# You have to set this switch to reach the endgame. +while true; do + read -p "> " nsewuh + case $nsewuh in + n ) ./brown.sh + exit ;; + s ) echo "Si vous continuez à marcher dans la forêt. Vous allez vous perdre. Demi tour." ;; + e ) echo "Le chemin à l'est n'est pas accessible, les arbres vous empêche de passer..." ;; + w ) echo "Une rivière vous empêche de passer." ;; + u ) levertwostate=`cat ../logic/leverlogictwo.ben` + if [ "$levertwostate" = "on" ]; then + echo "Le levier est déjà en position ON, impossible de l'abbaisser maintenant..." + else + sed -i='' 's/off/on/' ../logic/leverlogictwo.ben + echo "Vous relevez le levier en position ON en forcant un peu." + fi + ;; + * ) echo "Je suis désolé, je ne vous comprends pas. Les commandes sont : n, e, s, w et u..";; + esac +done + +esac +exit diff --git a/adventure/games/tom.vanschendel@ynov.com/rooms/start.sh b/adventure/games/tom.vanschendel@ynov.com/rooms/start.sh index bd214979..d245a104 100755 --- a/adventure/games/tom.vanschendel@ynov.com/rooms/start.sh +++ b/adventure/games/tom.vanschendel@ynov.com/rooms/start.sh @@ -7,6 +7,7 @@ clear # 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/leverlogictwo.ben # Who doen't love ASCII text, right? # Next up, let's initialise the Title Art