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(" ")
'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