From 571f9fdca93db57821b56d44adc930ea56bcd533 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 20 Jun 2022 20:02:26 -0500 Subject: [PATCH] 1 - Abominations. --- CalPlayer/CalamityPlayerMiscEffects.cs | 4 ++-- World/Planets/GrassPlanet.cs | 12 ++++++------ World/Planets/MainPlanet.cs | 6 +++--- World/Planets/MudPlanet.cs | 2 +- World/Planets/Planetoid.cs | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c1c52f4c6a..367cf1b8fa 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -828,12 +828,12 @@ namespace CalamityMod.CalPlayer // Death Mode effects caveDarkness = 0f; - if (CalamityWorld.death) + if (CalamityWorld.death || Main.getGoodWorld) { if (Player.whoAmI == Main.myPlayer) { // Thorn and spike effects - // 10 = crimson/corruption thorns, 17 = jungle thorns, 40 = dungeon spikes, 60 = temple spikes + // 10 = crimson/corruption thorns, 17 = jungle thorns, 80 = temple spikes Vector2 tileType; if (!Player.mount.Active || !Player.mount.Cart) tileType = Collision.HurtTiles(Player.position, Player.velocity, Player.width, Player.height, Player.fireWalk); diff --git a/World/Planets/GrassPlanet.cs b/World/Planets/GrassPlanet.cs index f584965b15..8484691ef3 100644 --- a/World/Planets/GrassPlanet.cs +++ b/World/Planets/GrassPlanet.cs @@ -21,9 +21,9 @@ namespace CalamityMod.World.Planets private ushort[] oreTypes = new ushort[] { WorldGen.copperBar == TileID.Copper ? (Main.getGoodWorld ? TileID.Palladium : TileID.Tin) : (Main.getGoodWorld ? TileID.Cobalt : TileID.Copper), - WorldGen.ironBar == TileID.Iron ? (Main.getGoodWorld ? TileID.Orichalcum : TileID.Lead) : (Main.getGoodWorld ? TileID.Mythril : TileID.Iron), - WorldGen.silverBar == TileID.Silver ? (Main.getGoodWorld ? TileID.Titanium : TileID.Tungsten) : (Main.getGoodWorld ? TileID.Adamantite : TileID.Silver), - WorldGen.goldBar == TileID.Gold ? (Main.getGoodWorld ? (ushort)ModContent.TileType() : TileID.Platinum) : (Main.getGoodWorld ? (ushort)ModContent.TileType() : TileID.Gold) + WorldGen.ironBar == TileID.Iron ? (Main.getGoodWorld ? TileID.Palladium : TileID.Lead) : (Main.getGoodWorld ? TileID.Cobalt : TileID.Iron), + WorldGen.silverBar == TileID.Silver ? (Main.getGoodWorld ? TileID.Orichalcum : TileID.Tungsten) : (Main.getGoodWorld ? TileID.Mythril : TileID.Silver), + WorldGen.goldBar == TileID.Gold ? (Main.getGoodWorld ? TileID.Titanium : TileID.Platinum) : (Main.getGoodWorld ? TileID.Adamantite : TileID.Gold) }; public override bool Place(Point origin, StructureMap structures) @@ -66,7 +66,7 @@ namespace CalamityMod.World.Planets //Place layers WorldUtils.Gen(origin, new ModShapes.All(core), Actions.Chain(new GenAction[] { - new Actions.PlaceTile(TileID.Stone), + new Actions.PlaceTile(Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone), new Actions.PlaceWall(WallID.Cave2Unsafe) })); WorldUtils.Gen(origin, new ModShapes.All(crust), Actions.Chain(new GenAction[] @@ -87,7 +87,7 @@ namespace CalamityMod.World.Planets x = _random.Next(origin.X - radius, origin.X + radius + 1); y = _random.Next(origin.Y - radius, origin.Y + radius + 1); } - WorldGen.TileRunner(x, y, _random.NextFloat(4.6f, 7.6f), _random.Next(7, 16), TileID.Stone); + WorldGen.TileRunner(x, y, _random.NextFloat(4.6f, 7.6f), _random.Next(7, 16), Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone); } for (int i = 0; i < randDirt; i++) { @@ -192,7 +192,7 @@ namespace CalamityMod.World.Planets //Clear dirt walls on outer edge because of stone / ore WorldUtils.Gen(origin, new ModShapes.InnerOutline(crust), Actions.Chain(new GenAction[] { - new Modifiers.OnlyTiles(new ushort[] { TileID.Stone, oreType }), + new Modifiers.OnlyTiles(new ushort[] { Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone, oreType }), new Modifiers.IsTouchingAir(true), new Modifiers.OnlyWalls(WallID.DirtUnsafe), new Actions.ClearWall(true) diff --git a/World/Planets/MainPlanet.cs b/World/Planets/MainPlanet.cs index 83262f1dbe..9b05d6bf7f 100644 --- a/World/Planets/MainPlanet.cs +++ b/World/Planets/MainPlanet.cs @@ -54,7 +54,7 @@ namespace CalamityMod.World.Planets WorldUtils.Gen(origin, new Shapes.Circle((int)(radius * outerRadiusPercentage)), Actions.Chain(new GenAction[] { new Modifiers.Blotches(2, 0.45).Output(outerCoreShape), - new Actions.SetTile(TileID.Stone, true), + new Actions.SetTile(Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone, true), new Actions.ClearWall(), new Actions.PlaceWall(WallID.CaveUnsafe) })); @@ -64,7 +64,7 @@ namespace CalamityMod.World.Planets while (numStone > 0) { Point p = outerCore.RandomPointOnCircleEdge().ToTileCoordinates(); - WorldGen.TileRunner(p.X, p.Y, _random.NextFloat(3f, 6f), _random.Next(5, 15), TileID.Stone); + WorldGen.TileRunner(p.X, p.Y, _random.NextFloat(3f, 6f), _random.Next(5, 15), Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone); numStone--; } int numDirt = _random.Next(80, 110); @@ -147,7 +147,7 @@ namespace CalamityMod.World.Planets if (Vector2.Distance(planetCenter, new Vector2(x * 16 + 8, startY * 16 + 8)) > radius * 16f - 64) { _tiles[x, startY].Get().HasTile = true; - _tiles[x, startY].TileType = TileID.Stone; + _tiles[x, startY].TileType = Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone; } } } diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 41b58a43e5..44a0a18bb9 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -49,7 +49,7 @@ namespace CalamityMod.World.Planets { int x = _random.Next(origin.X - radius + 3, origin.X + radius - 2); int y = _random.Next(origin.Y - radius + 3, origin.Y + radius - 2); - WorldGen.TileRunner(x, y, _random.NextFloat(5f, 9f), _random.Next(5, 15), TileID.Stone); + WorldGen.TileRunner(x, y, _random.NextFloat(5f, 9f), _random.Next(5, 15), Main.getGoodWorld ? TileID.WoodenSpikes : TileID.Stone); } //Place grass, remove wall and occasionally smooth diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index 61511893ef..12fd551d9b 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -74,6 +74,20 @@ namespace CalamityMod.World.Planets MudPlanetoidCount--; i++; } + + // Checkerboard of Spikes and Wooden Spikes. + if (Main.getGoodWorld) + { + for (int j = 0; j < Main.maxTilesX; j++) + { + for (int k = 0; k < (int)(Main.maxTilesY * 0.2f); k++) + { + bool convertToRegularSpikes = (j % 2 == 0 && k % 2 == 0) || (j % 2 != 0 && k % 2 != 0); + if (Main.tile[j, k].TileType == TileID.WoodenSpikes && convertToRegularSpikes) + Main.tile[j, k].TileType = TileID.Spikes; + } + } + } } public static bool InvalidSkyPlacementArea(Rectangle area)