diff --git a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx index ef7e9d0..b979dba 100644 --- a/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/ActivityObject.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx index e0dc11d..1859930 100644 --- a/DungeonShooting_Godot/excel/excelFile/Sound.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Sound.xlsx Binary files differ diff --git a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx index 602ddbe..9da7eac 100644 --- a/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx +++ b/DungeonShooting_Godot/excel/excelFile/Weapon.xlsx Binary files differ diff --git a/DungeonShooting_Godot/resource/config/Weapon.json b/DungeonShooting_Godot/resource/config/Weapon.json index 086f1f4..8354ff8 100644 --- a/DungeonShooting_Godot/resource/config/Weapon.json +++ b/DungeonShooting_Godot/resource/config/Weapon.json @@ -42,14 +42,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "shell0001", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 300, "BulletMaxDistance": 400, + "ShellId": "shell0001", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -112,14 +114,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "shell0001", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 300, "BulletMaxDistance": 400, + "ShellId": "shell0001", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -182,14 +186,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "ShellId": "shell0002", - "ThrowShellDelayTime": 0.2, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": -10, "BulletMaxDeviationAngle": 10, "BulletMaxSpeed": 280, "BulletMinSpeed": 380, "BulletMinDistance": 200, "BulletMaxDistance": 250, + "ShellId": "shell0002", + "ThrowShellDelayTime": 0.2, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -252,14 +258,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "ShellId": "shell0002", - "ThrowShellDelayTime": 0.2, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": -10, "BulletMaxDeviationAngle": 10, "BulletMaxSpeed": 280, "BulletMinSpeed": 380, "BulletMinDistance": 200, "BulletMaxDistance": 250, + "ShellId": "shell0002", + "ThrowShellDelayTime": 0.2, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -299,12 +307,12 @@ "LooseShoot": false, "MinChargeTime": 0, "AutoBeLoaded": true, - "BeLoadedTime": 0, + "BeLoadedTime": 0.05, "MinContinuousCount": 1, "MaxContinuousCount": 1, - "TriggerInterval": 0.1, - "StartFiringSpeed": 300, - "FinalFiringSpeed": 300, + "TriggerInterval": 0, + "StartFiringSpeed": 460, + "FinalFiringSpeed": 460, "FiringSpeedAddSpeed": 0, "FiringSpeedBackSpeed": 0, "MinFireBulletCount": 1, @@ -322,14 +330,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "shell0001", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 250, "BulletMaxDistance": 300, + "ShellId": "shell0001", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -369,7 +379,7 @@ "LooseShoot": false, "MinChargeTime": 0, "AutoBeLoaded": true, - "BeLoadedTime": 0, + "BeLoadedTime": 0.05, "MinContinuousCount": 1, "MaxContinuousCount": 1, "TriggerInterval": 2, @@ -392,14 +402,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "shell0001", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 4, + "BulletMinHarm": 4, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 250, "BulletMaxDistance": 300, + "ShellId": "shell0001", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -462,14 +474,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 25, + "BulletMinHarm": 25, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 35, "BulletMaxDistance": 35, + "ShellId": "", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -532,14 +546,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 25, + "BulletMinHarm": 25, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 350, "BulletMinSpeed": 350, "BulletMinDistance": 35, "BulletMaxDistance": 35, + "ShellId": "", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -602,14 +618,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0001", - "ShellId": "shell0003", - "ThrowShellDelayTime": 0.2, + "BulletMaxHarm": 30, + "BulletMinHarm": 30, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 600, "BulletMinSpeed": 600, "BulletMinDistance": 700, "BulletMaxDistance": 900, + "ShellId": "shell0003", + "ThrowShellDelayTime": 0.2, "ThrowCollisionSize": { "X": 20, "Y": 15 @@ -672,14 +690,16 @@ "DefaultAngle": 0, "UpliftAngleRestore": 1, "BulletId": "bullet0002", - "ShellId": "shell0001", - "ThrowShellDelayTime": 0, + "BulletMaxHarm": 3, + "BulletMinHarm": 3, "BulletMinDeviationAngle": 0, "BulletMaxDeviationAngle": 0, "BulletMaxSpeed": 320, "BulletMinSpeed": 320, "BulletMinDistance": 300, "BulletMaxDistance": 400, + "ShellId": "shell0001", + "ThrowShellDelayTime": 0, "ThrowCollisionSize": { "X": 20, "Y": 15 diff --git a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs index 624ada8..4b20145 100644 --- a/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs +++ b/DungeonShooting_Godot/src/config/ExcelConfig_Weapon.cs @@ -263,17 +263,16 @@ public string BulletId; /// <summary> - /// 默认抛出的弹壳 + /// 子弹造成的最大伤害 /// </summary> [JsonInclude] - public string ShellId; + public int BulletMaxHarm; /// <summary> - /// 投抛弹壳的延时时间, 在射击或者上膛后会触发抛弹壳效果 <br/> - /// 如果为负数, 则不自动抛弹 + /// 子弹造成的最小伤害 /// </summary> [JsonInclude] - public float ThrowShellDelayTime; + public int BulletMinHarm; /// <summary> /// 子弹最小偏移角度 <br/> @@ -313,6 +312,19 @@ public float BulletMaxDistance; /// <summary> + /// 默认抛出的弹壳 + /// </summary> + [JsonInclude] + public string ShellId; + + /// <summary> + /// 投抛弹壳的延时时间, 在射击或者上膛后会触发抛弹壳效果 <br/> + /// 如果为负数, 则不自动抛弹 + /// </summary> + [JsonInclude] + public float ThrowShellDelayTime; + + /// <summary> /// 投抛状态下物体碰撞器大小 /// </summary> [JsonInclude] @@ -449,14 +461,16 @@ inst.DefaultAngle = DefaultAngle; inst.UpliftAngleRestore = UpliftAngleRestore; inst.BulletId = BulletId; - inst.ShellId = ShellId; - inst.ThrowShellDelayTime = ThrowShellDelayTime; + inst.BulletMaxHarm = BulletMaxHarm; + inst.BulletMinHarm = BulletMinHarm; inst.BulletMinDeviationAngle = BulletMinDeviationAngle; inst.BulletMaxDeviationAngle = BulletMaxDeviationAngle; inst.BulletMaxSpeed = BulletMaxSpeed; inst.BulletMinSpeed = BulletMinSpeed; inst.BulletMinDistance = BulletMinDistance; inst.BulletMaxDistance = BulletMaxDistance; + inst.ShellId = ShellId; + inst.ThrowShellDelayTime = ThrowShellDelayTime; inst.ThrowCollisionSize = ThrowCollisionSize; inst.ShootSound = ShootSound; inst.BeginReloadSound = BeginReloadSound; diff --git a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs index bb20329..9def84a 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/Bullet.cs @@ -17,6 +17,16 @@ /// </summary> public Weapon Weapon { get; private set; } + /// <summary> + /// 最小伤害 + /// </summary> + public int MinHarm { get; set; } = 4; + + /// <summary> + /// 最大伤害 + /// </summary> + public int MaxHarm { get; set; } = 4; + // 最大飞行距离 private float MaxDistance; @@ -89,7 +99,7 @@ node.GlobalPosition = GlobalPosition; node.AddToActivityRoot(RoomLayerEnum.YSortLayer); - role.CallDeferred(nameof(Role.Hurt), 4, Rotation); + role.CallDeferred(nameof(Role.Hurt), Utils.RandomRangeInt(MinHarm, MaxHarm), Rotation); Destroy(); } } diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs index 6d4d491..6cd9670 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon.cs @@ -1078,6 +1078,9 @@ //普通换弹处理 ReloadHandler(); } + + //上膛标记完成 + _beLoadedState = 2; } } @@ -1218,7 +1221,6 @@ private void ReloadFinishHandler() { // GD.Print("装弹完成."); - _beLoadedState = 2; OnReloadFinish(); } @@ -1644,6 +1646,8 @@ fireRotation + Mathf.DegToRad(Utils.RandomRangeFloat(Attribute.BulletMinDeviationAngle, Attribute.BulletMaxDeviationAngle)), GetAttackLayer() ); + bullet.MinHarm = Attribute.BulletMinHarm; + bullet.MaxHarm = Attribute.BulletMaxHarm; bullet.PutDown(RoomLayerEnum.YSortLayer); return bullet; } diff --git a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs index 588d1d2..8f7e3ce 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/knife/Knife.cs @@ -92,7 +92,8 @@ { if (activityObject is Role role) { - role.CallDeferred(nameof(Role.Hurt), 10, (role.GetCenterPosition() - GlobalPosition).Angle()); + role.CallDeferred(nameof(Role.Hurt), + Utils.RandomRangeInt(Attribute.BulletMinHarm, Attribute.BulletMaxHarm), (role.GetCenterPosition() - GlobalPosition).Angle()); } } }