Changes between Version 4 and Version 5 of Unit_Summary_Table_Generator


Ignore:
Timestamp:
Jan 21, 2013, 11:46:55 PM (11 years ago)
Author:
Jonathan Waller
Comment:

Add training time

Legend:

Unmodified
Added
Removed
Modified
  • Unit_Summary_Table_Generator

    v4 v5  
    1414                unitInfo = loadData(d("Entity").attr("parent")+".xml", basePath, general, cost, attackRanged, attackMelee, armour)
    1515        else:
    16                 unitInfo = {'general':{}, 'cost':[0,0,0,0], 'attackRanged':[0,0,0,0], 'attackMelee':[0,0,0], 'armour':[0,0,0]}
     16                unitInfo = {'general':{}, 'cost':[0,0,0,0,0], 'attackRanged':[0,0,0,0], 'attackMelee':[0,0,0], 'armour':[0,0,0]}
    1717       
    1818        for attr in general:
     
    4040def printUnit(fileName, basePath):
    4141        general = ["GenericName", "SpecificName", "Vision > Range", "Health > Max", "WalkSpeed"]
    42         cost = ["Cost > * > food", "Cost > * > wood", "Cost > * > metal", "Cost > * > stone"]
     42        cost = ["Cost > * > food", "Cost > * > wood", "Cost > * > metal", "Cost > * > stone", "Cost > BuildTime"]
    4343        attackRanged = ["Attack > Ranged > Pierce", "Attack > Ranged > Hack", "Attack > Ranged > Crush", "Attack > Ranged > MaxRange"]
    4444        attackMelee = ["Attack > Melee > Pierce", "Attack > Melee > Hack", "Attack > Melee > Crush"]
    4545        armour = ["Armour > Pierce", "Armour > Hack", "Armour > Crush"]
    4646        generalTitles = ["Unit", "Specific Name", "Line of Sight", "Health"]
    47         costTitles = ["F", "W", "G", "S"]
     47        costTitles = ["F", "W", "G", "S", "T"]
    4848        aTitles = ["P", "H", "C"]
    4949       
     
    6464                        outString += " || "
    6565
    66         for i in range(4):
     66        for i in range(len(unitStuff["cost"])):
    6767                if unitStuff["cost"][i] != 0:
    6868                        outString += costTitles[i] + "{0:g} ".format(unitStuff["cost"][i])
     
    9797f.write("A more detailed description of the units is available on the [wiki:Manual_Units units page].\n\n")
    9898f.write("The following abbreviations are used in this page\n\n")
    99 f.write("  F = [wiki:Manual_Terminology#Food food], W = [wiki:Manual_Terminology#Wood wood], M = [wiki:Manual_Terminology#Metal metal], S = stone, H = Hack, P = Pierce, C = Crush\n\n")
     99f.write("  F = [wiki:Manual_Terminology#Food food], W = [wiki:Manual_Terminology#Wood wood], M = [wiki:Manual_Terminology#Metal metal], S = stone, T = training time (seconds), H = Hack, P = Pierce, C = Crush\n\n")
    100100f.write("The data is based on the basic form for all units that can be promoted.\n\n")
    101101