diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1467e28ea8..69914b73ed 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1024,6 +1024,7 @@ namespace CalamityMod.CalPlayer public int witheredWeaponHoldTime = 0; public bool persecutedEnchant = false; + public int persecutedEnchantSummonTimer = 0; #endregion Calamitas Enchant Effects #endregion @@ -2427,6 +2428,7 @@ namespace CalamityMod.CalPlayer animusBoost = 1f; potionTimer = 0; bloodflareCoreLostDefense = 0; + persecutedEnchantSummonTimer = 0; if (BossRushEvent.BossRushActive) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2af4eb10fa..5f766fba27 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -22,6 +22,7 @@ using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Environment; @@ -1180,6 +1181,19 @@ namespace CalamityMod.CalPlayer modPlayer.aBulwarkRareTimer--; if (modPlayer.hellbornBoost > 0) modPlayer.hellbornBoost--; + if (modPlayer.persecutedEnchantSummonTimer < 1800) + modPlayer.persecutedEnchantSummonTimer++; + else + { + modPlayer.persecutedEnchantSummonTimer = 0; + if (Main.myPlayer == player.whoAmI && player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) + { + Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int portal = NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + if (Main.npc.IndexInRange(portal)) + Main.npc[portal].target = player.whoAmI; + } + } if (player.miscCounter % 20 == 0) modPlayer.canFireAtaxiaRangedProjectile = true; if (player.miscCounter % 100 == 0) diff --git a/ExtraTextures/UI/CalamitasCurseBackground.png b/ExtraTextures/UI/CalamitasCurseBackground.png index f6c3ca7fd2..29555271c1 100644 Binary files a/ExtraTextures/UI/CalamitasCurseBackground.png and b/ExtraTextures/UI/CalamitasCurseBackground.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame.png new file mode 100644 index 0000000000..8d8c0b27ec Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty.png new file mode 100644 index 0000000000..583179b633 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Capricious.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Capricious.png new file mode 100644 index 0000000000..9c75e5ba01 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Capricious.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral.png new file mode 100644 index 0000000000..5d8f8666be Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Erratic.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Erratic.png new file mode 100644 index 0000000000..9d114ac4af Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Erratic.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png new file mode 100644 index 0000000000..3969952ddc Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png new file mode 100644 index 0000000000..588a10e3b0 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png new file mode 100644 index 0000000000..584bd62881 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png new file mode 100644 index 0000000000..96b2a87a02 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png new file mode 100644 index 0000000000..fe9459ec61 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png new file mode 100644 index 0000000000..526223131e Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous.png new file mode 100644 index 0000000000..fcbbe480bb Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory.png new file mode 100644 index 0000000000..f4d86bb62f Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png new file mode 100644 index 0000000000..41a740b387 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png new file mode 100644 index 0000000000..d4999cd4ad Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Polluted.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Polluted.png new file mode 100644 index 0000000000..4edccb5b2b Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Polluted.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png new file mode 100644 index 0000000000..df19b8d4c1 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png new file mode 100644 index 0000000000..6259357bb1 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png new file mode 100644 index 0000000000..0f75aff9d7 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted.png new file mode 100644 index 0000000000..c3b9d97ec5 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png new file mode 100644 index 0000000000..9a7f8c7cec Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png new file mode 100644 index 0000000000..3a768a4e8e Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png differ diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png new file mode 100644 index 0000000000..fd20048613 Binary files /dev/null and b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png differ diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 5abf79f364..e4434c1263 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -22,7 +22,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static bool CurrentlyViewing = false; - public static readonly Vector2 ReforgeUITopLeft = new Vector2(28f, 245f); + public static readonly Vector2 ReforgeUITopLeft = new Vector2(68f, 320f); public static readonly float ResolutionRatio = Main.screenHeight / 1440f; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); @@ -87,10 +87,6 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); - // Draw the item icon. - Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; - Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(88f, 60f) * backgroundScale; - // Prevent the player from say, firing a weapon while the mouse is hovering over the UI. DisableMouseWhenOverUI(backgroundTexture, backgroundScale); @@ -104,11 +100,20 @@ namespace CalamityMod.UI.CalamitasEnchants Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 78f) * backgroundScale).ToPoint(); cost = DrawEnchantmentCost(spriteBatch, costDrawPositionTopLeft); Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; - descriptionDrawPositionTopLeft.Y += 90; + descriptionDrawPositionTopLeft.Y += 70; + Vector2 iconDrawPositionTopLeft = costDrawPositionTopLeft.ToVector2() + new Vector2(270f, -24f); DrawEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); + if (!string.IsNullOrEmpty(SelectedEnchantment.Value.IconTexturePath)) + { + Texture2D iconTexture = ModContent.GetTexture(SelectedEnchantment.Value.IconTexturePath); + DrawIcon(spriteBatch, iconDrawPositionTopLeft, iconTexture); + } } + // Draw the item icon. + Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; + Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(84f, 60f) * backgroundScale; DrawItemIcon(spriteBatch, itemSlotDrawPosition, reforgeIconDrawPosition, backgroundScale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon); if (isHoveringOverItemIcon) InteractWithItemSlot(); @@ -167,7 +172,18 @@ namespace CalamityMod.UI.CalamitasEnchants if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == EnchantmentManager.UpgradeEnchantName) cost = (int)MathHelper.Min(cost, Item.buyPrice(5)) * 5; - ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); + // Draw the coin costs. + string costText = "Cost: "; + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, costText, costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y + 45f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero); + costDrawPositionTopLeft.X += (int)(Main.fontMouseText.MeasureString(costText).X * 0.5f + 12f); + + int[] coinsArray = Utils.CoinsSplit(cost); + for (int i = 0; i < 4; i++) + { + Vector2 drawPosition = new Vector2(costDrawPositionTopLeft.X + ChatManager.GetStringSize(Main.fontMouseText, costText, Vector2.One, -1f).X + (24 * i) - 24f, costDrawPositionTopLeft.Y + 54f); + spriteBatch.Draw(Main.itemTexture[ItemID.PlatinumCoin - i], drawPosition, null, Color.White, 0f, Main.itemTexture[ItemID.PlatinumCoin - i].Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontItemStack, coinsArray[3 - i].ToString(), drawPosition.X - 11f, drawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + } return cost; } @@ -176,7 +192,7 @@ namespace CalamityMod.UI.CalamitasEnchants { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); Vector2 scale = new Vector2(0.67f, 0.7f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f); - foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) + foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 465, 10, out _)) { if (string.IsNullOrEmpty(line)) continue; @@ -186,6 +202,11 @@ namespace CalamityMod.UI.CalamitasEnchants } } + public static void DrawIcon(SpriteBatch spriteBatch, Vector2 drawPositionTopLeft, Texture2D texture) + { + spriteBatch.Draw(texture, drawPositionTopLeft, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + public static void DrawItemIcon(SpriteBatch spriteBatch, Vector2 itemSlotDrawPosition, Vector2 reforgeIconDrawPosition, Vector2 scale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) { isHoveringOverReforgeIcon = false; @@ -261,6 +282,7 @@ namespace CalamityMod.UI.CalamitasEnchants // Attempt to exchange if the slot is clicked. if (Main.mouseLeftRelease && Main.mouseLeft && (Main.mouseItem.CanBeEnchantedBySomething() || Main.mouseItem.IsAir)) { + EnchantIndex = 0; Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); Main.PlaySound(SoundID.Grab); } diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs index e098ecb163..e24f411e0e 100644 --- a/UI/CalamitasEnchantments/Enchantment.cs +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -7,6 +7,7 @@ namespace CalamityMod.UI.CalamitasEnchants { public string Name; public string Description; + public string IconTexturePath; public Action CreationEffect; public Action HoldEffect; @@ -15,7 +16,7 @@ namespace CalamityMod.UI.CalamitasEnchants // This is internal because CanBeAppliedTo should be used over this field directly. // Using that has the benefit of null checks and is objectively superior to using the raw delegate. internal Predicate ApplyRequirement; - public Enchantment(string name, string description, int id, Action creationEffect, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action creationEffect, Action holdEffect, Predicate requirement) { Name = name; Description = description; @@ -23,8 +24,9 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = holdEffect; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } - public Enchantment(string name, string description, int id, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action holdEffect, Predicate requirement) { Name = name; Description = description; @@ -32,8 +34,9 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = holdEffect; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } - public Enchantment(string name, string description, int id, Action creationEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action creationEffect, Predicate requirement) { Name = name; Description = description; @@ -41,6 +44,7 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = null; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } public bool CanBeAppliedTo(Item item) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 6a1502f4c6..ba3dddd99c 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -58,14 +58,15 @@ namespace CalamityMod.UI.CalamitasEnchants public static void ConstructFromModcall(IEnumerable parameters) { int secondaryArgumentCount = parameters.Count(); - if (secondaryArgumentCount < 4) + if (secondaryArgumentCount < 5) throw new ArgumentNullException("ERROR: A minimum of 4 arguments must be supplied to this command; a name, a description, an id, and a requirement predicate."); - if (secondaryArgumentCount > 6) + if (secondaryArgumentCount > 7) throw new ArgumentNullException("ERROR: A maximum of 6 arguments can be supplied to this command."); string name = string.Empty; string description = string.Empty; int id = -1; + string iconTexturePath = null; Predicate requirement = null; Action creationEffect = null; Action holdEffect = null; @@ -94,33 +95,39 @@ namespace CalamityMod.UI.CalamitasEnchants else throw new ArgumentException("The fourth argument to this command must be an Item Predicate."); + // Fifth element - the texture path. This determines what icon is drawn on the UI when selected. It may be null to specify that none should be drawn. + if (parameters.ElementAt(4) is string iconTexturePathElement) + iconTexturePath = iconTexturePathElement; + else + throw new ArgumentException("The fifth argument to this command must be a string."); + // Optional elements - creation and hold effects. switch (secondaryArgumentCount) { - case 5: - object fifthElement = parameters.ElementAt(4); - if (fifthElement is Action creationElement) + case 6: + object sixthElement = parameters.ElementAt(4); + if (sixthElement is Action creationElement) creationEffect = creationElement; - else if (fifthElement is Action holdElement) + else if (sixthElement is Action holdElement) holdEffect = holdElement; else - throw new ArgumentException("The fifth argument to this command must be an Item or Player Action."); + throw new ArgumentException("The sixth argument to this command must be an Item or Player Action."); break; - case 6: - fifthElement = parameters.ElementAt(4); - object sixthElement = parameters.ElementAt(5); - if (fifthElement is Action creationElement2) + case 7: + sixthElement = parameters.ElementAt(4); + object seventhElement = parameters.ElementAt(5); + if (sixthElement is Action creationElement2) { creationEffect = creationElement2; - holdEffect = sixthElement as Action; + holdEffect = seventhElement as Action; } - else if (fifthElement is Action holdElement2) + else if (sixthElement is Action holdElement2) { - creationEffect = sixthElement as Action; + creationEffect = seventhElement as Action; holdEffect = holdElement2; } else - throw new ArgumentException("The fifth argument to this command must be an Item or Player Action and the sixth must be the other action type."); + throw new ArgumentException("The sixth argument to this command must be an Item or Player Action and the sixth must be the other action type."); break; } @@ -128,33 +135,37 @@ namespace CalamityMod.UI.CalamitasEnchants if (EnchantmentList.Any(enchant => enchant.ID == id) || id == ClearEnchantmentID) throw new ArgumentException("An enchantment with this ID already exists. Another one must be specified."); - EnchantmentList.Add(new Enchantment(name, description, id, creationEffect, holdEffect, requirement)); + EnchantmentList.Add(new Enchantment(name, description, id, iconTexturePathElement, creationEffect, holdEffect, requirement)); } internal static void LoadAllEnchantments() { EnchantmentList = new List { - new Enchantment(UpgradeEnchantName, "Transforms this item into something significantly better.", + new Enchantment(UpgradeEnchantName, "Transforms this item into something significantly stronger.", 1, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed", null, null, item => ItemUpgradeRelationship.ContainsKey(item.type)), - new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", + new Enchantment("Indignant", "Summons demons that harm you but drop healing items on death on item usage.", 100, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant", null, player => player.Calamity().cursedSummonsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), new Enchantment("Aflame", "Lights enemies ablaze on hit but also causes the user to take damage over time when holding this item.", 200, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame", null, player => player.Calamity().flamingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), new Enchantment("Oblatory", "Reduces mana cost and greatly increases damage but sometimes causes this item to use your life.", 300, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory", item => { item.damage = (int)(item.damage * 1.5); @@ -165,30 +176,35 @@ namespace CalamityMod.UI.CalamitasEnchants new Enchantment("Resentful", "Makes the damage of projectiles vary based on how far the hit target is from you. The farther, the more damage, and vice versa.", 400, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful", null, player => player.Calamity().farProximityRewardEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), new Enchantment("Bloodthirsty", "Makes the damage of projectiles vary based on how far the hit target is from you. The closer, the more damage, and vice versa.", 500, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty", null, player => player.Calamity().closeProximityRewardEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use. Its damage returns naturally when not being used.", 600, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral", null, player => player.Calamity().dischargingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", 700, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound", null, player => player.Calamity().explosiveMinionsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), new Enchantment("Tainted", "Removes projectile shooting capabilities of this item. In exchange, two skeletal arms are released on use that slice at the mouse position.", 800, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted", item => item.useTime = item.useAnimation = 25, player => { @@ -219,27 +235,33 @@ namespace CalamityMod.UI.CalamitasEnchants }, item => item.damage > 0 && item.maxStack == 1 && item.melee && !item.noUseGraphic && item.shoot > ProjectileID.None), - new Enchantment("Treacherous", "Causes this item to sometimes release a monster that hurts both you and enemies when you have less than 50% mana.", + new Enchantment("Traitorous", "Causes this item to sometimes release a monster that hurts both you and enemies when you have less than 50% mana.", 900, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous", null, player => player.Calamity().manaMonsterEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), new Enchantment("Withering", "You heal when hurt based on damage dealt. After being hurt, the weapon rapidly drains your life to deal massive damage.", 1000, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered", null, player => player.Calamity().witheringWeaponEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), - new Enchantment("Persecuted", "You attract portals which summon demons on hit. The portal must be brought close to death or the demons will attack you. Otherwise they attack enemies.", + new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you.", 1100, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted", null, player => player.Calamity().persecutedEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. - ClearEnchantment = new Enchantment("Disenchant", string.Empty, ClearEnchantmentID, + ClearEnchantment = new Enchantment("Disenchant", + string.Empty, + ClearEnchantmentID, + null, item => item.Calamity().AppliedEnchantment = null, item => item.maxStack == 1 && item.shoot >= ProjectileID.None);