-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskill.py
49 lines (41 loc) · 1.49 KB
/
skill.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
class Skill:
def __init__(self, cost: int, game_board, atk_type):
self.atk_type=atk_type
self.game_board = game_board
self.cost = cost
self.name = "empty skill"
self.explaination = [
"no explaination"
]
self.skill_image_path = "./Chloe/skill_image/sprout_of_blue.png"
def execute_one(self, caster, target):
pass
def execute(self, caster, targets, caster_pos, targets_pos, execute_pos):
for target in targets:
self.execute_one(caster, target)
def execute_range(self, pos):
return [(i + 1, 1) for i in range(5)] + \
[(i + 1, 2) for i in range(5)] + \
[(i + 1, 3) for i in range(5)] + \
[(i + 1, 4) for i in range(5)] + \
[(i + 1, 5) for i in range(5)]
def atk_range(self, caster_pos, pos):
return [pos]
class SpecialSkill(Skill):
def __init__(self, cost, energy, game_board, atk_type):
super().__init__(cost, game_board, atk_type)
self.max_energy = energy
self.energy = 0
self.name = "empty special skill"
self.explaination = [
"no explaination"
]
self.skill_image_path = "./Chloe/skill_image/sprout_of_blue.png"
def gage_up(self, num):
self.energy+=num
if self.energy>self.max_energy:
self.energy=self.max_energy
def gage_down(self, num):
self.energy-=num
if self.energy<0:
self.energy=0