Created
August 10, 2017 09:57
-
-
Save TheRenaissance/3e6fff4184377fc40cae790c45a19d53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The class for the Man-at-Arms (MAA) | |
from .base_sol import Soldier | |
from random import randint, sample | |
from .weapons import * | |
class MAA(Soldier): | |
weap_dict: {'greatsword': Greatsword(), | |
'sword': Sword(), | |
'axe': Axe(), | |
'morningstar': Morningstar(), | |
'crossbow': Crossbow(), | |
'dagger': Dagger()} | |
def __init__(self): | |
# A list of weapons to generate from in the init | |
maa_weapons = ['greatsword', 'sword', 'axe', 'morningstar', 'crossbow', | |
'dagger'] | |
self.attack=randint(3,7) | |
self.speed=1 | |
# The weapons are a bit complicated, because I want variation | |
weap_indx = sample(range(0, 5), 3) | |
self.weapons=[maa_weapons[weap_indx[0]], maa_weapons[weap_indx[1]], | |
maa_weapons[weap_indx[2]]] | |
self.defense=randint(6,9) | |
self.vitality=randint(20,25) | |
self.current_weapon=[self.weapons[0]] | |
def active_weapon(self, current_weapon): | |
weap = self.weap_dict.get(current_weapon) | |
return weap | |
Contact GitHub API Training Shop Blog About | |
© 2017 GitHub, Inc. Terms Privacy Security Status Help | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment