forked from elonafoobar/elonafoobar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.cpp
76 lines (67 loc) · 1.3 KB
/
event.cpp
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
#include "event.hpp"
#include "enums.hpp"
#include "variables.hpp"
namespace elona
{
int evproc = 0;
// TODO add serialization routines local to this file
int event_id()
{
if (evnum <= 0)
{
return -1;
}
return evlist(evnum - 1);
}
bool event_was_set()
{
return evnum != 0;
}
int event_find(int prm_288)
{
int f_at_m17 = 0;
f_at_m17 = 0;
for (int cnt = 0, cnt_end = (evnum); cnt < cnt_end; ++cnt)
{
if (evlist(cnt) == prm_288)
{
f_at_m17 = 1;
}
}
return f_at_m17;
}
void event_add(int prm_289, int prm_290, int prm_291)
{
if (evproc)
{
evlist(evnum) = evlist(evnum - 1);
evdata1(evnum) = evdata1(evnum - 1);
evdata2(evnum) = evdata2(evnum - 1);
evlist(evnum - 1) = prm_289;
evdata1(evnum - 1) = prm_290;
evdata2(evnum - 1) = prm_291;
}
else
{
evlist(evnum) = prm_289;
evdata1(evnum) = prm_290;
evdata2(evnum) = prm_291;
}
++evnum;
return;
}
turn_result_t event_start_proc()
{
evproc = 1;
proc_event();
evproc = 0;
--evnum;
evlist(evnum) = 0;
if (chatteleport == 1)
{
chatteleport = 0;
return turn_result_t::exit_map;
}
return turn_result_t::turn_begin;
}
} // namespace elona