-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenter_dungeon
executable file
·59 lines (53 loc) · 1.83 KB
/
enter_dungeon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
if [[ $(ps -ho cmd $$) != *"bash"* ]]; then
echo "Please use bash. No other shells are supported."
elif [ -d "locked" ] || [ -d "cerrado" ]; then
echo "Please delete the dungeon before regenerating it."
echo "You might need to use \`sudo rm -rf locked visited\` because of permissions, be careful."
else
export SHELL_ADVENTURE_SCRIPTS=$PWD/scripts
export SHELL_ADVENTURE_ROOT=$PWD
export SHELL_ADVENTURE_LANG=${LANG:0:2}
alias cd="source $SHELL_ADVENTURE_SCRIPTS/cd"
nim c -o:./scripts/build_dungeon ./scripts/build_dungeon.nim
./scripts/build_dungeon
if [[ $SHELL_ADVENTURE_LANG == "es" ]]; then
sudo chown root:root ./cerrado/una_habitacion_oscura/la_habitacion_de_la_espada/espada
roomlocked="cerrado"
roomstart="entrada"
cmdunavailable="No tienes la fuerza suficiente para usar esto por ahora."
else
sudo chown root:root ./locked/a_dark_room/the_sword_room/sword
roomlocked="locked"
roomstart="entrance"
cmdunavailable="You lack the stregth to use this for now."
fi
alias ls="echo $cmdunavailable"
alias cat="echo $cmdunavailable"
alias less="echo $cmdunavailable"
alias touch="echo $cmdunavailable"
alias vim="echo $cmdunavailable"
alias nano="echo $cmdunavailable"
alias cp="echo $cmdunavailable"
alias ln="echo $cmdunavailable"
alias who="echo $cmdunavailable"
alias whoami="echo $cmdunavailable"
alias mv="echo $cmdunavailable"
alias rm="echo $cmdunavailable"
alias chmod="echo $cmdunavailable"
alias chown="echo $cmdunavailable"
clear
for i in {1..6}; do
sleep .5
echo "o
O *pat*"
sleep .5
echo " o
O *pat*"
done
pushd $roomlocked > /dev/null && \
chmod 111 . && \
pushd $roomstart > /dev/null && \
source $SHELL_ADVENTURE_SCRIPTS/rooms/$roomstart.sh && \
touch $SHELL_ADVENTURE_ROOT/visited/$roomstart
fi