################################################################################# # This file is part of Spheres. # Copyright (C) 2022 Jesusalva # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################# # Editor labels for developers label ueditor_supernew: $ rar = int(renpy.input("What is the base unit rarity?", allow="0123456789")) python: c = Counter() for u in allunitsbase: if u["unit_id"] % 10: continue if u["flags"]: continue c[u["rare"]] += 1 lastid = c[rar] + 1 # We start at 1, not at 0 $ unitid = int("1%02d%03d" % (rar, lastid)) $ name = renpy.input("How is this [rar]★ unit called?\nIts ID is: [unitid]") menu: "Male": $ sex = 0 "Female": $ sex = 1 menu: "Please select the unit element:" "Fire": $ ele = Ele_Fire "Water": $ ele = Ele_Water "Nature": $ ele = Ele_Nature "Light": $ ele = Ele_Light "Shadow": $ ele = Ele_Shadow menu: "Please select the unit job:" "Swordsman (DEF+)": $ job = 1 "Assassin (Balanced)" if False: $ job = 2 "Mage (ATK+)": $ job = 3 "Archer (Balanced)": $ job = 4 "Gunner (ATK++)" if False: $ job = 5 show expression Text("[name]\n") at truecenter as ipsum with None $ desc = renpy.input("Describe the unit basic description.", default="A standard unit in the game.") show expression Text("[name]\n[desc]") at truecenter as ipsum with None $ desd = renpy.input("Describe the unit 2nd form description.") or "" show expression Text("[name]\n[desc] [desd]") at truecenter as ipsum with None $ dese = renpy.input("Describe the unit 2nd form description.") or "" hide ipsum with None python: # Create the randomness seed ssr=renpy.random.randint(-10, 15) shp=renpy.random.randint(-10, 15) i=0 while i < 3: if i == 0: atd = "" else: atd = " +%d" % i allunitsbase.append({"skill_id": 0, "strength": 500, "rare": rar, "name": "%s%s" % (name, atd), "ability_id": 0, "attribute": ele, "hp": 500, "unit_id": unitid*100+i, "sex": sex, "max_level": 10+(rar*10), "job": job, "cost": rar**2, "flags": 0, "unit_base_id": unitid, "flavor": desc}) current = len(allunitsbase)-1 ueditor_recalc(False, shp, ssr) rar += 1 i+=1 if i == 1: desc+=" %s" % desd elif i == 2: desc+=" %s" % dese pass $ ueditor_save() jump units_editors