Beispiel #1
0
 def __init__(self, name):
     Fighter.__init__(self,
                      Weapon.preset('Rusty Sword'),
                      health=50,
                      name=name,
                      ac=8)
     self.inventory = Inventory([self.__weapon__])
     self.needed = BASE_XP_NEEDED
Beispiel #2
0
 def preset(name):
     if name in presets:
         data = {'name': name}
         for k, v in presets[name].items():
             if k == 'weapon':
                 data[k] = Weapon.preset(v)
             else:
                 data[k] = v
         return Fighter(**data)
     else:
         raise ValueError('unknown preset "{}"'.format(name))