| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include <setjmp.h> |
| 21 |
|
| 22 |
#include "scare.h" |
| 23 |
#include "scprotos.h" |
| 24 |
|
| 25 |
#ifndef SCARE_GAMESTATE_H |
| 26 |
#define SCARE_GAMESTATE_H |
| 27 |
|
| 28 |
|
| 29 |
typedef struct sc_roomstate_s |
| 30 |
{ |
| 31 |
sc_bool visited; |
| 32 |
} sc_roomstate_t; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
enum |
| 42 |
{ OBJ_HIDDEN = -1, |
| 43 |
OBJ_HELD_PLAYER = 0, OBJ_HELD_NPC = -200, |
| 44 |
OBJ_WORN_PLAYER = -100, OBJ_WORN_NPC = -300, |
| 45 |
OBJ_PART_PLAYER = -30, OBJ_PART_NPC = -30, |
| 46 |
OBJ_ON_OBJECT = -20, OBJ_IN_OBJECT = -10 |
| 47 |
}; |
| 48 |
typedef struct sc_objectstate_s |
| 49 |
{ |
| 50 |
sc_int position; |
| 51 |
sc_int parent; |
| 52 |
sc_int openness; |
| 53 |
sc_int state; |
| 54 |
sc_bool seen; |
| 55 |
sc_bool unmoved; |
| 56 |
sc_bool static_unmoved; |
| 57 |
} sc_objectstate_t; |
| 58 |
|
| 59 |
|
| 60 |
typedef struct sc_taskstate_s |
| 61 |
{ |
| 62 |
sc_bool done; |
| 63 |
sc_bool scored; |
| 64 |
} sc_taskstate_t; |
| 65 |
|
| 66 |
|
| 67 |
enum |
| 68 |
{ ES_WAITING = 1, |
| 69 |
ES_RUNNING = 2, ES_AWAITING = 3, ES_FINISHED = 4, ES_PAUSED = 5 |
| 70 |
}; |
| 71 |
typedef struct sc_eventstate_s |
| 72 |
{ |
| 73 |
sc_int state; |
| 74 |
sc_int time; |
| 75 |
} sc_eventstate_t; |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
typedef struct sc_npcstate_s |
| 83 |
{ |
| 84 |
sc_int location; |
| 85 |
sc_int position; |
| 86 |
sc_int parent; |
| 87 |
sc_int walkstep_count; |
| 88 |
sc_int *walksteps; |
| 89 |
sc_bool seen; |
| 90 |
} sc_npcstate_t; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
typedef struct sc_resource_s |
| 99 |
{ |
| 100 |
const sc_char *name; |
| 101 |
sc_int offset; |
| 102 |
sc_int length; |
| 103 |
} sc_resource_t; |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
typedef struct sc_game_s |
| 110 |
{ |
| 111 |
sc_uint magic; |
| 112 |
|
| 113 |
|
| 114 |
sc_var_setref_t vars; |
| 115 |
sc_prop_setref_t bundle; |
| 116 |
sc_filterref_t filter; |
| 117 |
sc_memo_setref_t memento; |
| 118 |
sc_debuggerref_t debugger; |
| 119 |
|
| 120 |
|
| 121 |
struct sc_game_s *temporary; |
| 122 |
struct sc_game_s *undo; |
| 123 |
sc_bool undo_available; |
| 124 |
|
| 125 |
|
| 126 |
sc_int room_count; |
| 127 |
sc_roomstate_t *rooms; |
| 128 |
sc_int object_count; |
| 129 |
sc_objectstate_t *objects; |
| 130 |
sc_int task_count; |
| 131 |
sc_taskstate_t *tasks; |
| 132 |
sc_int event_count; |
| 133 |
sc_eventstate_t *events; |
| 134 |
sc_int npc_count; |
| 135 |
sc_npcstate_t *npcs; |
| 136 |
sc_int playerroom; |
| 137 |
sc_int playerposition; |
| 138 |
sc_int playerparent; |
| 139 |
sc_int turns; |
| 140 |
sc_int score; |
| 141 |
sc_bool bold_room_names; |
| 142 |
sc_bool verbose; |
| 143 |
sc_bool notify_score_change; |
| 144 |
sc_char *current_room_name; |
| 145 |
sc_char *status_line; |
| 146 |
sc_char *title; |
| 147 |
sc_char *author; |
| 148 |
sc_char *hint_text; |
| 149 |
|
| 150 |
|
| 151 |
sc_resource_t requested_sound; |
| 152 |
sc_resource_t requested_graphic; |
| 153 |
sc_bool stop_sound; |
| 154 |
sc_bool sound_active; |
| 155 |
|
| 156 |
sc_resource_t playing_sound; |
| 157 |
sc_resource_t displayed_graphic; |
| 158 |
|
| 159 |
|
| 160 |
sc_bool is_running; |
| 161 |
sc_bool has_completed; |
| 162 |
|
| 163 |
|
| 164 |
sc_int waitturns; |
| 165 |
|
| 166 |
|
| 167 |
sc_int waitcounter; |
| 168 |
sc_bool has_notified; |
| 169 |
sc_bool is_admin; |
| 170 |
sc_bool do_again; |
| 171 |
sc_int redo_sequence; |
| 172 |
sc_bool do_restart; |
| 173 |
sc_bool do_restore; |
| 174 |
sc_bool *object_references; |
| 175 |
sc_bool *multiple_references; |
| 176 |
sc_bool *npc_references; |
| 177 |
sc_int it_object; |
| 178 |
sc_int him_npc; |
| 179 |
sc_int her_npc; |
| 180 |
sc_int it_npc; |
| 181 |
|
| 182 |
|
| 183 |
jmp_buf quitter; |
| 184 |
} sc_game_t; |
| 185 |
|
| 186 |
#endif |