From d05b8406bae95bbac111665513e8062a66b81346 Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Sat, 29 Jan 2022 20:28:25 +0100 Subject: [PATCH 1/2] Combo reset on ice attunement for bb --- Items/Weapons/Melee/BiomeBlade.cs | 13 ++++++++++++- Items/Weapons/Melee/TrueBiomeBlade.cs | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/BiomeBlade.cs b/Items/Weapons/Melee/BiomeBlade.cs index 1103d1e8fe..22881e43ea 100644 --- a/Items/Weapons/Melee/BiomeBlade.cs +++ b/Items/Weapons/Melee/BiomeBlade.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public Attunement mainAttunement = null; public Attunement secondaryAttunement = null; public int Combo = 0; + public float ComboResetTimer = 0f; public int CanLunge = 1; #region stats @@ -222,6 +223,7 @@ namespace CalamityMod.Items.Weapons.Melee CanLunge = 1; + //Change the swords function based on its attunement if (mainAttunement == null) { @@ -244,7 +246,6 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement != null && mainAttunement.id != AttunementID.Cold) Combo = 0; - if (player.Calamity().mouseRight && CanUseItem(player) && player.whoAmI == Main.myPlayer && !Main.mapFullscreen) { //Don't shoot out a visual blade if you already have one out @@ -258,6 +259,15 @@ namespace CalamityMod.Items.Weapons.Melee } } + public override void UpdateInventory(Player player) + { + if (mainAttunement != null && mainAttunement.id == AttunementID.Cold && CanUseItem(player)) + ComboResetTimer -= 0.02f; //Make the combo counter get closer to being reset + + if (ComboResetTimer < 0) + Combo = 0; + } + public override bool CanUseItem(Player player) { return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && @@ -271,6 +281,7 @@ namespace CalamityMod.Items.Weapons.Melee int powerLungeCounter = 0; //Unused here + ComboResetTimer = 1f; return mainAttunement.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack, ref Combo, ref CanLunge, ref powerLungeCounter); } diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index a1691deffe..82ce2c043c 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public Attunement mainAttunement = null; public Attunement secondaryAttunement = null; public int Combo = 0; + public float ComboResetTimer = 0f; public int StoredLunges = 2; public int PowerLungeCounter = 0; @@ -284,6 +285,15 @@ namespace CalamityMod.Items.Weapons.Melee } } + public override void UpdateInventory(Player player) + { + if (mainAttunement != null && mainAttunement.id == AttunementID.Cold && CanUseItem(player)) + ComboResetTimer -= 0.02f; //Make the combo counter get closer to being reset + + if (ComboResetTimer < 0) + Combo = 0; + } + public override bool CanUseItem(Player player) { return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && @@ -300,6 +310,7 @@ namespace CalamityMod.Items.Weapons.Melee if (mainAttunement == null) return false; + ComboResetTimer = 1f; return mainAttunement.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack, ref Combo, ref StoredLunges, ref PowerLungeCounter); } From 10c0b4ab01b6019a05700d848da56b6f9bcb2d5d Mon Sep 17 00:00:00 2001 From: Phupperbat Date: Sun, 30 Jan 2022 02:17:20 -0500 Subject: [PATCH 2/2] Hardmode ore set recipes changes and Adamantite/Titanium Bars cost 4 ores per craft --- Utilities/CalamityRecipes.cs | 154 +++++++++++++++++++++++++++++++++-- 1 file changed, 148 insertions(+), 6 deletions(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index b37ec418a1..d10e6643ed 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -29,12 +29,12 @@ namespace CalamityMod public static void AddRecipes() { EditLeatherRecipe(); - EditPhoenixBlaster(); - EditFlamarang(); + EditPhoenixBlasterRecipe(); + EditFlamarangRecipe(); EditTerraBladeRecipe(); EditFireGauntletRecipe(); EditSpiritFlameRecipe(); - EditBeetleArmor(); + EditBeetleArmorRecipes(); EditGoblinArmySummonRecipe(); EditEvilBossSummonRecipes(); EditEarlyHardmodeRecipes(); @@ -46,6 +46,8 @@ namespace CalamityMod EditPhasesaberRecipes(); EditOpticStaffRecipe(); AstralAlternatives(); + EditTier3HardmodeOreRecipes(); + EditHardmodeOreSetRecipes(); AddPotionRecipes(); AddCookedFood(); @@ -149,7 +151,7 @@ namespace CalamityMod } // Change Phoenix Blaster's recipe to be consistent with literally every other weapon recipes in the game - private static void EditPhoenixBlaster() + private static void EditPhoenixBlasterRecipe() { List rec = Main.recipe.ToList(); rec.Where(x => x.createItem.type == ItemID.PhoenixBlaster).ToList().ForEach(s => @@ -169,7 +171,7 @@ namespace CalamityMod } // Change Flamarang's recipe to be consistent with literally every other weapon recipes in the game - private static void EditFlamarang() + private static void EditFlamarangRecipe() { List rec = Main.recipe.ToList(); rec.Where(x => x.createItem.type == ItemID.Flamarang).ToList().ForEach(s => @@ -264,7 +266,7 @@ namespace CalamityMod } // Change Beetle Armor recipes to have Turtle Armor at the top of them (my dreaded) - private static void EditBeetleArmor() + private static void EditBeetleArmorRecipes() { List rec = Main.recipe.ToList(); rec.Where(x => x.createItem.type == ItemID.BeetleHelmet).ToList().ForEach(s => @@ -460,6 +462,146 @@ namespace CalamityMod }); } + //Change the recipes to be like 1.4 + private static void EditTier3HardmodeOreRecipes() + { + List rec = Main.recipe.ToList(); + rec.Where(x => x.createItem.type == ItemID.AdamantiteBar || x.createItem.type == ItemID.TitaniumBar).ToList().ForEach(s => + { + s.requiredItem[0].stack = 4; + }); + } + + + //Change the recipes to be consistent on each tier and less cost for pickaxe. (I'm aware some recipes already have the proper recipe amounts but consider this futureproofing and laziness) + private static void EditHardmodeOreSetRecipes() + { + short MeleeHelm; + short RangedHelm; + short MagicHelm; + short Breastplate; + short Leggings; + short Pickaxe; + short Drill; + short Waraxe; + short Chainsaw; + short Sword; + short Glaive; + short Repeater; + + for (int HardmodeOre = 0; HardmodeOre < 6; HardmodeOre++) + { + switch (HardmodeOre) + { + case 1: + MeleeHelm = ItemID.CobaltHelmet; + RangedHelm = ItemID.CobaltMask; + MagicHelm = ItemID.CobaltHat; + Breastplate = ItemID.CobaltBreastplate; + Leggings = ItemID.CobaltLeggings; + Pickaxe = ItemID.CobaltPickaxe; + Drill = ItemID.CobaltDrill; + Waraxe = ItemID.CobaltWaraxe; + Chainsaw = ItemID.CobaltChainsaw; + Sword = ItemID.CobaltSword; + Glaive = ItemID.CobaltNaginata; + Repeater = ItemID.CobaltRepeater; + break; + + case 2: + MeleeHelm = ItemID.PalladiumMask; + RangedHelm = ItemID.PalladiumHelmet; + MagicHelm = ItemID.PalladiumHeadgear; + Breastplate = ItemID.PalladiumBreastplate; + Leggings = ItemID.PalladiumLeggings; + Pickaxe = ItemID.PalladiumPickaxe; + Drill = ItemID.PalladiumDrill; + Waraxe = ItemID.PalladiumWaraxe; + Chainsaw = ItemID.PalladiumChainsaw; + Sword = ItemID.PalladiumSword; + Glaive = ItemID.PalladiumPike; + Repeater = ItemID.PalladiumRepeater; + break; + + case 3: + MeleeHelm = ItemID.MythrilHelmet; + RangedHelm = ItemID.MythrilHat; + MagicHelm = ItemID.MythrilHood; + Breastplate = ItemID.MythrilChainmail; + Leggings = ItemID.MythrilGreaves; + Pickaxe = ItemID.MythrilPickaxe; + Drill = ItemID.MythrilDrill; + Waraxe = ItemID.MythrilWaraxe; + Chainsaw = ItemID.MythrilChainsaw; + Sword = ItemID.MythrilSword; + Glaive = ItemID.MythrilHalberd; + Repeater = ItemID.MythrilRepeater; + break; + + case 4: + MeleeHelm = ItemID.OrichalcumMask; + RangedHelm = ItemID.OrichalcumHelmet; + MagicHelm = ItemID.OrichalcumHeadgear; + Breastplate = ItemID.OrichalcumBreastplate; + Leggings = ItemID.OrichalcumLeggings; + Pickaxe = ItemID.OrichalcumPickaxe; + Drill = ItemID.OrichalcumDrill; + Waraxe = ItemID.OrichalcumWaraxe; + Chainsaw = ItemID.OrichalcumChainsaw; + Sword = ItemID.OrichalcumSword; + Glaive = ItemID.OrichalcumHalberd; + Repeater = ItemID.OrichalcumRepeater; + break; + + case 5: + MeleeHelm = ItemID.AdamantiteHelmet; + RangedHelm = ItemID.AdamantiteMask; + MagicHelm = ItemID.AdamantiteHeadgear; + Breastplate = ItemID.AdamantiteBreastplate; + Leggings = ItemID.AdamantiteLeggings; + Pickaxe = ItemID.AdamantitePickaxe; + Drill = ItemID.AdamantiteDrill; + Waraxe = ItemID.AdamantiteWaraxe; + Chainsaw = ItemID.AdamantiteChainsaw; + Sword = ItemID.AdamantiteSword; + Glaive = ItemID.AdamantiteGlaive; + Repeater = ItemID.AdamantiteRepeater; + break; + + default: + MeleeHelm = ItemID.TitaniumMask; + RangedHelm = ItemID.TitaniumHelmet; + MagicHelm = ItemID.TitaniumHeadgear; + Breastplate = ItemID.TitaniumBreastplate; + Leggings = ItemID.TitaniumLeggings; + Pickaxe = ItemID.TitaniumPickaxe; + Drill = ItemID.TitaniumDrill; + Waraxe = ItemID.TitaniumWaraxe; + Chainsaw = ItemID.TitaniumChainsaw; + Sword = ItemID.TitaniumSword; + Glaive = ItemID.TitaniumTrident; + Repeater = ItemID.TitaniumRepeater; + break; + } + List rec = Main.recipe.ToList(); + rec.Where(x => x.createItem.type == MeleeHelm || x.createItem.type == RangedHelm || x.createItem.type == MagicHelm || x.createItem.type == Waraxe || x.createItem.type == Glaive || + x.createItem.type == Pickaxe || x.createItem.type == Drill || x.createItem.type == Chainsaw || x.createItem.type == Sword || x.createItem.type == Repeater).ToList().ForEach(s => + { + s.requiredItem[0].stack = 12; + }); + + rec.Where(x => x.createItem.type == Breastplate).ToList().ForEach(s => + { + s.requiredItem[0].stack = 24; + }); + + rec.Where(x => x.createItem.type == Leggings).ToList().ForEach(s => + { + s.requiredItem[0].stack = 18; + }); + } + } + #region Astral Alternatives private static void AstralAlternatives() {