forked from ThorinSchmidt/GameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonster.py
More file actions
41 lines (36 loc) · 1.26 KB
/
monster.py
File metadata and controls
41 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Monster.py
# Nicholas Turner
# 11/16/2016
'''Monster Package'''
from Character import *
from random import randint
class Monster(Character):
def __init__(self, name = "Average Joe", maxHealth = 100,
speed = 25, stamina = 25, strength = 10,
intelligence = 10, dexterity = 10,
inventory = [["potion", 2],["Leather", 1]],
aggression = 50, awareness = 50, morale = 50):
super(Monster, self).__init__(name, maxHealth, speed,
stamina, strength, intelligence, dexterity,
inventory)
self.aggression = aggression
self.awareness = awareness
self.morale = morale
self.attack_chance = randint(1,100) + aggression
self.heal_chance = randint(1,100) + awareness
self.flee_chance = randint(1,100) - morale
def combat_choice(self):
ac = self.attack_chance
hc = self.heal_chance
fc = self.flee_chance
if ac > fc and hc:
combatChoice = 'a'
elif hc > ac and hc:
combatChoice = 'h'
elif fc > ac and hc:
combatChoice = 'f'
else:
combatChoice = 'a'
return combatChoice
if __name__ == "__main__":
Grr = Monster()