Exemplo n.º 1
0
 internal void SetupPathfinderMetas()
 {
     // these values don't like being initialized in Initialize() for some reason
     myTacticsPlayer = player.GetModPlayer <MinionTacticsPlayer>();
     pathfinderMetas = new PathfinderMetadata[MinionTacticsPlayer.TACTICS_GROUPS_COUNT];
     for (int i = 0; i < MinionTacticsPlayer.TACTICS_GROUPS_COUNT; i++)
     {
         pathfinderMetas[i] = new PathfinderMetadata(this, i);
     }
     for (int i = 0; i < Main.maxPlayers; i++)
     {
         Player p = Main.player[i];
         if (p.active)
         {
             MinionPathfindingPlayer pathPlayer = p.GetModPlayer <MinionPathfindingPlayer>();
         }
     }
 }
Exemplo n.º 2
0
 private void BuildMinionsAtWaypointList()
 {
     for (int j = 0; j < MinionTacticsPlayer.TACTICS_GROUPS_COUNT; j++)
     {
         PathfinderMetadata meta = pathfinderMetas[j];
         meta.MinionsAtWaypoint.Clear();
         if (meta.WaypointPosition == default)
         {
             return;
         }
         for (int i = 0; i < Main.maxProjectiles; i++)
         {
             Projectile p = Main.projectile[i];
             if (p.active && p.owner == player.whoAmI && (p.minion || ProjectileID.Sets.MinionShot[p.type]) &&
                 Vector2.DistanceSquared(meta.WaypointPosition, p.Center) < WAYPOINT_PROXIMITY_THRESHOLD * WAYPOINT_PROXIMITY_THRESHOLD)
             {
                 meta.MinionsAtWaypoint.Add(p);
             }
         }
     }
 }