aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/gyro2.cpp
blob: fba155af5918110762ae517d63962916c2aca1f9 (plain)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
/* ScummVM - Graphic Adventure Engine
 *
 * ScummVM is the legal property of its developers, whose names
 * are too numerous to list here. Please refer to the COPYRIGHT
 * file distributed with this source distribution.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 */

/*
 * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
 * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
 */

#include "avalanche/gyro2.h"
#include "common/textconsole.h"

//#include "pingo.h"
//#include "scrolls.h"
//#include "lucerna.h"
//#include "visa.h"
//#include "acci.h"
//#include "trip5.h"
//#include "dropdown.h"
//#include "basher.h"



namespace Avalanche {

	namespace Gyro {

	const Common::String things[numobjs] = {
		"Wine", "Money-bag", "Bodkin", "Potion", "Chastity belt",
		"Crossbow bolt", "Crossbow", "Lute", "Pilgrim's badge", "Mushroom", "Key",
		"Bell", "Scroll", "Pen", "Ink", "Clothes", "Habit", "Onion"
	};

	const char thingchar[] = "WMBParCLguKeSnIohn"; /* V=Vinegar */

	const Common::String better[numobjs] = {
		"some wine", "your money-bag", "your bodkin", "a potion", "a chastity belt",
		"a crossbow bolt", "a crossbow", "a lute", "a pilgrim's badge", "a mushroom",
		"a key", "a bell", "a scroll", "a pen", "some ink", "your clothes", "a habit",
		"an onion"
	};

	const char betterchar[] = "WMBParCLguKeSnIohn";

	void newpointer(byte m) {
		warning("STUB: Gyro::newpointer()");
	}

	void wait() {   /* makes hourglass */
		newpointer(5);
	}

	void on() {
		warning("STUB: Gyro::on()");
	}

	void on_virtual() {
		switch (visible) {
		case m_virtual:
			return;
			break;
		case m_yes:
			off();
			break;
		}

		visible = m_virtual;
	}

	void off() {
		warning("STUB: Gyro::off()");
	}

	void off_virtual() {
		warning("STUB: Gyro::off_virtual()");
	}

	void xycheck() {   /* only updates mx & my, not all other mouse vars */
		warning("STUB: Gyro::xycheck()");
	}

	void hopto(int16 x, int16 y) { /* Moves mouse void *to x,y */
		warning("STUB: Gyro::hopto()");
	}

	void check() {
		warning("STUB: Gyro::check()");
	}

	void note(uint16 hertz) {
		warning("STUB: Gyro::note()");
	}

	void blip() {
		warning("STUB: Gyro::blip()");
	}

	Common::String strf(int32 x) {
		Common::String q = Common::String::format("%d", x);
		return q;
	}

	void shadow(int16 x1, int16 y1, int16 x2, int16 y2, byte hc, byte sc) {
		warning("STUB: Gyro::shadow()");
	}

	void shbox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String t) {
		warning("STUB: Gyro::shbox()");
	}

	void newgame() {   /* This sets up the DNA for a completely new game. */
		warning("STUB: Gyro::newgame()");
	}

	void click() {   /* "Audio keyboard feedback" */
		warning("STUB: Gyro::click()");
	}

	void slowdown() {
		warning("STUB: Gyro::slowdown()");
	}

	bool flagset(char x) {
		for (uint16 i = 0; i < flags.size(); i++)
			if (flags[i] == x)
				return true;
		return false;
	}

	void force_numlock() {
		if ((locks & num) > 0)  locks -= num;
	}

	bool pennycheck(uint16 howmuchby) {
		warning("STUB: Gyro::pennycheck()");
		return true;
	}

	// There'll may be problems with calling these functions becouse of the conversion of the arrays!!!
	// Keep an eye open!
	Common::String getname(byte whose) { 
		Common::String getname_result;
		if (whose < 17)
			getname_result = lads[whose];
		else
			getname_result = lasses[whose-17];
		return getname_result;
	}

