-
Notifications
You must be signed in to change notification settings - Fork 0
/
unit_factory.py
49 lines (42 loc) · 1.06 KB
/
unit_factory.py
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
42
43
44
45
46
47
48
49
from unit import Unit
class UnitFactory(object):
_unit_counter = 0
@classmethod
def generate_name(cls, label='MyUnit'):
cls._unit_counter += 1
return '%s#%d' % (label, cls._unit_counter)
@classmethod
def create_malak(cls):
return Unit(name = cls.generate_name('Malak'),
hp=105,
damage=14,
wc=13,
ac=19,
critical_strike=6
)
@classmethod
def create_warrior(cls):
return Unit(name = cls.generate_name('HighAC'),
hp=105,
damage=9,
wc=13,
ac=23,
)
@classmethod
def create_mage(cls):
return Unit(name = cls.generate_name('Mage'),
hp=45,
ac=13,
spell_damage=21
)
@classmethod
def create_hybrid(cls):
return Unit(name = cls.generate_name('Hybrid'),
hp=75,
damage=13,
wc=11,
ac=18,
critical_strike=2,
spell_damage=8,
spell_resistance=4
)