-
Notifications
You must be signed in to change notification settings - Fork 0
/
towers.py
104 lines (84 loc) · 2.74 KB
/
towers.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
class TowerClass(object):
def __init__(self, economy, gameMap):
self.x = 0;
self.y = 0;
self.z = 0;
self.hp = 1000;
self.mp = 0;
self.attack = 10;
self.attackSpeed = 30;
self.defence = 10;
self.abilities = [];
self.effects = [];
self.vulnerabilities = [];
self.resistances = [];
self.immunities = ["mind"];
self.damageType = "physical";
self.currentHp = 1000;
self.currentMp = 0;
def __str__(self):
if (self.currentHp < 0.3 * self.hp):
return ",T,";
if (self.currentHp < 0.5 * self.hp):
return ">T<";
return "|T|";
class Fort(TowerClass):
def __init__(self, economy, gameMap):
TowerClass. __init__(self, economy, gameMap);
self.hp *= 0.7;
self.attack *= 0.5;
self.attackSpeed *= 1.5;
self.damageType = "physical";
self.currentHp = 1000;
self.currentMp = 0;
def __str__(self):
if (self.currentHp < 0.3 * self.hp):
return ",F,";
if (self.currentHp < 0.5 * self.hp):
return ">F<";
return "|F|";
class IllusionistTower(TowerClass):
def __init__(self, economy, gameMap):
TowerClass. __init__(self, economy, gameMap);
self.hp *= 0.4;
self.attack *= 1.5;
self.attackSpeed *= 0.5;
self.damageType = "mind";
self.currentHp = 1000;
self.currentMp = 0;
def __str__(self):
if (self.currentHp < 0.3 * self.hp):
return ",I,";
if (self.currentHp < 0.5 * self.hp):
return ">I<";
return "|I|";
class FireElementalistTower(TowerClass):
def __init__(self, economy, gameMap):
TowerClass. __init__(self, economy, gameMap);
self.hp *= 0.4;
self.attack *= 1.5;
self.attackSpeed *= 0.5;
self.damageType = "fire";
self.currentHp = 1000;
self.currentMp = 0;
def __str__(self):
if (self.currentHp < 0.3 * self.hp):
return ",E,";
if (self.currentHp < 0.5 * self.hp):
return ">E<";
return "|E|";
class WaterElementalistTower(TowerClass):
def __init__(self, economy, gameMap):
TowerClass. __init__(self, economy, gameMap);
self.hp *= 0.4;
self.attack *= 1.5;
self.attackSpeed *= 0.5;
self.damageType = "cold";
self.currentHp = 1000;
self.currentMp = 0;
def __str__(self):
if (self.currentHp < 0.3 * self.hp):
return ",W,";
if (self.currentHp < 0.5 * self.hp):
return ">W<";
return "|W|";