Skip to content

Instantly share code, notes, and snippets.

@TheRenaissance
Created August 10, 2017 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheRenaissance/c849e6de08d54e57f01453c75bcc116d to your computer and use it in GitHub Desktop.
Save TheRenaissance/c849e6de08d54e57f01453c75bcc116d to your computer and use it in GitHub Desktop.
from .base_sol import Soldier
from .weapons.lance import Lance # I only imported the lance, just to get one weapon up before I work on importing more
from random import randint
class Cavalryman(Soldier):
weap_dict = {'lance': Lance(),
'sword': Sword(),
'crossbow': Crossbow()}
def __init__(self):
self.attack=randint(5, 10)
self.speed=5
self.weapons=['lance', 'sword', 'crossbow']
self.defense=randint(1, 3)
self.vitality=randint(25, 30)
self.current_weapon='lance'
def active_weapon(self, current_weapon):
weap = self.weap_dict.get(current_weapon)
return weap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment