#!/usr/bin/python3
#import turtle
#from tkinter import *
#from PIL import Image, ImageTk
#from io import BytesIO
import math
import sys

def do_one(m_name):
    for i in range(100,-1,-1):
        print( '\tExternalCondition@'+m_name+str(i)+':')
        print( '\t\tCondition: '+m_name+str(i))

        print( '\tProvidesPrerequisite@'+m_name+str(i)+':')
        print( '\t\tPrerequisite: '+m_name+str(i))
        print( '\t\tRequiresCondition: '+m_name+str(i))
    print( '')

    return

def do_two(m_name, m_upper):
    print( '^TBUILD'+m_upper+':')
    
    for i in range(100,-1,-1):
        print( '\tProductionTimeMultiplier@'+m_name+str(i)+':')
        print( '\t\tMultiplier: '+str(i))
        print( '\t\tPrerequisites: ~toxic_enabled, ~'+m_name+str(i))
    print( '')
    return

def do_three(m_scheme, m_name):

        sys.stdout.write( '\t\t\tScheme'+str(m_scheme)+': '+m_name)
#        m = 0
#        for k in m_range:
#            if m == 0:
#                m = 1
#                sys.stdout.write(str(k))
#            else:
#                sys.stdout.write(', '+str(k))
        print('')
            
            #print( '\t\t\tfactory99: 99%')
            #print( '\t\t\tfactory98: 98%')
            #print( '\t\t\tfactory97: 97%')


#war: { 100, 86, 75, 67, 60, 55, 50 }
#vehicle: { 100, 75, 60, 50 }

if __name__ == "__main__":
    
    print('Player:')
    do_one('fact')
    do_one('weap')
    do_one('tent')
    do_one('barr')
    do_one('hpad')
    do_one('afld')
    do_one('kenn')
    do_one('spen')
    do_one('syrd')
    do_one('afld.ukraine')

    do_two('fact','fact'.upper() )
    do_two('weap','weap'.upper() )
    do_two('tent','tent'.upper() )
    do_two('barr','barr'.upper() )
    do_two('hpad','hpad'.upper() )
    do_two('afld','afld'.upper() )
    do_two('kenn','kenn'.upper() )
    do_two('spen','spen'.upper() )
    do_two('syrd','syrd'.upper() )
    do_two('afld.ukraine', 'afld.ukraine')
    
    print( '\tScriptLobbyDropdown@FactoryVehicle:'+' #Toxicity Level')
    print( '\t\tID: FactoryVehicle')
    print( '\t\tLabel: Factory Count Vehicle')
    print( '\t\tDescription: Default Toxicity Level Vehicle Buildings if Toxic Rules Enabled.')
    print( '\t\tDefault: Scheme3')
    print( '\t\tValues:')

    do_three(1, 'RA Default')
    do_three(2, 'Poops Default')
    do_three(3, 'Ultimate Default')
    do_three(4, 'Zypres')

    print( '\t\tLocked: false')
    print( '\t\tVisible: true   ')
    print( '\t\tDisplayOrder: '+str(101) )

    print( '\tScriptLobbyDropdown@FactoryWar:'+' #Toxicity Level')
    print( '\t\tID: FactoryWar')
    print( '\t\tLabel: Factory Count War')
    print( '\t\tDescription: Default Toxicity Level War Buildings if Toxic Rules Enabled.')
    print( '\t\tDefault: Scheme3')
    print( '\t\tValues:')

    do_three(1, 'RA Default')
    do_three(2, 'Poops Default')
    do_three(3, 'Ultimate Default')
    do_three(4, 'Zypres')

    print( '\t\tLocked: false')
    print( '\t\tVisible: true   ')
    print( '\t\tDisplayOrder: '+str(102) )

#        print(i)
#          factorycount = 1        Multiplier: 100     Conditonname:   1
#          factorycount = 2        Multiplier: 75      Conditonname:   2
#          factorycount = 3        Multiplier: 50      Conditonname:   3
#          factorycount = 4        Multiplier: 40      Conditonname:   4
#          factorycount = 5        Multiplier: 30      Conditonname:   5
#          factorycount = 6        Multiplier: 20      Conditonname:   6
#          factorycount = 7        Multiplier: 15      Conditonname:   7
#          factorycount <= 9       Multiplier: 10      Conditonname:   8
#          factorycount <= 12      Multiplier: 7       Conditonname:   10
#          factorycount <= 15      Multiplier: 5       Conditonname:   13
#          factorycount <= 16      Multiplier: 4       Conditonname:   17
#          factorycount <= 24      Multiplier: 2       Conditonname:   21
#                                  Multiplier: 1       Conditonname:   25

#          factorycount = 1        Multiplier: 100     Conditonname:   1
#          factorycount = 2        Multiplier: 75      Conditonname:   2
#          factorycount = 3        Multiplier: 50      Conditonname:   3
#          factorycount = 4        Multiplier: 40      Conditonname:   4
#          factorycount = 5        Multiplier: 30      Conditonname:   5
#          factorycount = 6        Multiplier: 20      Conditonname:   6
#          factorycount = 7        Multiplier: 15      Conditonname:   7
#          factorycount <= 9       Multiplier: 10      Conditonname:   8
#          factorycount <= 12      Multiplier: 7       Conditonname:   10
#          factorycount <= 15      Multiplier: 5       Conditonname:   13
#          factorycount <= 16      Multiplier: 4       Conditonname:   17
#          factorycount <= 24      Multiplier: 2       Conditonname:   21
#                                  Multiplier: 1       Conditonname:   25
