Exemplo n.º 1
0
            if key == 'speed_bonus':
                print 'divide'
            return divide(values, by, separator)
    else:
        # only single element, then multiply (parse exceptions in dividelist...)
        return multiply(values, by, separator)
    return ' '.join(tmplist)

    
if __name__ == "__main__":

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'npc_abilities_custom.tmp')
    clean.remove_comments('items.txt', 'items.tmp')

    kv = KeyValues()
    kv.load('npc_abilities_custom.tmp')

    itemkv = KeyValues()
    itemkv.load('items.tmp')

    root = KeyValues('DOTAAbilities')
    rootov = KeyValues('DOTAAbilities')

    for factor in factors:
        if factor == override_factor:
            print 'Factor x%d (_override.txt)...' % factor
        else:
            print 'Factor x%d (_custom.txt)...' % factor
        if factor == override_factor:
            print 'Generating items'
Exemplo n.º 2
0
            return multiply(values, by, " ")
        else:
            #last value is lower than first, then divide
            return divide(values, by, " ")
    else:
        # only single element, then multiply (parse exceptions in dividelist...)
        return multiply(values, by, " ")
    return ' '.join(tmplist)


if __name__ == "__main__":

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'npc_abilities_custom.tmp')

    kv = KeyValues()
    kv.load('npc_abilities_custom.tmp')

    root = KeyValues('DOTAAbilities')

    for factor in factors:
        for skill in kv:
            if skill in dont_parse:
                continue
            skillkv = KeyValues(skill)
            skillkv['BaseClass'] = skill

            for base in kv[skill]:
                base = str(base)
                if base != 'AbilitySpecial':
                    valueslist = kv[skill][base].strip().split(" ")
Exemplo n.º 3
0
                #last value is lower than first, then divide
                return divide(values, by, separator, maxValue)
    else:
        # only single element, then multiply (parse exceptions in dividelist...)
        return multiply(values, by, separator, maxValue)
    return ' '.join(tmplist)

    
if __name__ == "__main__":

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'npc_abilities_custom.tmp')
    clean.remove_comments('items.txt', 'items.tmp')
    clean.remove_comments('npc_custom.txt', 'custom.tmp')

    kv = KeyValues()
    kv.load('npc_abilities_custom.tmp')

    customkv = KeyValues()
    customkv.load('custom.tmp')

    itemkv = KeyValues()
    itemkv.load('items.tmp')

    root = KeyValues('DOTAAbilities')
    #rootov = KeyValues('DOTAAbilities')

    for factor in factors:
        print '==== Generating factor: x' +str(factor)+ ' ===='
        rootov = KeyValues('DOTAAbilities')
        print 'Factor x%d (_override.txt)...' % factor
Exemplo n.º 4
0
from lib.keyvalues import KeyValues
from lib import clean
import abilities
import os
   
if __name__ == "__main__":

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('item.txt', 'npc_abilities_override.tmp')

    kv = KeyValues()
    kv.load('npc_abilities_override.tmp')

    root = KeyValues('DOTAAbilities')

    for factor in abilitites.factors:
        for skill in kv:
            if skill in dont_parse:
                continue
            skillkv = KeyValues(skill)
            skillkv['BaseClass'] = skill

            for base in kv[skill]:
                base = str(base)
                if base != 'AbilitySpecial':
                    valueslist = kv[skill][base].strip().split(" ")
                    if base not in ignore_all_normal and str_to_type(valueslist[0]) in (int, long, float, complex):
                        skillkv[base] = divide_or_multiply(base, kv[skill][base], factor, " ")
                    else:
                        skillkv[base] = kv[skill][base]
                #print str(skillkv[base]) + ' = ' + str(kv[skill][base])
