From f9ff0c8a021d34bd0d18b3b9e8aeee2458ff5d9a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 19 Jun 2020 12:22:43 -0400 Subject: [PATCH] lore items only work while favorited --- CalPlayer/CalamityPlayer.cs | 21 +++++++++++++------ CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/LoreItems/KnowledgeAquaticScourge.cs | 14 +++++++------ Items/LoreItems/KnowledgeAstrumAureus.cs | 6 ++++-- Items/LoreItems/KnowledgeAstrumDeus.cs | 6 ++++-- Items/LoreItems/KnowledgeBrainofCthulhu.cs | 5 +++-- .../LoreItems/KnowledgeBrimstoneElemental.cs | 6 ++++-- Items/LoreItems/KnowledgeCalamitas.cs | 6 ++++-- Items/LoreItems/KnowledgeCrabulon.cs | 6 ++++-- Items/LoreItems/KnowledgeCryogen.cs | 6 ++++-- Items/LoreItems/KnowledgeDesertScourge.cs | 6 ++++-- Items/LoreItems/KnowledgeDestroyer.cs | 6 ++++-- Items/LoreItems/KnowledgeDevourerofGods.cs | 6 ++++-- Items/LoreItems/KnowledgeDukeFishron.cs | 6 ++++-- Items/LoreItems/KnowledgeEaterofWorlds.cs | 6 ++++-- Items/LoreItems/KnowledgeEyeofCthulhu.cs | 14 ++++++++----- Items/LoreItems/KnowledgeGolem.cs | 6 ++++-- Items/LoreItems/KnowledgeHiveMind.cs | 5 +++-- Items/LoreItems/KnowledgeKingSlime.cs | 6 ++++-- Items/LoreItems/KnowledgeLeviathanandSiren.cs | 6 ++++-- Items/LoreItems/KnowledgeLunaticCultist.cs | 5 +++-- Items/LoreItems/KnowledgeMoonLord.cs | 6 ++++-- Items/LoreItems/KnowledgeOldDuke.cs | 6 ++++-- Items/LoreItems/KnowledgePerforators.cs | 5 +++-- .../KnowledgePlaguebringerGoliath.cs | 6 ++++-- Items/LoreItems/KnowledgePlantera.cs | 6 ++++-- Items/LoreItems/KnowledgePolterghast.cs | 6 ++++-- Items/LoreItems/KnowledgeProvidence.cs | 6 ++++-- Items/LoreItems/KnowledgeQueenBee.cs | 6 ++++-- Items/LoreItems/KnowledgeRavager.cs | 6 ++++-- Items/LoreItems/KnowledgeSkeletron.cs | 5 +++-- Items/LoreItems/KnowledgeSkeletronPrime.cs | 6 ++++-- Items/LoreItems/KnowledgeSlimeGod.cs | 5 +++-- Items/LoreItems/KnowledgeTwins.cs | 6 ++++-- Items/LoreItems/KnowledgeWallofFlesh.cs | 6 ++++-- Items/LoreItems/KnowledgeYharon.cs | 6 ++++-- 36 files changed, 155 insertions(+), 82 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ca6e5f0f83..fd27e54a1d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3679,7 +3679,6 @@ namespace CalamityMod.CalPlayer } #endregion } - #endregion #region Rogue Mirrors @@ -3706,6 +3705,11 @@ namespace CalamityMod.CalPlayer Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); Main.projectile[lumenyl].frame = Main.rand.Next(0, 4); } + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } @@ -3726,6 +3730,11 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Item68, Main.player[Main.myPlayer].position); int eclipseBurst = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(7000 * player.RogueDamage()), 0, player.whoAmI); + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } #endregion @@ -8293,11 +8302,11 @@ namespace CalamityMod.CalPlayer Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + NPC npc = Main.npc[i]; + if (npc.active && !npc.dontTakeDamage && !npc.friendly && !npc.townNPC && npc.immune[player.whoAmI] <= 0 && npc.damage > 0) { - NPC nPC = Main.npc[i]; Rectangle rect = nPC.getRect(); - if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) { OnDodge(); break; @@ -8306,9 +8315,9 @@ namespace CalamityMod.CalPlayer } for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0) + Projectile proj = Main.projectile[i]; + if (proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { - Projectile proj = Main.projectile[i]; Rectangle rect = proj.getRect(); if (rectangle.Intersects(rect)) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3803891113..6dc3407c00 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3844,7 +3844,7 @@ namespace CalamityMod.CalPlayer #region Rogue Mirrors private static void RogueMirrors(Player player, CalamityPlayer modPlayer) { - Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); + Rectangle rectangle = new Rectangle((int)(player.position.X + player.velocity.X * 0.5f - 4f), (int)(player.position.Y + player.velocity.Y * 0.5f - 4f), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; diff --git a/Items/LoreItems/KnowledgeAquaticScourge.cs b/Items/LoreItems/KnowledgeAquaticScourge.cs index 725d3ce13d..c00a8083ea 100644 --- a/Items/LoreItems/KnowledgeAquaticScourge.cs +++ b/Items/LoreItems/KnowledgeAquaticScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A horror born of pollution and insatiable hunger; based on size alone this was merely a juvenile.\n" + "These scourge creatures are the largest aquatic predators and very rarely do they frequent such shallow waters.\n" + "Place in your inventory to gain immunity to the sulphurous waters and increase the stat gains from the Well Fed buff.\n" + - "However, without the Well Fed buff your stats will decrease due to your insatiable hunger."); + "However, without the Well Fed buff your stats will decrease due to your insatiable hunger.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,11 +32,12 @@ namespace CalamityMod.Items.LoreItems return false; } - public override void UpdateInventory(Player player) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aquaticScourgeLore = true; - } + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + if (item.favorited) + modPlayer.aquaticScourgeLore = true; + } public override void AddRecipes() { diff --git a/Items/LoreItems/KnowledgeAstrumAureus.cs b/Items/LoreItems/KnowledgeAstrumAureus.cs index 7b1d99ae7d..afff87fd71 100644 --- a/Items/LoreItems/KnowledgeAstrumAureus.cs +++ b/Items/LoreItems/KnowledgeAstrumAureus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Aureus"); Tooltip.SetDefault("A titanic cyborg infected by a star-borne disease expelled from the belly of an ancient god.\n" + "The destruction of this creature will not prevent the spread of the disease.\n" + - "Place in your inventory to gain increased jump speed in space."); + "Place in your inventory to gain increased jump speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumAureusLore = true; + if (item.favorited) + modPlayer.astrumAureusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeAstrumDeus.cs b/Items/LoreItems/KnowledgeAstrumDeus.cs index e892c5c7e8..a8b5376105 100644 --- a/Items/LoreItems/KnowledgeAstrumDeus.cs +++ b/Items/LoreItems/KnowledgeAstrumDeus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Deus"); Tooltip.SetDefault("God of the stars and largest vessel for the Astral Infection.\n" + "Though struck down from its place among the stars its remnants have gathered strength, aiming to take its rightful place in the cosmos once more.\n" + - "Place in your inventory to gain increased movement speed in space."); + "Place in your inventory to gain increased movement speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumDeusLore = true; + if (item.favorited) + modPlayer.astrumDeusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index 4e6a899dbb..e5f11cc641 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Most likely another abomination spawned from this inchoate mass of flesh.\n" + "Allows you to teleport similar to the Rod of Discord while in the crimson. Place in your hotbar to use it.\n" + "Teleportation is disabled while Chaos State is active.\n" + - "However, you become confused for a few seconds after you use it due to your overwhelming brain power."); + "However, you become confused for a few seconds after you use it due to your overwhelming brain power.\n" + + "Teleportation only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override bool CanUseItem(Player player) { - return player.ZoneCrimson; + return player.ZoneCrimson && item.favorited; } public override bool UseItem(Player player) diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.cs b/Items/LoreItems/KnowledgeBrimstoneElemental.cs index 336c1e75a2..d9a666e5d1 100644 --- a/Items/LoreItems/KnowledgeBrimstoneElemental.cs +++ b/Items/LoreItems/KnowledgeBrimstoneElemental.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Brimstone Elemental"); Tooltip.SetDefault("The most powerful of the elementals, bent on exacting revenge upon the bloody inferno that demolished her home.\n" + "Finally put to rest, she will suffer no longer from the grief caused by the deaths of her people.\n" + - "Place in your inventory to improve the inferno potion effect."); + "Place in your inventory to improve the inferno potion effect.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneElementalLore = true; + if (item.favorited) + modPlayer.brimstoneElementalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCalamitas.cs b/Items/LoreItems/KnowledgeCalamitas.cs index a4f20b294d..d2cddd9d9c 100644 --- a/Items/LoreItems/KnowledgeCalamitas.cs +++ b/Items/LoreItems/KnowledgeCalamitas.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The witch unrivaled. Perhaps the only one amongst my cohorts to have ever given me cause for doubt.\n" + "Now that you have defeated her your destiny is clear.\n" + "Come now, face me.\n" + - "Place in your inventory to die instantly from every hit."); + "Place in your inventory to die instantly from every hit.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.SCalLore = true; + if (item.favorited) + modPlayer.SCalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCrabulon.cs b/Items/LoreItems/KnowledgeCrabulon.cs index 57bf38da6e..1b2116ca4e 100644 --- a/Items/LoreItems/KnowledgeCrabulon.cs +++ b/Items/LoreItems/KnowledgeCrabulon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A crab and its mushrooms, a love story.\n" + "It's interesting how creatures can adapt given certain circumstances.\n" + "Place in your inventory to gain the Mushy buff while underground or in the mushroom biome.\n" + - "However, your movement speed will be decreased while in these areas due to you being covered in fungi."); + "However, your movement speed will be decreased while in these areas due to you being covered in fungi.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.crabulonLore = true; + if (item.favorited) + modPlayer.crabulonLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCryogen.cs b/Items/LoreItems/KnowledgeCryogen.cs index 184c4b9776..16b985b6f8 100644 --- a/Items/LoreItems/KnowledgeCryogen.cs +++ b/Items/LoreItems/KnowledgeCryogen.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Cryogen"); Tooltip.SetDefault("The archmage's prison.\n" + "I am unsure if it has grown weaker over the decades of imprisonment.\n" + - "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body."); + "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dashMod = 6; + if (item.favorited) + modPlayer.dashMod = 6; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDesertScourge.cs b/Items/LoreItems/KnowledgeDesertScourge.cs index 082f206049..a631c734fa 100644 --- a/Items/LoreItems/KnowledgeDesertScourge.cs +++ b/Items/LoreItems/KnowledgeDesertScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "What used to be a majestic beast swimming through the water has now become a dried-up and\n" + "gluttonous husk, constantly on a voracious search for its next meal.\n" + "Place in your inventory for an increase to defense while in the desert or sunken sea.\n" + - "However, you will deal decreased damage while in these areas due to being a husk of your former self."); + "However, you will deal decreased damage while in these areas due to being a husk of your former self.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().desertScourgeLore = true; + if (item.favorited) + player.Calamity().desertScourgeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDestroyer.cs b/Items/LoreItems/KnowledgeDestroyer.cs index 55303b8bff..5c3141b702 100644 --- a/Items/LoreItems/KnowledgeDestroyer.cs +++ b/Items/LoreItems/KnowledgeDestroyer.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A machine brought to life by the mighty souls of warriors, and built to excavate massive tunnels in planets to gather resources.\n" + "Could have proven useful if Draedon didn't have an obsession with turning everything into a tool of destruction.\n" + "Place in your inventory to gain a boost to your pick speed.\n" + - "However, your max acceleration is decreased slightly due to you feeling heavier."); + "However, your max acceleration is decreased slightly due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.destroyerLore = true; + if (item.favorited) + modPlayer.destroyerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDevourerofGods.cs b/Items/LoreItems/KnowledgeDevourerofGods.cs index c7b2f2d492..3cf2fa69fd 100644 --- a/Items/LoreItems/KnowledgeDevourerofGods.cs +++ b/Items/LoreItems/KnowledgeDevourerofGods.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This serpent’s power to assimilate the abilities and energy of those it consumed is unique in almost all the known cosmos, save for its lesser brethren.\n" + "I would have soon had to eliminate it as a threat had it been given more time and creatures to feast upon.\n" + "Place in your inventory to boost the power of your true melee strikes by 25%.\n" + - "However, due to your reckless nature you will take increased damage."); + "However, due to your reckless nature you will take increased damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.DoGLore = true; + if (item.favorited) + modPlayer.DoGLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDukeFishron.cs b/Items/LoreItems/KnowledgeDukeFishron.cs index 516bd28ad7..fdc59c60bd 100644 --- a/Items/LoreItems/KnowledgeDukeFishron.cs +++ b/Items/LoreItems/KnowledgeDukeFishron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The mutant terror of the sea was once the trusted companion of an old king; he tamed it using its favorite treat.\n" + "Long ago, the creature flew in desperation from the raging bloody inferno consuming its home, ultimately finding its way to the ocean.\n" + "Place in your inventory for an increase to all damage, crit and movement speed while submerged in liquid.\n" + - "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out."); + "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dukeFishronLore = true; + if (item.favorited) + modPlayer.dukeFishronLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.cs b/Items/LoreItems/KnowledgeEaterofWorlds.cs index 40a7adf76f..83269fc9a3 100644 --- a/Items/LoreItems/KnowledgeEaterofWorlds.cs +++ b/Items/LoreItems/KnowledgeEaterofWorlds.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Perhaps it was just a giant worm infected by the microbe, given centuries to feed and grow its festering body.\n" + "Seems likely, given the origins of this place.\n" + "Deadly microbes spawn around you while this is placed in your inventory.\n" + - "However, you will have decreased life regen due to your skin rotting off."); + "However, you will have decreased life regen due to your skin rotting off.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.eaterOfWorldsLore = true; + if (item.favorited) + modPlayer.eaterOfWorldsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.cs b/Items/LoreItems/KnowledgeEyeofCthulhu.cs index 61a1a60a44..086355307c 100644 --- a/Items/LoreItems/KnowledgeEyeofCthulhu.cs +++ b/Items/LoreItems/KnowledgeEyeofCthulhu.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("That eye...how peculiar.\n" + "I sensed it watching you more intensely as you grew stronger.\n" + "Place in your inventory for night vision at night.\n" + - "However, your vision is reduced during the day."); + "However, your vision is reduced during the day.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,10 +32,13 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (!Main.dayTime) - player.nightVision = true; - else - player.blind = true; + if (item.favorited) + { + if (!Main.dayTime) + player.nightVision = true; + else + player.blind = true; + } } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeGolem.cs b/Items/LoreItems/KnowledgeGolem.cs index 4fc871658b..d661b84483 100644 --- a/Items/LoreItems/KnowledgeGolem.cs +++ b/Items/LoreItems/KnowledgeGolem.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Golem"); Tooltip.SetDefault("A primitive construct.\n" + "I admire the lihzahrd race for their ingenuity, though finding faith in such a flawed idol would invariably lead to their downfall.\n" + - "Place in your inventory to gain increased defense while standing still."); + "Place in your inventory to gain increased defense while standing still.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.golemLore = true; + if (item.favorited) + modPlayer.golemLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeHiveMind.cs b/Items/LoreItems/KnowledgeHiveMind.cs index 2d7b59c989..9ad9b6dbd9 100644 --- a/Items/LoreItems/KnowledgeHiveMind.cs +++ b/Items/LoreItems/KnowledgeHiveMind.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A hive of clustered microbial-infected flesh.\n" + "I do not believe killing it will lessen the corruption here.\n" + "Place in your inventory for all of your projectiles to inflict cursed flames when in the corruption.\n" + - "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor."); + "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCorrupt) + if (player.ZoneCorrupt && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.hiveMindLore = true; diff --git a/Items/LoreItems/KnowledgeKingSlime.cs b/Items/LoreItems/KnowledgeKingSlime.cs index 9b7704180f..1af39c4988 100644 --- a/Items/LoreItems/KnowledgeKingSlime.cs +++ b/Items/LoreItems/KnowledgeKingSlime.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Only a fool could be caught by this pitiful excuse for a hunter.\n" + "Unfortunately, our world has no shortage of those.\n" + "Place in your inventory to gain a slight movement speed and jump boost.\n" + - "However, your defense is slightly reduced due to your gelatinous body."); + "However, your defense is slightly reduced due to your gelatinous body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().kingSlimeLore = true; + if (item.favorited) + player.Calamity().kingSlimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.cs b/Items/LoreItems/KnowledgeLeviathanandSiren.cs index b0207cd611..e95bef421f 100644 --- a/Items/LoreItems/KnowledgeLeviathanandSiren.cs +++ b/Items/LoreItems/KnowledgeLeviathanandSiren.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.LoreItems "Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another.\n" + "Place in your inventory to gain increased max health while wearing the siren heart and treasure detect while wearing the strange orb.\n" + "Allows the young siren pet to move normally while outside of liquids.\n" + - "However, if you're not submerged in liquid you will have decreased defense and damage reduction."); + "However, if you're not submerged in liquid you will have decreased defense and damage reduction.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.leviathanAndSirenLore = true; + if (item.favorited) + modPlayer.leviathanAndSirenLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLunaticCultist.cs b/Items/LoreItems/KnowledgeLunaticCultist.cs index 85eefb0946..4ddea4544f 100644 --- a/Items/LoreItems/KnowledgeLunaticCultist.cs +++ b/Items/LoreItems/KnowledgeLunaticCultist.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Someone I once held in such contempt for his actions is now...deceased, his sealing ritual undone...prepare for the end.\n" + "Your impending doom approaches...\n" + "Place in your inventory for an increase to all stats during the lunar event.\n" + - "However, your vision is decreased due to eldritch knowledge damaging your mind."); + "However, your vision is decreased due to eldritch knowledge damaging your mind.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (NPC.LunarApocalypseIsUp) + if (NPC.LunarApocalypseIsUp && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.lunaticCultistLore = true; diff --git a/Items/LoreItems/KnowledgeMoonLord.cs b/Items/LoreItems/KnowledgeMoonLord.cs index de993228b6..6d023e3fcb 100644 --- a/Items/LoreItems/KnowledgeMoonLord.cs +++ b/Items/LoreItems/KnowledgeMoonLord.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Had it been fully restored it would have been a force to behold, but what you fought was an empty shell.\n" + "However, that doesn't diminish the immense potential locked within it, released upon its death.\n" + "Place in your inventory to gain an improved Gravity Globe that gives you an increase to all stats while upside down.\n" + - "However, while not upside down you have permanent featherfall."); + "However, while not upside down you have permanent featherfall.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.moonLordLore = true; + if (item.favorited) + modPlayer.moonLordLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeOldDuke.cs b/Items/LoreItems/KnowledgeOldDuke.cs index 78a1498a80..6df689a8c1 100644 --- a/Items/LoreItems/KnowledgeOldDuke.cs +++ b/Items/LoreItems/KnowledgeOldDuke.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Old Duke"); Tooltip.SetDefault("Strange, to find out that the mutant terror of the seas was not alone in its unique biology.\n" + "Perhaps I was mistaken to classify the creature from its relation to pigrons alone.\n" + - "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects."); + "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.boomerDukeLore = true; + if (item.favorited) + modPlayer.boomerDukeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index aed58f7645..53dbe77a77 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Perforators and their Hive"); Tooltip.SetDefault("An abomination of comingled flesh, bone, and organ, infested primarily by blood-slurping worms.\n" + "Place in your inventory for all of your projectiles to inflict ichor when in the crimson.\n" + - "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus."); + "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCrimson) + if (player.ZoneCrimson && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.perforatorLore = true; diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs index 54bc9ee369..4f88bf176c 100644 --- a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs +++ b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Plaguebringer Goliath"); Tooltip.SetDefault("A horrific amalgam of steel, flesh, and infection, capable of destroying an entire civilization in just one onslaught.\n" + "Its plague nuke barrage can leave an entire area uninhabitable for months. A shame that it came to this but the plague must be contained.\n" + - "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen."); + "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.plaguebringerGoliathLore = true; + if (item.favorited) + modPlayer.plaguebringerGoliathLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePlantera.cs b/Items/LoreItems/KnowledgePlantera.cs index b5a07a9743..7c71900847 100644 --- a/Items/LoreItems/KnowledgePlantera.cs +++ b/Items/LoreItems/KnowledgePlantera.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Well done, you killed a plant.\n" + "It was used as a vessel to house the spirits of those unfortunate enough to find their way down here.\n" + "I wish you luck in dealing with the fallout.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.planteraLore = true; + if (item.favorited) + modPlayer.planteraLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePolterghast.cs b/Items/LoreItems/KnowledgePolterghast.cs index 80488cdddb..acce6e2081 100644 --- a/Items/LoreItems/KnowledgePolterghast.cs +++ b/Items/LoreItems/KnowledgePolterghast.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Polterghast"); Tooltip.SetDefault("A creature born of hatred and anger, formed by countless human souls with all of their energy entirely devoted to consuming others.\n" + "It seems a waste to have had such a potent source of power ravage mindlessly through these empty halls.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.polterghastLore = true; + if (item.favorited) + modPlayer.polterghastLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeProvidence.cs b/Items/LoreItems/KnowledgeProvidence.cs index 4c6d5cb9e0..16183e5179 100644 --- a/Items/LoreItems/KnowledgeProvidence.cs +++ b/Items/LoreItems/KnowledgeProvidence.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A core surrounded by stone and flame, a simple origin and a simple goal.\n" + "What would have become of us had she not been defeated is a frightening concept to consider.\n" + "Place in your inventory to imbue all projectiles with profaned flames, causing them to inflict extra damage.\n" + - "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames."); + "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.providenceLore = true; + if (item.favorited) + modPlayer.providenceLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeQueenBee.cs b/Items/LoreItems/KnowledgeQueenBee.cs index f4ed7c5ed5..b91706e5ae 100644 --- a/Items/LoreItems/KnowledgeQueenBee.cs +++ b/Items/LoreItems/KnowledgeQueenBee.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("Queen Bee"); Tooltip.SetDefault("As crude as the giant insects are they can prove useful in certain situations...given the ability to control them.\n" + - "Place in your inventory to make small bees and weak hornets friendly."); + "Place in your inventory to make small bees and weak hornets friendly.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.queenBeeLore = true; + if (item.favorited) + modPlayer.queenBeeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeRavager.cs b/Items/LoreItems/KnowledgeRavager.cs index 8a2b2fc156..461310f14d 100644 --- a/Items/LoreItems/KnowledgeRavager.cs +++ b/Items/LoreItems/KnowledgeRavager.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Ravager"); Tooltip.SetDefault("The flesh golem constructed using twisted necromancy during the time of my conquest to counter my unstoppable forces.\n" + "Its creators were slaughtered by it moments after its conception. It is for the best that it has been destroyed.\n" + - "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time."); + "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.ravagerLore = true; + if (item.favorited) + modPlayer.ravagerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSkeletron.cs b/Items/LoreItems/KnowledgeSkeletron.cs index 81a3cf3fdc..8f54da002b 100644 --- a/Items/LoreItems/KnowledgeSkeletron.cs +++ b/Items/LoreItems/KnowledgeSkeletron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The curse is said to only affect the elderly.\n" + "After they are afflicted they become an immortal vessel for an ancient demon of the underworld.\n" + "Place in your inventory to gain increased damage while in the dungeon.\n" + - "However, your max health is decreased due to Skeletron's curse."); + "However, your max health is decreased due to Skeletron's curse.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneDungeon) + if (player.ZoneDungeon && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.skeletronLore = true; diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.cs b/Items/LoreItems/KnowledgeSkeletronPrime.cs index bbb95cff60..22239ad9f4 100644 --- a/Items/LoreItems/KnowledgeSkeletronPrime.cs +++ b/Items/LoreItems/KnowledgeSkeletronPrime.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("What a silly and pointless contraption for something created with the essence of pure terror.\n" + "Draedon obviously took several liberties with its design...I am not impressed.\n" + "Place in your inventory to gain a boost to your armor penetration.\n" + - "However, your max acceleration is decreased due to you feeling heavier."); + "However, your max acceleration is decreased due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.skeletronPrimeLore = true; + if (item.favorited) + modPlayer.skeletronPrimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index e980523588..c194ec932f 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("It is a travesty, one of the most threatening biological terrors ever created.\n" + "If this creature were allowed to combine every slime on the planet it would become nearly unstoppable.\n" + "Place in your inventory to become slimed and able to slide around on tiles quickly, at the cost of reduced defense.\n" + - "This effect makes dashing more difficult and does not work with mounts."); + "This effect makes dashing more difficult and does not work with mounts.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.mount.Active) + if (player.mount.Active || !item.favorited) return; if (player.dashDelay < 0) diff --git a/Items/LoreItems/KnowledgeTwins.cs b/Items/LoreItems/KnowledgeTwins.cs index 7314c7f2ba..1514675839 100644 --- a/Items/LoreItems/KnowledgeTwins.cs +++ b/Items/LoreItems/KnowledgeTwins.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "These creatures did not belong in this world, it's best to be rid of them.\n" + "Place in your inventory to gain invisibility and rogue bonuses at night.\n" + "However, your defense is reduced while above 50% life due to you feeling softer.\n" + - "Your max acceleration is reduced while below 50% life due to you feeling heavier."); + "Your max acceleration is reduced while below 50% life due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.twinsLore = true; + if (item.favorited) + modPlayer.twinsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeWallofFlesh.cs b/Items/LoreItems/KnowledgeWallofFlesh.cs index 7f485be3dc..6c4b7a7015 100644 --- a/Items/LoreItems/KnowledgeWallofFlesh.cs +++ b/Items/LoreItems/KnowledgeWallofFlesh.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I see the deed is done.\n" + "The unholy amalgamation of flesh and hatred has been defeated.\n" + "Prepare to face the terrors that lurk in the light and dark parts of this world.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.wallOfFleshLore = true; + if (item.favorited) + modPlayer.wallOfFleshLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeYharon.cs b/Items/LoreItems/KnowledgeYharon.cs index 535ff8a48d..bbf5a90a42 100644 --- a/Items/LoreItems/KnowledgeYharon.cs +++ b/Items/LoreItems/KnowledgeYharon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Jungle Dragon, Yharon"); Tooltip.SetDefault("I would not be able to bear a world without my faithful companion by my side.\n" + "Fortunately, fate will have it so that it is a world I shall never have to see, for better or for worse.\n" + - "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage."); + "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.yharonLore = true; + if (item.favorited) + modPlayer.yharonLore = true; } public override void AddRecipes()