-
Notifications
You must be signed in to change notification settings - Fork 4
/
make_event_macros.py
70 lines (63 loc) · 1.6 KB
/
make_event_macros.py
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
from event_script import event_commands
from macros import get_script_macros
event_commands[0x5c]['macro'] = """\
@ If the Trainer flag for Trainer index is not set, this command does absolutely nothing.
.macro trainerbattle type, trainer, word, pointer1, pointer2, pointer3, pointer4
.byte 0x5c
.byte \\type
.2byte \\trainer
.2byte \\word
.if \\type == 0
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.elseif \\type == 1
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ event script
.elseif \\type == 2
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ event script
.elseif \\type == 3
.4byte \\pointer1 @ text
.elseif \\type == 4
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ text
.elseif \\type == 5
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.elseif \\type == 6
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ text
.4byte \\pointer4 @ event script
.elseif \\type == 7
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ text
.elseif \\type == 8
.4byte \\pointer1 @ text
.4byte \\pointer2 @ text
.4byte \\pointer3 @ text
.4byte \\pointer4 @ event script
.endif
.endm
"""
event_supplementary = """
@ Supplementary
.macro jumpeq dest
jumpif 1, \\dest
.endm
.macro switch var
copyvar 0x8000, \\var
.endm
.macro case condition, dest
compare 0x8000, \\condition
jumpeq \\dest
.endm
"""
def get_event_macros():
return get_script_macros(event_commands) + '\n\n' + event_supplementary
if __name__ == '__main__':
print get_event_macros()