diff --git a/DungeonShooting_Godot/excel/EnemyBase.xlsx b/DungeonShooting_Godot/excel/EnemyBase.xlsx
index e54451e..362bdeb 100644
--- a/DungeonShooting_Godot/excel/EnemyBase.xlsx
+++ b/DungeonShooting_Godot/excel/EnemyBase.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/excel/WeaponBase.xlsx b/DungeonShooting_Godot/excel/WeaponBase.xlsx
index 3de09d4..8f61a7a 100644
--- a/DungeonShooting_Godot/excel/WeaponBase.xlsx
+++ b/DungeonShooting_Godot/excel/WeaponBase.xlsx
Binary files differ
diff --git a/DungeonShooting_Godot/resource/config/EnemyBase.json b/DungeonShooting_Godot/resource/config/EnemyBase.json
index 657b2b7..054f597 100644
--- a/DungeonShooting_Godot/resource/config/EnemyBase.json
+++ b/DungeonShooting_Godot/resource/config/EnemyBase.json
@@ -7,6 +7,7 @@
"MoveSpeed": 80,
"Acceleration": 1500,
"Friction": 900,
+ "AttackInterval": 0,
"CanPickUpWeapon": true,
"ViewRange": 250,
"TailAfterViewRange": 400,
@@ -24,9 +25,10 @@
"MoveSpeed": 120,
"Acceleration": 1500,
"Friction": 900,
+ "AttackInterval": 2.2,
"CanPickUpWeapon": false,
- "ViewRange": 250,
- "TailAfterViewRange": 400,
+ "ViewRange": 200,
+ "TailAfterViewRange": 300,
"BackViewRange": 50,
"Gold": [
-2,
diff --git a/DungeonShooting_Godot/resource/config/WeaponBase.json b/DungeonShooting_Godot/resource/config/WeaponBase.json
index a2ee816..e8e4f61 100644
--- a/DungeonShooting_Godot/resource/config/WeaponBase.json
+++ b/DungeonShooting_Godot/resource/config/WeaponBase.json
@@ -406,9 +406,9 @@
"ContinuousCountRange": [
1
],
- "TriggerInterval": 0.4,
- "StartFiringSpeed": 300,
- "FinalFiringSpeed": 300,
+ "TriggerInterval": 0.55,
+ "StartFiringSpeed": 460,
+ "FinalFiringSpeed": 460,
"FiringSpeedAddSpeed": 0,
"FiringSpeedBackSpeed": 0,
"FiringSpeedBackTime": 0,
@@ -860,7 +860,7 @@
"ContinuousCountRange": [
5
],
- "TriggerInterval": 1.5,
+ "TriggerInterval": 1.4,
"StartFiringSpeed": 700,
"FinalFiringSpeed": 700,
"FiringSpeedAddSpeed": 0,
@@ -1621,8 +1621,8 @@
5
],
"TriggerInterval": 1.6,
- "StartFiringSpeed": 700,
- "FinalFiringSpeed": 700,
+ "StartFiringSpeed": 350,
+ "FinalFiringSpeed": 350,
"FiringSpeedAddSpeed": 0,
"FiringSpeedBackSpeed": 0,
"FiringSpeedBackTime": 0,
@@ -1924,7 +1924,7 @@
"ContinuousCountRange": [
1
],
- "TriggerInterval": 0.4,
+ "TriggerInterval": 0.45,
"StartFiringSpeed": 300,
"FinalFiringSpeed": 300,
"FiringSpeedAddSpeed": 0,
@@ -2077,8 +2077,8 @@
1
],
"TriggerInterval": 0.5,
- "StartFiringSpeed": 300,
- "FinalFiringSpeed": 300,
+ "StartFiringSpeed": 600,
+ "FinalFiringSpeed": 600,
"FiringSpeedAddSpeed": 0,
"FiringSpeedBackSpeed": 0,
"FiringSpeedBackTime": 0,
diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_EnemyBase.cs b/DungeonShooting_Godot/src/config/ExcelConfig_EnemyBase.cs
index 182c7e1..99bf73c 100644
--- a/DungeonShooting_Godot/src/config/ExcelConfig_EnemyBase.cs
+++ b/DungeonShooting_Godot/src/config/ExcelConfig_EnemyBase.cs
@@ -49,6 +49,13 @@
public float Friction;
///
+ /// 单次攻击间隔时间, 秒
+ /// 注意, 敌人攻击后计算间隔时间会使用当前字段值与武器上的TriggerInterval叠加
+ ///
+ [JsonInclude]
+ public float AttackInterval;
+
+ ///
/// 是否可以拾起武器
///
[JsonInclude]
@@ -92,6 +99,7 @@
inst.MoveSpeed = MoveSpeed;
inst.Acceleration = Acceleration;
inst.Friction = Friction;
+ inst.AttackInterval = AttackInterval;
inst.CanPickUpWeapon = CanPickUpWeapon;
inst.ViewRange = ViewRange;
inst.TailAfterViewRange = TailAfterViewRange;
diff --git a/DungeonShooting_Godot/src/game/activity/role/Role.cs b/DungeonShooting_Godot/src/game/activity/role/Role.cs
index 009ebe0..62feb99 100644
--- a/DungeonShooting_Godot/src/game/activity/role/Role.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/Role.cs
@@ -1057,6 +1057,9 @@
});
}
+ ///
+ /// 调整角色的朝向, 使其看向目标点
+ ///
public virtual void LookTargetPosition(Vector2 pos)
{
LookPosition = pos;
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
index 69c0fd7..33bf27b 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs
@@ -164,6 +164,7 @@
roleState.ViewRange = enemyBase.ViewRange;
roleState.TailAfterViewRange = enemyBase.TailAfterViewRange;
roleState.BackViewRange = enemyBase.BackViewRange;
+ roleState.AttackInterval = enemyBase.AttackInterval;
roleState.Gold = Mathf.Max(0, Utils.Random.RandomConfigRange(enemyBase.Gold));
return roleState;
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/EnemyRoleState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/EnemyRoleState.cs
index 174b52e..ef3618a 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/EnemyRoleState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/EnemyRoleState.cs
@@ -15,4 +15,9 @@
/// 背后的视野半径, 单位像素
///
public float BackViewRange = 50;
+
+ ///
+ /// 攻击间隔时间, 秒
+ ///
+ public float AttackInterval = 0;
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/NoWeaponEnemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/NoWeaponEnemy.cs
index 2e1e4ae..ed3d271 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/NoWeaponEnemy.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/NoWeaponEnemy.cs
@@ -82,7 +82,7 @@
{
if (name == AnimatorNames.Attack)
{
- AttackTimer = 3f;
+ AttackTimer = EnemyRoleState.AttackInterval;
}
}
}
\ No newline at end of file
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiAttackState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiAttackState.cs
index c5d8911..ca847b3 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiAttackState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiAttackState.cs
@@ -51,7 +51,7 @@
if (weapon != null)
{
_hasWeapon = true;
- if (!weapon.TriggerIsReady())
+ if (Master.IsAttack || !weapon.TriggerIsReady())
{
throw new Exception("进入 AIAdvancedStateEnum.AiAttack 状态时角色武器还无法触动扳机!");
}
@@ -206,6 +206,11 @@
{
MoveHandler(delta);
}
+
+ if (AttackState == AiAttackEnum.AttackInterval) //触发攻击完成
+ {
+ Master.AttackTimer = weapon.Attribute.TriggerInterval + Master.EnemyRoleState.AttackInterval;
+ }
}
}
}
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs
index c6ae3d6..d0f1bde 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiFollowUpState.cs
@@ -112,7 +112,7 @@
{
ChangeState(AIStateEnum.AiSurround);
}
- else if (weapon.TriggerIsReady()) //可以攻击
+ else if (!Master.IsAttack && weapon.TriggerIsReady()) //可以攻击
{
//攻击状态
ChangeState(AIStateEnum.AiAttack);
diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
index 2d3c914..da694dd 100644
--- a/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
+++ b/DungeonShooting_Godot/src/game/activity/role/enemy/state/AiSurroundState.cs
@@ -143,7 +143,7 @@
{
ChangeState(AIStateEnum.AiFollowUp);
}
- else if (weapon.TriggerIsReady()) //可以攻击
+ else if (!Master.IsAttack && weapon.TriggerIsReady()) //可以攻击
{
//发起攻击
ChangeState(AIStateEnum.AiAttack);
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
index 2ee8f84..1945689 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs
@@ -2200,7 +2200,7 @@
{
flag = AiAttackEnum.Attack;
enemy.Attack();
- if (_attackFlag)
+ if (_attackFlag) //成功触发攻击
{
enemy.LockingTime = 0;
}
@@ -2211,7 +2211,7 @@
{
flag = AiAttackEnum.Attack;
enemy.Attack();
- if (_attackFlag)
+ if (_attackFlag) //成功触发攻击
{
enemy.LockingTime = 0;
}
@@ -2227,7 +2227,7 @@
{
flag = AiAttackEnum.Attack;
enemy.Attack();
- if (_attackFlag && _attackTimer > 0)
+ if (_attackFlag && _attackTimer > 0) //成功触发攻击
{
enemy.LockingTime = 0;
}
diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
index f9c117f..63ada44 100644
--- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
+++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs
@@ -135,7 +135,13 @@
{
//反弹子弹
bullet.OnPlayDisappearEffect();
- bullet.MoveController.ScaleAllVelocity(-1);
+ var scale = -1f;
+ var weapon = bullet.BulletData.Weapon;
+ if (weapon != null)
+ {
+ scale /= weapon.AiUseAttribute.AiAttackAttr.BulletSpeedScale;
+ }
+ bullet.MoveController.ScaleAllVelocity(scale);
bullet.Rotation += Mathf.Pi;
bullet.AttackLayer = TriggerRole.AttackLayer;
bullet.RefreshBulletColor(false);