-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sh
137 lines (120 loc) · 2.67 KB
/
main.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
clear
if [ ! -f "data.txt" ]
then
touch data.txt
echo -e HUNGER=50 \\nFUN=50 \\nCLEAN=50 > data.txt
fi
if [ ! -f "monster.txt" ]
then
touch monster.txt
echo -e \\nNO MONSTER! EDIT monster.txt TO CREATE YOUR OWN ASCII MONSTER OR DOWNLOAD EL GATITO FROM \\e[94mgithub.com/Skilowi/ElGatito\\e[0m > monster.txt
fi
echo -e "================INSTRUCTION================="
echo -e " Press \\e[92mH\\e[0m to feed your monster,"
echo -e " Press \\e[33mF\\e[0m to play with him,"
echo -e " and \\e[94mC\\e[0m to clean him!!"
sleep 3
clear
source data.txt
LOOP=1
while [ $LOOP -le 2 ]
do
cat monster.txt
echo
echo -en "\e[92m"
cat translations/indicators/hunger.txt | tr '\n' ' ' && #echo -en "Hunger: "
echo -en "\e[0m"
echo $HUNGER
echo -en "\e[33m"
cat translations/indicators/fun.txt | tr '\n' ' ' && #echo -en "Fun: "
echo -en "\e[0m"
echo $FUN
echo -en "\e[94m"
cat translations/indicators/clean.txt | tr '\n' ' ' && #echo -en "Cleanliness: "
echo -en "\e[0m"
echo $CLEAN
echo
if [ $HUNGER -le 30 ]
then
echo -en "\e[31m"
cat translations/warnings/hunger.txt #echo -en "I am hungry!!!"
echo -en "\e[0m"
fi
if [ $FUN -le 30 ]
then
echo -en "\e[31m"
cat translations/warnings/fun.txt #echo -en "Play with me! Please!!!"
echo -en "\e[0m"
fi
if [ $CLEAN -le 30 ]
then
echo -en "\e[31m"
cat translations/warnings/clean.txt #echo -en "I am dirty!!!"
echo -en "\e[0m"
fi
if [ $HUNGER -le -1 ]
then
HUNGER=0
fi
if [ $FUN -le -1 ]
then
FUN=0
fi
if [ $CLEAN -le -1 ]
then
CLEAN=0
fi
#echo
#echo -e Press \\e[92mH\\e[0m to feed your monster!
#echo -e Press \\e[33mF\\e[0m to play with monster!
#echo -e Press \\e[94mC\\e[0m to wash your monster!
echo
if [ $RANDOM -le 900 ]
then
if [ $RANDOM -le 300 ]
then
HUNGER=$((HUNGER-1))
fi
if [ $RANDOM -le 700 ] && [ $RANDOM -gt 300 ]
then
FUN=$((FUN-1))
fi
if [ $RANDOM -ge 701 ]
then
CLEAN=$((CLEAN-1))
fi
fi
input="none"
read -rsn1 -t 1 input
if [ "$input" = "c" ]
then
echo -en "\e[94m"
cat translations/ihavenoideahowtocallthis/clean.txt #echo -en "Cleaning!"
echo -en "\e[0m"
CLEAN=$((CLEAN+1))
sleep 1
fi
if [ "$input" = "h" ]
then
echo -en "\e[92m"
cat translations/ihavenoideahowtocallthis/hunger.txt #echo -en "Feeding!"
echo -en "\e[0m"
HUNGER=$((HUNGER+1))
CLEAN=$((CLEAN-1))
sleep 1
fi
if [ "$input" = "f" ]
then
echo -en "\e[33m"
cat translations/ihavenoideahowtocallthis/fun.txt #echo -en "Lets play!"
echo -en "\e[0m"
FUN=$((FUN+1))
HUNGER=$((HUNGER-1))
CLEAN=$((CLEAN-1))
sleep 1
fi
input="none"
echo -e HUNGER=$HUNGER \\nFUN=$FUN \\nCLEAN=$CLEAN > data.txt
clear
done