diff --git a/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs index 9a7d44e..f08bc15 100644 --- a/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs +++ b/DungeonShooting_Godot/src/framework/map/preinstall/RoomPreinstall.cs @@ -159,7 +159,6 @@ random.RandomRangeInt((int)(pos.X - birthRect.X / 2), (int)(pos.X + birthRect.X / 2)), random.RandomRangeInt((int)(pos.Y - birthRect.Y / 2), (int)(pos.Y + birthRect.Y / 2)) ); - var offset = RoomInfo.GetOffsetPosition(); //var offset = RoomInfo.RoomSplit.RoomInfo.Position.AsVector2I(); //mark.Position = RoomInfo.GetWorldPosition() + tempPos - offset; mark.Position = RoomInfo.ToGlobalPosition(tempPos); diff --git a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs index 0ba5075..7344daf 100644 --- a/DungeonShooting_Godot/src/game/activity/role/RoleState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/RoleState.cs @@ -210,4 +210,20 @@ return distance; } + + /// + /// 子弹穿透次数 + /// + public event Action> CalcBulletPenetrationEvent; + public int CalcBulletPenetration(Weapon weapon, int distance) + { + if (CalcBulletPenetrationEvent != null) + { + var result = new RefValue(distance); + CalcBulletPenetrationEvent(weapon, distance, result); + return result.Value; + } + + return distance; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/weapon/Weapon_Bullet.cs b/DungeonShooting_Godot/src/game/activity/weapon/Weapon_Bullet.cs index 80cedf5..2370533 100644 --- a/DungeonShooting_Godot/src/game/activity/weapon/Weapon_Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/weapon/Weapon_Bullet.cs @@ -91,6 +91,7 @@ data.FlySpeed = roleState.CalcBulletSpeed(this, data.FlySpeed); data.MaxDistance = roleState.CalcBulletDistance(this, data.MaxDistance); data.BounceCount = roleState.CalcBulletBounceCount(this, data.BounceCount); + data.Penetration = roleState.CalcBulletPenetration(this, data.Penetration); deviationAngle = roleState.CalcBulletDeviationAngle(this, deviationAngle); if (TriggerRole.IsAi) //只有玩家使用该武器才能获得正常速度的子弹 diff --git a/DungeonShooting_Godot/src/game/data/BulletData.cs b/DungeonShooting_Godot/src/game/data/BulletData.cs index a8895d9..cd57ab2 100644 --- a/DungeonShooting_Godot/src/game/data/BulletData.cs +++ b/DungeonShooting_Godot/src/game/data/BulletData.cs @@ -55,7 +55,7 @@ /// /// 子弹最大穿透次数 /// - public float Penetration; + public int Penetration; /// /// 子弹最大存在时间 diff --git a/README.md b/README.md index 0acf3f2..ddf21a1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,6 @@ --- ### 其他 -**开发日志:** [开发日志.md](DungeonShooting_Document/开发日志.md) +**开发日志:** [开发日志.md](DungeonShooting_Document/开发日志.md) **哔哩哔哩:** https://space.bilibili.com/259437820 **项目Ui插件:** https://github.com/xlljc/Ds_Ui \ No newline at end of file