def __init__(self): self.hp = dice_roll(6,1,10) if self.hp < 35: self.hp = 35 self.dexterity = dice_roll(3,2,6) self.exp = 400 + self.hp*5 self.numattacks = 2
def __init__(self): self.hp = dice_roll(8,5,10) if self.hp < 55: self.hp = 55 self.dexterity = dice_roll(4,1,6) self.exp = 500 + self.hp*5 self.numattacks = 1
def __init__(self): # doing it this way gives a higher probability of the HP being low, with the occasional ubermensch double hp spider # also, this is a perfect of example of when to use the self.var assignment versus dgvars, as these are individual to each instance self.hp = dice_roll(3,3,10) if self.hp < 15: self.hp = 15 self.dexterity = dice_roll(2,1,6) self.exp = 35 + self.hp*2 self.numattacks = 1
def attack(self, monster_name): roll = randint(1,10) if roll <= 6: print spider_attack(1, monster_name) return dice_roll(4,1,8) elif roll > 6 and roll < 9: print spider_attack(2, monster_name) return 0 else: print spider_attack(3, monster_name) return dice_roll(6,3,6)
def attack(self, monster_name): roll = randint(1,10) if roll <= 5: print spider_attack(1, monster_name) return dice_roll(2,2,5) elif roll > 5 and roll < 9: print spider_attack(2, monster_name) return 0 else: print spider_attack(3, monster_name) return dice_roll(4,2,5)
def __init__(self): self.hp = dice_roll(10,20,40) self.dexterity = dice_roll(2,1,5) self.exp = 10000 + self.hp*5 self.numattacks = 1