39f8594ab8b2a692d617d3ca58e95426ab1eda6f
[ztornado.git] / draw.inf
1 ! Z-Tornado - Two player weather action game
2 !
3 ! Tornado is copyright (C) 2000-2002  Oliver Feiler
4 ! http://www.lionking.org/~kiza/linux/tornado
5 ! Inform version copyright (c) 2003  Sophie Frühling (sfruehling@aon.at)
6
7 ! This program is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU General Public License as published by
9 ! the Free Software Foundation; either version 3 of the License, or
10 ! (at your option) any later version.
11 !
12 ! This program is distributed in the hope that it will be useful,
13 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ! GNU General Public License for more details.
16 !
17 ! You should have received a copy of the GNU General Public License
18 ! along with this program; if not, write to the Free Software
19 ! Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21 ! Grafix except weather
22
23 [ DrawSnowWorld  i;
24   @set_cursor 5 1;
25   for (i = 0: i < fields: i++) {
26     print (char) snow_world->i;
27     if (i && i%screen_width == 0) new_line;
28   }
29 ];
30
31 [ DrawUserInterface  x;
32   x = dialog_x - 2;
33   @set_cursor  6 x; print ",___________________________________,";
34   @set_cursor  7 x; print "|            Z - Tornado            |";
35   @set_cursor  8 x; print "|  s = Snow               r = Rain  |";
36   @set_cursor  9 x; print "|  h = Hail          l = Lightning  |";
37   @set_cursor 10 x; print "|  t = Tornado  c = Current Scores  |";
38   @set_cursor 11 x; print "|  q = Quit         o = Highscores  |";
39   @set_cursor 12 x; print "+-----------------------------------+";   
40   @set_cursor screen_height 1;
41 ];
42
43 [ ClearUserInterface  x y;
44   x = dialog_x - 2;
45   for (y = 6: y <= 12: y++) {
46     @set_cursor y x; spaces (37);
47   }
48 ];
49
50 [ DrawDialogWindow  x;
51   x = dialog_x - 2;
52   @set_cursor  6 x; print ",___________________________________,";
53   @set_cursor  7 x; print "|                                   |";
54   @set_cursor  8 x; print "|                                   |";
55   @set_cursor  9 x; print "|                                   |";
56   @set_cursor 10 x; print "|                                   |";
57   @set_cursor 11 x; print "+-----------------------------------+";
58 ];
59
60 [ ClearDialogWindow  x y;
61   x = dialog_x - 2; y = 6;
62   for (y = 6: y <= 11: y++) {
63     @set_cursor y x; spaces (37);
64   }
65 ];  
66
67 [ DrawStatusLine  x y;
68   y = screen_height;
69   @set_cursor y 1;
70   PrintPlayerName(player1, player1_name);
71   x = screen_width/2 - 13;
72   @set_cursor y x;
73   if (player1_left < 100) print " ";
74   if (player1_left < 10) print " ";
75   print player1_left; print "%";
76   print " | Windspeed: ";
77   if (windspeed >= 0) print " ";
78   print windspeed; print " | ";
79   if (player2_left < 100) print " ";
80   if (player2_left < 10) print " ";
81   print player2_left; print "%";
82   x = screen_width - 16;
83   @set_cursor y x;
84   PrintPlayerName(player2, player2_name);
85   @set_cursor screen_height 1;
86 ];
87
88 [ PrintPlayerName current_player the_array  i;
89   if (current_player) print "*";
90   else print " ";
91   for (i = 2: i <= the_array->1 + 1: i++)
92     print (char) the_array->i;
93 ];
94
95 [ DrawCurrentScores  x;
96   x = dialog_x - 1;
97   DrawDialogWindow();
98   @set_cursor 7 x;
99   PrintPlayerName(0, player1_name);
100   @set_cursor 8 dialog_x;
101   print (longnr) player1_score;
102   @set_cursor 9 x;
103   PrintPlayerName(0, player2_name);
104   @set_cursor 10 dialog_x;
105   print (longnr) player2_score;
106 ];
107
108 [ DrawHighScores  x y;
109   x = dialog_x - 2;
110   @set_cursor 5 x; print ",___________________________________,";
111   @set_cursor 6 x; print "|             Highscores            |";
112   for (y = 7: y < 17: y++) {
113     x = dialog_x - 2;
114     @set_cursor y x; print "|";
115     @set_cursor y dialog_x;
116     PrintHighScoreName(y - 7);
117     x = dialog_x + 26;
118     @set_cursor y x;
119     PrintHighScoreNumber(y - 7);
120     x = dialog_x + 34;
121     @set_cursor y x; print "|";
122   }
123   x = dialog_x - 2;
124   @set_cursor 17 x; print "+-----------------------------------+";   
125 ];
126
127 [ ClearHighScoreWindow  x y;
128   x = dialog_x - 2;
129   for (y = 5: y <= 17: y++) {
130     @set_cursor y x;
131     spaces (37);
132   }       
133 ];
134
135 [ DrawWinningScreen  x;
136   x = dialog_x + 9;
137   @set_cursor 7 x; print "Player ";
138   if (player1_left) print 1; else print 2;
139   print " wins!";
140   x = dialog_x + 8;
141   @set_cursor 8 x; print "Your score is ";
142   if (player1_left) print (longnr) player1_score;
143   else print (longnr) player2_score;
144   print ".";
145   x = dialog_x + 3;
146   @set_cursor 9 x; print "Do you want to play again?";
147   x = dialog_x + 13;
148   @set_cursor 10 x; print "(y/n)";
149   @set_cursor screen_height 1;
150 ];
151
152 ! ----------- Extra-game information ---------------
153
154 [ InfoTitle x;
155   @split_window 1; @set_window 1;
156   @set_cursor 1 1; style reverse;
157   spaces (0->33); x = (0->33)/2 - 10;
158   @set_cursor 1 x;
159   print "Z - T O R N A D O";
160   style roman; @set_window 0;
161 ];
162
163 [ About;
164   @erase_window -1;
165   InfoTitle();
166   print "^^This is a fairly straight port of the C version of ~Tornado~,",
167         " release 1.2, written by Oliver Feiler and Rene Puls in or about",
168         " 2000, which in turn appears to be the port of a C64 game of the",
169         " same name.^^";
170   print "The screen is something between 64 and 80 by 24, instead of 80 x 25.",
171         " There is, of course, no network support, and no demo version. (But",
172         " you can emulate the latter by having the computer play against",
173         " itself. See (I)nstructions for details.)^";
174   print "Apart from that, it should work just like the C version, except that",
175         " it is a little slower, because I can't pause the game for less than",
176         " 1/10 of a second.^^";
177   print "Release 2 features a few cosmetic changes -- it now puts the cursor",
178         " outside the playfield while drawing the weather, which looks a lot",
179         " better -- and bugfixes: most importantly, the tornado used to erase",
180         " completely wrong stuff; there were also a few bugs that crept up when",
181         " piling up snow too high.^^";
182   print "Z-Tornado was written using Inform (http://www.inform-fiction.org),",
183         " and mainly tested on Unix Frotz 2.43.^^";
184   print "Thanks to Kevin Bracey (SameGame.inf), Torbj@:orn Andersson (robots.",
185         "inf) and Julian Arnold (z-life.inf) for inspiration and",
186         " encouragement. (To quote from ~SameGame.inf~, ~Anyone looking at",
187         " this source file for inspiration probably needs their head",
188         " examined.~) Thank you. ;) There are numerous other Z-Machine abuse",
189         " source files, but these were the ones I looked at.^^";
190   print "Thanks to Jim Fisher (http://www.onyxring.org) for the tip on",
191         " randomising random().^^";
192   print "Since the original code was released under GPL, this game is",
193         " released under GPL as well, which means there is ABSOLUTELY NO",
194         " WARRANTY OF ANY KIND, and you can get the messy source code,",
195         " too, from the games/source/inform directory of http://www.",
196         "ifarchive.org or (preferably) one of its mirrors.^^";
197   print "For more information about ~Tornado~, have a look at the webpage at",
198         " http://www.lionking.org/@@126kiza/linux/tornado/.^^";
199   print "[Hit any key]^";
200   Read();
201 ];
202
203 ! This is pretty much copy + paste from the man page, plus some more
204 [ Instructions;
205   @erase_window -1;
206   InfoTitle();
207   print "^From the "; style bold; print "Tornado"; style roman;
208   print " man page:^^";
209   print "~The object of the game "; style bold; print "tornado"; style roman;
210   print " is to destroy your opponent's house with the powers of rain, snow,",
211         " hail, lightning and the tornado.^^"; 
212   print "~After the game is started the two players enter their names. If you",
213         " leave the field blank the computer will take the player's part. You",
214         " can see two houses with each player's name in the corner below it and",
215         " a cloud on top of the screen, the sky. The player whose turn it is",
216         " has an asterisk "; style bold; print "*"; style roman;
217   print " next to his name.^^";
218   print "~From the menu in the center of the screen each player now picks a",
219         " weather phenomenon. A second box will appear where you can enter",
220         " the aim you would like to use. You may have noticed the value ";
221   style underline; print "Windspeed"; style roman;
222   print " in the mid bottom of the screen by now. Ideally you would take aim ";
223   style bold; print "2"; style roman;
224   print " if windspeed is "; style bold; print "-2"; style roman;
225   print " for example and then your rain/hail/snow/tornado would go straight",
226         " down the cloud. However, it's chosen randomly if the rain appears on",
227         " the left side of the cloud or the right side, so aiming might be not",
228         " that easy as it looks like.^^";
229   print "~If you hit your opponent's house (or your own) the percentage counter",
230         " will decrease depending on how much damage you did. If the counter is",
231         " down to "; style bold; print "0%"; style roman;
232   print " the player loses the game.^^";
233   print "~The keys you can use in the game are:^";
234   style bold; print "s"; style roman; print "  selects snow^";
235   print "      Snow is a defensive weapon. If you hit a house with^",
236         "      snow, it creates a coating that hail cannot destroy.^",
237         "      Only rain can be used to destroy that layer of snow.^",
238         "      Lightning and tornado are not effected.^";
239   style bold; print "r"; style roman; print "  selects rain^";
240   print "      Destroys one row of the house. Can be used to melt a^",
241         "      row of snow.^";
242   style bold; print "h"; style roman; print "  selects hail^";
243   print "      This will destroy two rows of the house, but cannot^",
244         "      destroy a snow coating.^";
245   style bold; print "l"; style roman; print "  selects lightning^";
246   print "      Splits the house into two pieces. Not influenced by^",
247         "      wind.^";
248   style bold; print "t"; style roman; print "  selects tornado^";
249   print "      Not as effective as lightning but the tornado goes^",
250         "      straight to the bottom of the house as well.^";
251   style bold; print "q"; style roman; print "  quits the game^";
252   style bold; print "o"; style roman; print "  show the highscores^";
253   style bold; print "c"; style roman; print "  show current player scores~^";
254   print "[End of quote.]^^";
255   print "To run the game in ~demo~ mode, just don't fill in the players'",
256         " names, so the computer has to play against itself. (It can still",
257         " get a highscore.) There is currently no way to stop it during a",
258         " game, though, short of quitting the interpreter. Sorry for the",
259         " inconvenience.^^";
260   print "The ~colour~ referred to by the menu is white on black. If your",
261         " interpreter doesn't support colour like it should (e.g. Unix Frotz",
262         " 2.32) just toggle it off. If your interpreter doesn't support",
263         " colour at all, you won't notice.^^";
264   print "If your interpreter doesn't support timed input properly, I can't",
265         " help you, sorry. You can hit some key repeatedly to make the game",
266         " go on, but it won't be very much fun, I guess.^^";
267   print "Note that you can't change the screen size after starting up, so",
268         " don't do that.^^";
269   print "Enjoy!^^";
270   print "[Hit any key]^";
271   Read();
272 ];
273
274 [ Banner  i;
275   style bold;
276   print "Z - T O R N A D O";
277   style roman;
278   print "^A two-player weather action game^";
279   print "Yet another abuse of the Z-Machine^";
280   print "Copyright (c) 2003 by Sophie Fr@:uhling (sfruehling@@64aon.at)^";
281   print "A port of the C port of the C64 game ~Tornado~^";
282   print "The C version is copyright (c) 2000-2002 by Oliver Feiler^";
283   print "Release ", (0-->1) & $03ff, " / Serial number ";
284   for (i = 18: i < 24: i++) print (char) 0->i;
285   print " / Inform v"; inversion; new_line;
286 ];
287
288 [ DrawTitleScreen  i;
289   @erase_window -1;
290   print "^^^^^^^^^^^^^^^^^^^";
291   i = 0->33; if (i > 30) i = (i - 30)/2;
292   style bold; font off; spaces(i);
293   print "      Z - T O R N A D O^";
294   style roman; new_line; spaces(i);
295   print "     [Please press a key]^";
296   font on;
297   box
298   "           ,/+++*++***+****++++++***+@@92, "
299   "           (*+++*****+++++***+++****++)"
300   "           `@@92++******+*++*++*****+++*/'"
301   "            `@{B0}*,.,*@{B0}'`@{B0}*,.,*@{B0}`@{B0}*,.,*@{B0}'"
302   "             ___         /  /  /  /  /"
303   "             |||          /  /  /  /  /"
304   "     /-------'|`-@@92         /  /  /  /  /"
305   "   /'/////////////`@@92        /  /  /  /  /"
306   "   |---------------|         /  /  /  /  /"
307   "   |-,_____,--,__,-|          /  /  /  /  /"
308   "   |-|__|__|--|++|-|           /  /  /  /  /"
309   "   |-|__|__|--|o+|-|            /  /  /  /  /"
310   "   |__________|__|_|              /  /  /  /  /";
311   Read();
312   @erase_window -1;
313 ];
314