diff --git a/DungeonShooting_Godot/src/game/effect/SpecialEffect.cs b/DungeonShooting_Godot/src/game/effect/SpecialEffect.cs
new file mode 100644
index 0000000..caa20ec
--- /dev/null
+++ b/DungeonShooting_Godot/src/game/effect/SpecialEffect.cs
@@ -0,0 +1,10 @@
+
+using Godot;
+
+///
+/// 基础特效播放类, 用于播放序列帧动画特效, 播完就回收
+///
+public class SpecialEffect : AnimatedSprite
+{
+
+}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs
index 994cac5..23c9ba2 100644
--- a/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs
+++ b/DungeonShooting_Godot/src/game/item/weapon/knife/Knife.cs
@@ -26,7 +26,6 @@
MaxBacklash = -8;
MinBacklash = -8;
BacklashRegressionSpeed = 24;
- //UpliftAngleRestore = 2;
UpliftAngle = -90;
}
}
@@ -35,13 +34,7 @@
{
}
-
- public override void _Process(float delta)
- {
- base._Process(delta);
-
- }
-
+
protected override void OnStartCharge()
{
RotationDegrees = -120;
@@ -49,7 +42,9 @@
protected override void OnFire()
{
- GD.Print("蓄力时长: " + GetTriggerChargeTime() + ", 扳机按下时长: " + GetTriggerDownTime());
+ GD.Print("近战武器攻击! 蓄力时长: " + GetTriggerChargeTime() + ", 扳机按下时长: " + GetTriggerDownTime());
+
+ //这里写播放挥刀特效和碰撞检测代码
if (Master == GameApplication.Instance.Room.Player)
{
@@ -63,16 +58,6 @@
}
- protected override void OnUpTrigger()
- {
- GD.Print("松开扳机");
- }
-
- protected override void OnDownTrigger()
- {
- GD.Print("开始按下扳机");
- }
-
protected override int UseAmmoCount()
{
//这里要做判断, 如果没有碰到敌人, 则不消耗弹药 (耐久)
diff --git a/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs
new file mode 100644
index 0000000..4ba9920
--- /dev/null
+++ b/DungeonShooting_Godot/src/game/manager/SpecialEffectManager.cs
@@ -0,0 +1,23 @@
+
+using Godot;
+
+///
+/// 特效管理器
+///
+public static class SpecialEffectManager
+{
+ ///
+ /// 在场景指定位置播放一个特效
+ ///
+ /// 特效SpriteFrames资源路径
+ /// 坐标
+ /// 旋转角度
+ /// 缩放
+ /// 层级
+ /// 播放速度
+ /// 循环次数, 到达该次数特效停止播放
+ public static void Play(string path, Vector2 pos, float rotation, Vector2 scale, int zIndex, float speed = 1, int loopCount = 1)
+ {
+
+ }
+}
\ No newline at end of file