diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index c79cb1e43d..44f9daa713 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -33,9 +33,8 @@ namespace CalamityMod.Items.Accessories item.width = 18; item.height = 18; item.accessory = true; - item.value = CalamityGlobalItem.Rarity11BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().postMoonLordRarity = 12; + item.value = CalamityGlobalItem.Rarity11BuyPrice; + item.rare = ItemRarityID.Purple; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/CheatTestThing.cs b/Items/Accessories/CheatTestThing.cs index a6ca44adaf..e8e587d31f 100644 --- a/Items/Accessories/CheatTestThing.cs +++ b/Items/Accessories/CheatTestThing.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().postMoonLordRarity = 16; + item.value = 0; // lul intentionally has zero value + item.Calamity().customRarity = CalamityRarity.HotPink; item.accessory = true; } diff --git a/Items/Accessories/DukeScales.cs b/Items/Accessories/DukeScales.cs index 36b9e857cf..e1aebb7ce8 100644 --- a/Items/Accessories/DukeScales.cs +++ b/Items/Accessories/DukeScales.cs @@ -10,19 +10,18 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Old Duke's Scales"); Tooltip.SetDefault("While under the effects of a damaging debuff, you gain 10% increased damage and 5% crit\n" + - "For every 25% of lost life, you gain 6% increased damage and 3% crit\n" + - "This will max out at 18% increased damage and 9% crit when under 25% life\n" + - "Provides immunity to poisoned, venom, and sulphuric poisoning"); + "For every 25% of lost life, you gain 6% increased damage and 3% crit\n" + + "This will max out at 18% increased damage and 9% crit when under 25% life\n" + + "Provides immunity to poisoned, venom, and sulphuric poisoning"); } public override void SetDefaults() { item.width = 28; item.height = 26; - item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; - item.rare = 10; - item.Calamity().postMoonLordRarity = 13; + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index ca0cd72a00..5cf0b4f0c4 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Accessories item.height = 50; item.accessory = true; item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index 61f542dc95..5878f6285b 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -53,7 +53,8 @@ namespace CalamityMod.Items.Accessories item.accessory = true; item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; item.rare = ItemRarityID.Red; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; + item.Calamity().devItem = true; } // Not overriding these Clones makes tooltips fail to function correctly due to HoverItem spaghetti. diff --git a/Items/Accessories/StatisBeltOfCurses.cs b/Items/Accessories/StatisBeltOfCurses.cs index ab686047ed..b956613640 100644 --- a/Items/Accessories/StatisBeltOfCurses.cs +++ b/Items/Accessories/StatisBeltOfCurses.cs @@ -7,13 +7,13 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class StatisBeltOfCurses : ModItem + public class StatisBeltOfCurses : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Statis' Void Sash"); Tooltip.SetDefault("24% increased jump speed and allows constant jumping\n" + - "Grants immunity to fall damage\n" + + "Grants immunity to fall damage\n" + "Can climb walls, dash, and dodge attacks\n" + "Dashes leave homing scythes in your wake"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 3)); @@ -23,9 +23,9 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; - item.Calamity().postMoonLordRarity = 14; + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.Calamity().customRarity = CalamityRarity.DarkBlue; } public override void UpdateAccessory(Player player, bool hideVisual) @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories player.jumpSpeedBoost += 1.2f; player.noFallDmg = true; player.blackBelt = true; - modPlayer.dashMod = 7; + modPlayer.dashMod = 7; player.spikedBoots = 2; } @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); - //This is not a mistake. Only Nightmare Fuel is intentional for thematics. + //This is not a mistake. Only Nightmare Fuel is intentional for thematics. recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index cc71ebc2d3..9dcf859e53 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.defense = 50; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Armor/DemonshadeGreaves.cs b/Items/Armor/DemonshadeGreaves.cs index 0272275d9e..8efdb8ca97 100644 --- a/Items/Armor/DemonshadeGreaves.cs +++ b/Items/Armor/DemonshadeGreaves.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor item.defense = 50; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index 81b0c87cfd..31be8d750b 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.defense = 50; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f5f041847e..c49a1e1594 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -64,19 +64,12 @@ namespace CalamityMod.Items #endregion // Miscellaneous stuff + public CalamityRarity customRarity = CalamityRarity.NoEffect; public int timesUsed = 0; public int reforgeTier = 0; public bool donorItem = false; public bool devItem = false; - // Rarity is provided both as the classic int and the new enum. - public CalamityRarity customRarity = CalamityRarity.NoEffect; - public int postMoonLordRarity - { - get => (int)customRarity; - set => customRarity = (CalamityRarity)value; - } - // See RogueWeapon.cs for rogue modifier shit #region Modifiers public CalamityGlobalItem() @@ -1082,11 +1075,87 @@ namespace CalamityMod.Items #region Modify Tooltips public override void ModifyTooltips(Item item, List tooltips) { - #region Custom Rarities# - TooltipLine tt2 = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.mod == "Terraria"); - if (tt2 != null) + #region Rarity Coloration + TooltipLine nameLine = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.mod == "Terraria"); + if (nameLine != null) { - // The special color in the tooltip were overlapping. Placing everything in here, above other things, was the only solution I could find that worked. + #region Standard Post-ML Rarities + // TODO -- these should be handled automatically with a separate function and the colors should be tied to the rarity definitions + switch (customRarity) + { + default: + break; + case CalamityRarity.Turquoise: + nameLine.overrideColor = new Color(0, 255, 200); + break; + case CalamityRarity.PureGreen: + nameLine.overrideColor = new Color(0, 255, 0); + break; + case CalamityRarity.DarkBlue: + nameLine.overrideColor = new Color(43, 96, 222); + break; + case CalamityRarity.Violet: + nameLine.overrideColor = new Color(108, 45, 199); + break; + case CalamityRarity.HotPink: + nameLine.overrideColor = new Color(255, 0, 255); + break; + + case CalamityRarity.Rainbow: + nameLine.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + break; + case CalamityRarity.DraedonRust: + nameLine.overrideColor = new Color(204, 71, 35); + break; + case CalamityRarity.RareVariant: + nameLine.overrideColor = new Color(255, 140, 0); + break; + } + #endregion + + #region Uniquely Colored Dev Items + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(Main.DiscoR, 100, 255); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(0, 0, 255); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = Judgement.GetSyncedLightColor(); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = ShatteredCommunity.GetRarityColor(); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(146, 0, 0); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(129, 29, 149); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(220, 20, 60); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(254, 253, 235); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(207, 17, 117); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(227, 226, 180); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); + + // TODO -- for cleanliness, ALL color math should either be a one-line ColorSwap or inside the item's own file + // The items that currently violate this are all below: + // Eternity, Flamsteed Ring, Earth if (item.type == ModContent.ItemType()) { List colorSet = new List() @@ -1099,142 +1168,71 @@ namespace CalamityMod.Items new Color(249, 245, 99), // bright yellow new Color(236, 168, 247), // purplish pink }; - if (tt2 != null) + if (nameLine != null) { int colorIndex = (int)(Main.GlobalTime / 2 % colorSet.Count); Color currentColor = colorSet[colorIndex]; Color nextColor = colorSet[(colorIndex + 1) % colorSet.Count]; - tt2.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); + nameLine.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); } - return; } - switch (customRarity) + if (item.type == ModContent.ItemType()) { - default: - break; - case CalamityRarity.Turquoise: - tt2.overrideColor = new Color(0, 255, 200); - break; - case CalamityRarity.PureGreen: - tt2.overrideColor = new Color(0, 255, 0); - break; - case CalamityRarity.DarkBlue: - tt2.overrideColor = new Color(43, 96, 222); - break; - case CalamityRarity.Violet: - tt2.overrideColor = new Color(108, 45, 199); - break; - case CalamityRarity.HotPink: - tt2.overrideColor = new Color(255, 0, 255); - break; - - case CalamityRarity.Rainbow: - tt2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - break; - case CalamityRarity.DraedonRust: - tt2.overrideColor = new Color(204, 71, 35); - break; - case CalamityRarity.RareVariant: - tt2.overrideColor = new Color(255, 140, 0); - break; - - case CalamityRarity.ItemSpecific: - // Uniquely colored developer items - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(Main.DiscoR, 100, 255); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(0, 0, 255); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = Judgement.GetSyncedLightColor(); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = ShatteredCommunity.GetRarityColor(); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(146, 0, 0); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(129, 29, 149); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(220, 20, 60); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(254, 253, 235); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(207, 17, 117); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(227, 226, 180); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); - if (item.type == ModContent.ItemType()) - { - if (Main.GlobalTime % 1f < 0.6f) - { - tt2.overrideColor = new Color(89, 229, 255); - } - else if (Main.GlobalTime % 1f < 0.8f) - { - tt2.overrideColor = Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTime % 1f - 0.6f) / 0.2f); - } - else - { - tt2.overrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTime % 1f - 0.8f) / 0.2f); - } - } - if (item.type == ModContent.ItemType()) - { - List earthColors = new List() - { - new Color(255, 99, 146), - new Color(255, 228, 94), - new Color(127, 200, 248) - }; - if (tt2 != null) - { - int colorIndex = (int)(Main.GlobalTime / 2 % earthColors.Count); - Color currentColor = earthColors[colorIndex]; - Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; - tt2.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); - } - } - - // Uniquely colored legendary weapons and Yharim's Crystal - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(255, Main.DiscoG, 53); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(Main.DiscoR, 203, 103); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(53, Main.DiscoG, 255); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(150, Main.DiscoG, 255); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(60, Main.DiscoG, 190); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(255, Main.DiscoG, 155); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(255, Main.DiscoG, 0); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); - if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 3f); - break; + if (Main.GlobalTime % 1f < 0.6f) + { + nameLine.overrideColor = new Color(89, 229, 255); + } + else if (Main.GlobalTime % 1f < 0.8f) + { + nameLine.overrideColor = Color.Lerp(new Color(89, 229, 255), Color.White, (Main.GlobalTime % 1f - 0.6f) / 0.2f); + } + else + { + nameLine.overrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTime % 1f - 0.8f) / 0.2f); + } } + if (item.type == ModContent.ItemType()) + { + List earthColors = new List() + { + new Color(255, 99, 146), + new Color(255, 228, 94), + new Color(127, 200, 248) + }; + if (nameLine != null) + { + int colorIndex = (int)(Main.GlobalTime / 2 % earthColors.Count); + Color currentColor = earthColors[colorIndex]; + Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; + nameLine.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); + } + } + #endregion + + #region Uniquely Colored Non-Dev Items + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(255, Main.DiscoG, 53); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(Main.DiscoR, 203, 103); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(53, Main.DiscoG, 255); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(150, Main.DiscoG, 255); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(60, Main.DiscoG, 190); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(255, Main.DiscoG, 155); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = new Color(255, Main.DiscoG, 0); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); + if (item.type == ModContent.ItemType()) + nameLine.overrideColor = CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 3f); + #endregion } #endregion - #region Accessory Modifier Display + #region Stealth Accessory Prefixes Display if (item.accessory) { if (!item.social && item.prefix > 0) @@ -1252,18 +1250,7 @@ namespace CalamityMod.Items } #endregion - /*if (item.ammo == 97) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria") - { - if (line2.Name == "Damage") - line2.text = ""; - } - } - }*/ - + #region Vanilla Item Tooltip Edits if (item.type == ItemID.CobaltSword || item.type == ItemID.CobaltNaginata) { foreach (TooltipLine line2 in tooltips) @@ -3022,8 +3009,10 @@ Grants immunity to fire blocks, and temporary immunity to lava"; } } } + #endregion - if (item.type < ItemID.Count) + #region Mod Mechanic Tooltips + if (item.type < ItemID.Count) return; // TODO -- mod references should be kept statically @@ -3069,6 +3058,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; TooltipLine line = new TooltipLine(mod, "CalamityDev", CalamityUtils.ColorMessage("- Developer Item -", new Color(255, 0, 255))); tooltips.Add(line); } + #endregion } #endregion diff --git a/Items/LoreItems/KnowledgeOldDuke.cs b/Items/LoreItems/KnowledgeOldDuke.cs index 80b9725a20..367946eac9 100644 --- a/Items/LoreItems/KnowledgeOldDuke.cs +++ b/Items/LoreItems/KnowledgeOldDuke.cs @@ -20,8 +20,7 @@ namespace CalamityMod.Items.LoreItems { item.width = 20; item.height = 20; - item.rare = 10; - item.Calamity().postMoonLordRarity = 13; + item.Calamity().customRarity = CalamityRarity.PureGreen; item.consumable = false; } diff --git a/Items/Placeables/Furniture/AuricToilet.cs b/Items/Placeables/Furniture/AuricToilet.cs index dd31366603..1f2a57b496 100644 --- a/Items/Placeables/Furniture/AuricToilet.cs +++ b/Items/Placeables/Furniture/AuricToilet.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Items.Placeables.FurnitureSilva; using CalamityMod.Tiles.Furniture; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { @@ -24,10 +25,10 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); - item.Calamity().postMoonLordRarity = 15; + item.Calamity().customRarity = CalamityRarity.Violet; } public override void AddRecipes() diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 60fc55a6aa..600a0e2a37 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Tools item.shoot = ModContent.ProjectileType(); item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/TreasureBags/FleshyGeodeT2.cs b/Items/TreasureBags/FleshyGeodeT2.cs index 78e34a3617..7c17a95cac 100644 --- a/Items/TreasureBags/FleshyGeodeT2.cs +++ b/Items/TreasureBags/FleshyGeodeT2.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Items.TreasureBags item.consumable = true; item.width = 24; item.height = 24; - item.rare = 11; - item.Calamity().postMoonLordRarity = 12; + item.Calamity().customRarity = CalamityRarity.Turquoise; } public override bool CanRightClick() => true; @@ -33,8 +32,8 @@ namespace CalamityMod.Items.TreasureBags int coreMax = !Main.expertMode ? 3 : 4; int bloodstoneMin = !Main.expertMode ? 50 : 60; int bloodstoneMax = !Main.expertMode ? 60 : 70; - int lifeAlloyChance = !Main.expertMode ? 2 : 1; - int coreofCalChance = !Main.expertMode ? 3 : 2; + int lifeAlloyChance = !Main.expertMode ? 2 : 1; + int coreofCalChance = !Main.expertMode ? 3 : 2; DropHelper.DropItem(player, ModContent.ItemType(), barMin, barMax); DropHelper.DropItem(player, ModContent.ItemType(), barMin, barMax); DropHelper.DropItem(player, ModContent.ItemType(), barMin, barMax); diff --git a/Items/Weapons/Magic/BlushieStaff.cs b/Items/Weapons/Magic/BlushieStaff.cs index f15bebd67b..fce8e7f7ca 100644 --- a/Items/Weapons/Magic/BlushieStaff.cs +++ b/Items/Weapons/Magic/BlushieStaff.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic item.magic = true; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Magic/Fabstaff.cs b/Items/Weapons/Magic/Fabstaff.cs index 56119266e7..f63c97e4f1 100644 --- a/Items/Weapons/Magic/Fabstaff.cs +++ b/Items/Weapons/Magic/Fabstaff.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic item.knockBack = 5f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.UseSound = SoundID.Item60; diff --git a/Items/Weapons/Magic/Judgement.cs b/Items/Weapons/Magic/Judgement.cs index ee5ed442af..64d7e15ad4 100644 --- a/Items/Weapons/Magic/Judgement.cs +++ b/Items/Weapons/Magic/Judgement.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 14f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 6a6cdd625e..67959f65a8 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -28,13 +28,13 @@ namespace CalamityMod.Items.Weapons.Magic item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; - item.rare = 5; - item.value = Item.buyPrice(0, 36, 0, 0); item.UseSound = SoundID.Item92; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index e277392e5b..26c1366cdc 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -33,17 +33,12 @@ namespace CalamityMod.Items.Weapons.Magic item.UseSound = SoundID.Item88; item.autoReuse = true; item.height = 62; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); - item.Calamity().customRarity = CalamityRarity.ItemSpecific; - } - /*public override Vector2? HoldoutOrigin() - { - return new Vector2(30, 30); - }*/ + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = ItemRarityID.Yellow; + } public override bool AltFunctionUse(Player player) { diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index 880d873644..332f98b66f 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -26,13 +26,13 @@ namespace CalamityMod.Items.Weapons.Magic item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.UseSound = SoundID.Item46; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index 6a0ea37e81..0fec6c9b3f 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -29,11 +29,11 @@ namespace CalamityMod.Items.Weapons.Magic item.noUseGraphic = true; item.channel = true; item.knockBack = 0f; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 30f; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index 29848a0dd8..90d316d672 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -30,10 +30,10 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 4.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.rare = 7; - item.value = Item.buyPrice(0, 60, 0, 0); item.shootSpeed = 14f; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = ItemRarityID.Lime; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 579ae2ba81..0b8f4faaa6 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -31,9 +31,9 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 102; item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; - item.value = Item.buyPrice(0, 80, 0, 0); + + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = ItemRarityID.Yellow; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Melee/CosmicDischarge.cs b/Items/Weapons/Melee/CosmicDischarge.cs index 24f867a7e9..41eb5b6edd 100644 --- a/Items/Weapons/Melee/CosmicDischarge.cs +++ b/Items/Weapons/Melee/CosmicDischarge.cs @@ -32,11 +32,11 @@ namespace CalamityMod.Items.Weapons.Melee item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 0.5f; item.UseSound = SoundID.Item122; - item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = 10; item.shootSpeed = 24f; item.shoot = ModContent.ProjectileType(); - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.Calamity().customRarity = CalamityRarity.DarkBlue; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 17221e995b..cadaa44d0e 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 14f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index ecc42e6001..9444e0c53c 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 3ef308ccbb..2296711bd5 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = CalamityGlobalItem.Rarity15BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.Violet; item.Calamity().devItem = true; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 7cbf27ee38..1cdcf1af99 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -5,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class InsidiousImpaler : ModItem + public class InsidiousImpaler : ModItem { public override void SetStaticDefaults() { @@ -28,13 +28,13 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 70; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index 157eb4465c..5a1e3f75e5 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 15f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index b08f99ac9b..5ec1b8cf86 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 20; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index 20e3ab1745..0693a323dc 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 25f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 2ef34ea002..50f2f2e93b 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -28,14 +28,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 0.15f; - item.value = Item.buyPrice(0, 60, 0, 0); - item.rare = 7; item.UseSound = SoundID.Item5; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.useAmmo = AmmoID.Arrow; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = ItemRarityID.Lime; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index 8f32f81420..7ad7f1d945 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = AmmoID.Arrow; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 3fcfca294d..b2cb333539 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.UseSound = SoundID.Item11; item.autoReuse = true; item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = AmmoID.Bullet; + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override Vector2? HoldoutOffset() @@ -51,12 +51,12 @@ namespace CalamityMod.Items.Weapons.Ranged dust.velocity = Vector2.Normalize(new Vector2(speedX, speedY)).RotatedByRandom(MathHelper.ToRadians(15f)); dust.noGravity = true; } - if (player.Calamity().soundCooldown <= 0) - { - // WoF vomit sound. - Main.PlaySound(SoundID.NPCKilled, (int)position.X, (int)position.Y, 13, 0.5f, 0f); - player.Calamity().soundCooldown = 120; - } + if (player.Calamity().soundCooldown <= 0) + { + // WoF vomit sound. + Main.PlaySound(SoundID.NPCKilled, (int)position.X, (int)position.Y, 13, 0.5f, 0f); + player.Calamity().soundCooldown = 120; + } return false; } return true; diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index 65429ec98a..dfa7c4c4de 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.noMelee = true; item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.Calamity().postMoonLordRarity = 14; + item.Calamity().customRarity = CalamityRarity.DarkBlue; item.Calamity().donorItem = true; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index 3f786a8c67..55b5fc6d18 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -9,8 +9,8 @@ namespace CalamityMod.Items.Weapons.Ranged { public class PristineFury : ModItem { - public int frameCounter = 0; - public int frame = 0; + public int frameCounter = 0; + public int frame = 0; public static int BaseDamage = 89; public override void SetStaticDefaults() @@ -33,14 +33,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; - item.value = CalamityGlobalItem.Rarity12BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; item.UseSound = SoundID.Item34; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 11f; item.useAmmo = AmmoID.Gel; + + item.value = CalamityGlobalItem.Rarity12BuyPrice; + item.Calamity().customRarity = CalamityRarity.Turquoise; } public override Vector2? HoldoutOffset() => new Vector2(-25, -10); @@ -66,39 +66,39 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - int flameAmt = 3; - for (int index = 0; index < flameAmt; ++index) - { - float SpeedX = speedX + Main.rand.NextFloat(-1.25f, 1.25f); - float SpeedY = speedY + Main.rand.NextFloat(-1.25f, 1.25f); - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI); - } + int flameAmt = 3; + for (int index = 0; index < flameAmt; ++index) + { + float SpeedX = speedX + Main.rand.NextFloat(-1.25f, 1.25f); + float SpeedY = speedY + Main.rand.NextFloat(-1.25f, 1.25f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI); + } } else { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } - return false; + return false; } - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); - spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), Color.White, 0f, origin, scale, SpriteEffects.None, 0); - return false; - } + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + return false; + } - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - return false; - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFuryGlow"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFuryGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } } } diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index f806265a32..035acb62f7 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -31,13 +31,13 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; - item.rare = 5; - item.value = Item.buyPrice(0, 36, 0, 0); - item.Calamity().customRarity = CalamityRarity.ItemSpecific; item.UseSound = SoundID.Item11; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 11f; + + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index e2b77f45dc..7ea6a5e2a1 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -26,13 +26,13 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.UseSound = SoundID.Item10; item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 49bb06ea28..aebcda9712 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = AmmoID.Bullet; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 9e9c2e6f8a..be0b0dc2bf 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.knockBack = 3.5f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.UseSound = SoundID.Item31; diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index 1a0dc3a40c..5809e39e40 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -27,14 +27,15 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; - item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.Calamity().postMoonLordRarity = 14; - item.Calamity().customRarity = CalamityRarity.DarkBlue; item.UseSound = SoundID.Item11; item.autoReuse = true; item.shootSpeed = 24f; item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Rocket; + + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.Calamity().donorItem = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index d0d3138ce0..8658d3268b 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -37,9 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.UseSound = SoundID.Item61; + item.value = CalamityGlobalItem.Rarity7BuyPrice; - item.rare = 7; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.rare = ItemRarityID.Lime; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index cfcb3d6e5a..5f71157b97 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -30,12 +30,12 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 58; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = ItemRarityID.Yellow; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Rogue/NanoblackReaperRogue.cs b/Items/Weapons/Rogue/NanoblackReaperRogue.cs index 6b3e16316b..37ad191a29 100644 --- a/Items/Weapons/Rogue/NanoblackReaperRogue.cs +++ b/Items/Weapons/Rogue/NanoblackReaperRogue.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item18; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index d9ab474a43..49275ba1d2 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index e7cb9c541d..990d98c0e3 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -28,12 +28,12 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 18f; item.Calamity().rogue = true; + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index fbd9a6aa4e..dcc5758db5 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon item.noMelee = true; item.UseSound = SoundID.Item68; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index 866f867f01..6e87d89ebe 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -26,11 +26,11 @@ namespace CalamityMod.Items.Weapons.Summon item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4f; - item.value = Item.buyPrice(1, 40, 0, 0); - item.Calamity().postMoonLordRarity = 13; - item.rare = 10; item.UseSound = SoundID.NPCDeath13; item.shoot = ModContent.ProjectileType(); + + item.value = CalamityGlobalItem.Rarity13BuyPrice; + item.Calamity().customRarity = CalamityRarity.PureGreen; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 10d09ad935..41146953db 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Cold Divinity"); Tooltip.SetDefault("Legendary Drop\n" + - "Summons the power of the ancient ice castle\n" + - "For each minion slot used, you will gain an additional orbiting shield spike\n" + - "These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage\n" + - "They take some time to regenerate after launching themselves at the target, however\n" + - "On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding\n" + - "Revengeance Drop"); + "Summons the power of the ancient ice castle\n" + + "For each minion slot used, you will gain an additional orbiting shield spike\n" + + "These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage\n" + + "They take some time to regenerate after launching themselves at the target, however\n" + + "On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding\n" + + "Revengeance Drop"); } public override void SetDefaults() @@ -33,29 +33,29 @@ namespace CalamityMod.Items.Weapons.Summon item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 4.5f; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; item.UseSound = SoundID.Item30; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.summon = true; + + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; } public override void ModifyTooltips(List list) { - if (CalamityWorld.death) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip7") - { - line2.text = "Provides heat and cold protection in Death Mode when in use\n" + - "Revengeance Drop"; - } - } - } + if (CalamityWorld.death) + { + foreach (TooltipLine line2 in list) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip7") + { + line2.text = "Provides heat and cold protection in Death Mode when in use\n" + + "Revengeance Drop"; + } + } + } } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Summon/CosmicViperEngine.cs b/Items/Weapons/Summon/CosmicViperEngine.cs index 709b16a50a..a92f6e0380 100644 --- a/Items/Weapons/Summon/CosmicViperEngine.cs +++ b/Items/Weapons/Summon/CosmicViperEngine.cs @@ -27,14 +27,14 @@ namespace CalamityMod.Items.Weapons.Summon item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 6f; - item.value = Item.buyPrice(2, 50, 0, 0); item.UseSound = SoundID.Item15; //phaseblade sound effect item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.summon = true; - item.rare = 10; - item.Calamity().postMoonLordRarity = 14; + + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.Calamity().customRarity = CalamityRarity.DarkBlue; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index b25b79381f..3755c66cce 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon item.shootSpeed = 10f; item.value = CalamityGlobalItem.Rarity16BuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; } diff --git a/Items/Weapons/Summon/PrototypeAndromechaRing.cs b/Items/Weapons/Summon/PrototypeAndromechaRing.cs index 53f3dc8fe3..2308e0f276 100644 --- a/Items/Weapons/Summon/PrototypeAndromechaRing.cs +++ b/Items/Weapons/Summon/PrototypeAndromechaRing.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Summon item.knockBack = 1f; item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; - item.Calamity().customRarity = CalamityRarity.ItemSpecific; + item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; item.UseSound = SoundID.Item117; diff --git a/Utilities/Enums.cs b/Utilities/Enums.cs index e0a63026cb..eac03fd75d 100644 --- a/Utilities/Enums.cs +++ b/Utilities/Enums.cs @@ -10,7 +10,6 @@ namespace CalamityMod public enum CalamityRarity { - ItemSpecific = -1, NoEffect = 0, Turquoise = 12, PureGreen = 13,