diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preinstall.json index 553b233b..e0cc3386 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preinstall.json @@ -1 +1 @@ -[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":true,"WaveList":[[{"Position":{"X":0,"Y":0},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":53,"Y":31},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0003","CurrAmmon":"12","ResidueAmmo":"12"},"Altitude":0,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":84,"Y":8},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0002","CurrAmmon":"7","ResidueAmmo":"7"},"Altitude":0,"VerticalSpeed":5.551115E-14}]}]]}] \ No newline at end of file +[{"Name":"Preinstall1","Weight":100,"Remark":"","AutoFill":true,"WaveList":[[{"Position":{"X":-81,"Y":25},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":53,"Y":31},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0003","CurrAmmon":"12","ResidueAmmo":"12"},"Altitude":0,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":84,"Y":8},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"enemy0001","Weight":100,"Attr":{"Face":"0","Weapon":"weapon0002","CurrAmmon":"7","ResidueAmmo":"7"},"Altitude":0,"VerticalSpeed":5.551115E-14}]},{"Position":{"X":-54,"Y":20},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":5.551115E-14}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preview.png index 556c95cc..a1a56f63 100644 Binary files a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preview.png and b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/Preview.png differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/RoomInfo.json index 9c57f07f..1b4a534f 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/RoomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/RoomInfo.json @@ -1 +1 @@ -{"Position":{"X":-5,"Y":-7},"Size":{"X":15,"Y":16},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":2,"RoomName":"Start2","Weight":100,"Remark":""} \ No newline at end of file +{"Position":{"X":-9,"Y":-7},"Size":{"X":19,"Y":16},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":2,"RoomName":"Start2","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/TileInfo.json index ce7a5250..d48b637a 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start2/TileInfo.json @@ -1 +1 @@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4,0,3,6,5,0,3,6,6,0,3,7,-4,0,3,7,-3,0,3,7,-2,0,3,7,-1,0,3,7,0,0,3,7,1,0,3,7,2,0,3,7,3,0,3,7,4,0,3,7,5,0,3,7,6,0,3],"CustomFloor1":[],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file +{"NavigationVertices":[{"X":6,"Y":86},{"X":122,"Y":122},{"X":-106,"Y":122},{"X":-22,"Y":86},{"X":-106,"Y":-58},{"X":-22,"Y":-22},{"X":122,"Y":-58},{"X":6,"Y":-22}],"NavigationPolygon":[[0,1,2,3],[3,2,4,5],[5,4,6,7],[6,1,0,7]],"Floor":[-3,-4,0,3,-3,-3,0,3,-3,-2,0,3,-3,-1,0,3,-3,0,0,3,-3,1,0,3,-3,2,0,3,-3,3,0,3,-3,4,0,3,-3,5,0,3,-3,6,0,3,-2,-4,0,3,-2,-3,0,3,-2,-2,0,3,-2,0,0,3,-2,1,0,3,-2,2,0,3,-2,3,0,3,-2,4,0,3,-2,5,0,3,-2,6,0,3,-1,-4,0,3,-1,-3,0,3,-1,5,0,3,-1,6,0,3,0,-4,0,3,0,-3,0,3,0,-2,0,3,0,-1,0,3,0,0,0,3,0,1,0,3,0,2,0,3,0,3,0,3,0,4,0,3,0,5,0,3,0,6,0,3,1,-4,0,3,1,-3,0,3,1,-2,0,3,1,-1,0,3,1,0,0,3,1,1,0,3,1,2,0,3,1,3,0,3,1,4,0,3,1,5,0,3,1,6,0,3,2,-4,0,3,2,-3,0,3,2,-2,0,3,2,-1,0,3,2,0,0,3,2,1,0,3,2,2,0,3,2,3,0,3,2,4,0,3,2,5,0,3,2,6,0,3,3,-4,0,3,3,-3,0,3,3,-2,0,3,3,-1,0,3,3,0,0,3,3,1,0,3,3,2,0,3,3,3,0,3,3,4,0,3,3,5,0,3,3,6,0,3,4,-4,0,3,4,-3,0,3,4,-2,0,3,4,-1,0,3,4,0,0,3,4,1,0,3,4,2,0,3,4,3,0,3,4,4,0,3,4,5,0,3,4,6,0,3,5,-4,0,3,5,-3,0,3,5,-2,0,3,5,-1,0,3,5,0,0,3,5,1,0,3,5,2,0,3,5,3,0,3,5,4,0,3,5,5,0,3,5,6,0,3,6,-4,0,3,6,-3,0,3,6,-2,0,3,6,-1,0,3,6,0,0,3,6,1,0,3,6,2,0,3,6,3,0,3,6,4,0,3,6,5,0,3,6,6,0,3,7,-4,0,3,7,-3,0,3,7,-2,0,3,7,-1,0,3,7,0,0,3,7,1,0,3,7,2,0,3,7,3,0,3,7,4,0,3,7,5,0,3,7,6,0,3,-4,6,0,3,-4,5,0,3,-4,4,0,3,-4,3,0,3,-4,2,0,3,-4,1,0,3,-4,0,0,3,-4,-1,0,3,-4,-2,0,3,-4,-3,0,3,-4,-4,0,3,-5,-4,0,3,-5,-3,0,3,-5,-2,0,3,-5,-1,0,3,-5,0,0,3,-5,1,0,3,-5,2,0,3,-5,3,0,3,-5,4,0,3,-5,5,0,3,-5,6,0,3,-6,6,0,3,-6,5,0,3,-6,4,0,3,-6,3,0,3,-6,2,0,3,-6,1,0,3,-6,0,0,3,-6,-1,0,3,-6,-2,0,3,-6,-3,0,3,-6,-4,0,3,-7,-4,0,3,-7,-3,0,3,-7,-2,0,3,-7,-1,0,3,-7,0,0,3,-7,1,0,3,-7,2,0,3,-7,3,0,3,-7,4,0,3,-7,5,0,3,-7,6,0,3,-2,-1,0,3],"CustomFloor1":[],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 0c2112ed..53a5b935 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -134,7 +134,7 @@ public partial class GameApplication : Node2D, ICoroutine //固定帧率 //Engine.MaxFps = TargetFps; //调试绘制开关 - ActivityObject.IsDebug = false; + ActivityObject.IsDebug = true; //Engine.TimeScale = 0.2f; //调整窗口分辨率 OnWindowSizeChanged(); diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAstonishedState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAstonishedState.cs index 7e8f382f..d3f446f7 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAstonishedState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAstonishedState.cs @@ -7,13 +7,10 @@ namespace AiState; /// public class AiAstonishedState : StateBase { - /// - /// 下一个状态 - /// - public AIStateEnum NextState; - private float _timer; private object[] _args; + //用于判断是否进入过惊讶状态 + private bool _flag = false; public AiAstonishedState() : base(AIStateEnum.AiAstonished) { @@ -28,9 +25,15 @@ public class AiAstonishedState : StateBase return; } + if (_flag) + { + ChangeNextState(args); + return; + } + + _flag = true; _args = args; - NextState = (AIStateEnum)args[0]; _timer = 0.6f; //播放惊讶表情 @@ -46,14 +49,19 @@ public class AiAstonishedState : StateBase _timer -= delta; if (_timer <= 0) { - if (_args.Length == 1) - { - ChangeState(NextState); - } - else if (_args.Length == 2) - { - ChangeState(NextState, _args[1]); - } + ChangeNextState(_args); + } + } + + private void ChangeNextState(object[] args) + { + if (args.Length == 1) + { + ChangeState((AIStateEnum)args[0]); + } + else if (args.Length == 2) + { + ChangeState((AIStateEnum)args[0], args[1]); } } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAttackState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAttackState.cs index 8fcb08d3..417a0397 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAttackState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiAttackState.cs @@ -43,7 +43,9 @@ public class AiAttackState : StateBase { if (Master.LookTarget == null) { - throw new Exception("进入 AIAdvancedStateEnum.AiAttack 状态时角色没有攻击目标!"); + ChangeState(AIStateEnum.AiNormal); + return; + //throw new Exception("进入 AIAdvancedStateEnum.AiAttack 状态时角色没有攻击目标!"); } var weapon = Master.WeaponPack.ActiveItem; diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiFollowUpState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiFollowUpState.cs index c231a9af..679ed22b 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiFollowUpState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiFollowUpState.cs @@ -21,7 +21,9 @@ public class AiFollowUpState : StateBase { if (Master.LookTarget == null) { - throw new Exception("进入 AIAdvancedStateEnum.AiFollowUp 状态时角色没有攻击目标!"); + ChangeState(AIStateEnum.AiNormal); + return; + //throw new Exception("进入 AIAdvancedStateEnum.AiFollowUp 状态时角色没有攻击目标!"); } _navigationUpdateTimer = 0; diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiNotifyState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiNotifyState.cs index b1e0b3f1..fac6cc87 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiNotifyState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiNotifyState.cs @@ -17,7 +17,9 @@ public class AiNotifyState : StateBase { if (Master.LookTarget == null) { - throw new Exception("进入 AIAdvancedStateEnum.AiNotify 没有攻击目标!"); + ChangeState(AIStateEnum.AiNormal); + return; + //throw new Exception("进入 AIAdvancedStateEnum.AiNotify 没有攻击目标!"); } _timer = 1.2f; //通知其它角色 diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiSurroundState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiSurroundState.cs index 46497e13..47608369 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiSurroundState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiSurroundState.cs @@ -32,7 +32,9 @@ public class AiSurroundState : StateBase { if (Master.LookTarget == null) { - throw new Exception("进入 AIAdvancedStateEnum.AiSurround 状态时角色没有攻击目标!"); + ChangeState(AIStateEnum.AiNormal); + return; + //throw new Exception("进入 AIAdvancedStateEnum.AiSurround 状态时角色没有攻击目标!"); } Master.TargetInView = true; diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiTailAfterState.cs b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiTailAfterState.cs index 05a5d9e7..b59e8492 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/state/AiTailAfterState.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/state/AiTailAfterState.cs @@ -29,7 +29,9 @@ public class AiTailAfterState : StateBase { if (Master.LookTarget == null) { - throw new Exception("进入 AIAdvancedStateEnum.AiTailAfter 状态时角色没有攻击目标!"); + ChangeState(AIStateEnum.AiNormal); + return; + //throw new Exception("进入 AIAdvancedStateEnum.AiTailAfter 状态时角色没有攻击目标!"); } _isInViewRange = true;