diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index e63c75cdb3..e508cb57c0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -523,7 +523,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 2); // You will need to set each resistant item here for burning as it gets bypassed for somereason - if (tile.TileType == scoriaOreID) + if (tile.TileType == scoriaOreID && !Player.fireWalk) Player.AddBuff(BuffID.Burning, 2); // Auric Ore causes an Auric Rejection unless you are wearing Auric Armor diff --git a/Items/Placeables/ScorchedBone.cs b/Items/Placeables/ScorchedBone.cs index 298787cbd8..3a49e41753 100644 --- a/Items/Placeables/ScorchedBone.cs +++ b/Items/Placeables/ScorchedBone.cs @@ -34,16 +34,12 @@ namespace CalamityMod.Items.Placeables itemGroup = ContentSamples.CreativeHelper.ItemGroup.Wood; } - //i assume this is supposed to be for when the platforms and walls for this tile are finished - /*public override void AddRecipes() + public override void AddRecipes() { CreateRecipe(). - AddIngredient(2). - Register(); - - CreateRecipe(1). - AddIngredient(ModContent.ItemType(), 4). - AddTile(TileID.WorkBenches).Register(); - }*/ + AddIngredient(ModContent.ItemType(), 4). + AddTile(TileID.WorkBenches). + Register(); + } } } diff --git a/Items/Placeables/SpineSapling.cs b/Items/Placeables/SpineSapling.cs new file mode 100644 index 0000000000..0e29baa64e --- /dev/null +++ b/Items/Placeables/SpineSapling.cs @@ -0,0 +1,30 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables +{ + public class SpineSapling : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 100; + DisplayName.SetDefault("Small Spine"); + Tooltip.SetDefault("Plants Giant Spine saplings on Brimstone Slag"); + } + + public override void SetDefaults() + { + Item.createTile = ModContent.TileType(); + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.autoReuse = true; + Item.consumable = true; + Item.width = 13; + Item.height = 10; + Item.maxStack = 999; + } + } +} diff --git a/Items/Placeables/SpineSapling.png b/Items/Placeables/SpineSapling.png new file mode 100644 index 0000000000..d2ae0e0dc7 Binary files /dev/null and b/Items/Placeables/SpineSapling.png differ diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 57886abbb9..9ec6cbeb7a 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.Abyss } if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 1.2f; + return SpawnCondition.OceanMonster.Chance * 2.5f; } return SpawnCondition.OceanMonster.Chance * 0.1f; } diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index fb92790826..c7359ba761 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -302,7 +302,7 @@ namespace CalamityMod.NPCs.Abyss { if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 0.3f; + return SpawnCondition.CaveJellyfish.Chance * 0.55f; } return 0f; } diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index a3edb69bd7..107dbc4349 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -298,7 +298,7 @@ namespace CalamityMod.NPCs.Abyss { if (spawnInfo.Player.Calamity().ZoneAbyssLayer3 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 0.3f; + return SpawnCondition.CaveJellyfish.Chance * 0.55f; } return 0f; } diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 7fa9262eec..f59ead27ec 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Abyss } if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 1.2f; + return SpawnCondition.OceanMonster.Chance * 2.2f; } return SpawnCondition.OceanMonster.Chance * 0.1f; } diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 40874b01a9..640101ef60 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -167,11 +167,11 @@ namespace CalamityMod.NPCs.Abyss { if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 0.6f; + return SpawnCondition.OceanMonster.Chance * 1.5f; } if (spawnInfo.Player.Calamity().ZoneAbyssLayer2 && spawnInfo.Water) { - return SpawnCondition.CaveJellyfish.Chance * 0.9f; + return SpawnCondition.CaveJellyfish.Chance * 1.0f; } return 0f; } diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index 2cc1d1ff1e..fa86620c10 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -140,7 +140,7 @@ namespace CalamityMod.NPCs.SulphurousSea if ((spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneAbyssLayer1) && spawnInfo.Water && NPC.CountNPCS(ModContent.NPCType()) < 12) { - return 1.1f; + return 2.2f; } return 0f; } diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 4ebf538cb3..c52e82f770 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.SulphurousSea { @@ -138,7 +139,7 @@ namespace CalamityMod.NPCs.SulphurousSea } if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return 0.45f; + return SpawnCondition.OceanMonster.Chance * 2f; } return 0f; } diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index f2a9bfd686..8dc9e2a378 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; namespace CalamityMod.NPCs.SulphurousSea { @@ -104,7 +105,7 @@ namespace CalamityMod.NPCs.SulphurousSea } if (spawnInfo.Player.Calamity().ZoneAbyssLayer1 && spawnInfo.Water) { - return 0.35f; + return SpawnCondition.OceanMonster.Chance * 1.65f; } return 0f; } diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 5b4bf7551d..ee4ac9b1af 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 1800; + Projectile.alpha = 125; } public override void AI() diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index 884c299646..257cff5acf 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 900; + Projectile.alpha = 125; } public override void AI() diff --git a/Projectiles/Environment/ThermalSteam.cs b/Projectiles/Environment/ThermalSteam.cs new file mode 100644 index 0000000000..97673d09ad --- /dev/null +++ b/Projectiles/Environment/ThermalSteam.cs @@ -0,0 +1,74 @@ +using CalamityMod.DataStructures; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Environment +{ + public class ThermalSteam : ModProjectile, IAdditiveDrawer + { + public const int Lifetime = 90; + + public override string Texture => "CalamityMod/Projectiles/Summon/SmallAresArms/MinionPlasmaGas"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steam"); + + // This prevents the water from creating a universal distortion wherever it lands, thus making the geysers look weird. + ProjectileID.Sets.NoLiquidDistortion[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 184; + Projectile.penetrate = -1; + Projectile.hostile = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.timeLeft = Lifetime; + Projectile.hide = true; + Projectile.localAI[0] = 1f; + } + + public override void AI() + { + Projectile.localAI[0] = 0f; + Projectile.scale = Utils.Remap((Projectile.timeLeft+Lifetime), 180, 0.4f, 0.02f, 1.4f); + Projectile.Opacity = Utils.Remap((Projectile.timeLeft+Lifetime), 160f, 50f, 1.15f, 0.01f); + Projectile.velocity.Y *= 0.97f; + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + if (damage <= 0) + return; + + target.AddBuff(BuffID.Burning, 180); + } + + public override bool? CanDamage() => Projectile.Opacity > 0.6f ? null : false; + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.scale * 92f, targetHitbox); + } + + public void AdditiveDraw(SpriteBatch spriteBatch) + { + if (Projectile.localAI[0] == 1f) + return; + + Texture2D texture = TextureAssets.Projectile[Projectile.type].Value; + Vector2 origin = texture.Size() * 0.5f; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float opacity = Projectile.Opacity * 0.45f; + Color drawColor = new Color(154, 69, 38) * opacity; + Vector2 scale = Projectile.Size / texture.Size() * Projectile.scale * 1.35f; + spriteBatch.Draw(texture, drawPosition, null, drawColor, Projectile.rotation, origin, scale, 0, 0f); + } + } +} diff --git a/Schematics/CragRuin1.csch b/Schematics/CragRuin1.csch new file mode 100644 index 0000000000..b6d755e301 Binary files /dev/null and b/Schematics/CragRuin1.csch differ diff --git a/Schematics/CragRuin2.csch b/Schematics/CragRuin2.csch new file mode 100644 index 0000000000..8155c32da4 Binary files /dev/null and b/Schematics/CragRuin2.csch differ diff --git a/Schematics/CragRuin3.csch b/Schematics/CragRuin3.csch new file mode 100644 index 0000000000..e9a1085bf9 Binary files /dev/null and b/Schematics/CragRuin3.csch differ diff --git a/Schematics/CragRuin4.csch b/Schematics/CragRuin4.csch new file mode 100644 index 0000000000..44c5ae92a9 Binary files /dev/null and b/Schematics/CragRuin4.csch differ diff --git a/Schematics/SchematicManager.cs b/Schematics/SchematicManager.cs index 8996e5f3f7..d62a3c8a13 100644 --- a/Schematics/SchematicManager.cs +++ b/Schematics/SchematicManager.cs @@ -76,6 +76,15 @@ namespace CalamityMod.Schematics internal const string PinkArchiveKey = "Archive Pink"; internal const string PinkArchiveFilename = "Schematics/DungeonArchivePink.csch"; + + internal const string CragRuinKey1 = "Crag Ruin 1"; + internal const string CragRuinKey1Filename = "Schematics/CragRuin1.csch"; + internal const string CragRuinKey2 = "Crag Ruin 21"; + internal const string CragRuinKey2Filename = "Schematics/CragRuin2.csch"; + internal const string CragRuinKey3 = "Crag Ruin 3"; + internal const string CragRuinKey3Filename = "Schematics/CragRuin3.csch"; + internal const string CragRuinKey4 = "Crag Ruin 4"; + internal const string CragRuinKey4Filename = "Schematics/CragRuin4.csch"; internal static Dictionary TileMaps; internal static Dictionary PilePlacementMaps; @@ -118,6 +127,12 @@ namespace CalamityMod.Schematics [GreenArchiveKey] = CalamitySchematicIO.LoadSchematic(GreenArchiveFilename), [PinkArchiveKey] = CalamitySchematicIO.LoadSchematic(PinkArchiveFilename), + //crags ruins + [CragRuinKey1] = CalamitySchematicIO.LoadSchematic(CragRuinKey1Filename), + [CragRuinKey2] = CalamitySchematicIO.LoadSchematic(CragRuinKey2Filename), + [CragRuinKey3] = CalamitySchematicIO.LoadSchematic(CragRuinKey3Filename), + [CragRuinKey4] = CalamitySchematicIO.LoadSchematic(CragRuinKey4Filename), + // Sulphurous Sea scrap world gen structures ["Sulphurous Scrap 1"] = CalamitySchematicIO.LoadSchematic("Schematics/SulphurousScrap1.csch").ShaveOffEdge(), ["Sulphurous Scrap 2"] = CalamitySchematicIO.LoadSchematic("Schematics/SulphurousScrap2.csch").ShaveOffEdge(), diff --git a/Tiles/Abyss/AbyssAmbient/ThermalVent.cs b/Tiles/Abyss/AbyssAmbient/ThermalVent.cs new file mode 100644 index 0000000000..0940dd15d6 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/ThermalVent.cs @@ -0,0 +1,98 @@ +using CalamityMod.Projectiles.Environment; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; +using System; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class ThermalVent1 : ModTile + { + int steamTimer = 0; + + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 2); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Thermal Vent"); + AddMapEntry(new Color(132, 56, 42), name); + DustType = 162; + + base.SetStaticDefaults(); + } + + public override bool IsTileDangerous(int i, int j, Player player) => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 2; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 255f / 355f; + g = 83f / 355f; + b = 0f; + } + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + Tile t = CalamityUtils.ParanoidTileRetrieval(i, j); + Vector2 spawnPosition = new(i * 16f + 24f, j * 16f - 4f); + + if (!Main.gamePaused && t.TileFrameX % 36 == 0 && t.TileFrameY % 36 == 0 && Collision.CanHitLine(spawnPosition, 1, 1, spawnPosition - Vector2.UnitY * 100f, 1, 1)) + { + steamTimer += Main.rand.Next(0, 2); + + if (steamTimer >= 600) + { + steamTimer = 0; + } + } + } + + public override void NearbyEffects(int i, int j, bool closer) + { + Tile t = CalamityUtils.ParanoidTileRetrieval(i, j); + Vector2 spawnPosition = new(i * 16f + 24f, j * 16f - 4f); + + if (!Main.gamePaused && t.TileFrameX % 36 == 0 && t.TileFrameY % 36 == 0 && Collision.CanHitLine(spawnPosition, 1, 1, spawnPosition - Vector2.UnitY * 100f, 1, 1)) + { + float positionInterpolant = (i + j) * 0.041f % 1f; + Vector2 smokeVelocity = -Vector2.UnitY.RotatedByRandom(0.11f) * MathHelper.Lerp(4.8f, 8.1f, positionInterpolant); + smokeVelocity.X += (float)Math.Cos(MathHelper.TwoPi * positionInterpolant) * 1.1f; + smokeVelocity.Y -= Main.rand.Next(3, 6); + + if (steamTimer >= 450 && Main.rand.NextBool(3)) + { + Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType(), Main.expertMode ? 85 : 60, 0f); + } + } + } + } + + public class ThermalVent2 : ThermalVent1 + { + } + + public class ThermalVent3 : ThermalVent1 + { + } +} diff --git a/Tiles/Abyss/AbyssAmbient/ThermalVent1.png b/Tiles/Abyss/AbyssAmbient/ThermalVent1.png new file mode 100644 index 0000000000..81bc29cb5f Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/ThermalVent1.png differ diff --git a/Tiles/Abyss/AbyssAmbient/ThermalVent2.png b/Tiles/Abyss/AbyssAmbient/ThermalVent2.png new file mode 100644 index 0000000000..3dc946a2fe Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/ThermalVent2.png differ diff --git a/Tiles/Abyss/AbyssAmbient/ThermalVent3.png b/Tiles/Abyss/AbyssAmbient/ThermalVent3.png new file mode 100644 index 0000000000..2ce6201c14 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/ThermalVent3.png differ diff --git a/Tiles/Crags/GloomTorch.cs b/Tiles/Crags/GloomTorch.cs index c43cda1087..098285f352 100644 --- a/Tiles/Crags/GloomTorch.cs +++ b/Tiles/Crags/GloomTorch.cs @@ -1,9 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; namespace CalamityMod.Tiles.Crags { @@ -16,11 +18,12 @@ namespace CalamityMod.Tiles.Crags name.SetDefault("Torch"); AddMapEntry(new Color(253, 221, 3), name); TileID.Sets.DisableSmartCursor[Type] = true; - ItemDrop = ModContent.ItemType(); - AdjTiles = new int[] { TileID.Torches }; TileID.Sets.Torch[Type] = true; Main.tileWaterDeath[Type] = true; TileID.Sets.FramesOnKillWall[Type] = true; + ItemDrop = ModContent.ItemType(); + AdjTiles = new int[] { TileID.Torches }; + } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Crags/Lily/LavaLily5.cs b/Tiles/Crags/Lily/LavaLily5.cs index 2a0457980a..036f0f7807 100644 --- a/Tiles/Crags/Lily/LavaLily5.cs +++ b/Tiles/Crags/Lily/LavaLily5.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Tiles.Crags.Lily //draw in the middle of the tile so it doesnt draw more than once if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18) { - DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(114, 209), false); - DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(114, 209), true); + DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(118, 209), false); + DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(118, 209), true); } } } diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs new file mode 100644 index 0000000000..f9c9c4f22a --- /dev/null +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -0,0 +1,62 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Linq; + +namespace CalamityMod.Tiles.Crags.Tree +{ + public class SpineSapling : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileID.Sets.CommonSapling[Type] = true; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.AnchorValidTiles = new[] { ModContent.TileType() }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.DrawFlipHorizontal = true; + TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.RandomStyleRange = 3; + TileObjectData.newTile.StyleMultiplier = 3; + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Spine Sapling"); + AddMapEntry(new Color(38, 25, 27), name); + DustType = DustID.Blood; + AdjTiles = new int[] { TileID.Saplings }; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void RandomUpdate(int i, int j) + { + if (WorldGen.genRand.Next(20) == 0) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + + if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType()) + { + SpineTree.Spawn(i, j, 22, 28, true); + } + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Tree/SpineSapling.png b/Tiles/Crags/Tree/SpineSapling.png new file mode 100644 index 0000000000..694feb66b0 Binary files /dev/null and b/Tiles/Crags/Tree/SpineSapling.png differ diff --git a/Tiles/Crags/Tree/SpineTree.cs b/Tiles/Crags/Tree/SpineTree.cs index 7f6e19c1bc..1f68fd9d0d 100644 --- a/Tiles/Crags/Tree/SpineTree.cs +++ b/Tiles/Crags/Tree/SpineTree.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Tiles.Crags.Tree Main.tileSolid[Framing.GetTileSafely(i, j).TileType]); } - public static bool Spawn(int i, int j, int minSize = 5, int maxSize = 18, bool leaves = false, int leavesType = -1, bool saplingExists = false) + public static bool Spawn(int i, int j, int minSize = 5, int maxSize = 18, bool saplingExists = false) { //if this tree grew from a sapling, then kill the sapling its growing from if (saplingExists) @@ -194,7 +194,6 @@ namespace CalamityMod.Tiles.Crags.Tree public override bool Drop(int i, int j) { - /* //drop seeds from the top of the tree if (Framing.GetTileSafely(i, j).TileFrameX == 36) { @@ -202,10 +201,9 @@ namespace CalamityMod.Tiles.Crags.Tree for (int numSeed = 0; numSeed < totalSeeds; numSeed++) { Item.NewItem(new EntitySource_TileBreak(i, j), (new Vector2(i, j) * 16) + new Vector2(Main.rand.Next(-46, 46), - Main.rand.Next(-40, 40) - 66), ModContent.ItemType(), Main.rand.Next(1, 5)); + Main.rand.Next(-40, 40) - 66), ModContent.ItemType(), Main.rand.Next(1, 5)); } } - */ //chance to drop extra wood if (Main.rand.NextBool()) diff --git a/Tiles/GiantPlanteraBulb.cs b/Tiles/GiantPlanteraBulb.cs new file mode 100644 index 0000000000..353f961595 --- /dev/null +++ b/Tiles/GiantPlanteraBulb.cs @@ -0,0 +1,53 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + //TODO: this needs animation, will do that later today + public class GiantPlanteraBulb : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.Width = 5; + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(2, 4); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.newTile.LavaDeath = true; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + AddMapEntry(Main.hardMode ? new Color(243, 82, 171) : new Color(107, 125, 33)); + DustType = DustID.JungleGrass; + + base.SetStaticDefaults(); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.hardMode) + { + r = 243f / 500f; + g = 82f / 500f; + b = 171f / 500f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 2; + } + } +} diff --git a/Tiles/GiantPlanteraBulb.png b/Tiles/GiantPlanteraBulb.png new file mode 100644 index 0000000000..b8d61db2f9 Binary files /dev/null and b/Tiles/GiantPlanteraBulb.png differ diff --git a/Tiles/GiantPlanteraBulbGlow.png b/Tiles/GiantPlanteraBulbGlow.png new file mode 100644 index 0000000000..ee8617bad5 Binary files /dev/null and b/Tiles/GiantPlanteraBulbGlow.png differ diff --git a/Tiles/MotherOfAllBulbs.png b/Tiles/MotherOfAllBulbs.png deleted file mode 100644 index 3da083a12d..0000000000 Binary files a/Tiles/MotherOfAllBulbs.png and /dev/null differ diff --git a/Tiles/Ores/ScoriaOre.cs b/Tiles/Ores/ScoriaOre.cs index 64bb87214d..921bf0de1c 100644 --- a/Tiles/Ores/ScoriaOre.cs +++ b/Tiles/Ores/ScoriaOre.cs @@ -87,7 +87,8 @@ namespace CalamityMod.Tiles.Ores { num = fail ? 1 : 3; } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { r = 0.04f; g = 0.00f; diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index b68213bd3d..20185dbc60 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -64,7 +64,7 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; - PlantCheckAgainst[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[3] { ModContent.TileType(), ModContent.TileType(), ModContent.TileType() }; VineToGrass = new Dictionary { diff --git a/World/Abyss.cs b/World/Abyss.cs index bdb9d47b33..bf4ef90146 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -312,12 +312,12 @@ namespace CalamityMod.World //place islands in the sulphuric depths layer //start placing islands at the world surface so the abyss hole isnt completely empty int abyssStartHeight = (SulphurousSea.YStart + (int)Main.worldSurface) / 2 + 90; - for (int sulphurIslandY = abyssStartHeight; sulphurIslandY <= rockLayer - 15; sulphurIslandY++) + for (int sulphurIslandY = abyssStartHeight; sulphurIslandY <= rockLayer - 25; sulphurIslandY++) { int islandLocationX = abyssChasmX; int islandLocationOffset = WorldGen.genRand.Next(15, 22); int randomPositon = WorldGen.genRand.Next(35, 80); - int randomIsland = WorldGen.genRand.Next(4); + int randomIsland = WorldGen.genRand.Next(5); switch (randomIsland) { case 0: @@ -331,16 +331,18 @@ namespace CalamityMod.World AbyssIsland(islandLocationX - randomPositon, sulphurIslandY + 10, 60, 85, 30, 35, ModContent.TileType(), false, false, false); AbyssIsland(islandLocationX, sulphurIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, false, false); AbyssIsland(islandLocationX + randomPositon, sulphurIslandY, 60, 85, 30, 35, ModContent.TileType(), false, false, false); - islandLocationX += 30; + islandLocationX += 15; break; case 2: - //1 island, right only - AbyssIsland(islandLocationX - randomPositon, sulphurIslandY + 10, 55, 65, 30, 35, ModContent.TileType(), false, false, false); - islandLocationX -= 30; + //2 islands, left, and slightly right + AbyssIsland(islandLocationX - randomPositon, sulphurIslandY + 15, 55, 65, 30, 35, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX + WorldGen.genRand.Next(15, 30), sulphurIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, false, false); + islandLocationX -= 15; break; case 3: - //1 island, right only - AbyssIsland(islandLocationX + randomPositon, sulphurIslandY + 15, 60, 85, 30, 55, ModContent.TileType(), false, false, false); + //2 islands, slightly left, and right + AbyssIsland(islandLocationX - WorldGen.genRand.Next(15, 30), sulphurIslandY + 10, 55, 65, 30, 35, ModContent.TileType(), false, false, false); + AbyssIsland(islandLocationX + randomPositon, sulphurIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, false, false); islandLocationX += 25; break; case 4: @@ -421,7 +423,7 @@ namespace CalamityMod.World { int islandLocationX = abyssChasmX; int islandLocationOffset = WorldGen.genRand.Next(18, 30); - int randomPositon = WorldGen.genRand.Next(45, 80); + int randomPositon = WorldGen.genRand.Next(40, 65); bool hasScoria = WorldGen.genRand.NextBool(2); //50% chance to place scoria in each island instead of planty mush int randomIsland = WorldGen.genRand.Next(4); @@ -429,7 +431,7 @@ namespace CalamityMod.World { case 0: //3 islands, left, middle, and right - AbyssIsland(islandLocationX - randomPositon - 10, thermalIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX - randomPositon - 10, thermalIslandY + 15, 65, 85, 45, 55, ModContent.TileType(), false, true, false); AbyssIsland(islandLocationX, thermalIslandY, 60, 65, 45, 55, ModContent.TileType(), false, true, true); AbyssIsland(islandLocationX + randomPositon + 10, thermalIslandY + 15, 60, 65, 45, 55, ModContent.TileType(), false, true, false); islandLocationX -= 30; @@ -437,22 +439,22 @@ namespace CalamityMod.World case 1: //3 islands, left, middle (slightly lower), and right AbyssIsland(islandLocationX - randomPositon, thermalIslandY + 10, 60, 85, 30, 35, ModContent.TileType(), false, true, true); - AbyssIsland(islandLocationX, thermalIslandY + 15, 60, 85, 30, 35, ModContent.TileType(), false, true, false); - AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 60, 85, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX, thermalIslandY + 15, 75, 85, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 65, 85, 30, 35, ModContent.TileType(), false, true, false); islandLocationX += 30; break; case 2: //3 islands, left, middle (slightly left), and right AbyssIsland(islandLocationX - randomPositon - 20, thermalIslandY, 55, 65, 30, 35, ModContent.TileType(), false, true, true); - AbyssIsland(islandLocationX - 20, thermalIslandY + 15, 55, 65, 30, 35, ModContent.TileType(), false, true, false); - AbyssIsland(islandLocationX + randomPositon + 20, thermalIslandY + 10, 55, 65, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX - 20, thermalIslandY + 15, 60, 70, 30, 35, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon + 20, thermalIslandY + 10, 65, 70, 30, 35, ModContent.TileType(), false, true, false); islandLocationX -= 25; break; case 3: //3 islands, left, middle (slightly right), and right - AbyssIsland(islandLocationX - randomPositon, thermalIslandY + 15, 60, 85, 30, 55, ModContent.TileType(), false, true, false); - AbyssIsland(islandLocationX + 20, thermalIslandY + 5, 60, 85, 30, 55, ModContent.TileType(), false, true, false); - AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 60, 85, 30, 55, ModContent.TileType(), false, true, true); + AbyssIsland(islandLocationX - randomPositon, thermalIslandY + 15, 75, 85, 30, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + 20, thermalIslandY + 5, 75, 85, 30, 55, ModContent.TileType(), false, true, false); + AbyssIsland(islandLocationX + randomPositon, thermalIslandY, 75, 85, 30, 55, ModContent.TileType(), false, true, true); islandLocationX += 25; break; } @@ -561,8 +563,8 @@ namespace CalamityMod.World if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { //giant kelp, more often in upper layers - if ((WorldGen.genRand.NextBool(18) && tile.TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType())) + if (WorldGen.genRand.NextBool(16) && tile.TileType == ModContent.TileType() || + WorldGen.genRand.NextBool(25) && tile.TileType == ModContent.TileType()) { ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -570,6 +572,16 @@ namespace CalamityMod.World WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); } + //thermal vents + if (WorldGen.genRand.NextBool(72) && tile.TileType == ModContent.TileType() || + WorldGen.genRand.NextBool(15) && tile.TileType == ModContent.TileType()) + { + ushort[] Vents = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Vents)); + } + //bulb trees on voidstone if (WorldGen.genRand.NextBool(25) && tile.TileType == ModContent.TileType()) { @@ -583,7 +595,7 @@ namespace CalamityMod.World if (tile.TileType == ModContent.TileType()) { //tube coral - if (WorldGen.genRand.NextBool(25)) + if (WorldGen.genRand.NextBool(85)) { WorldGen.PlaceObject(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } @@ -607,7 +619,7 @@ namespace CalamityMod.World } //sulphur fossils - if (WorldGen.genRand.NextBool(10)) + if (WorldGen.genRand.NextBool(12)) { ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -616,7 +628,7 @@ namespace CalamityMod.World } //ribs - if (WorldGen.genRand.NextBool(10)) + if (WorldGen.genRand.NextBool(12)) { ushort[] Ribs = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 299432d374..8e2a52e6be 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -127,7 +127,12 @@ namespace CalamityMod.World { float worldEdgeMargin = (float)Main.maxTilesX * 0.08f; int xLimit = Main.maxTilesX / 2; - int x = Abyss.AtLeftSideOfWorld ? rand.Next(Main.dungeonX + 200, xLimit - 400) : rand.Next(xLimit + 400, Main.dungeonX - 200); + + int x = Abyss.AtLeftSideOfWorld ? rand.Next(400, xLimit) : rand.Next(xLimit, Main.maxTilesX - 400); + while ((float)x > (float)Main.spawnTileX - worldEdgeMargin && (float)x < (float)Main.spawnTileX + worldEdgeMargin) + { + x = Abyss.AtLeftSideOfWorld ? rand.Next(400, xLimit) : rand.Next(xLimit, Main.maxTilesX - 400); + } //world surface = 920 large 740 medium 560 small int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336 @@ -213,6 +218,8 @@ namespace CalamityMod.World public static bool GenerateAstralMeteor(int i, int j) { + WorldGen.gen = true; + UnifiedRandom rand = WorldGen.genRand; if (i < 50 || i > Main.maxTilesX - 50) { @@ -391,6 +398,8 @@ namespace CalamityMod.World } } + WorldGen.gen = false; + if (Main.netMode != NetmodeID.MultiplayerClient) { NetMessage.SendTileSquare(-1, i, j, 40, TileChangeType.None); @@ -411,6 +420,8 @@ namespace CalamityMod.World bool altarPlaced = false; while (!altarPlaced) { + WorldGen.gen = true; + int x = i + xOffset; int y = j - 100; @@ -424,11 +435,14 @@ namespace CalamityMod.World bool place = true; SchematicManager.PlaceSchematic>(SchematicManager.AstralBeaconKey, new Point(x, y - 5), SchematicAnchor.Center, ref place); + WorldGen.gen = false; + altarPlaced = true; } } } } + return true; } diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index eb2093221d..bf6868149d 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -187,9 +187,9 @@ namespace CalamityMod.World //do not place lava in the general middle area of the biome because it keeps flooding the crag bridge if (numLavaLakes != 2 && numLavaLakes != 3) { - LavaTileRunner runner3 = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500), + LavaTileRunner runner = new LavaTileRunner(new Vector2(x, Main.maxTilesY - 165), new Vector2(0, 5), new Point16(-500, 500), new Point16(250, 1000), 15f, WorldGen.genRand.Next(300, 1000), 0, true, true); - runner3.Start(); + runner.Start(); } numLavaLakes++; @@ -246,6 +246,25 @@ namespace CalamityMod.World SchematicManager.PlaceSchematic(SchematicManager.CragBridgeKey, new Point(biomeMiddle, Main.maxTilesY - 100), SchematicAnchor.Center, ref firstItem, new Action(FillBrimstoneChests)); + //place crag ruins + bool place = true; + + SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey3, + new Point(biomeStart + 150, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + PlaceSquareForCragHouses(biomeStart + 150, Main.maxTilesY - 125); + + SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey1, + new Point(biomeMiddle - 235, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + PlaceSquareForCragHouses(biomeMiddle - 235, Main.maxTilesY - 125); + + SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey4, + new Point(biomeMiddle + 235, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + PlaceSquareForCragHouses(biomeMiddle + 235, Main.maxTilesY - 125); + + SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey2, + new Point(biomeEdge - 150, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + PlaceSquareForCragHouses(biomeEdge - 150, Main.maxTilesY - 125); + //lava clean up again for (int x = biomeStart; x <= biomeEdge; x++) { @@ -399,6 +418,18 @@ namespace CalamityMod.World } } + public static void PlaceSquareForCragHouses(int x, int y) + { + //loop to place tiles under the house so it doesnt look weird + for (int i = x - 25; i <= x + 25; i++) + { + for (int j = y; j <= y + 15; j++) + { + WorldGen.PlaceTile(i, j, ModContent.TileType()); + } + } + } + public static bool PlaceTree(int x, int y, int tileType) { int minDistance = 5; @@ -419,7 +450,7 @@ namespace CalamityMod.World } } - SpineTree.Spawn(x, y, 22, 28, false, -1, false); + SpineTree.Spawn(x, y, 22, 28, false); return true; }