-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbug_loadgame
144 lines (144 loc) · 5.9 KB
/
bug_loadgame
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
138
139
140
141
142
143
144
+ VERSION='1.4 LEGACY'
+ WEBURL=http://sigg3.net/biamin/
+ GAMEDIR=/home/sigg3/.biamin
+ unset HISTFILE
+ START_LOCATION=C2
+ DISABLE_CHEATS=0
+ REPO_EDITION=legacy
+ HR='- ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ '
+ case "$1" in
+ echo 'Launching Back in a Minute..'
+ [[ ! -d /home/sigg3/.biamin ]]
+ [[ ! -f /home/sigg3/.biamin/config ]]
+ echo 'Putting on the traveller'\''s boots..'
+ read -r GAMEDIR COLOR
++ awk '{ if (/^GAMEDIR:/) { GAMEDIR= $2 }
if (/^COLOR:/) { COLOR = $2 } }
END { print GAMEDIR " " COLOR ;}' /home/sigg3/.biamin/config
+ case "$COLOR" in
+ echo 'Enabling color for maps!'
+ (( COLOR == 1 ))
+ YELLOW='\033[1;33m'
+ RESET='\033[0m'
+ trap CleanUp SIGHUP SIGINT SIGTERM
+ SetupHighscore
+ HIGHSCORE=/home/sigg3/.biamin/highscore
+ [[ -f /home/sigg3/.biamin/highscore ]]
+ grep -q d41d8cd98f00b204e9800998ecf8427e /home/sigg3/.biamin/highscore
+ MainMenu
+ true
+ GX_Banner
+ GX_BiaminTitle
+ clear
+ cat
+ cat
+ echo '- ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ '
+ read -sn 1 -p ' (P)lay (L)oad game (H)ighscore (C)redits (Q)uit' TOPMENU_OPT
(P)lay (L)oad game (H)ighscore (C)redits (Q)uit+ case "$TOPMENU_OPT" in
+ LoadGame
+ local i=0
++ find /home/sigg3/.biamin/ -name '*.sheet'
++ xargs ls -t
+ for loadSHEET in '$(find "$GAMEDIR"/ -name '\''*.sheet'\'' | xargs ls -t)'
+ SHEETS[((++i))]=debug
+ for loadSHEET in '$(find "$GAMEDIR"/ -name '\''*.sheet'\'' | xargs ls -t)'
+ SHEETS[((++i))]=biamin.sh
+ for loadSHEET in '$(find "$GAMEDIR"/ -name '\''*.sheet'\'' | xargs ls -t)'
+ SHEETS[((++i))]=archive
+ [[ ! -n debug biamin.sh archive ]]
+ local LIMIT=9
+ local OFFSET=0
+ true
+ GX_LoadGame
+ clear
+ cat
+ echo '- ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ '
+ (( a=1 ))
+ (( a <= LIMIT ))
+ [[ ! -n debug ]]
+ awk '{ # Character can consist from two and more words - not only "Corum" but "Corum Jhaelen Irsei" for instance
if (/^CHARACTER:/) { RLENGTH = match($0,/: /);
CHARACTER = substr($0, RLENGTH+2); }
if (/^RACE:/) { if ($2 == 1 ) { RACE="Human"; }
if ($2 == 2 ) { RACE="Elf"; }
if ($2 == 3 ) { RACE="Dwarf"; }
if ($2 == 4 ) { RACE="Hobbit";}
}
if (/^LOCATION:/) { LOCATION = $2 }
if (/^HEALTH:/) { HEALTH = $2 }
if (/^ITEMS:/) { ITEMS = $2 }
if (/^EXPERIENCE:/) { EXPERIENCE = $2 }
}
END {
print " "1 ". \"" CHARACTER "\" the " RACE " (" HEALTH " HP, " EXPERIENCE " EXP, " ITEMS " items, sector " LOCATION ")"
}' debug
+ (( a++ ))
+ (( a <= LIMIT ))
+ [[ ! -n biamin.sh ]]
+ awk '{ # Character can consist from two and more words - not only "Corum" but "Corum Jhaelen Irsei" for instance
if (/^CHARACTER:/) { RLENGTH = match($0,/: /);
CHARACTER = substr($0, RLENGTH+2); }
if (/^RACE:/) { if ($2 == 1 ) { RACE="Human"; }
if ($2 == 2 ) { RACE="Elf"; }
if ($2 == 3 ) { RACE="Dwarf"; }
if ($2 == 4 ) { RACE="Hobbit";}
}
if (/^LOCATION:/) { LOCATION = $2 }
if (/^HEALTH:/) { HEALTH = $2 }
if (/^ITEMS:/) { ITEMS = $2 }
if (/^EXPERIENCE:/) { EXPERIENCE = $2 }
}
END {
print " "2 ". \"" CHARACTER "\" the " RACE " (" HEALTH " HP, " EXPERIENCE " EXP, " ITEMS " items, sector " LOCATION ")"
}' biamin.sh
+ (( a++ ))
+ (( a <= LIMIT ))
+ [[ ! -n archive ]]
+ awk '{ # Character can consist from two and more words - not only "Corum" but "Corum Jhaelen Irsei" for instance
if (/^CHARACTER:/) { RLENGTH = match($0,/: /);
CHARACTER = substr($0, RLENGTH+2); }
if (/^RACE:/) { if ($2 == 1 ) { RACE="Human"; }
if ($2 == 2 ) { RACE="Elf"; }
if ($2 == 3 ) { RACE="Dwarf"; }
if ($2 == 4 ) { RACE="Hobbit";}
}
if (/^LOCATION:/) { LOCATION = $2 }
if (/^HEALTH:/) { HEALTH = $2 }
if (/^ITEMS:/) { ITEMS = $2 }
if (/^EXPERIENCE:/) { EXPERIENCE = $2 }
}
END {
print " "3 ". \"" CHARACTER "\" the " RACE " (" HEALTH " HP, " EXPERIENCE " EXP, " ITEMS " items, sector " LOCATION ")"
}' archive
awk: warning: command line argument `archive' is a directory: skipped
+ (( a++ ))
+ (( a <= LIMIT ))
+ [[ ! -n '' ]]
+ break
+ (( i > LIMIT ))
+ echo -e '\n Enter NUMBER of character to load or any letter to return to (M)ain Menu: '
+ read -sn 1 NUM
+ case "$NUM" in
+ NUM=0
+ break
+ [[ ! -n '' ]]
+ unset NUM SHEETS i
+ return 1
+ true
+ GX_Banner
+ GX_BiaminTitle
+ clear
+ cat
+ cat
+ echo '- ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ '
+ read -sn 1 -p ' (P)lay (L)oad game (H)ighscore (C)redits (Q)uit' TOPMENU_OPT
(P)lay (L)oad game (H)ighscore (C)redits (Q)uit+ case "$TOPMENU_OPT" in
+ CleanUp
+ GX_BiaminTitle
+ clear
+ cat
+ echo -e '\n- ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ '
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo -e '\nLeaving the realm of magic behind ....\nPlease submit bugs and feedback at <http://sigg3.net/biamin/>'
+ exit 0