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
|
#!/usr/bin/python2.7
# Setup
class dlist(list):
def __setitem__(self, index, value):
size = len(self)
if index >= size:
self.extend(None for _ in range(size, index + 1))
list.__setitem__(self, index, value)
class Skill:
def __init__(self, ID, NAME, DESC):
self.id=ID
self.name=NAME
self.desc=DESC
def skill_tree(sk1=None, sk2=None, sk3=None, sk4=None, sk5=None):
return [sk1, sk2, sk3, sk4, sk5]
academy={}
# Skill shortcuts
SK_HEAL=Skill("heal", "Healing", "Heals target")
SK_ABHEAL=Skill("abheal", "High Healing", "Supremely heals target")
# Scholarship
academy["scholarship"]=dlist()
academy["scholarship"].append(skill_tree(SK_HEAL, None, SK_ABHEAL, None, None))
# Functions
def headers(classe, val):
return '\n\t<dialog name="mga_%s_%s" hideText="true">\n\t\t<menu>\n' % (classe, val)
def navigation():
nav=""
nav+='\t\t\t<button x="300" y="20" name="Next" value="Ok" />\n'
return nav
def tail():
return '\t\t</menu>\n\t</dialog>\n'
def data(val):
bf='\t\t\t<image x="0" y="0" image="graphics/images/aurora/%s.png" />\n' % val
return bf
# Begin
f=open("aurora.tmp", "w")
f.write('<?xml version="1.0" encoding="utf-8"?>\n<!-- This file is generated automatically, editing it will have no effect.\n Magic Academy Learning Interface\n (C) Jesusalva, 2020 -->\n<dialogs>')
for evtc in sorted(events):
f.write(headers("none", evtc))
f.write(data(evtc))
f.write(navigation())
f.write(tail())
f.write('\n</dialogs>')
f.close()
|