Exemplo n.º 5
0
        'tusk_walrus_kick', 'shoot_firework'
    ]

    banStartsWith = [
        'roshan_', 'greevil_', 'backdoor_', 'invoker_', 'earth_spirit_', 'cny',
        'necronomicon_', 'abyssal_underlord_', 'earth_spirit_'
    ]

    #luna_eclipse disabled due crash issues
    #sandking_caustic_finale buggy with other skills
    #lycan_summon_wolves not working fine with other heroes

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'skills_list.tmp')

    kv = KeyValues()
    kv.load('skills_list.tmp')

    root = KeyValues('DOTASkills')
    rootUlti = KeyValues('DOTAUltimates')

    for skill in kv:
        skillkv = KeyValues()
        if 'ID' in kv[skill]:
            if skill not in banSkills:
                if not inPartial(skill, banStartsWith):
                    if "AbilityType" in kv[skill] and kv[skill][
                            "AbilityType"] == "DOTA_ABILITY_TYPE_ULTIMATE":
                        rootUlti[kv[skill]['ID']] = skill
                    else:
                        root[kv[skill]['ID']] = skill
Exemplo n.º 6
0
            return multiply(values, by, " ")
        else:
            #last value is lower than first, then divide
            return divide(values, by, " ")
    else:
        # only single element, then multiply (parse exceptions in dividelist...)
        return multiply(values, by, " ")
    return ' '.join(tmplist)

    
if __name__ == "__main__":

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'npc_abilities_custom.tmp')

    kv = KeyValues()
    kv.load('npc_abilities_custom.tmp')

    root = KeyValues('DOTAAbilities')

    for factor in factors:
        for skill in kv:
            if skill in dont_parse:
                continue
            skillkv = KeyValues(skill)
            skillkv['BaseClass'] = skill

            for base in kv[skill]:
                base = str(base)
                if base != 'AbilitySpecial':
                    valueslist = kv[skill][base].strip().split(" ")
Exemplo n.º 7
0
    'night_stalker_darkness', 'night_stalker_hunter_in_the_night', 'enchantress_impetus', 'life_stealer_empty_4', 'life_stealer_empty_3', 'life_stealer_empty_2', 'life_stealer_empty_1', 'life_stealer_control',
    'life_stealer_consume', 'life_stealer_assimilate_eject', 'life_stealer_assimilate', 'dragon_knight_frost_breath', 'warlock_golem_permanent_immolation', 'warlock_golem_flaming_fists', 'sniper_take_aim',
    'riki_permanent_invisibility', 'puck_ethereal_jaunt', 'phantom_lancer_juxtapose', 'nevermore_shadowraze1', 'nevermore_shadowraze2', 'nevermore_shadowraze3', 'morphling_hybrid', 'drow_ranger_silence',
    'ability_deward', 'lone_druid_spirit_bear', 'shadow_demon_demonic_purge', 'tinker_rearm', 'lycan_summon_wolves', 'elder_titan_echo_stomp', 'shredder_chakram_2', 'tusk_ice_shards_stop', 'tusk_walrus_kick',
    'shoot_firework']

    banStartsWith = ['roshan_', 'greevil_', 'backdoor_', 'invoker_', 'earth_spirit_', 'cny', 'necronomicon_', 'abyssal_underlord_', 'earth_spirit_']

    #luna_eclipse disabled due crash issues
    #sandking_caustic_finale buggy with other skills
    #lycan_summon_wolves not working fine with other heroes

    # remove comments from file (there's bug in _custom that some comments have only an single slash instead of double slash...
    clean.remove_comments('npc_abilities.txt', 'skills_list.tmp')

    kv = KeyValues()
    kv.load('skills_list.tmp')

    root = KeyValues('DOTASkills')
    rootUlti = KeyValues('DOTAUltimates')

    for skill in kv:
        skillkv = KeyValues()
        if 'ID' in kv[skill]:
            if skill not in banSkills:
                if not inPartial(skill, banStartsWith):
                    if "AbilityType" in kv[skill] and kv[skill]["AbilityType"] == "DOTA_ABILITY_TYPE_ULTIMATE":
                        rootUlti[kv[skill]['ID']] = skill
                    else:
                        root[kv[skill]['ID']] = skill
    root.save('skillsList.kv')