public static void GenerateShrine(User user, int numberOfShrines = 1, int shrineSize = 12) { if (shrineSize < 1 || shrineSize > 20) { ChatManager.DebugAddToChatLog("#Shrine location", "Shrine size must be between 1 and 20", user.Name, 1); return; } for (int i = 0; i < numberOfShrines; ++i) { var location = World.GetRandomLandPos() + (Vector3i.Down * (shrineSize * 2)); location.SpiralOutXZIter(shrineSize).ForEach(x => { var height = Math.Min((shrineSize * 0.5f), (shrineSize * 0.6f) - WorldPosition3i.Distance(x, location)); for (int j = 0; j < height; ++j) { if (!World.GetBlock((Vector3i)x + (Vector3i.Up * j)).Is <Impenetrable>()) { World.DeleteBlock((Vector3i)x + (Vector3i.Up * j)); } if ((int)WorldPosition3i.Distance(x, location) != 0 && !World.GetBlock((Vector3i)x + (Vector3i.Down * j)).Is <Impenetrable>()) { World.SetBlock <WaterBlock>((Vector3i)x + (Vector3i.Down * j)); } } }); WorldObjectUtil.Spawn("EckoStatueObject", null, (Vector3i)location); ChatManager.DebugAddToChatLog("#Shrine location", location.ToString(), user.Name, 1); } }
public void Generate(Random seed, Vector3 voxelSize, WorldSettings settings) { for (int i = 0; i < numberOfShrines; ++i) { var location = World.GetRandomLandPos() + (Vector3i.Down * (shrineSize * 2)); location.SpiralOutXZIter(shrineSize).ForEach(x => { var height = Math.Min((shrineSize * 0.5f), (shrineSize * 0.6f) - WorldPosition3i.Distance(x, location)); for (int j = 0; j < height; ++j) { if (!World.GetBlock((Vector3i)x + (Vector3i.Up * j)).Is <Impenetrable>()) { World.DeleteBlock((Vector3i)x + (Vector3i.Up * j)); } if ((int)WorldPosition3i.Distance(x, location) != 0 && !World.GetBlock((Vector3i)x + (Vector3i.Down * j)).Is <Impenetrable>()) { World.SetBlock <WaterBlock>((Vector3i)x + (Vector3i.Down * j)); } } }); WorldObjectUtil.Spawn("EckoStatueObject", null, (Vector3i)location); } }