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

◆ GetPossibleChestsToTrapify()

List< int > Terraria.GameContent.Biomes.DeadMansChestBiome.GetPossibleChestsToTrapify ( StructureMap structures)
inline

Definition at line 405 of file DeadMansChestBiome.cs.

406 {
407 List<int> list = new List<int>();
408 bool[] array = new bool[TileID.Sets.GeneralPlacementTiles.Length];
409 for (int i = 0; i < array.Length; i++)
410 {
412 }
413 array[21] = true;
414 array[467] = true;
415 for (int j = 0; j < 8000; j++)
416 {
417 Chest chest = Main.chest[j];
418 if (chest == null)
419 {
420 continue;
421 }
422 Point position = new Point(chest.x, chest.y);
423 if (IsAGoodSpot(position))
424 {
425 ClearCaches();
426 Point position2 = new Point(position.X, position.Y + 1);
429 if (AreThereEnoughTraps() && (structures == null || structures.CanPlace(new Rectangle(position.X, position.Y, 1, 1), array, 10)))
430 {
431 list.Add(j);
432 }
433 }
434 }
435 return list;
436 }
static bool[] GeneralPlacementTiles
Definition TileID.cs:221
bool CanPlace(Rectangle area, int padding=0)

References Terraria.GameContent.Biomes.DeadMansChestBiome.AreThereEnoughTraps(), Terraria.WorldBuilding.StructureMap.CanPlace(), Terraria.Main.chest, Terraria.GameContent.Biomes.DeadMansChestBiome.ClearCaches(), Terraria.GameContent.Biomes.DeadMansChestBiome.FindBoulderTrapSpots(), Terraria.GameContent.Biomes.DeadMansChestBiome.FindDartTrapSpots(), Terraria.ID.TileID.Sets.GeneralPlacementTiles, Terraria.GameContent.Biomes.DeadMansChestBiome.IsAGoodSpot(), Microsoft.Xna.Framework.Point.X, Terraria.Chest.x, Microsoft.Xna.Framework.Point.Y, and Terraria.Chest.y.