|
@@ -1,6 +1,7 @@
|
|
|
from math import sqrt
|
|
from math import sqrt
|
|
|
|
|
|
|
|
import pygame
|
|
import pygame
|
|
|
|
|
+import random
|
|
|
|
|
|
|
|
from game.const import game as G
|
|
from game.const import game as G
|
|
|
from game.const import rouge as R
|
|
from game.const import rouge as R
|
|
@@ -1394,29 +1395,74 @@ class IceSlow(Skill):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-# 整活玩家技能
|
|
|
|
|
|
|
+# # 整活玩家技能
|
|
|
|
|
+# class PlayerSword5x5(Skill):
|
|
|
|
|
+#
|
|
|
|
|
+# def __init__(self, user, to, skill_instances):
|
|
|
|
|
+# super().__init__(user, to, skill_instances)
|
|
|
|
|
+#
|
|
|
|
|
+# def load(self):
|
|
|
|
|
+# self.effect_instances.append(
|
|
|
|
|
+# EffectInstance("sword", self.user, True, self.user.effects_front)
|
|
|
|
|
+# )
|
|
|
|
|
+# # self.user.align_xy()
|
|
|
|
|
+# for to in self.to:
|
|
|
|
|
+# if abs(to.x - self.user.x) < 3 and abs(to.y - self.user.y) < 3:
|
|
|
|
|
+# to.try_damage(R.SurpriseSkill(R.rouge_lv))
|
|
|
|
|
+# EffectInstance("thunder_explode", to, True, to.effects_front)
|
|
|
|
|
+#
|
|
|
|
|
+# def update(self):
|
|
|
|
|
+# if self.current_time - self.skill_time_init > 500:
|
|
|
|
|
+# self.kill()
|
|
|
|
|
+
|
|
|
class PlayerSword5x5(Skill):
|
|
class PlayerSword5x5(Skill):
|
|
|
|
|
|
|
|
def __init__(self, user, to, skill_instances):
|
|
def __init__(self, user, to, skill_instances):
|
|
|
|
|
+ self.used = False
|
|
|
super().__init__(user, to, skill_instances)
|
|
super().__init__(user, to, skill_instances)
|
|
|
|
|
|
|
|
def load(self):
|
|
def load(self):
|
|
|
|
|
+ super().load()
|
|
|
self.effect_instances.append(
|
|
self.effect_instances.append(
|
|
|
- EffectInstance("sword", self.user, True, self.user.effects_front)
|
|
|
|
|
|
|
+ EffectInstance("laser_sword", self.user, True, level.current_level.effects_front)
|
|
|
)
|
|
)
|
|
|
- # self.user.align_xy()
|
|
|
|
|
- for to in self.to:
|
|
|
|
|
- if abs(to.x - self.user.x) < 3 and abs(to.y - self.user.y) < 3:
|
|
|
|
|
- to.try_damage(R.SurpriseSkill(R.rouge_lv))
|
|
|
|
|
- EffectInstance("thunder_explode", to, True, to.effects_front)
|
|
|
|
|
|
|
+ sound_player.play("sword")
|
|
|
|
|
|
|
|
def update(self):
|
|
def update(self):
|
|
|
|
|
+ super().update()
|
|
|
|
|
+ if not self.used:
|
|
|
|
|
+ self.used = True
|
|
|
|
|
+ for to in self.to:
|
|
|
|
|
+ if abs(to.x - self.user.x) < 3 and abs(to.y - self.user.y) < 3 and (abs(to.x - self.user.x) + abs(to.y - self.user.y) != 4):
|
|
|
|
|
+ if random.randint(1, 100) <= 8:
|
|
|
|
|
+ to.try_damage(int(R.SurpriseSkill(R.rouge_lv)*1.5), critical=True)
|
|
|
|
|
+ EffectInstance("reverse", to, True, self.to.effects_front)
|
|
|
|
|
+ to.rooted_for(1000)
|
|
|
|
|
+ sound_player.play("cry")
|
|
|
|
|
+ print("暴击!!!")
|
|
|
|
|
+ else:
|
|
|
|
|
+ to.try_damage(int(R.SurpriseSkill(R.rouge_lv)))
|
|
|
|
|
+ EffectInstance("thunder_explode", to, True, to.effects_front)
|
|
|
|
|
+
|
|
|
|
|
+ for x in range(self.user.x - 2, self.user.x + 3):
|
|
|
|
|
+ for y in range(self.user.y - 2, self.user.y + 3):
|
|
|
|
|
+ if abs(x-self.user.x)+abs(y-self.user.y) != 4:
|
|
|
|
|
+ if x != self.user.x and y != self.user.y:
|
|
|
|
|
+ # 引爆糖泡
|
|
|
|
|
+ bombs = level.current_level.get_bomb_instance(x, y)
|
|
|
|
|
+ if len(bombs) > 0:
|
|
|
|
|
+ bombs[0].explode()
|
|
|
|
|
+ if (x, y) in level.current_level.obstacle_instances.keys(): # 尝试摧毁障碍
|
|
|
|
|
+ level.current_level.obstacle_instances[(x, y)].die()
|
|
|
|
|
+ level.current_level.obstacle_instances_need_to_update = True
|
|
|
|
|
+
|
|
|
if self.current_time - self.skill_time_init > 500:
|
|
if self.current_time - self.skill_time_init > 500:
|
|
|
|
|
+ for e in self.effect_instances:
|
|
|
|
|
+ e.state = EffectState.DEAD
|
|
|
self.kill()
|
|
self.kill()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
# 1x1燃烧火陷阱,踩中HP-800
|
|
# 1x1燃烧火陷阱,踩中HP-800
|
|
|
class PlayerFire8000(Skill):
|
|
class PlayerFire8000(Skill):
|
|
|
|
|
|