16 // for UpdateBlockedStates
17 #define RIGHTMASK 0x01
21 #define ALLDIRMASK (LEFTMASK | RIGHTMASK | UPMASK | DOWNMASK)
23 // highest addressable flag by tsc scripts etc
24 #define NUM_GAMEFLAGS 8000
26 // switchstage.mapno is set to this to load a game
27 #define MAPNO_SPECIALS 1000
28 #define LOAD_GAME 1000
30 #define NEW_GAME_FROM_MENU 1002 // new game (include Kazuma cutscene)
31 #define LOAD_GAME_FROM_MENU 1003 // load game (from title screen, include weapon slide)
32 #define START_REPLAY 1004
34 // game modes (changes *tickfunction)
37 GM_NONE
, // default mode at startup & shutdown
38 GM_NORMAL
, // playing the game
39 GM_INVENTORY
, // in inventory screen
40 GM_MAP_SYSTEM
, // viewing Map System
41 GM_ISLAND
, // XX1 good-ending island-crash cutscene
42 GM_CREDITS
, // <CRE credits
44 GM_TITLE
, // title screen
46 GP_PAUSED
, // pausemode: Pause (use game.pause())
47 GP_OPTIONS
, // pausemode: Options (use game.pause())
52 // note: this structure is memsetted at 0 at startup.
53 // ensure it doesn't contain any non-POD types that would be harmed by this.
66 uint32_t counter
; // Nikumaru counter value
73 bool DrawBoundingBoxes
;
76 // if mapno becomes >= 0 the stage ends and we switch to the new stage
85 // game flags and skipflags as set by scripts
86 bool flags
[NUM_GAMEFLAGS
];
87 bool skipflags
[NUM_GAMEFLAGS
];
89 // earthquake effect; <QUA command
96 Object
*object
; // if != NULL, a boss bar is shown displaying this object's remaining health
97 int starting_hp
; // HP boss had when <BSL was called
98 bool defeated
; // set to true when boss is defeated
102 StageBossManager stageboss
;
104 // set by enemies in Labyrinth M and by Almond Core to tell
105 // curly where to shoot at (it's like a hint)
112 int ffwdtime
; // debug option: disables speed-limiting for ffwdtime ticks
114 // ---------------------------------------
116 // static member functions--not private (Game is an object, not a namespace)
118 static bool initlevel();
119 static bool createplayer();
121 static void switchmap(int mapno
, int scriptno
=0, int px
=0, int py
=0);
124 static bool setmode(int newmode
, int param
=0, bool force
=false);
125 static bool pause(int pausemode
, int param
=0);
131 // NPC flags definitions
132 #define FLAG_SOLID_MUSHY 0x0001 // object blocks player but is a little "mushy" (normal solid state for enemies)
133 #define FLAG_IGNORETILE44 0x0002
134 #define FLAG_INVULNERABLE 0x0004
135 #define FLAG_IGNORE_SOLID 0x0008
136 #define FLAG_BOUNCY 0x0010 // when SOLID_BRICK also set, acts like a mini trampoline
137 #define FLAG_SHOOTABLE 0x0020
138 #define FLAG_SOLID_BRICK 0x0040 // object's entire bbox is rock-solid, just like a solid tile
139 #define FLAG_NOREARTOPATTACK 0x0080
140 #define FLAG_SCRIPTONTOUCH 0x0100
141 #define FLAG_SCRIPTONDEATH 0x0200
142 #define FLAG_DROP_POWERUPS_DONTUSE 0x0400 // not used here because it doesn't seem to be set on some npc.tbl entries which DO in fact spawn powerups; see the nxflag which replaces it
143 #define FLAG_APPEAR_ON_FLAGID 0x0800
144 #define FLAG_FACES_RIGHT 0x1000
145 #define FLAG_SCRIPTONACTIVATE 0x2000
146 #define FLAG_DISAPPEAR_ON_FLAGID 0x4000
147 #define FLAG_SHOW_FLOATTEXT 0x8000
149 // NXEngine flag definitions
150 #define NXFLAG_FOLLOW_SLOPE 0x0001 // enable moving up/down slopes when moving horizontally
151 #define NXFLAG_SLOW_X_WHEN_HURT 0x0002 // move at half X speed when shaking from damage
152 #define NXFLAG_SLOW_Y_WHEN_HURT 0x0004 // move at half Y speed when shaking from damage
153 #define NXFLAG_THUD_ON_RIDING 0x0008 // if set there is a "thud" sound when player lands on it
154 #define NXFLAG_NO_RESET_YINERTIA 0x0010 // don't zero yinertia on blocku/blockd
155 #define NXFLAG_CONSOLE_ANIMATE 0x0020 // spawned at console and is implicit target of subsequent animate commands
157 #define NXFLAG_SLOW_WHEN_HURT (NXFLAG_SLOW_X_WHEN_HURT | NXFLAG_SLOW_Y_WHEN_HURT)
160 extern TextBox textbox
;
162 extern Object
*onscreen_objects
[MAX_OBJECTS
];
163 extern int nOnscreenObjects
;
165 void debug(const char *fmt
, ...);
166 void quake(int quaketime
, int snd
=-1);
167 void megaquake(int quaketime
, int snd
=-1);
170 bool game_load(int num
);
171 bool game_load(Profile
*p
);
172 bool game_save(int num
);
173 bool game_save(Profile
*p
);