1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef AGS_ENGINE_AC_EVENT_H
24 #define AGS_ENGINE_AC_EVENT_H
25 
26 #include "ags/engine/ac/runtime_defines.h"
27 #include "ags/engine/script/runtime_script_value.h"
28 
29 namespace AGS3 {
30 
31 // parameters to run_on_event
32 #define GE_LEAVE_ROOM 1
33 #define GE_ENTER_ROOM 2
34 #define GE_MAN_DIES   3
35 #define GE_GOT_SCORE  4
36 #define GE_GUI_MOUSEDOWN 5
37 #define GE_GUI_MOUSEUP   6
38 #define GE_ADD_INV       7
39 #define GE_LOSE_INV      8
40 #define GE_RESTORE_GAME  9
41 
42 #define MAXEVENTS 15
43 
44 #define EV_TEXTSCRIPT 1
45 #define EV_RUNEVBLOCK 2
46 #define EV_FADEIN     3
47 #define EV_IFACECLICK 4
48 #define EV_NEWROOM    5
49 #define TS_REPEAT   1
50 #define TS_KEYPRESS 2
51 #define TS_MCLICK   3
52 #define EVB_HOTSPOT 1
53 #define EVB_ROOM    2
54 
55 struct EventHappened {
56 	int type;
57 	int data1, data2, data3;
58 	int player;
59 };
60 
61 int run_claimable_event(const char *tsname, bool includeRoom, int numParams, const RuntimeScriptValue *params, bool *eventWasClaimed);
62 // runs the global script on_event fnuction
63 void run_on_event(int evtype, RuntimeScriptValue &wparam);
64 void run_room_event(int id);
65 void run_event_block_inv(int invNum, int event);
66 // event list functions
67 void setevent(int evtyp, int ev1 = 0, int ev2 = -1000, int ev3 = 0);
68 void force_event(int evtyp, int ev1 = 0, int ev2 = -1000, int ev3 = 0);
69 void process_event(EventHappened *evp);
70 void runevent_now(int evtyp, int ev1, int ev2, int ev3);
71 void processallevents(int numev, EventHappened *evlist);
72 void update_events();
73 // end event list functions
74 void ClaimEvent();
75 
76 } // namespace AGS3
77 
78 #endif
79