diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index f5a67216a3..d26497c8b3 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -9,7 +9,6 @@ namespace CalamityMod.Buffs.StatBuffs { DisplayName.SetDefault("Mushy"); Description.SetDefault("Increased defense and life regen"); - Main.buffNoTimeDisplay[Type] = true; Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4a356d5a0b..a01305356c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -221,7 +221,6 @@ namespace CalamityMod.CalPlayer public int auralisAuroraCounter = 0; public int auralisAuroraCooldown = 0; public int auralisAurora = 0; - public int fungalSymbioteTimer = 0; public int aBulwarkRareTimer = 0; public int spiritOriginBullseyeShootCountdown = 0; public int spiritOriginConvertedCrit = 0; @@ -2129,7 +2128,6 @@ namespace CalamityMod.CalPlayer auralisAuroraCounter = 0; auralisAuroraCooldown = 0; auralisAurora = 0; - fungalSymbioteTimer = 0; aBulwarkRareTimer = 0; RustyMedallionCooldown = 0; SulphWaterPoisoningLevel = 0f; @@ -4044,7 +4042,10 @@ namespace CalamityMod.CalPlayer public override void ModifyWeaponDamage(Item item, ref StatModifier damage) { if (flamethrowerBoost && item.CountsAsClass() && (item.useAmmo == AmmoID.Gel || CalamityLists.flamethrowerList.Contains(item.type))) - damage += (hoverboardBoost ? 0.35f : 0.25f); + damage += hoverboardBoost ? 0.35f : 0.25f; + + if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type)) + damage += 0.1f; if (item.CountsAsClass()) acidRoundMultiplier = item.useTime / 20D; @@ -4139,7 +4140,7 @@ namespace CalamityMod.CalPlayer if (item.CountsAsClass()) { var source = Player.GetSource_ItemUse(item); - if (fungalSymbiote && Player.whoAmI == Main.myPlayer && fungalSymbioteTimer == 0) + if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type) && Player.whoAmI == Main.myPlayer) { if (Player.itemAnimation == (int)(Player.itemAnimationMax * 0.1) || Player.itemAnimation == (int)(Player.itemAnimationMax * 0.3) || @@ -4147,7 +4148,6 @@ namespace CalamityMod.CalPlayer Player.itemAnimation == (int)(Player.itemAnimationMax * 0.7) || Player.itemAnimation == (int)(Player.itemAnimationMax * 0.9)) { - fungalSymbioteTimer = 3; float yVel = 0f; float xVel = 0f; float yOffset = 0f; @@ -4203,8 +4203,7 @@ namespace CalamityMod.CalPlayer xVel *= 1.5f; xOffset *= (float)Player.direction; yOffset *= Player.gravDir; - int damage = (int)Player.GetTotalDamage().ApplyTo(item.damage * 0.15f); - Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + xOffset, (float)(hitbox.Y + hitbox.Height / 2) + yOffset, (float)Player.direction * xVel, yVel * Player.gravDir, ProjectileID.Mushroom, damage, 0f, Player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + xOffset, (float)(hitbox.Y + hitbox.Height / 2) + yOffset, (float)Player.direction * xVel, yVel * Player.gravDir, ProjectileID.Mushroom, 0, 0f, Player.whoAmI); } } if (aWeapon) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 57625c02ad..0f152e8b02 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -612,7 +612,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 5; if (mushy) - Player.lifeRegen += 1; + Player.lifeRegen += 2; if (permafrostsConcoction) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 5fc0a8b069..f076fe94cd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1133,8 +1133,6 @@ namespace CalamityMod.CalPlayer dogTextCooldown--; if (titanCooldown > 0) titanCooldown--; - if (fungalSymbioteTimer > 0) - fungalSymbioteTimer--; if (aBulwarkRareTimer > 0) aBulwarkRareTimer--; if (hellbornBoost > 0) @@ -2642,7 +2640,7 @@ namespace CalamityMod.CalPlayer } if (mushy) - Player.statDefense += 5; + Player.statDefense += 6; if (omniscience) { diff --git a/CalamityLists.cs b/CalamityLists.cs index bcdef8df1d..61c992aa18 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -117,6 +117,8 @@ namespace CalamityMod public static List livingFireBlockList; public static List amalgamBuffList; public static List persistentBuffList; + public static List MushroomWeaponIDs; + public static List MushroomProjectileIDs; public static List zombieList; public static List demonEyeList; @@ -1540,6 +1542,34 @@ namespace CalamityMod BuffID.WeaponImbuePoison }; + MushroomWeaponIDs = new List() + { + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemID.Hammush, + ItemID.MushroomSpear, + ItemID.Shroomerang + }; + + MushroomProjectileIDs = new List() + { + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileID.TruffleSpore, + ProjectileID.MushroomSpear, + ProjectileID.Shroomerang + }; + zombieList = new List() { NPCID.Zombie, @@ -2550,6 +2580,8 @@ namespace CalamityMod livingFireBlockList = null; amalgamBuffList = null; persistentBuffList = null; + MushroomWeaponIDs = null; + MushroomProjectileIDs = null; zombieList = null; demonEyeList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 6635e7e3b9..32ff531aec 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -225,7 +225,6 @@ namespace CalamityMod BossRushEvent.Load(); // TODO -- As ModBossBarStyle is a ModType, its Load function does not need to be called directly here. BossHealthBarManager.Load(this); - DraedonStructures.Load(); EnchantmentManager.LoadAllEnchantments(); VanillaArmorChangeManager.Load(); SetupVanillaDR(); @@ -383,7 +382,6 @@ namespace CalamityMod BossRushEvent.Unload(); SchematicManager.Unload(); CustomLavaManagement.Unload(); - DraedonStructures.Unload(); CooldownRegistry.Unload(); PlayerDashManager.Unload(); diff --git a/Items/Accessories/FungalSymbiote.cs b/Items/Accessories/FungalSymbiote.cs index 9d311596df..c2440931a4 100644 --- a/Items/Accessories/FungalSymbiote.cs +++ b/Items/Accessories/FungalSymbiote.cs @@ -11,8 +11,9 @@ namespace CalamityMod.Items.Accessories { SacrificeTotal = 1; DisplayName.SetDefault("Fungal Symbiote"); - Tooltip.SetDefault("Various melee weapons emit mushrooms in true melee range\n" + - "15% increased true melee damage"); + Tooltip.SetDefault("You grow mushrooms on the grass beneath you\n" + + "Consuming mushrooms provides the Mushy buff, increasing defense by 6 and life regen by 2\n" + + "All mushroom-based weapons deal 10% more damage and emit non-damaging mushrooms"); } public override void SetDefaults() @@ -26,9 +27,92 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetDamage() += 0.15f; CalamityPlayer modPlayer = player.Calamity(); modPlayer.fungalSymbiote = true; + + // Mushroom growing effects. + int x = (int)player.Center.X / 16; + int y = (int)(player.Bottom.Y - 1f) / 16; + Tile groundTile = CalamityUtils.ParanoidTileRetrieval(x, y + 1); + if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1) + { + Tile walkTile = CalamityUtils.ParanoidTileRetrieval(x, y); + if (!walkTile.HasTile && walkTile.LiquidAmount == 0 && groundTile != null && WorldGen.SolidTile(groundTile)) + { + walkTile.TileFrameY = 0; + walkTile.Get().Slope = SlopeType.Solid; + walkTile.Get().IsHalfBlock = false; + + // On dirt, grow teal and green mushrooms. + if (groundTile.TileType == TileID.Dirt) + { + if (Main.rand.NextBool(1000)) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.DyePlants; + walkTile.TileFrameX = (short)(Main.rand.NextBool() ? 0 : 34); + } + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + + // On grass, grow mushrooms. + else if (groundTile.TileType == TileID.Grass) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.Plants; + walkTile.TileFrameX = 144; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + + // On hallowed grass, grow mushrooms. + else if (groundTile.TileType == TileID.HallowedGrass) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.HallowedPlants; + walkTile.TileFrameX = 144; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + + // On corrupt grass, grow vile mushrooms. + else if (groundTile.TileType == TileID.CorruptGrass) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.CorruptPlants; + walkTile.TileFrameX = 144; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + + // On crimson grass, grow vicious mushrooms. + else if (groundTile.TileType == TileID.CrimsonGrass) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.CrimsonPlants; + walkTile.TileFrameX = 270; + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + + // On glowing mushroom grass, grow glowing mushrooms. + else if (groundTile.TileType == TileID.MushroomGrass) + { + walkTile.Get().HasTile = true; + walkTile.TileType = TileID.MushroomPlants; + walkTile.TileFrameX = (short)(Main.rand.Next(5) * 18); + + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + } + } } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 5717525ccc..71eaae76f1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -619,6 +620,10 @@ namespace CalamityMod.Items if (item.type == ItemID.BottledHoney) player.AddBuff(BuffID.Honey, 7200); + // Give 1 minute of Mushy buff when consuming Mushrooms with Fungal Symbiote equipped. + if (item.type == ItemID.Mushroom && player.Calamity().fungalSymbiote) + player.AddBuff(ModContent.BuffType(), 3600); + // Moon Lord instantly spawns when Celestial Sigil is used. if (item.type == ItemID.CelestialSigil) { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8592961261..cadfffdf19 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2087,7 +2087,7 @@ namespace CalamityMod.Projectiles if (!projectile.npcProj && !projectile.trap && projectile.friendly && projectile.damage > 0) { - if (modPlayer.fungalSymbiote && projectile.IsTrueMelee()) + if (modPlayer.fungalSymbiote && CalamityLists.MushroomProjectileIDs.Contains(projectile.type)) { if (Main.player[projectile.owner].miscCounter % 6 == 0 && projectile.FinalExtraUpdate()) { @@ -2108,11 +2108,11 @@ namespace CalamityMod.Projectiles } vector24 -= new Vector2(player.bodyFrame.Width - player.width, player.bodyFrame.Height - 42) / 2f; Vector2 newCenter = player.RotatedRelativePoint(player.position + vector24, true) + projectile.velocity; - Projectile.NewProjectile(projectile.GetSource_FromThis(), newCenter, Vector2.Zero, ProjectileID.Mushroom, (int)(projectile.damage * 0.15), 0f, projectile.owner); + Projectile.NewProjectile(projectile.GetSource_FromThis(), newCenter, Vector2.Zero, ProjectileID.Mushroom, 0, 0f, projectile.owner); } else { - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileID.Mushroom, (int)(projectile.damage * 0.15), 0f, projectile.owner); + Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileID.Mushroom, 0, 0f, projectile.owner); } } } diff --git a/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs b/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs index 13b410f911..7bb4f31e00 100644 --- a/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs +++ b/Projectiles/Melee/Yoyos/SmokingCometYoyo.cs @@ -75,6 +75,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Gore.NewGore(Projectile.GetSource_FromAI(), new Vector2(Projectile.position.X, Projectile.position.Y), default(Vector2), Main.rand.Next(16, 18)); } + // Hitbox is larger than normal while trying to hit NPCs + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 25f, targetHitbox); + // Draw the new string public override bool PreDraw(ref Color lightColor) { diff --git a/Schematics/Shrine_Crimson.csch b/Schematics/Shrine_Crimson.csch new file mode 100644 index 0000000000..48567cda53 Binary files /dev/null and b/Schematics/Shrine_Crimson.csch differ diff --git a/Schematics/Shrine_Mushroom.csch b/Schematics/Shrine_Mushroom.csch new file mode 100644 index 0000000000..ef2cb11c2f Binary files /dev/null and b/Schematics/Shrine_Mushroom.csch differ diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index db4bb75a29..91672ade03 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -18,35 +18,8 @@ namespace CalamityMod.World // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. public static class DraedonStructures { - private static int[] otherModTilesToAvoid; public const int HellVerticalAvoidance = 100; - internal static void Load() - { - IList avoid = new List(16); - - // Mod of Redemption's labs use modded blocks, but must still be avoided. - Mod mor = CalamityMod.Instance.redemption; - if (mor != null) - { - // Thanks to Hallam to providing these tile names. - string[] redemptionAvoidTiles = new string[] - { - "LabTileUnsafe", - "OvergrownLabTile" - }; - foreach (string tileName in redemptionAvoidTiles) - avoid.Add(mor.Find(tileName).Type); - } - - otherModTilesToAvoid = avoid.ToArray(); - } - - internal static void Unload() - { - otherModTilesToAvoid = null; - } - public static bool ShouldAvoidLocation(Point placementPoint, bool careAboutLava = true) { Tile tile = CalamityUtils.ParanoidTileRetrieval(placementPoint.X, placementPoint.Y); @@ -71,15 +44,7 @@ namespace CalamityMod.World return true; } - // - // Below this line: Avoiding other mod worldgen. - // - - // Avoid Thorium's Blood Chamber (where you summon Viscount). This is done separately because it uses vanilla tiles. - if (tile.TileType == TileID.StoneSlab || tile.WallType == WallID.StoneSlab) - return true; - // Avoid all other registered modded tiles to avoid. - return otherModTilesToAvoid.Any(id => tile.TileType == id); + return false; } #region Workshop