In [1]:
from pprint import pprint
from atod import Hero, Heroes

Hero creation

Create a hero. The same can be done with Hero.from_name('Anti-Mage')


In [2]:
am = Hero(1)
# You can use attributes to get some hero properties which depends on lvl, examples:
print('Anti-Mage stats on lvl {}'.format(am.lvl))
print('\tstrength   = {}'.format(am.str))
print('\tagility    = {}'.format(am.agi))
print('\tintellect  = {}'.format(am.int))
print('\t...')


Anti-Mage stats on lvl 1
	strength   = 22
	agility    = 22
	intellect  = 15
	...

Class attributes

It can be very useful to have hero's in-game name (how it is used in DotA files):


In [3]:
sf = Hero.from_name('Shadow Fiend')
sf.in_game_name


Out[3]:
'nevermore'

Also you can get all the specs. This is the dictionary with a lot of parameters.


In [4]:
pprint(am.specs)


{'ArmorPhysical': -1.0,
 'AttackAcquisitionRange': 600,
 'AttackAnimationPoint': 0.3,
 'AttackCapabilities': 'DOTA_UNIT_CAP_MELEE_ATTACK',
 'AttackDamageMax': 31,
 'AttackDamageMin': 27,
 'AttackRange': 150,
 'AttackRate': 1.45,
 'AttributeAgilityGain': 2.8,
 'AttributeBaseAgility': 22,
 'AttributeBaseIntelligence': 15,
 'AttributeBaseStrength': 22,
 'AttributeIntelligenceGain': 1.8,
 'AttributePrimary': 'DOTA_ATTRIBUTE_AGILITY',
 'AttributeStrengthGain': 1.5,
 'HeroID': 1,
 'HeroType': 'DOTA_BOT_HARD_CARRY',
 'MovementSpeed': 315,
 'MovementTurnRate': 0.5,
 'ProvidesBabysit': 0,
 'ProvidesSetup': 0,
 'RequiresBabysit': 2,
 'RequiresFarm': 2,
 'RequiresSetup': 1,
 'Role': 'Carry,Escape,Nuker',
 'Rolelevels': '3,3,1',
 'SoloDesire': 1,
 'SurvivalRating': 2,
 'Team': 'Good',
 'aliases': 'am',
 'in_game_name': 'antimage',
 'index': 74,
 'name': 'Anti-Mage',
 'patch': '706f'}

Getting info

The way to get info about certain side of the hero. List of all 'categories':

  • type
  • role
  • laning
  • attributes

functions look like hero.get_category(), where category is one of the above words.


In [5]:
am.get_role()


Out[5]:
disabler     0.0
nuker        1.0
escape       3.0
durable      0.0
initiator    0.0
pusher       0.0
support      0.0
jungler      0.0
carry        3.0
dtype: float64

If you want to combine few descriptions -- Hero.get_description() is the way to go.

Note that laning, roles and hero type are read from the game files and sometimes can be strange.


In [6]:
print(am.get_description(include=['laning', 'role', 'name']))


category  var             
laning    requires_farm               0
          requires_setup              0
          requires_babysit            2
          provides_setup              2
          solo_desire                 1
          survival_rating             1
          provides_babysit            2
role      disabler                    0
          nuker                       1
          escape                      3
          durable                     0
          initiator                   0
          pusher                      0
          support                     0
          jungler                     0
          carry                       3
name                          Anti-Mage
dtype: object