diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 549113959b..a4dbe1a3f6 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -22,6 +22,11 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Projectiles.VanillaProjectileOverrides; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralSnow; +using CalamityMod.Tiles.Crags.Tree; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.World; @@ -4067,7 +4072,8 @@ namespace CalamityMod.Projectiles || projectile.type == ProjectileID.PureSpray || projectile.type == ProjectileID.CorruptSpray || projectile.type == ProjectileID.CrimsonSpray - || projectile.type == ProjectileID.HallowSpray; + || projectile.type == ProjectileID.HallowSpray + || projectile.type == ProjectileID.Fertilizer; if (!isConversionProjectile) return; @@ -4078,10 +4084,39 @@ namespace CalamityMod.Projectiles bool isPowder = projectile.type == ProjectileID.PurificationPowder || projectile.type == ProjectileID.VilePowder || projectile.type == ProjectileID.ViciousPowder; + if (!WorldGen.InWorld(x, y, 3)) + return; + for (int i = x - 1; i <= x + 1; i++) { for (int j = y - 1; j <= y + 1; j++) { + if (projectile.type == ProjectileID.Fertilizer) + { + Tile tile = Main.tile[i, j]; + + if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + bool success = WorldGen.GrowTree(i, j); + if (success && isPlayerNear) + WorldGen.TreeGrowFXCheck(i, j); + } + else if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + bool success = WorldGen.GrowPalmTree(i, j); + if (success && isPlayerNear) + WorldGen.TreeGrowFXCheck(i, j); + } + else if (tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType()) + SpineTree.Spawn(i, j, 22, 28, true); + } + } + if (projectile.type == ProjectileID.PureSpray || projectile.type == ProjectileID.PurificationPowder) { AstralBiome.ConvertFromAstral(i, j, ConvertType.Pure, !isPowder); diff --git a/Tiles/Astral/AstralDirt.cs b/Tiles/Astral/AstralDirt.cs index 18ff19942a..43204bb557 100644 --- a/Tiles/Astral/AstralDirt.cs +++ b/Tiles/Astral/AstralDirt.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; - + TileID.Sets.Conversion.Dirt[Type] = true; this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs index 140f46a145..e1af1f142c 100644 --- a/Tiles/Crags/Tree/SpineSapling.cs +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -57,5 +57,7 @@ namespace CalamityMod.Tiles.Crags.Tree } } } + + public override bool CanDrop(int i, int j) => false; } } diff --git a/Walls/AstralDirtWall.cs b/Walls/AstralDirtWall.cs index 96a302952f..ae80a7a4dd 100644 --- a/Walls/AstralDirtWall.cs +++ b/Walls/AstralDirtWall.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Walls { // TODO -- Change this dust to be one more befitting Astral Dirt. DustType = DustID.Shadowflame; + WallID.Sets.Conversion.Dirt[Type] = true; AddMapEntry(new Color(26, 22, 32)); } diff --git a/Walls/AstralDirtWallSafe.cs b/Walls/AstralDirtWallSafe.cs index 90f3544a23..ad181c7504 100644 --- a/Walls/AstralDirtWallSafe.cs +++ b/Walls/AstralDirtWallSafe.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Walls // TODO -- Change this dust to be one more befitting Astral Dirt. DustType = DustID.Shadowflame; Main.wallHouse[Type] = true; + WallID.Sets.Conversion.Dirt[Type] = true; AddMapEntry(new Color(26, 22, 32)); } diff --git a/Walls/AstralIceWall.cs b/Walls/AstralIceWall.cs index 400e8a51af..4c0802f5a5 100644 --- a/Walls/AstralIceWall.cs +++ b/Walls/AstralIceWall.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Walls { // TODO -- Change this dust to be one more befitting Astral Ice. DustType = DustID.Shadowflame; + WallID.Sets.Conversion.Ice[Type] = true; AddMapEntry(new Color(83, 76, 92)); } diff --git a/Walls/AstralIceWallSafe.cs b/Walls/AstralIceWallSafe.cs index 7edf50c851..cd32b73a99 100644 --- a/Walls/AstralIceWallSafe.cs +++ b/Walls/AstralIceWallSafe.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Walls // TODO -- Change this dust to be one more befitting Astral Ice. Main.wallHouse[Type] = true; DustType = DustID.Shadowflame; - + WallID.Sets.Conversion.Ice[Type] = true; AddMapEntry(new Color(83, 76, 92)); } diff --git a/Walls/AstralSnowWall.cs b/Walls/AstralSnowWall.cs index 0b0d852f7f..586060389a 100644 --- a/Walls/AstralSnowWall.cs +++ b/Walls/AstralSnowWall.cs @@ -1,5 +1,6 @@  using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { @@ -8,7 +9,7 @@ namespace CalamityMod.Walls public override void SetStaticDefaults() { DustType = ModContent.DustType(); - + WallID.Sets.Conversion.Snow[Type] = true; AddMapEntry(new Color(135, 145, 149)); } diff --git a/Walls/AstralSnowWallSafe.cs b/Walls/AstralSnowWallSafe.cs index 5089358e68..933c29befd 100644 --- a/Walls/AstralSnowWallSafe.cs +++ b/Walls/AstralSnowWallSafe.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { @@ -10,7 +11,7 @@ namespace CalamityMod.Walls { DustType = ModContent.DustType(); Main.wallHouse[Type] = true; - + WallID.Sets.Conversion.Snow[Type] = true; AddMapEntry(new Color(135, 145, 149)); }