Exemplo n.º 1
0
def unit_action():
    action = unit_menu()
    if action.upper() == 'OUT':
        return False
    elif action == '1':
        print_units(io.get_unit_full())
        raw_input('I cannot find ... JOKE')
        return True
    elif action == '2':
        unit_id = raw_input('What is the unit id to display ? ')
        io.cls()
        print_units(io.get_unit_ids(unit_id))
        #TODO add getter in weapons and capacities
        weapon.print_weapons(io.get_unit_weapon(unit_id))
        capa.print_capacities(io.get_unit_capacities(unit_id))
        raw_input('See what I see ...')
        return True
    elif action == '3':
        squad.squad_display_full()
        add_unit(raw_input('What is the squad id ? '))
        raw_input('Unit added mother f****r')
        return True
    elif action == '4':
        capa.capacity_main()
        return True
    elif action == '5':
        raw_input('TBD  capacity => unit...')
        return True
    elif action == '6':
        raw_input('TBD  weapon  => unit...')
        return True
    else:
        raw_input('Action not allowed :(')
        return True
Exemplo n.º 2
0
def add_u_type():
    io.cls()
    print_u_types(io.get_unit_type())
    print '***********************'
    print '*   Add a unit type   *'
    print '***********************'
    print_u_types(io.set_unit_type(raw_input('What is the unit type name ? :\n')))
    raw_input('Unit type added ...')
Exemplo n.º 3
0
def capacity_menu():
    io.cls()
    print '*******************************'
    print '* Special unit abilities menu *'
    print '*******************************'
    print '1   : Add a new capacity'
    print '2   : Check a capacity'
    print '3   : Check all the capacities'
    print 'OUT : back to the previous menu'
    print '*******************************'
    return raw_input('Enter your choice : ')
Exemplo n.º 4
0
def u_type_menu():
    io.cls()
    print '******************************'
    print '**   Unit Type Management   **'
    print '*******************$$$$*******'
    print 'What do you want to do ?'
    print '1   : Check unit type list'
    print '2   : Add a new unit type'
    print 'OUT : Back to main menu'
    print '******************************'
    return raw_input('Enter your choice : ')
Exemplo n.º 5
0
def print_u_types(u_types):
    sep_line = io.add_space('',40).replace(' ', '*')
    io.cls()
    print sep_line
    print '* '+ io.add_space('Types',17) + ' list' + io.add_space('',14) + ' *'
    print '* ' + ' ID | ' + io.add_space('Unit type', 30) + ' *'
    print sep_line
    for ut in u_types:
        print_u_type(ut)
    print sep_line
    return True
Exemplo n.º 6
0
def weapon_menu():
    io.cls()
    print '***************************'
    print '*         Weapons         *'
    print '***************************'
    print '1   : Check weapon list'
    print '2   : Check one weapon'
    print '3   : Add a new weapon'
    print 'OUT : Back to the main menu'
    print '***************************'
    return raw_input('What is your choice : ')
Exemplo n.º 7
0
def index():
    io.cls()
    print '***********************************************************'
    print '**           Warhammer 40k Army list manager             **'
    print '***********************************************************'
    print '   Options : '
    print '    * 1 : Data management'
    print '    * 2 : Army list management'
    print '   Other : '
    print '    * OUT : program end'
    print '***********************************************************'
    return raw_input('Enter your choice : ')
Exemplo n.º 8
0
def codex_menu():
    io.cls()
    print '**************************'
    print '**   Codex Management   **'
    print '**************************'
    print 'What do you want to do ?'
    print '1   : Check Codex list'
    print '2   : Add a new codex'
    print '3   : Get a codex id'
    print 'OUT : Back to main menu'
    print '**************************'
    return raw_input('Enter your choice : ')
Exemplo n.º 9
0
def unit_capacity_menu(unit_id):
    io.cls()
    print '***************'
    print '* unit/ability *'
    print '***************'
    print '1   : link     '
    print '2 : : add&link'
    print 'OUT : next step'
    print '***************\n'
    print_units(io.get_unit_ids(str(unit_id)))
    print '\n'
    capa.print_capacities(io.get_unit_capacities(str(unit_id)))
    return raw_input('\nWhat do you do Sir ? ')
Exemplo n.º 10
0
def unit_weapon_menu(unit_id):
    io.cls()
    print '***************'
    print '* unit/weapon *'
    print '***************'
    print '1   : link     '
    print '2 : : add&link'
    print 'OUT : next step'
    print '***************\n'
    print_units(io.get_unit_ids(str(unit_id)))
    print '\n'
    weapon.print_weapons(io.get_unit_weapon(str(unit_id)))
    return raw_input('\nWhat do you do Sir ? ')
Exemplo n.º 11
0
def print_codex(codex):
    sep_line = io.add_space('', 40).replace(' ', '*')
    io.cls()
    print sep_line
    print '* ' + io.add_space('Codex', 17) + ' list' + io.add_space('',
                                                                    14) + ' *'
    print '* ' + ' ID | ' + io.add_space('Codex name', 30) + ' *'
    print sep_line
    print ''
    for c in codex:
        print_codex_item(c)
    print sep_line
    return True
Exemplo n.º 12
0
def unit_menu():
    io.cls()
    print '***************************'
    print '*          Units          *'
    print '***************************'
    print '1   : Check unit list'
    print '2   : Check one unit'
    print '3   : Add a new unit'
    print '4   : Capacity menu'
    print '5   : Link capacity and unit'
    print '6   : Link weapon and unit'
    print 'OUT : Back to the main menu'
    print '***************************'
    return raw_input('What is your choice : ')
Exemplo n.º 13
0
def add_unit(squad_id):
    u_data = {}
    u_data['squad'] = squad_id
    for field in conf.get_conf('unit.conf')['unit_fields'].split(','):
        if field.split(':')[0] == 'codex':
            codex.codex()
        if field.split(':')[0] == 'type':
            ut.unit_type()
        u_data[field.split(':')[0]] = raw_input(field.split(':')[1] + ' ')
    unit_id = io.set_unit(u_data)[0][0]
    raw_input('\nUnit add, now link unit and weapon   ' + str(unit_id))
    io.cls()
    unit_weapon(unit_id)
    raw_input('all weapons added, now add abilities')
    unit_capacity(unit_id)
Exemplo n.º 14
0
def add_codex():
    io.cls()
    print '****************************'
    print '*    Current codex list    *'
    print '****************************'
    print_codex(io.get_codex_full())
    print '***********************'
    print '*    Add a codex      *'
    print '***********************'
    print_codex(
        io.set_codex(
            raw_input(
                conf.get_conf('codex.conf')['get_codex_label'].split(':')[1] +
                ' : ')))
    raw_input('Codex added ...')
Exemplo n.º 15
0
def list_action():
    io.cls()
    action = list_menu()
    if action.upper() == 'OUT':
        return False
    elif action == '1':
        list_create()
        raw_input('List Created ! ')
        return True
    elif action == '2':
        list_update()
        return True
    elif action == '3':
        list_display_all()
        raw_input('Seeeeeee ! ')
        return True
    else:
        raw_input('Wrong choice baby !!! ')
        return True