diff options
Diffstat (limited to 'ueditor.rpy')
-rw-r--r-- | ueditor.rpy | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/ueditor.rpy b/ueditor.rpy index b7a98b8..c5a79fc 100644 --- a/ueditor.rpy +++ b/ueditor.rpy @@ -153,6 +153,9 @@ screen units_editor(): textbutton _("Save") action Function(ueditor_save) textbutton _("Close") action Return() + null width 20 + textbutton _("Recalc") action Function(ueditor_recalc) + null width 20 textbutton _("New Sub") action Function(ueditor_new, True) textbutton _("New Unit") action Function(ueditor_new) @@ -249,6 +252,38 @@ init python: renpy.notify("New unit added: %d" % ueid) return + def ueditor_recalc(): + global uedit + uedit=allunitsbase[current] + job=uedit["job"] + rar=uedit["rare"] + STR=0 + HP=0 + # Sum must be 800 + if job == 1: + STR=300;HP=500; # Swordsman (DEF+) + elif job == 2: + STR=400;HP=400; # Assassin (TODO) + elif job == 3: + STR=500;HP=300; # Mage (ATK+) + elif job == 4: + STR=400;HP=400; # Archer (balanced) + elif job == 5: + STR=600;HP=200; # Gunner + # Apply rarity modified + STR*=(rar+1)/2.0 + HP*=(rar+1)/2.0 + STR=int(STR) + HP=int(HP) + # Save data + renpy.notify("%s\nHP %d->%d \n ATK %d->%d" % (uedit["name"], + uedit["hp"], HP, + uedit["strength"], STR)) + uedit["strength"]=copy.copy(STR) + uedit["hp"]=copy.copy(HP) + allunitsbase[current]["strength"]=copy.copy(STR) + allunitsbase[current]["hp"]=copy.copy(HP) + return def ueditor_delete(key1, key2=None, key3=None, key4=None): @@ -372,11 +407,11 @@ label units_editors: $ uedit=allunitsbase[0] $ current=0 $print("") - $print(".:: THE BUILT-IN QUEST EDITOR ::.") + $print(".:: THE BUILT-IN UNIT EDITOR ::.") $print("Use ESC to redraw screen, saving input") $print("") call screen units_editor - $print("Quest Editor closed") + $print("Unit Editor closed") menu: "Save Changes": $ ueditor_save() |