Exemple #1
0
 public static NPCUtils.TargetSearchResults SearchForTarget(
     NPC searcher,
     NPCUtils.TargetSearchFlag flags             = NPCUtils.TargetSearchFlag.All,
     NPCUtils.SearchFilter <Player> playerFilter = null,
     NPCUtils.SearchFilter <NPC> npcFilter       = null)
 {
     return(NPCUtils.SearchForTarget(searcher, searcher.Center, flags, playerFilter, npcFilter));
 }
Exemple #2
0
 public static NPCUtils.TargetSearchResults SearchForTarget(
     Vector2 position,
     NPCUtils.TargetSearchFlag flags             = NPCUtils.TargetSearchFlag.All,
     NPCUtils.SearchFilter <Player> playerFilter = null,
     NPCUtils.SearchFilter <NPC> npcFilter       = null)
 {
     return(NPCUtils.SearchForTarget((NPC)null, position, flags, playerFilter, npcFilter));
 }
Exemple #3
0
 // Token: 0x0600095C RID: 2396 RVA: 0x003B6030 File Offset: 0x003B4230
 public static void TargetClosestOldOnesInvasion(NPC searcher, bool faceTarget = true, Vector2?checkPosition = null)
 {
     NPCUtils.TargetSearchResults targetSearchResults = NPCUtils.SearchForTarget(searcher, NPCUtils.TargetSearchFlag.All, NPCUtils.SearchFilters.OnlyPlayersInCertainDistance(searcher.Center, 200f), new NPCUtils.SearchFilter <NPC>(NPCUtils.SearchFilters.OnlyCrystal));
     if (!targetSearchResults.FoundTarget)
     {
         return;
     }
     searcher.target     = targetSearchResults.NearestTargetIndex;
     searcher.targetRect = targetSearchResults.NearestTargetHitbox;
     if (searcher.ShouldFaceTarget(ref targetSearchResults, null) & faceTarget)
     {
         searcher.FaceTarget();
     }
 }
Exemple #4
0
 public static void TargetClosestNonBees(NPC searcher, bool faceTarget = true, Vector2?checkPosition = null)
 {
     NPCUtils.TargetSearchResults searchResults = NPCUtils.SearchForTarget(searcher, NPCUtils.TargetSearchFlag.All, (NPCUtils.SearchFilter <Player>)null, new NPCUtils.SearchFilter <NPC>(NPCUtils.SearchFilters.NonBeeNPCs));
     if (!searchResults.FoundTarget)
     {
         return;
     }
     searcher.target     = searchResults.NearestTargetIndex;
     searcher.targetRect = searchResults.NearestTargetHitbox;
     if (!(searcher.ShouldFaceTarget(ref searchResults, new NPCUtils.TargetType?()) & faceTarget))
     {
         return;
     }
     searcher.FaceTarget();
 }
Exemple #5
0
 // Token: 0x0600095D RID: 2397 RVA: 0x003B60A0 File Offset: 0x003B42A0
 public static void TargetClosestBetsy(NPC searcher, bool faceTarget = true, Vector2?checkPosition = null)
 {
     NPCUtils.TargetSearchResults targetSearchResults = NPCUtils.SearchForTarget(searcher, NPCUtils.TargetSearchFlag.All, null, new NPCUtils.SearchFilter <NPC>(NPCUtils.SearchFilters.OnlyCrystal));
     if (!targetSearchResults.FoundTarget)
     {
         return;
     }
     NPCUtils.TargetType value = targetSearchResults.NearestTargetType;
     if (targetSearchResults.FoundTank && !targetSearchResults.NearestTankOwner.dead)
     {
         value = NPCUtils.TargetType.Player;
     }
     searcher.target     = targetSearchResults.NearestTargetIndex;
     searcher.targetRect = targetSearchResults.NearestTargetHitbox;
     if (searcher.ShouldFaceTarget(ref targetSearchResults, new NPCUtils.TargetType?(value)) & faceTarget)
     {
         searcher.FaceTarget();
     }
 }