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

◆ CheckSpecialTownNPCSpawningConditions()

static bool Terraria.WorldGen.CheckSpecialTownNPCSpawningConditions ( int type)
inlinestatic

Definition at line 1956 of file WorldGen.cs.

1957 {
1958 if (!NPCLoader.CheckConditions(type))
1959 {
1960 return false;
1961 }
1962 if (type == 160)
1963 {
1964 if (!NPC.unlockedTruffleSpawn && (double)roomY2 > Main.worldSurface)
1965 {
1966 return false;
1967 }
1969 int num = 0;
1970 for (int i = startX + 1; i < endX; i++)
1971 {
1972 for (int j = startY + 2; j < endY + 2; j++)
1973 {
1974 Tile tile = Main.tile[i, j];
1975 if (tile.active() && (tile.type == 70 || tile.type == 71 || tile.type == 72 || tile.type == 528))
1976 {
1977 num++;
1978 }
1979 }
1980 }
1981 if (num >= SceneMetrics.MushroomTileThreshold)
1982 {
1983 return true;
1984 }
1985 return false;
1986 }
1987 return true;
1988 }
static bool CheckConditions(int type)
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26
static int roomY2
Definition WorldGen.cs:1302
static void Housing_GetTestedRoomBounds(out int startX, out int endX, out int startY, out int endY)
Definition WorldGen.cs:2804

References Terraria.Tile.active(), Terraria.ModLoader.NPCLoader.CheckConditions(), Terraria.WorldGen.Housing_GetTestedRoomBounds(), Terraria.SceneMetrics.MushroomTileThreshold, Terraria.WorldGen.roomY2, Terraria.Main.tile, Terraria.Tile.type, Terraria.NPC.unlockedTruffleSpawn, and Terraria.Main.worldSurface.

Referenced by Terraria.WorldGen.FindAHomelessNPC(), Terraria.WorldGen.IsThereASpawnablePrioritizedTownNPC(), Terraria.WorldGen.IsThereASpawnablePrioritizedTownNPC_Old(), and Terraria.WorldGen.MoveTownNPC().

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