forked from cschultz16/test_repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshield.py
More file actions
51 lines (31 loc) · 990 Bytes
/
shield.py
File metadata and controls
51 lines (31 loc) · 990 Bytes
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
50
import random
class Shieldactory(object):
def get_random_shield(self):
# returns a random shield
pass
class Shield(object):
def __init__(self, name, power):
self.name = name
def block(self):
return random.randint(0, self.power)
class BareHands(Shield):
def __init__(self):
Shield.__init__(self, "bare hands", 1)
class WoodenShield(Shield):
def __init__(self):
Shield.__init__(self, "a wooden shield", 3)
class RustyShield(Shield):
def __init__(self):
Shield.__init__(self, "a rusty shield", 5)
class RegularShield(Shield):
def __init__(self):
Shield.__init__(self, "a regular shield", 10)
class IronShield(Shield):
def __init__(self):
Shield.__init__(self, "iron shield", 20)
class MagicShield(Shield):
def __init__(self):
Shield.__init__(self, "magic shield", 50)
class Aegis(Shield):
def __init__(self):
Shield.__init__(self, "Aegis", 100)