|
1 | | -using Comfort.Common; |
| 1 | +using Aki.Reflection.Utils; |
| 2 | +using Comfort.Common; |
2 | 3 | using DrakiaXYZ.Waypoints.Helpers; |
3 | 4 | using EFT; |
4 | 5 | using EFT.Game.Spawning; |
| 6 | +using HarmonyLib; |
5 | 7 | using System; |
| 8 | +using System.Collections; |
6 | 9 | using System.Collections.Generic; |
7 | 10 | using System.Linq; |
| 11 | +using System.Reflection; |
8 | 12 | using UnityEngine; |
9 | 13 |
|
10 | 14 | namespace DrakiaXYZ.Waypoints.Components |
@@ -58,54 +62,58 @@ private void createSpawnPointObjects() |
58 | 62 |
|
59 | 63 | private void createBotZoneObjects() |
60 | 64 | { |
61 | | - foreach (BotZone botZone in botZones) |
62 | | - { |
63 | | - Console.WriteLine($"Drawing BotZone {botZone.NameZone}"); |
64 | | - Console.WriteLine($"BushPoints (Green): {botZone.BushPoints.Length}"); |
65 | | - Console.WriteLine($"CoverPoints (Blue): {botZone.CoverPoints.Length}"); |
66 | | - Console.WriteLine($"AmbushPoints (Red): {botZone.AmbushPoints.Length}"); |
67 | | - Console.WriteLine($"PatrolWays: {botZone.PatrolWays.Length}"); |
68 | | - foreach (PatrolWay patrol in botZone.PatrolWays) |
69 | | - { |
70 | | - Console.WriteLine($" {patrol.name}"); |
71 | | - } |
| 65 | + var botGame = Singleton<IBotGame>.Instance; |
| 66 | + var pointsList = botGame.BotsController.CoversData.Points; |
72 | 67 |
|
73 | | - // Bushpoints are green |
74 | | - foreach (CustomNavigationPoint bushPoint in botZone.BushPoints) |
75 | | - { |
76 | | - gameObjects.Add(GameObjectHelper.drawSphere(bushPoint.Position, 0.5f, Color.green)); |
77 | | - } |
| 68 | + var BushCovers = pointsList.Where(x => x.CoverType == CoverType.Foliage); |
| 69 | + var WallCovers = pointsList.Where(x => x.CoverType == CoverType.Wall); |
| 70 | + var ShootCovers = WallCovers.Where(x => x.PointWithNeighborType == PointWithNeighborType.cover || x.PointWithNeighborType == PointWithNeighborType.both); |
| 71 | + var AmbushCovers = WallCovers.Where(x => x.PointWithNeighborType == PointWithNeighborType.ambush); |
78 | 72 |
|
79 | | - // Coverpoints are blue |
80 | | - var coverPoints = botZone.CoverPoints; |
81 | | - foreach (CustomNavigationPoint coverPoint in coverPoints) |
82 | | - { |
83 | | - gameObjects.Add(GameObjectHelper.drawSphere(coverPoint.Position, 0.5f, Color.blue)); |
84 | | - } |
| 73 | + Console.WriteLine($"BushCovers (Green): {BushCovers.Count()}"); |
| 74 | + Console.WriteLine($"WallCovers (Blue): {WallCovers.Count()}"); |
| 75 | + Console.WriteLine($"ShootCovers (Cyan): {ShootCovers.Count()}"); |
| 76 | + Console.WriteLine($"AmbushCovers (Red): {AmbushCovers.Count()}"); |
85 | 77 |
|
86 | | - // Ambushpoints are red |
87 | | - var ambushPoints = botZone.AmbushPoints; |
88 | | - foreach (CustomNavigationPoint ambushPoint in ambushPoints) |
89 | | - { |
90 | | - gameObjects.Add(GameObjectHelper.drawSphere(ambushPoint.Position, 0.5f, Color.red)); |
91 | | - } |
| 78 | + // BushCovers are green |
| 79 | + foreach (var point in BushCovers) |
| 80 | + { |
| 81 | + gameObjects.Add(GameObjectHelper.drawSphere(point.Position, 0.5f, Color.green)); |
| 82 | + } |
92 | 83 |
|
93 | | - // Patrol points are yellow |
94 | | - var patrolWays = botZone.PatrolWays; |
95 | | - foreach (PatrolWay patrolWay in patrolWays) |
96 | | - { |
97 | | - foreach (PatrolPoint patrolPoint in patrolWay.Points) |
98 | | - { |
99 | | - gameObjects.Add(GameObjectHelper.drawSphere(patrolPoint.Position, 0.5f, Color.yellow)); |
100 | | - |
101 | | - //// Sub-points are purple |
102 | | - //foreach (PatrolPoint subPoint in patrolPoint.subPoints) |
103 | | - //{ |
104 | | - // gameObjects.Add(GameObjectHelper.drawSphere(subPoint.Position, 0.25f, Color.magenta)); |
105 | | - //} |
106 | | - } |
107 | | - } |
| 84 | + // WallCovers are blue |
| 85 | + foreach (var point in WallCovers) |
| 86 | + { |
| 87 | + gameObjects.Add(GameObjectHelper.drawSphere(point.Position, 0.5f, Color.blue)); |
| 88 | + } |
| 89 | + |
| 90 | + // ShootCovers are cyan |
| 91 | + foreach (var point in ShootCovers) |
| 92 | + { |
| 93 | + gameObjects.Add(GameObjectHelper.drawSphere(point.Position, 0.5f, Color.cyan)); |
108 | 94 | } |
| 95 | + |
| 96 | + // Ambushpoints are red |
| 97 | + foreach (var point in AmbushCovers) |
| 98 | + { |
| 99 | + gameObjects.Add(GameObjectHelper.drawSphere(point.Position, 0.5f, Color.red)); |
| 100 | + } |
| 101 | + |
| 102 | + //// Patrol points are yellow |
| 103 | + //var patrolWays = botZone.PatrolWays; |
| 104 | + //foreach (PatrolWay patrolWay in patrolWays) |
| 105 | + //{ |
| 106 | + // foreach (PatrolPoint patrolPoint in patrolWay.Points) |
| 107 | + // { |
| 108 | + // gameObjects.Add(GameObjectHelper.drawSphere(patrolPoint.Position, 0.5f, Color.yellow)); |
| 109 | + |
| 110 | + // //// Sub-points are purple |
| 111 | + // //foreach (PatrolPoint subPoint in patrolPoint.subPoints) |
| 112 | + // //{ |
| 113 | + // // gameObjects.Add(GameObjectHelper.drawSphere(subPoint.Position, 0.25f, Color.magenta)); |
| 114 | + // //} |
| 115 | + // } |
| 116 | + //} |
109 | 117 | } |
110 | 118 |
|
111 | 119 | private void CachePoints(bool forced) |
|
0 commit comments