TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ AI_007_TownEntities_Shimmer_ScanForBestSpotToLandOn()

Vector2? Terraria.NPC.AI_007_TownEntities_Shimmer_ScanForBestSpotToLandOn ( )
inlineprivate

Definition at line 59152 of file NPC.cs.

59153 {
59154 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
59155 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
59156 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
59157 //IL_003e: Unknown result type (might be due to invalid IL or missing references)
59158 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
59159 //IL_0061: Unknown result type (might be due to invalid IL or missing references)
59160 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
59161 //IL_00f4: Unknown result type (might be due to invalid IL or missing references)
59162 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
59163 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
59164 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
59165 Point point = base.Top.ToTileCoordinates();
59166 int num = 30;
59167 Vector2? result = null;
59168 bool flag = homeless && (homeTileX == -1 || homeTileY == -1);
59169 for (int i = 1; i < num; i += 2)
59170 {
59171 Vector2? vector = ShimmerHelper.FindSpotWithoutShimmer(this, point.X, point.Y, i, flag);
59172 if (vector.HasValue)
59173 {
59174 result = vector.Value;
59175 break;
59176 }
59177 }
59178 if (!result.HasValue && homeTileX != -1 && homeTileY != -1)
59179 {
59180 for (int j = 1; j < num; j += 2)
59181 {
59183 if (vector2.HasValue)
59184 {
59185 result = vector2.Value;
59186 break;
59187 }
59188 }
59189 }
59190 if (!result.HasValue)
59191 {
59192 int num2 = (flag ? 30 : 0);
59193 num = 60;
59194 flag = true;
59195 for (int k = num2; k < num; k += 2)
59196 {
59197 Vector2? vector3 = ShimmerHelper.FindSpotWithoutShimmer(this, point.X, point.Y, k, flag);
59198 if (vector3.HasValue)
59199 {
59200 result = vector3.Value;
59201 break;
59202 }
59203 }
59204 }
59205 if (!result.HasValue && homeTileX != -1 && homeTileY != -1)
59206 {
59207 num = 60;
59208 flag = true;
59209 for (int l = 30; l < num; l += 2)
59210 {
59212 if (vector4.HasValue)
59213 {
59214 result = vector4.Value;
59215 break;
59216 }
59217 }
59218 }
59219 return result;
59220 }
static ? Vector2 FindSpotWithoutShimmer(Entity entity, int startX, int startY, int expand, bool allowSolidTop)
int homeTileX
Definition NPC.cs:1180
bool homeless
Definition NPC.cs:1178
int homeTileY
Definition NPC.cs:1182

References Terraria.GameContent.ShimmerHelper.FindSpotWithoutShimmer(), Terraria.NPC.homeless, Terraria.NPC.homeTileX, and Terraria.NPC.homeTileY.

Referenced by Terraria.NPC.AI_007_TownEntities_Shimmer_TeleportToLandingSpot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: