1 /*
2 Copyright (C) 2007, 2010 - Bit-Blot
3 
4 This file is part of Aquaria.
5 
6 Aquaria is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 
15 See the 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 #ifndef __dsq__
22 #define __dsq__
23 
24 #include "AquariaCompileConfig.h"
25 #include "../BBGE/Core.h"
26 #include "../BBGE/Quad.h"
27 #include "Element.h"
28 #include "../BBGE/BitmapFont.h"
29 #include "../BBGE/ScreenTransition.h"
30 #include "../BBGE/Precacher.h"
31 #include "AquariaMenuItem.h"
32 #include "ScriptInterface.h"
33 
34 #include "TTFFont.h"
35 
36 #include "tinyxml2.h"
37 using namespace tinyxml2;
38 
39 #define AQUARIA_BUILD_MAPVIS
40 
41 // Define this to save map visited data in a base64-encoded raw format.
42 // This can take much less space than the standard text format (as little
43 // as 10%), but WILL BE INCOMPATIBLE with previous builds of Aquaria --
44 // the visited data will be lost if the file is loaded into such a build.
45 // (Current builds will load either format regardless of whether or not
46 // this is defined.)
47 //#define AQUARIA_SAVE_MAPVIS_RAW
48 
49 class Game;
50 class DebugFont;
51 class ProfRender;
52 
53 const float FRAME_TIME = 0.04;
54 
55 const int MAX_INGREDIENT_AMOUNT = 8;
56 
57 const float MENUSELECTDELAY		= 0.2;
58 
59 const int VERSION_MAJOR			= 1;
60 const int VERSION_MINOR			= 1;
61 const int VERSION_REVISION		= 3;
62 
63 const int VERSION_BETA			= 5;
64 const int VERSION_FC			= 3;
65 const int VERSION_GM			= 6;
66 
67 enum CursorType
68 {
69 	CURSOR_NONE		= -1,
70 	CURSOR_NORMAL	= 0,
71 	CURSOR_SWIM		= 1,
72 	CURSOR_BURST	= 2,
73 	CURSOR_SING		= 3,
74 	CURSOR_LOOK		= 4
75 };
76 
77 enum AquariaActions
78 {
79 	ACTION_PRIMARY					=0,
80 	ACTION_SECONDARY				=1,
81 	ACTION_ESC						=2,
82 	ACTION_TOGGLESCENEEDITOR		=3,
83 	ACTION_TOGGLEWORLDMAP			=4,
84 
85 	ACTION_TOGGLEGRID				=5,
86 
87 	ACTION_MENULEFT					=6,
88 	ACTION_MENURIGHT				=7,
89 	ACTION_MENUUP					=8,
90 	ACTION_MENUDOWN					=9,
91 
92 	ACTION_PREVPAGE,
93 	ACTION_NEXTPAGE,
94 	ACTION_COOKFOOD,
95 	ACTION_FOODLEFT,
96 	ACTION_FOODRIGHT,
97 	ACTION_FOODDROP,
98 
99 	ACTION_TOGGLEMENU,
100 
101 
102 
103 	ACTION_SWIMUP = 100,
104 	ACTION_SWIMDOWN,
105 	ACTION_SWIMLEFT,
106 	ACTION_SWIMRIGHT,
107 
108 	ACTION_SINGUP,
109 	ACTION_SINGDOWN,
110 	ACTION_SINGLEFT,
111 	ACTION_SINGRIGHT,
112 
113 	ACTION_SONGSLOT1,
114 	ACTION_SONGSLOT2,
115 	ACTION_SONGSLOT3,
116 	ACTION_SONGSLOT4,
117 	ACTION_SONGSLOT5,
118 	ACTION_SONGSLOT6,
119 	ACTION_SONGSLOT7,
120 	ACTION_SONGSLOT8,
121 	ACTION_SONGSLOT9,
122 	ACTION_SONGSLOT10,
123 	ACTION_SONGSLOTEND,
124 
125 	ACTION_ROLL,
126 
127 	ACTION_SLOW,						// currently unused
128 	ACTION_REVERT,
129 
130 	ACTION_ZOOMIN		= 200,
131 	ACTION_ZOOMOUT,
132 
133 	ACTION_CAMLEFT,
134 	ACTION_CAMRIGHT,
135 	ACTION_CAMUP,
136 	ACTION_CAMDOWN,
137 
138 	ACTION_BONELEFT,
139 	ACTION_BONERIGHT,
140 	ACTION_BONEUP,
141 	ACTION_BONEDOWN,
142 
143 	ACTION_BGLAYER1,
144 	ACTION_BGLAYER2,
145 	ACTION_BGLAYER3,
146 	ACTION_BGLAYER4,
147 	ACTION_BGLAYER5,
148 	ACTION_BGLAYER6,
149 	ACTION_BGLAYER7,
150 	ACTION_BGLAYER8,
151 	ACTION_BGLAYER9,
152 	ACTION_BGLAYER10,
153 	ACTION_BGLAYER11,
154 	ACTION_BGLAYER12,
155 	ACTION_BGLAYER13,
156 	ACTION_BGLAYER14,
157 	ACTION_BGLAYER15,
158 	ACTION_BGLAYER16,
159 	ACTION_BGLAYEREND,
160 
161 	ACTION_MULTISELECT				,
162 
163 	ACTION_TOGGLEWORLDMAPEDITOR		,
164 
165 	ACTION_LOOK						,
166 	ACTION_TOGGLEHELPSCREEN,
167 	ACTION_PLACE_AVATAR,
168 };
169 
170 typedef std::list<Entity*> EntityList;
171 typedef std::vector<Entity*> EntityContainer;
172 
173 // last entry is always NULL. added if is a little hack to ensure the scope of the iterator variable
174 #define FOR_ENTITIES(i) for (size_t i##_i = 0; dsq->entities[i##_i] != 0; ++i##_i) if (Entity **i = &dsq->entities[i##_i])
175 
176 
177 enum MenuPage
178 {
179 	MENUPAGE_NONE		= -1,
180 	MENUPAGE_SONGS		= 0,
181 	MENUPAGE_FOOD		= 1,
182 	MENUPAGE_TREASURES	= 2,
183 	MENUPAGE_PETS		= 3
184 };
185 
186 enum WorldMapRevealMethod
187 {
188 	REVEAL_UNSPECIFIED = -1,
189 	REVEAL_DEFAULT	= 0,
190 	REVEAL_PARTIAL	= 1  // Not visited areas have zero alpha (invisible)
191 };
192 
193 
194 /*
195 class Title;
196 class GameOver;
197 class Logo;
198 class Entity;
199 class SCLogo;
200 class IntroText;
201 class AnimationEditor;
202 class Intro;
203 */
204 struct SubLine
205 {
SubLineSubLine206 	SubLine() { timeStamp = 0; }
207 	float timeStamp;
208 	std::string line;
209 };
210 
211 class StringBank
212 {
213 public:
214 	StringBank();
215 	void load();
216 
217 	const std::string& get(int idx);
218 protected:
219 	void _load(const std::string &file);
220 
221 	typedef std::map<int, std::string> StringMap;
222 	StringMap stringMap;
223 };
224 
225 class SubtitlePlayer
226 {
227 public:
228 	SubtitlePlayer();
229 	void go(const std::string &subs);
230 	void update(float dt);
231 	void end();
232 
233 	void hide(float t = 0);
234 	void show(float t = 0);
235 
236 	bool isVisible();
237 
238 	typedef std::vector<SubLine> SubLines;
239 	SubLines subLines;
240 
241 	int curLine;
242 protected:
243 	bool vis, hidden;
244 };
245 
246 enum ModType
247 {
248 	MODTYPE_MOD,
249 	MODTYPE_PATCH,
250 };
251 
252 struct ModEntry
253 {
254 	unsigned int id; // index in vector
255 	ModType type;
256 	std::string path;
257 };
258 
259 class ModSelectorScreen;
260 
261 class Mod
262 {
263 public:
264 	Mod();
265 	~Mod();
266 	void clear();
267 	void setActive(bool v);
268 	void start();
269 	void stop();
270 	void load(const std::string &path);
271 
272 	void update(float dt);
273 
274 	void recache();
275 
276 	const std::string& getBaseModPath() const;
277 
278 	bool isActive();
279 	bool isDebugMenu();
280 	bool hasWorldMap();
281 	bool isEditorBlocked();
282 
283 	const std::string& getPath() const;
284 	const std::string& getName() const;
285 
286 	void shutdown();
287 	bool isShuttingDown();
288 
289 	static bool loadModXML(XMLDocument *d, std::string modName);
290 	static ModType getTypeFromXML(XMLElement *xml);
291 
292 	WorldMapRevealMethod mapRevealMethod;
293 
294 protected:
295 	bool shuttingDown;
296 	bool active;
297 	bool hasMap;
298 	bool blockEditor;
299 	int doRecache;
300 	int debugMenu;
301 	int enqueueModStart;
302 	void applyStart();
303 
304 	std::string name;
305 	std::string path;
306 	Precacher modcache;
307 };
308 
309 class AquariaScreenTransition : public ScreenTransition
310 {
311 public:
312 	void capture();
313 };
314 
315 typedef std::vector<int> SongNotes;
316 
317 struct Song
318 {
SongSong319 	Song() { index=0; script=0; }
320 	int index;
321 	SongNotes notes;
322 	int script;
323 };
324 
325 const int MAX_FLAGS				= 1024;
326 
327 enum AuraType
328 {
329 	AURA_NONE				= -1,
330 	AURA_SHIELD				= 0,
331 	AURA_THING				= 1,
332 	AURA_HEAL				= 2
333 };
334 
335 enum SongType
336 {
337 	SONG_NONE				= -1,
338 	SONG_HEAL				= 0,
339 	SONG_ENERGYFORM			= 1,
340 	SONG_SONGDOOR1			= 2,
341 	SONG_SPIRITFORM			= 3,
342 	SONG_BIND				= 4,
343 	SONG_NATUREFORM			= 5,
344 	SONG_BEASTFORM			= 6,
345 	SONG_SHIELDAURA			= 7,
346 	SONG_SONGDOOR2			= 8,
347 	SONG_DUALFORM			= 9,
348 	SONG_FISHFORM			= 10,
349 	SONG_SUNFORM			= 11,
350 	SONG_LI					= 12,
351 	SONG_TIME				= 13,
352 	SONG_LANCE				= 14,
353 	SONG_MAP				= 15,
354 	SONG_ANIMA				= 16,
355 	SONG_MAX
356 };
357 
358 const int numForms			= 7;
359 
360 enum FormType
361 {
362 	FORM_NONE			= -1,
363 	FORM_NORMAL			= 0,
364 	FORM_ENERGY			,
365 	FORM_BEAST			,
366 	FORM_NATURE			,
367 	FORM_SPIRIT			,
368 	FORM_DUAL			,
369 	FORM_FISH			,
370 	FORM_SUN			,
371 	FORM_MAX
372 };
373 
374 enum FormUpgradeType
375 {
376 	FORMUPGRADE_ENERGY1		=0,
377 	FORMUPGRADE_ENERGY2		,
378 	FORMUPGRADE_BEAST		,
379 	FORMUPGRADE_MAX
380 };
381 
382 // defined by windows includes
383 #undef INPUT_MOUSE
384 #undef INPUT_KEYBOARD
385 
386 enum InputMode
387 {
388 	INPUT_MOUSE		= 0,
389 	INPUT_JOYSTICK	= 1,
390 	INPUT_KEYBOARD	= 2
391 };
392 
393 enum EFXType
394 {
395 	EFX_NONE	=-1,
396 	EFX_SEGS	=0,
397 	EFX_ALPHA	,
398 	EFX_WAVY	,
399 	EFX_MAX
400 };
401 
402 struct ElementEffect
403 {
404 public:
405 	int type;
406 	int segsx, segsy;
407 	float segs_dgox, segs_dgoy, segs_dgmx, segs_dgmy, segs_dgtm, segs_dgo;
408 	float wavy_radius, wavy_min, wavy_max;
409 	bool wavy_flip;
410 	InterpolatedVector alpha;
411 	InterpolatedVector color;
412 	int blendType;
413 };
414 
415 struct EmoteData
416 {
EmoteDataEmoteData417 	EmoteData()
418 	{
419 		index = -1; variations = 0;
420 	}
421 	int index;
422 	std::string name;
423 	int variations;
424 };
425 
426 enum EmoteType
427 {
428 	EMOTE_NAIJAEVILLAUGH	= 0,
429 	EMOTE_NAIJAGIGGLE		= 1,
430 	EMOTE_NAIJALAUGH		= 2,
431 	EMOTE_NAIJASADSIGH		= 3,
432 	EMOTE_NAIJASIGH			= 4,
433 	EMOTE_NAIJAWOW			= 5,
434 	EMOTE_NAIJAUGH			= 6,
435 	EMOTE_NAIJALOW			= 7,
436 	EMOTE_NAIJALI			= 8
437 };
438 
439 class Emote
440 {
441 public:
442 	Emote();
443 	void load(const std::string &file);
444 	void playSfx(int index);
445 	void update(float dt);
446 
447 	float emoteTimer;
448 	int lastVariation;
449 
450 	typedef std::vector<EmoteData> Emotes;
451 	Emotes emotes;
452 };
453 
454 enum WorldType
455 {
456 	WT_NONE		= -1,
457 	WT_NORMAL	= 0,
458 	WT_SPIRIT	= 1
459 };
460 
461 enum VisualEffectsType
462 {
463 	VFX_NONE		= -1,
464 	VFX_SHOCK		= 0,
465 	VFX_RIPPLE		= 1,
466 	VFX_SHOCKHIT	= 2,
467 	VFX_MAX			= 3
468 };
469 
470 enum Layers
471 {
472 	// GAME WILL CLEAR THESE
473 	LR_ZERO						= 0,
474 	LR_BACKDROP					,
475 	LR_BACKGROUND				,
476 	LR_SCENEBACKGROUNDIMAGE		,
477 	LR_BACKDROP_ELEMENTS1	,
478 	LR_BACKDROP_ELEMENTS2	,
479 	LR_ENTITIES_MINUS4_PLACEHOLDER	,
480 	LR_BACKDROP_ELEMENTS3	,
481 	LR_BACKDROP_ELEMENTS4	,
482 	LR_BACKDROP_ELEMENTS5	,
483 	LR_BACKDROP_ELEMENTS6	,
484 	LR_BACKGROUND_ELEMENTS1	,
485 	LR_BACKGROUND_ELEMENTS2	,
486 	LR_ENTITIES_MINUS3_PLACEHOLDER	,
487 	LR_BACKGROUND_ELEMENTS3	,
488 	LR_ENTITIES_MINUS2_PLACEHOLDER	,
489 	LR_BLACKGROUND			,
490 	LR_UPDATE_ELEMENTS_BG	,
491 	LR_ELEMENTS1			,
492 	LR_ELEMENTS2			,
493 	LR_ELEMENTS3			,
494 	LR_ELEMENTS4			,
495 	LR_ELEMENTS5			,
496 	LR_ELEMENTS6			,
497 	LR_ELEMENTS7			,
498 	LR_ELEMENTS8			,
499 	LR_ELEMENTS9			,
500 	LR_ELEMENTS10			,
501 	LR_ELEMENTS11			,
502 	LR_ELEMENTS12			,
503 	LR_ELEMENTS13			,
504 	LR_ELEMENTS14			,
505 	LR_ELEMENTS15			,
506 	LR_ELEMENTS16			,
507 	LR_UPDATE_ELEMENTS_FG	,
508 	LR_ENTITIES_MINUS4		,
509 	LR_ENTITIES_MINUS3		,
510 	LR_ENTITIES_MINUS2		,
511 	LR_ENTITIES00			,
512 	LR_ENTITIES0			,
513 	LR_ENTITIES				,
514 	LR_ENTITIES2			,
515 	LR_WATERSURFACE			,
516 	LR_WATERSURFACE2		,
517 	LR_DARK_LAYER			,
518 	LR_PROJECTILES			,
519 	LR_LIGHTING				,
520 	LR_PARTICLES			,
521 	LR_PARTICLES2			,
522 	LR_FOREGROUND_ELEMENTS1	,
523 	LR_FOREGROUND_ELEMENTS2	,
524 	LR_PARTICLES_TOP		,
525 	LR_AFTER_EFFECTS		,
526 	LR_SCENE_COLOR			,
527 	LR_MENU					,
528 	LR_MENU2				,
529 	LR_HUD					,
530 	LR_HUD2					,
531 	LR_HUD3					,
532 	LR_HUDUNDERLAY			,
533 	LR_MINIMAP				,
534 	LR_RECIPES				,
535 	LR_WORLDMAP				,
536 	LR_WORLDMAPHUD			,
537 	LR_REGISTER_TEXT		,
538 	LR_DAMAGESPRITE			,
539 	LR_HELP					,
540 	LR_TRANSITION			,
541 	LR_OVERLAY				,
542 	LR_FILEMENU				,
543 	LR_CONFIRM				,
544 	LR_CURSOR				,
545 	LR_SUBTITLES			,
546 	LR_PROGRESS				,
547 	LR_DEBUG_TEXT			,
548 	LR_BLACKBARS			,
549 	LR_MAX
550 };
551 
552 class Avatar;
553 
554 /*
555 class GardenHoleData
556 {
557 public:
558 	GardenHoleData();
559 	float timePlanted, timeLastChecked, lastTimeGrown;
560 	int plantedItem;
561 	unsigned int state;
562 	int slotsUsed;
563 };
564 
565 class GardenData
566 {
567 public:
568 	GardenHoleData holeData[256];
569 };
570 */
571 
572 #define MAPVIS_SUBDIV 64
573 
574 struct WorldMapTile
575 {
576 	WorldMapTile();
577 	~WorldMapTile();
578 
579 	void markVisited(int left, int top, int right, int bottom);
580 	void dataToString(std::ostringstream &os);
581 	void stringToData(std::istringstream &is);
getDataWorldMapTile582 	const unsigned char *getData() const {return data;}
583 
584 	std::string name;
585 	Vector gridPos;
586 	float scale, scale2;
587 	bool revealed, prerevealed;
588 	int layer, index;
589 	int stringIndex;
590 
591 	Quad *q;
592 
593 protected:
594 	unsigned char *data;
595 };
596 
597 struct WorldMap
598 {
599 	WorldMap();
600 	void load();
601 	void save();
602 	void hideMap();
603 	void revealMap(const std::string &name);
604 	WorldMapTile *getWorldMapTile(const std::string &name);
605 	int getNumWorldMapTiles();
606 	WorldMapTile *getWorldMapTile(int index);
607 
608 	WorldMapTile *getWorldMapTileByIndex(int index);
609 	void revealMapIndex(int index);
610 
611 	int gw, gh;
612 	typedef std::vector<WorldMapTile> WorldMapTiles;
613 	WorldMapTiles worldMapTiles;
614 
615 private:
616 	void _load(const std::string &file);
617 };
618 
619 class Path;
620 
621 struct GemData
622 {
GemDataGemData623 	GemData() { canMove=false; blink = false; }
624 	std::string name;
625 	std::string userString;
626 	std::string mapName;
627 	Vector pos;
628 	bool canMove;
629 	bool blink; // not saved
630 };
631 
632 struct BeaconData
633 {
BeaconDataBeaconData634 	BeaconData(){ index=-1; on=0; }
635 	int index;
636 	Vector pos,color;
637 	bool on;
638 };
639 
640 enum IngredientType
641 {
642 	IT_NONE			= -1,
643 	IT_LEAF			= 0,
644 	IT_MEAT			,
645 	IT_EGG			,
646 	IT_OIL			,
647 	IT_BERRY		,
648 	IT_MUSHROOM		,
649 	IT_BULB			,
650 	IT_TENTACLE		,
651 	IT_ICECHUNK		,
652 	IT_PART			,
653 
654 	IT_SHELL		,
655 	IT_BONE			,
656 	IT_INGREDIENTSEND ,
657 
658 	IT_FOOD		= 100,
659 	IT_SOUP		= 101,
660 	IT_CAKE		= 103,
661 	IT_ICECREAM	= 105,
662 	IT_LOAF		= 107,
663 	IT_PEROGI	= 108,
664 	IT_POULTICE	= 109,
665 	IT_ROLL		= 110,
666 
667 	IT_ANYTHING	= 200,
668 
669 	IT_MAX
670 };
671 
672 enum IngredientEffectType
673 {
674 	IET_NONE		= -1,
675 	IET_HP			= 0,
676 	IET_DEFENSE		= 1,
677 	IET_SPEED		= 2,
678 	IET_RANDOM		= 3,
679 	IET_MAXHP		= 4,
680 	IET_INVINCIBLE	= 5,
681 	IET_TRIP		= 6,
682 	IET_REGEN		= 7,
683 	IET_LI			= 8,
684 	IET_FISHPOISON	= 9,
685 	IET_BITE		= 10,
686 	IET_EAT			= 11,
687 	IET_LIGHT		= 12,
688 	IET_YUM			= 13,
689 	IET_PETPOWER	= 14,
690 	IET_WEB			= 15,
691 	IET_ENERGY		= 16,
692 	IET_POISON		= 17,
693 	IET_BLIND		= 18,
694 	IET_ALLSTATUS	= 19,
695 	IET_SCRIPT		= 20,
696 	IET_MAX
697 };
698 
699 enum FoodSortType
700 {
701 	FOODSORT_BYTYPE			= 0,
702 	FOODSORT_BYHEAL			= 1,
703 	FOODSORT_BYINGREDIENT	= 2,
704 	MAX_FOODSORT
705 };
706 
707 //	FOODSORT_UNSORTED		= 0,
708 
709 struct IngredientEffect
710 {
IngredientEffectIngredientEffect711 	IngredientEffect() : type(IET_NONE), magnitude(0) {}
712 	float magnitude;
713 	IngredientEffectType type;
714 	std::string string;
715 };
716 
717 class IngredientData
718 {
719 public:
720 	IngredientData(const std::string &name, const std::string &gfx, IngredientType type);
721 	int getIndex() const;
722 	const std::string name, gfx;
723 	std::string displayName;
724 	const IngredientType type;
725 	int amount;
726 	int maxAmount;
727 	int held;
728 	int marked;
729 	bool sorted;
730 	bool rotKind;
731 	bool hasIET(IngredientEffectType iet);
732 
733 	typedef std::vector<IngredientEffect> IngredientEffects;
734 	IngredientEffects effects;
735 private:
736 	// ensure that IngredientData instances are never copied:
737 	IngredientData(const IngredientData&);
738 	const IngredientData& operator=(const IngredientData&);
739 };
740 typedef std::vector<IngredientData*> IngredientDatas;
741 
742 class IngredientDescription
743 {
744 public:
745 	std::string text;
746 };
747 typedef std::vector<IngredientDescription> IngredientDescriptions;
748 
749 struct RecipeType
750 {
RecipeTypeRecipeType751 	RecipeType(IngredientType type, const std::string &typeName) : type(type), amount(1) { this->typeName = typeName; }
RecipeTypeRecipeType752 	RecipeType() { amount = 1; type = IT_NONE; }
753 	IngredientType type;
754 	int amount;
755 	std::string typeName;
756 };
757 
758 struct RecipeName
759 {
RecipeNameRecipeName760 	RecipeName(const std::string &name) : name(name), amount(1) {}
RecipeNameRecipeName761 	RecipeName() : amount(1) {}
762 	std::string name;
763 	int amount;
764 };
765 
766 class Recipe
767 {
768 public:
769 	Recipe();
770 	std::vector<RecipeType> types;
771 	std::vector<RecipeName> names;
772 	std::string result;
773 	std::string resultDisplayName;
774 
775 	int index;
776 
777 
778 	void addName(const std::string &name);
779 	void addType(IngredientType type, const std::string &typeName);
780 	void clear();
781 	void learn();
782 
isKnown()783 	bool isKnown() { return known; }
784 protected:
785 	bool known;
786 };
787 
788 struct PECue
789 {
PECuePECue790 	PECue(std::string name, Vector pos, float rot, float t)
791 		: name(name), pos(pos), rot(rot), t(t) {}
792 	std::string name;
793 	Vector pos;
794 	float rot;
795 	float t;
796 };
797 
798 struct EatData
799 {
EatDataEatData800 	EatData() { ammoUnitSize=getUnits=1; health=0; ammo=1;}
801 	std::string name, shot;
802 	int ammoUnitSize, getUnits, ammo;
803 	float health;
804 };
805 
806 struct SFXLoops
807 {
808 	SFXLoops();
809 	void updateVolume();
810 	void stopAll();
811 
812 	void *bg;
813 	void *bg2;
814 	void *roll;
815 	void *charge;
816 	void *shield;
817 	void *current;
818 	void *trip;
819 };
820 
821 class GameplayVariables
822 {
823 public:
824 	int maxSlowSwimSpeed, maxSwimSpeed, maxBurstSpeed, maxDodgeSpeed, maxWallJumpSpeed, maxWallJumpBurstSpeed;
825 	int maxDreamWorldSpeed;
826 	int autoSaveTime, autoSaveFiles;
827 	int afterEffectsXDivs, afterEffectsYDivs;
828 	int frictionForce, maxSpringSpeed;
829 	int grabSpringPlantVelCap;
830 	float springTime;
831 	float zoomStop, zoomMove, zoomNaija;
832 	float jumpVelocityMod;
833 	float dodgeTime;
834 	float initialId, initialEgo, initialSuperEgo;
835 	int unusedFPSSmoothing;
836 	float defaultCameraLerpDelay;
837 	int maxOutOfWaterSpeed;
838 	float entityDamageTime, pushTime, avatarDamageTime;
839 	void load();
840 };
841 
842 const int FLAG_LI = 1000, FLAG_LICOMBAT = 1001;
843 
844 const int FLAG_COOKS			= 21;
845 
846 const int FLAG_PET_ACTIVE		= 600;
847 const int FLAG_PET_NAMESTART	= 601;
848 
849 const int FLAG_UPGRADE_WOK		= 620;
850 
851 const int FLAG_SEALOAFANNOYANCE = 801;
852 
853 const int FLAG_SECRET01 = 234;
854 const int FLAG_SECRET02	= 235;
855 const int FLAG_SECRET03 = 236;
856 
857 const int FLAG_COLLECTIBLE_START = 500;
858 const int FLAG_COLLECTIBLE_END = 600;
859 
860 /*
861 const int FLAG_PET_NAUTILUS		= 601;
862 const int FLAG_PET_DUMBO		= 602;
863 const int FLAG_PET_BLASTER		= 603;
864 const int FLAG_PET_PIRANHA		= 604;
865 */
866 
867 struct PetData
868 {
869 	std::string namePart;
870 };
871 
872 struct TreasureDataEntry
873 {
TreasureDataEntryTreasureDataEntry874 	TreasureDataEntry() { sz = 1; use = 0;}
875 	std::string gfx;
876 	float sz;
877 	int use;
878 };
879 
880 struct FoodSortOrder
881 {
882 	FoodSortOrder(IngredientType t, IngredientEffectType et = IET_NONE, std::string name="", int effectAmount=0)
883 	{ type = t; effectType = et; this->name = name; this->effectAmount=effectAmount;}
FoodSortOrderFoodSortOrder884 	FoodSortOrder() { type = IT_NONE; effectType = IET_NONE; }
885 	std::string name;
886 	IngredientType type;
887 	IngredientEffectType effectType;
888 	int effectAmount;
889 };
890 
891 typedef std::map<int, TreasureDataEntry> TreasureData;
892 
893 #include "StatsAndAchievements.h"
894 
895 class Continuity
896 {
897 public:
898 	Continuity();
~Continuity()899 	~Continuity() { clearIngredientData(); }
900 	void init();
901 	void shutdown();
902 	void initAvatar(Avatar *a);
903 	void refreshAvatarData(Avatar *a);
904 	void reset();
905 	bool hasItem(int type);
906 	void pickup(int type, int amount=1);
907 	void drop(int type);
908 
909 	void entityDied(Entity *eDead);
910 
911 	void achieve(const std::string &achievement);
912 
913 	void initFoodSort();
914 	void sortFood();
915 
916 	bool isIngredientFull(IngredientData *data);
917 
918 	void setCostume(const std::string &c);
919 
920 	void shortenSong(Song &song, int size);
921 	void warpLiToAvatar();
922 
923 	void flingMonkey(Entity *e);
924 
925 	void upgradeHealth();
926 
927 	int  getFlag(std::string flag);
928 	void setFlag(std::string flag, int v);
929 
930 	int getFlag(int flag);
931 	void setFlag(int flag, int v);
932 
933 	int getEntityFlag(const std::string &sceneName, int id);
934 	void setEntityFlag(const std::string &sceneName, int id, int v);
935 
936 	void setPathFlag(Path *p, int v);
937 	int getPathFlag(Path *p);
938 
939 	std::string getStringFlag(std::string flag);
940 	void		setStringFlag(std::string flag, std::string v);
941 
942 	void saveFile(int slot, Vector position=Vector(0,0,0), unsigned char *scrShotData=0, int scrShotWidth=0, int scrShotHeight=0);
943 	void loadFileData(int slot, XMLDocument &doc);
944 	void loadFile(int slot);
945 
946 	void castSong(int num);
947 
948 	bool hasLi();
949 
950 	std::string getDescriptionForSongSlot(int songSlot);
951 	std::string getVoxForSongSlot(int songSlot);
952 
953 	std::string getIEString(IngredientData *data, int i);
954 	std::string getAllIEString(IngredientData *data);
955 
956 	std::string getInternalFormName();
957 
958 	std::string getSaveFileName(int slot, const std::string &pfix);
959 
960 	float maxHealth;
961 	float health;
962 	bool hudVisible;
963 	unsigned int exp;
964 
965 	void clearTempFlags();
966 	void getHoursMinutesSeconds(int *hours, int *minutes, int *seconds);
967 	float seconds;
968 
969 	void update(float dt);
970 
971 	void setItemSlot(int slot, int itemType);
972 
973 	std::vector<int> itemSlots;
974 
975 	bool isItemPlantable(int item);
976 
getCurrentTime()977 	float getCurrentTime(){return seconds;}
978 
979 	//GardenData gardenData;
980 	Vector zoom;
981 
982 	std::string getIngredientGfx(const std::string &name);
983 
984 
getWorldType()985 	WorldType getWorldType() { return worldType; }
986 	void shiftWorlds();
987 	void applyWorldEffects(WorldType type, bool transition, bool affectMusic);
988 
989 
990 	//void setActivePet(int flag);
991 
992 	bool isStory(float v);
993 	float getStory();
994 	void setStory(float v);
995 
996 	float getSpeedType(int speedType);
997 	void setNaijaModel(std::string model);
998 
999 
1000 	std::string naijaModel;
1001 
1002 	FormType form;
1003 
1004 	void learnFormUpgrade(FormUpgradeType form);
1005 	bool hasFormUpgrade(FormUpgradeType form);
1006 
1007 	typedef std::map<FormUpgradeType, bool> FormUpgrades;
1008 	FormUpgrades formUpgrades;
1009 
1010 	void loadSongBank();
1011 	void loadIntoSongBank(const std::string &file);
1012 	int checkSong(const Song &song);
1013 	int checkSongAssisted(const Song &song);
1014 	typedef std::map<int, Song> SongMap;
1015 	SongMap songBank;
1016 
1017 	Song *getSongByIndex(int idx);
1018 
1019 
1020 	bool hasSong(int song);
1021 	int getSongTypeBySlot(int slot);
1022 	int getSongSlotByType(int type);
1023 	void learnSong(int song);
1024 	void unlearnSong(int song);
1025 	std::map<int, bool> knowsSong;
1026 	std::map<int, int> songSlotsToType;
1027 	std::map<int, int> songTypesToSlot;
1028 
1029 	std::map<int, std::string> songSlotDescriptions;
1030 	std::map<int, std::string> songSlotNames;
1031 	std::map<int, std::string> songSlotVox;
1032 
1033 	typedef std::map<std::string, int> EntityFlags;
1034 	EntityFlags entityFlags;
1035 
1036 	bool toggleMoveMode;
1037 
1038 	typedef std::list<GemData> Gems;
1039 	Gems gems;
1040 
1041 	typedef std::list<BeaconData> Beacons;
1042 	Beacons beacons;
1043 
1044 	GemData *pickupGem(std::string name, bool effects = true);
1045 	void removeGemData(GemData *gemData);
1046 
1047 
1048 	typedef std::vector<std::string> VoiceOversPlayed;
1049 	VoiceOversPlayed voiceOversPlayed;
1050 
1051 	std::string costume;
1052 
1053 	AuraType auraType;
1054 	float auraTimer;
1055 
1056 	EatData *getEatData(const std::string &name);
1057 	void loadEatBank();
1058 
1059 	bool isSongTypeForm(SongType s);
1060 
1061 	std::string getSongNameBySlot(int slot);
1062 	void toggleLiCombat(bool t);
1063 
1064 	void pickupIngredient(IngredientData *i, int amount, bool effects=true, bool learn=true);
1065 	int indexOfIngredientData(const IngredientData* data) const;
1066 	IngredientData *getIngredientHeldByName(const std::string &name) const; // an ingredient that the player actually has; in the ingredients list
1067 	IngredientData *getIngredientDataByName(const std::string &name); // an ingredient in the general data list; ingredientData
1068 
1069 	IngredientData *getIngredientHeldByIndex(int idx) const;
1070 	IngredientData *getIngredientDataByIndex(int idx);
1071 
1072 	int getIngredientDataSize() const;
1073 	int getIngredientHeldSize() const;
1074 
1075 	bool applyIngredientEffects(IngredientData *data);
1076 
1077 	void loadIngredientData();
1078 	void loadIngredientData(const std::string &file);
1079 	void loadIngredientDisplayNames(const std::string& file);
hasIngredients()1080 	bool hasIngredients() const { return !ingredients.empty(); }
ingredientCount()1081 	IngredientDatas::size_type ingredientCount() const { return ingredients.size(); }
1082 	IngredientType getIngredientTypeFromName(const std::string &name) const;
1083 	std::string getIngredientDisplayName(const std::string& name) const;
1084 
1085 	void removeEmptyIngredients();
1086 	void spawnAllIngredients(const Vector &position);
1087 
1088 	std::vector<std::string> unsortedOrder;
1089 
1090 	typedef std::vector<Recipe> Recipes;
1091 	Recipes recipes;
1092 
1093 	void setSpeedMultiplier(float s, float t);
1094 	void setBiteMultiplier(float m, float t);
1095 	void setFishPoison(float m, float t);
1096 	void setDefenseMultiplier(float s, float t);
1097 	void setRegen(float t);
1098 	void setTrip(float t);
1099 	void setInvincible(float t);
1100 	void setEnergy(float m, float t);
1101 	void setPoison(float m, float t);
1102 	void setWeb(float t);
1103 	void setLight(float m, float t);
1104 	void setPetPower(float m, float t);
1105 	void setLiPower(float m, float t);
1106 
1107 	void cureAllStatus();
1108 
1109 	float speedMult, biteMult, fishPoison, defenseMult, energyMult, poison, light, petPower, liPower;
1110 	Timer speedMultTimer, biteMultTimer, fishPoisonTimer, defenseMultTimer, liPowerTimer;
1111 	Timer invincibleTimer;
1112 	Timer regenTimer, tripTimer;
1113 	Timer energyTimer, poisonTimer, poisonBitTimer;
1114 	Timer webTimer, webBitTimer, lightTimer, petPowerTimer;
1115 
1116 	float speedMult2;
1117 
1118 	void eatBeast(const EatData &eatData);
1119 	void removeNaijaEat(int idx);
1120 	void removeLastNaijaEat();
1121 	EatData *getLastNaijaEat();
1122 	bool isNaijaEatsEmpty();
1123 
1124 	void loadPetData();
1125 	PetData *getPetData(int idx);
1126 
1127 	std::vector<EatData> naijaEats;
1128 
1129 	std::vector<PetData> petData;
1130 
1131 	IngredientDescriptions ingredientDescriptions;
1132 
1133 	std::string getIngredientAffectsString(IngredientData *data);
1134 
1135 	WorldMap worldMap;
1136 
1137 	StringBank stringBank;
1138 
1139 	TreasureData treasureData;
1140 
1141 	void loadTreasureData();
1142 
1143 	void learnRecipe(Recipe *r, bool effects=true);
1144 	void learnRecipe(const std::string &result, bool effects=true);
1145 
1146 	float poisonBitTime, poisonBitTimeAvatar;
1147 
1148 	MenuPage lastMenuPage, lastOptionsMenuPage;
1149 
1150 	enum { DUALFORM_NAIJA = 0, DUALFORM_LI = 1 };
1151 	int dualFormMode, dualFormCharge;
1152 
1153 	BeaconData *getBeaconByIndex(int index);
1154 	void setBeacon(int index, bool v, Vector pos=Vector(0,0,0), Vector color=Vector(1,1,1));
1155 
1156 	int foodSortType;
1157 	std::vector<FoodSortOrder> sortByType, sortByHeal, sortByIngredients, sortByUnsort;
1158 
1159 	StatsAndAchievements *statsAndAchievements;
1160 
1161 protected:
1162 	std::vector<EatData> eats;
1163 	std::vector<float> speedTypes;
1164 	float story;
1165 	WorldType worldType;
1166 
1167 	std::vector<int> items;
1168 	std::vector<int> spells;
1169 	typedef std::map<std::string,int> Flags;
1170 	Flags flags;
1171 
1172 	int intFlags[MAX_FLAGS];
1173 	typedef std::map<std::string,std::string> StringFlags;
1174 	StringFlags stringFlags;
1175 private:
1176 	void clearIngredientData();
1177 
1178 	IngredientDatas ingredients; // held ingredients
1179 	IngredientDatas ingredientData; // all possible ingredients
1180 
1181 	typedef std::map<std::string,std::string> IngredientNameMap;
1182 	IngredientNameMap ingredientDisplayNames;
1183 };
1184 
1185 class Profile
1186 {
1187 public:
1188 	Profile();
1189 	std::string name;
1190 };
1191 
1192 enum SaveSlotMode
1193 {
1194 	SSM_NONE = -1,
1195 	SSM_SAVE = 0,
1196 	SSM_LOAD = 1
1197 };
1198 
1199 extern GameplayVariables *vars;
1200 
1201 #include "UserSettings.h"
1202 
1203 struct DemoFrame
1204 {
1205 	float t;
1206 	Vector avatarPos, vel, vel2;
1207 	Mouse mouse;
1208 	float rot;
1209 };
1210 
1211 class Demo
1212 {
1213 public:
1214 	enum {
1215 		DEMOMODE_NONE		= -1,
1216 		DEMOMODE_RECORD		= 0,
1217 		DEMOMODE_PLAYBACK	= 1
1218 	};
1219 	Demo();
1220 	void toggleRecord(bool on);
1221 	void togglePlayback(bool on);
1222 	void renderFramesToDisk();
1223 	void clearRecordedFrames();
1224 
1225 	void update(float dt);
1226 
1227 	bool getQuitKey();
1228 
1229 	void save(const std::string &name);
1230 	void load(const std::string &name);
1231 
1232 	int frame;
1233 	float time;
1234 	float timeDiff;
1235 	std::vector <DemoFrame> frames;
1236 	int mode;
1237 };
1238 
1239 enum NagType
1240 {
1241 	NAG_TOTITLE		= 0,
1242 	NAG_QUIT		= 1
1243 };
1244 
1245 class DSQ : public Core
1246 {
1247 public:
1248 	DSQ(const std::string& fileSystem, const std::string& extraDataDir);
1249 	~DSQ();
1250 
1251 	void init();
1252 	void shutdown();
1253 
1254 	void toggleInputGrabPlat(bool on);
1255 
1256 	void toggleBlackBars(bool on, float t=0);
1257 
1258 	void setCursor(CursorType type);
1259 
1260 	Quad *cursor, *cursorGlow, *cursorBlinker;
1261 	Quad *overlay, *tfader, *overlay2, *overlay3, *overlayRed;
1262 	Quad *sceneColorOverlay;
1263 	Quad *bar_left, *bar_right, *bar_up, *bar_down;
1264 	Quad *barFade_left, *barFade_right;
1265 
1266 	CountedPtr<Texture> texCursor, texCursorSwim, texCursorBurst, texCursorSing, texCursorLook;
1267 
1268 	void setBlackBarsColor(Vector color);
1269 
1270 	void toggleFullscreen();
1271 
1272 	void setTexturePointers();
1273 
1274 	void fade(float alpha, float time);
1275 
1276 	void applyParallaxUserSettings();
1277 
1278 	void lockMouse();
1279 
1280 	void nag(NagType type);
1281 
1282 	void action(int id, int state);
1283 
1284 	void title(bool fadeMusic=true);
1285 
1286 	void cutsceneEffects(bool on);
1287 
1288 	bool isScriptRunning();
1289 	void delay(float dt); // active delay - game continues to run
1290 
1291 	void newGame();
1292 
1293 	Game *game;
1294 
1295 	bool isQuitFlag();
1296 
1297 	void jiggleCursor();
1298 
1299 	SFXLoops loops;
1300 	SubtitlePlayer subtitlePlayer;
1301 
1302 	void onPlayedVoice(const std::string &name);
1303 
1304 	NagType nagType;
1305 
1306 	int getEntityLayerToLayer(int layer);
1307 
1308 	void addElement(Element *e);
getNumElements()1309 	int getNumElements() const {return elements.size();}
getElement(int idx)1310 	Element *getElement(int idx) const {return elements[idx];}
getFirstElementOnLayer(int layer)1311 	Element *getFirstElementOnLayer(int layer) const {return layer<0 || layer>15 ? 0 : firstElementOnLayer[layer];}
1312 	void clearElements();
1313 	// Used only by scene editor:
1314 	void removeElement(int idx);
1315 	void removeElement(Element *e);
getElementsCopy()1316 	ElementContainer getElementsCopy() const {return elements;}
1317 
1318 protected:  // These should never be accessed from outside (use the functions above).
1319 	ElementContainer elements;
1320 	Element *firstElementOnLayer[16];
1321 public:
1322 
1323 	void addEntity(Entity *entity);
1324 	void removeEntity(Entity *e);
1325 	void clearEntities();
1326 
1327 	EntityContainer entities;
1328 
1329 	bool useFrameBuffer;
1330 	Continuity continuity;
1331 	GameplayVariables v;
1332 	Emote emote;
1333 
1334 	void playVisualEffect(int vfx, Vector position, Entity *target=0);
1335 	void playNoEffect();
1336 
1337 	typedef std::vector<std::string> StringList;
1338 	StringList profiles;
1339 
1340 	Profile currentProfile;
1341 
1342 	AquariaScreenTransition *screenTransition;
1343 
1344 	Precacher precacher;
1345 
1346 	Entity *getFirstEntity();
1347 	Entity *getNextEntity();
1348 
1349 	std::string initScene;
1350 
1351 	bool modIsSelected;
1352 
1353 	void toggleMuffleSound(bool toggle);
1354 	void toggleInputMode();
1355 	void shakeCamera(float mag, float time);
1356 	Vector avStart;
1357 	Entity *getEntityByName(const std::string &name);
1358 	Entity *getEntityByNameNoCase(std::string name);
1359 
1360 	void doSavePoint(const Vector &position);
1361 	std::string getEntityFlagName(Entity *e);
1362 	std::string getUserInputString(std::string label, std::string t="", bool allowNonLowerCase=false);
1363 	Vector getUserInputDirection(std::string label);
1364 	bool onPickedSaveSlot(AquariaSaveSlot *slot);
1365 	void doSaveSlotMenu(SaveSlotMode ssm, const Vector &position = Vector(0,0,0));
1366 	void doModSelect();
1367 	void doLoadMenu();
1368 	void onExitSaveSlotMenu();
1369 	ScriptInterface scriptInterface;
1370 	bool runScript(const std::string &name, const std::string &func="", bool ignoremissing = false);
1371 	bool runScriptNum(const std::string &name, const std::string &func="", float num=0);
1372 	void collectScriptGarbage();
1373 
1374 	ParticleEffect *spawnParticleEffect(const std::string &name, Vector position, float rot=0, float t=0, int layer=LR_PARTICLES, float follow=0);
1375 	void spawnAllIngredients(const Vector &position);
1376 
1377 	std::string getDialogueFilename(const std::string &f);
1378 
1379 	bool isShakingCamera();
1380 
1381 	std::string languagePack;
1382 
1383 	int getEntityTypeIndexByName(std::string s);
1384 	void screenMessage(const std::string &msg);
1385 #ifdef AQUARIA_BUILD_CONSOLE  // No need to override it otherwise.
1386 	void debugLog(const std::string &s);
1387 #endif
1388 	void toggleConsole();
1389 	void toggleEffects();
1390 	void debugMenu();
1391 
1392 	std::string dialogueFile;
1393 
1394 	void takeScreenshot();
1395 	void takeScreenshotKey();
1396 
1397 	void jumpToSection(InStream &inFile, const std::string &section);
1398 
1399 	void generateCollisionMask(RenderObject *r);
1400 	void toggleRenderCollisionShapes();
1401 
1402 	void voice(const std::string &file, float volMod = -1);
1403 	void voiceOnce(const std::string &file);
1404 	void voiceInterupt(const std::string &file);
1405 	void stopVoice();
1406 	Vector getNoteColor(int note);
1407 	int getRandNote();
1408 	Vector getNoteVector(int note, float mag=1);
1409 	void toggleCursor(bool v, float t = -1);
1410 
1411 	bool isDeveloperKeys();
1412 	bool canOpenEditor() const;
1413 
1414 	void loadElementEffects();
1415 	ElementEffect getElementEffectByIndex(int e);
1416 	typedef std::vector<ElementEffect> ElementEffects;
1417 	ElementEffects elementEffects;
1418 
1419 	bool playedVoice(const std::string &file);
1420 
1421 	bool voiceOversEnabled;
1422 	int recentSaveSlot;
1423 
1424 	void playPositionalSfx(const std::string &name, const Vector &position, float freq=1.0f, float fadeOut=0, SoundHolder *holder = 0);
1425 
1426 	void playMenuSelectSfx();
1427 
1428 	InterpolatedVector gameSpeed;
1429 
1430 	InputMode inputMode;
1431 	void setInputMode(InputMode mode);
1432 
1433 	void rumble(float leftMotor, float rightMotor, float time);
1434 	void vision(std::string folder, int num, bool ignoreMusic = false);
1435 
1436 	void watch(float t, int canQuit = 0);
1437 
1438 	std::string lastVoiceFile;
1439 
1440 	UserSettings user, user_backup, user_bcontrol;
1441 
1442 	void prepScreen(bool t);
1443 	SaveSlotMode saveSlotMode;
1444 	bool inModSelector;
1445 
1446 	void createSaveSlots(SaveSlotMode ssm = SSM_NONE);
1447 	void nextSaveSlotPage();
1448 	void prevSaveSlotPage();
1449 	void createSaveSlotPage();
1450 	void clearSaveSlots(bool trans);
1451 	void hideSaveSlots();
1452 	void transitionSaveSlots();
1453 	void hideSaveSlotCrap();
1454 
1455 	void createModSelector();
1456 	void clearModSelector();
1457 	bool mountModPackage(const std::string&);
1458 	bool modIsKnown(const std::string& name);
1459 	void unloadMods();
1460 	static void loadModsCallback(const std::string &filename, intptr_t param);
1461 	static void loadModPackagesCallback(const std::string &filename, intptr_t param);
1462 
1463 	bool doScreenTrans;
1464 
1465 	AquariaSaveSlot *selectedSaveSlot;
1466 	void setStory();
1467 
1468 	bool disableMiniMapOnNoInput;
1469 
1470 	std::string returnToScene;
1471 
1472 	Demo demo;
1473 
1474 	DebugFont *fpsText, *cmDebug;
1475 #ifdef AQUARIA_BUILD_CONSOLE
1476 	DebugFont *console;
1477 #endif
1478 	BitmapText *versionLabel;
1479 	ProfRender *profRender;
1480 
1481 	void setVersionLabelText();
1482 
1483 	float menuSelectDelay;
1484 	float timer;
1485 
1486 	Mod mod;
1487 
1488 	void loadMods();
1489 	void applyPatches();
1490 	void refreshResourcesForPatch(const std::string& name);
1491 	void applyPatch(const std::string& name);
1492 	void unapplyPatch(const std::string& name);
isPatchActive(const std::string & name)1493 	bool isPatchActive(const std::string& name) { return activePatches.find(name) != activePatches.end(); }
1494 
1495 	std::vector<ModEntry> modEntries;
1496 	std::set<std::string> activePatches;
1497 	int selectedMod;
1498 	ModSelectorScreen *modSelectorScr;
1499 
1500 	void startSelectedMod();
1501 	ModEntry* getSelectedModEntry();
1502 
1503 #ifdef BBGE_BUILD_ACHIEVEMENTS_INTERNAL
1504 	BitmapText *achievement_text;
1505 	Quad *achievement_box;
1506 #endif
1507 
1508 	BitmapText *subtext;
1509 	Quad *subbox;
1510 
1511 	BmpFont font, smallFont, subsFont, goldFont, smallFontRed;
1512 	TTFFont fontArialSmall, fontArialBig, fontArialSmallest;
1513 	unsigned char *arialFontData;
1514 	unsigned long arialFontDataSize;
1515 
1516 	void loadFonts();
1517 
1518 
1519 	void instantQuit();
1520 
1521 	void centerText(const std::string &text);
1522 	void centerMessage(const std::string &text, float y=300, int type=0);
1523 
1524 	bool routeShoulder;
1525 
1526 	void toggleVersionLabel(bool on);
1527 
1528 	void onConfirmYes();
1529 	void onConfirmNo();
1530 
1531 	bool confirm(const std::string &text, const std::string &image="", bool ok=false, float countdown=0.0f);
1532 
1533 	std::string particleBank1;
1534 	std::string particleBank2;
1535 
1536 	std::string shotBank1;
1537 	std::string shotBank2;
1538 
1539 
1540 	int dsq_filter;
1541 	void setFilter(int dsqFilterCode);
1542 
1543 
1544 	enum Difficulty
1545 	{
1546 		DIFF_NORMAL		= 0,
1547 		DIFF_EASY		= 1
1548 	};
1549 
1550 	Difficulty difficulty;
1551 
1552 	std::string getSaveDirectory();
1553 
1554 	void clickRingEffect(Vector position, int type=0, Vector color=Vector(1,1,1), float ut=0);
1555 
1556 	void bindInput();
1557 
1558 	void forceInputGrabOff();
1559 
1560 	int weird;
1561 
1562 	void setCutscene(bool on, bool canSkip=false);
1563 	bool isInCutscene();
1564 	bool isCutscenePaused();
1565 	void pauseCutscene(bool on);
1566 	bool canSkipCutscene();
1567 	bool isSkippingCutscene();
1568 
1569 	virtual void onBackgroundUpdate();
1570 
1571 	void resetLayerPasses();
1572 	bool isMiniMapCursorOkay();
1573 
1574 protected:
1575 
1576 	Quad *cutscene_bg;
1577 	BitmapText *cutscene_text;
1578 	BitmapText *cutscene_text2;
1579 
1580 	bool cutscenePaused;
1581 	bool inCutscene;
1582 	bool _canSkipCutscene;
1583 	bool skippingCutscene;
1584 
1585 	ActionInput *almb, *armb;
1586 
1587 	void recreateBlackBars();
1588 
1589 	bool watchQuitFlag, watchForQuit;
1590 
1591 	int confirmDone;
1592 
1593 	AquariaMenuItem *cancel, *arrowUp, *arrowDown;
1594 
1595 	float noEffectTimer;
1596 	void destroyFonts();
1597 
1598 	void onReloadResources();
1599 
1600 	void unloadDevice();
1601 	void reloadDevice();
1602 
1603 	void onSwitchScreenMode();
1604 	void onAltTab();
1605 
1606 	void onPlayVoice();
1607 	void onStopVoice();
1608 
1609 	Entity **iter;
1610 	Quad *blackout;
1611 	void updatepecue(float dt);
1612 	std::vector<PECue> pecue;
1613 
1614 	void onMouseInput();
1615 	std::vector<std::string> voxQueue;
1616 
1617 #ifdef AQUARIA_BUILD_CONSOLE
1618 	std::vector<std::string> consoleLines;
1619 #endif
1620 
1621 	std::vector <AquariaSaveSlot*> saveSlots;
1622 
1623 	BitmapText *expText, *moneyText;
1624 
1625 	void clearMenu(float t = 0.01);
1626 	std::vector <RenderObject*> menu;
1627 	BitmapText *saveSlotPageCount;
1628 
1629 	void updateSaveSlotPageCount();
1630 
1631 	float shakeCameraTimer;
1632 	float shakeCameraMag;
1633 	std::string currentPortrait;
1634 
1635 	void onUpdate(float dt);
1636 	void onRender();
1637 
1638 	void modifyDt(float &dt);
1639 };
1640 
1641 extern DSQ *dsq;
1642 
1643 #endif
1644 
1645