diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-10-23 23:45:19 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-10-23 23:45:19 -0300 |
commit | c2ccb14ffff0e45398365e19dfd2874307ddb943 (patch) | |
tree | 976eaea586fb8f1ee0ab8cae67c69071aed8b952 /client/magicacademy.py | |
download | tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.gz tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.bz2 tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.xz tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.zip |
Initial commit
Diffstat (limited to 'client/magicacademy.py')
-rwxr-xr-x | client/magicacademy.py | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/client/magicacademy.py b/client/magicacademy.py new file mode 100755 index 0000000..c6ee44c --- /dev/null +++ b/client/magicacademy.py @@ -0,0 +1,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() + |