diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png index 7f5ea4d..41a778f 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Battle2/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs index b3ef7bf..ddec291 100644 --- a/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs +++ b/DungeonShooting_Godot/src/framework/map/AffiliationArea.cs @@ -114,7 +114,7 @@ { return _includeItems.Count; } - + /// /// 统计符合条件的数量 /// @@ -224,6 +224,37 @@ return false; } + + /// + /// 遍历该该区域的物体 + /// + /// 操作函数, 返回 false 表示跳出循环 + public void ForEachIncludeItems(Func handler) + { + foreach (var activityObject in _includeItems) + { + if (!activityObject.IsDestroyed && handler(activityObject)) + { + return; + } + } + } + + /// + /// 遍历该进入该区域的物体 + /// + /// 操作函数, 返回 false 表示跳出循环 + public void ForEachEnterItems(Func handler) + { + foreach (var activityObject in _enterItems) + { + if (!activityObject.IsDestroyed && handler(activityObject)) + { + return; + } + } + } + /// /// 返回物体是否进入了该区域 diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index e53840c..f77474a 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -662,7 +662,7 @@ else if (enemy is AdvancedEnemy ae) { var state = ae.StateController.CurrState; - if (state == AIAdvancedStateEnum.AiFollowUp || state == AIAdvancedStateEnum.AiSurround) //目标在视野内 + if (state == AIAdvancedStateEnum.AiFollowUp || state == AIAdvancedStateEnum.AiSurround || state == AIAdvancedStateEnum.AiFindAmmo) //目标在视野内 { if (!World.Enemy_IsFindTarget) {