diff --git a/Buffs/Alcohol/Trippy.cs b/Buffs/Alcohol/Trippy.cs index e791bdd796..21b5357e8e 100644 --- a/Buffs/Alcohol/Trippy.cs +++ b/Buffs/Alcohol/Trippy.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions.Alcohol; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol { public class Trippy : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(OddMushroom.DamageBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/CalciumBuff.cs b/Buffs/Potions/CalciumBuff.cs index 0a55b80590..5ec698247a 100644 --- a/Buffs/Potions/CalciumBuff.cs +++ b/Buffs/Potions/CalciumBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class CalciumBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(CalciumPotion.KnockbackResistance.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/PhotosynthesisBuff.cs b/Buffs/Potions/PhotosynthesisBuff.cs index 202952cb86..db53347ad2 100644 --- a/Buffs/Potions/PhotosynthesisBuff.cs +++ b/Buffs/Potions/PhotosynthesisBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class PhotosynthesisBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(PhotosynthesisPotion.IncreasedHeartHeal); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/ShadowBuff.cs b/Buffs/Potions/ShadowBuff.cs index 0244cb7c0b..d06152f5f2 100644 --- a/Buffs/Potions/ShadowBuff.cs +++ b/Buffs/Potions/ShadowBuff.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class ShadowBuff : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(ShadowPotion.StealthRegenBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/Buffs/Potions/Soaring.cs b/Buffs/Potions/Soaring.cs index bb5e481442..a9a75af3c5 100644 --- a/Buffs/Potions/Soaring.cs +++ b/Buffs/Potions/Soaring.cs @@ -1,10 +1,14 @@ -using Terraria; +using CalamityMod.Items.Potions; +using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { public class Soaring : ModBuff { + public override LocalizedText Description => base.Description.WithFormatArgs(SoaringPotion.FlightBoost.ToPercent()); + public override void SetStaticDefaults() { Main.debuff[Type] = false; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c2dee18d27..92b6fc5472 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -29,6 +29,8 @@ using CalamityMod.Items.Dyes; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; using CalamityMod.Items.PermanentBoosters; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -234,7 +236,6 @@ namespace CalamityMod.CalPlayer public int profanedSoulWeaponType = 0; public int hurtSoundTimer = 0; public int danceOfLightCharge = 0; - public int shadowPotCooldown = 0; public int dogTextCooldown = 0; public float auralisStealthCounter = 0f; public int auralisAuroraCounter = 0; @@ -2398,7 +2399,6 @@ namespace CalamityMod.CalPlayer planarSpeedBoost = 0; galileoCooldown = 0; soundCooldown = 0; - shadowPotCooldown = 0; dogTextCooldown = 0; auralisStealthCounter = 0f; auralisAuroraCounter = 0; @@ -3966,16 +3966,16 @@ namespace CalamityMod.CalPlayer knockback.Flat += item.knockBack * ((1f - modStealth) * 0.5f); if (whiskey) - knockback.Flat += item.knockBack * 0.2f; + knockback.Flat += item.knockBack * Whiskey.KnockbackBoost; if (tequila && Main.dayTime) - knockback += item.knockBack * 0.1f; + knockback += item.knockBack * Tequila.KnockbackBoost; if (tequilaSunrise && Main.dayTime) - knockback += item.knockBack * 0.2f; + knockback += item.knockBack * TequilaSunrise.KnockbackBoost; if (moscowMule) - knockback += item.knockBack * 0.5f; + knockback += item.knockBack * MoscowMule.KnockbackBoost; if (titanHeartMask && rogue) knockback += item.knockBack * 0.05f; @@ -4851,8 +4851,8 @@ namespace CalamityMod.CalPlayer if (shadow) { - stealthGenStandstill += 0.08f; - stealthGenMoving += 0.08f; + stealthGenStandstill += ShadowPotion.StealthRegenBoost; + stealthGenMoving += ShadowPotion.StealthRegenBoost; } if (eArtifact) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 7d69d07af4..2729765d0f 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -20,6 +20,8 @@ using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Mounts; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -627,7 +629,7 @@ namespace CalamityMod.CalPlayer if (screwdriver) { if (proj.penetrate > 1 || proj.penetrate == -1) - modifiers.ScalingBonusDamage += 0.05f; + modifiers.ScalingBonusDamage += Screwdriver.PiercingDamageBuff; } // Calamity buffs Inferno Fork by 20%. This is multiplicative because it's supposed to be a buff to the weapon's base damage. @@ -1663,6 +1665,10 @@ namespace CalamityMod.CalPlayer #region Modify Hurt public override void ModifyHurt(ref Player.HurtModifiers modifiers) { + // Calcium Potion knockback reduction + if (calcium) + modifiers.Knockback *= (1f - CalciumPotion.KnockbackResistance); + // Handles energy shields and Boss Rush, in that order modifiers.ModifyHurtInfo += ModifyHurtInfo_Calamity; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index bd1a2c6012..e1961cd604 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -6,6 +6,8 @@ using CalamityMod.Buffs.Placeables; using CalamityMod.Cooldowns; using CalamityMod.Enums; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; @@ -177,14 +179,12 @@ namespace CalamityMod.CalPlayer if (vodka) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Vodka.RegenLoss; } if (redWine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; - if (baguette) - totalNegativeLifeRegen += 3; + totalNegativeLifeRegen += baguette ? Baguette.RedWineBuffedRegenLoss : RedWine.RegenLoss; } if (grapeBeer) { @@ -193,7 +193,7 @@ namespace CalamityMod.CalPlayer if (moonshine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Moonshine.RegenLoss; } if (rum) { @@ -206,7 +206,7 @@ namespace CalamityMod.CalPlayer if (fireball) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Fireball.RegenLoss; } if (whiskey) { @@ -215,27 +215,27 @@ namespace CalamityMod.CalPlayer if (everclear) { alcoholPoisonLevel += 2; - totalNegativeLifeRegen += 10; + totalNegativeLifeRegen += Everclear.RegenLoss; } if (bloodyMary) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 4; + totalNegativeLifeRegen += BloodyMary.RegenLoss; } if (tequila) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Tequila.RegenLoss; } if (tequilaSunrise) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 2; + totalNegativeLifeRegen += TequilaSunrise.RegenLoss; } if (screwdriver) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Screwdriver.RegenLoss; } if (caribbeanRum) { @@ -252,27 +252,27 @@ namespace CalamityMod.CalPlayer if (margarita) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += Margarita.RegenLoss; } if (starBeamRye) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 2; + totalNegativeLifeRegen += StarBeamRye.RegenLoss; } if (moscowMule) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 4; + totalNegativeLifeRegen += MoscowMule.RegenLoss; } if (whiteWine) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += WhiteWine.RegenLoss; } if (evergreenGin) { alcoholPoisonLevel++; - totalNegativeLifeRegen += 1; + totalNegativeLifeRegen += EvergreenGin.RegenLoss; } if (Player.tipsy) { @@ -615,10 +615,10 @@ namespace CalamityMod.CalPlayer public override void UpdateLifeRegen() { if (rum) - Player.lifeRegen += 2; + Player.lifeRegen += Rum.RegenBoost; if (caribbeanRum) - Player.lifeRegen += 2; + Player.lifeRegen += CaribbeanRum.RegenBoost; if (aChicken) Player.lifeRegen += 1; @@ -769,8 +769,7 @@ namespace CalamityMod.CalPlayer if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) { bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; - bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity; - bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime; + bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || aAmpoule || purity; // Divides all negative life regen by two before applying any other effects. if (anyStandingStillLifeRegen && Player.lifeRegen < 0) @@ -779,7 +778,7 @@ namespace CalamityMod.CalPlayer // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1; + int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : aAmpoule ? 228 : purity ? 187 : -1; bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool() : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { @@ -795,16 +794,15 @@ namespace CalamityMod.CalPlayer } // Actually apply "standing still" regeneration (the stats are granted even at full health) - float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; // 4 = vanilla Shiny Stone - int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1; + int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : -1; if (turboRegenPower > 0) { // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. - // Photosynthesis Potion does not do this at night. - if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f && !onlyPhotosynthesisAtNight) + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f) Player.lifeRegenTime = 1800f; Player.lifeRegen += turboRegenPower; @@ -841,9 +839,9 @@ namespace CalamityMod.CalPlayer if (Player.statLife < actualMaxLife) { // The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following: - // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Photosynthesis Potion buff or The Camper. + // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, or The Camper. int baseLifeRegenBoost = 4; - bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || photosynthesis || camper) && + bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper) && Player.StandingStill() && Player.itemAnimation == 0; if (!noLifeRegenCap) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3dc6810f86..212aebbfb9 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1582,8 +1582,6 @@ namespace CalamityMod.CalPlayer dragonRageCooldown--; if (soundCooldown > 0) soundCooldown--; - if (shadowPotCooldown > 0) - shadowPotCooldown--; if (raiderCritLifespan > 0f) raiderCritLifespan--; if (raiderSoundCooldown > 0) @@ -2138,10 +2136,6 @@ namespace CalamityMod.CalPlayer } } - // Calcium Potion buff - if (calcium) - Player.noFallDmg = true; - // Ceaseless Hunger Potion buff if (ceaselessHunger) { @@ -2824,7 +2818,7 @@ namespace CalamityMod.CalPlayer if (astralInjection) { if (Player.statMana < Player.statManaMax2) - Player.statMana += 2; + Player.statMana += AstralInjection.ManaPerFrame; if (Player.statMana > Player.statManaMax2) Player.statMana = Player.statManaMax2; } @@ -2980,38 +2974,38 @@ namespace CalamityMod.CalPlayer Player.moveSpeed -= 0.2f; if (fabsolVodka) - Player.GetDamage() += 0.08f; + Player.GetDamage() += FabsolsVodka.DamageBoost; if (vodka) { - Player.GetDamage() += 0.06f; + Player.GetDamage() += Vodka.DamageBoost; Player.GetCritChance() += Vodka.CritBoost; } if (moonshine) { - Player.statDefense += 10; - Player.endurance += 0.03f; + Player.statDefense += Moonshine.DefenseBoost; + Player.endurance += Moonshine.DamageReductionBoost; } if (rum) - Player.moveSpeed += 0.1f; + Player.moveSpeed += Rum.MoveSpeedBoost; if (whiskey) { - Player.GetDamage() += 0.04f; + Player.GetDamage() += Whiskey.DamageBoost; Player.GetCritChance() += Whiskey.CritBoost; } if (everclear) - Player.GetDamage() += 0.25f; + Player.GetDamage() += Everclear.DamageBoost; if (bloodyMary) { if (Main.bloodMoon) { - Player.GetDamage() += 0.1f; - Player.moveSpeed += 0.1f; + Player.GetDamage() += BloodyMary.DamageMovementBoost; + Player.moveSpeed += BloodyMary.DamageMovementBoost; } } @@ -3019,7 +3013,7 @@ namespace CalamityMod.CalPlayer { if (Main.dayTime) { - Player.statDefense += 5; + Player.statDefense += Tequila.DefenseBoost; Player.GetCritChance() += Tequila.CritBoost; } } @@ -3028,13 +3022,13 @@ namespace CalamityMod.CalPlayer { if (Main.dayTime) { - Player.statDefense += 10; + Player.statDefense += TequilaSunrise.DefenseBoost; Player.GetCritChance() += TequilaSunrise.CritBoost; } } if (caribbeanRum) - Player.moveSpeed += 0.1f; + Player.moveSpeed += CaribbeanRum.MoveSpeedBoost; if (cinnamonRoll) { @@ -3044,19 +3038,19 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { - Player.GetDamage() += 0.08f; - Player.manaCost *= 0.9f; - Player.statManaMax2 += 50; + Player.GetDamage() += StarBeamRye.MagicDamageBoost; + Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); + Player.statManaMax2 += StarBeamRye.MaxManaBoost; } if (moscowMule) { - Player.GetDamage() += 0.09f; + Player.GetDamage() += MoscowMule.DamageBoost; Player.GetCritChance() += MoscowMule.CritBoost; } if (whiteWine) - Player.GetDamage() += 0.08f; + Player.GetDamage() += WhiteWine.MagicDamageBoost; // Adjustment to the Tipsy debuff if (Player.tipsy) @@ -3113,7 +3107,7 @@ namespace CalamityMod.CalPlayer (reaverSpeed ? 0.1 : 0D) + (angelTreads ? 0.1 : 0D) + (blueCandle ? CirrusBlueCandleBuff.WingTimeBoost : 0D) + - (soaring ? 0.1 : 0D) + + (soaring ? SoaringPotion.FlightBoost : 0D) + (prismaticGreaves ? 0.1 : 0D) + (plagueReaper ? 0.05 : 0D) + (ascendantInsignia ? 0.05 : 0D) + // Added to soaring insignia's flight to get 30% @@ -3169,9 +3163,8 @@ namespace CalamityMod.CalPlayer if (bounding) { - Player.jumpSpeedBoost += 0.25f; - Player.jumpHeight += 10; - Player.extraFall += 25; + Player.jumpSpeedBoost += BoundingPotion.JumpSpeedBoost; + Player.jumpHeight += (int)(BoundingPotion.JumpHeightPercentBoost * 15); } if (mushy) @@ -3513,7 +3506,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() *= 1.2f; if (trippy) - Player.GetDamage() += 0.5f; + Player.GetDamage() += OddMushroom.DamageBoost; if (eArtifact) { @@ -4263,37 +4256,37 @@ namespace CalamityMod.CalPlayer if (fabsolVodka) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * FabsolsVodka.DefenseLossPercent); } if (vodka) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Vodka.DefenseLossPercent); } if (grapeBeer) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.03); + Player.statDefense -= (int)(Player.statDefense * GrapeBeer.DefenseLossPercent); } if (rum) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Rum.DefenseLossPercent); } if (whiskey) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.05); + Player.statDefense -= (int)(Player.statDefense * Whiskey.DefenseLossPercent); } if (everclear) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.3); + Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent); } if (bloodyMary) @@ -4301,38 +4294,38 @@ namespace CalamityMod.CalPlayer if (Main.bloodMoon) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.04); + Player.statDefense -= (int)(Player.statDefense * BloodyMary.DefenseLossPercent); } } if (caribbeanRum) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.1); + Player.statDefense -= (int)(Player.statDefense * CaribbeanRum.DefenseLossPercent); } if (cinnamonRoll) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.1); + Player.statDefense -= (int)(Player.statDefense * CinnamonRoll.DefenseLossPercent); } if (margarita) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * Margarita.DefenseLossPercent); } if (starBeamRye) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * StarBeamRye.DefenseLossPercent); } if (whiteWine) { if (Player.statDefense > 0) - Player.statDefense -= (int)(Player.statDefense * 0.06); + Player.statDefense -= (int)(Player.statDefense * WhiteWine.DefenseLossPercent); } if (Player.tipsy) @@ -4607,7 +4600,7 @@ namespace CalamityMod.CalPlayer if (item.type == ModContent.ItemType()) CalamityUtils.ConsumeItemViaQuickBuff(Player, item, HadalStew.BuffType, HadalStew.BuffDuration, true); if (item.type == ModContent.ItemType()) - CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, Margarita.BuffDuration, false); + CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, CalamityUtils.MinutesToFrames(Margarita.MinuteDuration), false); } } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 3f38b9a195..00c96499f5 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -524,21 +524,6 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI, 0f, 0f); } - if (soaring && !targetIsDummy) - { - double useTimeMultiplier = 0.85 + (item.useTime * item.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost - double wingTimeFraction = Player.wingTimeMax / 20D; - - // TODO -- this scaling function is probably totally screwed. What is it supposed to do? - double meleeStatMultiplier = (double)(Player.GetTotalDamage().Additive * (float)(Player.GetTotalCritChance() / 10f)); - - if (Player.wingTime < Player.wingTimeMax) - Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); - - if (Player.wingTime > Player.wingTimeMax) - Player.wingTime = Player.wingTimeMax; - } - if (bloodflareMelee && item.CountsAsClass() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) bloodflareMeleeHits++; } @@ -643,20 +628,6 @@ namespace CalamityMod.CalPlayer if (proj.IsTrueMelee()) { - if (soaring && !targetIsDummy) - { - double useTimeMultiplier = 0.85 + (heldItem.useTime * heldItem.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost - double wingTimeFraction = Player.wingTimeMax / 20D; - - // TODO -- this scaling function is probably totally screwed. What is it supposed to do? - double meleeStatMultiplier = (double)(Player.GetTotalDamage().Additive * (float)(Player.GetTotalCritChance() / 10f)); - - if (Player.wingTime < Player.wingTimeMax) - Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); - - if (Player.wingTime > Player.wingTimeMax) - Player.wingTime = Player.wingTimeMax; - } if (hideOfDeus && hideOfDeusTimer == 0) { hideOfDeusTimer = 10; @@ -1061,16 +1032,6 @@ namespace CalamityMod.CalPlayer } } - if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 3) - { - int randrot = Main.rand.Next(-30, 391); - Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); - int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f); - if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].DamageType = DamageClass.Generic; - shadowPotCooldown = 30; - } - if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a228313cb1..80e2cfab7a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -7,6 +7,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Magic; @@ -598,7 +599,7 @@ namespace CalamityMod.Items bool boostedHeart = player.Calamity().photosynthesis; if (boostedHeart) { - player.HealPlayer(5); + player.HealPlayer(PhotosynthesisPotion.IncreasedHeartHeal); } } return true; @@ -1474,7 +1475,7 @@ namespace CalamityMod.Items float moveSpeedBoost = modPlayer.moveSpeedBonus * 0.1f; float flightSpeedMult = 1f + - (modPlayer.soaring ? 0.1f : 0f) + + (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + (modPlayer.reaverSpeed ? 0.1f : 0f) + moveSpeedBoost; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index c9bfa18d8c..3382a33487 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -764,16 +764,16 @@ namespace CalamityMod.Items // Frog Leg and all upgrades get clear explanations of what they actually do. if (item.type == ItemID.FrogLeg) - EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); + EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); if (item.type == ItemID.FrogFlipper || item.type == ItemID.FrogWebbing) - EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); if (item.type == ItemID.FrogGear) - EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.VanillaFrogLegJumpSpeedBoost * 20f))); + EditTooltipByNum(2, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.VanillaFrogLegJumpSpeedBoost.ToJumpSpeedPercent())); if (item.type == ItemID.AmphibianBoots) - EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format((int)(BalancingConstants.AmphibianBootsJumpSpeedBoost * 20f))); + EditTooltipByNum(1, (line) => line.Text = GetEditedTooltip("FrogLeg").Format(BalancingConstants.AmphibianBootsJumpSpeedBoost.ToJumpSpeedPercent())); // Soaring Insignia nerf and clear explanation of what it actually does. if (item.type == ItemID.EmpressFlightBooster) diff --git a/Items/Potions/Alcohol/BloodyMary.cs b/Items/Potions/Alcohol/BloodyMary.cs index 3a05e66424..1da4570be2 100644 --- a/Items/Potions/Alcohol/BloodyMary.cs +++ b/Items/Potions/Alcohol/BloodyMary.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class BloodyMary : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageMovementBoost = 0.1f; + public static int RegenLoss = 4; + public static float DefenseLossPercent = 0.04f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageMovementBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(20, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(20, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/CaribbeanRum.cs b/Items/Potions/Alcohol/CaribbeanRum.cs index 67b3449640..f2c945f402 100644 --- a/Items/Potions/Alcohol/CaribbeanRum.cs +++ b/Items/Potions/Alcohol/CaribbeanRum.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class CaribbeanRum : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RegenBoost = 2; + public static float MoveSpeedBoost = 0.1f; + public static float DefenseLossPercent = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -22,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(14, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/CinnamonRoll.cs b/Items/Potions/Alcohol/CinnamonRoll.cs index 1270088e04..1f8ddbcbd1 100644 --- a/Items/Potions/Alcohol/CinnamonRoll.cs +++ b/Items/Potions/Alcohol/CinnamonRoll.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class CinnamonRoll : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float HeatDebuffBoost = 0.5f; + public static float DefenseLossPercent = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +27,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Items/Potions/Alcohol/Everclear.cs b/Items/Potions/Alcohol/Everclear.cs index 2ca6759049..fe3fc5721b 100644 --- a/Items/Potions/Alcohol/Everclear.cs +++ b/Items/Potions/Alcohol/Everclear.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Everclear : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageBoost = 0.25f; + public static int RegenLoss = 10; + public static float DefenseLossPercent = 0.30f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 42, ModContent.BuffType(), CalamityUtils.SecondsToFrames(60f), true); + Item.DefaultToFood(14, 42, ModContent.BuffType(), CalamityUtils.MinutesToFrames(1), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index 6fcc5f841a..8860ba8c7e 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class EvergreenGin : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float SicknessWaterDebuffBoost = 0.25f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + SicknessWaterDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -22,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/FabsolsVodka.cs b/Items/Potions/Alcohol/FabsolsVodka.cs index 86d5a08d52..258199b35c 100644 --- a/Items/Potions/Alcohol/FabsolsVodka.cs +++ b/Items/Potions/Alcohol/FabsolsVodka.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -12,6 +13,10 @@ namespace CalamityMod.Items.Potions.Alcohol { public new string LocalizationCategory => "Items.Potions"; + public static float DamageBoost = 0.08f; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -25,7 +30,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(30, 42, ModContent.BuffType(), CalamityUtils.SecondsToFrames(900f), true); + Item.DefaultToFood(30, 42, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index e7f9f76d24..9256f82e69 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class Fireball : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float HeatDebuffBoost = 0.25f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + HeatDebuffBoost).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +27,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(16, 38, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(16, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 5b6c7928f4..8d09cabb05 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class GrapeBeer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DefenseLossPercent = 0.03f; + public static int SecondDuration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), SecondDuration); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -29,7 +35,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void OnConsumeItem(Player player) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); } } } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index 30a6730df0..5c1f303342 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,8 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Margarita : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + public static int BuffType = ModContent.BuffType(); - public static int BuffDuration = 10800; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 1; + public static int MinuteDuration = 3; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond(), MinuteDuration); public override void SetStaticDefaults() { @@ -32,7 +37,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void OnConsumeItem(Player player) { - player.AddBuff(BuffType, BuffDuration); + player.AddBuff(BuffType, CalamityUtils.MinutesToFrames(MinuteDuration)); } } } diff --git a/Items/Potions/Alcohol/Moonshine.cs b/Items/Potions/Alcohol/Moonshine.cs index ca4b665233..dbb903feb1 100644 --- a/Items/Potions/Alcohol/Moonshine.cs +++ b/Items/Potions/Alcohol/Moonshine.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Moonshine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int DefenseBoost = 10; + public static float DamageReductionBoost = 0.03f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DefenseBoost, DamageReductionBoost.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -22,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Items/Potions/Alcohol/MoscowMule.cs b/Items/Potions/Alcohol/MoscowMule.cs index ee5e40e3e7..d679852c11 100644 --- a/Items/Potions/Alcohol/MoscowMule.cs +++ b/Items/Potions/Alcohol/MoscowMule.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,7 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class MoscowMule : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 3; + + public static float DamageBoost = 0.09f; + public static float KnockbackBoost = 0.5f; + public static int CritBoost = 3; + public static int RegenLoss = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, RegenLoss.ToRegenPerSecond()); public override void SetStaticDefaults() { @@ -24,7 +30,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(32, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(32, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Items/Potions/Alcohol/OddMushroom.cs b/Items/Potions/Alcohol/OddMushroom.cs index 1c3472f24d..c51fe1cc0f 100644 --- a/Items/Potions/Alcohol/OddMushroom.cs +++ b/Items/Potions/Alcohol/OddMushroom.cs @@ -9,6 +9,9 @@ namespace CalamityMod.Items.Potions.Alcohol public class OddMushroom : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float DamageBoost = 0.5f; + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +24,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(38, 50, ModContent.BuffType(), CalamityUtils.SecondsToFrames(3600f)); + Item.DefaultToFood(38, 50, ModContent.BuffType(), CalamityUtils.MinutesToFrames(60)); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 10); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/OldFashioned.cs b/Items/Potions/Alcohol/OldFashioned.cs index ae0dd709d6..c6b3f043be 100644 --- a/Items/Potions/Alcohol/OldFashioned.cs +++ b/Items/Potions/Alcohol/OldFashioned.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(30, 38, ModContent.BuffType(), CalamityUtils.SecondsToFrames(360f), true); + Item.DefaultToFood(30, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index e1a185a15b..dda993af15 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class RedWine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int HealValue = 200; + public static int RegenLoss = 1; + public static int SecondDuration = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenLoss.ToRegenPerSecond(), SecondDuration); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToHealingPotion(14, 48, 200); + Item.DefaultToHealingPotion(14, 48, HealValue); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; @@ -29,12 +36,12 @@ namespace CalamityMod.Items.Potions.Alcohol public override void GetHealLife(Player player, bool quickHeal, ref int healValue) { - healValue = player.Calamity().baguette ? 250 : 200; + healValue = player.Calamity().baguette ? Baguette.RedWineBuffedHealValue : HealValue; } public override void OnConsumeItem(Player player) { - player.AddBuff(ModContent.BuffType(), 900); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(SecondDuration)); } } } diff --git a/Items/Potions/Alcohol/Rum.cs b/Items/Potions/Alcohol/Rum.cs index 8b06e8ca63..242f902bb8 100644 --- a/Items/Potions/Alcohol/Rum.cs +++ b/Items/Potions/Alcohol/Rum.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Rum : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RegenBoost = 2; + public static float MoveSpeedBoost = 0.1f; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RegenBoost.ToRegenPerSecond(), MoveSpeedBoost.ToPercent(), DefenseLossPercent.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +28,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(24, 26, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(24, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/Screwdriver.cs b/Items/Potions/Alcohol/Screwdriver.cs index 4a472c629c..0efa0d15c7 100644 --- a/Items/Potions/Alcohol/Screwdriver.cs +++ b/Items/Potions/Alcohol/Screwdriver.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions.Alcohol public class Screwdriver : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float PiercingDamageBuff = 0.05f; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((1f + PiercingDamageBuff).ToString(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +27,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(14, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); Item.rare = ItemRarityID.LightPurple; diff --git a/Items/Potions/Alcohol/StarBeamRye.cs b/Items/Potions/Alcohol/StarBeamRye.cs index 28a963686a..4843b084f2 100644 --- a/Items/Potions/Alcohol/StarBeamRye.cs +++ b/Items/Potions/Alcohol/StarBeamRye.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,6 +10,14 @@ namespace CalamityMod.Items.Potions.Alcohol public class StarBeamRye : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int MaxManaBoost = 50; + public static float MagicDamageBoost = 0.08f; + public static float ManaCostReduction = 0.1f; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent(), ManaCostReduction.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -22,7 +31,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(20, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(20, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 80); Item.rare = ItemRarityID.Lime; diff --git a/Items/Potions/Alcohol/Tequila.cs b/Items/Potions/Alcohol/Tequila.cs index 77cf945a86..3f37dbef16 100644 --- a/Items/Potions/Alcohol/Tequila.cs +++ b/Items/Potions/Alcohol/Tequila.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,7 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Tequila : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 4; + + public static float KnockbackBoost = 0.1f; + public static int CritBoost = 4; + public static int DefenseBoost = 5; + public static int RegenLoss = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); public override void SetStaticDefaults() { @@ -23,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(16, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(16, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/TequilaSunrise.cs b/Items/Potions/Alcohol/TequilaSunrise.cs index 52f9a4a1e7..e3447a3ca3 100644 --- a/Items/Potions/Alcohol/TequilaSunrise.cs +++ b/Items/Potions/Alcohol/TequilaSunrise.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,7 +10,13 @@ namespace CalamityMod.Items.Potions.Alcohol public class TequilaSunrise : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 8; + + public static float KnockbackBoost = 0.2f; + public static int CritBoost = 8; + public static int DefenseBoost = 10; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackBoost.ToPercent(), CritBoost, DefenseBoost, RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -22,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(22, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(22, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(gold: 1); Item.rare = ItemRarityID.Yellow; diff --git a/Items/Potions/Alcohol/Vodka.cs b/Items/Potions/Alcohol/Vodka.cs index 819f19c56f..15ceee8de1 100644 --- a/Items/Potions/Alcohol/Vodka.cs +++ b/Items/Potions/Alcohol/Vodka.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,7 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Vodka : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 2; + + public static float DamageBoost = 0.06f; + public static int CritBoost = 2; + public static int RegenLoss = 1; + public static float DefenseLossPercent = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, RegenLoss.ToRegenPerSecond(), DefenseLossPercent.ToPercent()); public override void SetStaticDefaults() { @@ -23,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 36, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(14, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); Item.rare = ItemRarityID.LightPurple; diff --git a/Items/Potions/Alcohol/Whiskey.cs b/Items/Potions/Alcohol/Whiskey.cs index 08439d4a39..266eb72018 100644 --- a/Items/Potions/Alcohol/Whiskey.cs +++ b/Items/Potions/Alcohol/Whiskey.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -9,7 +10,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class Whiskey : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - internal static readonly int CritBoost = 2; + + public static float DamageBoost = 0.04f; + public static float KnockbackBoost = 0.2f; + public static int CritBoost = 2; + public static float DefenseLossPercent = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), KnockbackBoost.ToPercent(), CritBoost, DefenseLossPercent.ToPercent()); public override void SetStaticDefaults() { @@ -23,7 +29,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(18, 32, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.LightRed; diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index a011a932a2..6670d64617 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.GameInput; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions.Alcohol @@ -10,6 +11,12 @@ namespace CalamityMod.Items.Potions.Alcohol public class WhiteWine : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float MagicDamageBoost = 0.08f; + public static float DefenseLossPercent = 0.06f; + public static int RegenLoss = 2; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), DefenseLossPercent.ToPercent(), RegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -23,7 +30,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetDefaults() { - Item.DefaultToFood(14, 44, ModContent.BuffType(), CalamityUtils.SecondsToFrames(300f), true); + Item.DefaultToFood(14, 44, ModContent.BuffType(), CalamityUtils.MinutesToFrames(5), true); Item.healMana = 300; // Cirrus overcharges: 10% sell value instead of 20% Item.value = Item.sellPrice(silver: 40); diff --git a/Items/Potions/AnechoicCoating.cs b/Items/Potions/AnechoicCoating.cs index bc876056a2..cb8c122a7e 100644 --- a/Items/Potions/AnechoicCoating.cs +++ b/Items/Potions/AnechoicCoating.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { // How do you even use this? - Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.SecondsToFrames(240f)); + Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(4)); Item.UseSound = SoundID.Item3; Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 59ca31b05b..e2bbfbc188 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -11,6 +12,11 @@ namespace CalamityMod.Items.Potions public class AstralInjection : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int ManaPerFrame = 2; + public static int SelfDamage = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ManaPerFrame * 60, SelfDamage); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 30; @@ -22,7 +28,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(14, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(5f), true); + Item.DefaultToFood(14, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(5), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Lime; } @@ -30,10 +36,10 @@ namespace CalamityMod.Items.Potions public override void OnConsumeItem(Player player) { player.AddBuff(BuffID.ManaSickness, Player.manaSickTime / 2, true); - player.statLife -= 5; + player.statLife -= SelfDamage; if (Main.myPlayer == player.whoAmI) { - player.HealEffect(-5, true); + player.HealEffect(-SelfDamage, true); } if (player.statLife <= 0) { diff --git a/Items/Potions/AureusCell.cs b/Items/Potions/AureusCell.cs index 5d03d2eacb..5878710f40 100644 --- a/Items/Potions/AureusCell.cs +++ b/Items/Potions/AureusCell.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { // Eating animation but gulp sound? Sure - Item.DefaultToFood(22, 38, BuffID.MagicPower, CalamityUtils.SecondsToFrames(360f)); + Item.DefaultToFood(22, 38, BuffID.MagicPower, CalamityUtils.MinutesToFrames(8)); Item.healMana = 200; Item.UseSound = SoundID.Item3; Item.value = Item.sellPrice(silver: 50); // Based on material cost rather than potion cost diff --git a/Items/Potions/Baguette.cs b/Items/Potions/Baguette.cs index df1038ef1c..0009eb0f1c 100644 --- a/Items/Potions/Baguette.cs +++ b/Items/Potions/Baguette.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Potions public class Baguette : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int RedWineBuffedHealValue = 250; + public static int RedWineBuffedRegenLoss = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RedWineBuffedHealValue, RedWineBuffedRegenLoss.ToRegenPerSecond()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 5; @@ -21,7 +27,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(52, 38, BuffID.WellFed, CalamityUtils.SecondsToFrames(300f)); + Item.DefaultToFood(52, 38, BuffID.WellFed, CalamityUtils.MinutesToFrames(5)); Item.value = Item.sellPrice(silver: 1); Item.rare = ItemRarityID.Blue; Item.Calamity().donorItem = true; diff --git a/Items/Potions/BlasphemousDonut.cs b/Items/Potions/BlasphemousDonut.cs index 44f4d3c1d2..994ceb77fa 100644 --- a/Items/Potions/BlasphemousDonut.cs +++ b/Items/Potions/BlasphemousDonut.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions } public override void SetDefaults() { - Item.DefaultToFood(40, 26, BuffID.WellFed2, CalamityUtils.SecondsToFrames(3600f)); + Item.DefaultToFood(40, 26, BuffID.WellFed2, CalamityUtils.MinutesToFrames(60)); Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/BoundingPotion.cs b/Items/Potions/BoundingPotion.cs index db489e51e4..a5906281fa 100644 --- a/Items/Potions/BoundingPotion.cs +++ b/Items/Potions/BoundingPotion.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Potions public class BoundingPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float JumpSpeedBoost = 0.25f; + public static float JumpHeightPercentBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(JumpSpeedBoost.ToJumpSpeedPercent(), JumpHeightPercentBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; @@ -21,7 +27,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(26, 38, ModContent.BuffType(), CalamityUtils.SecondsToFrames(300f), true); + Item.DefaultToFood(26, 38, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Potions/CalciumPotion.cs b/Items/Potions/CalciumPotion.cs index 672a6e1f67..407672f6bc 100644 --- a/Items/Potions/CalciumPotion.cs +++ b/Items/Potions/CalciumPotion.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Potions public class CalciumPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float KnockbackResistance = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(KnockbackResistance.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; @@ -21,15 +26,15 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(18, 30, ModContent.BuffType(), CalamityUtils.SecondsToFrames(1200f), true); + Item.DefaultToFood(18, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Blue; } public override void AddRecipes() { - CreateRecipe(4). - AddIngredient(ItemID.BottledWater, 4). + CreateRecipe(). + AddIngredient(ItemID.BottledWater). AddIngredient(). AddTile(TileID.Bottles). Register() diff --git a/Items/Potions/CeaselessHungerPotion.cs b/Items/Potions/CeaselessHungerPotion.cs index 78fb605f52..625751c603 100644 --- a/Items/Potions/CeaselessHungerPotion.cs +++ b/Items/Potions/CeaselessHungerPotion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(22, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(10f), true); + Item.DefaultToFood(22, 32, ModContent.BuffType(), CalamityUtils.SecondsToFrames(20), true); Item.value = Item.sellPrice(silver: 10); Item.rare = ModContent.RarityType(); } @@ -37,8 +37,8 @@ namespace CalamityMod.Items.Potions AddConsumeItemCallback(Recipe.ConsumptionRules.Alchemy). Register(); - CreateRecipe(4). - AddIngredient(ItemID.BottledWater, 4). + CreateRecipe(8). + AddIngredient(ItemID.BottledWater, 8). AddIngredient(10). AddIngredient(). AddTile(TileID.AlchemyTable). diff --git a/Items/Potions/DeliciousMeat.cs b/Items/Potions/DeliciousMeat.cs index f03920f06f..779c5e8f18 100644 --- a/Items/Potions/DeliciousMeat.cs +++ b/Items/Potions/DeliciousMeat.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Potions } public override void SetDefaults() { - Item.DefaultToFood(32, 30, BuffID.WellFed2, CalamityUtils.SecondsToFrames(1800f)); + Item.DefaultToFood(32, 30, BuffID.WellFed2, CalamityUtils.MinutesToFrames(30)); Item.value = Item.buyPrice(silver: 50); // Sold by Archmage Item.rare = ItemRarityID.Pink; } diff --git a/Items/Potions/Fabsoup.cs b/Items/Potions/Fabsoup.cs index e532b991b1..91e98d12c6 100644 --- a/Items/Potions/Fabsoup.cs +++ b/Items/Potions/Fabsoup.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Potions public override void UseItemFrame(Player player) { - int time = CalamityUtils.SecondsToFrames(1980f); // 33 minutes + int time = CalamityUtils.MinutesToFrames(33); if (player.itemAnimation == 180) { player.AddBuff(BuffID.WellFed3, time); diff --git a/Items/Potions/FlaskOfBrimstone.cs b/Items/Potions/FlaskOfBrimstone.cs index 69610c0c06..885fed71c6 100644 --- a/Items/Potions/FlaskOfBrimstone.cs +++ b/Items/Potions/FlaskOfBrimstone.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(1200f), true); + Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/FlaskOfCrumbling.cs b/Items/Potions/FlaskOfCrumbling.cs index c0ee5ce802..6f358b0230 100644 --- a/Items/Potions/FlaskOfCrumbling.cs +++ b/Items/Potions/FlaskOfCrumbling.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(32, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(1200f), true); + Item.DefaultToFood(32, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/FlaskOfHolyFlames.cs b/Items/Potions/FlaskOfHolyFlames.cs index 7c2d8e958d..bb4f4c46e8 100644 --- a/Items/Potions/FlaskOfHolyFlames.cs +++ b/Items/Potions/FlaskOfHolyFlames.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(44, 36, ModContent.BuffType(), CalamityUtils.SecondsToFrames(1200f), true); + Item.DefaultToFood(44, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(20), true); Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.Purple; } diff --git a/Items/Potions/GravityNormalizerPotion.cs b/Items/Potions/GravityNormalizerPotion.cs index 7397185372..e95b3e3898 100644 --- a/Items/Potions/GravityNormalizerPotion.cs +++ b/Items/Potions/GravityNormalizerPotion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(24, 36, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(24, 36, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Lime; } diff --git a/Items/Potions/HadalStew.cs b/Items/Potions/HadalStew.cs index 04082b6d5a..a724a51365 100644 --- a/Items/Potions/HadalStew.cs +++ b/Items/Potions/HadalStew.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Items.Potions { public new string LocalizationCategory => "Items.Potions"; public static int BuffType = BuffID.WellFed2; - public static int BuffDuration = 60 * 3600; - public static int SicknessDuration = 50 * 60; + public static int BuffDuration = CalamityUtils.MinutesToFrames(60); + public static int SicknessDuration = CalamityUtils.SecondsToFrames(50); public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(BuffDuration / 3600); public override void SetStaticDefaults() diff --git a/Items/Potions/PhotosynthesisPotion.cs b/Items/Potions/PhotosynthesisPotion.cs index 49ada46832..f1dbcd15c1 100644 --- a/Items/Potions/PhotosynthesisPotion.cs +++ b/Items/Potions/PhotosynthesisPotion.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Potions public class PhotosynthesisPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static int IncreasedHeartHeal = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(IncreasedHeartHeal); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; @@ -22,7 +27,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(30, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/PotionofOmniscience.cs b/Items/Potions/PotionofOmniscience.cs index a17b98283c..bc71eddfa1 100644 --- a/Items/Potions/PotionofOmniscience.cs +++ b/Items/Potions/PotionofOmniscience.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(28, 30, ModContent.BuffType(), CalamityUtils.SecondsToFrames(900f), true); + Item.DefaultToFood(28, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Orange; } diff --git a/Items/Potions/ShadowPotion.cs b/Items/Potions/ShadowPotion.cs index 8463f9dfb7..611ac1c8e6 100644 --- a/Items/Potions/ShadowPotion.cs +++ b/Items/Potions/ShadowPotion.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Potions public class ShadowPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float StealthRegenBoost = 0.08f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(StealthRegenBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; @@ -23,7 +28,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(20, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(480f), true); + Item.DefaultToFood(20, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Orange; } diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 58a57bdfaf..c89f575924 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Potions @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Potions public class SoaringPotion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; + + public static float FlightBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FlightBoost.ToPercent()); + public override void SetStaticDefaults() { Item.ResearchUnlockCount = 20; @@ -23,7 +28,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.SecondsToFrames(360f), true); + Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/SulphurskinPotion.cs b/Items/Potions/SulphurskinPotion.cs index 2d837ad3c8..82301ec02a 100644 --- a/Items/Potions/SulphurskinPotion.cs +++ b/Items/Potions/SulphurskinPotion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.SecondsToFrames(150f), true); + Item.DefaultToFood(22, 26, ModContent.BuffType(), CalamityUtils.MinutesToFrames(4), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.Green; } diff --git a/Items/Potions/ZenPotion.cs b/Items/Potions/ZenPotion.cs index 0c7dafcea5..905b6f831d 100644 --- a/Items/Potions/ZenPotion.cs +++ b/Items/Potions/ZenPotion.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.SecondsToFrames(900f), true); + Item.DefaultToFood(24, 28, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/ZergPotion.cs b/Items/Potions/ZergPotion.cs index 36bb9e4866..0d118409f3 100644 --- a/Items/Potions/ZergPotion.cs +++ b/Items/Potions/ZergPotion.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(24, 34, ModContent.BuffType(), CalamityUtils.SecondsToFrames(900f), true); + Item.DefaultToFood(24, 34, ModContent.BuffType(), CalamityUtils.MinutesToFrames(15), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 99fb0a30ba..be692ba91c 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -10,7 +10,7 @@ BloodyMaryBuff: { CaribbeanRumBuff: { DisplayName: Caribbean Rum - Description: Life regen, movement speed, and wing flight time increased, you are floaty and defense is reduced + Description: Life regen and movement speed increased, you are floaty and defense is reduced } CinnamonRollBuff: { @@ -60,7 +60,7 @@ MoscowMuleBuff: { OldFashionedBuff: { DisplayName: Old Fashioned - Description: Accessory and set bonus damage multiplied, damage reduced + Description: Non-weapon damage increased, weapon damage reduced } RedWineBuff: { @@ -95,7 +95,7 @@ TequilaSunriseBuff: { Trippy: { DisplayName: Trippy - Description: You see the world for what it truly is... and you also have a 50% increase to all damage + Description: You see the world for what it truly is... and you also have a {0}% increase to all damage } VodkaBuff: { @@ -550,12 +550,12 @@ BloodfinBoost: { BoundingBuff: { DisplayName: Bounding - Description: Increased jump height, jump speed, and fall damage resistance + Description: Increased jump speed and height } CalciumBuff: { DisplayName: Calcium - Description: You are immune to fall damage + Description: You take {0}% less knockback } CeaselessHunger: { @@ -565,7 +565,7 @@ CeaselessHunger: { GravityNormalizerBuff: { DisplayName: Gravity Normalizer - Description: Gravity is now normal in space, immunity to distorted + Description: Gravity is now normal in space, immunity to {$BuffName.VortexDebuff} } Omniscience: { @@ -575,7 +575,7 @@ Omniscience: { PhotosynthesisBuff: { DisplayName: Photosynthesis - Description: Life regen boosted, more during daytime, and hearts heal more HP + Description: Hearts heal {0} more HP } ShadowBuff: { @@ -583,18 +583,13 @@ ShadowBuff: { Description: ''' You are a shadow - Rogue weapons spawn projectiles on hit - 8% boosted stealth generation + {0}% increased stealth generation ''' } Soaring: { DisplayName: Soaring - Description: - ''' - 10% increased wing flight time and speed - True melee hits restore some wing flight time - ''' + Description: "{0}% increased wing flight time and speed" } SulphurskinBuff: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 32f960cfb7..bb567a265f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -5,12 +5,16 @@ AnechoicCoating: { AstralInjection: { DisplayName: Astral Injection - Tooltip: Gives mana sickness and hurts you when used, but you regenerate mana extremely quickly even while moving or casting spells + Tooltip: + ''' + Restores {0} mana per second + Lower your health by {1} and inflicts {$BuffName.ManaSickness} when used + ''' } AureusCell: { DisplayName: Aureus Cell - Tooltip: Grants increased mana regeneration and magic power + Tooltip: Grants the {$BuffName.MagicPower} and {$BuffName.ManaRegeneration} buffs } Baguette: { @@ -18,7 +22,7 @@ Baguette: { Tooltip: ''' {$CommonItemTooltip.MinorStats} - Red Wine heals 250 HP, but reduces life regen by 2 HP/s + Red Wine heals {0} HP, but reduces life regen by {1} HP/s [c/FCE391:'je suis Monte'] ''' } @@ -34,12 +38,12 @@ BlasphemousDonut: { BoundingPotion: { DisplayName: Bounding Potion - Tooltip: 5% increased jump speed, 25 extra blocks of fall damage resistance, and increased jump height + Tooltip: "{0}% increased jump speed and {1}% increased jump height" } CalciumPotion: { DisplayName: Calcium Potion - Tooltip: Grants immunity to fall damage + Tooltip: Grants {0}% knockback resistance } CeaselessHungerPotion: { @@ -82,7 +86,7 @@ FlaskOfHolyFlames: { GravityNormalizerPotion: { DisplayName: Gravity Normalizer Potion - Tooltip: Disables the low gravity of space and grants immunity to the distorted debuff + Tooltip: Disables the low gravity of space and grants immunity to the {$BuffName.VortexDebuff} debuff } HadalStew: { @@ -102,12 +106,7 @@ OmegaHealingPotion: { PhotosynthesisPotion: { DisplayName: Photosynthesis Potion - Tooltip: - ''' - Grants +0.5 HP/s life regen and accelerates natural life regen while not moving - This natural life regen effect is five times as strong during daytime - Dropped hearts heal more HP - ''' + Tooltip: Dropped hearts heal {0} more HP } PotionofOmniscience: { @@ -123,21 +122,15 @@ ShadowPotion: { DisplayName: Shadow Potion Tooltip: ''' + {0}% increased stealth generation Turns the player into a shadow with glowing eyes - Rogue weapons spawn projectiles on hit - 8% increased stealth generation Visual effects can be disabled with the Stealth Invisibility config ''' } SoaringPotion: { DisplayName: Soaring Potion - Tooltip: - ''' - 10% increased flight time and horizontal flight speed - Restores a fraction of your wing flight time after a true melee strike - The amount of flight time restored scales with your melee stats and weapon swing speed - ''' + Tooltip: "{0}% increased flight time and horizontal flight speed" } SulphurskinPotion: { @@ -170,8 +163,8 @@ BloodyMary: { DisplayName: Bloody Mary Tooltip: ''' - 10% increased damage and movement speed during a Blood Moon - Reduces life regen by 2 HP/s and defense by 4% + {0}% increased damage and movement speed during a Blood Moon + Reduces life regen by {1} HP/s and defense by {2} {$Common.AlcoholWarning} [c/B00BA5:'Extra spicy... and bloody!'] ''' @@ -181,8 +174,8 @@ CaribbeanRum: { DisplayName: Caribbean Rum Tooltip: ''' - Increases life regen by 1 HP/s, movement speed by 10% and wing flight time by 20% - Makes you floaty and reduces defense by 10% + Increases life regen by {0} HP/s, movement speed by {1}% + Makes you floaty and reduces defense by {2}% {$Common.AlcoholWarning} [c/B00BA5:'Why is the rum gone?'] ''' @@ -192,8 +185,8 @@ CinnamonRoll: { DisplayName: Cinnamon Roll Tooltip: ''' - Increases mana regeneration rate and multiplies all fire-based debuff damage by 1.5x - Reduces defense by 10% + Increases mana regeneration rate and multiplies all fire-based debuff damage by {0}x + Reduces defense by {1}% {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey with a touch of cream soda.'] ''' @@ -203,8 +196,8 @@ Everclear: { DisplayName: Everclear Tooltip: ''' - 25% increased damage - Reduces life regen by 5 HP/s and defense by 30% + {0}% increased damage + Reduces life regen by {1} HP/s and defense by {2}% Counts as 2 alcohols for Alcohol Poisoning {$Common.AlcoholWarning} [c/B00BA5:'This is the most potent booze I have, be careful with it.'] @@ -215,8 +208,8 @@ EvergreenGin: { DisplayName: Evergreen Gin Tooltip: ''' - Multiplies all sickness and water-related debuff damage by 1.25x - Reduces life regen by 0.5 HP/s + Multiplies all sickness and water-related debuff damage by {0}x + Reduces life regen by {1} HP/s {$Common.AlcoholWarning} [c/B00BA5:'It tastes like a Christmas tree, if you can imagine that.'] ''' @@ -226,7 +219,7 @@ FabsolsVodka: { DisplayName: Fabsol's Vodka Tooltip: ''' - 8% increased damage, but lowers defense by 5% + {0}% increased damage, but lowers defense by {1}% Increases immune time after being struck {$Common.AlcoholWarning} This magical liquor is highly sought by those with a refined palate @@ -237,8 +230,8 @@ Fireball: { DisplayName: Fireball Tooltip: ''' - Multiplies all fire-based debuff damage by 1.25x - Reduces life regen by 0.5 HP/s + Multiplies all fire-based debuff damage by {0}x + Reduces life regen by {1} HP/s {$Common.AlcoholWarning} [c/B00BA5:'A great-tasting cinnamon whiskey.'] ''' @@ -248,7 +241,7 @@ GrapeBeer: { DisplayName: Grape Beer Tooltip: ''' - Reduces defense by 3% for 15 seconds + Reduces defense by {0}% for {1} seconds {$Common.AlcoholWarning} [c/B00BA5:'This crap is abhorrent, but you might like it.'] ''' @@ -259,9 +252,9 @@ Margarita: { Tooltip: ''' Halves the duration of most harmful debuffs - Reduces defense by 6% and life regen by 0.5 HP/s + Reduces defense by {0}% and life regen by {1} HP/s {$Common.AlcoholWarning} - 3 minute duration + {2} minute duration [c/B00BA5:'One of the best drinks ever created, enjoy it while it lasts.'] ''' } @@ -270,8 +263,8 @@ Moonshine: { DisplayName: Moonshine Tooltip: ''' - Increases defense by 10 and damage reduction by 3% - Reduces life regen by 0.5 HP/s + Increases defense by {0} and damage reduction by {1}% + Reduces life regen by {2} HP/s {$Common.AlcoholWarning} [c/B00BA5:'This stuff is pretty strong, but I'm sure you can handle it.'] ''' @@ -281,8 +274,8 @@ MoscowMule: { DisplayName: Moscow Mule Tooltip: ''' - Increases damage by 9%, knockback by 50% and critical strike chance by 3% - Reduces life regen by 2 HP/s + Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% + Reduces life regen by {3} HP/s {$Common.AlcoholWarning} [c/B00BA5:'I once heard the copper mug can be toxic and I told 'em, 'listen, dummy, I'm already poisoning myself!''] ''' @@ -314,7 +307,7 @@ RedWine: { DisplayName: Red Wine Tooltip: ''' - Reduces life regen by 0.5 HP/s for 15 seconds + Reduces life regen by {0} HP/s for {1} seconds {$Common.AlcoholWarning} [c/B00BA5:'Too dry for my taste.'] ''' @@ -324,8 +317,8 @@ Rum: { DisplayName: Rum Tooltip: ''' - Increases life regen by 1 HP/s and movement speed by 10% - Reduces defense by 5% + Increases life regen by {0} HP/s and movement speed by {1}% + Reduces defense by {2}% {$Common.AlcoholWarning} [c/B00BA5:'Sweet and potent, just how I like it.'] ''' @@ -335,8 +328,8 @@ Screwdriver: { DisplayName: Screwdriver Tooltip: ''' - Multiplies piercing projectile damage by 1.05x - Reduces life regen by 0.5 HP/s + Multiplies piercing projectile damage by {0}x + Reduces life regen by {1} HP/s {$Common.AlcoholWarning} [c/B00BA5:'Do you have a screw loose?'] ''' @@ -346,9 +339,9 @@ StarBeamRye: { DisplayName: Star Beam Rye Tooltip: ''' - Increases max mana by 50, magic damage by 8%, - and reduces mana usage by 10% - Reduces defense by 6% and life regen by 1 HP/s + Increases max mana by {0}, magic damage by {1}%, + and reduces mana usage by {2}% + Reduces defense by {3}% and life regen by {4} HP/s {$Common.AlcoholWarning} [c/B00BA5:'Made from some stuff I found near the Astral Meteor crash site. Don't worry, it's safe, trust me...'] ''' @@ -358,8 +351,8 @@ Tequila: { DisplayName: Tequila Tooltip: ''' - Increases knockback by 10%, crit chance by 4% and defense by 5 during daytime - Reduces life regen by 0.5 HP/s + Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime + Reduces life regen by {3} HP/s {$Common.AlcoholWarning} [c/B00BA5:'Great for mixing up daytime drinks.'] ''' @@ -369,8 +362,8 @@ TequilaSunrise: { DisplayName: Tequila Sunrise Tooltip: ''' - Increases knockback by 20%, crit chance by 8% and defense by 10 during daytime - Reduces life regen by 1 HP/s + Increases knockback by {0}%, crit chance by {1}% and defense by {2} during daytime + Reduces life regen by {3} HP/s {$Common.AlcoholWarning} [c/B00BA5:'The greatest daytime drink I've ever had.'] ''' @@ -380,8 +373,8 @@ Vodka: { DisplayName: Vodka Tooltip: ''' - Increases damage by 6% and critical strike chance by 2% - Reduces life regen by 0.5 HP/s and defense by 5% + Increases damage by {0}% and critical strike chance by {1}% + Reduces life regen by {2} HP/s and defense by {3}% {$Common.AlcoholWarning} [c/B00BA5:'The number one alcohol for creating great mixed drinks.'] ''' @@ -391,8 +384,8 @@ Whiskey: { DisplayName: Whiskey Tooltip: ''' - Increases damage by 4%, knockback by 20% and critical strike chance by 2% - Reduces defense by 5% + Increases damage by {0}%, knockback by {1}% and critical strike chance by {2}% + Reduces defense by {3}% {$Common.AlcoholWarning} [c/B00BA5:'The burning sensation makes it tastier.'] ''' @@ -402,8 +395,8 @@ WhiteWine: { DisplayName: White Wine Tooltip: ''' - Increases magic damage by 8% - Reduces defense by 6% and life regen by 0.5 HP/s + Increases magic damage by {0}% + Reduces defense by {1}% and life regen by {2} HP/s {$Common.AlcoholWarning} [c/B00BA5:'I drank a full barrel of this stuff once in one night, I couldn't remember who I was the next day.'] ''' diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 2f06741f2e..90b7838760 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -14,6 +14,7 @@ using CalamityMod.Events; using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.Abyss; @@ -862,11 +863,11 @@ namespace CalamityMod.NPCs electricityDamageMult += 0.5; if (IncreasedHeatEffects_Fireball) - heatDamageMult += 0.25; + heatDamageMult += Fireball.HeatDebuffBoost; if (IncreasedHeatEffects_FlameWakerBoots) heatDamageMult += 0.25; if (IncreasedHeatEffects_CinnamonRoll) - heatDamageMult += 0.5; + heatDamageMult += CinnamonRoll.HeatDebuffBoost; if (IncreasedHeatEffects_HellfireTreads) heatDamageMult += 0.5; if (IncreasedHeatEffects_FlameWings) @@ -877,8 +878,8 @@ namespace CalamityMod.NPCs if (IncreasedSicknessAndWaterEffects_EvergreenGin) { - sicknessDamageMult += 0.25; - waterDamageMult += 0.25; + sicknessDamageMult += EvergreenGin.SicknessWaterDebuffBoost; + waterDamageMult += EvergreenGin.SicknessWaterDebuffBoost; } // Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code. diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 6ec6e5d93a..0b4f4acc7b 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -79,5 +79,10 @@ namespace CalamityMod /// NOTE: Modded translations are not loaded until after PostSetupContent.Caching the result is suggested. /// public static string GetTextValueFromModItem(string suffix) where T : ModItem => GetTextFromModItem(ModContent.ItemType(), suffix).ToString(); + + // Double-rounded for proper digit cutoffs + public static string ToRegenPerSecond(this int regen) => float.Parse((regen * 0.5f).ToString("N2")).ToString(); + public static string ToJumpSpeedPercent(this float boost) => float.Parse((boost * 20f).ToString("N2")).ToString(); + public static string ToPercent(this float percent) => float.Parse((percent * 100f).ToString("N4")).ToString(); } } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 27cb806879..2407103f72 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -205,6 +205,7 @@ namespace CalamityMod public static int SecondsToFrames(int seconds) => seconds * 60; public static int SecondsToFrames(float seconds) => (int)(seconds * 60); + public static int MinutesToFrames(int minutes) => minutes * 3600; public static bool WithinBounds(this int index, int cap) => index >= 0 && index < cap;