	// Keep an eye open! ^
	char getnamechar(byte whose) {
		char getnamechar_result;
		if (whose < 16) 
			getnamechar_result = ladchar[whose];
		else
			getnamechar_result = lasschar[whose-16];
		return getnamechar_result;
	}

	// Keep an eye open! ^^
	Common::String get_thing(byte which) {
		Common::String get_thing_result;
		switch (which) {
		case wine:
			switch (dna.winestate) {
			case 1:
			case 4:
				get_thing_result = things[which];
				break;
			case 3:
				get_thing_result = "Vinegar";
				break;
			}
			break;
		case onion:
			if (dna.rotten_onion)
				get_thing_result = "rotten onion";
			else get_thing_result = things[which];
			break;
		default:
			get_thing_result = things[which];
		}
		return get_thing_result;
	}

	// Keep an eye open! ^^^
	char get_thingchar(byte which) {
		char get_thingchar_result;
		switch (which) {
		case wine:
			if (dna.winestate == 3)
				get_thingchar_result = 'V'; /* Vinegar */
			else
				get_thingchar_result = thingchar[which];
			break;
		default:
			get_thingchar_result = thingchar[which];
		}
		return get_thingchar_result;
	}

	// Keep an eye open! ^^^^
	Common::String get_better(byte which) {
		Common::String get_better_result;
		if (which > 150)  which -= 149;
		switch (which) {
		case wine:
			switch (dna.winestate) {
			case 0:
			case 1:
			case 4:
				get_better_result = better[which];
				break;
			case 3:
				get_better_result = "some vinegar";
				break;
			}
			break;
		case onion:
			if (dna.rotten_onion)
				get_better_result = "a rotten onion";
			else if (dna.onion_in_vinegar)
				get_better_result = "a pickled onion (in the vinegar)";
			else get_better_result = better[which];
			break;
		default:
			if ((which < numobjs) && (which > '\0'))
				get_better_result = better[which];
			else
				get_better_result = "";
		}
		return get_better_result;
	}

	// Get back here after finished with acci.pas, where vb_-s are resided.
	Common::String f5_does()
	/* This procedure determines what f5 does. */
	{
		warning("STUB: Gyro::f5_does()");
		return "STUB: Gyro::f5_does()";
	}

	// Pobably vmc functions will deal with the mouse cursor.
	void plot_vmc(int16 xx, int16 yy, byte page_) {
		warning("STUB: Gyro::plot_vmc()");
	}

	void wipe_vmc(byte page_) {
		warning("STUB: Gyro::wipe_vmc()");
	}

	void setup_vmc() {
		warning("STUB: Gyro::setup_vmc()");
	}

	void clear_vmc() {
		warning("STUB: Gyro::clear_vmc()");
	}

	void setminmaxhorzcurspos(uint16 min, uint16 max) { /* phew */
		warning("STUB: Gyro::setminmaxhorzcurspos()");
	}

	void setminmaxvertcurspos(uint16 min, uint16 max) {
		warning("STUB: Gyro::setminmaxvertcurspos()");
	}

	void load_a_mouse(byte which) {
		warning("STUB: Gyro::load_a_mouse()");
	}

	void background(byte x) {
		warning("STUB: Gyro::background()");
	}

	void hang_around_for_a_while() {
		byte fv;

		for (fv = 1; fv <= 28; fv ++) slowdown();
	}

	bool mouse_near_text() {
		bool mouse_near_text_result;
		mouse_near_text_result = (my > 144) && (my < 188);
		return mouse_near_text_result;
	}

	/* Super_Off and Super_On are two very useful procedures. Super_Off switches
	  the mouse cursor off, WHATEVER it's like. Super_On restores it again
	  afterwards. */

	void super_off() {
		super_was_off = visible == m_no;
		if (super_was_off)  return;

		super_was_virtual = visible == m_virtual;

		if (visible == m_virtual)  off_virtual();
		else off();
	}

	void super_on() {
		if ((visible != m_no) || (super_was_off))  return;

		if (super_was_virtual)  on_virtual();
		else on();
	}

	} // End of namespace Gyro

} // End of namespace Avalanche