forked from cschultz16/test_repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweapon.py
More file actions
52 lines (31 loc) · 982 Bytes
/
weapon.py
File metadata and controls
52 lines (31 loc) · 982 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
51
import random
class WeaponFactory(object):
def get_random_weapon(self):
# returns a random weapons
pass
class Weapon(object):
def __init__(self, name, power):
pass
def attack(self):
return random.randint(0, self.power)
class BareHands(Weapon):
def __init__(self):
Weapon.__init__(self, "bare hands", 1)
class WoodenStick(Weapon):
def __init__(self):
Weapon.__init__(self, "a wooden stick", 3)
class RustySword(Weapon):
def __init__(self):
Weapon.__init__(self, "a rusty sword", 5)
class RegularSword(Weapon):
def __init__(self):
Weapon.__init__(self, "a regular sword", 10)
class IronSword(Weapon):
def __init__(self):
Weapon.__init__(self, "a iron sword", 20)
class MagicSword(Weapon):
def __init__(self):
Weapon.__init__(self, "a magic sword", 50)
class Masamune(Weapon):
def __init__(self):
Weapon.__init__(self, "Masamune", 100)