diff --git a/Backgrounds/SunkenSeaBurrowsBG0.png b/Backgrounds/SunkenSeaBurrowsBG0.png index 26ad2b3f50..21e7232442 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG0.png and b/Backgrounds/SunkenSeaBurrowsBG0.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG1.png b/Backgrounds/SunkenSeaBurrowsBG1.png index 452e46c78c..9756095977 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG1.png and b/Backgrounds/SunkenSeaBurrowsBG1.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG2.png b/Backgrounds/SunkenSeaBurrowsBG2.png index 3eb8e53eb6..21e7232442 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG2.png and b/Backgrounds/SunkenSeaBurrowsBG2.png differ diff --git a/Backgrounds/SunkenSeaBurrowsBG3.png b/Backgrounds/SunkenSeaBurrowsBG3.png index 13524864b4..55795c777e 100644 Binary files a/Backgrounds/SunkenSeaBurrowsBG3.png and b/Backgrounds/SunkenSeaBurrowsBG3.png differ diff --git a/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs index 8f7d2a9a30..a7d599d6c6 100644 --- a/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs +++ b/BiomeManagers/BestiaryCategories/AstralCaveDesert.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralCaveDesertIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/BiomeManagers/BestiaryCategories/AstralDesert.cs b/BiomeManagers/BestiaryCategories/AstralDesert.cs index 29b0a3f907..12450ebde2 100644 --- a/BiomeManagers/BestiaryCategories/AstralDesert.cs +++ b/BiomeManagers/BestiaryCategories/AstralDesert.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/BiomeManagers/BestiaryCategories/AstralUnderground.cs b/BiomeManagers/BestiaryCategories/AstralUnderground.cs index 42d924fd5b..0b3c7b2090 100644 --- a/BiomeManagers/BestiaryCategories/AstralUnderground.cs +++ b/BiomeManagers/BestiaryCategories/AstralUnderground.cs @@ -7,5 +7,6 @@ namespace CalamityMod.BiomeManagers.BestiaryCategories public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; } } diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 28c7af8b79..0fe1c1512f 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -90,6 +90,14 @@ namespace CalamityMod.Buffs player.Calamity().shine = true; } + // Star in a Bottle provides Mana Regeneration Potion effect and cancels out the usual effect if you don't have it + else if (type == BuffID.StarInBottle && !player.manaRegenBuff) + { + player.manaRegenBuff = true; + player.manaRegenDelayBonus -= 0.5f; + player.manaRegenBonus -= 10; + } + // Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely. else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense) { @@ -200,10 +208,6 @@ namespace CalamityMod.Buffs tip = tip.Replace("25", "15"); break; - case BuffID.LeafCrystal: - tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal"); - break; - case BuffID.MagicPower: tip = tip.Replace("20", "10"); break; @@ -249,10 +253,6 @@ namespace CalamityMod.Buffs tip = tip.Replace("25", "15"); break; - case BuffID.Warmth: - tip += "\n" + CalamityUtils.GetTextValue("Vanilla.BuffDescription.WarmthExtra"); - break; - case BuffID.WeaponImbueConfetti: tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.WeaponImbueConfetti"); break; diff --git a/Buffs/DamageOverTime/Daybroken.cs b/Buffs/DamageOverTime/Daybroken.cs index c8453011c4..81298bf7f4 100644 --- a/Buffs/DamageOverTime/Daybroken.cs +++ b/Buffs/DamageOverTime/Daybroken.cs @@ -26,13 +26,13 @@ namespace CalamityMod.Buffs.DamageOverTime player.Calamity().daybroken = true; } - internal static void DrawEffects(PlayerDrawSet drawInfo, bool reducedEffects) + internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; - if (Main.rand.Next(reducedEffects ? 8 : 4) < 3) + if (Main.rand.Next(4) < 3) { - Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, reducedEffects ? 175 : 100, default, reducedEffects ? 2f : 3f); + Dust solarDust = Dust.NewDustDirect(Player.position, Player.width, Player.height, DustID.OrangeTorch, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); solarDust.noGravity = true; solarDust.velocity *= 2.8f; solarDust.velocity.Y -= 0.5f; diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index 7008cead6a..dbdbef4d02 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -34,23 +34,23 @@ namespace CalamityMod.Buffs.DamageOverTime npc.Calamity().nightwither = true; } - internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false) + internal static void DrawEffects(PlayerDrawSet drawInfo) { Player Player = drawInfo.drawPlayer; - if (Main.rand.NextBool(hasDebuffResistance ? 4 : 2)) + if (Main.rand.NextBool(2)) { Vector2 Vect = new Vector2(0f, Main.rand.NextBool(4) ? -5f : -9f).RotatedByRandom(MathHelper.ToRadians(25f)) * Main.rand.NextFloat(0.1f, 1.9f); - CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, (hasDebuffResistance ? 0.4f : 0.8f), 15, 2f, 1.9f); + CritSpark spark = new CritSpark(Player.Calamity().RandomDebuffVisualSpot, Vect, Main.rand.NextBool() ? Color.Cyan : Color.Turquoise, Color.PaleTurquoise, 0.8f, 15, 2f, 1.9f); GeneralParticleHandler.SpawnParticle(spark); } - for (int i = 0; i < (hasDebuffResistance ? 1 : 2); i++) + for (int i = 0; i < 2; i++) { Vector2 dustCorner = Player.position - 2f * Vector2.One; Vector2 dustVel = Player.velocity + new Vector2(0f, Main.rand.NextFloat(-11f, -2f)); Dust moonDust = Dust.NewDustDirect(dustCorner, Player.width + 4, Player.height + 4, Main.rand.NextBool(4) ? 300 : 323, dustVel.X, dustVel.Y); moonDust.noGravity = true; - moonDust.scale = hasDebuffResistance ? Main.rand.NextFloat(0.3f, 0.3f) : Main.rand.NextFloat(0.5f, 0.5f); + moonDust.scale = Main.rand.NextFloat(0.5f, 0.5f); moonDust.alpha = 235; } } diff --git a/Buffs/Pets/ReaverOrbBuff.cs b/Buffs/Pets/ReaverOrbBuff.cs deleted file mode 100644 index 3be4f5a02b..0000000000 --- a/Buffs/Pets/ReaverOrbBuff.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Pets -{ - public class ReaverOrbBuff : ModBuff - { - public override void SetStaticDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - Main.buffNoSave[Type] = true; - //Main.persistentBuff[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - CalamityPlayer modPlayer = player.Calamity(); - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) - { - modPlayer.rOrb = true; - } - if (!modPlayer.rOrb) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } - } -} diff --git a/Buffs/Pets/ReaverOrbBuff.png b/Buffs/Pets/ReaverOrbBuff.png deleted file mode 100644 index 61a7e2e2d2..0000000000 Binary files a/Buffs/Pets/ReaverOrbBuff.png and /dev/null differ diff --git a/Buffs/StatBuffs/TarragonCloak.cs b/Buffs/StatBuffs/TarragonCloak.cs index bcd5138b3d..12e659b6e0 100644 --- a/Buffs/StatBuffs/TarragonCloak.cs +++ b/Buffs/StatBuffs/TarragonCloak.cs @@ -1,4 +1,5 @@ -using Terraria; +using CalamityMod.Items.Armor.Tarragon; +using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -7,8 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class TarragonCloak : ModBuff { - public static double ContactDamageReduction = 0.5D; - public override LocalizedText Description => base.Description.WithFormatArgs(ContactDamageReduction.ToPercent()); + public override LocalizedText Description => base.Description.WithFormatArgs(TarragonHeadMelee.CloakContactDamageReduction.ToPercent()); public override void SetStaticDefaults() { diff --git a/Buffs/Summon/AqueousHunterDroneBuff.cs b/Buffs/Summon/AqueousHunterDroneBuff.cs new file mode 100644 index 0000000000..292d0df8e0 --- /dev/null +++ b/Buffs/Summon/AqueousHunterDroneBuff.cs @@ -0,0 +1,12 @@ +using CalamityMod.Projectiles.DraedonsArsenal; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class AqueousHunterDroneBuff : BaseSummonBuff + { + protected override int MinionProjectileType => ModContent.ProjectileType(); + + protected override ref bool MinionBool => ref BuffModdedOwner.aqueousHunterDrone; + } +} diff --git a/Buffs/Summon/AqueousHunterDroneBuff.png b/Buffs/Summon/AqueousHunterDroneBuff.png new file mode 100644 index 0000000000..728c691251 Binary files /dev/null and b/Buffs/Summon/AqueousHunterDroneBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 39c9d00359..48d21ffb54 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -27,8 +27,10 @@ using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; using CalamityMod.Items.Armor.PlagueReaper; +using CalamityMod.Items.Armor.Prismatic; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.SnowRuffian; +using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.TitanHeart; using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; @@ -40,6 +42,7 @@ using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.DraedonsArsenal; @@ -68,12 +71,16 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; using Terraria.GameInput; +using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Graphics.Effects; +using Terraria.Net; +using static Terraria.Main; using static Terraria.ModLoader.ModContent; namespace CalamityMod.CalPlayer @@ -88,10 +95,6 @@ namespace CalamityMod.CalPlayer /// If true, there is an event actively occuring near the player. Solely used for preventing Silva Revive's cooldown from decreasing. public static bool areThereAnyDamnEvents = false; public float calamityBonusLuck = 0f; - /// Custom variable for tracking if the player has Potion Sickness. Used for adding Potion Sickness to the Cooldown Rack. - public bool potionSick = false; - /// Custom variable for tracking how long the player has had Potion Sickness. Solely used for triggering the aura effects of Life Jelly and its upgrades. - public int timePotionSick; public bool drawBossHPBar = true; public float stealthUIAlpha = 1f; public float SulphWaterUIOpacity = 1f; @@ -113,6 +116,7 @@ namespace CalamityMod.CalPlayer public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; public int hellbornShots = 0; + public int garandShots = 0; public int searedPanCounter = 0; public int searedPanTimer = 0; /// Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. @@ -123,8 +127,6 @@ namespace CalamityMod.CalPlayer public bool resetHeightandWidth = false; /// If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. public bool noLifeRegen = false; - public bool reducedDaybrokenDamage = false; - public bool reducedNightwitherDamage = false; public float ammoCost = 1f; public float healingPotionMultiplier = 1f; /// @@ -262,8 +264,8 @@ namespace CalamityMod.CalPlayer public int arsenalCooldown = 0; public int killModeCooldown = 0; public bool demonSwordKillMode = false; - public bool exaltedKillMode => (demonSwordKillMode && Player.ActiveItem().type == ModContent.ItemType()); - public bool devilsDevastationKillMode => (demonSwordKillMode && Player.ActiveItem().type == ModContent.ItemType()); + public bool exaltedKillMode => (demonSwordKillMode && Player.ActiveItem().type == ItemType()); + public bool devilsDevastationKillMode => (demonSwordKillMode && Player.ActiveItem().type == ItemType()); /// /// Tracks Dragoon Drizzlefish's "gel feed" mechanic in Get fixed boi.
/// Consuming Gel adds 1 to this counter, up to a maximum of 6, and using the weapon has a random chance to decrement the counter.
@@ -398,6 +400,9 @@ namespace CalamityMod.CalPlayer public bool canFireGodSlayerRangedProjectile = false; public bool canFireBloodflareMageProjectile = false; public bool canFireBloodflareRangedProjectile = false; + + public float WeakTimeFreezeUseTimer = 0; + public bool WeakTimeFreezeInUse = false; #endregion #region Sound @@ -658,6 +663,8 @@ namespace CalamityMod.CalPlayer public bool roverDrive = false; public bool roverDriveShieldVisible = false; + internal float roverDriveShieldPartialRechargeProgress = 0f; + internal bool playedRoverDriveShieldSound = false; // Lunic Corps shield is controlled by its armor set bool // Lunic Corps shield comes from an armor set and its visibility is non optional @@ -826,9 +833,6 @@ namespace CalamityMod.CalPlayer public bool lAmbergrisVisual = false; public bool tortShell = false; public bool absorber = false; - public bool alwaysHoneyRegen = false; - public float alwaysHoneyRegenAmount = 0; - public bool honeyTurboRegen = false; public bool honeyDewHalveDebuffs = false; public bool livingDewHalveDebuffs = false; public int jewelBonusDefense = 0; @@ -845,7 +849,6 @@ namespace CalamityMod.CalPlayer public bool aAmpoule = false; public bool rOoze = false; public float radiantOozeRegen = 0; - public float ambrosialAmpouleRegen = 0; public float purityRegen = 0; public bool fBarrier = false; public bool aBrain = false; @@ -882,6 +885,7 @@ namespace CalamityMod.CalPlayer public bool cleansingjelly = false; public bool GrandGelatin = false; public int CleansingEffect = 0; + public bool spawnedJellyAura = false; public bool community = false; public bool shatteredCommunity = false; public bool fleshTotem = false; @@ -1147,7 +1151,6 @@ namespace CalamityMod.CalPlayer /// Demonshade Greaves' movement speed boost. public bool shadowSpeed = false; public bool dsSetBonus = false; - public bool auricBoost = false; public bool auricSetMelee = false; public bool daedalusReflect = false; public bool daedalusSplit = false; @@ -1191,9 +1194,7 @@ namespace CalamityMod.CalPlayer public int silvaMageCooldown = 0; public bool silvaSummon = false; public bool hasSilvaEffect = false; - /// Constant variable representing the duration of Silva armor's revive, in frames. - public const int SilvaReviveDuration = 300; - public int silvaCountdown = SilvaReviveDuration; + public int silvaCountdown = SilvaArmor.ReviveDuration; public bool auricSet = false; public bool omegaBlueChestplate = false; public bool omegaBlueSet = false; @@ -1485,8 +1486,6 @@ namespace CalamityMod.CalPlayer public bool victideSnail = false; /// Hydrothermic armor's Vent. public bool cSpirit = false; - /// Reaver armor's Reaver Orb. - public bool rOrb = false; /// Daedalus armor's Daedalus Crystal. public bool dCrystal = false; public bool endoHydra = false; @@ -1521,6 +1520,7 @@ namespace CalamityMod.CalPlayer public bool starSwallowerPetFroge = false; public bool snakeEyes = false; public bool poleWarper = false; + public bool aqueousHunterDrone = false; public bool causticDragon = false; public bool plaguebringerPatronSummon = false; public bool howlTrio = false; @@ -2122,7 +2122,6 @@ namespace CalamityMod.CalPlayer silvaSummon = false; auricSet = false; - auricBoost = false; auricSetMelee = false; GemTechSet = false; @@ -2203,15 +2202,11 @@ namespace CalamityMod.CalPlayer lAmbergris = false; tortShell = false; absorber = false; - alwaysHoneyRegen = false; - alwaysHoneyRegenAmount = 0; - honeyTurboRegen = false; honeyDewHalveDebuffs = false; livingDewHalveDebuffs = false; aAmpoule = false; rOoze = false; radiantOozeRegen = 0; - ambrosialAmpouleRegen = 0; purityRegen = 0; fBarrier = false; aBrain = false; @@ -2249,6 +2244,7 @@ namespace CalamityMod.CalPlayer lifejelly = false; GrandGelatin = false; cleansingjelly = false; + spawnedJellyAura = false; community = false; shatteredCommunity = false; stressPills = false; @@ -2317,8 +2313,6 @@ namespace CalamityMod.CalPlayer CryoStoneVanity = false; voidField = false; copyrightInfringementShield = false; - reducedDaybrokenDamage = false; - reducedNightwitherDamage = false; daedalusReflect = false; daedalusSplit = false; @@ -2623,7 +2617,6 @@ namespace CalamityMod.CalPlayer astralProbe = false; victideSnail = false; cSpirit = false; - rOrb = false; dCrystal = false; MutatedTruffleBool = false; sandElemental = false; @@ -2677,6 +2670,7 @@ namespace CalamityMod.CalPlayer starSwallowerPetFroge = false; snakeEyes = false; poleWarper = false; + aqueousHunterDrone = false; causticDragon = false; plaguebringerPatronSummon = false; howlTrio = false; @@ -3096,13 +3090,12 @@ namespace CalamityMod.CalPlayer godSlayerThrowing = false; godSlayerDashHotKeyPressed = false; SpeedBlasterDashStarted = false; - auricBoost = false; auricSetMelee = false; silvaSet = false; silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = SilvaReviveDuration; + silvaCountdown = SilvaArmor.ReviveDuration; auricSet = false; GemTechSet = false; CobaltSet = false; @@ -3226,6 +3219,7 @@ namespace CalamityMod.CalPlayer flareGunOverheat = 0; hellbornShots = 0; lucreciaEnergy = 0; + garandShots = 0; searedPanCounter = 0; searedPanTimer = 0; potionTimer = 0; @@ -3297,7 +3291,7 @@ namespace CalamityMod.CalPlayer ascendantInsigniaBuffTime = 240; //4 seconds } - int numOfBlobs = Player.ownedProjectileCounts[ModContent.ProjectileType()]; + int numOfBlobs = Player.ownedProjectileCounts[ProjectileType()]; if (transformer && numOfBlobs > 0 && Main.myPlayer == Player.whoAmI && CalamityKeybinds.TransformerHotKey.JustPressed && transformerCooldown <= 0 && true) // Add check if projectiles are active { // Go fire all the blobs @@ -3308,7 +3302,7 @@ namespace CalamityMod.CalPlayer for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; - if (projectile.active && projectile.type == ModContent.ProjectileType()) + if (projectile.active && projectile.type == ProjectileType()) { projectile.localAI[0] = 5; } @@ -3622,7 +3616,7 @@ namespace CalamityMod.CalPlayer // Gael's Greatsword replaces Rage Mode with an uber skull attack if (!(Player.HasCooldown(Cooldowns.GaelsRage.ID)) && Player.ActiveItem().type == ItemType() && rage > 0f) { - SoundEngine.PlaySound(SilvaHeadSummon.DispelSound, Player.Center); + SoundEngine.PlaySound(SilvaArmor.DispelSound, Player.Center); for (int i = 0; i < 3; i++) Dust.NewDust(Player.position, 120, 120, DustID.Rain_BloodMoon, 0f, 0f, 100, default, 1.5f); @@ -3823,13 +3817,13 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - Player.AddBuff(BuffType(), 602, false); + Player.AddBuff(BuffType(), TarragonHeadMelee.CloakDuration, false); } } if (bloodflareRanged && !Player.HasCooldown(BloodflareRangedSet.ID)) { if (Player.whoAmI == Main.myPlayer) - Player.AddCooldown(BloodflareRangedSet.ID, 1800); + Player.AddCooldown(BloodflareRangedSet.ID, BloodflareHeadRanged.SoulCooldown); SoundEngine.PlaySound(BloodflareHeadRanged.ActivationSound, Player.Center); for (int d = 0; d < 64; d++) @@ -3853,8 +3847,8 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { var source = Player.GetSource_Misc("1"); - int damage = (int)(Player.GetTotalDamage().ApplyTo(300f)); - for (int i = 0; i < 16; i++) + int damage = (int)(Player.GetTotalDamage().ApplyTo(BloodflareHeadRanged.SoulDamage)); + for (int i = 0; i < BloodflareHeadRanged.SoulAmount; i++) { float ai1 = Main.rand.NextFloat() + 0.5f; Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f); @@ -3868,9 +3862,9 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer) { - Player.AddBuff(BuffType(), 300, false); + Player.AddBuff(BuffType(), OmegaBlueHelmet.MadnessDuration, false); } - Player.AddCooldown(OmegaBlue.ID, 1800); + Player.AddCooldown(OmegaBlue.ID, OmegaBlueHelmet.MadnessDuration + OmegaBlueHelmet.MadnessCooldown); SoundEngine.PlaySound(OmegaBlueHelmet.ActivationSound, Player.Center); for (int i = 0; i < 66; i++) { @@ -3903,23 +3897,23 @@ namespace CalamityMod.CalPlayer } if (Player.whoAmI == Main.myPlayer) { - Player.AddBuff(BuffType(), 600, false); + Player.AddBuff(BuffType(), DemonshadeHelm.EnrageDuration, false); } if (Main.netMode != NetmodeID.MultiplayerClient) { foreach (NPC npc in Main.ActiveNPCs) { if (!npc.friendly && !npc.dontTakeDamage && Vector2.Distance(Player.Center, npc.Center) <= 3000f) - npc.AddBuff(BuffType(), 600, false); + npc.AddBuff(BuffType(), DemonshadeHelm.EnrageDuration, false); } } } if (plagueReaper && !Player.HasCooldown(PlagueBlackout.ID)) { SoundEngine.PlaySound(PlagueReaperMask.ActivationSound, Player.Center); - Player.AddCooldown(PlagueBlackout.ID, 1800); + Player.AddCooldown(PlagueBlackout.ID, PlagueReaperMask.BlackoutDuration + PlagueReaperMask.BlackoutCooldown); } - if (forbiddenCirclet && Player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) + if (forbiddenCirclet && Player.ownedProjectileCounts[ProjectileType()] < 2) { forbiddenCooldown = ForbiddenCirclet.StormCooldown; int stormMana = (int)(ForbiddenCirclet.StormManaCost * Player.manaCost); @@ -3984,7 +3978,7 @@ namespace CalamityMod.CalPlayer } } if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0) - prismaticLasers = CalamityUtils.SecondsToFrames(35f); + prismaticLasers = PrismaticHelmet.LaserDuration + PrismaticHelmet.LaserCooldown; if (WulfrumHat.HasArmorSet(Player)) { //Only activate if no cooldown & available scrap. @@ -4137,23 +4131,7 @@ namespace CalamityMod.CalPlayer if (Player.accRunSpeed < accRunSpeedMin) Player.accRunSpeed = accRunSpeedMin; - // Life Jelly regen aura spawn when using a healing potion - if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly && !GrandGelatin) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType(), 0, 0, Player.whoAmI); - - // Cleansing Jelly cleansing aura spawn when using a healing potion - if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly && !GrandGelatin) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType(), 0, 0, Player.whoAmI); - - // Grand Gellatin regen and cleansing aura spawn when using a healing potion - if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && GrandGelatin && !absorber) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType(), 0, 0, Player.whoAmI); - - // Absorber's regen, cleansing, and buffing aura spawn when using a healing potion - if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && absorber) - Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ProjectileType(), 0, 0, Player.whoAmI); - - if (Player.Transformation().Type == ModContent.ItemType()) + if (Player.Transformation().Type == ItemType()) { if (Player.whoAmI == Main.myPlayer && !snowmanNoseless) Player.AddBuff(BuffType(), 60, true); @@ -4342,9 +4320,9 @@ namespace CalamityMod.CalPlayer } if (Player.statMana < 0) { - Player.AddBuff(ModContent.BuffType(), 10); - } else if (Player.HasBuff(ModContent.BuffType())) { - Player.ClearBuff(ModContent.BuffType()); + Player.AddBuff(BuffType(), 10); + } else if (Player.HasBuff(BuffType())) { + Player.ClearBuff(BuffType()); } } #endregion @@ -4393,20 +4371,6 @@ namespace CalamityMod.CalPlayer { if (Player.whoAmI == Main.myPlayer && CalamityClientConfig.Instance.VanillaCooldownDisplay) { - if (Player.whoAmI == Main.myPlayer && Player.potionDelay != 0) - potionSick = true; - else - potionSick = false; - - if (!potionSick) - timePotionSick = 0; - else - timePotionSick++; - - // Add a cooldown display for potion sickness if the player has the vanilla counter ticking - if (potionSick && !Player.HasCooldown(PotionSickness.ID)) - Player.AddCooldown(PotionSickness.ID, Player.potionDelay, false); - if (cooldowns.TryGetValue(PotionSickness.ID, out CooldownInstance cd)) { if (Player.potionDelay != cd.timeLeft && cd.timeLeft > 0) @@ -4415,6 +4379,8 @@ namespace CalamityMod.CalPlayer if (cd.timeLeft > cd.duration) cd.duration = cd.timeLeft; // If the new cooldown is larger than the full duration, update, else keep it the same. } + else if (Player.whoAmI == Main.myPlayer && Player.potionDelay > 0) + Player.AddCooldown(PotionSickness.ID, Player.potionDelay, false); // Add a cooldown display for chaos state if the player has the vanilla counter ticking // This will make the cooldown look like vanilla Rod of Discord, as it wasn't applied by either Normality Relocator or Spectral Veil @@ -4446,17 +4412,6 @@ namespace CalamityMod.CalPlayer } } - //Star in a Bottle gives Mana Regeneration instead of it's usual effect when you don't already have Mana Regeneration - if (!Player.manaRegenBuff && Player.HasBuff(BuffID.StarInBottle)) - { - //Cancel out Star In A Bottle's normal effect - Player.manaRegenDelayBonus -= 0.5f; - Player.manaRegenBonus -= 10; - //Apply Mana Regen Potion effect - Player.manaRegenBuff = true; - - } - ForceVariousEffects(); } #endregion @@ -4521,6 +4476,47 @@ namespace CalamityMod.CalPlayer #endregion + public override void PostUpdate() + { + #region Managing time control + if (Main.netMode != NetmodeID.Server && Player == Main.LocalPlayer) + { + var power = CreativePowerManager.Instance.GetPower(); + double dayrate = CreativePowerManager.Instance.GetPower().TargetTimeRate; + if (CurrentFrameFlags.SleepingPlayersCount == CurrentFrameFlags.ActivePlayersCount && CurrentFrameFlags.SleepingPlayersCount > 0) + dayrate *= 5; + if (Main.IsFastForwardingTime()) + dayrate = 60; + double tileUpdate = 1; + double eventUpdate = 1; + SystemLoader.ModifyTimeRate(ref dayrate, ref tileUpdate, ref eventUpdate); + if (WeakTimeFreezeInUse) + { + if (!power.Enabled) + WeakTimeFreezeInUse = false; + else + { + if (WeakTimeFreezeUseTimer >= Bakidon.FreezeTime / Bakidon.RechargeMultiplier || Main.bloodMoon || Main.eclipse || Main.pumpkinMoon || Main.snowMoon) + { + + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(false); + NetManager.Instance.SendToServerOrLoopback(packet); + WeakTimeFreezeInUse = false; + } + WeakTimeFreezeUseTimer += 1 * (float)dayrate; + } + } + else + { + if (WeakTimeFreezeUseTimer > 0) + WeakTimeFreezeUseTimer -= 1 * (float)dayrate; + else + WeakTimeFreezeUseTimer = 0; + } + } + #endregion + } public override void PostUpdateRunSpeeds() { #region SpeedBoosts @@ -4529,7 +4525,7 @@ namespace CalamityMod.CalPlayer float runAccMult = 1f + (victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) + (lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) + - (shadowSpeed ? 0.5f : 0f) + + (shadowSpeed ? DemonshadeGreaves.AccelerationBoost : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + @@ -4537,7 +4533,7 @@ namespace CalamityMod.CalPlayer ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + - (silvaSet ? 0.05f : 0f) + + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + (getSandCloakAccelBoost ? 0.75f : 0f) + (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (ascendantInsignia ? 0.25f : 0f ) + // Added to Soaring Insignia's 1.25x multiplier to get 1.5x @@ -4551,14 +4547,14 @@ namespace CalamityMod.CalPlayer float runSpeedMult = 1f + (victideBurrowHead ? VictideHeadBurrow.MoveSpeedAccelerationBoost : 0f) + (lunicCorpsLegs ? LunicCorpsBoots.MoveSpeedAccelerationBoost : 0f) + - (shadowSpeed ? 0.5f : 0f) + + (shadowSpeed ? DemonshadeGreaves.AccelerationBoost : 0f) + (stressPills ? 0.05f : 0f) + ((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) + (aquaticHeartWaterBuff ? AquaticHeart.WaterSpeedBoost : 0f) + ((frostFlare && Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) ? 0.15f : 0f) + (dragonScales ? 0.1f : 0f) + (CobaltSet ? CobaltArmorSetChange.SpeedBoostSetBonusPercentage * 0.01f : 0f) + - (silvaSet ? 0.05f : 0f) + + (silvaSet ? SilvaArmor.AccelerationBoost : 0f) + (nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) + (planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) + //(exaltedKillMode ? 0.4f : devilsDevastationKillMode ? 0.7f : 0) + @@ -4610,7 +4606,7 @@ namespace CalamityMod.CalPlayer ModDashMovement(); } #endregion - + Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it } #endregion @@ -4939,25 +4935,25 @@ namespace CalamityMod.CalPlayer if (Player.isDisplayDollOrInanimate) { // Body - if (Player.armor[1].type == ModContent.ItemType()) + if (Player.armor[1].type == ItemType()) Player.body = EquipLoader.GetEquipSlot(Mod, "AuricTeslaBodyArmor", EquipType.Body); - else if (Player.armor[1].type == ModContent.ItemType()) + else if (Player.armor[1].type == ItemType()) Player.body = EquipLoader.GetEquipSlot(Mod, "DaedalusBreastplate", EquipType.Body); - else if (Player.armor[1].type == ModContent.ItemType()) + else if (Player.armor[1].type == ItemType()) Player.body = EquipLoader.GetEquipSlot(Mod, "EmpyreanCloak", EquipType.Body); - else if (Player.armor[1].type == ModContent.ItemType()) + else if (Player.armor[1].type == ItemType()) Player.body = EquipLoader.GetEquipSlot(Mod, "SnowRuffianChestplate", EquipType.Body); - else if (Player.armor[1].type == ModContent.ItemType()) + else if (Player.armor[1].type == ItemType()) Player.body = EquipLoader.GetEquipSlot(Mod, "VictideBreastplate", EquipType.Body); // Legs - if (Player.armor[2].type == ModContent.ItemType()) + if (Player.armor[2].type == ItemType()) Player.legs = EquipLoader.GetEquipSlot(Mod, "VictideGreaves", EquipType.Legs); // Set Bonus - if (Player.armor[0].type == ModContent.ItemType() - && Player.armor[1].type == ModContent.ItemType() - && Player.armor[2].type == ModContent.ItemType()) + if (Player.armor[0].type == ItemType() + && Player.armor[1].type == ItemType() + && Player.armor[2].type == ItemType()) snowRuffianSet = true; } @@ -5371,11 +5367,11 @@ namespace CalamityMod.CalPlayer playerUsingWeapon = false; // Molten Amputator consumes stealth in a special way - if (it.type == ModContent.ItemType()) + if (it.type == ItemType()) playerUsingWeapon = false; // Shock Grenade consumes stealth in a special way - if (it.type == ModContent.ItemType()) + if (it.type == ItemType()) playerUsingWeapon = false; // Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle. diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index fb4d2acd41..3088a7dd21 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -240,9 +240,8 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.crushDepth && drawInfo.shadow == 0f) CrushDepth.DrawEffects(drawInfo); - // Daybroken's visual effects are reduced if the player resists it if (calamityPlayer.daybroken && drawInfo.shadow == 0f) - Daybroken.DrawEffects(drawInfo, reducedDaybrokenDamage); + Daybroken.DrawEffects(drawInfo); if (calamityPlayer.demonicFlames && drawInfo.shadow == 0f) DemonicFlames.DrawEffects(drawInfo); @@ -283,8 +282,8 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.mushy && drawInfo.shadow == 0f) Mushy.DrawEffects(drawInfo); - if (calamityPlayer.nightwither && drawInfo.shadow == 0f) // Looks weaker if you have Moon Stone equipped - Nightwither.DrawEffects(drawInfo, reducedNightwitherDamage); + if (calamityPlayer.nightwither && drawInfo.shadow == 0f) + Nightwither.DrawEffects(drawInfo); if (calamityPlayer.plague && drawInfo.shadow == 0f) Plague.DrawEffects(drawInfo); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index bcaf4cc917..a362b57861 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using CalamityMod.Balancing; using CalamityMod.Buffs.Cooldowns; @@ -14,11 +14,17 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Aerospec; +using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Daedalus; using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Items.Armor.GodSlayer; +using CalamityMod.Items.Armor.Hydrothermic; using CalamityMod.Items.Armor.LunicCorps; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.Sulphurous; +using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Mounts; @@ -80,7 +86,7 @@ namespace CalamityMod.CalPlayer sVeilDust2.noLight = false; } - SoundEngine.PlaySound(SilvaHeadSummon.DispelSound, Player.Center); + SoundEngine.PlaySound(SilvaArmor.DispelSound, Player.Center); NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0); } @@ -159,7 +165,7 @@ namespace CalamityMod.CalPlayer Player.GiveUniversalIFrames(abyssalMirrorDodgeIFrames, true); rogueStealth += 0.5f; - SoundEngine.PlaySound(SilvaHeadSummon.ActivationSound, Player.Center); + SoundEngine.PlaySound(SilvaArmor.ActivationSound, Player.Center); var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < 10; i++) @@ -296,10 +302,10 @@ namespace CalamityMod.CalPlayer if (silvaSet && silvaCountdown > 0) { - if (silvaCountdown == SilvaReviveDuration && !hasSilvaEffect) + if (silvaCountdown == SilvaArmor.ReviveDuration && !hasSilvaEffect) { - SoundEngine.PlaySound(SilvaHeadSummon.ActivationSound, Player.Center); - Player.AddBuff(ModContent.BuffType(), SilvaReviveDuration); + SoundEngine.PlaySound(SilvaArmor.ActivationSound, Player.Center); + Player.AddBuff(ModContent.BuffType(), SilvaArmor.ReviveDuration); } hasSilvaEffect = true; @@ -810,10 +816,10 @@ namespace CalamityMod.CalPlayer contactDamageReduction += 0.5; if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID)) - contactDamageReduction += Buffs.StatBuffs.TarragonCloak.ContactDamageReduction; + contactDamageReduction += TarragonHeadMelee.CloakContactDamageReduction; if (bloodflareMelee && bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) - contactDamageReduction += 0.5; + contactDamageReduction += BloodflareHeadMelee.FrenzyContactDamageReduction; if (npc.Calamity().temporalSadness) contactDamageReduction += 0.5; @@ -827,11 +833,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChiBuff) contactDamageReduction += 0.08; - // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. - // To prevent abuse, this effect does not work if there are any bosses alive. - if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon)) - contactDamageReduction += 0.15; - if (abyssalDivingSuitPlates) contactDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; @@ -1076,11 +1077,6 @@ namespace CalamityMod.CalPlayer if (trinketOfChiBuff) projectileDamageReduction += 0.08; - // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. - // To prevent abuse, this effect does not work if there are any bosses alive. - if (fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon)) - projectileDamageReduction += 0.15; - if (abyssalDivingSuitPlates) projectileDamageReduction += AbyssalDivingSuit.PlatesAllDamageReduction - abyssalDivingSuitPlateHits * AbyssalDivingSuit.PlatesHitDecay; @@ -1204,7 +1200,7 @@ namespace CalamityMod.CalPlayer Vector2 pushVel = Utils.DirectionTo(Player.Center, npc.Center) * 7; if (!npc.dontTakeDamage) { - int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(40); + int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(CrawCarapace.ThornsDamage); Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y); } SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); @@ -1229,7 +1225,7 @@ namespace CalamityMod.CalPlayer Vector2 pushVel = Utils.DirectionTo(Player.Center, npc.Center) * 15; if (!npc.dontTakeDamage) { - int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(250); + int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(Baroclaw.ThornsDamage); Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y); npc.AddBuff(ModContent.BuffType(), 900); @@ -1264,8 +1260,8 @@ namespace CalamityMod.CalPlayer Vector2 pushVel = Utils.DirectionTo(Player.Center, npc.Center) * 22; if (!npc.dontTakeDamage) { - int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(350); - Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, -1, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y); + int onHitDamage = (int)Player.GetBestClassDamage().ApplyTo(TheAbsorber.ThornsDamage); + Projectile revenge = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, -1f, Player.whoAmI, npc.whoAmI, pushVel.X, pushVel.Y); npc.AddBuff(ModContent.BuffType(), 900); } @@ -2058,10 +2054,9 @@ namespace CalamityMod.CalPlayer // Regardless of whether shields took damage, iterate over and stall all shield regen on ANY hit. // This applies even if you are hit while shields are fully down, or if you unequip any of the relevant items. { - // Rover Drive does not recharge while partially full, only when broken. - // If you are hit when recharging, though, that timer gets reset. - if (cooldowns.TryGetValue(WulfrumRoverDriveRecharge.ID, out var roverDriveRechargeCD)) - roverDriveRechargeCD.timeLeft = RoverDrive.ShieldRechargeTime; + // Set Rover Drive's recharge delay to full. Override any existing cooldown instance. + if (roverDrive) + Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeDelay, true); // Set the Lunic Corps Armor's recharge delay to full. Override any existing cooldown instance. if (lunicCorpsSet) @@ -2405,15 +2400,15 @@ namespace CalamityMod.CalPlayer if (tarraMelee) { - Player.AddBuff(ModContent.BuffType(), 120); + Player.AddBuff(ModContent.BuffType(), TarragonHeadMelee.TarraLifeDuration); } else if (xerocSet) { - Player.AddBuff(ModContent.BuffType(), 180); + Player.AddBuff(ModContent.BuffType(), EmpyreanMask.WrathDuration); } else if (reaverDefense) { - Player.AddBuff(ModContent.BuffType(), 180); + Player.AddBuff(ModContent.BuffType(), ReaverHeadTank.ReaverRageDuration); } if (fBarrier || (aquaticHeart && NPC.downedBoss3)) @@ -2536,10 +2531,9 @@ namespace CalamityMod.CalPlayer { // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext); + int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage); for (int n = 0; n < 4; n++) { - int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage); - CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), featherDamage, 1f, Player.whoAmI); } } @@ -2548,14 +2542,8 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); SoundEngine.PlaySound(SoundID.Item74, Player.Center); - int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(25); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(320); - + int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(HideofAstrumDeus.BlazeDamage); Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, 0f, ModContent.ProjectileType(), blazeDamage, 5f, Player.whoAmI, 0f, 1f); - for (int n = 0; n < 12; n++) - { - CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), astralStarDamage, 5f, Player.whoAmI); - } } // TODO -- Make Deific Amulet and Rampart of Deities' retaliation effects way cooler // In the meantime, gave them homing astral bombers instead of the lame falling stars @@ -2565,8 +2553,7 @@ namespace CalamityMod.CalPlayer int projAmount = (rampartOfDeities ? 12 : 6); for (int n = 0; n < projAmount; n++) { - int baseDamage = 130 * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1); - int deificProjDamage = (int)Player.GetBestClassDamage().ApplyTo(baseDamage); + int deificProjDamage = (int)Player.GetBestClassDamage().ApplyTo(DeificAmulet.StarDamage); Projectile onHitProj = Main.projectile[Projectile.NewProjectile(source, Player.Center, new Vector2(0,-15).RotatedBy(MathHelper.TwoPi/projAmount*n), ModContent.ProjectileType(), deificProjDamage, 4f, Player.whoAmI)]; if (onHitProj.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2603,7 +2590,7 @@ namespace CalamityMod.CalPlayer { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int effectStrength = amalgam ? 3 : aBrain ? 2 : 1; - int effectDamage = amalgam ? 400 : aBrain ? 35 : 15; + int effectDamage = amalgam ? TheAmalgam.NimbusDamage : aBrain ? AmalgamatedBrain.NimbusDamage : RottenBrain.NimbusDamage; effectDamage = (int)Player.GetBestClassDamage().ApplyTo(effectDamage); Vector2 spawnerVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 40f) * 12.5f; @@ -2637,7 +2624,7 @@ namespace CalamityMod.CalPlayer if (hurtInfo.Damage > 0) { SoundEngine.PlaySound(SoundID.Item74, Player.Center); - int eDamage = (int)Player.GetBestClassDamage().ApplyTo(230); + int eDamage = (int)Player.GetBestClassDamage().ApplyTo(HydrothermicArmor.BlazeDamage); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(fuckYouBitch, Player.Center, Vector2.Zero, ModContent.ProjectileType(), eDamage, 1f, Player.whoAmI, 0f, 0f); @@ -2664,28 +2651,17 @@ namespace CalamityMod.CalPlayer } } } - else if (reaverDefense) //Defense and DR Helm - { - var source = Player.GetSource_Misc("23"); - if (hurtInfo.Damage > 0) - { - int rDamage = (int)Player.GetBestClassDamage().ApplyTo(240); - - if (Player.whoAmI == Main.myPlayer) - Projectile.NewProjectile(source, Player.Center.X, Player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), rDamage, 0f, Player.whoAmI, 0f, 0f); - } - } else if (godSlayerDamage) //god slayer melee helm { var source = Player.GetSource_Misc("24"); - if (hurtInfo.Damage > 80) + if (hurtInfo.Damage > GodSlayerHeadMelee.SetBonusHurtDamageThreshold) { SoundEngine.PlaySound(SoundID.Item73, Player.Center); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int shrapnelDamage = Player.CalcIntDamage(675); + int shrapnelDamage = Player.CalcIntDamage(GodSlayerHeadMelee.DartDamage); if (Player.whoAmI == Main.myPlayer) { for (int i = 0; i < 4; i++) @@ -2705,7 +2681,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, DemonshadeHelm.ShadowScytheEntitySourceContext); for (int l = 0; l < 2; l++) { - int shadowbeamDamage = (int)Player.GetBestClassDamage().ApplyTo(300); + int shadowbeamDamage = (int)Player.GetBestClassDamage().ApplyTo(DemonshadeHelm.BeamDamage); Projectile beam = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.ShadowBeamFriendly, shadowbeamDamage, 7f, Player.whoAmI); if (beam.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2717,7 +2693,7 @@ namespace CalamityMod.CalPlayer } for (int l = 0; l < 5; l++) { - int scytheDamage = (int)Player.GetBestClassDamage().ApplyTo(500); + int scytheDamage = (int)Player.GetBestClassDamage().ApplyTo(DemonshadeHelm.ScytheDamage); Projectile scythe = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.DemonScythe, scytheDamage, 7f, Player.whoAmI); if (scythe.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 32a981809f..20bce9b8de 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -9,6 +9,10 @@ using CalamityMod.Cooldowns; using CalamityMod.Enums; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; +using CalamityMod.Items.Armor.Fearmonger; +using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions; @@ -119,8 +123,8 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(searingLava, 30); ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player ApplyDoTDebuff(laceration, 36, purity); - ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity); - ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity); + ApplyDoTDebuff(daybroken, 40, purity); + ApplyDoTDebuff(nightwither, 40, purity); ApplyDoTDebuff(holyFlames, 40, purity); ApplyDoTDebuff(voidfrost, 40, purity); ApplyDoTDebuff(hadopelagicPressure, 40, purity); @@ -289,34 +293,11 @@ namespace CalamityMod.CalPlayer // At the last second, Reaver defense helm reduces DoT debuffs by 20% if (reaverDefense) - totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen); + totalNegativeLifeRegen -= (int)(totalNegativeLifeRegen * ReaverHeadTank.SetBonusDebuffDamageReduction); Player.lifeRegen -= (int)totalNegativeLifeRegen; #region Life Regen That Works Even During DoT Debuffs - - // Honey Dew (and upgrades) - if (alwaysHoneyRegen) - { - // Exact copy of vanilla Honey behavior, but does not stack with actually standing in Honey - if (!Player.honey) - { - alwaysHoneyRegenAmount += 1; - Player.lifeRegen += 2; - Player.lifeRegenTime += 1; - - // Grants +2 life regen if negative life regen would otherwise occur. - // However, this can't bring regen into the positives. - if (Player.lifeRegen < 0) - { - alwaysHoneyRegenAmount += Math.Min(1f, 0 - Player.lifeRegen/2f); - Player.lifeRegen += 2; - if (Player.lifeRegen > 0) - Player.lifeRegen = 0; - } - } - } - if (honeyDewHalveDebuffs) { // Tick down all sickness debuffs; this makes them expire 2x faster @@ -386,11 +367,10 @@ namespace CalamityMod.CalPlayer if (rOoze || aAmpoule || purity) { float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2; - //Ambrosial Ampule and ooze give between 2 and 6 hp/s - int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 10f : 12f), missingLifeRatio));//Rounding is needed for it to ever actually give +6 hp/s, as the integer conversion would otherwise floor it. + //Ambrosial Ampule and ooze give between 2 and 5 hp/s + int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp(4f, 10f, missingLifeRatio));//Rounding is needed for it to ever actually give +5 hp/s, as the integer conversion would otherwise floor it. Player.lifeRegen += lifeRegenToGive; radiantOozeRegen += lifeRegenToGive / 2f; - ambrosialAmpouleRegen += lifeRegenToGive / 2f; purityRegen += lifeRegenToGive / 2f; } @@ -414,9 +394,6 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) Player.Heal(1); - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; - intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; if (jewelBonusDefense < intendedPurityDefense) jewelBonusDefense = intendedPurityDefense; @@ -456,8 +433,6 @@ namespace CalamityMod.CalPlayer if (currentDebuffs > 0) { Player.lifeRegen += 4; - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; if (jewelBonusDefense < intendedJewelDefense) @@ -478,13 +453,9 @@ namespace CalamityMod.CalPlayer { Player.lifeRegen += 2; - // If any debuff is detected, provide even more life regen and massively accelerate it + // If any debuff is detected, provide even more life regen if (Player.buffType.Any(i => CalamityBuffSets.IsDebuff[i])) - { Player.lifeRegen += 3; - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; - } } #endregion @@ -585,7 +556,7 @@ namespace CalamityMod.CalPlayer } if (tRegen) - Player.lifeRegen += 3; + Player.lifeRegen += TarragonHeadMelee.TarraLifeRegenBoost; if (sRegen) Player.lifeRegen += SpiritGlyph.RegenBoost; @@ -621,7 +592,7 @@ namespace CalamityMod.CalPlayer } if (silvaSet) - Player.lifeRegen += 6; + Player.lifeRegen += SilvaArmor.SetBonusRegenBoost; if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { @@ -661,20 +632,13 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += 4; } - if (bloodflareSummon) - { - if (Player.statLife <= (int)(actualMaxLife * 0.5)) - Player.lifeRegen += 2; - } - if (fearmongerSet && fearmongerRegenFrames > 0) { - Player.lifeRegen += 7; + if (Player.lifeRegenTime < FearmongerGreathelm.MinionRegenTimeFloor) + Player.lifeRegenTime = FearmongerGreathelm.MinionRegenTimeFloor; - if (Player.lifeRegenTime < 900) - Player.lifeRegenTime = 900; - - Player.lifeRegenTime += 4; + Player.lifeRegen += FearmongerGreathelm.MinionRegenBoost; + Player.lifeRegenTime += FearmongerGreathelm.MinionRegenTimeBoost; } if (pinkCandle && !noLifeRegen) @@ -699,63 +663,51 @@ namespace CalamityMod.CalPlayer #region Standing Still Life Regen // Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly) - if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0) + if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0 && (shadeRegen || cFreeze)) { - bool honeyDewWorking = honeyTurboRegen && Player.honeyWet; - bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || aAmpoule || purity; - // Divides all negative life regen by two before applying any other effects. - if (anyStandingStillLifeRegen && Player.lifeRegen < 0) + if (Player.lifeRegen < 0) Player.lifeRegen /= 2; - // Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style + // Spawn dust of some flavor while actually regenerating if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) { - 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); + int dustType = shadeRegen ? 173 : 67; + bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime ? Main.rand.NextBool() : Main.rand.NextBool(30); if (dustType != -1 && dustSpawnRolled) { - Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f); + Dust regen = Dust.NewDustDirect(Player.position, Player.width, Player.height, dustType, 0f, 0f, 200, default, 1f); regen.noGravity = true; regen.fadeIn = 1.3f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); regen.velocity = velocity; velocity.Normalize(); - velocity *= purity || aAmpoule ? 55f : 34f; regen.position = Player.Center - velocity; } } // Actually apply "standing still" regeneration (the stats are granted even at full health) - float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : aAmpoule ? 90f : purity ? 60f : -1f; + float regenTimeNeededForTurboRegen = shadeRegen ? 40f : 60f; - // 4 = vanilla Shiny Stone - int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : -1; + // After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600. + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f) + Player.lifeRegenTime = 900f; - if (turboRegenPower > 0) - { - // After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600. - if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f) - Player.lifeRegenTime = 900f; - - Player.lifeRegen += turboRegenPower; - Player.lifeRegenTime += turboRegenPower; - purityRegen += turboRegenPower / 2f; - if (!shadeRegen || cFreeze || purity) ambrosialAmpouleRegen += turboRegenPower / 2f; - } + Player.lifeRegen += 4; + Player.lifeRegenTime += 4; } #endregion if (regenerator) // Gives special regen of it's own, but disables all regular life regen { - if (Player.miscCounter % 7 == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f)) + if (Player.miscCounter % Regenerator.FramesPerHeal == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f)) Player.HealPlayer(1, HealTextType.None); // Boost life regen time quite a bit. // This is so that in events and such where small hits are common, your damage boost isn't completley negated if (Player.lifeRegenTime < 3600) - Player.lifeRegenTime += 10; + Player.lifeRegenTime += Regenerator.RegenTimeBoost; } else regeneratorDamage = 0; @@ -824,7 +776,7 @@ namespace CalamityMod.CalPlayer if (Player.palladiumRegen) finalRegen += 4; - regeneratorDamage = (finalRegen * 1.75f) * 0.01f; + regeneratorDamage = finalRegen * Regenerator.RegenToDamageRatio; Player.GetDamage() += regeneratorDamage; if (Player.lifeRegen > 0) @@ -834,11 +786,11 @@ namespace CalamityMod.CalPlayer if (Player.lifeRegenCount > 0) Player.lifeRegenCount = 0; - //Hard-lock the player's health to 50%. + //Hard-lock the player's health to a certain ratio. //No lifesteal, no regen, no healing pots - if (Player.statLife >= (int)(Player.statLifeMax2 * 0.5f)) + if (Player.statLife >= (int)(Player.statLifeMax2 * Regenerator.HealthRatioCap)) { - Player.statLife = (int)(Player.statLifeMax2 * 0.5f); + Player.statLife = (int)(Player.statLifeMax2 * Regenerator.HealthRatioCap); Player.moonLeech = true; healingPotionMultiplier = 0; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 15dcc3113d..4946d3f912 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -18,12 +18,16 @@ using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; using CalamityMod.Items.Armor.Aerospec; +using CalamityMod.Items.Armor.Auric; using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; using CalamityMod.Items.Armor.DesertProwler; +using CalamityMod.Items.Armor.Empyrean; +using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.Items.Armor.Hydrothermic; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; +using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Armor.Prismatic; using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Armor.Silva; @@ -1490,7 +1494,7 @@ namespace CalamityMod.CalPlayer { if (!tentaclesPresent[i]) { - int damage = (int)Player.GetBestClassDamage().ApplyTo(350); + int damage = (int)Player.GetBestClassDamage().ApplyTo(OmegaBlueHelmet.TentacleDamage); var source = Player.GetSource_FromThis(OmegaBlueHelmet.TentacleEntitySourceContext); Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f; @@ -1499,15 +1503,11 @@ namespace CalamityMod.CalPlayer } } - float damageUp = 0.1f; - int critUp = 10; if (omegaBlueAbyssalMadness) { - damageUp += 0.1f; - critUp += 10; + Player.GetDamage() += OmegaBlueHelmet.MadnessDamageBoost; + Player.GetCritChance() += OmegaBlueHelmet.MadnessCritBoost; } - Player.GetDamage() += damageUp; - Player.GetCritChance() += critUp; } // Rain armor set effects @@ -2289,13 +2289,13 @@ namespace CalamityMod.CalPlayer canFireAtaxiaRangedProjectile = true; if (Player.miscCounter % HydrothermicHeadRogue.VolleyCooldown == 0) canFireAtaxiaRogueProjectile = true; - if (Player.miscCounter % 100 == 0) + if (Player.miscCounter % BloodflareHeadMagic.GhostBoltCooldown == 0) canFireBloodflareMageProjectile = true; - if (Player.miscCounter % 150 == 0) - { - canFireGodSlayerRangedProjectile = true; + if (Player.miscCounter % BloodflareHeadRanged.BloodBombCooldown == 0) canFireBloodflareRangedProjectile = true; - } + if (Player.miscCounter % GodSlayerHeadRanged.ShrapnelRoundCooldown == 0) + canFireGodSlayerRangedProjectile = true; + if (auralisAurora > 0) auralisAurora--; if (auralisAuroraCooldown > 0) @@ -2470,8 +2470,8 @@ namespace CalamityMod.CalPlayer silvaCountdown -= 1; if (silvaCountdown <= 0) { - SoundEngine.PlaySound(SilvaHeadSummon.DispelSound, Player.Center); - Player.AddCooldown(SilvaRevive.ID, CalamityUtils.SecondsToFrames(5 * 60)); + SoundEngine.PlaySound(SilvaArmor.DispelSound, Player.Center); + Player.AddCooldown(SilvaRevive.ID, SilvaArmor.ReviveCooldown); } for (int j = 0; j < 2; j++) @@ -2489,7 +2489,7 @@ namespace CalamityMod.CalPlayer } if (!Player.HasCooldown(SilvaRevive.ID) && hasSilvaEffect && silvaCountdown <= 0 && !areThereAnyDamnBosses && !areThereAnyDamnEvents) { - silvaCountdown = 480; + silvaCountdown = SilvaArmor.ReviveDuration; hasSilvaEffect = false; } @@ -2501,7 +2501,7 @@ namespace CalamityMod.CalPlayer { tarraDefenseTime = 600; if (Player.whoAmI == Main.myPlayer) - Player.AddCooldown(Cooldowns.TarragonCloak.ID, CalamityUtils.SecondsToFrames(30)); + Player.AddCooldown(Cooldowns.TarragonCloak.ID, TarragonHeadMelee.CloakCooldown); } for (int j = 0; j < 2; j++) @@ -2527,11 +2527,11 @@ namespace CalamityMod.CalPlayer if (tarragonImmunity && !disableAllDodges) Player.GiveUniversalIFrames(2, true); - if (tarraThrowingCrits >= 50) + if (tarraThrowingCrits >= TarragonHeadRogue.CritsToActivateImmunity) { tarraThrowingCrits = 0; if (Player.whoAmI == Main.myPlayer && !disableAllDodges) - Player.AddBuff(ModContent.BuffType(), 150, false); + Player.AddBuff(ModContent.BuffType(), TarragonHeadRogue.ImmunityDuration, false); } for (int l = 0; l < Player.MaxBuffs; l++) @@ -2539,10 +2539,10 @@ namespace CalamityMod.CalPlayer int buffID = Player.buffType[l]; if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType()) if (Player.whoAmI == Main.myPlayer) - Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25)); + Player.AddCooldown(Cooldowns.TarragonImmunity.ID, TarragonHeadRogue.ImmunityCooldown); if (CalamityBuffSets.IsDebuff[buffID]) - Player.GetDamage() += 0.1f; + Player.GetDamage() += TarragonHeadRogue.RogueDamageBoostWhileDebuffed; } } @@ -2560,7 +2560,7 @@ namespace CalamityMod.CalPlayer { bloodflareMeleeHits = 0; if (Player.whoAmI == Main.myPlayer) - Player.AddBuff(ModContent.BuffType(), 302, false); + Player.AddBuff(ModContent.BuffType(), BloodflareHeadMelee.FrenzyDuration, false); } if (bloodflareFrenzy) @@ -2569,11 +2569,11 @@ namespace CalamityMod.CalPlayer { int hasBuff = Player.buffType[l]; if (Player.buffTime[l] <= 2 && hasBuff == ModContent.BuffType() && Player.whoAmI == Main.myPlayer) - Player.AddCooldown(BloodflareFrenzy.ID, CalamityUtils.SecondsToFrames(30)); + Player.AddCooldown(BloodflareFrenzy.ID, BloodflareHeadMelee.FrenzyCooldown); } - Player.GetCritChance() += 25; - Player.GetDamage() += 0.25f; + Player.GetCritChance() += BloodflareHeadMelee.FrenzyMeleeCritBoost; + Player.GetDamage() += BloodflareHeadMelee.FrenzyMeleeDamageBoost; for (int j = 0; j < 2; j++) { @@ -2630,7 +2630,6 @@ namespace CalamityMod.CalPlayer { Player.moveSpeed += TheAbsorber.MoveSpeedBoost; Player.jumpSpeedBoost += TheAbsorber.JumpSpeedBoost; - Player.thorns += TheAbsorber.ThornsBoost; } // Nimble Bounder bonus @@ -2880,26 +2879,26 @@ namespace CalamityMod.CalPlayer { bloodflareFrenzy = false; Player.ClearBuff(ModContent.BuffType()); - Player.AddCooldown(BloodflareFrenzy.ID, CalamityUtils.SecondsToFrames(30)); + Player.AddCooldown(BloodflareFrenzy.ID, BloodflareHeadMelee.FrenzyCooldown); } if (!tarraMelee && tarragonCloak) { tarragonCloak = false; Player.ClearBuff(ModContent.BuffType()); - Player.AddCooldown(Cooldowns.TarragonCloak.ID, CalamityUtils.SecondsToFrames(30)); + Player.AddCooldown(Cooldowns.TarragonCloak.ID, TarragonHeadMelee.CloakCooldown); } if (!tarraThrowing && tarragonImmunity) { tarragonImmunity = false; Player.ClearBuff(ModContent.BuffType()); - Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25)); + Player.AddCooldown(Cooldowns.TarragonImmunity.ID, TarragonHeadRogue.ImmunityCooldown); } bool hasOmegaBlueCooldown = cooldowns.TryGetValue(OmegaBlue.ID, out CooldownInstance omegaBlueCD); - if (!omegaBlueSet && hasOmegaBlueCooldown && omegaBlueCD.timeLeft > 1500) + if (!omegaBlueSet && hasOmegaBlueCooldown && omegaBlueCD.timeLeft > OmegaBlueHelmet.MadnessCooldown) { Player.ClearBuff(ModContent.BuffType()); - omegaBlueCD.timeLeft = 1500; + omegaBlueCD.timeLeft = OmegaBlueHelmet.MadnessCooldown; } bool hasKillMode = cooldowns.TryGetValue(KillMode.ID, out CooldownInstance killModeCD); @@ -2911,13 +2910,13 @@ namespace CalamityMod.CalPlayer } bool hasPlagueBlackoutCD = cooldowns.TryGetValue(PlagueBlackout.ID, out CooldownInstance plagueBlackoutCD); - if (!plagueReaper && hasPlagueBlackoutCD && plagueBlackoutCD.timeLeft > 1500) - plagueBlackoutCD.timeLeft = 1500; + if (!plagueReaper && hasPlagueBlackoutCD && plagueBlackoutCD.timeLeft > PlagueReaperMask.BlackoutCooldown) + plagueBlackoutCD.timeLeft = PlagueReaperMask.BlackoutCooldown; - if (!prismaticSet && prismaticLasers > 1800) + if (!prismaticSet && prismaticLasers > PrismaticHelmet.LaserCooldown) { - prismaticLasers = 1800; - Player.AddCooldown(PrismaticLaser.ID, 1800); + prismaticLasers = PrismaticHelmet.LaserCooldown; + Player.AddCooldown(PrismaticLaser.ID, PrismaticHelmet.LaserCooldown); } if (!angelicAlliance && divineBless) { @@ -3143,7 +3142,7 @@ namespace CalamityMod.CalPlayer abyssDeath = false; // Signus headcrab darkness - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (CalamityGlobalNPC.signus != -1) { @@ -3389,21 +3388,6 @@ namespace CalamityMod.CalPlayer if (AdamantiteSet) Player.statDefense += AdamantiteSetDefenseBoost; - // Warmth makes Chilled and Frozen tick down 3x as fast - if (Player.HasBuff(BuffID.Warmth)) - { - for (int b = 0; b < Player.MaxBuffs; b++) - { - if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen) - { - if (Player.buffTime[b] > 3) - { - Player.buffTime[b] -= 2; - } - } - } - } - if (astralInjection) { if (Player.statMana < Player.statManaMax2) @@ -3423,8 +3407,8 @@ namespace CalamityMod.CalPlayer if (xWrath) { - Player.GetDamage() += 0.1f; - Player.GetCritChance() += 5; + Player.GetDamage() += EmpyreanMask.WrathRogueDamageBoost; + Player.GetCritChance() += EmpyreanMask.WrathRogueCritBoost; } if (graxDefense) @@ -3676,12 +3660,12 @@ namespace CalamityMod.CalPlayer // Flight time boosts double flightTimeMult = 1D + (harpyRing ? 0.2 : 0D) + - (reaverSpeed ? 0.1 : 0D) + - (angelTreads ? 0.1 : 0D) + + (reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0D) + + (angelTreads ? AngelTreads.FlightTimeBoost : 0D) + (blueCandle ? WeightlessCandle.WingTimeBoost : 0D) + (soaring ? SoaringPotion.FlightBoost : 0D) + - (prismaticGreaves ? 0.1 : 0D) + - (plagueReaper ? 0.05 : 0D) + + (prismaticGreaves ? PrismaticGreaves.FlightTimeBoost : 0D) + + (plagueReaper ? PlagueReaperMask.SetBonusFlightTimeBoost : 0D) + (ascendantInsignia ? 0.17 : 0D) + // Added to soaring insignia's flight to get 50% (Player.empressBrooch ? 0.33 : 0D) + externalFlightTimeMultBoost; @@ -3702,7 +3686,7 @@ namespace CalamityMod.CalPlayer // Reaver Tank set nuke flight time if (reaverDefense) - flightTimeMult -= 0.3f; + flightTimeMult -= ReaverHeadTank.SetBonusMobilityReduction; // Increase wing time if (Player.wingTimeMax > 0) @@ -3873,41 +3857,34 @@ namespace CalamityMod.CalPlayer if (bloodflareThrowing) { - if (Player.statLife > (int)(Player.statLifeMax2 * 0.8)) - { - Player.GetCritChance() += 5; - Player.statDefense += 30; - } - else - Player.GetDamage() += 0.1f; + if (Player.statLife > (int)(Player.statLifeMax2 * BloodflareHeadRogue.DefenseBoostHealthThreshold)) + Player.statDefense += BloodflareHeadRogue.DefenseBoostAboveHealthThreshold; } if (bloodflareSummon) { - if (Player.statLife >= (int)(Player.statLifeMax2 * 0.9)) - Player.GetDamage() += 0.1f; - else if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) - Player.statDefense += 20; + if (Player.statLife <= (int)(Player.statLifeMax2 * BloodflareHeadSummon.DefenseBoostHealthThreshold)) + Player.statDefense += BloodflareHeadSummon.DefenseBoostBelowHealthThreshold; if (bloodflareSummonTimer > 0) bloodflareSummonTimer--; if (Player.whoAmI == Main.myPlayer && bloodflareSummonTimer <= 0) { - bloodflareSummonTimer = 900; + bloodflareSummonTimer = BloodflareHeadSummon.MineCooldown; // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(BloodflareHeadSummon.GhostMineEntitySourceContext); for (int I = 0; I < 3; I++) { float ai1 = I * 120; - int damage = (int)Player.CalcIntDamage(3750); + int damage = (int)Player.CalcIntDamage(BloodflareHeadSummon.MineDamage); int projectile = Projectile.NewProjectile(source, Player.Center.X + (float)(Math.Sin(I * 120) * 550), Player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, ModContent.ProjectileType(), damage, 1f, Player.whoAmI, ai1, 0f); if (projectile.WithinBounds(Main.maxProjectiles)) { - Main.projectile[projectile].originalDamage = 3750; + Main.projectile[projectile].originalDamage = BloodflareHeadSummon.MineDamage; Main.projectile[projectile].DamageType = DamageClass.Generic; } } @@ -3923,7 +3900,7 @@ namespace CalamityMod.CalPlayer } if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDmg = auricSet ? 500 : 380; + int baseDmg = auricSet ? AuricTeslaHeadSummon.CrystalDamage : SilvaHeadSummon.CrystalDamage; int damage = (int)Player.GetTotalDamage().ApplyTo(baseDmg); var p = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -20f, 0f); @@ -3951,9 +3928,9 @@ namespace CalamityMod.CalPlayer { if (Player.statLife >= Player.statLifeMax2) { - Player.GetCritChance() += 10; - Player.GetDamage() += 0.1f; - rogueVelocity += 0.1f; + Player.GetDamage() += GodSlayerHeadRogue.RogueDamageBoostAtFullHealth; + Player.GetCritChance() += GodSlayerHeadRogue.RogueCritBoostAtFullHealth; + rogueVelocity += GodSlayerHeadRogue.RogueVelocityBoostAtFullHealth; } } @@ -3969,7 +3946,7 @@ namespace CalamityMod.CalPlayer // If the timer rolls over, it's time to deal damage. Only run this code for the client which is wearing the armor. if (tarraLifeAuraTimer == 0 && Player.whoAmI == Main.myPlayer) { - int damage = (int)Player.CalcDamage(120); + int damage = (int)Player.CalcDamage(TarragonHeadSummon.AuraDamage); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(TarragonHeadSummon.LifeAuraEntitySourceContext); @@ -4288,66 +4265,27 @@ namespace CalamityMod.CalPlayer } } - if (prismaticLasers > 1800 && Player.whoAmI == Main.myPlayer) + if (prismaticLasers > PrismaticHelmet.LaserCooldown && Player.whoAmI == Main.myPlayer) { - float shootSpeed = 18f; - int dmg = (int)Player.GetTotalDamage().ApplyTo(30); - - Vector2 startPos = Player.RotatedRelativePoint(Player.MountedCenter, true); - - // 14NOV2024: Ozzatron: clamped mouse position is inappropriate to apply here due to excessive use of decompiled vanilla shitcode - Vector2 velocity = Main.MouseWorld - startPos; - if (Player.gravDir == -1f) - { - velocity.Y = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - startPos.Y; - } - float travelDist = velocity.Length(); - if ((float.IsNaN(velocity.X) && float.IsNaN(velocity.Y)) || (velocity.X == 0f && velocity.Y == 0f)) - { - velocity.X = Player.direction; - velocity.Y = 0f; - travelDist = shootSpeed; - } - else - { - travelDist = shootSpeed / travelDist; - } + int dmg = (int)Player.GetTotalDamage().ApplyTo(PrismaticHelmet.LaserDamage); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(PrismaticHelmet.LaserEntitySourceContext); int laserAmt = Main.rand.Next(2); for (int index = 0; index < laserAmt; index++) { - startPos = new Vector2(Player.Center.X + (Main.rand.Next(201) * -(float)Player.direction) + (Main.mouseX + Main.screenPosition.X - Player.position.X), Player.MountedCenter.Y - 600f); - startPos.X = (startPos.X + Player.Center.X) / 2f + Main.rand.Next(-200, 201); - startPos.Y -= 100 * index; - velocity.X = Main.mouseX + Main.screenPosition.X - startPos.X; - velocity.Y = Main.mouseY + Main.screenPosition.Y - startPos.Y; - if (velocity.Y < 0f) - { - velocity.Y *= -1f; - } - if (velocity.Y < 20f) - { - velocity.Y = 20f; - } - travelDist = velocity.Length(); - travelDist = shootSpeed / travelDist; - velocity.X *= travelDist; - velocity.Y *= travelDist; - velocity.X += Main.rand.Next(-50, 51) * 0.02f; - velocity.Y += Main.rand.Next(-50, 51) * 0.02f; - int laser = Projectile.NewProjectile(source, startPos, velocity, ModContent.ProjectileType(), dmg, 4f, Player.whoAmI, 0f, 0f); - Main.projectile[laser].localNPCHitCooldown = 5; - if (laser.WithinBounds(Main.maxProjectiles)) - Main.projectile[laser].DamageType = DamageClass.Generic; + Vector2 newPos = new Vector2(Player.ClampedMouseWorld().X + Main.rand.NextFloat(-240f, 240f), Player.MountedCenter.Y - 960f); + Vector2 newVel = (Player.ClampedMouseWorld() + Main.rand.NextVector2CircularEdge(24f, 24f) - newPos).SafeNormalize(Vector2.Zero) * 18f; + Projectile laser = Projectile.NewProjectileDirect(source, newPos, newVel, ModContent.ProjectileType(), dmg, 4f, Player.whoAmI); + laser.localNPCHitCooldown = 5; + laser.DamageType = DamageClass.Generic; } SoundEngine.PlaySound(SoundID.Item12, Player.Center); } - if (prismaticLasers == 1800) + if (prismaticLasers == PrismaticHelmet.LaserCooldown) { // At the exact moment the lasers stop, set the cooldown to appear - Player.AddCooldown(PrismaticLaser.ID, 1800); + Player.AddCooldown(PrismaticLaser.ID, PrismaticHelmet.LaserCooldown); } if (prismaticLasers == 1) { @@ -4789,7 +4727,10 @@ namespace CalamityMod.CalPlayer { if (cooldowns.TryGetValue(WulfrumRoverDriveDurability.ID, out var cdDurability)) cdDurability.timeLeft = 0; - // if (cooldowns.TryGetValue(WulfrumRoverDriveRecharge.ID, out var cdRecharge)) cdRecharge.timeLeft = 0; + + // As Rover Drive's shield can be left in a partially recharged state, this is for safety. + // If the player does not have the accessory equipped for even one frame, discharge all shields. + RoverDriveShieldDurability = 0; } // Stuff to do if the Rover Drive is equipped @@ -4797,16 +4738,38 @@ namespace CalamityMod.CalPlayer { // If the Rover Drive shield is discharged and hasn't started its recharge delay, start that. if (RoverDriveShieldDurability == 0 && !cooldowns.ContainsKey(WulfrumRoverDriveRecharge.ID)) - Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeTime); + Player.AddCooldown(WulfrumRoverDriveRecharge.ID, RoverDrive.ShieldRechargeDelay); - // If the shield has greater than zero durability but that durability is not on the cooldown rack, - // add it to the cooldown rack and play a sound of the shield turning on. + // If the shield has greater than zero durability but that durability is not on the cooldown rack, add it to the cooldown rack. if (RoverDriveShieldDurability > 0 && !cooldowns.ContainsKey(WulfrumRoverDriveDurability.ID)) { CooldownInstance durabilityCooldown = Player.AddCooldown(WulfrumRoverDriveDurability.ID, RoverDrive.ShieldDurabilityMax); durabilityCooldown.timeLeft = RoverDriveShieldDurability; } + // If the shield has greater than zero durability and isn't in its recharge delay, actively replenish shield points. + // Play a sound on the first frame this occurs. + if (RoverDriveShieldDurability > 0 && !cooldowns.ContainsKey(WulfrumRoverDriveRecharge.ID)) + { + if (!playedRoverDriveShieldSound) + SoundEngine.PlaySound(RoverDrive.ActivationSound, Player.Center); + playedRoverDriveShieldSound = true; + + // This number is not an integer, and stores exact per-frame recharge progress. + roverDriveShieldPartialRechargeProgress += RoverDrive.ShieldDurabilityMax / (float)RoverDrive.TotalShieldRechargeTime; + + // Floor the value to get whole number of shield points recharged this frame. + int pointsActuallyRecharged = (int)MathF.Floor(roverDriveShieldPartialRechargeProgress); + + // Give those points to the real shield durability, capping the result. Then remove them from recharge progress. + RoverDriveShieldDurability = Math.Min(RoverDriveShieldDurability + pointsActuallyRecharged, RoverDrive.ShieldDurabilityMax); + roverDriveShieldPartialRechargeProgress -= pointsActuallyRecharged; + + // Update the cooldown rack's durability indicator. + if (cooldowns.TryGetValue(WulfrumRoverDriveDurability.ID, out var cdDurability)) + cdDurability.timeLeft = RoverDriveShieldDurability; + } + // Add light if this shield is currently active if (RoverDriveShieldDurability > 0 && !shieldAddedLight) { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 0439ca71ba..9a5dbf505b 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -11,10 +11,15 @@ using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; using CalamityMod.Items.Armor.Astral; +using CalamityMod.Items.Armor.Bloodflare; +using CalamityMod.Items.Armor.Fearmonger; using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.Plaguebringer; using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.SnowRuffian; using CalamityMod.Items.Armor.Sulphurous; +using CalamityMod.Items.Armor.Tarragon; using CalamityMod.Items.Armor.TitanHeart; using CalamityMod.Items.Armor.Umbraphile; using CalamityMod.Items.Fishing.AstralCatches; @@ -415,8 +420,8 @@ namespace CalamityMod.CalPlayer if (!proj.npcProj && !proj.trap && proj.friendly) { - if (plaguebringerCarapace && CalamityProjectileSets.IsFriendlyBeeProjectile[proj.type]) - target.AddBuff(BuffType(), 300); + if (plaguebringerPatronSet && CalamityProjectileSets.IsFriendlyBeeProjectile[proj.type]) + target.AddBuff(BuffType(), PlaguebringerVisor.BeePlagueDuration); // All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile CalamityGlobalProjectile cgp = proj.Calamity(); @@ -623,7 +628,7 @@ namespace CalamityMod.CalPlayer if (item.CountsAsClass() && hideOfDeus && hideOfDeusTimer == 0) { hideOfDeusTimer = 10; - int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); + int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(HideofAstrumDeus.StarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -660,7 +665,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI); } - if (bloodflareMelee && item.CountsAsClass() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) + if (bloodflareMelee && item.CountsAsClass() && bloodflareMeleeHits < BloodflareHeadMelee.HitsToActivateFrenzy && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) bloodflareMeleeHits++; } } @@ -780,7 +785,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), geyserDamage, 0f, Player.whoAmI, 0f, 0f); } - if (bloodflareMelee && proj.IsTrueMelee() && bloodflareMeleeHits < 15 && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) + if (bloodflareMelee && proj.IsTrueMelee() && bloodflareMeleeHits < BloodflareHeadMelee.HitsToActivateFrenzy && !bloodflareFrenzy && !Player.HasCooldown(BloodflareFrenzy.ID)) bloodflareMeleeHits++; } } @@ -795,11 +800,11 @@ namespace CalamityMod.CalPlayer { if (tarraRanged && proj.CountsAsClass() && tarraRangedCooldown <= 0) { - tarraRangedCooldown = 60; + tarraRangedCooldown = TarragonHeadRanged.OnHitEffectCooldown; for (int l = 0; l < 2; l++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int leafDamage = CalamityUtils.DamageSoftCap((int)(0.25f * proj.damage), 150); + int leafDamage = CalamityUtils.DamageSoftCap((int)(proj.damage * TarragonHeadRanged.LeafDamageRatio), TarragonHeadRanged.LeafDamageSoftcap); int leaf = Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, leafDamage, 0f, Player.whoAmI); if (leaf.WithinBounds(Main.maxProjectiles)) { @@ -812,7 +817,7 @@ namespace CalamityMod.CalPlayer for (int projCount = 0; projCount < 2; projCount++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int energyDamage = CalamityUtils.DamageSoftCap((int)(0.33f * proj.damage), 200); + int energyDamage = CalamityUtils.DamageSoftCap((int)(proj.damage * TarragonHeadRanged.EnergyDamageRatio), TarragonHeadRanged.EnergyDamageSoftcap); Projectile.NewProjectile(source, proj.Center, velocity, ProjectileType(), energyDamage, 0f, proj.owner); } } @@ -850,9 +855,8 @@ namespace CalamityMod.CalPlayer { if (bloodflareMage && bloodflareMageCooldown <= 0 && crit) { - bloodflareMageCooldown = 120; - // Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons - int bloodflareFireballDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250); + bloodflareMageCooldown = BloodflareHeadMagic.BloodsplosionCooldown; + int bloodflareFireballDamage = CalamityUtils.DamageSoftCap(proj.damage * BloodflareHeadMagic.BloodsplosionDamageRatio, BloodflareHeadMagic.BloodsplosionDamageSoftcap); int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); if (fire.WithinBounds(Main.maxProjectiles)) @@ -864,10 +868,9 @@ namespace CalamityMod.CalPlayer } if (silvaMage && silvaMageCooldown <= 0 && (proj.penetrate == 1 || proj.timeLeft <= 5)) { - silvaMageCooldown = 300; + silvaMageCooldown = SilvaHeadMagic.BurstCooldown; SoundEngine.PlaySound(SoundID.Zombie103, proj.Center); //So scuffed, just because zombie sounds werent ported normally - // Silva Mage Blasts: 800 + 60%, softcap on the whole combined thing starts at 1400 - int silvaBurstDamage = CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400); + int silvaBurstDamage = CalamityUtils.DamageSoftCap(SilvaHeadMagic.BurstDamage + proj.damage * SilvaHeadMagic.BurstDamageRatio, SilvaHeadMagic.BurstDamageSoftcap); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), silvaBurstDamage, 8f, Player.whoAmI); } } @@ -938,12 +941,12 @@ namespace CalamityMod.CalPlayer } } - // Fearmonger set gains +10 frames (max 90) of regen when any minion lands any hit + // Fearmonger set gains regen duration when any minion lands any hit if (fearmongerSet) { - fearmongerRegenFrames += 10; - if (fearmongerRegenFrames > 90) - fearmongerRegenFrames = 90; + fearmongerRegenFrames += FearmongerGreathelm.RegenBoostDurationPerHit; + if (fearmongerRegenFrames > FearmongerGreathelm.RegenBoostDurationLimit) + fearmongerRegenFrames = FearmongerGreathelm.RegenBoostDurationLimit; } //Priorities: Nucleogenesis => Starbuster Core => Nuclear Rod => Jelly-Charged Battery diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index f14b13f223..8d1fc22a2d 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -18,8 +18,6 @@ namespace CalamityMod.CalPlayer.Dashes { public static new string ID => "Godslayer Armor"; - public static int GodslayerCooldown = 45; - public SlotId GSDashSlot; public static readonly SoundStyle Impact = new("CalamityMod/Sounds/NPCKilled/DevourerDeathImpact") { Volume = 0.5f }; @@ -113,7 +111,7 @@ namespace CalamityMod.CalPlayer.Dashes runSpeedDecelerationFactor = 0.8f; // Cooldown for God Slayer Armor dash. - player.AddCooldown(Cooldowns.GodSlayerDash.ID, CalamityUtils.SecondsToFrames(GodslayerCooldown)); + player.AddCooldown(Cooldowns.GodSlayerDash.ID, GodSlayerChestplate.DashCooldown); player.Calamity().godSlayerDashHotKeyPressed = false; } @@ -140,14 +138,14 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. hitContext.damageClass = player.GetBestClass(); - hitContext.BaseDamage = 3000; - hitContext.BaseKnockback = 15f; + hitContext.BaseDamage = GodSlayerChestplate.DashDamage; + hitContext.BaseKnockback = GodSlayerChestplate.DashKnockback; // God Slayer Dash intentionally does not use the vanilla function for collision attack iframes. // This is because its immunity is meant to be completely consistent and not subject to vanilla anticheese. hitContext.PlayerImmunityFrames = GodSlayerChestplate.DashIFrames; - npc.AddBuff(ModContent.BuffType(), 300); + npc.AddBuff(ModContent.BuffType(), GodSlayerChestplate.DashGodSlayerInfernoDuration); } } } diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index df2248ff57..bcce9288bc 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -1,6 +1,6 @@ using System; using CalamityMod.Enums; -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Plaguebringer; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -61,12 +61,12 @@ namespace CalamityMod.CalPlayer.Dashes if (player.velocity.X != 0f) hitDirection = Math.Sign(player.velocity.X); hitContext.HitDirection = hitDirection; - hitContext.PlayerImmunityFrames = AsgardsValor.ShieldSlamIFrames; + hitContext.PlayerImmunityFrames = PlaguebringerVisor.PlagueDashIFrames; // Define damage parameters. hitContext.damageClass = DamageClass.Summon; - hitContext.BaseDamage = 50; - hitContext.BaseKnockback = 3f; + hitContext.BaseDamage = PlaguebringerVisor.PlagueDashDamage; + hitContext.BaseKnockback = PlaguebringerVisor.PlagueDashKnockback; } } } diff --git a/Cooldowns/M1GarandShots.cs b/Cooldowns/M1GarandShots.cs new file mode 100644 index 0000000000..200f8d1c05 --- /dev/null +++ b/Cooldowns/M1GarandShots.cs @@ -0,0 +1,43 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria.Localization; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Cooldowns +{ + public class M1GarandShots : CooldownHandler + { + public float CompletionPercentage => MathF.Round(instance.Completion * 100); + private bool IsEmpty => CompletionPercentage == 100; + private float TextXOffset => -5.4f; + private Vector2 TextPosition => new(TextXOffset, 15); + private Color TextColor => Color.Silver; + private Color TextBorderColor = Color.DarkGoldenrod; + + public static new string ID => "M1GarandShots"; + public override bool CanTickDown => false; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override bool ShouldDisplay => instance.player.HeldItem.type == ItemType(); + public override string Texture => "CalamityMod/Cooldowns/" + ID; + + public override Color CooldownStartColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.DarkGoldenrod, Color.SlateGray, instance.Completion); + public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.LightGoldenrodYellow, Color.SlateGray, instance.Completion); + + public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawExpanded(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().garandShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + + public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale) + { + base.DrawCompact(spriteBatch, position, opacity, scale); + + CalamityUtils.DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.player.Calamity().garandShots.ToString(), position + TextPosition, TextColor, TextBorderColor); + } + } +} diff --git a/Cooldowns/M1GarandShots.png b/Cooldowns/M1GarandShots.png new file mode 100644 index 0000000000..b50e512ae9 Binary files /dev/null and b/Cooldowns/M1GarandShots.png differ diff --git a/Cooldowns/M1GarandShotsOutline.png b/Cooldowns/M1GarandShotsOutline.png new file mode 100644 index 0000000000..495f87eb5c Binary files /dev/null and b/Cooldowns/M1GarandShotsOutline.png differ diff --git a/Cooldowns/M1GarandShotsOverlay.png b/Cooldowns/M1GarandShotsOverlay.png new file mode 100644 index 0000000000..4d8b9e04e8 Binary files /dev/null and b/Cooldowns/M1GarandShotsOverlay.png differ diff --git a/Cooldowns/WulfrumRoverDriveCooldowns.cs b/Cooldowns/WulfrumRoverDriveCooldowns.cs index e4c6485992..9df995f04a 100644 --- a/Cooldowns/WulfrumRoverDriveCooldowns.cs +++ b/Cooldowns/WulfrumRoverDriveCooldowns.cs @@ -91,12 +91,14 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion); + public override void Tick() => instance.player.Calamity().playedRoverDriveShieldSound = false; + // Rover Drive shields are recharged as a side effect of the cooldown completing client side public override void OnCompleted() { CalamityPlayer modPlayer = instance.player.Calamity(); - if (modPlayer.roverDrive) - modPlayer.RoverDriveShieldDurability = RoverDrive.ShieldDurabilityMax; + if (modPlayer.RoverDriveShieldDurability <= 0) + modPlayer.RoverDriveShieldDurability = 1; } public override SoundStyle? EndSound => RoverDrive.ActivationSound; public override bool ShouldPlayEndSound => instance.player.Calamity().roverDrive; diff --git a/DataStructures/DebuffData.cs b/DataStructures/DebuffData.cs index 56ba9e5c0a..44e01e60ca 100644 --- a/DataStructures/DebuffData.cs +++ b/DataStructures/DebuffData.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using System.Security.Cryptography; using CalamityMod.NPCs; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; @@ -184,6 +185,21 @@ namespace CalamityMod.DataStructures output.Flat = Modifer.Flat * scaling; return output; } + /// + /// Applies a scaling amount to a StatModifier but ensures all changes end up positive + /// + /// + /// + /// + public static StatModifier ForceModifierPositiveWithScaling(StatModifier Modifer, float scaling) + { + StatModifier output = new(); + output += MathHelper.Max((Modifer.Additive - 1) * scaling,0); + output *= MathHelper.Max(1 + (Modifer.Multiplicative - 1) * scaling,1); + output.Base = MathHelper.Max(Modifer.Base * scaling,0); + output.Flat = MathHelper.Max(Modifer.Flat * scaling, 0); + return output; + } /// /// UNIMPLEMENTED. WILL BE IN A FUTURE PR diff --git a/Effects/ArsenalEffects.cs b/Effects/ArsenalEffects.cs index 41ecff817f..c0a21645a7 100644 --- a/Effects/ArsenalEffects.cs +++ b/Effects/ArsenalEffects.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Effects // Plasma public static int ArsenalPlasmaDust = ModContent.DustType(); - public static Color ArsenalPlasmaColor = Color.Lerp(Color.Green, Color.Chartreuse, 0.45f); + public static Color ArsenalPlasmaColor = new Color(154, 255, 0); // Laser public static int ArsenalLaserDust = ModContent.DustType(); public static Color ArsenalLaserColor = Color.Lerp(Color.Crimson, Color.Red, 0.45f); diff --git a/Fonts/FontAssetSystem.cs b/Fonts/FontAssetSystem.cs index b3f056c32e..ae8ef15410 100644 --- a/Fonts/FontAssetSystem.cs +++ b/Fonts/FontAssetSystem.cs @@ -7,6 +7,7 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.UI.DraedonSummoning; using ReLogic.Content; using ReLogic.Graphics; +using Terraria; using Terraria.GameContent; using Terraria.ModLoader; @@ -24,6 +25,9 @@ namespace CalamityMod.Fonts public override void OnModLoad() { + if (Main.dedServ) + return; + AddFont("Wingdings", CalamityMod.Instance.Assets.Request("Fonts/Wingdings", AssetRequestMode.ImmediateLoad).Value); //Intentionally does not have a fallback due to it already having null checks where it is utilized to prevent them from appearing AddFont("CodebreakerDialog", CalamityMod.Instance.Assets.Request("Fonts/CodebreakerDialog", AssetRequestMode.ImmediateLoad).Value, FontAssets.MouseText.Value); AddFont("Impact", CalamityMod.Instance.Assets.Request("Fonts/Impact", AssetRequestMode.ImmediateLoad).Value, FontAssets.CombatText[1].Value); diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index d56645f05f..f7428ad488 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -66,6 +66,7 @@ namespace CalamityMod.ILEditing IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; + On_NPC.NPCLoot += PreventDiabolistLootLogic; IL_Player.CollectTaxes += MakeTaxCollectorUseful; // Mechanics / features @@ -201,7 +202,6 @@ namespace CalamityMod.ILEditing On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming; IL_Projectile.CanExplodeTile += MakeMeteoriteExplodable; - IL_Main.UpdateWindyDayState += MakeWindyDayMusicPlayLessOften; IL_Main.UpdateTime_StartNight += BloodMoonsRequire200MaxLife; IL_WorldGen.AttemptFossilShattering += PreventFossilShattering; On_Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index ebcdea0eb4..b181b5b09d 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -379,6 +379,15 @@ namespace CalamityMod.ILEditing } #endregion + #region Prevent Diabolists from Dropping Stuff in GFB Before Plantera + private static void PreventDiabolistLootLogic(On_NPC.orig_NPCLoot orig, NPC self) + { + if (self.type == NPCID.DiabolistWhite && Main.getGoodWorld && !NPC.downedPlantBoss) + return; + orig(self); + } + #endregion + #region Town NPC Spawning Improvements private static void PermitNighttimeTownNPCSpawning(ILContext il) { diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 83ee5fc55a..d8b2adea5e 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -241,34 +241,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Make Windy Day Music Play Less Often - private static void MakeWindyDayMusicPlayLessOften(ILContext il) - { - // Make windy day theme only play when the wind speed is over 0.5f instead of 0.4f and make it stop when the wind dies down to below 0.44f instead of 0.34f. - var cursor = new ILCursor(il); - - FieldInfo _minWindField = typeof(Main).GetField("_minWind", BindingFlags.NonPublic | BindingFlags.Static); - - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(_minWindField))) // The min wind speed check that stops the windy day theme when the wind dies down enough. - { - LogFailure("Make Windy Day Music Play Less Often", "Could not locate the _minWind variable."); - return; - } - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, 0.44f); // Change to 0.44f. - - FieldInfo _maxWindField = typeof(Main).GetField("_maxWind", BindingFlags.NonPublic | BindingFlags.Static); - - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(_maxWindField))) // The max wind speed check that causes the windy day theme to play. - { - LogFailure("Make Windy Day Music Play Less Often", "Could not locate the _maxWind variable."); - return; - } - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, 0.5f); // Change to 0.5f. - } - #endregion Make Windy Day Music Play Less Often - #region Change Blood Moon Max HP Requirements private static void BloodMoonsRequire200MaxLife(ILContext il) { diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index a823f93126..ac6c8b1a82 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Accessories public class AmalgamatedBrain : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; + + public static int NimbusDamage => CalamityUtils.ScaleWithDifficulty(18); + public override void SetDefaults() { Item.width = 34; diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index a201961732..9036f66442 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -24,12 +24,13 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); player.statLifeMax2 += 50; + if (!player.HasBuff(BuffID.Honey)) + player.AddBuff(BuffID.Honey, 2); // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; - // Inherits all effects of Honey Dew and Living Dew (except standing regen is not honey exclusive anymore) - modPlayer.alwaysHoneyRegen = true; + // Inherits all effects of Honey Dew and Living Dew modPlayer.honeyDewHalveDebuffs = true; modPlayer.livingDewHalveDebuffs = true; @@ -43,7 +44,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", (player.Calamity().ambrosialAmpouleRegen + player.Calamity().alwaysHoneyRegenAmount).ToString("0.##")); + list.FindAndReplace("[REGEN]", player.Calamity().radiantOozeRegen.ToString("0.##")); } } diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index bf1b3b87a0..c75f44b7f4 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -10,6 +11,13 @@ namespace CalamityMod.Items.Accessories public class AngelTreads : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float RunningSpeed = 7.5f; // 6.75 from Lightning-Terraspark + public static float MoveSpeedBoost = 0.12f; + public static float FlightTimeBoost = 0.1f; + public static int LavaImmunityTime = 420; // Identical to Terraspark Boots and upgrades prior + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), FlightTimeBoost.ToPercent(), LavaImmunityTime.FramesToSeconds()); + public override void SetDefaults() { Item.width = 32; @@ -23,14 +31,14 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.angelTreads = true; - player.accRunSpeed = 7.5f; + player.accRunSpeed = RunningSpeed; player.rocketBoots = player.vanityRocketBoots = 3; - player.moveSpeed += 0.12f; + player.moveSpeed += MoveSpeedBoost; player.iceSkate = true; player.waterWalk = true; player.fireWalk = true; - player.lavaMax += 240; - player.buffImmune[BuffID.OnFire] = true; + player.lavaMax += LavaImmunityTime; + player.lavaRose = true; } public override void UpdateVanity(Player player) diff --git a/Items/Accessories/Baroclaw.cs b/Items/Accessories/Baroclaw.cs index bbc971ac6a..579a0c61c4 100644 --- a/Items/Accessories/Baroclaw.cs +++ b/Items/Accessories/Baroclaw.cs @@ -9,6 +9,9 @@ namespace CalamityMod.Items.Accessories public class Baroclaw : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int ThornsDamage => CalamityUtils.ScaleWithDifficulty(150); + public override void SetDefaults() { Item.width = 40; @@ -22,7 +25,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.baroclaw = true; - player.thorns += 2.5f; } public override void AddRecipes() { diff --git a/Items/Accessories/CrawCarapace.cs b/Items/Accessories/CrawCarapace.cs index fcb357da8a..63f99afc7e 100644 --- a/Items/Accessories/CrawCarapace.cs +++ b/Items/Accessories/CrawCarapace.cs @@ -8,6 +8,9 @@ namespace CalamityMod.Items.Accessories public class CrawCarapace : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int ThornsDamage => CalamityUtils.ScaleWithDifficulty(20); + public override void SetDefaults() { Item.width = 28; @@ -21,7 +24,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.crawCarapace = true; - player.thorns += 0.25f; } } } diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index b79a6ea9c4..623491d97d 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static readonly int MaxBonusIFrames = 30; + public static int StarDamage => CalamityUtils.ScaleWithDifficulty(130); public override void SetDefaults() { diff --git a/Items/Accessories/GrandGelatin.cs b/Items/Accessories/GrandGelatin.cs index 1bf8309fd9..a3c5b0b973 100644 --- a/Items/Accessories/GrandGelatin.cs +++ b/Items/Accessories/GrandGelatin.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public static float MoveSpeedBoost = 0.12f; public static float JumpSpeedBoost = 0.6f; // Both 12% so we only need just one in the tooltip public static int AuraLifetime = 1800; - public static int AuraRegenBoost = 6; + public static int AuraRegenBoost = 4; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AuraLifetime.FramesToSeconds(), AuraRegenBoost.ToRegenPerSecond()); public override void SetDefaults() diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index 45526da47c..cb4e4dba87 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -9,6 +9,10 @@ namespace CalamityMod.Items.Accessories public class HideofAstrumDeus : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int BlazeDamage => CalamityUtils.ScaleWithDifficulty(50); + public static int StarDamage => 75; + public override void SetDefaults() { Item.width = 26; @@ -24,7 +28,6 @@ namespace CalamityMod.Items.Accessories modPlayer.hideOfDeus = true; if (modPlayer.hideOfDeusMeleeBoostTimer > 0) player.GetDamage() += 0.3f; - player.thorns += 0.75f; } } } diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 5d8a49719e..88e6b334ed 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -13,17 +13,17 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 20; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; Item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) { player.statLifeMax2 += 10; + if (!player.HasBuff(BuffID.Honey)) + player.AddBuff(BuffID.Honey, 2); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.alwaysHoneyRegen = true; - modPlayer.honeyTurboRegen = true; modPlayer.honeyDewHalveDebuffs = true; } diff --git a/Items/Accessories/InkBomb.cs b/Items/Accessories/InkBomb.cs index 955e945460..5f7a6cad05 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -8,6 +8,9 @@ namespace CalamityMod.Items.Accessories public class InkBomb : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int InkDamage => CalamityUtils.ScaleWithDifficulty(16); + public override void SetDefaults() { Item.width = 22; @@ -21,9 +24,8 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.inkBomb = true; - modPlayer.rogueStealthMax += 0.1f; - player.Calamity().stealthGenStandstill += 0.07f; - player.Calamity().stealthGenMoving += 0.07f; + modPlayer.stealthGenStandstill += 0.07f; + modPlayer.stealthGenMoving += 0.07f; } } } diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index d384b931a1..ca84090d44 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -21,11 +21,11 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.statLifeMax2 += 25; + if (!player.HasBuff(BuffID.Honey)) + player.AddBuff(BuffID.Honey, 2); // Inherits all effects of Honey Dew CalamityPlayer modPlayer = player.Calamity(); - modPlayer.alwaysHoneyRegen = true; - modPlayer.honeyTurboRegen = true; modPlayer.honeyDewHalveDebuffs = true; modPlayer.livingDewHalveDebuffs = true; } diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index ba2d8f31ff..7fbffc9bb8 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -35,12 +35,13 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); player.statLifeMax2 += 70; + if (!player.HasBuff(BuffID.Honey)) + player.AddBuff(BuffID.Honey, 2); // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving modPlayer.purity = true; // Inherits effects from Honey Dew and Living Dew - modPlayer.alwaysHoneyRegen = true; modPlayer.honeyDewHalveDebuffs = true; modPlayer.livingDewHalveDebuffs = true; @@ -55,7 +56,7 @@ namespace CalamityMod.Items.Accessories var player = Main.LocalPlayer; if (player != null) { - list.FindAndReplace("[REGEN]", (player.Calamity().purityRegen + player.Calamity().alwaysHoneyRegenAmount).ToString("0.##")); + list.FindAndReplace("[REGEN]", player.Calamity().purityRegen.ToString("0.##")); list.FindAndReplace("[DEFENSE]", player.Calamity().jewelBonusDefense.ToString()); } } diff --git a/Items/Accessories/Regenerator.cs b/Items/Accessories/Regenerator.cs index ea319a1373..8161d9d105 100644 --- a/Items/Accessories/Regenerator.cs +++ b/Items/Accessories/Regenerator.cs @@ -1,11 +1,11 @@ -using CalamityMod.CalPlayer; +using System; +using System.Collections.Generic; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework; using Terraria.Localization; -using System.Collections.Generic; -using System; +using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { @@ -13,6 +13,13 @@ namespace CalamityMod.Items.Accessories public class Regenerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static float HealthRatioCap = 0.5f; + public static int FramesPerHeal = 8; + public static int RegenTimeBoost = 4; // on top of +1/s regular increment + public static float RegenToDamageRatio = 0.015f; // per regen point + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HealthRatioCap.ToPercent(), (60 / (float)FramesPerHeal).Round()); + public override void SetDefaults() { Item.width = 34; diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 8f2dd3ad50..c5f4da845c 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -9,6 +9,9 @@ namespace CalamityMod.Items.Accessories public class RottenBrain : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int NimbusDamage => CalamityUtils.ScaleWithDifficulty(8); + public override void SetDefaults() { Item.width = 34; diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index bc9c49a36c..dd70db074e 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -11,6 +11,7 @@ using Terraria; using Terraria.Audio; using Terraria.Graphics.Effects; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -25,7 +26,9 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static int ShieldDurabilityMax = 20; - public static int ShieldRechargeTime = CalamityUtils.SecondsToFrames(10); + public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(10); + public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(5); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ShieldDurabilityMax, ShieldRechargeDelay.FramesToSeconds(), TotalShieldRechargeTime.FramesToSeconds()); // Interface stuff. public int OwnerPlayer { get; set; } diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index 798f0c4020..9d8c0fadec 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Accessories Vector2 shoveVelocity = Utils.DirectionTo(player.Center, npc.Center) * (Main.zenithWorld ? 35f : 12.5f) - Vector2.UnitY * 6f; npc.MoveNPC(Vector2.Normalize(shoveVelocity), shoveVelocity.Length(), true); - int scaledFallDamage = ShoveFallBaseDamage * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1) * (Main.zenithWorld ? 10 : 1); + int scaledFallDamage = CalamityUtils.ScaleWithDifficulty(ShoveFallBaseDamage) * (Main.zenithWorld ? 10 : 1); if (empowered) npc.FlungNPC().ApplyCollisionDamage(npc, player, scaledFallDamage, shoveVelocity * 0.5f, 5f, true); else @@ -103,7 +103,7 @@ namespace CalamityMod.Items.Accessories { if (empowered) { - int scaledImmuneDamage = ImmuneToShoveBaseDamage * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1) * (Main.zenithWorld ? 10 : 1); + int scaledImmuneDamage = CalamityUtils.ScaleWithDifficulty(ImmuneToShoveBaseDamage) * (Main.zenithWorld ? 10 : 1); Projectile.NewProjectile(player.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), scaledImmuneDamage, 0f, player.whoAmI, npc.whoAmI); } diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index a054aba516..08416580fe 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Accessories public static float MoveSpeedBoost = 0.12f; public static float JumpSpeedBoost = 0.6f; // Both 12% so we only need just one in the tooltip - public static float ThornsBoost = 3.5f; + public static int ThornsDamage => CalamityUtils.ScaleWithDifficulty(200); public static int AuraLifetime = 1800; - public static int AuraRegenBoost = 6; + public static int AuraRegenBoost = 4; public static float AuraDamageBoost = 0.08f; public static float AuraDamageReductionBoost = 0.05f; public static float DamageTakenHealedPercent = 0.05f; diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 6344183f9d..d8c8cc6475 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -16,6 +16,9 @@ namespace CalamityMod.Items.Accessories public class TheAmalgam : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; + + public static int NimbusDamage => CalamityUtils.ScaleWithDifficulty(200); + public override void SetStaticDefaults() { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(9, 6)); diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 6c1c3ee7e9..de3d6a916f 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -15,6 +15,7 @@ using Terraria.DataStructures; using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -33,11 +34,10 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; public static int ShieldDurabilityMax = 120; + public static float ShieldActiveDamageReduction = 0.1f; public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(8); // Was 6, then was 9 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(10); // Was 6 - - // While active, The Sponge gives 10% DR - public static float ShieldActiveDamageReduction = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(ShieldDurabilityMax, ShieldActiveDamageReduction.ToPercent(), ShieldRechargeDelay.FramesToSeconds(), TotalShieldRechargeTime.FramesToSeconds()); public int OwnerPlayer { get; set; } public float RenderDepth => IDyeableShaderRenderer.SpongeShieldDepth; diff --git a/Items/Armor/Aerospec/AerospecBreastplate.cs b/Items/Armor/Aerospec/AerospecBreastplate.cs index acd1344852..97e9ae7fbd 100644 --- a/Items/Armor/Aerospec/AerospecBreastplate.cs +++ b/Items/Armor/Aerospec/AerospecBreastplate.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Armor.Aerospec // Common Set Bonus public static int SetBonusHurtDamageThreshold = 25; - public static int SetBonusFeatherDamage = 30; + public static int SetBonusFeatherDamage => CalamityUtils.ScaleWithDifficulty(15); public static float SetBonusFallSpeed = 15f; public override void SetDefaults() diff --git a/Items/Armor/Aerospec/AerospecHeadMagic.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs index 3c66e85984..d2a019c966 100644 --- a/Items/Armor/Aerospec/AerospecHeadMagic.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -31,20 +31,13 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 3; //15 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusManaCostReduction.ToPercent(), SetBonusMoveSpeedBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusManaCostReduction.ToPercent(), SetBonusMoveSpeedBoost.ToPercent(), AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; diff --git a/Items/Armor/Aerospec/AerospecHeadMelee.cs b/Items/Armor/Aerospec/AerospecHeadMelee.cs index 070471a1d6..c229ad325c 100644 --- a/Items/Armor/Aerospec/AerospecHeadMelee.cs +++ b/Items/Armor/Aerospec/AerospecHeadMelee.cs @@ -30,20 +30,13 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 7; //20 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent(), AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; diff --git a/Items/Armor/Aerospec/AerospecHeadRanged.cs b/Items/Armor/Aerospec/AerospecHeadRanged.cs index 7953422862..a4baae9a58 100644 --- a/Items/Armor/Aerospec/AerospecHeadRanged.cs +++ b/Items/Armor/Aerospec/AerospecHeadRanged.cs @@ -29,20 +29,13 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 5; //18 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent(), AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; diff --git a/Items/Armor/Aerospec/AerospecHeadRogue.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs index 5ada7136eb..2d563a31a1 100644 --- a/Items/Armor/Aerospec/AerospecHeadRogue.cs +++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs @@ -37,20 +37,13 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 4; //17 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusMoveSpeedBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusMoveSpeedBoost.ToPercent(), AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; diff --git a/Items/Armor/Aerospec/AerospecHeadSummon.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs index 5543fb9945..4cfabb9185 100644 --- a/Items/Armor/Aerospec/AerospecHeadSummon.cs +++ b/Items/Armor/Aerospec/AerospecHeadSummon.cs @@ -34,20 +34,13 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 2; //13 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.valkyrie = true; modPlayer.aeroSet = true; diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index cdc97de8ed..9d5c5ff701 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -10,6 +10,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric @@ -17,7 +18,6 @@ namespace CalamityMod.Items.Armor.Auric [AutoloadEquip(EquipType.Body)] public class AuricTeslaBodyArmor : ModItem, ILocalizedModType { - public static int setBonusTooltipNumber = 0; //Set this to zero so the first Shift pressed will increment it to 1. public static bool holdingShift = false; public static Color tooltipTarragonColor = new(194, 255, 194); @@ -25,6 +25,11 @@ namespace CalamityMod.Items.Armor.Auric public static Color tooltipSilvaColor = new(246, 255, 194); public static Color tooltipGodslayerColor = new(204, 194, 255); public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.16f; + public static int CritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + public override void Load() { // All code below runs only if we're not loading on a server @@ -40,17 +45,16 @@ namespace CalamityMod.Items.Armor.Auric Item.width = 38; Item.height = 34; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 48; + Item.defense = 44; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - player.statLifeMax2 += 50; - player.GetDamage() += 0.08f; - player.GetCritChance() += 5; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } + public override void ModifyTooltips(List tooltips) { //This just runs the ModifyTooltips for whatever helmet is equipped if a full auric set is equipped; but runs it on this item's tooltips. diff --git a/Items/Armor/Auric/AuricTeslaCuisses.cs b/Items/Armor/Auric/AuricTeslaCuisses.cs index fc02b0dc0e..8d7918c639 100644 --- a/Items/Armor/Auric/AuricTeslaCuisses.cs +++ b/Items/Armor/Auric/AuricTeslaCuisses.cs @@ -8,6 +8,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric @@ -16,22 +17,29 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.12f; + public static int CritBoost = 10; + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 44; + Item.defense = 42; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.1f; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; player.carpet = true; - player.GetDamage() += 0.12f; - player.GetCritChance() += 5; } + public override void ModifyTooltips(List tooltips) { //This just runs the ModifyTooltips for whatever helmet is equipped if a full auric set is equipped; but runs it on this item's tooltips. diff --git a/Items/Armor/Auric/AuricTeslaHeadMagic.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs index 94f03805a8..7231f09ff0 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMagic.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -7,7 +7,10 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Bloodflare.BloodflareHeadMagic; +using static CalamityMod.Items.Armor.Silva.SilvaArmor; namespace CalamityMod.Items.Armor.Auric { @@ -16,24 +19,25 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MaxManaBoost = 100; + public static float ManaCostReduction = 0.2f; + public static float MagicDamageBoost = 0.22f; + public static int MagicCritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 24; //132 + Item.defense = 24; // 110 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { @@ -46,9 +50,7 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSet = true; modPlayer.silvaMage = true; modPlayer.auricSet = true; - player.thorns += 3f; - player.ignoreWater = true; - player.crimsonRegen = true; + player.crimsonRegen = true; // Inherited from Bloodflare } public override void ModifyTooltips(List tooltips) @@ -68,7 +70,10 @@ namespace CalamityMod.Items.Armor.Auric if (line.Name == "SetBonus") { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipSilvaColor }; - line.Text = this.GetLocalizedValue($"SetBonus{setBonusTooltipNumber}"); + var LocalizedText = this.GetLocalization($"SetBonus{setBonusTooltipNumber}"); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(SetBonusRegenBoost.ToRegenPerSecond(), AccelerationBoost.ToPercent(), ReviveDuration.FramesToSeconds(), (ReviveCooldown / 60).FramesToSeconds()) + : setBonusTooltipNumber == 2 ? LocalizedText.Format(GhostBoltCooldown.FramesToSeconds(), BloodsplosionCooldown.FramesToSeconds()) + : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } @@ -80,12 +85,10 @@ namespace CalamityMod.Items.Armor.Auric } public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.auricBoost = true; - player.manaCost -= 0.2f; - player.GetDamage() += 0.3f; - player.GetCritChance() += 20; - player.statManaMax2 += 100; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Auric/AuricTeslaHeadMelee.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs index a77c7f55cf..33839d713e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadMelee.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -10,6 +10,9 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Bloodflare.BloodflareHeadMelee; +using static CalamityMod.Items.Armor.GodSlayer.GodSlayerHeadMelee; +using static CalamityMod.Items.Armor.Tarragon.TarragonHeadMelee; namespace CalamityMod.Items.Armor.Auric { @@ -19,30 +22,31 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MeleeDamageBoost = 0.12f; + public static float MeleeSpeedBoost = 0.28f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 1200; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 54; //132 + Item.defense = 54; // 140 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { player.setBonus = this.GetLocalizedValue("SetBonus"); var modPlayer = player.Calamity(); - player.GetAttackSpeed() += 0.28f; modPlayer.tarraSet = true; modPlayer.tarraMelee = true; modPlayer.bloodflareSet = true; @@ -51,10 +55,8 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayerDamage = true; modPlayer.auricSet = true; modPlayer.auricSetMelee = true; - player.thorns += 3f; - player.ignoreWater = true; - player.crimsonRegen = true; - player.aggro += 1200; + player.crimsonRegen = true; // Inherited from Bloodflare + player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; @@ -62,11 +64,10 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.auricBoost = true; - player.GetDamage() += 0.2f; - player.GetCritChance() += 10; + player.GetDamage() += MeleeDamageBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } + public override void ModifyTooltips(List tooltips) { ref var holdingShift = ref AuricTeslaBodyArmor.holdingShift; @@ -85,7 +86,9 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey())); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(SetBonusHurtDamageThreshold, CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodSlayerChestplate.DashCooldown.FramesToSeconds()) + : setBonusTooltipNumber == 2 ? LocalizedText.Format(HitsToActivateFrenzy, FrenzyDuration.FramesToSeconds(), FrenzyMeleeDamageBoost.ToPercent(), FrenzyContactDamageReduction.ToPercent(), FrenzyCooldown.FramesToSeconds()) + : LocalizedText.Format(TarraLifeRegenBoost.ToRegenPerSecond(), CalamityUtils.GetArmorSetBonusKey(), CloakDuration.FramesToSeconds(), CloakCooldown.FramesToSeconds())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaHeadRanged.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs index f143ce6580..cd28653a58 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRanged.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -8,7 +8,10 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Bloodflare.BloodflareHeadRanged; +using static CalamityMod.Items.Armor.GodSlayer.GodSlayerHeadRanged; namespace CalamityMod.Items.Armor.Auric { @@ -17,24 +20,23 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RangedDamageBoost = 0.22f; + public static int RangedCritBoost = 20; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 40; //132 + Item.defense = 39; // 125 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { @@ -47,9 +49,7 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; modPlayer.auricSet = true; - player.thorns += 3f; - player.ignoreWater = true; - player.crimsonRegen = true; + player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; @@ -57,11 +57,10 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.auricBoost = true; - player.GetDamage() += 0.3f; - player.GetCritChance() += 30; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } + public override void ModifyTooltips(List tooltips) { ref var holdingShift = ref AuricTeslaBodyArmor.holdingShift; @@ -80,7 +79,9 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey()) : LocalizedText.Format()); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(ShrapnelRoundCooldown.FramesToSeconds(), CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodSlayerChestplate.DashCooldown.FramesToSeconds()) + : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds()) + : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index 78fe5227c7..6e73e4e0cc 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -8,7 +8,11 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Bloodflare.BloodflareHeadRogue; +using static CalamityMod.Items.Armor.GodSlayer.GodSlayerHeadRogue; +using static CalamityMod.Items.Armor.Tarragon.TarragonHeadRogue; namespace CalamityMod.Items.Armor.Auric { @@ -17,28 +21,31 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.17f; + public static int RogueCritBoost = 10; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.3f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 34; //132 + Item.defense = 34; // 120 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; @@ -47,11 +54,9 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.godSlayer = true; modPlayer.godSlayerThrowing = true; modPlayer.auricSet = true; - modPlayer.rogueStealthMax += 1.3f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.thorns += 3f; - player.ignoreWater = true; - player.crimsonRegen = true; + player.crimsonRegen = true; // Inherited from Bloodflare if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) modPlayer.DeferredDashID = GodslayerArmorDash.ID; @@ -59,12 +64,11 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.auricBoost = true; - player.GetDamage() += 0.2f; - player.GetCritChance() += 20; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } + public override void ModifyTooltips(List tooltips) { ref var holdingShift = ref AuricTeslaBodyArmor.holdingShift; @@ -83,7 +87,9 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format()); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodSlayerChestplate.DashCooldown.FramesToSeconds()) + : setBonusTooltipNumber == 2 ? LocalizedText.Format(DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()) + : LocalizedText.Format(CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaHeadSummon.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs index 44c56a3720..afe538c9a8 100644 --- a/Items/Armor/Auric/AuricTeslaHeadSummon.cs +++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs @@ -7,7 +7,10 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Bloodflare.BloodflareHeadSummon; +using static CalamityMod.Items.Armor.Silva.SilvaArmor; namespace CalamityMod.Items.Armor.Auric { @@ -16,28 +19,32 @@ namespace CalamityMod.Items.Armor.Auric public class AuricTeslaHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MinionSlotBoost = 2; + public static float SummonDamageBoost = 0.32f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 4; + public static float SetBonusSummonDamageBoost = 0.55f; + public static int CrystalDamage = 500; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 12; //132 + Item.defense = 18; // 104 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()); var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraSummon = true; @@ -47,19 +54,17 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.silvaSummon = true; modPlayer.auricSet = true; modPlayer.WearingPostMLSummonerSet = true; - player.thorns += 3f; - player.ignoreWater = true; - player.crimsonRegen = true; - player.GetDamage() += 0.75f; - player.maxMinions += 6; + player.crimsonRegen = true; // Inherited from Bloodflare + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - modPlayer.auricBoost = true; - player.GetDamage() += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } + public override void ModifyTooltips(List tooltips) { ref var holdingShift = ref AuricTeslaBodyArmor.holdingShift; @@ -77,7 +82,10 @@ namespace CalamityMod.Items.Armor.Auric if (line.Name == "SetBonus") { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipSilvaColor }; - line.Text = this.GetLocalizedValue($"SetBonus{setBonusTooltipNumber}"); + var LocalizedText = this.GetLocalization($"SetBonus{setBonusTooltipNumber}"); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(SetBonusRegenBoost.ToRegenPerSecond(), AccelerationBoost.ToPercent(), ReviveDuration.FramesToSeconds(), (ReviveCooldown / 60).FramesToSeconds()) + : setBonusTooltipNumber == 2 ? LocalizedText.Format(DefenseBoostBelowHealthThreshold, DefenseBoostHealthThreshold.ToPercent()) + : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs index b9370b9752..5dcf752f3e 100644 --- a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs +++ b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -10,20 +11,24 @@ namespace CalamityMod.Items.Armor.Bloodflare public class BloodflareBodyArmor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.12f; + public static int CritBoost = 8; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 35; + Item.defense = 36; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.statLifeMax2 += 25; - player.GetDamage() += 0.12f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareCuisses.cs b/Items/Armor/Bloodflare/BloodflareCuisses.cs index e604477feb..b037201ed0 100644 --- a/Items/Armor/Bloodflare/BloodflareCuisses.cs +++ b/Items/Armor/Bloodflare/BloodflareCuisses.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -10,20 +11,26 @@ namespace CalamityMod.Items.Armor.Bloodflare public class BloodflareCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.1f; + public static int CritBoost = 7; + public static float MoveSpeedBoost = 0.17f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 29; + Item.defense = 28; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.17f; - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index cff6ab1e36..783c0285e0 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -12,40 +13,49 @@ namespace CalamityMod.Items.Armor.Bloodflare public class BloodflareHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MaxManaBoost = 100; + public static float ManaCostReduction = 0.17f; + public static float MagicDamageBoost = 0.2f; + public static int MagicCritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + + // Set Bonus + public static int GhostBoltCooldown = CalamityUtils.SecondsToFrames(1.67f); + public static double GhostBoltDamageRatio = 1.3D; + public static int GhostBoltonDamageSoftcap = 2600; + public static int BloodsplosionCooldown = CalamityUtils.SecondsToFrames(2); + public static double BloodsplosionDamageRatio = 0.5D; + public static int BloodsplosionDamageSoftcap = 250; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 22; //85 + Item.defense = 18; // 82 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; modPlayer.bloodflareMage = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(GhostBoltCooldown.FramesToSeconds(), BloodsplosionCooldown.FramesToSeconds()); player.crimsonRegen = true; } public override void UpdateEquip(Player player) { - player.manaCost -= 0.17f; - player.GetDamage() += 0.2f; - player.GetCritChance() += 10; - player.statManaMax2 += 100; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs index a65be7a702..820ab011c6 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMelee.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMelee.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -12,40 +13,49 @@ namespace CalamityMod.Items.Armor.Bloodflare public class BloodflareHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MeleeDamageBoost = 0.1f; + public static int MeleeCritBoost = 5; + public static float MeleeSpeedBoost = 0.18f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost, MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 900; + public static int HitsToActivateFrenzy = 15; + public static float FrenzyMeleeDamageBoost = 0.25f; + public static int FrenzyMeleeCritBoost = 25; // NOTE: Tooltip shares this number with damage % as they're equal + public static double FrenzyContactDamageReduction = 0.5D; + public static int FrenzyDuration = CalamityUtils.SecondsToFrames(5); + public static int FrenzyCooldown = CalamityUtils.SecondsToFrames(30); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 49; //85 + Item.defense = 44; // 108 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - player.GetAttackSpeed() += 0.18f; modPlayer.bloodflareSet = true; modPlayer.bloodflareMelee = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.aggro += SetBonusAggroBoost; + player.setBonus = this.GetLocalization("SetBonus").Format(HitsToActivateFrenzy, FrenzyDuration.FramesToSeconds(), FrenzyMeleeDamageBoost.ToPercent(), FrenzyContactDamageReduction.ToPercent(), FrenzyCooldown.FramesToSeconds()); player.crimsonRegen = true; - player.aggro += 900; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 5; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index 58e7430499..f21e5bd410 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -4,6 +4,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -15,38 +16,44 @@ namespace CalamityMod.Items.Armor.Bloodflare public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/BloodflareRangerActivation"); + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + + // Set Bonus + public static int SoulCooldown = CalamityUtils.SecondsToFrames(30); + public static int SoulDamage = 300; + public static int SoulAmount = 16; + public static int BloodBombCooldown = CalamityUtils.SecondsToFrames(2.5f); + public static double BloodBombDamageRatio = 0.8D; + public static int BloodBombDamageSoftcap = 120; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 34; //85 + Item.defense = 30; // 94 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), SoulCooldown.FramesToSeconds(), BloodBombCooldown.FramesToSeconds()); player.crimsonRegen = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 10; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index fbf4e7f488..9cfac4e338 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -12,41 +13,46 @@ namespace CalamityMod.Items.Armor.Bloodflare public class BloodflareHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.15f; + public static int RogueCritBoost = 10; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.2f; + public static int DefenseBoostAboveHealthThreshold = 30; + public static float DefenseBoostHealthThreshold = 0.8f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 28; //85 + Item.defense = 26; // 90 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; modPlayer.bloodflareThrowing = true; - modPlayer.rogueStealthMax += 1.2f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); player.crimsonRegen = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 10; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs index 20e647a2cb..41ec5c1295 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadSummon.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadSummon.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Bloodflare @@ -14,24 +15,30 @@ namespace CalamityMod.Items.Armor.Bloodflare public new string LocalizationCategory => "Items.Armor.PostMoonLord"; internal static string GhostMineEntitySourceContext => "SetBonus_Calamity_BloodflareSummon"; + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.3f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 2; + public static float SetBonusSummonDamageBoost = 0.3f; + public static int MineDamage = 3750; + public static int MineCooldown = 900; + public static int DefenseBoostBelowHealthThreshold = 20; + public static float DefenseBoostHealthThreshold = 0.5f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.defense = 16; //85 + Item.defense = 12; // 76 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadowSubtle = true; public override void UpdateArmorSet(Player player) { @@ -39,15 +46,16 @@ namespace CalamityMod.Items.Armor.Bloodflare modPlayer.bloodflareSet = true; modPlayer.bloodflareSummon = true; modPlayer.WearingPostMLSummonerSet = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), DefenseBoostBelowHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); player.crimsonRegen = true; - player.GetDamage() += 0.5f; - player.maxMinions += 3; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadRanged.cs b/Items/Armor/Daedalus/DaedalusHeadRanged.cs index 27b8fdb48a..22eff4e7fb 100644 --- a/Items/Armor/Daedalus/DaedalusHeadRanged.cs +++ b/Items/Armor/Daedalus/DaedalusHeadRanged.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); // Set Bonus - public static int ShardDamage = 60; + public static int ShardDamage => CalamityUtils.ScaleWithDifficulty(30); public override void SetDefaults() { diff --git a/Items/Armor/Demonshade/DemonshadeBreastplate.cs b/Items/Armor/Demonshade/DemonshadeBreastplate.cs index 4119d966ad..343b4d953b 100644 --- a/Items/Armor/Demonshade/DemonshadeBreastplate.cs +++ b/Items/Armor/Demonshade/DemonshadeBreastplate.cs @@ -4,6 +4,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Demonshade @@ -14,6 +15,12 @@ namespace CalamityMod.Items.Armor.Demonshade public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public string FrontArmTexture => "CalamityMod/Items/Armor/Demonshade/DemonshadeBreastplate_Arms"; + public static int MaxManaBoost = 200; + public static float DamageBoost = 0.15f; + public static int CritBoost = 15; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MeleeSpeedBoost = 0.25f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent(), MeleeSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -28,12 +35,10 @@ namespace CalamityMod.Items.Armor.Demonshade { var modPlayer = player.Calamity(); modPlayer.shadeRegen = true; - player.thorns += 100f; - player.statLifeMax2 += 50; - player.statManaMax2 += 200; - player.GetDamage() += 0.15f; - player.GetCritChance() += 15; - player.GetAttackSpeed() += 0.25f; + player.statManaMax2 += MaxManaBoost; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Demonshade/DemonshadeGreaves.cs b/Items/Armor/Demonshade/DemonshadeGreaves.cs index 013b25a960..3a10e1a186 100644 --- a/Items/Armor/Demonshade/DemonshadeGreaves.cs +++ b/Items/Armor/Demonshade/DemonshadeGreaves.cs @@ -11,6 +11,11 @@ namespace CalamityMod.Items.Armor.Demonshade public class DemonshadeGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + // Shadow Speed... (elusive) + public static float MoveSpeedBoost = 0.3f; + public static float AccelerationBoost = 0.5f; + public override void SetDefaults() { Item.width = 18; @@ -26,7 +31,7 @@ namespace CalamityMod.Items.Armor.Demonshade { var modPlayer = player.Calamity(); modPlayer.shadowSpeed = true; - player.moveSpeed += 0.3f; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index b245974237..8a4ddf570a 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -9,6 +9,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Demonshade @@ -20,7 +21,18 @@ namespace CalamityMod.Items.Armor.Demonshade public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DemonshadeEnrage"); internal static string ShadowScytheEntitySourceContext => "SetBonus_Calamity_Demonshade"; + public static int MinionSlotBoost = 2; + public static float DamageBoost = 0.3f; + public static int CritBoost = 15; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, DamageBoost.ToPercent(), CritBoost); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 8; + public static float SetBonusSummonDamageBoost = 1f; public static int DevilDamage = 1000; + public static int BeamDamage => CalamityUtils.ScaleWithDifficulty(300); + public static int ScytheDamage => CalamityUtils.ScaleWithDifficulty(500); + public static int EnrageDuration = CalamityUtils.SecondsToFrames(10); public static float MultDamageBoost = 0.5f; public static double MultDamageTakenBoost = 0.25D; @@ -34,10 +46,7 @@ namespace CalamityMod.Items.Armor.Demonshade Item.Calamity().devItem = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -47,7 +56,7 @@ namespace CalamityMod.Items.Armor.Demonshade public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), CalamityUtils.GetArmorSetBonusKey(), EnrageDuration.FramesToSeconds(), (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); var modPlayer = player.Calamity(); modPlayer.dsSetBonus = true; modPlayer.wearingRogueArmor = true; @@ -68,14 +77,15 @@ namespace CalamityMod.Items.Armor.Demonshade devil.originalDamage = DevilDamage; } } - player.GetDamage() += 1f; - player.maxMinions += 10; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.3f; - player.GetCritChance() += 15; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Empyrean/EmpyreanCloak.cs b/Items/Armor/Empyrean/EmpyreanCloak.cs index d776dddcfb..4d16ffe959 100644 --- a/Items/Armor/Empyrean/EmpyreanCloak.cs +++ b/Items/Armor/Empyrean/EmpyreanCloak.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanCloak : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.12f; + public static int RogueCritBoost = 8; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost); + public override void Load() { if (!Main.dedServ) @@ -21,7 +27,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); @@ -36,13 +41,13 @@ namespace CalamityMod.Items.Armor.Empyrean Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 27; + Item.defense = 24; } public override void UpdateEquip(Player player) { - player.GetCritChance() += 7; - player.GetDamage() += 0.07f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Empyrean/EmpyreanCuisses.cs b/Items/Armor/Empyrean/EmpyreanCuisses.cs index 9480df2faf..ff7916ea14 100644 --- a/Items/Armor/Empyrean/EmpyreanCuisses.cs +++ b/Items/Armor/Empyrean/EmpyreanCuisses.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -10,20 +11,26 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.08f; + public static int RogueCritBoost = 8; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 24; + Item.defense = 20; } public override void UpdateEquip(Player player) { - player.GetCritChance() += 5; - player.GetDamage() += 0.05f; - player.moveSpeed += 0.15f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index 87b20de371..1bc1475cd6 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Empyrean @@ -12,6 +13,20 @@ namespace CalamityMod.Items.Armor.Empyrean public class EmpyreanMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.12f; + public static int RogueCritBoost = 7; + public static float RogueVelocityBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, RogueVelocityBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.15f; + public static int WrathDuration = CalamityUtils.SecondsToFrames(3); + public static float PermanentWrathHealthRatio = 0.5f; + public static float WrathRogueDamageBoost = 0.1f; + public static int WrathRogueCritBoost = 5; + // There's 10 or so different magic numbers polluting CalamityPlayerOnHit for each projectile. I'm not adding it. - Iris + public override void Load() { if (!Main.dedServ) @@ -25,7 +40,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -45,13 +59,10 @@ namespace CalamityMod.Items.Armor.Empyrean Item.height = 18; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.defense = 20; //71 + Item.defense = 16; // 60 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -65,20 +76,18 @@ namespace CalamityMod.Items.Armor.Empyrean { var modPlayer = player.Calamity(); modPlayer.xerocSet = true; - modPlayer.rogueStealthMax += 1.15f; - player.setBonus = this.GetLocalizedValue("SetBonus"); - if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) + modPlayer.rogueStealthMax += SetBonusRogueStealth; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); + if (player.statLife <= (int)(player.statLifeMax2 * PermanentWrathHealthRatio)) player.AddBuff(ModContent.BuffType(), 2); - player.GetDamage() += 0.09f; - modPlayer.rogueVelocity += 0.09f; modPlayer.wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.11f; - player.GetCritChance() += 11; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.Calamity().rogueVelocity += RogueVelocityBoost; } public override void AddRecipes() diff --git a/Items/Armor/Fearmonger/FearmongerGreathelm.cs b/Items/Armor/Fearmonger/FearmongerGreathelm.cs index ade4c8e7b0..f4c2532956 100644 --- a/Items/Armor/Fearmonger/FearmongerGreathelm.cs +++ b/Items/Armor/Fearmonger/FearmongerGreathelm.cs @@ -5,6 +5,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Fearmonger @@ -13,45 +14,52 @@ namespace CalamityMod.Items.Armor.Fearmonger public class FearmongerGreathelm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MaxManaBoost = 60; + public static float ManaCostReduction = 0.1f; + public static float SummonDamageBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 2; + public static int RegenBoostDurationPerHit = CalamityUtils.SecondsToFrames(0.17f); + public static int RegenBoostDurationLimit = CalamityUtils.SecondsToFrames(1.5f); + public static int MinionRegenBoost = 5; + public static int MinionRegenTimeBoost = 4; + public static int MinionRegenTimeFloor = 900; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 38; // 132 total + Item.defense = 35; // 125 Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.statManaMax2 += 60; - player.GetDamage() += 0.1f; - player.manaCost -= 0.1f; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += SummonDamageBoost; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, MinionRegenBoost.ToRegenPerSecond()); - // This bool encompasses cross-class nerf immunity, colossal life regen on minion attack, and the holiday moon DR + // This bool encompasses cross-class nerf immunity and colossal life regen on minion attack // TODO -- Fearmonger life regen from minion attacks needs some sort of cool visual effect player.Calamity().fearmongerSet = true; // All-class armors count as rogue sets, but don't grant stealth bonuses player.Calamity().wearingRogueArmor = true; player.Calamity().WearingPostMLSummonerSet = true; - player.GetDamage() += 0.2f; - player.maxMinions += 2; + player.maxMinions += SetBonusMinionSlotBoost; int[] immuneDebuffs = { BuffID.OnFire, diff --git a/Items/Armor/Fearmonger/FearmongerGreaves.cs b/Items/Armor/Fearmonger/FearmongerGreaves.cs index 37a4444b3c..fa54151a89 100644 --- a/Items/Armor/Fearmonger/FearmongerGreaves.cs +++ b/Items/Armor/Fearmonger/FearmongerGreaves.cs @@ -3,6 +3,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Fearmonger @@ -11,21 +12,24 @@ namespace CalamityMod.Items.Armor.Fearmonger public class FearmongerGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.1f; + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 44; + Item.defense = 42; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.06f; - player.GetKnockback() += 0.5f; - player.moveSpeed += 0.1f; - player.panic = true; + player.GetDamage() += DamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Fearmonger/FearmongerPlateMail.cs b/Items/Armor/Fearmonger/FearmongerPlateMail.cs index 12cdb7a6fb..768d743c3e 100644 --- a/Items/Armor/Fearmonger/FearmongerPlateMail.cs +++ b/Items/Armor/Fearmonger/FearmongerPlateMail.cs @@ -3,6 +3,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Fearmonger @@ -11,21 +12,28 @@ namespace CalamityMod.Items.Armor.Fearmonger public class FearmongerPlateMail : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.1f; + public static int CritBoost = 5; + public static int MaxLifeBoost = 100; + public static float DamageReductionBoost = 0.08f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, MaxLifeBoost, DamageReductionBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 50; + Item.defense = 48; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.statLifeMax2 += 100; - player.endurance += 0.08f; - player.GetDamage() += 0.05f; - player.GetCritChance() += 5; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.statLifeMax2 += MaxLifeBoost; + player.endurance += DamageReductionBoost; } public override void AddRecipes() diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 3c860e87a8..a8733ae713 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -64,10 +64,8 @@ namespace CalamityMod.Items.Armor.GemTech Item.Calamity().donorItem = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ItemType() && legs.type == ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType() && legs.type == ItemType(); + public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType() && player.armor[2].type == ItemType(); public override void UpdateArmorSet(Player player) @@ -79,7 +77,8 @@ namespace CalamityMod.Items.Armor.GemTech if (player.Calamity().GemTechState.IsYellowGemActive) player.GetAttackSpeed() += MeleeSpeedBoost; - player.setBonus = "Mucho Texto"; //Replaced below + Color AbilityBriefColor = Color.Lerp(Color.White, Main.DiscoColor, 0.3f); + player.setBonus = this.GetLocalization("AbilityBrief").Format(AbilityBriefColor.Hex3()); // Added below } public static void ModifySetTooltips(ModItem item, List tooltips) @@ -90,24 +89,22 @@ namespace CalamityMod.Items.Armor.GemTech if (setBonusIndex != -1) { - tooltips[setBonusIndex].Text = CalamityUtils.GetTextValueFromModItem("AbilityBrief"); - tooltips[setBonusIndex].OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.3f); - if (!Main.keyState.PressingShift()) { + setBonusIndex++; TooltipLine briefDescription = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem("AbilityDescription")); briefDescription.OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.5f); - tooltips.Insert(setBonusIndex + 1, briefDescription); + tooltips.Insert(setBonusIndex, briefDescription); - TooltipLine itemDisplay = new TooltipLine(item.Mod, "CalamityMod:ExpandedDisplay", CalamityUtils.GetTextValue("Misc.ShiftToExpand")); - itemDisplay.OverrideColor = new Color(190, 190, 190); - tooltips.Add(itemDisplay); + setBonusIndex++; + TooltipLine holdShiftIndicator = new TooltipLine(item.Mod, IHoldShiftTooltipItem.ExtensionIndicatorTooltipID, CalamityUtils.GetTextValue("Misc.ShiftToExpand")); + holdShiftIndicator.OverrideColor = IHoldShiftTooltipItem.DefaultExtensionIndicatorColor; + tooltips.Insert(setBonusIndex, holdShiftIndicator); } - else { setBonusIndex++; - TooltipLine largerDescription = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("GeneralGemInfo").Format(GemBreakDamageLowerBound, GemDamage, GemRegenTime / 60)); + TooltipLine largerDescription = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("GeneralGemInfo").Format(GemBreakDamageLowerBound, GemDamage, GemRegenTime.FramesToSeconds())); largerDescription.OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.5f); tooltips.Insert(setBonusIndex, largerDescription); @@ -137,15 +134,12 @@ namespace CalamityMod.Items.Armor.GemTech tooltips.Insert(setBonusIndex, purpleGemTooltip); setBonusIndex++; - string pinkLifeRegenString = (0.5f * BaseGemLifeRegenBoost).ToString("n1"); - TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, pinkLifeRegenString)); + TooltipLine pinkGemTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus7", CalamityUtils.GetTextFromModItem("PinkGemInfo").Format(BaseGemDefenseBoost, BaseGemLifeRegenBoost.ToRegenPerSecond())); pinkGemTooltip.OverrideColor = new Color(255, 115, 206); tooltips.Insert(setBonusIndex, pinkGemTooltip); setBonusIndex++; - string baseLifeRegenString = (0.5f * AllGemsWeaponUseLifeRegenBoost).ToString("n1"); - string multiclassLifeRegenString = (0.5f * AllGemsMultiWeaponUseLifeRegenBoost).ToString("n1"); - TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(baseLifeRegenString, AllGemsLifeRegenBoostTime / 60, multiclassLifeRegenString, AllGemsMultiWeaponLifeRegenBoostTime / 60f)); + TooltipLine liferegenTooltip = new TooltipLine(item.Mod, "CalamityMod:SetBonus8", CalamityUtils.GetTextFromModItem("GemBonusInfo").Format(AllGemsWeaponUseLifeRegenBoost.ToRegenPerSecond(), AllGemsLifeRegenBoostTime.FramesToSeconds(), AllGemsMultiWeaponUseLifeRegenBoost.ToRegenPerSecond(), AllGemsMultiWeaponLifeRegenBoostTime.FramesToSeconds())); liferegenTooltip.OverrideColor = new Color(230, 230, 230); tooltips.Insert(setBonusIndex, liferegenTooltip); } diff --git a/Items/Armor/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index 815eeb87e7..ee29234204 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GodSlayer @@ -11,24 +12,31 @@ namespace CalamityMod.Items.Armor.GodSlayer public class GodSlayerChestplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; - public const int DashIFrames = 12; + + public static float DamageBoost = 0.15f; + public static int CritBoost = 11; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Common Set Bonus + public static int DashCooldown = CalamityUtils.SecondsToFrames(45); + public static int DashDamage = 3000; + public static float DashKnockback = 15f; + public static int DashIFrames = 12; + public static int DashGodSlayerInfernoDuration = CalamityUtils.SecondsToFrames(5); public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 41; + Item.defense = 40; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - var modPlayer = player.Calamity(); - player.thorns += 0.5f; - player.statLifeMax2 += 50; - player.GetDamage() += 0.11f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs index f1dbb56762..210163dcc5 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadMelee.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GodSlayer @@ -13,35 +14,38 @@ namespace CalamityMod.Items.Armor.GodSlayer public class GodSlayerHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MeleeDamageBoost = 0.1f; + public static int MeleeCritBoost = 5; + public static float MeleeSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost, MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 1000; + public static int SetBonusHurtDamageThreshold = 80; + public static int DartDamage => CalamityUtils.ScaleWithDifficulty(350); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 48; //96 + Item.defense = 50; // 120 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - player.GetAttackSpeed() += 0.2f; modPlayer.godSlayer = true; modPlayer.godSlayerDamage = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(hotkey, GodslayerArmorDash.GodslayerCooldown); - player.thorns += 2.5f; - player.aggro += 1000; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); + player.aggro += SetBonusAggroBoost; if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { @@ -52,8 +56,9 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.14f; - player.GetCritChance() += 7; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs index 45e96894a1..8e88861af9 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRanged.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GodSlayer @@ -13,24 +14,28 @@ namespace CalamityMod.Items.Armor.GodSlayer public class GodSlayerHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 12; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static int ShrapnelRoundCooldown = CalamityUtils.SecondsToFrames(2.5f); + public static double ShrapnelRoundDamageRatio = 1D; + public static int ShrapnelRoundDamageSoftcap = 800; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 35; //96 + Item.defense = 35; // 105 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { @@ -38,7 +43,7 @@ namespace CalamityMod.Items.Armor.GodSlayer modPlayer.godSlayer = true; modPlayer.godSlayerRanged = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(hotkey, GodslayerArmorDash.GodslayerCooldown); + player.setBonus = this.GetLocalization("SetBonus").Format(ShrapnelRoundCooldown.FramesToSeconds(), hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { @@ -49,8 +54,8 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.14f; - player.GetCritChance() += 14; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs index 630ec80251..66f2f30a73 100644 --- a/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs +++ b/Items/Armor/GodSlayer/GodSlayerHeadRogue.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GodSlayer @@ -13,34 +14,42 @@ namespace CalamityMod.Items.Armor.GodSlayer public class GodSlayerHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.1f; + public static int RogueCritBoost = 12; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.2f; + public static float RogueDamageBoostAtFullHealth = 0.1f; + public static int RogueCritBoostAtFullHealth = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public static float RogueVelocityBoostAtFullHealth = 0.1f; // NOTE: Tooltip shares this number with damage % as they're equal + public static int SetBonusHurtDamageThreshold = 80; + public static int ExtraIFrames = 30; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 29; //96 + Item.defense = 30; // 100 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.godSlayer = true; modPlayer.godSlayerThrowing = true; - modPlayer.rogueStealthMax += 1.2f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; var hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(hotkey, GodslayerArmorDash.GodslayerCooldown); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, hotkey, GodSlayerChestplate.DashCooldown.FramesToSeconds()); if (modPlayer.godSlayerDashHotKeyPressed || (player.dashDelay != 0 && modPlayer.LastUsedDashID == GodslayerArmorDash.ID)) { @@ -51,9 +60,9 @@ namespace CalamityMod.Items.Armor.GodSlayer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.14f; - player.GetCritChance() += 14; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayer/GodSlayerLeggings.cs b/Items/Armor/GodSlayer/GodSlayerLeggings.cs index d713af7df5..e5dade9642 100644 --- a/Items/Armor/GodSlayer/GodSlayerLeggings.cs +++ b/Items/Armor/GodSlayer/GodSlayerLeggings.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.GodSlayer @@ -10,20 +11,26 @@ namespace CalamityMod.Items.Armor.GodSlayer public class GodSlayerLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.11f; + public static int CritBoost = 11; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 35; + Item.defense = 30; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.1f; - player.GetDamage() += 0.11f; - player.GetCritChance() += 11; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index 63884e2bfd..6e4f64d76f 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Items.Armor.Hydrothermic public static float DamageBoost = 0.13f; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + // Common Set Bonus + public static int BlazeDamage => CalamityUtils.ScaleWithDifficulty(115); public static float InfernoHealthThreshold = 0.5f; public static int InfernoHitRate = 30; public static int InfernoDamage = 50; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index 33899b8191..7737a0066c 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs index b7c9eeb6aa..e59b8099bf 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMelee.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaGeyser = true; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs index 7ea70f3c9b..728599f3c6 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRanged.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(FlareCooldown.FramesToSeconds()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(FlareCooldown.FramesToSeconds(), HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaBolt = true; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs index b5a04d2688..e65569ad8d 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadRogue.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), VolleyCooldown.FramesToSeconds()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), VolleyCooldown.FramesToSeconds(), HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaVolley = true; diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index 0e0c982103..b3114d43af 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(HydrothermicArmor.InfernoHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), HydrothermicArmor.InfernoHealthThreshold.ToPercent()); var modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.chaosSpirit = true; diff --git a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs index 0f02976040..1cc46af3a9 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Placeables; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.OmegaBlue @@ -12,6 +13,11 @@ namespace CalamityMod.Items.Armor.OmegaBlue public class OmegaBlueChestplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.18f; + public static int CritBoost = 12; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -35,8 +41,8 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void UpdateEquip(Player player) { var modPlayer = player.Calamity(); - player.GetDamage() += 0.12f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; modPlayer.omegaBlueChestplate = true; modPlayer.noLifeRegen = true; } diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index 84b178e4d0..85ae39c9fb 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using System; +using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; @@ -7,6 +8,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.OmegaBlue @@ -19,6 +21,18 @@ namespace CalamityMod.Items.Armor.OmegaBlue public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/OmegaBlueAbility"); + public static float DamageBoost = 0.12f; + public static int CritBoost = 14; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 2; + public static int TentacleDamage = 350; + public static float MadnessDamageBoost = 0.1f; + public static int MadnessCritBoost = 10; + public static int MadnessDuration = CalamityUtils.SecondsToFrames(5); + public static int MadnessCooldown = CalamityUtils.SecondsToFrames(25); + public override void Load() { if (!Main.dedServ) @@ -48,14 +62,11 @@ namespace CalamityMod.Items.Armor.OmegaBlue { player.ignoreWater = true; - player.GetDamage() += 0.12f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -66,10 +77,11 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); + Color AbilityBriefColor = Color.Lerp(new Color(255, 229, 61), new Color(110, 173, 237), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), MadnessDuration.FramesToSeconds(), MadnessDamageBoost.ToPercent(), MadnessCooldown.FramesToSeconds()); var mp = player.Calamity(); - player.maxMinions += 2; + player.maxMinions += SetBonusMinionSlotBoost; mp.wearingRogueArmor = true; mp.omegaBlueSet = true; mp.WearingPostMLSummonerSet = true; diff --git a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs index 8c853d54f7..91f0b82463 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.OmegaBlue @@ -12,6 +13,12 @@ namespace CalamityMod.Items.Armor.OmegaBlue public class OmegaBlueTentacles : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.16f; + public static int CritBoost = 12; + public static float MoveSpeedBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, MoveSpeedBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -33,9 +40,9 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void UpdateEquip(Player player) { - player.GetDamage() += 0.12f; - player.GetCritChance() += 12; - player.moveSpeed += 0.12f; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index ba3cdb9a84..22a247b1e7 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -1,11 +1,12 @@ -using CalamityMod.CalPlayer; +using System; +using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.Items.Materials; -using CalamityMod.Items.Potions.Alcohol; -using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -16,63 +17,55 @@ namespace CalamityMod.Items.Armor.PlagueReaper public new string LocalizationCategory => "Items.Armor.Hardmode"; public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/PlagueReaperAbility"); + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 8; + // NOTE: Ammo conservation is a bool so the number is manually added in the tooltip and equip + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static float SetBonusFlightTimeBoost = 0.05f; + public static float SetBonusPlaguedRangedDamageMult = 1.1f; + public static float BlackoutRangedDamageBoost = 0.6f; + public static int BlackoutRangedCritBoost = 20; + public static int BlackoutDuration = CalamityUtils.SecondsToFrames(5); + public static int BlackoutCooldown = CalamityUtils.SecondsToFrames(25); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; - Item.defense = 11; + Item.defense = 11; // 44 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawOutlines = true; public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); + Color AbilityBriefColor = Color.Lerp(new Color(79, 100, 95), new Color(109, 209, 130), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFlightTimeBoost.ToPercent(), SetBonusPlaguedRangedDamageMult, AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BlackoutRangedDamageBoost.ToPercent(), BlackoutRangedCritBoost, BlackoutDuration.FramesToSeconds(), BlackoutCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.plagueReaper = true; - player.ammoCost75 = true; var hasPlagueBlackoutCD = modPlayer.cooldowns.TryGetValue(PlagueBlackout.ID, out var cd); - if (hasPlagueBlackoutCD && cd.timeLeft > 1500) + if (hasPlagueBlackoutCD && cd.timeLeft > BlackoutCooldown) { player.blind = true; player.headcovered = true; player.blackout = true; - player.GetDamage() += 0.6f; //60% ranged dmg and 20% crit - player.GetCritChance() += 20; - } - - if (player.whoAmI == Main.myPlayer) - { - var source = player.GetSource_Accessory(Item); - if (player.immune) - { - if (player.miscCounter % 10 == 0) - { - var damage = (int)player.GetTotalDamage().ApplyTo(40); - - var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); - if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) - cinder.DamageType = DamageClass.Generic; - } - } + player.GetDamage() += BlackoutRangedDamageBoost; + player.GetCritChance() += BlackoutRangedCritBoost; } } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 8; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; + player.ammoCost75 = true; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaper/PlagueReaperStriders.cs b/Items/Armor/PlagueReaper/PlagueReaperStriders.cs index 72f7fb5256..5eab566b5e 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperStriders.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperStriders.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.PlagueReaper public class PlagueReaperStriders : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int RangedCritBoost = 8; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost, MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { - player.GetCritChance() += 3; - player.moveSpeed += 0.15f; + player.GetCritChance() += RangedCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaper/PlagueReaperVest.cs b/Items/Armor/PlagueReaper/PlagueReaperVest.cs index 1016e203d4..c94900de0e 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperVest.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperVest.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.PlagueReaper @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Armor.PlagueReaper public class PlagueReaperVest : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float RangedDamageBoost = 0.16f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,8 +26,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.GetCritChance() += 5; + player.GetDamage() += RangedDamageBoost; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs index dc7245ce1a..612d748fa8 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -11,6 +12,11 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerCarapace : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -26,7 +32,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer { Item.width = 18; Item.height = 18; - Item.defense = 17; + Item.defense = 13; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -35,7 +41,8 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { player.Calamity().plaguebringerCarapace = true; - player.GetDamage() += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs index 488bf88d8c..1ae9a366f0 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerPistons.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerPistons.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -9,11 +10,17 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerPistons : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.defense = 8; + Item.defense = 10; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -21,8 +28,9 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; - player.moveSpeed += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; + player.moveSpeed += MoveSpeedBoost; //Flower Boots code if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1) diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 97e4d4197b..4a9c6dae23 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Plaguebringer @@ -13,14 +14,23 @@ namespace CalamityMod.Items.Armor.Plaguebringer public class PlaguebringerVisor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; - public const int PlagueDashIFrames = 12; + + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int PlagueDashDamage = 50; + public static float PlagueDashKnockback = 3f; + public static int PlagueDashIFrames = 12; public static int BeeMinionDamage = 25; + public static int BeePlagueDuration = CalamityUtils.SecondsToFrames(5); public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.defense = 7; // 32 total + Item.defense = 9; // 32 total Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; @@ -28,18 +38,13 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { - player.GetDamage() += 0.15f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { @@ -48,7 +53,6 @@ namespace CalamityMod.Items.Armor.Plaguebringer player.Calamity().plaguebringerPatronSet = true; player.Calamity().DashID = PlaguebringerArmorDash.ID; player.dashType = 0; - player.maxMinions += 3; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_ItemUse(Item); diff --git a/Items/Armor/Prismatic/PrismaticGreaves.cs b/Items/Armor/Prismatic/PrismaticGreaves.cs index 2af82a1c33..8a6458fd51 100644 --- a/Items/Armor/Prismatic/PrismaticGreaves.cs +++ b/Items/Armor/Prismatic/PrismaticGreaves.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Prismatic @@ -11,6 +12,14 @@ namespace CalamityMod.Items.Armor.Prismatic public class PrismaticGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MagicDamageBoost = 0.1f; + public static int MagicCritBoost = 12; + public static float NonMagicDamageDecrease = 0.2f; + public static float FlightTimeBoost = 0.1f; + public static float JumpSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), MagicCritBoost, NonMagicDamageDecrease.ToPercent(), FlightTimeBoost.ToPercent(), JumpSpeedBoost.ToJumpSpeedPercent()); + public override void SetDefaults() { Item.width = 18; @@ -25,11 +34,11 @@ namespace CalamityMod.Items.Armor.Prismatic public override void UpdateEquip(Player player) { player.Calamity().prismaticGreaves = true; - player.GetDamage() += 0.1f; - player.GetCritChance() += 12; - player.jumpSpeedBoost += 0.1f; - player.GetDamage() -= 0.2f; - player.GetDamage() += 0.2f; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.jumpSpeedBoost += JumpSpeedBoost; + player.GetDamage() -= NonMagicDamageDecrease; + player.GetDamage() += NonMagicDamageDecrease; } public override void AddRecipes() diff --git a/Items/Armor/Prismatic/PrismaticHelmet.cs b/Items/Armor/Prismatic/PrismaticHelmet.cs index 5cb45254a2..0088ea45b8 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -1,8 +1,11 @@ -using CalamityMod.Items.Materials; +using System; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Rarities; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Prismatic @@ -12,21 +15,32 @@ namespace CalamityMod.Items.Armor.Prismatic { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; internal static string LaserEntitySourceContext => "SetBonus_Calamity_Prismatic"; + + public static int MaxManaBoost = 80; + public static float ManaCostReduction = 0.15f; + public static float MagicDamageBoost = 0.15f; + public static int MagicCritBoost = 12; + public static float NonMagicDamageDecrease = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost, NonMagicDamageDecrease.ToPercent()); + + // Set Bonus + public static int ManaRegenBonus = 8; + public static int LaserDamage = 30; + public static int LaserDuration = CalamityUtils.SecondsToFrames(5); + public static int LaserCooldown = CalamityUtils.SecondsToFrames(30); + public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.defense = 18; //71 + Item.defense = 18; // 72 Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,19 +51,20 @@ namespace CalamityMod.Items.Armor.Prismatic public override void UpdateArmorSet(Player player) { player.Calamity().prismaticSet = true; - player.statManaMax2 += 40; - player.manaCost -= 0.15f; - player.manaRegenBonus += 8; - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); + player.manaRegenBonus += ManaRegenBonus; + Color AbilityBriefColor = Color.Lerp(new Color(255, 106, 246), new Color(148, 145, 243), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), LaserDuration.FramesToSeconds(), LaserCooldown.FramesToSeconds()); } public override void UpdateEquip(Player player) { player.Calamity().prismaticHelmet = true; - player.GetDamage() -= 0.2f; - player.GetDamage() += 0.2f; - player.GetDamage() += 0.18f; - player.GetCritChance() += 12; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.GetDamage() -= NonMagicDamageDecrease; + player.GetDamage() += NonMagicDamageDecrease; } public override void AddRecipes() diff --git a/Items/Armor/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index 520c548143..0df8c6ea13 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Prismatic @@ -11,9 +12,16 @@ namespace CalamityMod.Items.Armor.Prismatic public class PrismaticRegalia : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MagicDamageBoost = 0.15f; + public static int MagicCritBoost = 15; // NOTE: Tooltip shares this number with damage % as they're equal + public static float NonMagicDamageDecrease = 0.2f; + public static int RocketChanceDenominator = 20; + public static float RocketDamageRatio = 0.25f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MagicDamageBoost.ToPercent(), NonMagicDamageDecrease.ToPercent(), RocketChanceDenominator.GetChanceFromDenominator()); + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -37,11 +45,10 @@ namespace CalamityMod.Items.Armor.Prismatic public override void UpdateEquip(Player player) { player.Calamity().prismaticRegalia = true; - player.statManaMax2 += 40; - player.GetDamage() += 0.12f; - player.GetCritChance() += 15; - player.GetDamage() -= 0.2f; - player.GetDamage() += 0.2f; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.GetDamage() -= NonMagicDamageDecrease; + player.GetDamage() += NonMagicDamageDecrease; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverCuisses.cs b/Items/Armor/Reaver/ReaverCuisses.cs index 56c540e454..f44835ab63 100644 --- a/Items/Armor/Reaver/ReaverCuisses.cs +++ b/Items/Armor/Reaver/ReaverCuisses.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -9,20 +10,20 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverCuisses : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MoveSpeedBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; Item.height = 18; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 14; + Item.defense = 18; } - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 5; - player.moveSpeed += 0.12f; - } + public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; public override void AddRecipes() { diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 1e99bdc685..7348b90212 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -14,19 +15,26 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverHeadExplore : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float MiningSpeedBoost = 0.2f; + public static float PlacementSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MiningSpeedBoost.ToPercent(), PlacementSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroReduction = 400; + public static int SetBonusTileRangeBoost = 7; + public static int SetBonusGrabRangeBoost = 246; // (2.625 + 15.375 = 18 tiles) + public override void SetDefaults() { Item.width = 22; Item.height = 22; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 7; + Item.defense = 6; // 48 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -36,30 +44,24 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusTileRangeBoost); var modPlayer = player.Calamity(); modPlayer.reaverExplore = true; modPlayer.wearingRogueArmor = true; player.findTreasure = true; - player.aggro -= 200; + player.aggro -= SetBonusAggroReduction; if (player.Calamity().countsAsAnyWet) player.gills = true; + DelegateMethods.v3_1 = new Vector3(1f, 1f, 1f); + Utils.PlotTileLine(player.Center, player.Center + player.velocity * 6f, 20f, DelegateMethods.CastLightOpen); + Utils.PlotTileLine(player.Left, player.Right, 20f, DelegateMethods.CastLightOpen); + if (player.whoAmI == Main.myPlayer) { - var source = player.GetSource_ItemUse(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); - } - // These are static variables. Awesome - Player.tileRangeX += 7; - Player.tileRangeY += 7; + Player.tileRangeX += SetBonusTileRangeBoost; + Player.tileRangeY += SetBonusTileRangeBoost; } } @@ -67,9 +69,9 @@ namespace CalamityMod.Items.Armor.Reaver { player.ignoreWater = true; player.lavaImmune = true; - player.pickSpeed -= 0.2f; - player.tileSpeed += 0.5f; - player.wallSpeed += 0.5f; + player.pickSpeed -= MiningSpeedBoost; + player.tileSpeed += PlacementSpeedBoost; + player.wallSpeed += PlacementSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverHeadMobility.cs b/Items/Armor/Reaver/ReaverHeadMobility.cs index f6f861a712..46b0326b58 100644 --- a/Items/Armor/Reaver/ReaverHeadMobility.cs +++ b/Items/Armor/Reaver/ReaverHeadMobility.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -11,20 +12,25 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverHeadMobility : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; - //Jump/Flight Boosts and Movement Speed Helm + + public static float MoveSpeedBoost = 0.15f; + public static float JumpSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), JumpSpeedBoost.ToJumpSpeedPercent()); + + public static float SetBonusFlightBoost = 0.1f; + public static float SetBonusHookBoost = 0.5f; + public static int SetBonusDashDelayReductionInterval = 3; + public override void SetDefaults() { Item.width = 24; Item.height = 28; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 13; //46 + Item.defense = 13; // 55 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,17 +43,17 @@ namespace CalamityMod.Items.Armor.Reaver var modPlayer = player.Calamity(); modPlayer.reaverSpeed = true; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFlightBoost.ToPercent(), SetBonusHookBoost.ToPercent(), (1 / (float)SetBonusDashDelayReductionInterval).ToPercent()); player.noFallDmg = true; player.autoJump = true; - if (player.miscCounter % 3 == 2 && player.dashDelay > 0) + if (player.miscCounter % SetBonusDashDelayReductionInterval == 1 && player.dashDelay > 0) player.dashDelay--; } public override void UpdateEquip(Player player) { - player.jumpSpeedBoost += 0.5f; - player.moveSpeed += 0.15f; + player.moveSpeed += MoveSpeedBoost; + player.jumpSpeedBoost += JumpSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index cfed218502..2048aa9684 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -13,23 +14,28 @@ namespace CalamityMod.Items.Armor.Reaver public new string LocalizationCategory => "Items.Armor.Hardmode"; internal static string HealOrbEntitySourceContext => "SetBonus_Calamity_ReaverTank"; + public static int MaxLifeBoost = 50; + public static int RegenBoost = 8; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxLifeBoost, RegenBoost.ToRegenPerSecond()); + + // Set Bonus + public static int SetBonusAggroBoost = 600; + public static float SetBonusDebuffDamageReduction = 0.2f; + public static float SetBonusMobilityReduction = 0.3f; + public static int ReaverRageDuration = CalamityUtils.SecondsToFrames(5); public static int ReaverRageDefenseBoost = 5; public static float ReaverRageDamageBoost = 0.1f; - //Defense and DR Helm public override void SetDefaults() { Item.width = 28; Item.height = 30; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 30; //63 => 73 w/ set bonus (+5 w/ Reaver Rage) + Item.defense = 28; // 70 (75 with Reaver Rage) } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -40,21 +46,17 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); - player.thorns += 0.33f; - player.moveSpeed -= 0.3f; - player.statDefense += 10; - player.lifeRegen += 10; - player.aggro += 600; + player.moveSpeed -= SetBonusMobilityReduction; + player.aggro += SetBonusAggroBoost; modPlayer.reaverDefense = true; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusDebuffDamageReduction.ToPercent(), SetBonusMobilityReduction.ToPercent(), ReaverRageDuration.FramesToSeconds()); } public override void UpdateEquip(Player player) { - player.GetDamage() -= 0.3f; - player.endurance += 0.15f; - player.statLifeMax2 += 50; + player.statLifeMax2 += MaxLifeBoost; + player.lifeRegen += RegenBoost; } public override void AddRecipes() diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 7d1f5a9221..90cba4743e 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Reaver @@ -9,9 +10,12 @@ namespace CalamityMod.Items.Armor.Reaver public class ReaverScaleMail : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageReductionBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageReductionBoost.ToPercent()); + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -27,14 +31,10 @@ namespace CalamityMod.Items.Armor.Reaver Item.height = 22; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 19; + Item.defense = 24; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.09f; - player.GetCritChance() += 4; - } + public override void UpdateEquip(Player player) => player.endurance += DamageReductionBoost; public override void AddRecipes() { diff --git a/Items/Armor/Silva/SilvaArmor.cs b/Items/Armor/Silva/SilvaArmor.cs index e3250d25d5..603d51812f 100644 --- a/Items/Armor/Silva/SilvaArmor.cs +++ b/Items/Armor/Silva/SilvaArmor.cs @@ -3,7 +3,9 @@ using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Silva @@ -12,20 +14,32 @@ namespace CalamityMod.Items.Armor.Silva public class SilvaArmor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaActivation"); + public static readonly SoundStyle DispelSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaDispel"); + + public static float DamageBoost = 0.15f; + public static int CritBoost = 11; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Common Set Bonus + public static int SetBonusRegenBoost = 6; + public static float AccelerationBoost = 0.05f; + public static int ReviveDuration = CalamityUtils.SecondsToFrames(5); + public static int ReviveCooldown = CalamityUtils.SecondsToFrames(5 * 60); + public override void SetDefaults() { Item.width = 24; Item.height = 24; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 44; + Item.defense = 38; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.statLifeMax2 += 50; - player.GetDamage() += 0.11f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Silva/SilvaHeadMagic.cs b/Items/Armor/Silva/SilvaHeadMagic.cs index aae31f716a..7373acd566 100644 --- a/Items/Armor/Silva/SilvaHeadMagic.cs +++ b/Items/Armor/Silva/SilvaHeadMagic.cs @@ -1,11 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Silva.SilvaArmor; namespace CalamityMod.Items.Armor.Silva { @@ -14,39 +16,46 @@ namespace CalamityMod.Items.Armor.Silva public class SilvaHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MaxManaBoost = 100; + public static float ManaCostReduction = 0.19f; + public static float MagicDamageBoost = 0.18f; + public static int MagicCritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + + // Set Bonus + public static int BurstCooldown = CalamityUtils.SecondsToFrames(5); + public static int BurstDamage = 800; // Damage + (projectile damage) * Damage Ratio + public static double BurstDamageRatio = 0.6D; + public static int BurstDamageSoftcap = 1400; + public override void SetDefaults() { Item.width = 24; Item.height = 22; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 21; //110 + Item.defense = 24; // 90 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.silvaSet = true; modPlayer.silvaMage = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRegenBoost.ToRegenPerSecond(), AccelerationBoost.ToPercent(), ReviveDuration.FramesToSeconds(), (ReviveCooldown / 60).FramesToSeconds()); } public override void UpdateEquip(Player player) { - player.manaCost -= 0.19f; - player.GetDamage() += 0.23f; - player.GetCritChance() += 13; - player.statManaMax2 += 100; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Silva/SilvaHeadSummon.cs b/Items/Armor/Silva/SilvaHeadSummon.cs index fde79e89cf..28e23828d6 100644 --- a/Items/Armor/Silva/SilvaHeadSummon.cs +++ b/Items/Armor/Silva/SilvaHeadSummon.cs @@ -7,9 +7,10 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; -using Terraria.Audio; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; +using static CalamityMod.Items.Armor.Silva.SilvaArmor; namespace CalamityMod.Items.Armor.Silva { @@ -19,27 +20,28 @@ namespace CalamityMod.Items.Armor.Silva { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; internal static string SilvaCrystalEntitySourceContext => "SetBonus_Calamity_SilvaSummon"; - public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaActivation"); - public static readonly SoundStyle DispelSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaDispel"); + + public static int MinionSlotBoost = 2; + public static float SummonDamageBoost = 0.3f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 3; + public static float SetBonusSummonDamageBoost = 0.4f; + public static int CrystalDamage = 380; public override void SetDefaults() { Item.width = 28; Item.height = 24; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 13; //110 + Item.defense = 18; // 84 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } + public override void ArmorSetShadows(Player player) => player.armorEffectDrawShadow = true; public override void UpdateArmorSet(Player player) { @@ -47,12 +49,16 @@ namespace CalamityMod.Items.Armor.Silva modPlayer.silvaSet = true; modPlayer.silvaSummon = true; modPlayer.WearingPostMLSummonerSet = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - player.GetDamage() += 0.65f; - player.maxMinions += 5; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent(), SetBonusRegenBoost.ToRegenPerSecond(), AccelerationBoost.ToPercent(), ReviveDuration.FramesToSeconds(), (ReviveCooldown / 60).FramesToSeconds()); + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } - public override void UpdateEquip(Player player) => player.GetDamage() += 0.1f; + public override void UpdateEquip(Player player) + { + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; + } public override void AddRecipes() { diff --git a/Items/Armor/Silva/SilvaLeggings.cs b/Items/Armor/Silva/SilvaLeggings.cs index 5aa164bd65..78a51c76c9 100644 --- a/Items/Armor/Silva/SilvaLeggings.cs +++ b/Items/Armor/Silva/SilvaLeggings.cs @@ -4,6 +4,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Silva @@ -12,20 +13,26 @@ namespace CalamityMod.Items.Armor.Silva public class SilvaLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.11f; + public static int CritBoost = 11; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; Item.height = 18; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 39; + Item.defense = 28; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.1f; - player.GetDamage() += 0.11f; - player.GetCritChance() += 11; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Statigel/StatigelArmor.cs b/Items/Armor/Statigel/StatigelArmor.cs index d335715a55..bb2ce6cdf8 100644 --- a/Items/Armor/Statigel/StatigelArmor.cs +++ b/Items/Armor/Statigel/StatigelArmor.cs @@ -16,8 +16,6 @@ namespace CalamityMod.Items.Armor.Statigel public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost); // Common Set Bonus - public static int SetBonusHurtDamageThreshold = 100; - public static int SetBonusIFrameExtension = 30; public static float SetBonusJumpSpeedBoost = 0.6f; public static float SetBonusJumpHeightPercentBoost = 0.3334f; diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index 26acf35900..51097e8f85 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -29,14 +29,11 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 5; //22 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); diff --git a/Items/Armor/Statigel/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index a6d3b93c8d..3671a6bdab 100644 --- a/Items/Armor/Statigel/StatigelHeadMelee.cs +++ b/Items/Armor/Statigel/StatigelHeadMelee.cs @@ -31,15 +31,11 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 9; //27 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); diff --git a/Items/Armor/Statigel/StatigelHeadRanged.cs b/Items/Armor/Statigel/StatigelHeadRanged.cs index f587500f24..17294e9b1d 100644 --- a/Items/Armor/Statigel/StatigelHeadRanged.cs +++ b/Items/Armor/Statigel/StatigelHeadRanged.cs @@ -27,14 +27,11 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 7; //25 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); diff --git a/Items/Armor/Statigel/StatigelHeadRogue.cs b/Items/Armor/Statigel/StatigelHeadRogue.cs index 25d42aaf34..bddb78f285 100644 --- a/Items/Armor/Statigel/StatigelHeadRogue.cs +++ b/Items/Armor/Statigel/StatigelHeadRogue.cs @@ -31,15 +31,11 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 6; //23 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index 865e54846e..19f3eea4ff 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -7,6 +7,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -17,11 +18,12 @@ namespace CalamityMod.Items.Armor.Statigel { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - public static float SummonKBBoost = 1.5f; + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); // Set Bonus - public static int SetBonusMinionSlotBoost = 1; - public static float SetBonusSummonDamageBoost = 0.18f; + public static float SetBonusSummonDamageBoost = 0.15f; public static int SlimeDamage = 18; public override void SetDefaults() @@ -33,15 +35,11 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 4; //20 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) - + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusSummonDamageBoost.ToPercent(), StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; modPlayer.slimeGod = true; @@ -49,7 +47,6 @@ namespace CalamityMod.Items.Armor.Statigel Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; player.GetDamage() += SetBonusSummonDamageBoost; - player.maxMinions += SetBonusMinionSlotBoost; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); @@ -71,7 +68,11 @@ namespace CalamityMod.Items.Armor.Statigel } } - public override void UpdateEquip(Player player) => player.GetKnockback() += SummonKBBoost; + public override void UpdateEquip(Player player) + { + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; + } public override void AddRecipes() { diff --git a/Items/Armor/Tarragon/TarragonBreastplate.cs b/Items/Armor/Tarragon/TarragonBreastplate.cs index 9c37bd9f9b..f51bbea2a2 100644 --- a/Items/Armor/Tarragon/TarragonBreastplate.cs +++ b/Items/Armor/Tarragon/TarragonBreastplate.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -10,21 +11,28 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.12f; + public static int CritBoost = 8; + public static int RegenBoost = 4; + public static float DamageReductionBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost, RegenBoost.ToRegenPerSecond(), DamageReductionBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; - Item.lifeRegen = 3; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 40; + Item.defense = 36; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.statLifeMax2 += 25; - player.GetDamage() += 0.1f; - player.GetCritChance() += 5; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.lifeRegen += RegenBoost; + player.endurance += DamageReductionBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index a9b0fac606..28a39ba3ec 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -12,19 +13,27 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static int MaxManaBoost = 100; + public static float ManaCostReduction = 0.15f; + public static float MagicDamageBoost = 0.15f; + public static int MagicCritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + + // Set Bonus + public static int CritsToSpawnLeaves = 5; + public static float LeafDamageRatio = 0.2f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 15; // 90 + Item.defense = 16; // 76 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,16 +46,15 @@ namespace CalamityMod.Items.Armor.Tarragon var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraMage = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus"); } public override void UpdateEquip(Player player) { - player.manaCost -= 0.15f; - player.GetDamage() += 0.15f; - player.GetCritChance() += 10; - player.endurance += 0.1f; - player.statManaMax2 += 100; + player.statManaMax2 += MaxManaBoost; + player.manaCost -= ManaCostReduction; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index 3afaa9f935..21a19642ee 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -12,19 +13,30 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float MeleeDamageBoost = 0.1f; + public static int MeleeCritBoost = 5; + public static float MeleeSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost, MeleeSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusAggroBoost = 800; + public static int TarraLifeDuration = CalamityUtils.SecondsToFrames(5); + public static int TarraLifeRegenBoost = 3; + public static double CloakContactDamageReduction = 0.5D; + public static int CloakDuration = CalamityUtils.SecondsToFrames(10); + public static int CloakCooldown = CalamityUtils.SecondsToFrames(30); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 42; // 117 + Item.defense = 40; // 100 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,16 +49,15 @@ namespace CalamityMod.Items.Armor.Tarragon var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraMelee = true; - player.GetAttackSpeed() += 0.15f; - player.aggro += 800; - player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.aggro += SetBonusAggroBoost; + player.setBonus = this.GetLocalization("SetBonus").Format(TarraLifeRegenBoost.ToRegenPerSecond(), CalamityUtils.GetArmorSetBonusKey(), CloakDuration.FramesToSeconds(), CloakCooldown.FramesToSeconds()); } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.12f; - player.GetCritChance() += 7; - player.endurance += 0.1f; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadRanged.cs b/Items/Armor/Tarragon/TarragonHeadRanged.cs index 7bc1135d98..0fee5f6616 100644 --- a/Items/Armor/Tarragon/TarragonHeadRanged.cs +++ b/Items/Armor/Tarragon/TarragonHeadRanged.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -12,19 +13,28 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + + // Set Bonus + public static int OnHitEffectCooldown = CalamityUtils.SecondsToFrames(1); + public static float LeafDamageRatio = 0.25f; + public static int LeafDamageSoftcap = 150; + public static float EnergyDamageRatio = 0.33f; + public static int EnergyDamageSoftcap = 200; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 27; // 102 + Item.defense = 28; // 88 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,14 +47,13 @@ namespace CalamityMod.Items.Armor.Tarragon var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraRanged = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus"); } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 10; - player.endurance += 0.1f; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadRogue.cs b/Items/Armor/Tarragon/TarragonHeadRogue.cs index 31fe1ed587..3345d79518 100644 --- a/Items/Armor/Tarragon/TarragonHeadRogue.cs +++ b/Items/Armor/Tarragon/TarragonHeadRogue.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -12,19 +13,29 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float RogueDamageBoost = 0.1f; + public static int RogueCritBoost = 7; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 1.15f; + public static int CritsToActivateImmunity = 50; + public static int ImmunityDuration = CalamityUtils.SecondsToFrames(2.5f); + public static int ImmunityCooldown = CalamityUtils.SecondsToFrames(25); + public static float RogueDamageBoostWhileDebuffed = 0.1f; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 20; // 95 + Item.defense = 24; // 84 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -37,17 +48,16 @@ namespace CalamityMod.Items.Armor.Tarragon var modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; - modPlayer.rogueStealthMax += 1.15f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent()); } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 10; - player.moveSpeed += 0.05f; - player.endurance += 0.1f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonHeadSummon.cs b/Items/Armor/Tarragon/TarragonHeadSummon.cs index b850eaea52..6b03f69d18 100644 --- a/Items/Armor/Tarragon/TarragonHeadSummon.cs +++ b/Items/Armor/Tarragon/TarragonHeadSummon.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -14,19 +15,25 @@ namespace CalamityMod.Items.Armor.Tarragon public new string LocalizationCategory => "Items.Armor.PostMoonLord"; internal static string LifeAuraEntitySourceContext => "SetBonus_Calamity_Tarragon"; + public static int MinionSlotBoost = 1; + public static float SummonDamageBoost = 0.25f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost, SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 2; + public static float SetBonusSummonDamageBoost = 0.3f; + public static int AuraDamage = 120; + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 10; // 85 + Item.defense = 10; // 70 Item.rare = ModContent.RarityType(); } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void ArmorSetShadows(Player player) { @@ -40,15 +47,15 @@ namespace CalamityMod.Items.Armor.Tarragon modPlayer.tarraSet = true; modPlayer.tarraSummon = true; modPlayer.WearingPostMLSummonerSet = true; - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); - player.GetDamage() += 0.5f; - player.maxMinions += 3; + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()); + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusSummonDamageBoost; } public override void UpdateEquip(Player player) { - player.endurance += 0.1f; - player.GetDamage() += 0.05f; + player.maxMinions += MinionSlotBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Tarragon/TarragonLeggings.cs b/Items/Armor/Tarragon/TarragonLeggings.cs index fa0a9d0a61..0b9a6fad3c 100644 --- a/Items/Armor/Tarragon/TarragonLeggings.cs +++ b/Items/Armor/Tarragon/TarragonLeggings.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Tarragon @@ -10,20 +11,26 @@ namespace CalamityMod.Items.Armor.Tarragon public class TarragonLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; + + public static float DamageBoost = 0.08f; + public static int CritBoost = 8; // NOTE: Tooltip shares this number with damage % as they're equal + public static float MoveSpeedBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.defense = 35; + Item.defense = 24; Item.rare = ModContent.RarityType(); } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.1f; - player.GetDamage() += 0.08f; - player.GetCritChance() += 8; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Victide/VictideHeadBarrier.cs b/Items/Armor/Victide/VictideHeadBarrier.cs index 0cd59efdd7..5da260e68e 100644 --- a/Items/Armor/Victide/VictideHeadBarrier.cs +++ b/Items/Armor/Victide/VictideHeadBarrier.cs @@ -23,8 +23,9 @@ namespace CalamityMod.Items.Armor.Victide // Set Bonus public static int BarrierCooldown = CalamityUtils.SecondsToFrames(8); - public static int BarrierDefenseBoost = 8; + public static int BarrierDefenseBoost = 5; public static float BarrierDamageAbsorptionPercent = 0.1f; + public static int BarrierFramesPerHeal = 15; public static int BarrierDamage = 50; public static float BarrierExplosionKB = 8f; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Armor.Victide Item.height = 18; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; - Item.defense = 7; // 16 + Item.defense = 6; // 15 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); diff --git a/Items/Armor/Victide/VictideHeadBurrow.cs b/Items/Armor/Victide/VictideHeadBurrow.cs index beb9f5767b..8eaf0ed7be 100644 --- a/Items/Armor/Victide/VictideHeadBurrow.cs +++ b/Items/Armor/Victide/VictideHeadBurrow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.Victide public static float BaseBurrowSpeed = 9f; // 46 mph public static float SubmergedBurrowSpeed = 12f; // 61 mph public static float BaseAcceleration = 0.4f; // For reference, base player running acceleration is 0.08 - public static int BurrowDuration = CalamityUtils.SecondsToFrames(8); + public static int BurrowDuration = CalamityUtils.SecondsToFrames(7); public static int BurrowCooldown = CalamityUtils.SecondsToFrames(30); public override void SetDefaults() diff --git a/Items/Armor/Victide/VictideHeadSnail.cs b/Items/Armor/Victide/VictideHeadSnail.cs index 7b82692256..7b4de4234d 100644 --- a/Items/Armor/Victide/VictideHeadSnail.cs +++ b/Items/Armor/Victide/VictideHeadSnail.cs @@ -21,6 +21,9 @@ namespace CalamityMod.Items.Armor.Victide public static int AggroReduction = 200; public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(FishingPowerBoost); + // Set Bonus + public static int SetBonusGrabRangeBoost = 102; // (2.625 + 6.375 = 9 tiles) + public override void SetDefaults() { Item.width = 18; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 04d78e3550..583ab42e22 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -8,7 +8,13 @@ using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; +using CalamityMod.Items.Armor.Bloodflare; +using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.Items.Armor.Hydrothermic; +using CalamityMod.Items.Armor.Prismatic; +using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.Tarragon; +using CalamityMod.Items.Armor.Victide; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; @@ -19,6 +25,7 @@ using CalamityMod.NPCs.Other; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Packets; using CalamityMod.Particles; +using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -42,6 +49,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.Utilities; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items { @@ -123,11 +131,6 @@ namespace CalamityMod.Items /// public bool devItem = false; /// - /// If true, this item can fire projectiles with point-blank damage.
- /// Also adds a tooltip line to the bottom of the item's tooltip. - ///
- public bool canFirePointBlankShots = false; - /// /// If set to a value greater than 1, applies a multiplier to the item's grab range.
/// Used by coin items spawned from hitting ricoshot coins. ///
@@ -170,7 +173,6 @@ namespace CalamityMod.Items myClone.revengeanceItem = revengeanceItem; myClone.donorItem = donorItem; myClone.devItem = devItem; - myClone.canFirePointBlankShots = canFirePointBlankShots; myClone.grabRangeMultiplier = grabRangeMultiplier; return myClone; @@ -256,7 +258,7 @@ namespace CalamityMod.Items // Zenith rarity if (item.type == ItemID.Zenith) - item.rare = ModContent.RarityType(); + item.rare = RarityType(); // Make most expert items no longer expert because they drop in all modes now. switch (item.type) @@ -339,9 +341,9 @@ namespace CalamityMod.Items if (Main.myPlayer == player.whoAmI && player.Calamity().cursedSummonsEnchant) { - if (NPC.CountNPCS(ModContent.NPCType()) < 2) + if (NPC.CountNPCS(NPCType()) < 2) { - CalamityNetcode.NewNPC_ClientSide(mouse, ModContent.NPCType(), player); + CalamityNetcode.NewNPC_ClientSide(mouse, NPCType(), player); SoundEngine.PlaySound(SoundID.DD2_DarkMageSummonSkeleton, mouse); } } @@ -352,7 +354,7 @@ namespace CalamityMod.Items // // Traitorous has been reworked to be a guaranteed effect below 25% mana, which removes all your remaining mana bool belowManaThreshold = player.statMana < player.statManaMax2 * 0.25f; - bool traitorousAlreadyInPlay = player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + bool traitorousAlreadyInPlay = player.ownedProjectileCounts[ProjectileType()] > 0; if (Main.myPlayer == player.whoAmI && player.Calamity().manaMonsterEnchant && !traitorousAlreadyInPlay && belowManaThreshold) { // Calculate how much damage to deal based on how much mana was consumed @@ -362,7 +364,7 @@ namespace CalamityMod.Items // Spawn the Mana Monster Vector2 shootVelocity = player.SafeDirectionTo(mouse, -Vector2.UnitY).RotatedByRandom(0.07f) * Main.rand.NextFloat(4f, 5f); - Projectile.NewProjectile(source, player.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), monsterDamage, 0f, player.whoAmI); + Projectile.NewProjectile(source, player.Center + shootVelocity, shootVelocity, ProjectileType(), monsterDamage, 0f, player.whoAmI); // Set the player's mana to zero. player.statMana = 0; @@ -375,10 +377,8 @@ namespace CalamityMod.Items modPlayer.canFireBloodflareMageProjectile = false; if (player.whoAmI == Main.myPlayer) { - // Bloodflare Mage Bolt: 130%, soft cap starts at 2000 base damage - int bloodflareBoltDamage = CalamityUtils.DamageSoftCap(damage * 1.3, 2600); - - Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), bloodflareBoltDamage, 1f, player.whoAmI); + int bloodflareBoltDamage = CalamityUtils.DamageSoftCap(damage * BloodflareHeadMagic.GhostBoltDamageRatio, BloodflareHeadMagic.GhostBoltonDamageSoftcap); + Projectile.NewProjectile(playerSource, position, velocity, ProjectileType(), bloodflareBoltDamage, 1f, player.whoAmI); } } } @@ -389,22 +389,19 @@ namespace CalamityMod.Items modPlayer.canFireBloodflareRangedProjectile = false; if (player.whoAmI == Main.myPlayer) { - // Bloodflare Ranged Bloodsplosion: 80%, soft cap starts at 150 base damage - // This is intentionally extremely low because this effect can be grossly overpowered with sniper rifles and the like. - int bloodsplosionDamage = CalamityUtils.DamageSoftCap(damage * 0.8, 120); - - Projectile.NewProjectile(playerSource, position, velocity, ModContent.ProjectileType(), bloodsplosionDamage, 2f, player.whoAmI); + int bloodsplosionDamage = CalamityUtils.DamageSoftCap(damage * BloodflareHeadRanged.BloodBombDamageRatio, BloodflareHeadRanged.BloodBombDamageSoftcap); + Projectile.NewProjectile(playerSource, position, velocity, ProjectileType(), bloodsplosionDamage, 2f, player.whoAmI); } } } if (modPlayer.tarraMage && !item.channel) { - if (modPlayer.tarraCrits >= 5 && player.whoAmI == Main.myPlayer) + if (modPlayer.tarraCrits >= TarragonHeadMagic.CritsToSpawnLeaves && player.whoAmI == Main.myPlayer) { modPlayer.tarraCrits = 0; // Tarragon Mage Leaves: (8-10) x 20%, soft cap starts at 200 base damage int leafAmt = 8 + Main.rand.Next(3); // 8, 9, or 10 - int leafDamage = (int)(damage * 0.2f); + int leafDamage = (int)(damage * TarragonHeadMagic.LeafDamageRatio); for (int l = 0; l < leafAmt; l++) { @@ -429,7 +426,7 @@ namespace CalamityMod.Items if (player.whoAmI == Main.myPlayer) { int ataxiaFlareDamage = (int)(damage * HydrothermicHeadRanged.FlareDamageRatio); - Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); + Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); } } } @@ -440,10 +437,8 @@ namespace CalamityMod.Items modPlayer.canFireGodSlayerRangedProjectile = false; if (player.whoAmI == Main.myPlayer) { - // God Slayer Ranged Shrapnel: 100%, soft cap starts at 800 base damage - int shrapnelRoundDamage = CalamityUtils.DamageSoftCap(damage, 800); - - Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ModContent.ProjectileType(), shrapnelRoundDamage, 2f, player.whoAmI); + int shrapnelRoundDamage = CalamityUtils.DamageSoftCap(damage * GodSlayerHeadRanged.ShrapnelRoundDamageRatio, GodSlayerHeadRanged.ShrapnelRoundDamageSoftcap); + Projectile.NewProjectile(playerSource, position, velocity * 1.25f, ProjectileType(), shrapnelRoundDamage, 2f, player.whoAmI); } } } @@ -452,7 +447,7 @@ namespace CalamityMod.Items if (item.CountsAsClass() && !item.channel) { modPlayer.canFireAtaxiaRogueProjectile = false; - int flareID = ModContent.ProjectileType(); + int flareID = ProjectileType(); int flareDamage = CalamityUtils.DamageSoftCap(HydrothermicHeadRogue.VolleyDamage + damage * HydrothermicHeadRogue.VolleyDamageRatio, HydrothermicHeadRogue.VolleyDamageSoftcap); if (player.whoAmI == Main.myPlayer) @@ -468,7 +463,7 @@ namespace CalamityMod.Items } if (modPlayer.prismaticRegalia) { - if (item.CountsAsClass() && Main.rand.NextBool(20) && !item.channel) + if (item.CountsAsClass() && Main.rand.NextBool(PrismaticRegalia.RocketChanceDenominator) && !item.channel) { if (player.whoAmI == Main.myPlayer) { @@ -477,7 +472,7 @@ namespace CalamityMod.Items if (i != 0) { Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); - int rocket = Projectile.NewProjectile(playerSource, position, perturbedSpeed, ModContent.ProjectileType(), (int)(damage * 0.25), 2f, player.whoAmI, 0, 12f); + int rocket = Projectile.NewProjectile(playerSource, position, perturbedSpeed, ProjectileType(), (int)(damage * PrismaticRegalia.RocketDamageRatio), 2f, player.whoAmI, 0, 12f); //First extra value is rocket type which I just used 0 to get the default, second is the velocity I went with my gut feeling and got quite close to Scorpio's velocity with Rockets I if (rocket.WithinBounds(Main.maxProjectiles)) Main.projectile[rocket].DamageType = DamageClass.Generic; @@ -567,13 +562,10 @@ namespace CalamityMod.Items tag.Add("charge", Charge); tag.Add("enchantmentID", AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); tag.Add("DischargeEnchantExhaustion", DischargeEnchantExhaustion); - tag.Add("canFirePointBlankShots", canFirePointBlankShots); } public override void LoadData(Item item, TagCompound tag) { - canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); - // Changed charge from int to float. If an old charge int is present, load that instead. if (tag.ContainsKey("Charge")) Charge = tag.GetInt("Charge"); @@ -592,11 +584,6 @@ namespace CalamityMod.Items public override void NetSend(Item item, BinaryWriter writer) { - BitsByte flags = new BitsByte(); - flags[0] = canFirePointBlankShots; - // rip, no other flags. what a byte. - - writer.Write(flags); writer.Write(Charge); writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); writer.Write(DischargeEnchantExhaustion); @@ -604,9 +591,6 @@ namespace CalamityMod.Items public override void NetReceive(Item item, BinaryReader reader) { - BitsByte flags = reader.ReadByte(); - canFirePointBlankShots = flags[0]; - Charge = reader.ReadSingle(); Enchantment? savedEnchantment = EnchantmentManager.FindByID(reader.ReadInt32()); @@ -627,7 +611,7 @@ namespace CalamityMod.Items // Prevent Mana Stars from being picked up while wielding Ion Blaster or Apoctosis Array if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum) { - if (player.ActiveItem().type == ModContent.ItemType() || player.ActiveItem().type == ModContent.ItemType()) + if (player.ActiveItem().type == ItemType() || player.ActiveItem().type == ItemType()) return false; } return base.CanPickup(item, player); @@ -650,7 +634,7 @@ namespace CalamityMod.Items // Clear Evil Smasher buffs if not holding Evil Smasher if (player.Calamity().evilSmasherBoost > 0) { - if (item.type != ModContent.ItemType()) + if (item.type != ItemType()) player.Calamity().evilSmasherBoost = 0; } @@ -666,24 +650,46 @@ namespace CalamityMod.Items if (Main.zenithWorld && item.type == ItemID.RodOfHarmony) { - if (NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.AnyNPCs(NPCType())) { //one hour of NOU when using rod of harmony while LORDE is alive - player.AddBuff(ModContent.BuffType(), 3600 * 60); + player.AddBuff(BuffType(), 3600 * 60); } } // Give 1 minute of Mushy buff when consuming Mushrooms with Fungal Symbiote equipped. if (item.type == ItemID.Mushroom && player.Calamity().fungalSymbiote) - player.AddBuff(ModContent.BuffType(), 3600); + player.AddBuff(BuffType(), 3600); - // Trigger Bloom Stone's heal over time from healing items - if (item.healLife > 0 && modPlayer.bloomStone) + // Healing item interactions + if (item.healLife > 0) { - // Temporarily disable Bloom Stone so that GetHealLife doesn't return 0 - modPlayer.bloomStone = false; - modPlayer.bloomStoneTotalHeal = modPlayer.bloomStoneHealPool = player.GetHealLife(item); - modPlayer.bloomStone = true; + // Jelly aura spawning + // This runs twice per use for whatever reason so we need a stopping player variable + if (player.whoAmI == Main.myPlayer && !modPlayer.spawnedJellyAura) + { + if (modPlayer.absorber) + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0, player.whoAmI); + else if (modPlayer.GrandGelatin) + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0, player.whoAmI); + else + { + if (modPlayer.cleansingjelly) + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0, player.whoAmI); + if (modPlayer.lifejelly) + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType(), 0, 0, player.whoAmI); + } + modPlayer.spawnedJellyAura = true; + } + + // Trigger Bloom Stone's heal over time from healing items + if (modPlayer.bloomStone) + { + // Temporarily disable Bloom Stone so that GetHealLife doesn't return 0 + modPlayer.bloomStone = false; + modPlayer.bloomStoneTotalHeal = modPlayer.bloomStoneHealPool = player.GetHealLife(item); + modPlayer.bloomStone = true; + } } // Staff/Axe of Regrowth growing Calamity grass @@ -692,16 +698,16 @@ namespace CalamityMod.Items Tile tile = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY); Tile tileAbove = Framing.GetTileSafely(Player.tileTargetX, Player.tileTargetY - 1); - if (tile.HasTile && !tileAbove.HasTile && tileAbove.LiquidAmount == 0 && tile.TileType == ModContent.TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) + if (tile.HasTile && !tileAbove.HasTile && tileAbove.LiquidAmount == 0 && tile.TileType == TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) { - Main.tile[Player.tileTargetX, Player.tileTargetY].TileType = (ushort)ModContent.TileType(); + Main.tile[Player.tileTargetX, Player.tileTargetY].TileType = (ushort)TileType(); SoundEngine.PlaySound(SoundID.Dig, player.Center); return true; } - else if (tile.HasTile && tile.TileType == ModContent.TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) + else if (tile.HasTile && tile.TileType == TileType() && player.IsInTileInteractionRange(Player.tileTargetX, Player.tileTargetY, TileReachCheckSettings.Simple)) { - Main.tile[Player.tileTargetX, Player.tileTargetY].TileType = (ushort)ModContent.TileType(); + Main.tile[Player.tileTargetX, Player.tileTargetY].TileType = (ushort)TileType(); SoundEngine.PlaySound(SoundID.Dig, player.Center); return true; @@ -716,7 +722,7 @@ namespace CalamityMod.Items { return false; } - if (player.ActiveItem().type == ModContent.ItemType() && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + if (player.ActiveItem().type == ItemType() && player.ownedProjectileCounts[ProjectileType()] == 0) { foreach (Projectile p in Main.ActiveProjectiles) { @@ -731,13 +737,13 @@ namespace CalamityMod.Items } return false; } - if (player.ActiveItem().type == ModContent.ItemType()) + if (player.ActiveItem().type == ItemType()) { bool canContinue = true; int count = 0; foreach (Projectile p in Main.ActiveProjectiles) { - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) + if (p.type == ProjectileType() && p.owner == player.whoAmI) { if (p.ai[1] > 1f) { @@ -767,7 +773,7 @@ namespace CalamityMod.Items if (Main.projectile.Length == Main.maxProjectiles) break; int GlacialEmbraceDamage = (int)player.GetTotalDamage().ApplyTo(80); - int projj = Projectile.NewProjectile(source, mouse, Vector2.Zero, ModContent.ProjectileType(), GlacialEmbraceDamage, 1f, player.whoAmI, angle, 2f); + int projj = Projectile.NewProjectile(source, mouse, Vector2.Zero, ProjectileType(), GlacialEmbraceDamage, 1f, player.whoAmI, angle, 2f); Main.projectile[projj].originalDamage = 80; angle += angleVariance; @@ -795,10 +801,10 @@ namespace CalamityMod.Items return false; // Can't use anything while burrowing - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ProjectileType()] > 0) return false; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && + if (player.ownedProjectileCounts[ProjectileType()] > 0 && (item.damage > 0 || item.ammo != AmmoID.None)) { return false; // Don't use weapons if you're charging with a spear @@ -810,7 +816,7 @@ namespace CalamityMod.Items return base.CanUseItem(item, player); // Conversion for Andromeda - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ProjectileType()] > 0) { if (item.type == ItemID.WireKite) return false; @@ -979,7 +985,7 @@ namespace CalamityMod.Items target.Calamity().hyperiusDamage -= damage; // Spawn overflow hit - Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, player.whoAmI, target.whoAmI); + Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), (int)(damage * HyperiusBullet.overflowEfficency), 0, player.whoAmI, target.whoAmI); overflow.DamageType = item.DamageType; overflow.ArmorPenetration = item.ArmorPenetration; // Takes the armor pen from what did the hit @@ -1234,10 +1240,6 @@ namespace CalamityMod.Items { CalamityPlayer modPlayer = player.Calamity(); - // Obsidian Skull and its upgrades make you immune to On Fire! - if (item.type == ItemID.ObsidianSkull || item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaWaders || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose || item.type == ItemID.AnkhShield) - player.buffImmune[BuffID.OnFire] = true; - // Ankh Shield Mighty Wind immunity. if (item.type == ItemID.AnkhShield) player.buffImmune[BuffID.WindPushed] = true; @@ -1257,17 +1259,6 @@ namespace CalamityMod.Items player.buffImmune[BuffID.OnFire] = true; } - // Reduced Nightwither and Holy Flames damage. - if (item.type == ItemID.MoonStone) - modPlayer.reducedNightwitherDamage = true; - if (item.type == ItemID.SunStone) - modPlayer.reducedDaybrokenDamage = true; - if (item.type == ItemID.CelestialStone || item.type == ItemID.CelestialShell) - { - modPlayer.reducedDaybrokenDamage = true; - modPlayer.reducedNightwitherDamage = true; - } - if (item.type == ItemID.FairyBoots) modPlayer.fairyBoots = true; @@ -1386,9 +1377,6 @@ namespace CalamityMod.Items player.GetAttackSpeed() -= 0.1f; } - if (item.type == ItemID.TerrasparkBoots) - player.buffImmune[BuffID.OnFire] = true; - if (item.type == ItemID.GravityGlobe) { player.GetJumpState().Enable(); @@ -1427,7 +1415,7 @@ namespace CalamityMod.Items { Vector2 ornamentPos = player.Center + Vector2.UnitY.RotatedByRandom(MathHelper.ToRadians(105f)) * Main.rand.NextFloat(-512f, -320f); - int p = Projectile.NewProjectile(source, ornamentPos, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + int p = Projectile.NewProjectile(source, ornamentPos, Vector2.Zero, ProjectileType(), 0, 0f, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) modPlayer.wingProjectileCooldown = 90; } @@ -1443,7 +1431,7 @@ namespace CalamityMod.Items { Vector2 fairyDustVel = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.08f, 0.2f); - int p = Projectile.NewProjectile(source, player.Center, fairyDustVel, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + int p = Projectile.NewProjectile(source, player.Center, fairyDustVel, ProjectileType(), 0, 0f, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) modPlayer.wingProjectileCooldown = 8; } @@ -1475,7 +1463,7 @@ namespace CalamityMod.Items float flightSpeedMult = 1f + (modPlayer.soaring ? SoaringPotion.FlightBoost : 0f) + - (modPlayer.reaverSpeed ? 0.1f : 0f) + + (modPlayer.reaverSpeed ? ReaverHeadMobility.SetBonusFlightBoost : 0f) + moveSpeedBoost; float flightAccMult = 1f + moveSpeedBoost; @@ -1525,14 +1513,11 @@ namespace CalamityMod.Items if (grabRangeMultiplier > 1f) grabRange = (int)(grabRangeMultiplier * grabRange); - // Then, if wearing the appropriate Reaver armor, add 246 flat item grab range. (2.625 + 15.375 = 18 tiles) - // For reference, Treasure Magnet adds 150 (2.625 + 9.375 = 12 tiles) + // Then, apply flat grab range boosts. if (player.Calamity().reaverExplore) - grabRange += 246; - - // Victide utility set provides a lesser boost of 102 (2.625 + 6.375 = 9 tiles) + grabRange += ReaverHeadExplore.SetBonusGrabRangeBoost; if (player.Calamity().victideSnailSet) - grabRange += 102; + grabRange += VictideHeadSnail.SetBonusGrabRangeBoost; // Nebula boosters have greater pickup range while using Nebula Mantle. if (player.wingsLogic == (int)VanillaWingID.WingsNebula && ItemID.Sets.NebulaPickup[item.type]) @@ -1651,12 +1636,12 @@ namespace CalamityMod.Items Texture2D itemTexture = TextureAssets.Item[item.type].Value; Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); - if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ModContent.ItemType())) + if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ItemType())) return true; // Draw all particles. float currentPower = 0f; - int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType()); + int calamitasNPCIndex = NPC.FindFirstNPC(NPCType()); if (calamitasNPCIndex != -1) currentPower = Utils.GetLerpValue(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); @@ -1681,7 +1666,7 @@ namespace CalamityMod.Items // This was moved out of an On edit in the DraedonsForge item for Magic Storage compatibility. Player p = Main.LocalPlayer; if (cachedForgeID < 0) - cachedForgeID = ModContent.TileType(); + cachedForgeID = TileType(); if (context is RecipeItemCreationContext && p.adjTile[cachedForgeID]) p.Calamity().HasCraftedDraedonsForge = true; } @@ -1720,7 +1705,7 @@ namespace CalamityMod.Items { storedPrefix = -1; // Bandit steals 20% of the total price of the reforge if she's around. - if (NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.AnyNPCs(NPCType())) { // Calculate the item's reforge cost. int value = item.value; @@ -1822,17 +1807,17 @@ namespace CalamityMod.Items return RarityBuyPriceArray[rarity]; // Calamity rarities aren't guaranteed to have the monotonic IDs, so they're handled directly. - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityTurquoiseBuyPrice; - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityPureGreenBuyPrice; - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityDarkBlueBuyPrice; - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityVioletBuyPrice; - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityHotPinkBuyPrice; - if (rarity == ModContent.RarityType()) + if (rarity == RarityType()) return RarityCalamityRedBuyPrice; // Return 0 if it's not a progression based or other mod's rarity diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index c9be425662..3c2271b110 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -31,17 +31,17 @@ namespace CalamityMod.Items { #region Boss Treasure Bags case ItemID.KingSlimeBossBag: - loot.DefineConditionalDropSet(DropHelper.NotRemix).Add(ItemID.Katana, 3); // 33% Katana - loot.DefineConditionalDropSet(DropHelper.Remix).Add(ItemID.Keybrand, 3); // 33% Keybrand in Remix + loot.DefineConditionalDropSet(DropHelper.NotRemix).Add(ItemID.Katana, DropHelper.BagWeaponDropRateInt); // 33% Katana + loot.DefineConditionalDropSet(DropHelper.Remix).Add(ItemID.Keybrand, DropHelper.BagWeaponDropRateInt); // 33% Keybrand in Remix - loot.Add(new CommonDrop(ModContent.ItemType(), 10)); // 10% Crown Jewel + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Crown Jewel loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; case ItemID.EyeOfCthulhuBossBag: - loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); // 33% Deathstare Rod - loot.Add(ModContent.ItemType(), 10); // 10% Teardrop Cleaver + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Deathstare Rod + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% Teardrop Cleaver loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; @@ -93,7 +93,7 @@ namespace CalamityMod.Items ModContent.ItemType(), }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, queenBeeWeapons)); - loot.Add(ModContent.ItemType(), 10); // 10% The Bee + loot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); // 33% The Bee loot.Add(ItemID.Stinger, 1, 8, 12); // 100% 8-12 Stinger loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -105,6 +105,7 @@ namespace CalamityMod.Items int[] wofWeapons = new int[] { ItemID.BreakerBlade, + ModContent.ItemType(), ItemID.ClockworkAssaultRifle, ModContent.ItemType(), ItemID.LaserRifle, @@ -113,7 +114,6 @@ namespace CalamityMod.Items ModContent.ItemType() }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, wofWeapons)); - loot.Add(ModContent.ItemType(), 10); // 10% Carnage int[] emblems = new int[] { @@ -145,7 +145,6 @@ namespace CalamityMod.Items case ItemID.TwinsBossBag: loot.Remove(FindHallowedBars(loot)); loot.AddIf(DropHelper.HallowedBarsCondition, ItemID.HallowedBar, 1, 20, 35); - loot.Add(ModContent.ItemType(), 10); // 10% Arbalest loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 7d006dd210..6fbc26e8de 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -145,14 +145,6 @@ namespace CalamityMod.Items // Modify all vanilla tooltips before appending mod mechanics (if any). ModifyVanillaTooltips(item, tooltips); - // Adds "Does extra damage to enemies shot at point-blank range" to weapons capable of it. - if (canFirePointBlankShots) - { - LocalizedText lineText = CalamityUtils.GetText("Misc.PointBlank"); - TooltipLine line = new TooltipLine(Mod, "CalamityMod:PointBlankTooltip", lineText.Value); - tooltips.Insert(++lastTooltipIndex, line); - } - // If an item has an enchantment, show its prefix in the first tooltip line and append its description to the tooltip list. EnchantmentTooltips(item, tooltips); @@ -572,10 +564,6 @@ namespace CalamityMod.Items if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush)) EditTooltipByNum(0, (line) => line.Text += AddedTooltip("Pwnhammer")); - // Warmth Potion reduces debuff durations - if (item.type == ItemID.WarmthPotion) - EditTooltipByNum(0, (line) => line.Text += AddedTooltip("WarmthPotion")); - // Nerfed Archery Potion tooltip if (item.type == ItemID.ArcheryPotion) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion")); @@ -803,27 +791,15 @@ namespace CalamityMod.Items if (item.type == ItemID.FairyBoots) EditTooltipByNum(2, (line) => line.Text += AddedTooltip("FairyBoots")); - // Reduced Nightwither and Daybroken damage, and melee speed removal. + // Melee speed removal. if (item.type == ItemID.MoonStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("MoonStone")); EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); - } if (item.type == ItemID.SunStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("SunStone")); EditTooltipByNum(1, (line) => line.Text = EditedTooltip("SunMoonStones")); - } if (item.type == ItemID.CelestialStone) - { - EditTooltipByNum(2, (line) => line.Text += AddedTooltip("CelestialStone")); EditTooltipByNum(0, (line) => line.Text = EditedTooltip("CelestialStoneShell")); - } if (item.type == ItemID.CelestialShell) - { - EditTooltipByNum(4, (line) => line.Text += AddedTooltip("CelestialStone")); EditTooltipByNum(2, (line) => line.Text = EditedTooltip("CelestialStoneShell")); - } // Mana Flower tinker buffs. if (item.type == ItemID.MagnetFlower) @@ -953,21 +929,6 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = EditedTooltip("FireGauntlet2") + AddedTooltip("TitanGloveLine")); } - // On Fire! debuff immunities - if (item.type == ItemID.ObsidianSkull || item.type == ItemID.ObsidianSkullRose || item.type == ItemID.MoltenCharm) - EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); - - if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaSkull || item.type == ItemID.MoltenSkullRose) - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("ObsidianSkullLine")); - - if (item.type == ItemID.LavaWaders) - EditTooltipByNum(1, (line) => line.Text = EditedTooltip("LavaWaders")); - - if (item.type == ItemID.TerrasparkBoots) - EditTooltipByNum(3, (line) => line.Text = EditedTooltip("LavaWaders")); - - // Ozzatron 23NOV2023: Removed tooltip edits for Magma Skull and Molten Skull Rose, as they were invalid after vanilla tooltip changes. - // Yoyo Glove/Bag apply a 0.5x damage multiplier on the second yoyo if (item.type == ItemID.YoyoBag || item.type == ItemID.YoYoGlove) EditTooltipByNum(0, (line) => line.Text += AddedTooltip("YoyoGlove")); @@ -1131,10 +1092,8 @@ namespace CalamityMod.Items // Non-consumable boss summon items #region Vanilla Boss Summon Non-consumable Tooltips - if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.BloodMoonStarter || item.type == ItemID.GoblinBattleStandard || - item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing || item.type == ItemID.QueenSlimeCrystal || - item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || - item.type == ItemID.NaughtyPresent || item.type == ItemID.PumpkinMoonMedallion || item.type == ItemID.SolarTablet || item.type == ItemID.SolarTablet || item.type == ItemID.CelestialSigil) + if (item.type == ItemID.SlimeCrown || item.type == ItemID.SuspiciousLookingEye || item.type == ItemID.WormFood || item.type == ItemID.BloodySpine || item.type == ItemID.Abeemination || item.type == ItemID.DeerThing + || item.type == ItemID.QueenSlimeCrystal || item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalWorm || item.type == ItemID.MechanicalSkull || item.type == ItemID.CelestialSigil) EditTooltipByNum(0, (line) => line.Text += "\n" + CalamityUtils.GetTextValue("Common.NotConsumable")); #endregion diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index ef2d422864..f9987ef183 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -6,7 +6,9 @@ using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Items.Weapons.Typeless; +using CalamityMod.Physics; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -29,7 +31,6 @@ namespace CalamityMod.Items // Various shorthands for items which receive very simple changes, or are repeated multiple times. IItemTweak[] trueMelee = Do(TrueMelee); IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); - IItemTweak[] pointBlank = Do(PointBlank); IItemTweak[] autoReuse = Do(AutoReuse); IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable, UseTimeExact(10)); IItemTweak[] phaseblade = Do(AutoReuse, UseTurn, DamageExact(36)); @@ -43,7 +44,7 @@ namespace CalamityMod.Items { #region CATEGORY 1: Weapon Balancing { ItemID.AdamantiteGlaive, Do(AutoReuse, TrueMelee, DamageExact(69), UseExact(7), ShootSpeedExact(18f)) }, - { ItemID.AdamantiteRepeater, Do(PointBlank, UseExact(14)) }, + { ItemID.AdamantiteRepeater, Do(UseExact(14)) }, { ItemID.AdamantiteSword, Do(UseTurn, DamageExact(75), UseExact(7)) }, { ItemID.AmberStaff, Do(UseTimeExact(15), UseAnimationExact(45), ReuseDelayExact(15)) }, { ItemID.AmethystStaff, Do(ManaExact(2)) }, @@ -56,31 +57,31 @@ namespace CalamityMod.Items { ItemID.BeeGun, Do(DamageExact(11), ManaExact(4)) }, { ItemID.BeeKeeper, Do(UseTurn, DamageExact(32)) }, { ItemID.Beenade, Do(DamageExact(11), UseTimeExact(22), ShootSpeedExact(10f)) }, - { ItemID.BeesKnees, Do(PointBlank, DamageExact(21), UseExact(38)) }, + { ItemID.BeesKnees, Do(DamageExact(21), UseExact(38)) }, { ItemID.Bladetongue, Do(UseTurn, UseRatio(0.8f), DamageExact(120)) }, { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, { ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) }, - { ItemID.Blowgun, Do(PointBlank, DamageExact(40), ShootSpeedExact(15f)) }, + { ItemID.Blowgun, Do(DamageExact(40), ShootSpeedExact(15f)) }, { ItemID.BluePhaseblade, phaseblade }, { ItemID.BluePhasesaber, phasesaber }, { ItemID.BoneSword, Do(AutoReuse, UseTurn, DamageExact(25)) }, { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom - { ItemID.Boomstick, Do(PointBlank, DamageExact(11)) }, + { ItemID.Boomstick, Do(DamageExact(11)) }, { ItemID.BreakerBlade, Do(AutoReuse, UseTurn, DamageExact(140)) }, - { ItemID.CandyCornRifle, Do(PointBlank, DamageExact(66)) }, + { ItemID.CandyCornRifle, Do(DamageExact(66)) }, { ItemID.Cascade, Do(AutoReuse, DamageExact(31)) }, { ItemID.ChainGuillotines, Do(DamageExact(100)) }, - { ItemID.ChainGun, Do(PointBlank, DamageExact(35)) }, + { ItemID.ChainGun, Do(DamageExact(35)) }, { ItemID.ChainKnife, Do(AutoReuse, DamageRatio(1.34f)) }, // Uses ratios due to remix seed { ItemID.ChlorophyteClaymore, Do(UseMeleeSpeed, DamageExact(180), UseExact(45), ShootSpeedExact(22f)) }, { ItemID.ChlorophytePartisan, Do(AutoReuse, UseMeleeSpeed, DamageExact(98)) }, { ItemID.ChlorophyteSaber, Do(UseMeleeSpeed, DamageExact(92), UseExact(10)) }, { ItemID.ChristmasTreeSword, Do(AutoReuse, UseTurn, UseMeleeSpeed, DamageExact(80), UseExact(30)) }, { ItemID.ClingerStaff, Do(DamageExact(63)) }, - { ItemID.ClockworkAssaultRifle, Do(PointBlank, DamageExact(21)) }, + { ItemID.ClockworkAssaultRifle, Do(DamageExact(21)) }, { ItemID.CobaltNaginata, Do(AutoReuse, TrueMelee, DamageExact(55), UseExact(9), ShootSpeedExact(12f)) }, - { ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) }, + { ItemID.CobaltRepeater, Do(UseExact(18)) }, { ItemID.CobaltSword, Do(UseTurn, DamageExact(60), UseExact(9)) }, { ItemID.Code2, Do(AutoReuse, DamageExact(43)) }, { ItemID.CoinGun, Do(UseExact(12)) }, @@ -96,14 +97,14 @@ namespace CalamityMod.Items { ItemID.DaedalusStormbow, Do(DamageExact(30)) }, { ItemID.DaoofPow, Do(DamageExact(85)) }, { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(40)) }, - { ItemID.DartRifle, Do(PointBlank, DamageExact(58)) }, + { ItemID.DartRifle, Do(DamageExact(58)) }, { ItemID.DayBreak, Do(DamageExact(125), UseExact(20)) }, { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon { ItemID.DD2SquireDemonSword, Do(DamageExact(110), UseExact(25)) }, // Brand of the Inferno { ItemID.DeadlySphereStaff, Do(AutoReuse, UseExact(20), DamageExact(50)) }, { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(70), ShootSpeedExact(15f)) }, - { ItemID.DemonBow, Do(PointBlank, DamageExact(12), AutoReuse) }, + { ItemID.DemonBow, Do(DamageExact(12), AutoReuse) }, { ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar { ItemID.ElectrosphereLauncher, Do(DamageExact(44)) }, @@ -125,7 +126,7 @@ namespace CalamityMod.Items { ItemID.FlyingKnife, Do(DamageExact(53)) }, { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update - { ItemID.Gatligator, Do(PointBlank, UseExact(6)) }, + { ItemID.Gatligator, Do(UseExact(6)) }, { ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) }, { ItemID.GolemFist, Do(DamageExact(150)) }, { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, @@ -133,9 +134,8 @@ namespace CalamityMod.Items { ItemID.GreenPhasesaber, phasesaber }, { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) }, - { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, - { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, - { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, + { ItemID.HallowedRepeater, Do(UseExact(12)) }, + { ItemID.Handgun, Do(UseExact(20)) }, { ItemID.HighVelocityBullet, Do(DamageExact(13)) }, { ItemID.HiveFive, Do(AutoReuse, DamageExact(27)) }, { ItemID.HornetStaff, Do(AutoReuse, DamageExact(18), UseExact(30)) }, @@ -162,14 +162,14 @@ namespace CalamityMod.Items { ItemID.MagicalHarp, Do(DamageExact(50), ShootSpeedExact(12f)) }, { ItemID.MagicDagger, Do(DamageRatio(1.8f), UseRatio(1.88f), ShootSpeedExact(30)) }, // Uses ratios due to remix seed { ItemID.MagicMissile, Do(DamageExact(23), ManaExact(10), UseAnimationExact(20), UseTimeExact(10)) }, - { ItemID.Marrow, Do(PointBlank, DamageExact(69)) }, + { ItemID.Marrow, Do(DamageExact(69)) }, { ItemID.MedusaHead, Do(ManaExact(6), DamageExact(48)) }, { ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, { ItemID.MeteorStaff, Do(DamageExact(58), ManaExact(7), ShootSpeedExact(13f)) }, { ItemID.MiniNukeI, Do(DamageExact(90)) }, { ItemID.MiniNukeII, Do(DamageExact(90)) }, - { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, - { ItemID.MoltenFury, Do(PointBlank, UseExact(28), AutoReuse) }, + { ItemID.Minishark, Do(DamageExact(4)) }, + { ItemID.MoltenFury, Do(UseExact(28), AutoReuse) }, { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury @@ -177,9 +177,9 @@ namespace CalamityMod.Items { ItemID.MoonlordTurretStaff, Do(DamageExact(50), UseExact(15)) }, // Lunar Portal Staff { ItemID.Muramasa, Do(CritDelta(+10)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, - { ItemID.Musket, Do(PointBlank, DamageExact(22)) }, + { ItemID.Musket, Do(DamageExact(22)) }, { ItemID.MythrilHalberd, Do(AutoReuse, TrueMelee, DamageExact(65), UseExact(8), ShootSpeedExact(15f)) }, - { ItemID.MythrilRepeater, Do(PointBlank, UseExact(16)) }, + { ItemID.MythrilRepeater, Do(UseExact(16)) }, { ItemID.MythrilSword, Do(UseTurn, DamageExact(70), UseExact(8)) }, { ItemID.NailGun, Do(DamageExact(77)) }, { ItemID.NettleBurst, Do(ManaExact(10), DamageExact(65)) }, @@ -188,19 +188,18 @@ namespace CalamityMod.Items { ItemID.OrangePhaseblade, phaseblade }, { ItemID.OrangePhasesaber, phasesaber }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, - { ItemID.OrichalcumRepeater, Do(PointBlank, DamageExact(48)) }, + { ItemID.OrichalcumRepeater, Do(DamageExact(48)) }, { ItemID.OrichalcumSword, Do(UseTurn, DamageExact(175)) }, - { ItemID.PainterPaintballGun, Do(PointBlank, DamageExact(8)) }, { ItemID.PaladinsHammer, Do(DamageExact(95), ShootSpeedExact(28)) }, { ItemID.PalladiumPike, Do(AutoReuse, TrueMelee, DamageExact(120), ShootSpeedExact(5.4f)) }, - { ItemID.PalladiumRepeater, Do(PointBlank, DamageExact(45)) }, + { ItemID.PalladiumRepeater, Do(DamageExact(45)) }, { ItemID.PalladiumSword, Do(UseTurn, DamageExact(150)) }, - { ItemID.PearlwoodBow, Do(AutoReuse, PointBlank, DamageExact(32)) }, + { ItemID.PearlwoodBow, Do(AutoReuse, DamageExact(32)) }, { ItemID.PearlwoodSword, Do(UseTurn, DamageExact(45)) }, { ItemID.PewMaticHorn, Do(DamageExact(25), ShootSpeedExact(15)) }, - { ItemID.Phantasm, Do(PointBlank, DamageExact(48)) }, - { ItemID.PhoenixBlaster, Do(AutoReuse, PointBlank, UseExact(20)) }, - { ItemID.PlatinumBow, Do(PointBlank, DamageExact(12)) }, + { ItemID.Phantasm, Do(DamageExact(48)) }, + { ItemID.PhoenixBlaster, Do(AutoReuse, UseExact(20)) }, + { ItemID.PlatinumBow, Do(DamageExact(12)) }, { ItemID.PlatinumShortsword, Do(AutoReuse, TrueMelee, DamageExact(18)) }, { ItemID.PoisonStaff, Do(DamageExact(57)) }, { ItemID.PossessedHatchet, Do(DamageExact(135)) }, @@ -210,7 +209,6 @@ namespace CalamityMod.Items { ItemID.PurplePhaseblade, phaseblade }, { ItemID.PurplePhasesaber, phasesaber }, { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(63)) }, - { ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, { ItemID.Rally, Do(AutoReuse, DamageExact(18)) }, @@ -219,26 +217,26 @@ namespace CalamityMod.Items { ItemID.Razorpine, Do(DamageExact(40)) }, { ItemID.RedPhaseblade, phaseblade }, { ItemID.RedPhasesaber, phasesaber }, - { ItemID.RedRyder, Do(PointBlank, DamageExact(24)) }, + { ItemID.RedRyder, Do(DamageExact(24)) }, { ItemID.RedsYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.RocketLauncher, Do(DamageExact(60), ShootSpeedExact(9)) }, - { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, + { ItemID.Sandgun, Do(DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, { ItemID.ScourgeoftheCorruptor, Do(DamageExact(63)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(45), ShootSpeedExact(16)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, - { ItemID.ShadowFlameBow, Do(PointBlank, DamageExact(55)) }, + { ItemID.ShadowFlameBow, Do(DamageExact(55)) }, { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, { ItemID.ShadowFlameKnife, Do(DamageExact(50)) }, { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn - { ItemID.Shotgun, Do(PointBlank, DamageExact(36), AutoReuse) }, + { ItemID.Shotgun, Do(DamageExact(36), AutoReuse) }, { ItemID.Shroomerang, Do(ShootSpeedExact(11)) }, { ItemID.SilverBullet, Do(DamageExact(8)) }, { ItemID.SilverShortsword, Do(AutoReuse, TrueMelee, DamageExact(14)) }, { ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) }, { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, { ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff - { ItemID.SniperRifle, Do(PointBlank, DamageExact(200), UseExact(40)) }, + { ItemID.SniperRifle, Do(DamageExact(200), UseExact(40)) }, { ItemID.SolarEruption, Do(DamageExact(122)) }, { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain { ItemID.SpaceGun, Do(DamageExact(23)) }, @@ -253,9 +251,9 @@ namespace CalamityMod.Items { ItemID.Stynger, Do(DamageExact(75)) }, { ItemID.SuperStarCannon, Do(DamageExact(55)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) }, + { ItemID.TacticalShotgun, Do(DamageExact(34)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane - { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, + { ItemID.TendonBow, Do(DamageExact(17), AutoReuse) }, { ItemID.TerraBlade, Do(DamageExact(95)) }, { ItemID.Terragrim, Do(TrueMeleeNoSpeed, DamageExact(13)) }, // Vanilla damage 190. After fixing iframes so yoyo and shots can hit simultaneously, @@ -264,10 +262,10 @@ namespace CalamityMod.Items { ItemID.TheEyeOfCthulhu, Do(AutoReuse, DamageExact(80)) }, { ItemID.TheMeatball, Do(DamageExact(24)) }, { ItemID.TheRottedFork, Do(AutoReuse, TrueMelee, DamageExact(20)) }, - { ItemID.TheUndertaker, Do(PointBlank, AutoReuse, DamageExact(15)) }, + { ItemID.TheUndertaker, Do(AutoReuse, DamageExact(15)) }, { ItemID.ThunderSpear, Do(AutoReuse, UseMeleeSpeed) }, // Storm Spear { ItemID.ThunderStaff, Do(DamageExact(18)) }, //Thunder Zapper - { ItemID.TitaniumRepeater, Do(PointBlank, DamageExact(52)) }, + { ItemID.TitaniumRepeater, Do(DamageExact(52)) }, { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, @@ -277,12 +275,12 @@ namespace CalamityMod.Items { ItemID.Trimarang, Do(DamageExact(24)) }, { ItemID.TrueExcalibur, Do(TrueMelee, DamageExact(112)) }, { ItemID.TrueNightsEdge, Do(DamageExact(105)) }, - { ItemID.Tsunami, Do(PointBlank, DamageExact(45)) }, + { ItemID.Tsunami, Do(DamageExact(45)) }, { ItemID.TungstenBullet, Do(DamageExact(8)) }, { ItemID.TungstenShortsword, Do(AutoReuse, TrueMelee, DamageExact(15)) }, { ItemID.UnholyArrow, Do(DamageExact(11)) }, { ItemID.UnholyTrident, Do(ManaRatio(0.78f), DamageRatio(0.91f)) }, // Uses ratios due to remix seed - { ItemID.Uzi, Do(PointBlank, UseExact(8)) }, + { ItemID.Uzi, Do(UseExact(8)) }, { ItemID.VampireKnives, Do(DamageExact(38)) }, { ItemID.ValkyrieYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.VenomStaff, Do(UseExact(27)) }, @@ -428,41 +426,7 @@ namespace CalamityMod.Items { ItemID.VortexChainsaw, trueMeleeNoSpeed }, #endregion - #region CATEGORY 5: Point Blank support - { ItemID.Blowpipe, pointBlank }, - { ItemID.BorealWoodBow, pointBlank }, - { ItemID.ChlorophyteShotbow, pointBlank }, - { ItemID.CopperBow, pointBlank }, - { ItemID.DartPistol, pointBlank }, - { ItemID.DD2PhoenixBow, pointBlank }, // Phantom Phoenix - { ItemID.EbonwoodBow, pointBlank }, - { ItemID.FairyQueenRangedItem, pointBlank }, //Eventide - { ItemID.FlintlockPistol, pointBlank }, - { ItemID.FlareGun, Do(PointBlank, Value(Item.sellPrice(silver: 10))) }, - { ItemID.GoldBow, pointBlank }, - { ItemID.Harpoon, pointBlank }, - { ItemID.IceBow, pointBlank }, - { ItemID.IronBow, pointBlank }, - { ItemID.LeadBow, pointBlank }, - { ItemID.Megashark, pointBlank }, - { ItemID.OnyxBlaster, pointBlank }, - { ItemID.PalmWoodBow, pointBlank }, - { ItemID.PulseBow, pointBlank }, - { ItemID.Revolver, Do(PointBlank, AutoReuse) }, - { ItemID.RichMahoganyBow, pointBlank }, - { ItemID.SDMG, pointBlank }, - { ItemID.ShadewoodBow, pointBlank }, - { ItemID.SilverBow, pointBlank }, - { ItemID.SnowballCannon, pointBlank }, - { ItemID.StakeLauncher, pointBlank }, - { ItemID.TinBow, pointBlank }, - { ItemID.TungstenBow, pointBlank }, - { ItemID.VenusMagnum, pointBlank }, - { ItemID.VortexBeater, pointBlank }, - { ItemID.WoodenBow, pointBlank }, - #endregion - - #region CATEGORY 6: Summoner Quality of Life + #region CATEGORY 5: Summoner Quality of Life { ItemID.AbigailsFlower, autoReuse }, { ItemID.BabyBirdStaff, Do(AutoReuse, UseExact(35)) }, // Finch Staff { ItemID.BlandWhip, autoReuse }, // Leather Whip @@ -501,7 +465,7 @@ namespace CalamityMod.Items { ItemID.XenoStaff, Do(AutoReuse, UseExact(20)) }, #endregion - #region CATEGORY 7: Other Quality of Life (AutoReuse / UseTurn) + #region CATEGORY 6: Other Quality of Life (AutoReuse / UseTurn) { ItemID.Amarok, autoReuse }, { ItemID.BatBat, autoReuse }, { ItemID.BladeofGrass, Do(AutoReuse, UseTurn) }, @@ -528,6 +492,7 @@ namespace CalamityMod.Items { ItemID.PaperAirplaneA, autoReuse }, { ItemID.PaperAirplaneB, autoReuse }, // White Paper Airplane { ItemID.PlatinumBroadsword, Do(AutoReuse, UseTurn) }, + { ItemID.Revolver, autoReuse }, { ItemID.RichMahoganySword, Do(AutoReuse, UseTurn) }, { ItemID.ShadewoodSword, Do(AutoReuse, UseTurn) }, { ItemID.SilverBroadsword, Do(AutoReuse, UseTurn) }, @@ -547,30 +512,31 @@ namespace CalamityMod.Items { ItemID.ZapinatorOrange, autoReuse }, #endregion - #region CATEGORY 8: Non-consumable Quality of Life + #region CATEGORY 7: Summoning Item Quality of Life { ItemID.Abeemination, nonConsumableBossSummon }, - { ItemID.BloodMoonStarter, nonConsumableBossSummon }, // Bloody Tear + { ItemID.BloodMoonStarter, Do(UseTimeExact(10))}, // Bloody Tear { ItemID.BloodySpine, nonConsumableBossSummon }, { ItemID.CelestialSigil, nonConsumableBossSummon }, { ItemID.DeerThing, nonConsumableBossSummon }, - { ItemID.GoblinBattleStandard, nonConsumableBossSummon }, + { ItemID.GoblinBattleStandard, Do(UseTimeExact(10)) }, { ItemID.MechanicalEye, nonConsumableBossSummon }, { ItemID.MechanicalSkull, nonConsumableBossSummon }, { ItemID.MechanicalWorm, nonConsumableBossSummon }, { ItemID.MechdusaSummon, nonConsumableBossSummon }, // Ocram's Razor - { ItemID.NaughtyPresent, nonConsumableBossSummon }, - { ItemID.PirateMap, nonConsumableBossSummon }, - { ItemID.PumpkinMoonMedallion, nonConsumableBossSummon }, + { ItemID.NaughtyPresent, Do(UseTimeExact(10)) }, + { ItemID.PirateMap, Do(UseTimeExact(10)) }, + { ItemID.PumpkinMoonMedallion, Do(UseTimeExact(10)) }, { ItemID.QueenSlimeCrystal, nonConsumableBossSummon }, // Gelatin Crystal { ItemID.SlimeCrown, nonConsumableBossSummon }, - { ItemID.SnowGlobe, nonConsumableBossSummon }, - { ItemID.SolarTablet, nonConsumableBossSummon }, + { ItemID.SnowGlobe, Do(UseTimeExact(10)) }, + { ItemID.SolarTablet, Do(UseTimeExact(10)) }, { ItemID.SuspiciousLookingEye, nonConsumableBossSummon }, { ItemID.WormFood, nonConsumableBossSummon }, #endregion - #region CATEGORY 9: Sell Prices + #region CATEGORY 8: Sell Prices { ItemID.EncumberingStone, Do(Worthless) }, + { ItemID.FlareGun, Do(Value(Item.sellPrice(silver: 10))) }, { ItemID.GlowingMushroom, Do(Worthless) }, { ItemID.Mushroom, Do(Worthless) }, { ItemID.PortableStool, Do(Value(Item.sellPrice(copper: 20))) }, // Step Stool @@ -998,15 +964,6 @@ namespace CalamityMod.Items internal static IItemTweak PickPower(int p) => new PickPowerRule(p); #endregion - #region Point Blank - internal class PointBlankRule : IItemTweak - { - public bool AppliesTo(Item it) => true; - public void ApplyTweak(Item it) => it.Calamity().canFirePointBlankShots = true; - } - internal static IItemTweak PointBlank => new PointBlankRule(); - #endregion - #region Scale (True Melee) internal class ScaleDeltaRule : IItemTweak { @@ -1395,6 +1352,80 @@ namespace CalamityMod.Items //Calamity Permanent Upgrades shimmerTransmute[ItemID.FrogLeg] = ModContent.ItemType(); + + + // -- Vanilla Boss Shimmer Drop Cycles -- + // These cycles follow the order of: Melee Weapons A to Z -> Ranged Weapons A to Z -> Magic Weapons A to Z -> Summon Weapons A to Z -> Rogue Weapons A to Z (Based off of their in-game names) + // Note that only a select amount of vanilla bosses have an array of equally-likely weapon drops, so the amount of drop pools affected may seem odd at first glance. + + // Queen Bee + shimmerTransmute[ItemID.BeeKeeper] = ItemID.BeesKnees; + shimmerTransmute[ItemID.BeesKnees] = ItemID.BeeGun; + shimmerTransmute[ItemID.BeeGun] = ItemID.BeeKeeper; + + // Deerclops + shimmerTransmute[ItemID.LucyTheAxe] = ItemID.PewMaticHorn; + shimmerTransmute[ItemID.PewMaticHorn] = ItemID.WeatherPain; + shimmerTransmute[ItemID.WeatherPain] = ItemID.HoundiusShootius; + shimmerTransmute[ItemID.HoundiusShootius] = ItemID.LucyTheAxe; + + // Wall of Flesh + shimmerTransmute[ItemID.BreakerBlade] = ItemID.ClockworkAssaultRifle; + shimmerTransmute[ItemID.ClockworkAssaultRifle] = ModContent.ItemType(); + shimmerTransmute[ModContent.ItemType()] = ItemID.LaserRifle; + shimmerTransmute[ItemID.LaserRifle] = ModContent.ItemType(); + shimmerTransmute[ModContent.ItemType()] = ItemID.FireWhip; + shimmerTransmute[ItemID.FireWhip] = ModContent.ItemType(); + shimmerTransmute[ModContent.ItemType()] = ItemID.BreakerBlade; + + // Plantera + shimmerTransmute[ItemID.FlowerPow] = ItemID.Seedler; + shimmerTransmute[ItemID.Seedler] = ItemID.GrenadeLauncher; + shimmerTransmute[ItemID.GrenadeLauncher] = ItemID.VenusMagnum; + shimmerTransmute[ItemID.VenusMagnum] = ItemID.LeafBlower; + shimmerTransmute[ItemID.LeafBlower] = ItemID.NettleBurst; + shimmerTransmute[ItemID.NettleBurst] = ItemID.WaspGun; + shimmerTransmute[ItemID.WaspGun] = ItemID.FlowerPow; + + // Golem + shimmerTransmute[ItemID.EyeoftheGolem] = ItemID.SunStone; + shimmerTransmute[ItemID.SunStone] = ItemID.GolemFist; + shimmerTransmute[ItemID.GolemFist] = ItemID.PossessedHatchet; + shimmerTransmute[ItemID.PossessedHatchet] = ItemID.Stynger; + shimmerTransmute[ItemID.Stynger] = ItemID.HeatRay; + shimmerTransmute[ItemID.HeatRay] = ItemID.StaffofEarth; + shimmerTransmute[ItemID.StaffofEarth] = ItemID.EyeoftheGolem; + + // Duke Fishron + shimmerTransmute[ItemID.FishronWings] = ItemID.Flairon; + shimmerTransmute[ItemID.Flairon] = ItemID.Tsunami; + shimmerTransmute[ItemID.Tsunami] = ItemID.BubbleGun; + shimmerTransmute[ItemID.BubbleGun] = ItemID.RazorbladeTyphoon; + shimmerTransmute[ItemID.RazorbladeTyphoon] = ItemID.TempestStaff; + shimmerTransmute[ItemID.TempestStaff] = ModContent.ItemType(); + shimmerTransmute[ModContent.ItemType()] = ItemID.FishronWings; + + // Empress of Light (Yes these are actually the IDs) + shimmerTransmute[ItemID.RainbowWings] = ItemID.PiercingStarlight; + shimmerTransmute[ItemID.PiercingStarlight] = ItemID.FairyQueenRangedItem; + shimmerTransmute[ItemID.FairyQueenRangedItem] = ItemID.FairyQueenMagicItem; + shimmerTransmute[ItemID.FairyQueenMagicItem] = ItemID.SparkleGuitar; + shimmerTransmute[ItemID.SparkleGuitar] = ItemID.RainbowWhip; + shimmerTransmute[ItemID.RainbowWhip] = ItemID.EmpressBlade; + shimmerTransmute[ItemID.EmpressBlade] = ItemID.RainbowWings; + + // Moon Lord + shimmerTransmute[ItemID.Meowmere] = ItemID.StarWrath; + shimmerTransmute[ItemID.StarWrath] = ItemID.Terrarian; + shimmerTransmute[ItemID.Terrarian] = ItemID.Celeb2; + shimmerTransmute[ItemID.Celeb2] = ItemID.SDMG; + shimmerTransmute[ItemID.SDMG] = ItemID.LastPrism; + shimmerTransmute[ItemID.LastPrism] = ItemID.LunarFlareBook; + shimmerTransmute[ItemID.LunarFlareBook] = ItemID.MoonlordTurretStaff; + shimmerTransmute[ItemID.MoonlordTurretStaff] = ItemID.RainbowCrystalStaff; + shimmerTransmute[ItemID.RainbowCrystalStaff] = ModContent.ItemType(); + shimmerTransmute[ModContent.ItemType()] = ItemID.Meowmere; + } #endregion } diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 3af6d8f825..105dd1799c 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.DraedonMisc mageDisplay.OverrideColor = new Color(201, 41, 255); list.Insert(insertIndex + 3, mageDisplay); - int summonItem = ModContent.ItemType(); + int summonItem = ModContent.ItemType(); TooltipLine summonDisplay = new TooltipLine(this.Mod, "CalamityMod:SummonDisplay", $"[i:{summonItem}] {CalamityUtils.GetItemName(summonItem)}"); summonDisplay.OverrideColor = new Color(149, 243, 43); list.Insert(insertIndex + 4, summonDisplay); diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 6b89b76f91..07e7f4cb50 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { public new string LocalizationCategory => "Items.Fishing"; - public static int RegenBoost = 5; - public static int RegenTimeBoost = 10; + public static int RegenBoost = 4; + public static int RegenTimeBoost = 4; public static int DebuffedRegenBoost = 10; // Does not stack with above public static int DebuffedRegenTimeFloor = 900; diff --git a/Items/Materials/CosmiliteBar.cs b/Items/Materials/CosmiliteBar.cs index 65a85a7e88..b76d623ee8 100644 --- a/Items/Materials/CosmiliteBar.cs +++ b/Items/Materials/CosmiliteBar.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 3); + Item.value = Item.sellPrice(gold: 2); Item.rare = ModContent.RarityType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs index d1b80fa264..55da90cc1e 100644 --- a/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/CosmicAnvilItem.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 60); + Item.value = Item.sellPrice(gold: 50); Item.rare = ModContent.RarityType(); } diff --git a/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs index c74e0940e0..6637a54478 100644 --- a/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs +++ b/Items/Placeables/Furniture/Monoliths/BlueDistortedMonolith.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Monoliths public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 45); + Item.value = Item.sellPrice(gold: 30); Item.rare = ModContent.RarityType(); Item.accessory = true; Item.vanity = true; diff --git a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs index e074b01fce..204e9ce38c 100644 --- a/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs +++ b/Items/Placeables/Furniture/Monoliths/PurpleDistortedMonolith.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Monoliths public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 45); + Item.value = Item.sellPrice(gold: 30); Item.rare = ModContent.RarityType(); Item.accessory = true; Item.vanity = true; diff --git a/Items/Placeables/FurnitureBasalt/BasaltSlab.cs b/Items/Placeables/FurnitureBasalt/BasaltSlab.cs new file mode 100644 index 0000000000..c8f4ee7ad8 --- /dev/null +++ b/Items/Placeables/FurnitureBasalt/BasaltSlab.cs @@ -0,0 +1,31 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureBasalt +{ + public class BasaltSlab : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(1). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); + } + + } +} diff --git a/Items/Placeables/FurnitureBasalt/BasaltSlab.png b/Items/Placeables/FurnitureBasalt/BasaltSlab.png new file mode 100644 index 0000000000..a40c5e3054 Binary files /dev/null and b/Items/Placeables/FurnitureBasalt/BasaltSlab.png differ diff --git a/Items/Placeables/Ores/AuricOre.cs b/Items/Placeables/Ores/AuricOre.cs index 2fcf606930..0d313efc82 100644 --- a/Items/Placeables/Ores/AuricOre.cs +++ b/Items/Placeables/Ores/AuricOre.cs @@ -18,13 +18,13 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(silver: 50); + Item.value = Item.sellPrice(silver: 60); Item.rare = ModContent.RarityType(); } public override void AddRecipes() { - CreateRecipe(30). + CreateRecipe(10). AddIngredient(). AddCondition(Condition.NearShimmer). Register(); diff --git a/Items/Placeables/SunkenSea/TableCoralLeft.cs b/Items/Placeables/SunkenSea/TableCoralLeft.cs new file mode 100644 index 0000000000..835a1e43df --- /dev/null +++ b/Items/Placeables/SunkenSea/TableCoralLeft.cs @@ -0,0 +1,15 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea +{ + public class TableCoralLeft : ModItem, ILocalizedModType + { + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + } +} diff --git a/Items/Placeables/SunkenSea/TableCoralLeft.png b/Items/Placeables/SunkenSea/TableCoralLeft.png new file mode 100644 index 0000000000..db7fa149c0 Binary files /dev/null and b/Items/Placeables/SunkenSea/TableCoralLeft.png differ diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs index 75deb7d52b..0663d7c312 100644 --- a/Items/SummonItems/Invasion/CausticTear.cs +++ b/Items/SummonItems/Invasion/CausticTear.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { + Item.ResearchUnlockCount = 3; ItemID.Sets.SortingPriorityBossSpawns[Type] = 4; // Goblin Battle Standard } @@ -18,12 +19,11 @@ namespace CalamityMod.Items.SummonItems.Invasion { Item.width = 16; Item.height = 28; - Item.maxStack = 1; - Item.rare = ItemRarityID.Green; - Item.useAnimation = 10; - Item.useTime = 10; + Item.consumable = true; + Item.maxStack = Item.CommonMaxStack; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.HoldUp; - Item.consumable = false; + Item.rare = ItemRarityID.Green; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -51,7 +51,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(). AddCondition(Condition.NearWater). Register(); } diff --git a/Items/SummonItems/Invasion/MartianDistressRemote.cs b/Items/SummonItems/Invasion/MartianDistressRemote.cs index 34160a893b..73140ce6ff 100644 --- a/Items/SummonItems/Invasion/MartianDistressRemote.cs +++ b/Items/SummonItems/Invasion/MartianDistressRemote.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.SummonItems.Invasion public int frame = 0; public override void SetStaticDefaults() { + Item.ResearchUnlockCount = 3; ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Solar Tablet (1 above Lihzahrd Power Cell) } @@ -22,14 +23,13 @@ namespace CalamityMod.Items.SummonItems.Invasion { Item.width = 26; Item.height = 52; - Item.maxStack = 1; + Item.consumable = true; + Item.maxStack = Item.CommonMaxStack; + Item.useAnimation = Item.useTime = 10; + Item.UseSound = SoundID.Zombie67; + Item.useStyle = ItemUseStyleID.HoldUp; Item.value = Item.buyPrice(gold: 50); // Sold by Cyborg Item.rare = ItemRarityID.Yellow; - Item.useAnimation = 10; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.HoldUp; - Item.consumable = false; - Item.UseSound = SoundID.Zombie67; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) diff --git a/Items/Tools/ClimateChange/Bakidon.cs b/Items/Tools/ClimateChange/Bakidon.cs new file mode 100644 index 0000000000..5372e4491e --- /dev/null +++ b/Items/Tools/ClimateChange/Bakidon.cs @@ -0,0 +1,87 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Net; + +namespace CalamityMod.Items.Tools.ClimateChange +{ + [LegacyName("Moonlight")] + public class Bakidon : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Tools"; + + public static int FreezeTime => CalamityUtils.MinutesToFrames(10); + public static float RechargeMultiplier => 1; + + public override void SetDefaults() + { + Item.width = 20; + Item.height = 20; + Item.rare = ItemRarityID.LightRed; + Item.useAnimation = 9; + Item.useTime = 9; + Item.autoReuse = false; // Explicitly not autofire, since it can be used quickly now + Item.useStyle = ItemUseStyleID.HoldUp; + Item.UseSound = SoundID.Item60; + Item.consumable = false; + } + + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; + } + + public override bool? UseItem(Player player) + { + player.Calamity().WeakTimeFreezeInUse = !player.Calamity().WeakTimeFreezeInUse; + if (Main.netMode != NetmodeID.Server && player == Main.LocalPlayer) + { + var power = CreativePowerManager.Instance.GetPower(); + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(player.Calamity().WeakTimeFreezeInUse); + NetManager.Instance.SendToServerOrLoopback(packet); + } + return true; + } + + public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + var cplayer = Main.LocalPlayer.Calamity(); + float fill = 1 - cplayer.WeakTimeFreezeUseTimer / (float)(FreezeTime / RechargeMultiplier); + if (fill >= 1) + return; + + float barScale = 1.1f; + + var barBG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; + var barFG = ModContent.Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; + + Vector2 barOrigin = barBG.Size() * 0.5f; + float yOffset = 7.5f; + Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); + Rectangle frameCrop = new Rectangle(0, 0, (int)((fill) * barFG.Width), barFG.Height); + Color colorBG = Color.DarkViolet * 0.5f; + Color colorFG = Color.Lerp(Color.Orange, Color.Green, fill); + + spriteBatch.Draw(barBG, drawPos, null, colorBG, 0f, barOrigin, scale * barScale, 0f, 0f); + spriteBatch.Draw(barFG, drawPos, frameCrop, colorFG, 0f, barOrigin, scale * barScale, 0f, 0f); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.FallenStar, 10). + AddIngredient(ItemID.SoulofLight, 7). + AddIngredient(ItemID.SoulofNight, 7). + AddIngredient(5). + AddTile(TileID.DemonAltar). + Register(); + } + } +} diff --git a/Items/Tools/ClimateChange/Bakidon.png b/Items/Tools/ClimateChange/Bakidon.png new file mode 100644 index 0000000000..e48b63f744 Binary files /dev/null and b/Items/Tools/ClimateChange/Bakidon.png differ diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index b380c4f384..4f65a2ecb2 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -1,18 +1,20 @@ -using CalamityMod.CalPlayer; +using System.Linq; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using CalamityMod.World; using Terraria; +using Terraria.GameContent.Creative; +using Terraria.GameContent.NetModules; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Net; namespace CalamityMod.Items.Tools.ClimateChange { public class Cosmolight : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Tools"; - // Hardcoded times set by the vanilla Journey Mode buttons. - // These are "halfway through day" and "halfway through night" respectively. - private const int NoonCutoff = 27000; - private const int MidnightCutoff = 16200; public override void SetDefaults() { @@ -21,10 +23,11 @@ namespace CalamityMod.Items.Tools.ClimateChange Item.rare = ItemRarityID.LightRed; Item.useAnimation = 9; Item.useTime = 9; - Item.autoReuse = false; // Explicitly not autofire, since it can be used quickly now + Item.autoReuse = false; Item.useStyle = ItemUseStyleID.HoldUp; Item.UseSound = SoundID.Item60; Item.consumable = false; + Item.channel = true; } public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) @@ -32,42 +35,51 @@ namespace CalamityMod.Items.Tools.ClimateChange itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther; } - public override bool CanUseItem(Player player) => !CalamityPlayer.areThereAnyDamnBosses; + public override bool AltFunctionUse(Player player) + { + return true; + } public override bool? UseItem(Player player) { - //Only SinglePlayer or DedServ should change time to prevent unwanted race condition - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - // Early Morning -> Noon - if (Main.dayTime && Main.time < NoonCutoff) - Main.SkipToTime(NoonCutoff, true); - - // Afternoon -> Dusk - else if (Main.dayTime) - Main.SkipToTime(0, false); - - // Early Night -> Midnight - else if (!Main.dayTime && Main.time < MidnightCutoff) - Main.SkipToTime(MidnightCutoff, false); - - // Late Night -> Dawn - else if (!Main.dayTime) - Main.SkipToTime(0, true); - + if (Main.netMode != NetmodeID.Server && player == Main.LocalPlayer && (player.altFunctionUse == 2 || (CreativePowerManager.Instance.GetPower().Enabled))) + { + var power = CreativePowerManager.Instance.GetPower(); + NetPacket packet = NetCreativePowersModule.PreparePacket(power.PowerId, 1); + packet.Writer.Write(!power.Enabled); + NetManager.Instance.SendToServerOrLoopback(packet); + } return true; } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.FallenStar, 10). - AddIngredient(ItemID.SoulofLight, 7). - AddIngredient(ItemID.SoulofNight, 7). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(). + AddIngredient(ItemID.Sundial). + AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 15). + AddTile(TileID.DemonAltar). + Register(); + + CreateRecipe(). + AddIngredient(). + AddIngredient(ItemID.Moondial). + AddIngredient(3). + AddIngredient(ItemID.FragmentSolar, 15). + AddTile(TileID.DemonAltar). Register(); } } + + public class CosmolightTimeRateChange : ModSystem + { + public override void ModifyTimeRate(ref double timeRate, ref double tileUpdateRate, ref double eventUpdateRate) + { + if (Main.player.Any(x => x.active && x.channel && x.altFunctionUse != 2 && x.HeldItem.type == ModContent.ItemType())) + { + timeRate *= 120; + } + } + } } diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 29a16a9229..492019a90b 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -72,8 +72,8 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); + itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.Add(ModContent.ItemType()); - itemLoot.Add(ModContent.ItemType(), 10); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index 3a2e4aefee..b4cd2b50d9 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -84,7 +84,6 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType() })); itemLoot.Add(ModContent.ItemType(), 10); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(ModContent.ItemType()); diff --git a/Items/TreasureBags/DragonfollyBag.cs b/Items/TreasureBags/DragonfollyBag.cs index ac6f05ebad..8a516b2381 100644 --- a/Items/TreasureBags/DragonfollyBag.cs +++ b/Items/TreasureBags/DragonfollyBag.cs @@ -69,7 +69,6 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType() })); - itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); diff --git a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs b/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs deleted file mode 100644 index f284793d44..0000000000 --- a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Terraria.ID; - -namespace CalamityMod.Items.VanillaArmorChanges -{ - public class ChlorophyteArmorSetChange : VanillaArmorChange - { - public override int? HeadPieceID => ItemID.ChlorophyteHeadgear; - - public override int? BodyPieceID => ItemID.ChlorophytePlateMail; - - public override int? LegPieceID => ItemID.ChlorophyteGreaves; - - public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.ChlorophyteMask, ItemID.ChlorophyteHelmet }; - - public override string ArmorSetName => "Chlorophyte"; - - public const int AmountToHealPerPulse = 5; - - public const int PulseReleaseRate = 300; - - public const int DelayBetweenHeals = 270; - - public const int BaseDamageToEnemies = 220; - - public override void UpdateSetBonusText(ref string setBonusText) - { - setBonusText = $"{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(PulseReleaseRate / 60f, BaseDamageToEnemies, AmountToHealPerPulse, DelayBetweenHeals / 60f)}"; - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs similarity index 69% rename from Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs rename to Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs index 15fda0cf58..8ab0339f1c 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.cs @@ -6,23 +6,29 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class StarSwallowerContainmentUnit : ModItem, ILocalizedModType + public class AqueousHunterDrone : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/ShrimpFire"); + public static readonly SoundStyle Hit = new("CalamityMod/Sounds/Item/ShrimpMissileHit"); + public static readonly SoundStyle Sound1 = new("CalamityMod/Sounds/Item/ShrimpSound1"); + public static readonly SoundStyle Sound2 = new("CalamityMod/Sounds/Item/ShrimpSound2"); + public static readonly SoundStyle Surprise = new("CalamityMod/Sounds/Item/ShrimpSurprise"); public override void SetDefaults() { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 18; - Item.height = 28; + Item.width = 34; + Item.height = 32; Item.shootSpeed = 10f; - Item.damage = 24; + Item.damage = 30; Item.mana = 10; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.HoldUp; @@ -30,33 +36,25 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.knockBack = 2.25f; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.UseSound = SoundID.Item15; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; - - modItem.UsesCharge = true; - modItem.MaxCharge = 50f; - modItem.ChargePerUse = 0.8f; - modItem.ChargePerAltUse = 0f; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 mouse = player.ClampedMouseWorld(); Point mouseTileCoords = mouse.ToTileCoordinates(); if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).HasTile) { - int p = Projectile.NewProjectile(source, mouse, Vector2.Zero, type, damage, knockback, player.whoAmI); + int p = Projectile.NewProjectile(source, new Vector2(mouse.X, player.Center.Y - 600), Vector2.Zero, type, damage, knockback, player.whoAmI); + Main.projectile[p].localAI[2] = player.ownedProjectileCounts[Item.shoot]; if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = Item.damage; } return false; } - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.png b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.png new file mode 100644 index 0000000000..4c5c16cd38 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/AqueousHunterDrone.png differ diff --git a/Items/Weapons/DraedonsArsenal/AqueousHunterDroneGlow.png b/Items/Weapons/DraedonsArsenal/AqueousHunterDroneGlow.png new file mode 100644 index 0000000000..b069a6dde7 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/AqueousHunterDroneGlow.png differ diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index ad10265c3a..be38aa1993 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -95,5 +96,14 @@ namespace CalamityMod.Items.Weapons.Melee Main.dust[swingDust].noGravity = true; } } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddIngredient(15). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index f1b8d996c2..e00105a1a8 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -26,12 +26,11 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 90; Item.height = 90; Item.damage = 1005; - Item.DamageType = DamageClass.Melee; + Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 30; Item.knockBack = 8f; - Item.UseSound = SoundID.Item1; Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index 2f0ddc6042..a2cd8b7c50 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 6.6f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 28af864475..a7a96fec75 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index 3f2a2b21ce..6fbb3fa2e2 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index f04613eac6..8c11300b71 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 6.5f; Item.useAmmo = AmmoID.Bullet; Item.crit = 8; - Item.Calamity().canFirePointBlankShots = true; } public override void UpdateInventory(Player player) diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 0594fbdafc..8ed530291d 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-30, 0); diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index c388ec1d2e..e2a590fafb 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 3ee4b56f48..bacb49e7ed 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -33,12 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { SoundEngine.PlaySound(SoundID.Item5, player.Center); @@ -70,5 +66,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } + + public override void AddRecipes() + { + CreateRecipe(). + AddRecipeGroup("AnyMythrilBar", 10). + AddIngredient(ItemID.Cog, 15). + AddIngredient(ItemID.SoulofSight, 10). + AddTile(TileID.MythrilAnvil). + Register(); + } } } diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs index 737ffe8a93..489bc4baea 100644 --- a/Items/Weapons/Ranged/ArcNovaDiffuser.cs +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index 52ae3be18f..041243c5bd 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, -5); diff --git a/Items/Weapons/Ranged/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index 8a163ed1b4..e711d0b85b 100644 --- a/Items/Weapons/Ranged/Arietes41.cs +++ b/Items/Weapons/Ranged/Arietes41.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 13f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index 621e409326..e6c0803a7a 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 0c957b8304..08eb0c16d4 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 4f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index f20f25503a..23985319f3 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override void ModifyWeaponDamage(Player player, ref StatModifier damage) diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index ed8ba5560f..acd1cd5aa3 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(0, 4); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index f3b401d895..a3b381d0b9 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index 8aa526363c..65eb24364c 100644 --- a/Items/Weapons/Ranged/BladedgeRailbow.cs +++ b/Items/Weapons/Ranged/BladedgeRailbow.cs @@ -110,7 +110,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 14f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 81a591dcb8..fb099727e2 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.Calamity().canFirePointBlankShots = true; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Ranged/BrimstoneFury.cs b/Items/Weapons/Ranged/BrimstoneFury.cs index 634cb0cef9..c4d586c689 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index eda730ce49..428aac80cd 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-7, 0); diff --git a/Items/Weapons/Ranged/Buzzkill.cs b/Items/Weapons/Ranged/Buzzkill.cs index f228e86dc2..cfeef85b6b 100644 --- a/Items/Weapons/Ranged/Buzzkill.cs +++ b/Items/Weapons/Ranged/Buzzkill.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index b51d12896b..83d1c7daac 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index c80a369ecc..4588b6b709 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-50f, 0f); diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index c878c4894e..1f941bd2dc 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/ContinentalGreatbow.cs b/Items/Weapons/Ranged/ContinentalGreatbow.cs index 6e63b9f837..e82feae262 100644 --- a/Items/Weapons/Ranged/ContinentalGreatbow.cs +++ b/Items/Weapons/Ranged/ContinentalGreatbow.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 18; Item.height = 36; - Item.damage = 34; + Item.damage = 38; Item.DamageType = DamageClass.Ranged; Item.useTime = 24; Item.useAnimation = 24; @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 17f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/CorinthPrime.cs b/Items/Weapons/Ranged/CorinthPrime.cs index 77b516c7f8..abc000862a 100644 --- a/Items/Weapons/Ranged/CorinthPrime.cs +++ b/Items/Weapons/Ranged/CorinthPrime.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 5); diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 8a79b82295..2c4d7fcd6e 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/CrackshotColt.cs b/Items/Weapons/Ranged/CrackshotColt.cs index 62b68420ed..6d80394bf6 100644 --- a/Items/Weapons/Ranged/CrackshotColt.cs +++ b/Items/Weapons/Ranged/CrackshotColt.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; Item.shootSpeed = 14f; - Item.Calamity().canFirePointBlankShots = true; } // This item has a right click. diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index f42eb94dd5..ab347b043c 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/DarkechoGreatbow.cs b/Items/Weapons/Ranged/DarkechoGreatbow.cs index 960f51a999..7516999dd8 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 92fe3d370c..99603e8425 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Weapons/Ranged/DeepcoreGK2.cs b/Items/Weapons/Ranged/DeepcoreGK2.cs index cd98650a7f..d5266a1a8c 100644 --- a/Items/Weapons/Ranged/DeepcoreGK2.cs +++ b/Items/Weapons/Ranged/DeepcoreGK2.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Bullet; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 0); diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index 2ed7345aee..ca84ae4483 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 6.6f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index 988223ece0..6fa526b7e7 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 11f; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index ecbb2126b4..420161a8c4 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 22f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index a1f6d32d26..b5320a069d 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/FlurrystormCannon.cs b/Items/Weapons/Ranged/FlurrystormCannon.cs index fb1b12d224..18fe6f9193 100644 --- a/Items/Weapons/Ranged/FlurrystormCannon.cs +++ b/Items/Weapons/Ranged/FlurrystormCannon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Snowball; Item.shootSpeed = 18f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/FrostbiteBlaster.cs b/Items/Weapons/Ranged/FrostbiteBlaster.cs index 38f5f1dca7..9712968aa5 100644 --- a/Items/Weapons/Ranged/FrostbiteBlaster.cs +++ b/Items/Weapons/Ranged/FrostbiteBlaster.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ProjectileID.Blizzard; Item.shootSpeed = 9f; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-14, 0); diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 656cdd1b20..9515420395 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 14f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index 0f943388fb..e6d5027ac3 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index 0188b657ce..c0611fc259 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index b2d20525cf..dd909d62fe 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 9f68640f98..b63a4cacdc 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index 7dc5bc4243..61983896f5 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-15, 0); diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 57c046422b..428804c436 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useTurn = true; Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.Calamity().canFirePointBlankShots = true; } // Shoot via the projectile only diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index dfb6c5bb78..759c3af8c5 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 11.5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 8bad1545c0..03947cc5eb 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index a7538b9261..cf5737a4f1 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 6f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 90464eefc7..50f41fa042 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 13f; Item.useStyle = ItemUseStyleID.Shoot; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index ea46bd671f..c4cbe5856e 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 8f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/M1Garand.cs b/Items/Weapons/Ranged/M1Garand.cs new file mode 100644 index 0000000000..ff034f96b2 --- /dev/null +++ b/Items/Weapons/Ranged/M1Garand.cs @@ -0,0 +1,62 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.DataStructures; +using static Terraria.ModLoader.ModContent; +using CalamityMod.Cooldowns; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class M1Garand : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetDefaults() + { + Item.width = 102; + Item.height = 22; + Item.damage = 75; + Item.DamageType = DamageClass.Ranged; + + Item.useTime = 40; + Item.useAnimation = 40; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 2f; + Item.autoReuse = false; // Because holdout + Item.channel = true; // Because holdout + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 12f; + Item.useAmmo = AmmoID.Bullet; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; + } + + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) + { + if (player.Calamity().cooldowns.TryGetValue(M1GarandShots.ID, out var cooldown)) + { + cooldown.timeLeft = 8 - player.Calamity().garandShots; + } + else + { + player.AddCooldown(M1GarandShots.ID, 8); + } + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ProjectileType(), damage, knockback, player.whoAmI); + + // Seting its velocity like this is what aims to the mouse + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + + return false; + } + } +} diff --git a/Items/Weapons/Ranged/M1Garand.png b/Items/Weapons/Ranged/M1Garand.png new file mode 100644 index 0000000000..a0b47c6f6d Binary files /dev/null and b/Items/Weapons/Ranged/M1Garand.png differ diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 891cb67dd6..0ec26d25e0 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index dc76d797a7..e37f4b5964 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 0508a50472..04583dd290 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 28ff3ad12f..deaea9191e 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/MidasPrime.cs b/Items/Weapons/Ranged/MidasPrime.cs index 80ec7fb0ed..ee3a74f18d 100644 --- a/Items/Weapons/Ranged/MidasPrime.cs +++ b/Items/Weapons/Ranged/MidasPrime.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; Item.shootSpeed = 14f; - Item.Calamity().canFirePointBlankShots = true; } // This item has a right click. diff --git a/Items/Weapons/Ranged/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index 5d35184a01..be48baab00 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 9f; Item.useAmmo = AmmoID.Arrow; Item.consumeAmmoOnFirstShotOnly = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 55375b864d..2404be7c1b 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.WoodenArrowFriendly; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/NettlevineGreatbow.cs b/Items/Weapons/Ranged/NettlevineGreatbow.cs index 683f4a03bd..486f5f7cf7 100644 --- a/Items/Weapons/Ranged/NettlevineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlevineGreatbow.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index 6985f2b139..e4515a024e 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.rare = ItemRarityID.LightRed; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 8); diff --git a/Items/Weapons/Ranged/Norfleet.cs b/Items/Weapons/Ranged/Norfleet.cs index 19d8c9fa64..5e1b8da3e9 100644 --- a/Items/Weapons/Ranged/Norfleet.cs +++ b/Items/Weapons/Ranged/Norfleet.cs @@ -1,9 +1,9 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -13,7 +13,6 @@ namespace CalamityMod.Items.Weapons.Ranged public class Norfleet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public int loadedShots = 3; public override void SetStaticDefaults() { @@ -47,28 +46,22 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Funny punishment for trying to cheeese with Norfleet - bool cheater = player.Calamity().NorfleetCounter >= 3 && player.Calamity().NorfleetCounter < 1000; - if (player.Calamity().NorfleetCounter >= 1000) - loadedShots = 1; - - if (cheater) - { - SoundStyle fire = new("CalamityMod/Sounds/Item/NuhUhUh"); - SoundEngine.PlaySound(fire, player.Center); - } - - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, (cheater ? 1000 : 0), loadedShots); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); - - player.Calamity().NorfleetCounter++; - loadedShots--; - if (loadedShots <= 0) - loadedShots = 3; return false; } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(8). + AddIngredient(20). + AddTile(). + Register(); + } } } diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index e0ec40a167..d1a3d83b57 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.BlackBolt; Item.shootSpeed = 24f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() @@ -38,8 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { // Fire the Onyx Shard that is characteristic of the Onyx Blaster - // The shard deals 250% damage and double knockback - int shardDamage = (int)(2.5f * damage); + // The shard deals 200% damage and double knockback + int shardDamage = 2 * damage; float shardKB = 2f * knockback; Vector2 offset = new Vector2(Main.rand.Next(-25, 26) * 0.05f, Main.rand.Next(-25, 26) * 0.05f); Projectile shard = Projectile.NewProjectileDirect(source, position, velocity + offset, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI); diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index b15d0c87e4..f3beca5561 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.BlackBolt; Item.shootSpeed = 28f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index e923ec174b..74b412be00 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/P90.cs b/Items/Weapons/Ranged/P90.cs index eac50a1416..5d24b598cf 100644 --- a/Items/Weapons/Ranged/P90.cs +++ b/Items/Weapons/Ranged/P90.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 9f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-14, -1); diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 60f8d757f1..6e3a075207 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 14f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index 395795456d..93e90c6d72 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index c5c81448e0..92c9b28190 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-20, 5); diff --git a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs index baefda8bf8..7a1cc73742 100644 --- a/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PridefulHuntersPlanarRipper.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-12, -6); diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 36aeaafe38..b5625dec07 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.channel = true; Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 11f; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-30f, 0f); diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index 16b499d389..6846184c84 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 30f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Riftburst.cs b/Items/Weapons/Ranged/Riftburst.cs index 3e070ef0f0..ba72722721 100644 --- a/Items/Weapons/Ranged/Riftburst.cs +++ b/Items/Weapons/Ranged/Riftburst.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 2042afd288..ed48b70019 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index da6627d9ee..0d7273664d 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; Item.rare = ModContent.RarityType(); - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index 4a309f2dd4..34396470c2 100644 --- a/Items/Weapons/Ranged/Sandblaster.cs +++ b/Items/Weapons/Ranged/Sandblaster.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Sand; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 39ca453361..60d2fadde4 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index 45d07acc99..e39b9b4e76 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 2.5f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index a31575ec1d..3eef641cf6 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 5f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 4d103f929b..2b619ab787 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SlagMagnum.cs b/Items/Weapons/Ranged/SlagMagnum.cs index e3a71d7dfb..6c3656b312 100644 --- a/Items/Weapons/Ranged/SlagMagnum.cs +++ b/Items/Weapons/Ranged/SlagMagnum.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index fb63f652a9..228cff54b3 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index 91eb648f97..7992b482e5 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shootSpeed = 20f; Item.shoot = ModContent.ProjectileType(); - Item.Calamity().canFirePointBlankShots = true; } public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index 37e84fff5d..027e1acbab 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -73,7 +73,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = ShootSpeed; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index d8f1d3de75..8815647088 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 6f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); @@ -62,12 +61,12 @@ namespace CalamityMod.Items.Weapons.Ranged SineCounter++; if (SineCounter % 4 == 0) { - Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); - Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); - Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); - int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); - int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); + Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); + Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); + Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); + Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); + Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); } else if (player.altFunctionUse != 2) { diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index bdf5de94a8..56277e2258 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -45,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 18f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-14f, 0f); public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.NextFloat() < 0.25f; diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 4cea38a174..17cf943732 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index 5a2e736fee..d84ae38408 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 20f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; Item.Calamity().donorItem = true; } diff --git a/Items/Weapons/Ranged/ThermoclineBlaster.cs b/Items/Weapons/Ranged/ThermoclineBlaster.cs index cb2a56540f..f71a133430 100644 --- a/Items/Weapons/Ranged/ThermoclineBlaster.cs +++ b/Items/Weapons/Ranged/ThermoclineBlaster.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 12f; Item.shoot = ProjectileID.PurificationPowder; Item.useAmmo = AmmoID.Bullet; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index c35b54cd02..66c1fe65b0 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 15f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 3625172b9f..86672a1208 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index f926e11106..7f00ee3db8 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Ranged/UniversalGenesis.cs b/Items/Weapons/Ranged/UniversalGenesis.cs index 0a9ff8e0a9..86d1b1acd3 100644 --- a/Items/Weapons/Ranged/UniversalGenesis.cs +++ b/Items/Weapons/Ranged/UniversalGenesis.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 20f; Item.autoReuse = true; - Item.Calamity().canFirePointBlankShots = true; Item.noMelee = true; Item.UseSound = SoundID.Item38; @@ -35,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-50f, -8f); diff --git a/Items/Weapons/Ranged/VernalBolter.cs b/Items/Weapons/Ranged/VernalBolter.cs index 2f22ba25bf..f105614251 100644 --- a/Items/Weapons/Ranged/VernalBolter.cs +++ b/Items/Weapons/Ranged/VernalBolter.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Arrow; - Item.Calamity().canFirePointBlankShots = true; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Weapons/Ranged/Voidragon.cs b/Items/Weapons/Ranged/Voidragon.cs index 2cd4c67f92..b02785a578 100644 --- a/Items/Weapons/Ranged/Voidragon.cs +++ b/Items/Weapons/Ranged/Voidragon.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - Item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs index caa91297a0..1ba16b3a15 100644 --- a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs +++ b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs @@ -53,7 +53,6 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = false; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; - Item.Calamity().canFirePointBlankShots = true; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index f29d97c52a..45fe58a160 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 56; Item.knockBack = 3f; Item.useAnimation = Item.useTime = 20; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; @@ -48,21 +49,16 @@ namespace CalamityMod.Items.Weapons.Summon slimeSlots = (int)(player.maxMinions - minionCount); } - public override bool CanUseItem(Player player) - { - return slimeSlots >= 1; - } + public override bool CanUseItem(Player player) => slimeSlots >= 1; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); float damageMult = ((float)Math.Log(slimeSlots, 8f)) + 1f; - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int slime = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * damageMult), knockback, player.whoAmI); - Main.projectile[slime].originalDamage = (int)(Item.damage * damageMult); - Main.projectile[slime].minionSlots = slimeSlots; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, (int)(damage * damageMult), knockback, player.whoAmI); + minion.originalDamage = (int)(Item.damage * damageMult); + minion.minionSlots = slimeSlots; return false; } } diff --git a/Items/Weapons/Summon/AncientIceChunk.cs b/Items/Weapons/Summon/AncientIceChunk.cs index 00bfcf39ee..3e00d8eb98 100644 --- a/Items/Weapons/Summon/AncientIceChunk.cs +++ b/Items/Weapons/Summon/AncientIceChunk.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -35,6 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 25; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -50,7 +52,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(1f, 1f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs index 18143c9703..542ee216fd 100644 --- a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs +++ b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -32,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 35; @@ -45,9 +47,9 @@ namespace CalamityMod.Items.Weapons.Summon } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int belladonna = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(belladonna)) - Main.projectile[belladonna].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/BlackHawkRemote.cs b/Items/Weapons/Summon/BlackHawkRemote.cs index 330d2f3e95..aff29efd63 100644 --- a/Items/Weapons/Summon/BlackHawkRemote.cs +++ b/Items/Weapons/Summon/BlackHawkRemote.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; // Affects bullet speed Item.DamageType = DamageClass.Summon; @@ -31,15 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - if (player.whoAmI == Main.myPlayer) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 4e39fe3f72..b6c15f5dd2 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; @@ -30,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item44 with { Pitch = 0.5f }; Item.autoReuse = true; - Item.shootSpeed = 5; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -45,12 +46,9 @@ namespace CalamityMod.Items.Weapons.Summon if (player.altFunctionUse != 2) { Item.noUseGraphic = false; - position = player.ClampedMouseWorld(); - velocity = Vector2.Zero; int SummonNumber = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 0, SummonNumber); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, SummonNumber); + minion.originalDamage = Item.damage; } if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index 8123714305..8aefe8f92c 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -45,6 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 1f; // This does nothing, it's just here so it's able to act like a staff. @@ -59,7 +61,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CausticStaff.cs b/Items/Weapons/Summon/CausticStaff.cs index 88a22bfafb..87a955b692 100644 --- a/Items/Weapons/Summon/CausticStaff.cs +++ b/Items/Weapons/Summon/CausticStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 15; Item.useStyle = ItemUseStyleID.Swing; - Item.shootSpeed = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.UseSound = SoundID.Item77; Item.useAnimation = Item.useTime = 25; @@ -34,12 +35,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CinderBlossomStaff.cs b/Items/Weapons/Summon/CinderBlossomStaff.cs index f048621794..335309e1eb 100644 --- a/Items/Weapons/Summon/CinderBlossomStaff.cs +++ b/Items/Weapons/Summon/CinderBlossomStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 16; Item.knockBack = 2f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 30; @@ -32,10 +34,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index de17dde940..edd2f9d35f 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -29,22 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index d7254633f4..0926ff4cc5 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.UseSound = SoundID.DD2_BetsyFlyingCircleAttack; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 13f; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); @@ -36,12 +37,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 3209dce26f..2a311d9066 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -1,4 +1,5 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.useAnimation = Item.useTime = 10; Item.knockBack = 0.25f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.UseSound = SoundID.Item60; Item.useStyle = ItemUseStyleID.Swing; @@ -42,10 +43,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/CosmicViperEngine.cs b/Items/Weapons/Summon/CosmicViperEngine.cs index b6a4bf8f37..21fc2f864d 100644 --- a/Items/Weapons/Summon/CosmicViperEngine.cs +++ b/Items/Weapons/Summon/CosmicViperEngine.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; @@ -27,6 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 6f; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; // Affects bullet speed Item.DamageType = DamageClass.Summon; @@ -37,20 +39,18 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - float speed = Item.shootSpeed; - Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); - float xPos = Main.screenPosition.X + Main.mouseX - spawnPos.X; - float yPos = Main.screenPosition.Y + (player.gravDir == -1 ? Main.screenHeight - Main.mouseY : Main.mouseY) - spawnPos.Y; - Vector2 vel = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitX * player.direction) * speed; + player.AddBuff(Item.buffType, 2); - spawnPos = player.ClampedMouseWorld(); - vel = vel.RotatedBy(MathHelper.PiOver2); - int p = Projectile.NewProjectile(source, spawnPos + vel, vel, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + float speed = Item.shootSpeed; + Vector2 spawnPos = player.RotatedRelativePoint(player.MountedCenter, true); + float xPos = Main.screenPosition.X + Main.mouseX - spawnPos.X; + float yPos = Main.screenPosition.Y + (player.gravDir == -1 ? Main.screenHeight - Main.mouseY : Main.mouseY) - spawnPos.Y; + Vector2 vel = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitX * player.direction) * speed; + + spawnPos = player.ClampedMouseWorld(); + vel = vel.RotatedBy(MathHelper.PiOver2); + var minion = Projectile.NewProjectileDirect(source, spawnPos + vel, vel, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index b4c43ed83f..3a6cd6413e 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -40,8 +41,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -49,26 +50,22 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - // Reset the timer for all lamps, to re-align the formation. - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().Timer = 0f; - pro.netUpdate = true; - } - } + player.AddBuff(Item.buffType, 2); - int existingLamps = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) + // Reset the timer for all lamps, to re-align the formation. + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ai[0] = existingLamps; + pro.ModProjectile().Timer = 0f; + pro.netUpdate = true; } } + + int existingLamps = player.ownedProjectileCounts[type]; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + minion.ai[0] = existingLamps; return false; } } diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 3e7129a037..467eaf14e4 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -30,22 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.cs b/Items/Weapons/Summon/DaedalusGolemStaff.cs index ec0b92d270..9f0761011b 100644 --- a/Items/Weapons/Summon/DaedalusGolemStaff.cs +++ b/Items/Weapons/Summon/DaedalusGolemStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,10 +12,6 @@ namespace CalamityMod.Items.Weapons.Summon public class DaedalusGolemStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() - { - // Funny Hollow Knight reference. - } public override void SetDefaults() { @@ -27,8 +24,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3f; Item.UseSound = SoundID.Item67; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; @@ -36,13 +33,13 @@ namespace CalamityMod.Items.Weapons.Summon } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 mouse = player.ClampedMouseWorld(); Point mouseTileCoords = mouse.ToTileCoordinates(); if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).IsTileSolidGround()) { - int p = Projectile.NewProjectile(source, mouse, Vector2.UnitY * 4f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, mouse, Vector2.UnitY * 4f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index d67006f38b..f996dae50c 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -31,22 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 93cff97797..b36a388f5b 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 15; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 13f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); @@ -43,14 +44,12 @@ namespace CalamityMod.Items.Weapons.Summon } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + + for (int i = 0; i < 3; i++) { - for (int i = 0; i < 3; i++) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, i + 1); + minion.originalDamage = Item.damage; } float angleMax = MathHelper.ToRadians(360f); if (CalamityUtils.CountOwnedProjectiles(type, player.whoAmI) == 1) diff --git a/Items/Weapons/Summon/DeathstareRod.cs b/Items/Weapons/Summon/DeathstareRod.cs index 8bd0029774..0eaba9f552 100644 --- a/Items/Weapons/Summon/DeathstareRod.cs +++ b/Items/Weapons/Summon/DeathstareRod.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -22,17 +23,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.NPCHit8; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index 07c7018c5d..f65d3f9ae6 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -28,20 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity = Vector2.Zero; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index c27c8fb840..b2429d03fa 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -28,16 +29,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.DD2_SkeletonDeath; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/EnchantedConch.cs b/Items/Weapons/Summon/EnchantedConch.cs index 768ffed01d..c5d5a015f9 100644 --- a/Items/Weapons/Summon/EnchantedConch.cs +++ b/Items/Weapons/Summon/EnchantedConch.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -18,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 26; Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -33,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index ed6a24735a..2d28fe5010 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.UseSound = SoundID.Item60; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); @@ -36,41 +37,38 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + + bool bodyExists = false; + int bodyIndex = -1; + foreach (Projectile p in Main.ActiveProjectiles) { - bool bodyExists = false; - int bodyIndex = -1; - foreach (Projectile p in Main.ActiveProjectiles) + if (p.type == type && p.owner == player.whoAmI) { - if (p.type == type && p.owner == player.whoAmI) - { - bodyIndex = p.whoAmI; - bodyExists = true; - break; - } + bodyIndex = p.whoAmI; + bodyExists = true; + break; } - if (bodyExists) + } + if (bodyExists) + { + var head = Projectile.NewProjectileDirect(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); + head.originalDamage = Item.damage; + } + else + { + bodyIndex = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + if (Main.projectile.IndexInRange(bodyIndex)) + Main.projectile[bodyIndex].originalDamage = Item.damage; + var head = Projectile.NewProjectileDirect(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); + head.originalDamage = Item.damage; + for (int i = 0; i < 72; i++) { - int p = Projectile.NewProjectile(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } - else - { - bodyIndex = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - int head = Projectile.NewProjectile(source, player.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType(), damage, knockback, player.whoAmI, bodyIndex); - if (Main.projectile.IndexInRange(bodyIndex)) - Main.projectile[bodyIndex].originalDamage = Item.damage; - if (Main.projectile.IndexInRange(head)) - Main.projectile[head].originalDamage = Item.damage; - for (int i = 0; i < 72; i++) - { - Dust dust = Dust.NewDustPerfect(Main.projectile[bodyIndex].Center, 113); - dust.velocity = (MathHelper.TwoPi * Vector2.Dot((i / 72f * MathHelper.TwoPi).ToRotationVector2(), player.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(i / 72f * -MathHelper.TwoPi))).ToRotationVector2(); - dust.velocity = dust.velocity.RotatedBy(i / 36f * MathHelper.TwoPi) * 8f; - dust.noGravity = true; - dust.scale = 1.9f; - } + Dust dust = Dust.NewDustPerfect(Main.projectile[bodyIndex].Center, 113); + dust.velocity = (MathHelper.TwoPi * Vector2.Dot((i / 72f * MathHelper.TwoPi).ToRotationVector2(), player.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(i / 72f * -MathHelper.TwoPi))).ToRotationVector2(); + dust.velocity = dust.velocity.RotatedBy(i / 36f * MathHelper.TwoPi) * 8f; + dust.noGravity = true; + dust.scale = 1.9f; } } return false; diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index 97942a9175..a9a41e73d4 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -33,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); @@ -45,21 +46,19 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + CalamityUtils.KillShootProjectileMany(player, new int[] { - CalamityUtils.KillShootProjectileMany(player, new int[] - { - type, - ModContent.ProjectileType(), - ModContent.ProjectileType() - }); + type, + ModContent.ProjectileType(), + ModContent.ProjectileType() + }); - SummonEndoCooper(source, AttackMode, player.ClampedMouseWorld(), damage, Item.damage, knockback, player, out _, out _); + player.AddBuff(Item.buffType, 2); + SummonEndoCooper(source, AttackMode, player.ClampedMouseWorld(), damage, Item.damage, knockback, player, out _, out _); - AttackMode++; - if (AttackMode > 3) - AttackMode = 0; - } + AttackMode++; + if (AttackMode > 3) + AttackMode = 0; return false; } diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index 286efcaa94..6b74919eb6 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -1,5 +1,5 @@ -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -27,6 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 52; Item.damage = 42; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; @@ -45,6 +46,8 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); + Vector2 mouse = player.ClampedMouseWorld(); float randomAngleOffset = Main.rand.NextFloat(MathHelper.TwoPi); for (int i = 0; i < 3; i++) @@ -55,15 +58,18 @@ namespace CalamityMod.Items.Weapons.Summon switch (i) { case 0: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; case 1: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; case 2: - Projectile.NewProjectile(source, mouse, spawnVelocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + type = ModContent.ProjectileType(); break; } + + var minion = Projectile.NewProjectileDirect(source, mouse, spawnVelocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 9edd09c593..66dbca0b57 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 70; Item.damage = 200; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -42,7 +44,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs index 4dae0ecdb7..829421eadb 100644 --- a/Items/Weapons/Summon/EyeOfNight.cs +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,19 +26,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.NPCHit1; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -3f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.UnitY * -3f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/FlarebatStaff.cs b/Items/Weapons/Summon/FlarebatStaff.cs index 4ee88f1d16..91f6eb0365 100644 --- a/Items/Weapons/Summon/FlarebatStaff.cs +++ b/Items/Weapons/Summon/FlarebatStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -15,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -31,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 671bec1cae..638e048448 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 42; Item.damage = 20; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -37,7 +38,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index ee43914ad1..247ab82b77 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -28,6 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; } @@ -36,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 5; i++) { diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index 4fb966f134..ba73a0b486 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,21 +27,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 28; Item.useAnimation = Item.useTime = 25; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - vector2.X = Main.mouseX + Main.screenPosition.X; - vector2.Y = Main.mouseY + Main.screenPosition.Y; - int p = Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 852b6cd188..026da729b3 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,17 +24,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item28; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/FrostbatStaff.cs b/Items/Weapons/Summon/FrostbatStaff.cs index ade55ae2aa..a8148b1e5b 100644 --- a/Items/Weapons/Summon/FrostbatStaff.cs +++ b/Items/Weapons/Summon/FrostbatStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -15,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 22; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -31,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GammaHeart.cs b/Items/Weapons/Summon/GammaHeart.cs index 6ab12f05c7..b563bb8704 100644 --- a/Items/Weapons/Summon/GammaHeart.cs +++ b/Items/Weapons/Summon/GammaHeart.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -24,20 +25,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3f; Item.autoReuse = true; Item.useAnimation = Item.useTime = 14; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 0d23ca4774..7e7233f8cf 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -29,44 +30,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item76; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.autoReuse = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float directionX = Main.mouseX + Main.screenPosition.X - playerPos.X; - float directionY = Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - directionY = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; - } - Vector2 spinningpoint = new Vector2(directionX, directionY); - float dist = spinningpoint.Length(); - if ((float.IsNaN(spinningpoint.X) && float.IsNaN(spinningpoint.Y)) || (spinningpoint.X == 0f && spinningpoint.Y == 0f)) - { - spinningpoint.X = player.direction; - spinningpoint.Y = 0f; - dist = Item.shootSpeed; - } - else - { - dist = Item.shootSpeed / dist; - } - spinningpoint.X *= dist; - spinningpoint.Y *= dist; - playerPos.X = Main.mouseX + Main.screenPosition.X; - playerPos.Y = Main.mouseY + Main.screenPosition.Y; - spinningpoint = spinningpoint.RotatedBy(Math.PI / 2D, default); - int p = Projectile.NewProjectile(source, playerPos + spinningpoint, spinningpoint, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(5f, 5f), type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index 00fc0f2f75..7f2827b342 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4.5f; Item.UseSound = SoundID.Item30; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; @@ -44,11 +45,10 @@ namespace CalamityMod.Items.Weapons.Summon } if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) { - player.AddBuff(ModContent.BuffType(), 120, true); + player.AddBuff(Item.buffType, 2); position = player.ClampedMouseWorld(); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; int pointyThingCount = 0; foreach (Projectile pro in Main.ActiveProjectiles) { diff --git a/Items/Weapons/Summon/HauntedScroll.cs b/Items/Weapons/Summon/HauntedScroll.cs index 5ac5707364..001eafa166 100644 --- a/Items/Weapons/Summon/HauntedScroll.cs +++ b/Items/Weapons/Summon/HauntedScroll.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -30,23 +31,17 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item60; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 30f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - //projectile.ai[1] is attack cooldown. Setting it here prevents immediate attacks - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 30f); + minion.originalDamage = Item.damage; + //projectile.ai[1] is attack cooldown. Setting it here prevents immediate attacks return false; } diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index 33f8bd5fbe..045c7353c3 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -17,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1.25f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 30; Item.DamageType = DamageClass.Summon; @@ -30,12 +32,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index e91c75a2c7..86d6a3d058 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,15 +54,14 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item71; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } - public override bool AltFunctionUse(Player player) - { - return player.ownedProjectileCounts[Item.shoot] > 0; - } + public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[Item.shoot] > 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse == 2) @@ -77,12 +77,9 @@ namespace CalamityMod.Items.Weapons.Summon } else { - - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; int bladeIndex = 0; foreach (Projectile pro in Main.ActiveProjectiles) diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index a5391fa820..7410951304 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -37,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon { ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); - - } + } public override void SetDefaults() { @@ -51,8 +51,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.noMelee = true; Item.knockBack = 5f; Item.UseSound = SoundID.Item15; //phaseblade sound effect + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; @@ -64,11 +64,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/KingofConstellationsTenryu.cs b/Items/Weapons/Summon/KingofConstellationsTenryu.cs index f8c677a7a7..e25f41c11f 100644 --- a/Items/Weapons/Summon/KingofConstellationsTenryu.cs +++ b/Items/Weapons/Summon/KingofConstellationsTenryu.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 187; Item.useStyle = ItemUseStyleID.HoldUp; - Item.shootSpeed = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.UseSound = Flare.FlareSound; Item.useAnimation = Item.useTime = 25; @@ -38,10 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.autoReuse = true; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-20, 0); public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.maxMinions >= 4; @@ -49,20 +47,23 @@ namespace CalamityMod.Items.Weapons.Summon { Vector2 spawnPos = new Vector2(player.position.X - 200, player.position.Y - 200); Vector2 spawnPos2 = new Vector2(player.position.X + 200, player.position.Y - 200); - SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos2, player, source, damage, knockback); - SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos, player, source, damage, knockback); + player.AddBuff(Item.buffType, 2); + SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos2, player, source, damage, Item.damage, knockback); + SpawnDragon(ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), spawnPos, player, source, damage, Item.damage, knockback); return false; } - public static void SpawnDragon(int head, int body, int tail, Vector2 spawnPos, Player player, EntitySource_ItemUse_WithAmmo source, int damage, float knockback) + public static void SpawnDragon(int headType, int bodyType, int tailType, Vector2 spawnPos, Player player, EntitySource_ItemUse_WithAmmo source, int damage, int originalDamage, float knockback) { // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile.NewProjectile(source, spawnPos, player.DirectionTo(Main.MouseWorld) * 3, head, damage, knockback, player.whoAmI); - // okay but seriously why are you multiplying zero by three - Projectile.NewProjectile(source, spawnPos, Vector2.Zero * 3, tail, damage, knockback, player.whoAmI); + var head = Projectile.NewProjectileDirect(source, spawnPos, player.DirectionTo(Main.MouseWorld) * 3, headType, damage, knockback, player.whoAmI); + head.originalDamage = originalDamage; + var tail = Projectile.NewProjectileDirect(source, spawnPos, Vector2.Zero, tailType, damage, knockback, player.whoAmI); + tail.originalDamage = originalDamage; for (var i = 0; i < 20; i++) { - Projectile.NewProjectile(source, spawnPos, Vector2.Zero * 3, body, damage, knockback, player.whoAmI); + var body = Projectile.NewProjectileDirect(source, spawnPos, Vector2.Zero, bodyType, damage, knockback, player.whoAmI); + body.originalDamage = originalDamage; } } diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index 4e49f639e6..4978eebfd0 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -28,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Purple; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; } public override void UseStyle(Player player, Rectangle heldItemFrame) @@ -39,15 +40,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/LiliesOfFinality.cs b/Items/Weapons/Summon/LiliesOfFinality.cs index 968e79bbe8..8c78d3b917 100644 --- a/Items/Weapons/Summon/LiliesOfFinality.cs +++ b/Items/Weapons/Summon/LiliesOfFinality.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -40,6 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.damage = 512; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ProjectileType(); Item.knockBack = 5f; @@ -58,9 +60,12 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 mouse = player.ClampedMouseWorld(); - Projectile.NewProjectile(source, mouse, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); - Projectile.NewProjectile(source, mouse, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + var elster = Projectile.NewProjectileDirect(source, mouse, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); + elster.originalDamage = Item.damage; + var ariane = Projectile.NewProjectileDirect(source, mouse, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + ariane.originalDamage = Item.damage; if (Main.dedServ) return false; diff --git a/Items/Weapons/Summon/Metastasis.cs b/Items/Weapons/Summon/Metastasis.cs index dce121d6b1..51fa3ef810 100644 --- a/Items/Weapons/Summon/Metastasis.cs +++ b/Items/Weapons/Summon/Metastasis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.DD2_BetsySummon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -40,9 +41,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), -Vector2.UnitY * 5f, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), -Vector2.UnitY * 5f, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/MirrorofKalandra.cs b/Items/Weapons/Summon/MirrorofKalandra.cs index 9c6734e2f4..bdf70f8296 100644 --- a/Items/Weapons/Summon/MirrorofKalandra.cs +++ b/Items/Weapons/Summon/MirrorofKalandra.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon.MirrorofKalandraMinions; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -53,6 +54,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useAnimation = Item.useTime = 30; Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.autoReuse = true; @@ -71,6 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 1) { type = ModContent.ProjectileType(); @@ -82,9 +85,9 @@ namespace CalamityMod.Items.Weapons.Summon type = ModContent.ProjectileType(); } - int minion = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(minion)) - Main.projectile[minion].rotation = -MathHelper.PiOver2; + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.rotation = -MathHelper.PiOver2; + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index be68bf83a5..5b577b75d8 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -42,6 +43,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 26; Item.damage = 275; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 5f; @@ -54,12 +56,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; } + // Only one can be summoned. + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 1 && player.maxMinions >= 3; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Only one can be summoned. - if (player.ownedProjectileCounts[type] < 1 && player.maxMinions >= 3) - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); - + player.AddBuff(Item.buffType, 2); + CalamityUtils.KillShootProjectiles(true, type, player); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index af0f2d7571..338f86fb93 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,7 +16,6 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { - ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } @@ -25,7 +24,9 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 56; Item.damage = 375; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); + Item.sentry = true; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1. @@ -38,19 +39,15 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.DD2_EtherianPortalOpen; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 1; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - if (player.ownedProjectileCounts[type] < 1) - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - } - else - { - // Play some demonic noises prior to a target being selected. - SoundEngine.PlaySound(SoundID.Zombie93, player.Center); - SoundEngine.PlaySound(SoundID.Item119, player.Center); - } + player.AddBuff(Item.buffType, 2); + CalamityUtils.KillShootProjectiles(true, type, player); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + player.UpdateMaxTurrets(); return false; } } diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index f7ab0903ef..b967ef9731 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -41,6 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 58; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; @@ -57,7 +59,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/PuffShroom.cs b/Items/Weapons/Summon/PuffShroom.cs index 99690d4f50..d12ee0ac1e 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -29,19 +30,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item42; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int puffGuy = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(puffGuy)) - Main.projectile[puffGuy].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index 98ff76631a..d99b51f0a3 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -29,22 +30,21 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); Vector2 clampedMouse = player.ClampedMouseWorld(); - Vector2 mouseDirection = Vector2.Normalize(clampedMouse - player.Center) * Item.shootSpeed; + Vector2 mouseDirection = Vector2.Normalize(clampedMouse - player.Center) * 10f; - int p = Projectile.NewProjectile(source, clampedMouse, mouseDirection.RotatedBy(MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - p = Projectile.NewProjectile(source, clampedMouse, mouseDirection.RotatedBy(-MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var pink = Projectile.NewProjectileDirect(source, clampedMouse, mouseDirection.RotatedBy(MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); + pink.originalDamage = Item.damage; + var purple = Projectile.NewProjectileDirect(source, clampedMouse, mouseDirection.RotatedBy(-MathHelper.PiOver2), ModContent.ProjectileType(), damage, knockback, Main.myPlayer, 0f, 0f); + purple.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 262bb00eb2..beba2cc6f2 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -22,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; @@ -35,12 +37,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int sandnado = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(sandnado)) - Main.projectile[sandnado].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index e70b846278..0e143371a0 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; @@ -37,10 +39,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index 9ddc38325c..2bee629707 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,6 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item83; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; @@ -36,15 +38,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/SeashineHilt.cs b/Items/Weapons/Summon/SeashineHilt.cs index 8168f5fff6..6ec21393a9 100644 --- a/Items/Weapons/Summon/SeashineHilt.cs +++ b/Items/Weapons/Summon/SeashineHilt.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.SunkenSea; @@ -38,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 12f; Item.mana = 10; Item.rare = ItemRarityID.Green; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); } public override bool AltFunctionUse(Player player) => true; @@ -90,11 +92,11 @@ namespace CalamityMod.Items.Weapons.Summon } else // Toss out the summon { + player.AddBuff(Item.buffType, 2); SoundEngine.PlaySound(SoundID.Item1, player.Center); - int pr = Projectile.NewProjectile(source, player.Center, velocity, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(pr)) - Main.projectile[pr].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, player.Center, velocity, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; float angleMax = MathHelper.ToRadians(360f); if (CalamityUtils.CountProjectiles(type) == 1) diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index acfa24fee7..01c8c17b73 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,19 +28,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 4c39a7837c..305abfe88a 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.knockBack = 10f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; @@ -36,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs index 9bd042de78..607bbbe62d 100644 --- a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs +++ b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -24,22 +25,19 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Point mouseTileCoords = position.ToTileCoordinates(); + player.AddBuff(Item.buffType, 2); + Point mouseTileCoords = player.ClampedMouseWorld().ToTileCoordinates(); if (WorldGen.SolidTile(mouseTileCoords.X, mouseTileCoords.Y)) return false; - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 2968a2088d..83e6d27796 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,4 +1,5 @@ using System.Linq; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -31,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item113; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -104,6 +105,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); int head = -1; int tail = -1; foreach (Projectile p in Main.ActiveProjectiles) diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index e687d10378..48701eb7dc 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -24,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1.25f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; @@ -37,24 +39,19 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ModProjectile().ProbeIndex = player.ownedProjectileCounts[type]; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; + minion.ModProjectile().ProbeIndex = player.ownedProjectileCounts[type]; - int bladeIndex = 0; - foreach (Projectile pro in Main.ActiveProjectiles) + int bladeIndex = 0; + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().ProbeIndex = bladeIndex++; - pro.ModProjectile().AITimer = 0f; - pro.netUpdate = true; - } + pro.ModProjectile().ProbeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 23e2df9b9d..05344b0db5 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -29,6 +30,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.useAnimation = Item.useTime = 20; Item.knockBack = 4f; Item.mana = 10; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.noMelee = true; @@ -43,11 +45,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int minion = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); - - if (Main.projectile.IndexInRange(minion)) - Main.projectile[minion].originalDamage = Item.OriginalDamage; - + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, knockback, player.whoAmI); + minion.originalDamage = Item.OriginalDamage; return false; } diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 53c47e8b77..2780625a88 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Buffs.Summon; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,19 +26,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Green; Item.UseSound = Stormlion.DeathSound; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index fa04a52417..61403820f0 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -24,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -32,10 +34,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index 2a672d25f5..bbdbb624a9 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -27,18 +28,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item14; Item.autoReuse = true; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 7f; // Affects bullet speed } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 592dea16b1..04b56eee01 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon.Umbrella; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 99; Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; - Item.shootSpeed = 0f; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.useStyle = ItemUseStyleID.Swing; @@ -41,10 +42,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectileMany(player, type, ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType()); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs index dcf2926b9a..c3879ce76f 100644 --- a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs +++ b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -23,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item46; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -31,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 3; i++) { diff --git a/Items/Weapons/Summon/VengefulSunStaff.cs b/Items/Weapons/Summon/VengefulSunStaff.cs index fc5250bf6d..6a6e9735c3 100644 --- a/Items/Weapons/Summon/VengefulSunStaff.cs +++ b/Items/Weapons/Summon/VengefulSunStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; Item.rare = ItemRarityID.LightPurple; Item.UseSound = SoundID.Item44; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } @@ -33,10 +35,10 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(true, type, player); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + var minion = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 5b731630f0..bd8f7d453a 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.UseSound = SoundID.DD2_BetsySummon; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; @@ -37,17 +38,12 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + if (player.maxMinions - player.slotsMinions >= 1f) { - if (player.maxMinions - player.slotsMinions >= 1f) - { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].ai[0] = player.ownedProjectileCounts[type]; - Main.projectile[p].originalDamage = Item.damage; - } - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.ai[0] = player.ownedProjectileCounts[type]; + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index db16a86ab9..9f7e9472ac 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Buffs.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -19,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 36; Item.damage = 15; Item.DamageType = DamageClass.Summon; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; @@ -37,7 +39,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Main.rand.NextVector2CircularEdge(5f, 5f), type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 1c6f7c5669..a3cb6ee511 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -25,29 +26,26 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item44; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + + int minionCount = 0; + foreach (Projectile pro in Main.ActiveProjectiles) { - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; + if (pro.type != type || pro.owner != player.whoAmI) + continue; - int minionCount = 0; - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type != type || pro.owner != player.whoAmI) - continue; - - pro.localAI[0] = minionCount; - pro.netUpdate = true; - minionCount++; - } + pro.localAI[0] = minionCount; + pro.netUpdate = true; + minionCount++; } return false; } diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index affd241fee..6c1376707e 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -47,33 +48,28 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Red; Item.UseSound = SoundID.Item71; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ModProjectile().BladeIndex = player.ownedProjectileCounts[type]; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; + minion.ModProjectile().BladeIndex = player.ownedProjectileCounts[type]; - int bladeIndex = 0; - foreach (Projectile pro in Main.ActiveProjectiles) + int bladeIndex = 0; + foreach (Projectile pro in Main.ActiveProjectiles) + { + if (pro.type == type && pro.owner == player.whoAmI) { - if (pro.type == type && pro.owner == player.whoAmI) - { - pro.ModProjectile().BladeIndex = bladeIndex++; - pro.ModProjectile().AITimer = 0f; - pro.netUpdate = true; - } + pro.ModProjectile().BladeIndex = bladeIndex++; + pro.ModProjectile().AITimer = 0f; + pro.netUpdate = true; } } - return false; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 38ce3b2db3..e9263db742 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 105; Item.knockBack = 4f; Item.useAnimation = Item.useTime = 15; // 14 because of useStyle 1 + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); } @@ -50,10 +50,9 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - int p = Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = Item.damage; - player.AddBuff(ModContent.BuffType(), 120); + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; } return false; } diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index edc2b0338b..b06e055294 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -35,24 +36,19 @@ namespace CalamityMod.Items.Weapons.Summon Item.UseSound = SoundID.Item104; Item.autoReuse = true; Item.noUseGraphic = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.Calamity().donorItem = true; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - int existingFists = player.ownedProjectileCounts[type]; - int p = Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(p)) - { - Main.projectile[p].originalDamage = Item.damage; - Main.projectile[p].ai[0] = existingFists; - } - } + player.AddBuff(Item.buffType, 2); + int existingFists = player.ownedProjectileCounts[type]; + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; + minion.ai[0] = existingFists; return false; } diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.cs b/Items/Weapons/Summon/WitherBlossomsStaff.cs index e4ff0d39fd..4bd1b77d8d 100644 --- a/Items/Weapons/Summon/WitherBlossomsStaff.cs +++ b/Items/Weapons/Summon/WitherBlossomsStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item46; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -36,6 +37,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + player.AddBuff(Item.buffType, 2); CalamityUtils.KillShootProjectiles(false, type, player); for (int i = 0; i < 4; i++) { diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 9dff85b70b..4c3c3541a9 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.Summon; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -27,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.Blue; Item.UseSound = SoundID.Item15; //phaseblade sound effect Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } @@ -40,15 +41,9 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - velocity.X = 0; - velocity.Y = 0; - int droid = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); - if (Main.projectile.IndexInRange(droid)) - Main.projectile[droid].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI, 0f, 1f); + minion.originalDamage = Item.damage; return false; } diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index cffe7f5fb8..724f7a5e09 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; @@ -36,20 +37,16 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ModContent.RarityType(); Item.UseSound = CommonCalamitySounds.FlareSound; Item.autoReuse = true; + Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse != 2) - { - position = player.ClampedMouseWorld(); - int dragon = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - if (Main.projectile.IndexInRange(dragon)) - Main.projectile[dragon].originalDamage = Item.damage; - } + player.AddBuff(Item.buffType, 2); + var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); + minion.originalDamage = Item.damage; return false; } } diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 872d2e4d6a..bfc0f7aa08 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Typeless { public new string LocalizationCategory => "Items.Weapons.Typeless"; - public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/LunicShot", 2) { PitchVariance = 0.1f }; + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/LunicShot", 2) { Volume = 0.8f, PitchVariance = 0.1f }; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Item/LunicImpact") { PitchVariance = 0.1f }; public override void SetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson index 7d5a7a6af1..21b32dc38b 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.hjson @@ -86,7 +86,7 @@ MantisShrimp: Though a variety of answers are given when one asks adventurers ab OverloadedSoldier: A body given life again, overflowing with the souls of warriors that perished during the Crusade who were unable to find peace. Their ravenous hunger for battle has been reignited due to sensing godly essences in the land once more. PerennialSlime: These slimes have seized a small amount of the Goddess of Life's essence. Despite her reimprisonment in the deepest depths of the Abyss, the tendrils of her influence now stretch far into the world beyond. PhantomSpirit: The spirits within the Dungeon only vaguely recall their lives, and yet there is one thing each and all clearly remember, that drives them to chaos: the man responsible for locking them in these cursed walls, and his overwhelming power– power that they have been reminded of, due to one ever growing in strength roaming their halls. -Piggy: These little swines waddle their little legs across these lands with little purpose, but they are happy with just that. Yet, little is known about how their little stomach carries a not-so-little amount of coins. +Piggy: These little swines waddle their little legs across these lands with little purpose, but they are happy with just that. Yet, little is known about how their little stomach carries a not-so-little amount of fat and muscle. ProfanedEnergyBody: Those most devout to Her travel the world, being planted into societies and acting as spies and assassins. Among their duties is constructing shrines in Her honor infused with Her divine power, that She might bless pagans blinded by darkness with visions of Her new age of light. Rimehound: These hounds were bred and trained to survive in the tundra's hostile conditions by Yharim's forces, so that they may act as scouts. Most were simply abandoned by their masters out of either necessity or choice, and were resigned to roam forever without purpose. Rotdog: Fast and furious, these hounds prowl the night, hunting prey with their razor sharp teeth. They are similar in nature to the demon eyes, both being spawned from the same vile mire, yet these creatures are tailored made to end those who have proven themselves a threat to it. diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 0e8e942090..5920e13c94 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -479,11 +479,6 @@ RadiatorBuff: { Description: Radioactive but adorable } -ReaverOrbBuff: { - DisplayName: Reaver Orb - Description: The reaver orb will light your way -} - SparksBuff: { DisplayName: Sparks Description: Eats butterflies @@ -1078,6 +1073,11 @@ AquaticStar: { Description: The aquatic star will protect you } +AqueousHunterDroneBuff: { + DisplayName: Aqueous Hunter Drone Buff + Description: Unfortunately incapable of producing fried rice +} + AstralProbeBuff: { DisplayName: Astral Probe Description: The astral probe will protect you @@ -1143,11 +1143,6 @@ CloudElemental: { Description: The Cloud Elemental will protect you } -GlacialEmbraceBuff: { - DisplayName: Glacial Embrace - Description: The magic of the ancient ice castle will aid you -} - Corroslime: { DisplayName: Corroslime Description: The corroslime will protect you @@ -1203,11 +1198,6 @@ DemonshadeSetDevilBuff: { Description: The red devil will protect you } -LegionofCelestiaBuff: { - DisplayName: Celestial Axe - Description: If only it was this good at chopping trees... -} - EndoCooperBuff: { DisplayName: Endo Cooper Description: The ascened Cooper will protect you @@ -1278,6 +1268,11 @@ GastricAberrationBuff: { Description: The aquatic aberration will protect you } +GlacialEmbraceBuff: { + DisplayName: Glacial Embrace + Description: The magic of the ancient ice castle will aid you +} + HauntedDishesBuff: { DisplayName: Haunted Dishes Description: The haunted dishes will protect you @@ -1328,6 +1323,11 @@ KingofConstellationsBuff: { Description: The celestial dragons will protect you } +LegionofCelestiaBuff: { + DisplayName: Celestial Axe + Description: If only it was this good at chopping trees... +} + LiliesOfFinalityBuff: { DisplayName: Finality Description: Remember our promise diff --git a/Localization/en-US/Mods.CalamityMod.GameTips.hjson b/Localization/en-US/Mods.CalamityMod.GameTips.hjson index 3d5faa25c4..d847050349 100644 --- a/Localization/en-US/Mods.CalamityMod.GameTips.hjson +++ b/Localization/en-US/Mods.CalamityMod.GameTips.hjson @@ -9,7 +9,6 @@ AmidiasBlessingTip: The Sea King can provide a bubble to aid with breathing unde ArchmageTip: The Archmage can be freed if you manage to destroy the cell he was imprisoned in. BrimstoneWitchTip: The Brimstone Witch can enchant your items to grant them new powers. TitanHeartTip: Titan Hearts can be used as an offering at a Beacon found in the Astral Infection. -NightProvTip: Summoning the Profaned Goddess under the light of the moon massively empowers her strength and endurance. DayEoLTip: Summoning the fae monarch under the light of day will start a vicious and persistent battle. BossEnemyTip: Killing the most harmless of enemies can awaken the wrath of a much stronger monster. Slay them at your own risk! RoDAbyssTip: Use the Rod of Discord in the Abyss at your own risk. The light left behind may attract the attention of unwanted foes. @@ -21,7 +20,6 @@ FactoryChargingTip: Power Cell Factories and Charging Stations can be looted fro StealthTip: Wearing any rogue class armor lets you build stealth! SummonNerfTip: Holding a non-summoner weapon reduces the damage of your minions. DefenseDamageTip: Certain attacks will chip away at your defense, but it will quickly regenerate afterward. -PointBlankTip: Ranged weapons fired at point blank will do a lot more damage. RevengeanceTip: Need a challenge beyond Expert Mode? Try Revengeance Mode! BloodOrbTip: Blood Orbs collected during the Blood Moon can craft almost any potion. KeybindsTip: Modded controls can be bound in Settings. diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 88d01de082..0c10d1af98 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -105,8 +105,8 @@ AmbrosialAmpoule: { Tooltip: ''' +50 max life - Grants +2 to +6 HP/s life regen based on missing health - Standing still grants +1.5 HP/s life regen and +1 HP/s life regen when inflicted with a damage debuff + Grants +2 to +5 HP/s life regen based on missing health + Grants the Honey buff Current boost: +[REGEN] HP/s Fire and sickness debuff durations are halved You emit yellow light if visibility is enabled @@ -151,10 +151,11 @@ AngelTreads: { DisplayName: Angel Treads Tooltip: ''' - 36% increased running acceleration - Increased flight time and grants rocket flight - Provides water walking and extra mobility on ice - Grants immunity to On Fire! and temporary immunity to lava + Allows flight, super fast running, and extra mobility on ice + {0}% increased movement speed and {1}% increased flight time + Provides the ability to walk on water, honey & lava + Grants immunity to fire blocks and {2} seconds of immunity to lava + Reduces damage from touching lava 'Extreme speed!' ''' } @@ -496,7 +497,6 @@ CrownJewel: { ''' +1 HP/s life regen You gain an additional +1.5 HP/s life regen while afflicted with any debuff - Massively boosts natural life regen while afflicted with any debuff ''' } @@ -971,10 +971,9 @@ HideofAstrumDeus: { DisplayName: Hide of Astrum Deus Tooltip: ''' - Taking damage or inflicting true melee strikes drops an immense amount of astral stars from the sky - Taking damage temporarily increases true melee damage by 30% + True melee strikes drops astral stars from the sky + Releases an explosion and temporarily increases true melee damage by 30% when damaged Boost duration scales with the amount of damage you took, up to 10 seconds - Attackers take damage and are inflicted with Astral Infection Nullifies the Astral Infection debuff ''' } @@ -984,8 +983,7 @@ HoneyDew: { Tooltip: ''' +10 max life - Grants +1 HP/s life regen, and +1 HP/s life regen when inflicted with a damaging debuff - Standing still in Honey grants +1.5 HP/s life regen + Grants the Honey buff Sickness debuff durations are halved ''' } @@ -1015,7 +1013,6 @@ InfectedJewel: { ''' Passively grants +1 HP/s life regen Grants 12 defense and +2 HP/s life regen while afflicted with any debuff - Massively boosts natural life regen while afflicted with any debuff Granted defense fades away quickly when not afflicted with any debuffs Each debuff beyond the first grants 4 additional defense Nullifies the Astral Infection debuff @@ -1027,7 +1024,6 @@ InkBomb: { DisplayName: Ink Bomb Tooltip: ''' - +10 maximum stealth Stealth generates 7% faster Throws several ink bombs when hit that explode into ink and confuse enemies Gain a lot of stealth when struck @@ -1107,8 +1103,7 @@ LivingDew: { Tooltip: ''' +25 max life - Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damaging debuff - Standing still in Honey grants +1.5 HP/s life regen + Grants the Honey buff Fire and sickness debuff durations are halved ''' } @@ -1429,11 +1424,11 @@ Radiance: { ''' HoldShiftTooltip: ''' - [c/CDF69C:Grants +2 to +6 HP/s life regen based on missing health] + [c/CDF69C:Grants +2 to +5 HP/s life regen based on missing health] [c/CDF69C:Recover an additional 6 HP/s while inflicted with a debuff] [c/CDF69C:This eventually slows to 1.33 HP/s when debuffed for an extended time period] - [c/CDF69C:Standing still provides +2 HP/s life regen and faster natural regen recovery] - [c/CDF69C:+15 defense and faster natural regen recovery while afflicted with any debuff] + [c/CDF69C:Grants the Honey buff] + [c/CDF69C:Grants 15 defense while afflicted with any debuff] [c/CDF69C:Each additional debuff grants 5 defense, which slowly decays while not debuffed] [c/CDF69C:Weak damaging debuffs are harmless and halves the duration of most other debuffs] ''' @@ -1443,7 +1438,7 @@ RadiantOoze: { DisplayName: Radiant Ooze Tooltip: ''' - Grants +2 to +6 HP/s life regen based on missing health + Grants +2 to +5 HP/s life regen based on missing health Current boost: +[REGEN] HP/s You emit yellow light if visibility is enabled ''' @@ -1491,9 +1486,9 @@ Regenerator: { DisplayName: Regenerator Tooltip: ''' - Your health cannot exceed 50% of its maximum + Your health cannot exceed {0}% of its maximum Increases length of invincibility after taking damage - Provides powerful special life regen to heal you for 8.5 HP/s + Provides powerful special life regen to heal you for {1} HP/s All normal life regen is negated and converted into damage Current damage boost: [DAMAGE]% ''' @@ -1528,9 +1523,9 @@ RoverDrive: { DisplayName: Rover Drive Tooltip: ''' - Gain a barrier with 20 health + Gain a barrier with {0} health [ADREN] - If depleted, the barrier's health regenerates after not receiving damage for 10 seconds + The barrier will regenerate {1} seconds after being hit, taking {2} seconds to completely regenerate Getting hit resets the timer Can also be scrapped at an extractinator ''' @@ -1972,10 +1967,10 @@ TheSponge: { Tooltip: ''' Grants immunity to knockback - Gain a barrier with 120 health - The barrier grants 10% damage reduction while active + Gain a barrier with {0} health + The barrier grants {1}% damage reduction while active [ADREN] - The barrier will regenerate 8 seconds after being hit, taking 10 seconds to completely regenerate + The barrier will regenerate {2} seconds after being hit, taking {3} seconds to completely regenerate Getting hit resets the timer ''' ShieldAdren: Halved Adrenaline loss if all damage is absorbed diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index eb8db68041..b2b3e048b1 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -211,7 +211,11 @@ HydrothermicHeadMagic: { {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' - SetBonus: Magic attacks summon damaging and healing flare orbs on hit + SetBonus: + ''' + Magic attacks summon damaging and healing flare orbs on hit + {$HydrothermicArmor.CommonSetBonus} + ''' } HydrothermicHeadMelee: { @@ -225,6 +229,7 @@ HydrothermicHeadMelee: { ''' {$Common.AggroBoost} Melee attacks and projectiles cause chaos flames to erupt on enemy hits + {$HydrothermicArmor.CommonSetBonus} ''' } @@ -235,7 +240,11 @@ HydrothermicHeadRanged: { {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} 25% chance to save ammo ''' - SetBonus: You fire a homing chaos flare when using ranged weapons every {0} seconds + SetBonus: + ''' + You fire a homing chaos flare when using ranged weapons every {0} seconds + {$HydrothermicArmor.CommonSetBonus@1} + ''' } HydrothermicHeadRogue: { @@ -249,6 +258,7 @@ HydrothermicHeadRogue: { ''' {$Common.RogueStealth} Rogue weapons unleash a volley of homing chaos flames around the player every {1} seconds + {$HydrothermicArmor.CommonSetBonus@2} ''' } @@ -264,6 +274,7 @@ HydrothermicHeadSummon: { {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a hydrothermic vent to protect you + {$HydrothermicArmor.CommonSetBonus@2} ''' } @@ -280,7 +291,7 @@ LunicCorpsBoots: { DisplayName: Lunic Corps Boots Tooltip: ''' - {0}% increased ranged critical strike chance + {$CommonItemTooltip.PercentIncreasedRangedCritChance} {1}% increased movement speed and acceleration ''' } @@ -296,8 +307,8 @@ LunicCorpsHelmet: { ''' {0}% increased jump speed [c/{1}:MJOLNIR Shield - Projects a bubble shield that absorbs up to {2} damage]{3} - [c/52CBDE:The shield starts recharging {4} seconds after being hit] - [c/52CBDE:Recharging from zero to full charge takes {5} seconds] + [c/52CBDE:The shield starts recharging {4} {^4:second;seconds} after being hit] + [c/52CBDE:Recharging from zero to full charge takes {5} {^5:second;seconds}] [c/52CBDE:Being hit again while recharging restarts the charge timer] [c/9EA67F:'Finish the fight'] ''' @@ -346,9 +357,9 @@ PlaguebringerCarapace: { DisplayName: Plaguebringer Carapace Tooltip: ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Grants immunity to the Plague - 15% increased summon damage - Friendly bees inflict the plague ''' } @@ -356,32 +367,41 @@ PlaguebringerPistons: { DisplayName: Plaguebringer Pistons Tooltip: ''' - 15% increased summon damage and 15% increased movement speed - You grow flowers on the grass beneath you, chance to grow very random dye plants on grassless dirt + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} + Flowers grow on the grass you walk on, and dye plants rarely grow on grassless dirt you walk on ''' } PlaguebringerVisor: { DisplayName: Plaguebringer Visor - Tooltip: 15% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' Grants a plague dash which can slam through enemies without taking damage Summons a lil' plaguebringer which swarms your foes with little bees - +3 max minions + Friendly bees inflict the plague ''' } PlagueReaperMask: { DisplayName: Plague Reaper Mask - Tooltip: 10% increased ranged damage and 8% increased ranged critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} + 25% chance to save ammo + ''' SetBonus: ''' - 25% reduced ammo usage and 5% increased flight time - Enemies receive 10% more damage from ranged projectiles when afflicted by the Plague - Getting hit causes plague cinders to rain from above - {0} to blind yourself for 5 seconds but massively boost your ranged damage - This has a 25 second cooldown + {0}% increased flight time + Enemies afflicted by the Plague take {1}x damage from ranged projectiles + [c/{2}:Plague Blackout - {3} to greatly empower your damage but completely blind yourself] + [c/009418:{$CommonItemTooltip.PercentIncreasedRangedDamage@4} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@5} while blacked out] + [c/009418:This effect lasts {6} {^6:second;seconds} and has a cooldown of {7} {^7:second;seconds}] ''' } @@ -389,8 +409,8 @@ PlagueReaperStriders: { DisplayName: Plague Reaper Striders Tooltip: ''' - 3% increased ranged critical strike chance - 15% increased movement speed + {$CommonItemTooltip.PercentIncreasedRangedCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -398,71 +418,61 @@ PlagueReaperVest: { DisplayName: Plague Reaper Vest Tooltip: ''' + {$CommonItemTooltip.PercentIncreasedRangedDamage} Grants immunity to the Plague - 15% increased ranged damage and 5% increased ranged critical strike chance ''' } ReaverCuisses: { DisplayName: Reaver Cuisses - Tooltip: - ''' - 5% increased critical strike chance - 12% increased movement speed - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" } ReaverHeadExplore: { DisplayName: Reaver Headgear Tooltip: ''' - 20% increased mining speed - 50% increased block & wall placement speed + {0}% increased mining speed + {1}% increased block & wall placement speed Grants immunity to lava and can move freely through liquids ''' SetBonus: ''' - Summons an orb which highlights nearby treasure and provides light - Grants underwater breathing and reduced enemy aggression + Emits light and shows the location of treasure and ore + {$Common.AggroReduction} and grants underwater breathing These have a moderate effect while in the Abyss - Increased block placement & tool range by 7 + Increased block placement & tool range by {0} Increases pickup range for items ''' } ReaverHeadMobility: { DisplayName: Reaver Visage - Tooltip: 10% increased jump speed and 15% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed} and {1}% increased jump speed" SetBonus: ''' Grants immunity to fall damage and allows constant jumping - 10% increased flight time and horizontal wing speed - Hooks fly out and retract 50% faster - Reduces the cooldown of dashes + {0}% increased flight time and horizontal wing speed + Grappling hooks retract and pull the player {1}% faster + Reduces the cooldown of dashes by {2}% ''' } ReaverHeadTank: { DisplayName: Reaver Helm - Tooltip: - ''' - 15% increased damage reduction but 30% decreased damage - +50 max life - ''' + Tooltip: +{0} max life and +{1} HP/s life regen SetBonus: ''' - +10 defense and +5 HP/s life regen - Enemies are more likely to target you - Reduces the life regen lost from damage over time debuffs by 20% - 30% decreased movement speed and flight time - Enemy damage is reflected and summons a thorn spike - Reaver Rage activates when you are damaged + {$Common.AggroBoost} + Reduces the life regen lost from damage over time debuffs by {0}% + {1}% decreased movement speed and flight time + Grants Reaver Rage for {2} {^2:second;seconds} after taking damage ''' } ReaverScaleMail: { DisplayName: Reaver Scale Mail - Tooltip: 9% increased damage and 4% increased critical strike chance + Tooltip: "{0}% increased damage reduction" } TitanHeartBoots: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index b43be68354..b664e39301 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -1,25 +1,21 @@ AuricTeslaBodyArmor: { DisplayName: Auric Tesla Body Armor - Tooltip: - ''' - +100 max life - 8% increased damage and 5% increased critical strike chance - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" } AuricTeslaCuisses: { DisplayName: Auric Tesla Cuisses Tooltip: ''' - 10% increased movement speed - 12% increased damage and 5% increased critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} Magic carpet effect ''' } AuricTeslaHeadRanged: { DisplayName: Auric Tesla Hooded Facemask - Tooltip: 30% increased ranged damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" SetBonus: ''' Ranged Tarragon, Bloodflare and God Slayer armor effects @@ -29,19 +25,16 @@ AuricTeslaHeadRanged: { ''' Inherited Tarragon Set Bonus: {$TarragonHeadRanged.SetBonusEffect} - {$TarragonBreastplate.CommonSetBonus} ''' SetBonus2: ''' Inherited Bloodflare Set Bonus: {$BloodflareHeadRanged.SetBonusEffect} - {$BloodflareBodyArmor.CommonSetBonus} ''' SetBonus3: ''' Inherited God Slayer Set Bonus: {$GodSlayerHeadRanged.SetBonusEffect} - {$GodSlayerChestplate.CommonSetBonus} ''' } @@ -49,12 +42,12 @@ AuricTeslaHeadRogue: { DisplayName: Auric Tesla Plumed Helm Tooltip: ''' - 20% increased rogue damage and critical strike chance - 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' SetBonus: ''' - +130 maximum stealth + {$Common.RogueStealth} Rogue Tarragon, Bloodflare and God Slayer armor effects Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' @@ -62,19 +55,16 @@ AuricTeslaHeadRogue: { ''' Inherited Tarragon Set Bonus: {$TarragonHeadRogue.SetBonusEffect} - {$TarragonBreastplate.CommonSetBonus} ''' SetBonus2: ''' Inherited Bloodflare Set Bonus: {$BloodflareHeadRogue.SetBonusEffect} - {$BloodflareBodyArmor.CommonSetBonus} ''' SetBonus3: ''' Inherited God Slayer Set Bonus: {$GodSlayerHeadRogue.SetBonusEffect} - {$GodSlayerChestplate.CommonSetBonus} ''' } @@ -82,13 +72,12 @@ AuricTeslaHeadMelee: { DisplayName: Auric Tesla Royal Helm Tooltip: ''' - 20% increased melee damage - 10% increased melee critical strike chance + {$CommonItemTooltip.PercentIncreasedMeleeDamage} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@1} ''' SetBonus: ''' - Enemies are more likely to target you - 28% increased melee speed + {$Common.AggroBoost} Melee Tarragon, Bloodflare and God Slayer effects Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' @@ -96,29 +85,30 @@ AuricTeslaHeadMelee: { ''' Inherited Tarragon Set Bonus: {$TarragonHeadMelee.SetBonusEffect} - {$TarragonBreastplate.CommonSetBonus} ''' SetBonus2: ''' Inherited Bloodflare Set Bonus: {$BloodflareHeadMelee.SetBonusEffect} - {$BloodflareBodyArmor.CommonSetBonus} ''' SetBonus3: ''' Inherited God Slayer Set Bonus: {$GodSlayerHeadMelee.SetBonusEffect} - {$GodSlayerChestplate.CommonSetBonus} ''' } AuricTeslaHeadSummon: { DisplayName: Auric Tesla Space Helmet - Tooltip: 15% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - Max run speed and acceleration boosted by 5% - +6 max minions and 75% increased summon damage + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summoner Tarragon, Bloodflare and Silva armor effects Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' @@ -126,28 +116,28 @@ AuricTeslaHeadSummon: { ''' Inherited Tarragon Set Bonus: {$TarragonHeadSummon.SetBonusEffect} - {$TarragonBreastplate.CommonSetBonus} ''' SetBonus2: ''' Inherited Bloodflare Set Bonus: {$BloodflareHeadSummon.SetBonusEffect} - {$BloodflareBodyArmor.CommonSetBonus} ''' SetBonus3: ''' Inherited Silva Set Bonus: {$SilvaHeadSummon.SetBonusEffect} - {$SilvaArmor.CommonSetBonus} ''' } AuricTeslaHeadMagic: { DisplayName: Auric Tesla Wire-Hemmed Visage - Tooltip: 30% increased magic damage, 20% increased magic critical strike chance, +100 max mana and 20% reduced mana usage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} + ''' SetBonus: ''' - Max run speed and acceleration boosted by 5% Magic Tarragon, Bloodflare and Silva armor effects Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' @@ -155,29 +145,22 @@ AuricTeslaHeadMagic: { ''' Inherited Tarragon Set Bonus: {$TarragonHeadMagic.SetBonusEffect} - {$TarragonBreastplate.CommonSetBonus} ''' SetBonus2: ''' Inherited Bloodflare Set Bonus: {$BloodflareHeadMagic.SetBonusEffect} - {$BloodflareBodyArmor.CommonSetBonus} ''' SetBonus3: ''' Inherited Silva Set Bonus: {$SilvaHeadMagic.SetBonusEffect} - {$SilvaArmor.CommonSetBonus} ''' } BloodflareBodyArmor: { DisplayName: Bloodflare Body Armor - Tooltip: - ''' - 12% increased damage and 8% increased critical strike chance - +25 max life - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' Greatly increased life regen, equivalent to Crimson armor @@ -188,46 +171,60 @@ BloodflareBodyArmor: { BloodflareCuisses: { DisplayName: Bloodflare Cuisses - Tooltip: 17% increased movement speed, 10% increased damage and 7% increased critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} + ''' } BloodflareHeadMagic: { DisplayName: Bloodflare Hydra Hood - Tooltip: 20% increased magic damage, 10% increased magic critical strike chance, +100 max mana and 17% reduced mana usage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} + ''' SetBonus: "{$BloodflareHeadMagic.SetBonusEffect}" SetBonusEffect: ''' - Magic weapons fire ghostly bolts every 1.67 seconds - Magic critical strikes cause blood explosions every 2 seconds + Magic weapons fire ghostly bolts every {0} seconds + Magic critical strikes cause blood explosions every {1} seconds + {$BloodflareBodyArmor.CommonSetBonus} ''' } BloodflareHeadMelee: { DisplayName: Bloodflare Ram Mask - Tooltip: 10% increased melee damage and 5% increased melee critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.PercentIncreasedMeleeDamage} and {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} + ''' SetBonus: ''' - 18% increased melee speed - Enemies are more likely to target you + {$Common.AggroBoost} {$BloodflareHeadMelee.SetBonusEffect} ''' SetBonusEffect: ''' - After striking an enemy 15 times with true melee you will enter a blood frenzy for 5 seconds - During this you will gain 25% increased melee damage, critical strike chance, and contact damage is halved - This effect has a 30 second cooldown + After striking an enemy {0} times with true melee you will enter a blood frenzy for {1} seconds + During this you will gain {2}% increased melee damage, critical strike chance, and {3}% reduced contact damage + This effect has a {4} second cooldown + {$BloodflareBodyArmor.CommonSetBonus} ''' } BloodflareHeadRanged: { DisplayName: Bloodflare Horned Helm - Tooltip: 10% increased ranged damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamageCritChance}" SetBonus: "{$BloodflareHeadRanged.SetBonusEffect}" SetBonusEffect: ''' {0} to unleash the lost souls of polterghast to destroy your enemies - This effect has a 30 second cooldown - Ranged weapons fire bloodsplosion orbs every 2.5 seconds + This effect has a {1} second cooldown + Ranged weapons fire bloodsplosion orbs every {2} seconds + {$BloodflareBodyArmor.CommonSetBonus} ''' } @@ -235,36 +232,41 @@ BloodflareHeadRogue: { DisplayName: Bloodflare Imp Mask Tooltip: ''' - 10% increased rogue damage and critical strike chance - 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' SetBonus: ''' - +120 maximum stealth - {$BloodflareHeadRogue.SetBonusEffect} + {$Common.RogueStealth} + {$BloodflareHeadRogue.SetBonusEffect@1} ''' SetBonusEffect: ''' - Being over 80% life boosts your defense by 30 and rogue crit by 5% - Being below 80% life boosts your rogue damage by 10% + Grants {0} defense when above {1}% life Rogue critical strikes burst into blood orbs Picking up these blood orbs reduces the duration of [Potion Sickness] + {$BloodflareBodyArmor.CommonSetBonus} ''' } BloodflareHeadSummon: { DisplayName: Bloodflare Wyvern Helm - Tooltip: 5% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - 50% increased summon damage and +3 max minions - {$BloodflareHeadSummon.SetBonusEffect} + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + {$BloodflareHeadSummon.SetBonusEffect@2} ''' SetBonusEffect: ''' Summons polterghast mines to circle you - At 90% life and above you gain 10% increased summon damage - At 50% life and below you gain 20 defense and +1 HP/s life regen + Grants {0} defense when below {1}% life + {$BloodflareBodyArmor.CommonSetBonus} ''' } @@ -272,9 +274,9 @@ DemonshadeBreastplate: { DisplayName: Demonshade Breastplate Tooltip: ''' - 25% increased melee speed, 15% increased damage and critical strike chance - Enemies take ungodly damage when they touch you - Increased max life by 50 and max mana by 200 + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} Standing still absorbs shadows to grant exponentially accelerating life regen ''' } @@ -286,32 +288,33 @@ DemonshadeGreaves: { DemonshadeHelm: { DisplayName: Demonshade Helm - Tooltip: 30% increased damage and 15% increased critical strike chance + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedDamage@1} and {$CommonItemTooltip.PercentIncreasedCritChance@2} + ''' SetBonus: ''' - 100% increased summon damage and +10 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Shadowbeams and demon scythes will fire down when you are hit A friendly red devil follows you around - {0} to enrage nearby enemies with a dark magic spell for 10 seconds - This makes them take {1}x total damage, but they will deal {2}x damage to you + {2} to enrage nearby enemies with a dark magic spell for {3} seconds + This makes them take {4}x total damage, but they will deal {5}x damage to you ''' } EmpyreanCloak: { DisplayName: Empyrean Cloak - Tooltip: - ''' - Armor of the cosmos - 7% increased rogue damage and critical strike chance - ''' + Tooltip: "{$Common.RogueDamage} and {$Common.RogueCrit@1}" } EmpyreanCuisses: { DisplayName: Empyrean Cuisses Tooltip: ''' - 5% increased rogue damage and critical strike chance - 15% increased movement speed + {$Common.RogueDamageCrit} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -319,13 +322,12 @@ EmpyreanMask: { DisplayName: Empyrean Mask Tooltip: ''' - 11% increased rogue damage and critical strike chance - 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$Common.RogueVelocity@2} ''' SetBonus: ''' - 9% increased rogue damage and velocity - +115 maximum stealth + {$Common.RogueStealth} Rogue projectiles have special effects on enemy hits Imbued with cosmic wrath when you are damaged ''' @@ -335,18 +337,16 @@ FearmongerGreathelm: { DisplayName: Fearmonger Greathelm Tooltip: ''' + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedSummonDamage@2} Pure terror radiates from your eyes - +60 max mana and 10% reduced mana usage - 10% increased summon damage ''' SetBonus: ''' - 20% increased summon damage and +2 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} Minions no longer deal less damage while wielding non-summoner weapons Immunity to all but the strongest forms of frost and flame - Minion attacks grant +3.5 HP/s life regen and massively accelerate life regen - 15% increased damage reduction during the Pumpkin and Frost Moons - This extra damage reduction ignores the soft cap + Minion attacks grant +{1} HP/s life regen and massively accelerate life regen ''' } @@ -354,10 +354,8 @@ FearmongerGreaves: { DisplayName: Fearmonger Greaves Tooltip: ''' - 6% increased damage - 50% increased minion knockback - 10% increased movement speed - Taking damage increases your movement speed by 40% for 4 seconds + {$CommonItemTooltip.PercentIncreasedDamage} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -365,8 +363,8 @@ FearmongerPlateMail: { DisplayName: Fearmonger Plate Mail Tooltip: ''' - +100 max life and 8% increased damage reduction - 5% increased damage and critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + +{2} max life and {3}% increased damage reduction ''' } @@ -378,7 +376,7 @@ GemTechBodyArmor: { GemTechHeadgear: { DisplayName: Gem Tech Headgear Tooltip: "'The Devil said: Revel in your victory; You've earned your damning. Pack your things and leave.'" - AbilityBrief: Power Gems - Six gem fragments idly orbit you; one for each class, and a base gem + AbilityBrief: "[c/{0}:Power Gems - Six gem fragments idly orbit you; one for each class, and a base gem]" AbilityDescription: ''' Each active gem provides a bonus for its respective class, while the defensive gem grants defensive boosts @@ -388,18 +386,18 @@ GemTechHeadgear: { ''' GeneralGemInfo: ''' - A gem is lost when you take more than {0} damage in a single hit. + A gem is lost when you take more than {0} damage in a single hit The type of gem lost is the same as the class of the most recently used weapon If said gem has already been lost, the base gem is lost instead When a gem is lost, it breaks off and homes towards the nearest enemy or boss, if one is present, dealing a base of {1} damage Gems have a {2} second delay before they appear again ''' - RedGemInfo: "[i:Ruby] The red gem grants {0} maximum stealth, increased rogue stats, and makes stealth only consumable by rogue weapons" - YellowGemInfo: "[i:Topaz] The yellow gem provides increased melee stats and makes melee attacks release shards on hit with a cooldown. This cooldown is shorter for true melee attacks" - GreenGemInfo: "[i:Emerald] The green gem provides increased ranged stats and causes flechettes to fly swiftly towards targets when they are damaged by a ranged projectile" - BlueGemInfo: "[i:Sapphire] The blue gem grants {0} extra maximum minions, increased summon damage, and negates the summon damage penalty while wielding non-summoner weapons" - PurpleGemInfo: "[i:Amethyst] The violet gem grants {0} extra maximum mana, increased magic stats, and makes mana rapidly regenerate when holding a non-magic weapon" - PinkGemInfo: "[i:Diamond] The pink base gem grants {0} extra defense, extra damage reduction, increased movement speed, jump speed, and +{1} HP/s life regen" + RedGemInfo: "[i:CalamityMod/GemTechRedGem] The red gem grants {0} maximum stealth, increased rogue stats, and makes stealth only consumable by rogue weapons" + YellowGemInfo: "[i:CalamityMod/GemTechYellowGem] The yellow gem provides increased melee stats and makes melee attacks release shards on hit with a cooldown. This cooldown is shorter for true melee attacks" + GreenGemInfo: "[i:CalamityMod/GemTechGreenGem] The green gem provides increased ranged stats and causes flechettes to fly swiftly towards targets when they are damaged by a ranged projectile" + BlueGemInfo: "[i:CalamityMod/GemTechBlueGem] The blue gem grants {0} maximum minions, increased summon damage, and negates the summon damage penalty while wielding non-summoner weapons" + PurpleGemInfo: "[i:CalamityMod/GemTechPurpleGem] The violet gem grants {0} maximum mana, increased magic stats, and makes mana rapidly regenerate when holding a non-magic weapon" + PinkGemInfo: "[i:CalamityMod/GemTechPinkGem] The pink base gem grants {0} defense, increased damage reduction, movement speed, jump speed, and +{1} HP/s life regen" GemBonusInfo: ''' When all gems exist simultaneously, hitting a target with any weapon grants you +{0} HP/s life regen for {1} seconds @@ -414,15 +412,10 @@ GemTechSchynbaulds: { GodSlayerChestplate: { DisplayName: God Slayer Chestplate - Tooltip: - ''' - +50 max life - Enemies take damage when they hit you - 11% increased damage and 8% increased critical strike chance - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - Pressing {0} allows you to dash towards your cursor for 2 seconds + Press {0} to dash towards your cursor for 2 seconds Enemies you dash through take massive damage During the dash you are immune to damage and most debuffs The dash has a {1} second cooldown @@ -433,45 +426,49 @@ GodSlayerHeadMelee: { DisplayName: God Slayer Horned Greathelm Tooltip: ''' - 14% increased melee damage - 7% increased melee critical strike chance + {$CommonItemTooltip.PercentIncreasedMeleeDamage} and {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} ''' SetBonus: ''' - 20% increased melee speed - Enemies are more likely to target you + {$Common.AggroBoost} {$GodSlayerHeadMelee.SetBonusEffect} ''' SetBonusEffect: ''' - Taking over 80 damage in one hit will cause you to release a swarm of high-damage god killer darts - Enemies take a lot of damage when they hit you + Releases a swarm of god killer darts when taking over {0} damage in one hit + {$GodSlayerChestplate.CommonSetBonus@1} ''' } GodSlayerHeadRanged: { DisplayName: God Slayer Helmet - Tooltip: 14% increased ranged damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" SetBonus: "{$GodSlayerHeadRanged.SetBonusEffect}" - SetBonusEffect: You fire a god killer shrapnel round while firing ranged weapons every 2.5 seconds + SetBonusEffect: + ''' + Ranged weapons fire a god killer shrapnel round every {0} seconds + {$GodSlayerChestplate.CommonSetBonus@1} + ''' } GodSlayerHeadRogue: { DisplayName: God Slayer Mask Tooltip: ''' - 14% increased rogue damage and critical strike chance - 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' SetBonus: ''' - +120 maximum stealth - {$GodSlayerHeadRogue.SetBonusEffect} + {$Common.RogueStealth} + {$GodSlayerHeadRogue.SetBonusEffect@1} ''' SetBonusEffect: ''' - While at full HP all of your rogue stats are boosted by 10% - If you take over 80 damage in one hit you will be given extra immunity frames + {0}% increased rogue damage, critical strike chance, and velocity when at full health + Increased length of invincibility when taking over {1} damage in one hit + {$GodSlayerChestplate.CommonSetBonus@2} ''' } @@ -479,8 +476,8 @@ GodSlayerLeggings: { DisplayName: God Slayer Leggings Tooltip: ''' - 10% increased movement speed - 11% increased damage and critical strike chance + {$CommonItemTooltip.PercentIncreasedDamageCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -488,7 +485,7 @@ OmegaBlueChestplate: { DisplayName: Omega Blue Chestplate Tooltip: ''' - 12% increased damage and 8% increased critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} Your attacks inflict Hadopelagic Pressure No positive life regen ''' @@ -498,17 +495,17 @@ OmegaBlueHelmet: { DisplayName: Omega Blue Helmet Tooltip: ''' + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} You can move freely through liquids - 12% increased damage and 8% increased critical strike chance ''' SetBonus: ''' - 10% increased damage and critical strike chance and +2 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} Short-ranged tentacles heal you by sucking enemy life - {0} to activate abyssal madness for 5 seconds - Abyssal madness increases damage and critical strike chance by 10% - It also increases tentacle aggression and range, and allows them to critically strike - This effect has a 25 second cooldown + [c/{1}:Abyssal Madness - {2} to go berserk for {3} seconds] + [c/99ABFF:While active, tentacles attack with greater range and aggression, and always critically strike] + [c/99ABFF:This also grants {$CommonItemTooltip.PercentIncreasedDamageCritChance@4}] + [c/99ABFF:This effect has a {5} second cooldown] ''' } @@ -516,8 +513,8 @@ OmegaBlueTentacles: { DisplayName: Omega Blue Tentacles Tooltip: ''' - 12% increased movement speed - 12% increased damage and critical strike chance + {$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' } @@ -525,9 +522,9 @@ PrismaticGreaves: { DisplayName: Prismatic Greaves Tooltip: ''' - 10% increased magic damage and 12% increased magic crit - 20% decreased non-magic damage - 10% increased flight time and 2% increased jump speed + {$CommonItemTooltip.PercentIncreasedMagicDamage} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@1} + {2}% decreased non-magic damage + {3}% increased flight time and {4}% increased jump speed ''' } @@ -535,17 +532,17 @@ PrismaticHelmet: { DisplayName: Prismatic Helmet Tooltip: ''' - 18% increased magic damage and 12% increased magic crit - 20% decreased non-magic damage + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} + {4}% decreased non-magic damage Enemies with less than 500 max health deal no contact damage This does not occur while a boss is alive ''' SetBonus: ''' - +40 max mana and 15% reduced mana cost Increased mana regeneration rate - {0} to unleash a barrage of death lasers at the cursor for the next 5 seconds - This has a 30 second cooldown + [c/{0}:Prismatic Barrage - {1} to unleash a laser barrage at the cursor for {2} seconds] + [c/67F4FB:This has a {3} second cooldown] ''' } @@ -553,26 +550,21 @@ PrismaticRegalia: { DisplayName: Prismatic Regalia Tooltip: ''' - 12% increased magic damage and 15% increased magic crit - 20% decreased non-magic damage - +40 max mana - Magic attacks occasionally fire a pair of homing rockets + {$CommonItemTooltip.PercentIncreasedMagicDamageCritChance} + {1}% decreased non-magic damage + Magic attacks have a {2}% chance to fire a pair of homing rockets ''' } SilvaArmor: { DisplayName: Silva Armor - Tooltip: - ''' - +50 max life - 11% increased damage and 8% increased critical strike chance - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance@1}" CommonSetBonus: ''' - +3 HP/s life regen - Max run speed and acceleration boosted by 5% - Taking fatal damage will revive you and make you invulnerable to all damage for 5 seconds - This effect has a 5 minute cooldown, which does not decrement if any bosses or events are active + +{0} HP/s life regen + {1}% increased max run speed and acceleration + Taking fatal damage will revive you and make you invulnerable to all damage for {2} seconds + This effect has a {3} minute cooldown, which does not decrement if any bosses or events are active ''' } @@ -580,30 +572,43 @@ SilvaHeadMagic: { DisplayName: Silva Masked Cap Tooltip: ''' - 23% increased magic damage and 13% increased magic critical strike chance - +100 max mana and 19% reduced mana usage + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' SetBonus: "{$SilvaHeadMagic.SetBonusEffect}" - SetBonusEffect: Magic projectiles which cannot pierce will occasionally set off potent blasts of nature energy + SetBonusEffect: + ''' + Magic projectiles which cannot pierce will occasionally set off potent blasts of nature energy + {$SilvaArmor.CommonSetBonus} + ''' } SilvaHeadSummon: { DisplayName: Silva Horned Hood - Tooltip: 10% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - 65% increased summon damage and +5 max minions - {$SilvaHeadSummon.SetBonusEffect} + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + {$SilvaHeadSummon.SetBonusEffect@2} + ''' + SetBonusEffect: + ''' + Summons an ancient leaf prism to blast your enemies with life energy + {$SilvaArmor.CommonSetBonus} ''' - SetBonusEffect: Summons an ancient leaf prism to blast your enemies with life energy } SilvaLeggings: { DisplayName: Silva Leggings Tooltip: ''' - 10% increased movement speed - 11% increased damage and critical strike chance + {$CommonItemTooltip.PercentIncreasedDamageCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -611,8 +616,8 @@ TarragonBreastplate: { DisplayName: Tarragon Breastplate Tooltip: ''' - 10% increased damage and 5% increased critical strike chance - +1.5 HP/s life regen and +40 max life + {0}% increased damage and {1}% increased critical strike chance + +{2} HP/s life regen and {3}% increased damage reduction ''' CommonSetBonus: ''' @@ -625,81 +630,95 @@ TarragonHeadMagic: { DisplayName: Tarragon Mask Tooltip: ''' - 15% increased magic damage and 10% increased magic critical strike chance - 10% increased damage reduction, +100 max mana, and 15% reduced mana usage + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' SetBonus: "{$TarragonHeadMagic.SetBonusEffect}" - SetBonusEffect: On every 5th critical strike you will fire a leaf storm + SetBonusEffect: + ''' + On every 5th critical strike you will fire a leaf storm + {$TarragonBreastplate.CommonSetBonus} + ''' } TarragonHeadMelee: { DisplayName: Tarragon Helm Tooltip: ''' - 12% increased melee damage and 7% increased melee critical strike chance - 10% increased damage reduction + {$CommonItemTooltip.PercentIncreasedMeleeDamage} and {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} + {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} ''' SetBonus: ''' - 15% increased melee speed - Enemies are more likely to target you + {$Common.AggroBoost} {$TarragonHeadMelee.SetBonusEffect} ''' SetBonusEffect: ''' - Taking damage gives the Tarra Life buff, which grants +1.5 HP/s life regen - {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds - This has a 30 second cooldown + Taking damage gives the Tarra Life buff, which grants +{0} HP/s life regen + {1} to cloak yourself in life energy that heavily reduces enemy contact damage for {2} seconds + This has a {3} second cooldown + {$TarragonBreastplate.CommonSetBonus} ''' } TarragonHeadRanged: { DisplayName: Tarragon Visage - Tooltip: - ''' - 10% increased ranged damage and critical strike chance - 10% increased damage reduction - ''' + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage} and {$CommonItemTooltip.PercentIncreasedRangedCritChance@1}" SetBonus: "{$TarragonHeadRanged.SetBonusEffect}" - SetBonusEffect: Ranged projectiles split into homing life energy and leaves on death + SetBonusEffect: + ''' + Ranged projectiles spawn homing life energy and leaves on enemy hits + {$TarragonBreastplate.CommonSetBonus} + ''' } TarragonHeadRogue: { DisplayName: Tarragon Helmet Tooltip: ''' - 10% increased rogue damage and critical strike chance - 10% increased damage reduction and 5% increased movement speed + {$Common.RogueDamage} and {$Common.RogueCrit@1} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' SetBonus: ''' - +115 maximum stealth - {$TarragonHeadRogue.SetBonusEffect} + {$Common.RogueStealth} + {$TarragonHeadRogue.SetBonusEffect@1} ''' SetBonusEffect: ''' - After every 50 rogue critical hits you will gain 2.5 seconds of damage immunity - This effect has a cooldown of 25 seconds - While under the effects of a debuff you gain 10% increased rogue damage + After every {0} rogue critical hits you will gain {1} seconds of damage immunity + This effect has a cooldown of {2} seconds + While under the effects of a debuff you gain {3}% increased rogue damage + {$TarragonBreastplate.CommonSetBonus} ''' } TarragonHeadSummon: { DisplayName: Tarragon Horned Helm - Tooltip: 10% increased damage reduction and 5% increased summon damage + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' SetBonus: ''' - 50% increased summon damage and +3 max minions + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} {$TarragonHeadSummon.SetBonusEffect} ''' - SetBonusEffect: Summons a life aura around you that damages nearby enemies + SetBonusEffect: + ''' + Summons a life aura around you that damages nearby enemies + {$TarragonBreastplate.CommonSetBonus} + ''' } TarragonLeggings: { DisplayName: Tarragon Leggings Tooltip: ''' - 10% increased movement speed - 8% increased damage and critical strike chance + {$CommonItemTooltip.PercentIncreasedDamageCritChance} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index 4cde8ba463..21188dd4b7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -19,6 +19,7 @@ AerospecHeadMagic: { ''' {$CommonItemTooltip.PercentReducedManaCost} {1}% increased movement speed and magic critical strike chance + {$AerospecBreastplate.CommonSetBonus@2} ''' } @@ -29,6 +30,7 @@ AerospecHeadRogue: { ''' {$Common.RogueStealth} {1}% increased movement speed and rogue critical strike chance + {$AerospecBreastplate.CommonSetBonus@2} ''' } @@ -39,6 +41,7 @@ AerospecHeadMelee: { ''' {0}% increased movement speed and melee critical strike chance {$Common.AggroBoost} + {$AerospecBreastplate.CommonSetBonus@1} ''' } @@ -50,13 +53,18 @@ AerospecHeadSummon: { {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a valkyrie to protect you + {$AerospecBreastplate.CommonSetBonus@2} ''' } AerospecHeadRanged: { DisplayName: Aerospec Hood Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage}" - SetBonus: "{0}% increased movement speed and ranged critical strike chance" + SetBonus: + ''' + {0}% increased movement speed and ranged critical strike chance + {$AerospecBreastplate.CommonSetBonus@1} + ''' } AerospecLeggings: { @@ -133,9 +141,8 @@ StatigelArmor: { Tooltip: "{$CommonItemTooltip.PercentIncreasedCritChance}" CommonSetBonus: ''' - When you take over {0} damage in one hit you become immune to damage for an extended period of time Grants an extra jump and increased jump height - {1}% increased jump speed + {0}% increased jump speed ''' } @@ -160,7 +167,11 @@ StatigelHeadMelee: { {0}% increased melee damage and melee speed {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} ''' - SetBonus: "{$Common.AggroBoost}" + SetBonus: + ''' + {$Common.AggroBoost} + {$StatigelArmor.CommonSetBonus} + ''' } StatigelHeadRanged: { @@ -179,17 +190,25 @@ StatigelHeadRogue: { {$Common.RogueDamage} {$Common.RogueCrit@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' - SetBonus: "{$Common.RogueStealth}" + SetBonus: + ''' + {$Common.RogueStealth} + {$StatigelArmor.CommonSetBonus@1} + ''' } StatigelHeadSummon: { DisplayName: Statigel Hood - Tooltip: Increased minion knockback - SetBonus: + Tooltip: ''' {$CommonItemTooltip.IncreasesMaxMinionsBy} {$CommonItemTooltip.PercentIncreasedSummonDamage@1} + ''' + SetBonus: + ''' + {$CommonItemTooltip.PercentIncreasedSummonDamage} Summons a mini paladin to fight for you, the type depends on what world evil you have + {$StatigelArmor.CommonSetBonus@1} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 12a943c834..c3a3783cdf 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -3948,6 +3948,11 @@ PolypSand: { Tooltip: "" } +TableCoralLeft: { + DisplayName: Table Coral + Tooltip: "" +} + VolcanicSand: { DisplayName: Volcanic Sand Tooltip: "" @@ -4643,3 +4648,8 @@ ShellTrimBrickWall: { DisplayName: Shell Trim Brick Wall Tooltip: "" } + +BasaltSlab: { + DisplayName: Basalt Slab + Tooltip: "" +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index dc71997ddd..3b2b45c9a7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -41,11 +41,7 @@ BloodyWormFood: { CausticTear: { DisplayName: Caustic Tear - Tooltip: - ''' - Causes an acidic downpour in the Sulphurous Sea - {$Common.NotConsumable} - ''' + Tooltip: Causes an acidic downpour in the Sulphurous Sea } CeremonialUrn: { @@ -188,11 +184,7 @@ MarkofProvidence: { MartianDistressRemote: { DisplayName: Martian Distress Remote - Tooltip: - ''' - Summons the Martian Madness - {$Common.NotConsumable} - ''' + Tooltip: Summons the Martian Madness } NecroplasmicBeacon: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 1083e38f93..c558c21085 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -52,6 +52,17 @@ AxeofPurity: { ''' } +Bakidon: { + DisplayName: Bakidon + Tooltip: + ''' + A lost artifact said to pin the heavens in place + to freeze the passage of day and night temporarily + This does not work during celestial anomalies + The time freeze recharges while not in use + ''' +} + BeastialPickaxe: { DisplayName: Beastial Pickaxe Tooltip: "" @@ -80,8 +91,10 @@ Cosmolight: { DisplayName: Cosmolight Tooltip: ''' - Advances time immediately to the next dawn, noon, dusk or midnight - Does not work while a boss is alive + A lost artifact freshly rekindled by exposure to raw cosmic energies + Hold to drastically accelerate the passage of day and night + to freeze the passage of day and night indefinitely + The time freeze lasts forever and works during celestial anomalies ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index a1ee116328..d0cbc0922e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -10,6 +10,19 @@ AerialTracker: { ''' } +AqueousHunterDrone: { + DisplayName: P-PMA: Aqueous Hunter Drone + Tooltip: + ''' + Summons a shrimp drone that fires bursts of homing plasma missiles + while holding any summon weapon to command the shrimp to launch a vertical missile barrage + Vertical missiles aim towards your cursor and leave a lingering blast if they hit solid ground + Each shrimp uses 4 minion slots + [c/1FBFF:'When pursuing the adherents of Gods, Yharim believed no stone should be left unturned.] + [c/1FBFF:Weaponry for underwater contingencies was an unusually heavy focus, but no models ever saw deployment.'] + ''' +} + Auger: { DisplayName: P-GSS: Auger Tooltip: @@ -223,16 +236,6 @@ SnakeEyes: { ''' } -StarSwallowerContainmentUnit: { - DisplayName: Star Swallower Containment Unit - Tooltip: - ''' - Summons a biomechanical frog that vomits plasma onto enemies - [c/1FFBFF:'These simplistic creatures were mechanized to autonomously transport plasma.] - [c/1FFBFF:They are vastly more servicable than their mundane organic counterparts.'] - ''' -} - SystemBane: { DisplayName: System Bane Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 021008f3c8..2d767078ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -676,6 +676,17 @@ LunarianBow: { ''' } +M1Garand: { + DisplayName: M1 Garand + Tooltip: + ''' + Shots fired only inherit the damage of the bullet used + Fires 8 bullets before ejecting the rifle's cartridge + Bullets which ricochet off coins can ricochet off cartridges too + 'Mind your thumb' + ''' +} + MagnaCannon: { DisplayName: Magna Cannon Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 4fe952f5bc..ba1421818e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -407,7 +407,7 @@ Exorcism: { ''' Throws a gigantic hallowed cross to the heavens, which will fall at your cursor a moment later Enemies hit as it falls are impaled and repeatedly seared with holy light - Upon experation a cross shaped explosion is created + Upon expiration a cross shaped explosion is created Stealth strikes twirl and throw the cross, ending in a stronger explosion at your cursor ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 6ca2aa511e..9e19bfe3cc 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -118,8 +118,6 @@ SwineSecret37: Let me know when it's 7 PM, I've got to tweak something before so SwineSecret38: Thank Xeroc I don't have any of that 'Pathfinding' garbage, whatever the hell that is. SwineSecret39: If you think the Sulphur Sea smells bad, just wait til' you're near a nohitter! SwineSecret40: Did you know there's 40 of these damn things? -// Point Blank -PointBlank: Does extra damage to enemies shot at point-blank range // Charge Charge: Current Charge: {0}% //GFB Rogue Keys diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 235098e2e1..c5cc51f0a4 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -306,6 +306,6 @@ MirrorBladeProjectile.DisplayName: Mirror Blade MirrorBladeSlash.DisplayName: Mirror Blade Slash MirrorBladeSlashCreator.DisplayName: Mirror Blade Slash Creator GildedProboscisProj.DisplayName: Gilded Proboscis -LucreciaProj.DisplayName: Lucrecia Proj -LucreciaDoubleHelix.DisplayName: Lucrecia Double Helix -LucreciaSmallProjectile.DisplayName: Lucrecia Small Projectile +LucreciaProj.DisplayName: Lucrecia +LucreciaDoubleHelix.DisplayName: Lucrecia Helix Comet +LucreciaSmallProjectile.DisplayName: Lucrecia diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index 9dc5d84ee5..0863e6de92 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -8,6 +8,7 @@ AnomalysNanogunHoldout.DisplayName: The Anomaly's Nanogun AnomalysNanogunMPFBBoom.DisplayName: MPFB Explosion AnomalysNanogunMPFBDevastator.DisplayName: MPFB Devastator AnomalysNanogunPlasmaBeam.DisplayName: Plasma Beam +AqueousHunterDroneSummon.DisplayName: Plasma Shrimp AugerHoldout.DisplayName: P-GSS Auger AugerSlash.DisplayName: Auger Slash AugerPull.DisplayName: Auger Pull @@ -40,6 +41,7 @@ PulseRifleShot.DisplayName: Pulse Bolt PulseTurret.DisplayName: Pulse Turret PulseTurretShot.DisplayName: Pulse Bolt ShortCircuitHook.DisplayName: Short Circuit Hook +ShrimpPlasmaMissile.DisplayName: Plasma Shrimp Missile SnakeEyesSummon.DisplayName: Snake Eyes SnakeEyesProjectile.DisplayName: Inescapable Bolt StarSwallowerAcid.DisplayName: Acid diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index c6be216f3d..e7a674c92d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -262,3 +262,5 @@ LeviatitanMeteor.DisplayName: Leviatitan Meteor LeviatitanExplosion.DisplayName: Leviatitan Explosion SulphuricDrop.DisplayName: Sulphuric Drop AcidRocket.DisplayName: Acid Rocket +M1GarandBulletCasing.DisplayName: M1 Garand Bullet Casing +M1GarandEmptyClip.DisplayName: M1 Garand Empty Clip diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index b9a0d86656..fe21625893 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -31,7 +31,6 @@ BossRushEndEffectThing.DisplayName: Boss Rush End Effect Thing BossRushFailureEffectThing.DisplayName: Boss Rush Failure Effect Thing BossRushTierAnimation.DisplayName: Boss Rush Tier Animation ChaoticGeyser.DisplayName: Chaotic Geyser -ChlorophyteLifePulse.DisplayName: Life Pulse ChronoClock.DisplayName: Chrono Clock ClaretCannonProj.DisplayName: Claret Round CoralBubble.DisplayName: Bubble @@ -110,7 +109,6 @@ ProtolithBangleProjectile.DisplayName: Marble Shatter PscTransformAnimation.DisplayName: Psc Transform Animation PscTransformRocks.DisplayName: Psc Transform Rocks PuddleSplash.DisplayName: Puddle Splash -ReaverOrb.DisplayName: Reaver Orb ReaverThornBase.DisplayName: Thorn RedLabSeeker.DisplayName: Seeking Mechanism RelicGuard.DisplayName: Relic Guard diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 503f870d8e..42c737aff9 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -120,6 +120,7 @@ Cooldowns: { LifeSteal: Life Steal Cooldown LionHeartShield: Energy Shell Cooldown LucreciaEnergy: Lucrecia Energy + M1GarandShots: Chambered Rounds MasterChefShieldDurability: MJOLNIR Shield Level MasterChefShieldRecharge: MJOLNIR Shield Recharge NebulousCore: Nebulous Core Cooldown @@ -531,7 +532,7 @@ Exhumed: { Indignant: { DisplayName: Indignant - Description: Summons demons that harm you but drop healing items on death on item usage. + Description: Summons demons that harm you but drop healing orbs on death on item usage. } Aflame: { diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 30f140caee..3ea54b5b73 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -10,15 +10,6 @@ SetBonus: { Melee: 15% increased melee speed and 20% increased movement speed } - Chlorophyte: - ''' - Summons a powerful leaf crystal to shoot pulses of life every {0} seconds - The pulses do a base damage of {1} to enemies within its range - The pulses also provide a {2} health boost to you and all players on your team - Players healed by pulses cannot be healed by another pulse until {3} seconds have passed - Both the health boost and the damage scale based on your strongest class - ''' - Cobalt: { $parentVal: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index e5377d757e..eea5f703ae 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -28,7 +28,6 @@ AddedTooltip: { This grants +1.5 HP/s life regen and accelerates natural life regen Life drain stacks based on the number of enemies being hit ''' - WarmthPotion: Greatly reduces the duration of Chilled and Frozen HandWarmer: Provides a regeneration boost while wearing the Snow armor GoldenFishingRod: Its fishing line will never break // Step Stool @@ -50,9 +49,6 @@ AddedTooltip: { Nearby fairies grant +2 HP/s life regen, 6 defense and 10% movement speed Fairies are immune to damage and will no longer flee ''' - MoonStone: Reduces the damage of the Nightwither debuff - SunStone: Reduces the damage of the Daybroken debuff - CelestialStone: Reduces the damage of the Nightwither and Daybroken debuffs ArcaneFlower: 5% increased magic damage RifleScope: The scope effect can be toggled with visibility FeatherfallPotion: Disables all airborne flight recovery @@ -183,8 +179,6 @@ EditedTooltip: { 14% increased melee damage 14% increased melee speed, does not stack with downgrades ''' - ObsidianSkullLine: Grants immunity to the Burning and On Fire! debuffs - LavaWaders: Grants immunity to the Burning and On Fire! debuffs, and 7 seconds of immunity to lava Gi: 10% increased movement and jump speed GoldPickaxe: Can mine Demonite, Crimtane, Meteorite, Sea Prisms, and Sea Prism Crystals FlaskofCursedFlames: Melee, Whip, and Rogue attacks inflict enemies with cursed flames @@ -258,9 +252,7 @@ BuffDescription: { Banner: You have increased damage and defense against the following: BeetleMight: Melee damage and speed increase by {0}% and {1}% respectively ChaosState: Rod of Discord teleports are disabled - LeafCrystal: Emits powerful life pulses at nearby enemies Rabies: Decreased life regen, Causes status effects - WarmthExtra: Reduced durations of Chilled and Frozen WeaponImbueConfetti: All attacks cause confetti to appear WeaponImbueCursedFlames: Melee, Whip, and Rogue attacks inflict enemies with cursed flames WeaponImbueFire: Melee, Whip, and Rogue attacks set enemies on fire diff --git a/MainMenu/CalamityMainMenu_Sunken.cs b/MainMenu/CalamityMainMenu_Sunken.cs index 9df3a95724..1883b6b6c7 100644 --- a/MainMenu/CalamityMainMenu_Sunken.cs +++ b/MainMenu/CalamityMainMenu_Sunken.cs @@ -110,14 +110,17 @@ namespace CalamityMod.MainMenu { base.SetStaticDefaults(); - LogoWaterFill.Wait(); - Logo.Wait(); - - Main.QueueMainThreadAction(() => + if (!Main.dedServ) { - logoWaterFillTarget = new RenderTarget2D(Main.instance.GraphicsDevice, LogoWaterFill.Width(), LogoWaterFill.Height()); - logoTarget = new RenderTarget2D(Main.instance.GraphicsDevice, Logo.Width(), Logo.Height()); - }); + LogoWaterFill.Wait(); + Logo.Wait(); + + Main.QueueMainThreadAction(() => + { + logoWaterFillTarget = new RenderTarget2D(Main.instance.GraphicsDevice, LogoWaterFill.Width(), LogoWaterFill.Height()); + logoTarget = new RenderTarget2D(Main.instance.GraphicsDevice, Logo.Width(), Logo.Height()); + }); + } } public static void ForceMenuStyle() diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index e83b214326..9d2985bac3 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -866,46 +866,6 @@ namespace CalamityMod public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; #endregion - #region Can Fire Point Blank Shots - /// - /// Gets whether the given item can fire point blank shots. - /// - /// The item which is being checked. - /// Whether the item can fire point blank shots. - public static bool CanFirePointBlank(Item it) - { - if (it is null || it.Calamity() is null) - return false; - CalamityGlobalItem cgi = it.Calamity(); - return cgi.canFirePointBlankShots; - } - - /// - /// Sets whether the given item can fire point blank shots. - /// - /// The item whose point blank capabilities is being toggled. - /// The value to apply. - /// Whether the item can fire point blank shots. - public static bool SetFirePointBlank(Item it, bool enabled) - { - if (it is null || it.Calamity() is null) - return false; - CalamityGlobalItem cgi = it.Calamity(); - cgi.canFirePointBlankShots = enabled; - return cgi.canFirePointBlankShots; - } - - // Set a projectile's point blank duration - public static void SetPointBlankDuration(Projectile projectile, int duration) - { - if (projectile != null) - projectile.Calamity().pointBlankShotDuration = duration; - } - - // Gets a projectile's current point blank duration - public static int GetPointBlankDuration(Projectile projectile) => projectile?.Calamity()?.pointBlankShotDuration ?? 0; - #endregion - #region Amalgam Potion Buff List public static bool SetAmalgamBuffList(int type, bool shouldBeListed) { @@ -1891,55 +1851,6 @@ namespace CalamityMod return GetShouldCloseBossHealthBar(castNPC(args[1])); } - case "CanFirePointBlank": - case "CanFirePointBlankShots": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify an Item object (or int index of an Item in the Main.item array)."); ; - if (!isValidItemArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"CanFirePointBlank\" must be an Item or an int."); - return CanFirePointBlank(castItem(args[1])); - - case "SetFirePointBlank": - case "SetFirePointBlankShots": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both an Item object (or int index of an Item in the Main.item array) and a bool."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify whether the item can fire point blank as a bool."); - if (!(args[2] is bool firePointBlank)) - return new ArgumentException("ERROR: The second argument to \"SetFirePointBlank\" must be a bool."); - if (!isValidItemArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"SetFirePointBlank\" must be an Item or an int."); - return SetFirePointBlank(castItem(args[1]), firePointBlank); - - - case "GetPointBlankDuration": - case "GetProjectilePointBlank": - case "GetProjectilePointBlankDuration": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify a Projectile."); - if (!isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"GetPointBlankDuration\" must be a Projectile."); - return GetPointBlankDuration(castProjectile(args[1])); - } - - case "SetPointBlankDuration": - case "SetProjectilePointBlank": - case "SetProjectilePointBlankDuration": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both a Projectile and point blank duration as an int."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify the point blank duration as an int."); - if (!(args[2] is int pbDuration)) - return new ArgumentException("ERROR: The second argument to \"SetPointBlankDuration\" must be an int."); - if (!isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"SetPointBlankDuration\" must be a Projectile."); - - SetPointBlankDuration(castProjectile(args[1]), pbDuration); - return null; - } - case "NoDodges": case "DodgesDisabled": case "GetDodgesDisabled": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 51133250cd..b8550398d8 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1167,7 +1167,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 7aa490d3a3..b9f91cbcc0 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -42,8 +42,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -60,7 +58,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -99,7 +97,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -259,7 +257,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -277,7 +275,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index f67f835fed..2bcd18a1d5 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -40,8 +40,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -58,7 +56,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -97,7 +95,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -228,7 +226,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -246,7 +244,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index b5d285e677..f7277274af 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -54,12 +54,12 @@ namespace CalamityMod.NPCs.AquaticScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } - public static int MistDamage = 25; // 100 - public static int CloudDamage = 28; // 112; applies to both Sand and Toxic + public static int MistDamage = 23; // 92 + public static int CloudDamage = 26; // 104; applies to both Sand and Toxic public override void SetDefaults() { - NPC.damage = 90; // 180 + NPC.damage = 85; // 170 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 90; NPC.height = 90; @@ -68,8 +68,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.aiStyle = -1; AIType = -1; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(gold: 12); NPC.behindTiles = true; @@ -87,7 +85,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -141,7 +139,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -410,7 +408,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.alpha = 0; Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -443,7 +441,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeAcceleration *= accelerationMultiplier; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { scourgeMaxSpeed *= 1.15f; scourgeAcceleration *= 1.15f; @@ -645,7 +643,7 @@ namespace CalamityMod.NPCs.AquaticScourge if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { if (!NPC.AnyNPCs(ModContent.NPCType())) - return (CalamityWorld.LegendaryMode ? 0.05f : 0.01f); + return Main.zenithWorld ? 0.1f : 0.01f; } return 0f; diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 1a2c8de69e..75935256b7 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -37,8 +37,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -55,7 +53,7 @@ namespace CalamityMod.NPCs.AquaticScourge else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -94,7 +92,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Adjust hostility and stats bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld) { if (nonHostile) { @@ -225,7 +223,7 @@ namespace CalamityMod.NPCs.AquaticScourge } Vector2 scourgePosition = NPC.Center; - Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; float scourgeTargetX = player.Center.X + predictionVector.X; float scourgeTargetY = player.Center.Y + predictionVector.Y; @@ -243,7 +241,7 @@ namespace CalamityMod.NPCs.AquaticScourge scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) scourgeMaxSpeed *= 1.15f; } diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 3f4c651ee5..c3d38bd18d 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -40,7 +40,6 @@ namespace CalamityMod.NPCs.Astral NPC.width = 60; NPC.height = 50; NPC.aiStyle = NPCAIStyleID.Bat; //bats - NPC.npcSlots = 0.5f; //needed? NPC.damage = 55; NPC.defense = 26; NPC.knockBackResist = 0.65f; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 84f9759b5c..f28d818989 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.AstrumAureus } } - public static int LaserDamage = 24; // 96 + public static int LaserDamage = 25; // 100 public static int CrystalDamage = 30; // 120 public override void SetDefaults() @@ -113,10 +113,10 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (CalamityWorld.LegendaryMode) - NPC.scale *= 0.8f; + if (Main.getGoodWorld) + NPC.scale = 0.7f; if (Main.zenithWorld) - NPC.scale *= 1.5f; + NPC.scale = 1.5f; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -199,14 +199,12 @@ namespace CalamityMod.NPCs.AstrumAureus if (expertMode) astralFlameBarrageTimerIncrement += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio)); - float walkingVelocity = CalamityWorld.MaliceMode ? 6f : 5f; - if (phase5) - walkingVelocity += 2f; + float walkingVelocity = phase5 ? 7f : 5f; if (expertMode) walkingVelocity += 1.5f * (1f - lifeRatio); if (revenge) walkingVelocity += Math.Abs(NPC.Center.X - player.Center.X) * 0.0025f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) walkingVelocity *= 1.15f; float walkingProjectileVelocity = walkingVelocity * 0.8f; @@ -632,10 +630,10 @@ namespace CalamityMod.NPCs.AstrumAureus calamityGlobalNPC.newAI[1] = speedMultLimit; } - float velocity = CalamityWorld.MaliceMode ? 27f : 20f; + float velocity = 20f; if (expertMode) velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.15f; NPC.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - NPC.Center).SafeNormalize(Vector2.Zero) * velocity; @@ -761,7 +759,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserVelocity = CalamityWorld.MaliceMode ? 7f : death ? 6f : 5f; + float laserVelocity = Main.getGoodWorld ? 7f : death ? 6f : 5f; int maxProjectiles = !phase3 ? (death ? 11 : 9) : (death ? 15 : 13); int spread = !phase3 ? (death ? 18 : 16) : (death ? 22 : 20); @@ -812,7 +810,7 @@ namespace CalamityMod.NPCs.AstrumAureus float fallSpeed = 1.2f; if (expertMode) fallSpeed += death ? 0.36f * (1f - lifeRatio) : 0.24f * (1f - lifeRatio); - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) fallSpeed += 0.5f; if (calamityGlobalNPC.newAI[1] > 0f) @@ -837,7 +835,7 @@ namespace CalamityMod.NPCs.AstrumAureus float velocityXCap = 12f; if (expertMode) velocityXCap += death ? 3.6f * (1f - lifeRatio) : 2.4f * (1f - lifeRatio); - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) velocityXCap += 5f; if (calamityGlobalNPC.newAI[0] > 0f) @@ -1050,7 +1048,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (calamityGlobalNPC.newAI[1] > 0f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[1] + 1f; - if (CalamityWorld.LegendaryMode && !reduceFallSpeed) + if (Main.getGoodWorld && !reduceFallSpeed) { gravity *= 1.15f; maxFallSpeed *= 1.15f; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index c0d00b5ab8..9d20520ac4 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 55; // 110 + NPC.damage = 60; // 120 NPC.aiStyle = -1; AIType = -1; NPC.width = 90; @@ -308,10 +308,10 @@ namespace CalamityMod.NPCs.AstrumAureus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.LegendaryMode ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); + int totalProjectiles = 3 + (int)((NPC.scale - 1f) * 3); double radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity = CalamityWorld.LegendaryMode ? 10f : 6f; + float velocity = 6f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 81a730c44c..1a017ad86a 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; @@ -434,7 +434,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Need segment amount to get a smooth transition down the worm based on length int segmentAmt = Main.zenithWorld ? (CalamityWorld.death ? 8 : CalamityWorld.revenge ? 7 : Main.expertMode ? 6 : 5) : (CalamityWorld.death ? 40 : CalamityWorld.revenge ? 35 : Main.expertMode ? 30 : 25); - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; float transitionStart = MathHelper.Lerp(cyanThreshold * 0.75f, cyanThreshold * 0.95f, 1f - (NPC.ai[3] / (float)segmentAmt)); float transitionEnd = MathHelper.Lerp(cyanThreshold * 0.8f, cyanThreshold, 1f - (NPC.ai[3] / (float)segmentAmt)); bool drawCyan = NPC.Calamity().newAI[3] >= transitionEnd && NPC.Calamity().newAI[3] <= cyanThreshold + transitionEnd; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 04ca13ca77..728439106b 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -222,7 +222,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; @@ -330,7 +330,7 @@ namespace CalamityMod.NPCs.AstrumDeus int startIndexHeadTwo = startIndexHeadOne + phase2Length + 1; int headTwoID = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPC.type, startIndexHeadTwo); Main.npc[headTwoID].Calamity().newAI[0] = 2f; - Main.npc[headTwoID].Calamity().newAI[3] = CalamityWorld.LegendaryMode ? 300f : 600f; + Main.npc[headTwoID].Calamity().newAI[3] = Main.getGoodWorld ? 300f : 600f; Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; Main.npc[headTwoID].timeLeft *= 20; Main.npc[headTwoID].ForceNetUpdate(); @@ -571,7 +571,7 @@ namespace CalamityMod.NPCs.AstrumDeus speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.15f; turnSpeed *= 1.15f; @@ -794,7 +794,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; // Head is always the last segment to visually transition float transitionStart = cyanThreshold * 0.95f; bool drawCyan = NPC.Calamity().newAI[3] >= cyanThreshold; diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index db2efb9c1b..d231d34b8d 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.AstrumDeus calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; // Flight timer - float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Become gradually more pissed as more worms are killed int gfbMaxWormCount = 10; int gfbWormCount = 0; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); if (gfbWormCount > gfbMaxWormCount) gfbWormCount = gfbMaxWormCount; @@ -304,7 +304,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; + float cyanThreshold = Main.getGoodWorld ? 300f : 600f; // Tail is always the first segment to visually transition float transitionStart = cyanThreshold * 0.75f; float transitionEnd = cyanThreshold * 0.8f; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 96cf8f7d05..306bc4ec15 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -67,14 +67,14 @@ namespace CalamityMod.NPCs.BrimstoneElemental // These values are all applied alongside their respective GFB attacks (too many to list) public static int DartDamage = 19; // 76 - public static int HellblastDamage = 22; // 88 - public static int HellfireballDamage = 22; // 88 + public static int HellblastDamage = 24; // 96 + public static int HellfireballDamage = 24; // 96 public static int RayDamage = 35; // 140 public override void SetDefaults() { NPC.npcSlots = 64f; - NPC.damage = 52; // 104 + NPC.damage = 56; // 112 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 100; NPC.height = 150; @@ -460,7 +460,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.chaseable = true; NPC.ai[3] += 1f; NPC.alpha = 0; - if (NPC.ai[3] >= 2f || phase2 || CalamityWorld.LegendaryMode) + if (NPC.ai[3] >= 2f || phase2 || Main.getGoodWorld) { NPC.ai[0] = -1f; NPC.ai[1] = 0f; @@ -510,8 +510,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental { int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 5f, projectileVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); Main.projectile[proj].timeLeft = 240; - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; } if (NPC.ai[1] % divisor2 == divisor2 - 1f) @@ -531,7 +529,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; int numProj = death ? 8 : 4; int spread = death ? 90 : 45; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { numProj *= 3; spread *= 2; @@ -544,9 +542,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj2].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } } } @@ -570,7 +566,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.chaseable = false; NPC.localAI[0] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.localAI[0] += 2f; if (expertMode) NPC.localAI[0] += 1f - lifeRatio; @@ -608,8 +604,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 300; Main.projectile[proj].tileCollide = false; - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; } } @@ -637,9 +631,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } if (death) @@ -648,9 +640,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.MaliceMode) - Main.projectile[proj].extraUpdates += 1; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); } } } @@ -738,7 +728,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental int damage = RayDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -779,7 +769,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); if (Main.zenithWorld) @@ -801,7 +791,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental if (Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, NPC.localAI[0], NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, -NPC.localAI[0], -NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); if (Main.zenithWorld) diff --git a/NPCs/Bumblebirb/DraconicSwarmer.cs b/NPCs/Bumblebirb/DraconicSwarmer.cs index 043af182c8..86b4ac4ff2 100644 --- a/NPCs/Bumblebirb/DraconicSwarmer.cs +++ b/NPCs/Bumblebirb/DraconicSwarmer.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Bumblebirb public override void SetDefaults() { - NPC.damage = 100; // 200 + NPC.damage = 96; // 192 NPC.npcSlots = 1f; NPC.aiStyle = -1; AIType = -1; @@ -123,8 +123,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) NPC.velocity *= 0.95f; @@ -171,8 +169,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -199,8 +195,6 @@ namespace CalamityMod.NPCs.Bumblebirb swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; @@ -216,9 +210,6 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; - if (NPC.velocity.X < 0f) NPC.direction = -1; else diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs index 656bbb41ee..7a0926637d 100644 --- a/NPCs/Bumblebirb/Dragonfolly.cs +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -60,13 +60,14 @@ namespace CalamityMod.NPCs.Bumblebirb public override string Texture => "CalamityMod/NPCs/Bumblebirb/Birb"; public override string BossHeadTexture => "CalamityMod/NPCs/Bumblebirb/Birb_Head_Boss"; - public static int FeatherDamage = 42; // 168 - public static int LightningDamage = 65; // 260 + public static float DashDamageMult = 1.5f; // 240 + public static int FeatherDamage = 36; // 144 + public static int LightningDamage = 64; // 256 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 120; // 240 + NPC.damage = 80; // 160 NPC.npcSlots = 32f; NPC.aiStyle = -1; AIType = -1; @@ -80,7 +81,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.noTileCollide = true; NPC.lavaImmune = true; NPC.noGravity = true; - NPC.value = Item.buyPrice(platinum: 1); + NPC.value = Item.buyPrice(gold: 50); NPC.HitSound = SoundID.NPCHit51; NPC.DeathSound = SoundID.NPCDeath46; NPC.Calamity().VulnerableToHeat = true; @@ -173,7 +174,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (NPC.localAI[2] > 0f) enrageScale += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrageScale += 0.5f; if (enrageScale > 3f) @@ -228,8 +229,6 @@ namespace CalamityMod.NPCs.Bumblebirb calamityGlobalNPC.DR = phaseSwitchPhase || NPC.ai[0] == 5f || enrageScale == 3f ? 0.55f : 0.1f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || NPC.ai[0] == 5f || enrageScale == 3f; - int reducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); - if (phaseSwitchPhase) { // Avoid cheap bullshit @@ -337,7 +336,7 @@ namespace CalamityMod.NPCs.Bumblebirb } // Max spawn amount - int maxBirbs = CalamityWorld.MaliceMode ? 12 : revenge ? 3 : 2; + int maxBirbs = Main.zenithWorld ? 12 : revenge ? 3 : 2; // Variable for charging float chargeDistance = 600f; @@ -466,7 +465,7 @@ namespace CalamityMod.NPCs.Bumblebirb bool spawnRight = player.velocity.X > 0f; for (int i = 0; i < totalProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) { @@ -533,13 +532,13 @@ namespace CalamityMod.NPCs.Bumblebirb { int totalProjectiles = phase2 ? 40 : 48; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; int distance = phase2 ? 1200 : 1320; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) distance *= 2; bool spawnRight = player.velocity.X > 0f; @@ -618,8 +617,7 @@ namespace CalamityMod.NPCs.Bumblebirb // Fly towards target quickly else if (NPC.ai[0] == 2f) { - // Set reduced damage - NPC.damage = reducedSetDamage; + NPC.damage = NPC.defDamage; if (NPC.target < 0 || !player.active || player.dead) { @@ -648,7 +646,7 @@ namespace CalamityMod.NPCs.Bumblebirb float velocity = 8f + (enrageScale - 1f) * 2f; float follyQuickFlySpeed = velocity + NPC.ai[2] + follyQuickFlyTargetDirection.Length() / 120f; - if (CalamityWorld.MaliceMode) + if (Main.getGoodWorld) follyQuickFlySpeed *= 2f; float follyQuickFlyVelMult = 20f; @@ -657,7 +655,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.velocity = (NPC.velocity * (follyQuickFlyVelMult - 1f) + follyQuickFlyTargetDirection) / follyQuickFlyVelMult; NPC.ai[1] += 1f; - if (NPC.ai[1] >= (CalamityWorld.MaliceMode ? 90f : 180f)) + if (NPC.ai[1] >= (Main.getGoodWorld ? 90f : 180f)) { NPC.TargetClosest(); NPC.ai[0] = 0f; @@ -735,8 +733,7 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.ai[1] += 1f; if (NPC.ai[1] > 10f) { - // Set damage - NPC.damage = NPC.defDamage; + NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); NPC.velocity = follyChargePrepareTargetDirection; @@ -756,8 +753,7 @@ namespace CalamityMod.NPCs.Bumblebirb // Charge else if (NPC.ai[0] == 3.2f) { - // Set damage - NPC.damage = NPC.defDamage; + NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); NPC.ai[2] += 0.0333333351f; float velocity = 28f + (enrageScale - 1f) * 4f; @@ -855,7 +851,7 @@ namespace CalamityMod.NPCs.Bumblebirb if (Main.netMode != NetmodeID.MultiplayerClient) { - bool gfbSpawnFlag = CalamityWorld.MaliceMode && (NPC.ai[1] == 145f || NPC.ai[1] == 150f || NPC.ai[1] == 160f || NPC.ai[1] == 165f); + bool gfbSpawnFlag = Main.zenithWorld && (NPC.ai[1] == 145f || NPC.ai[1] == 150f || NPC.ai[1] == 160f || NPC.ai[1] == 165f); bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (NPC.ai[1] == 140f || (revenge && NPC.ai[1] == 155f) || NPC.ai[1] == 170f || gfbSpawnFlag); if (spawnFlag) { @@ -1247,7 +1243,6 @@ namespace CalamityMod.NPCs.Bumblebirb ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); - normalOnly.Add(ModContent.ItemType(), 10); // Materials normalOnly.Add(ModContent.ItemType(), 1, 25, 30); diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index e2fde8abe5..499a2bcb04 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.CalClone public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 60; // 120 + NPC.damage = 70; // 140 NPC.npcSlots = 14f; NPC.width = 120; NPC.height = 120; @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 2f; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.CalClone SoundEngine.PlaySound(SoundID.Item109, NPC.Center); calamityGlobalNPC.newAI[2] = 1f; - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) calamityGlobalNPC.newAI[3] = 0f; SpawnDust(); @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.CalClone baseVelocity += 1.5f * (1f - lifeRatio); baseAcceleration += 0.03f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { baseVelocity *= 1.15f; baseAcceleration *= 1.15f; @@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.zenithWorld) type = ModContent.ProjectileType(); - float gigaBlastFrequency = CalamityWorld.LegendaryMode ? 120f : expertMode ? 180f : 240f; + float gigaBlastFrequency = Main.getGoodWorld ? 120f : expertMode ? 180f : 240f; float projSpeed = 5f; if (calamityGlobalNPC.newAI[3] <= 300f) { @@ -585,7 +585,7 @@ namespace CalamityMod.NPCs.CalClone return; } - else if (CalamityWorld.MaliceMode) + else if (Main.zenithWorld) { if (calamityGlobalNPC.newAI[3] < 900f) calamityGlobalNPC.newAI[3] += 1f; @@ -667,8 +667,7 @@ namespace CalamityMod.NPCs.CalClone float projectileVelocity = expertMode ? 14f : 12.5f; int type = ModContent.ProjectileType(); - bool shootPredictiveShot = CalamityWorld.MaliceMode && Main.rand.NextBool(); - Vector2 predictionVector = shootPredictiveShot ? player.velocity * 20f : Vector2.Zero; + Vector2 predictionVector = Main.getGoodWorld ? player.velocity * 20f : Vector2.Zero; Vector2 fireballVelocity = Vector2.Normalize(player.Center + predictionVector - NPC.Center) * projectileVelocity; Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); @@ -773,7 +772,7 @@ namespace CalamityMod.NPCs.CalClone if (Main.netMode != NetmodeID.MultiplayerClient && death && phase3 && NPC.ai[2] % (phase4 ? 6f : 10f) == 0f) { int type = ModContent.ProjectileType(); - Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; + Vector2 fireballVelocity = Main.getGoodWorld ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, HellblastDamage, 0f, Main.myPlayer, 1f, 0f); } } @@ -895,7 +894,7 @@ namespace CalamityMod.NPCs.CalClone // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(ModContent.ItemType(), 10); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index b4dec050ba..b8338510e8 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.CalClone { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 45; // 90 + NPC.damage = 54; // 108 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -221,7 +221,7 @@ namespace CalamityMod.NPCs.CalClone float calCloneBroProjAttackMaxSpeed = 5f; float calCloneBroProjAttackAccel = 0.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -342,7 +342,7 @@ namespace CalamityMod.NPCs.CalClone calCloneBroChargeSpeed += 2f; if (revenge) calCloneBroChargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = NPC.Center; diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index b12216583d..3c341d7b8c 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.CalClone { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 45; // 90 + NPC.damage = 54; // 108 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -215,7 +215,7 @@ namespace CalamityMod.NPCs.CalClone float calCloneBroProjAttackMaxSpeed = 4.5f; float calCloneBroProjAttackAccel = 0.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { calCloneBroProjAttackMaxSpeed *= 1.15f; calCloneBroProjAttackAccel *= 1.15f; @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.CalClone calCloneBroChargeSpeed += 2f; if (revenge) calCloneBroChargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) calCloneBroChargeSpeed *= 1.25f; Vector2 calCloneBroChargeCenter = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4370e9a8b2..48efee5374 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -19,6 +19,7 @@ using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; @@ -232,8 +233,6 @@ namespace CalamityMod.NPCs ///
public int destroyerLaserColor = -1; - /// Constant multiplier used to increase vanilla enemy health. - private const double EnemyHPMultiplier = 1.25; /// Constant multiplier used to decrease the health and/or damage of pre-Hardmode Desert enemies. private const double DesertEnemyStatMultiplier = 0.75; @@ -1574,13 +1573,13 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.KingSlime) { if (CalamityWorld.death) - npc.scale = CalamityWorld.LegendaryMode ? 6f : 2.5f; + npc.scale = Main.getGoodWorld ? 6f : 2.5f; else - npc.scale = CalamityWorld.LegendaryMode ? 3f : 1.5f; + npc.scale = Main.getGoodWorld ? 3f : 1.5f; - npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.LegendaryMode ? 1.8 : 1.5)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.5); } - else if ((npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental || npc.type == NPCID.Ghost) && CalamityWorld.LegendaryMode) + else if ((npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental || npc.type == NPCID.Ghost) && Main.getGoodWorld) { npc.knockBackResist = 0f; } @@ -1648,7 +1647,6 @@ namespace CalamityMod.NPCs // Organic undead or other enemies that are covered in slime. case NPCID.ArmedZombieSlimed: case NPCID.BigSlimedZombie: - case NPCID.BunnySlimed: case NPCID.SlimedZombie: case NPCID.SmallSlimedZombie: VulnerableToCold = true; @@ -2288,6 +2286,204 @@ namespace CalamityMod.NPCs VulnerableToHeat = true; VulnerableToSickness = false; break; + + // Town NPCs. Mostly irrelevant, but it displays in the Bestiary + case NPCID.Merchant: + case NPCID.Nurse: + case NPCID.ArmsDealer: + case NPCID.Dryad: + case NPCID.Guide: + case NPCID.OldMan: + case NPCID.Demolitionist: + case NPCID.Clothier: + case NPCID.BoundGoblin: + case NPCID.BoundWizard: + case NPCID.GoblinTinkerer: + case NPCID.Wizard: + case NPCID.BoundMechanic: + case NPCID.Mechanic: + case NPCID.Truffle: + case NPCID.Steampunker: + case NPCID.DyeTrader: + case NPCID.PartyGirl: + case NPCID.Painter: + case NPCID.WitchDoctor: + case NPCID.Pirate: + case NPCID.Stylist: + case NPCID.WebbedStylist: + case NPCID.TravellingMerchant: + case NPCID.Angler: + case NPCID.SleepingAngler: + case NPCID.DD2Bartender: + case NPCID.BartenderUnconscious: + case NPCID.Golfer: + case NPCID.GolferRescue: + case NPCID.BestiaryGirl: + case NPCID.Princess: + case NPCID.TownCat: + case NPCID.TownDog: + case NPCID.TownBunny: + VulnerableToCold = true; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + case NPCID.SantaClaus: + VulnerableToCold = false; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + case NPCID.TaxCollector: + VulnerableToCold = true; + VulnerableToHeat = false; + VulnerableToSickness = true; + break; + // Non-organic Town NPCs. + case NPCID.Cyborg: + case NPCID.BoundTownSlimeOld: + VulnerableToSickness = false; + break; + // Town Slimes. + case NPCID.TownSlimeBlue: + case NPCID.TownSlimeGreen: + case NPCID.TownSlimeOld: + case NPCID.TownSlimePurple: + case NPCID.TownSlimeRainbow: + case NPCID.TownSlimeRed: + case NPCID.TownSlimeYellow: + case NPCID.TownSlimeCopper: + case NPCID.BoundTownSlimePurple: + VulnerableToSickness = false; + VulnerableToHeat = true; + break; + + // Critters + case NPCID.Bunny: + case NPCID.Bird: + case NPCID.BirdBlue: + case NPCID.BirdRed: + case NPCID.Squirrel: + case NPCID.Mouse: + case NPCID.BunnySlimed: + case NPCID.BunnyXmas: + case NPCID.Firefly: + case NPCID.Butterfly: + case NPCID.Worm: + case NPCID.LightningBug: + case NPCID.Snail: + case NPCID.GlowingSnail: + case NPCID.Frog: + case NPCID.Duck: + case NPCID.Duck2: + case NPCID.DuckWhite: + case NPCID.DuckWhite2: + case NPCID.ScorpionBlack: + case NPCID.Scorpion: + case NPCID.TruffleWorm: + case NPCID.TruffleWormDigger: + case NPCID.Grasshopper: + case NPCID.GoldBird: + case NPCID.GoldBunny: + case NPCID.GoldButterfly: + case NPCID.GoldFrog: + case NPCID.GoldGrasshopper: + case NPCID.GoldMouse: + case NPCID.GoldWorm: + case NPCID.EnchantedNightcrawler: + case NPCID.Grubby: + case NPCID.Sluggy: + case NPCID.Buggy: + case NPCID.SquirrelRed: + case NPCID.SquirrelGold: + case NPCID.PartyBunny: + case NPCID.BlackDragonfly: + case NPCID.BlueDragonfly: + case NPCID.GreenDragonfly: + case NPCID.OrangeDragonfly: + case NPCID.RedDragonfly: + case NPCID.YellowDragonfly: + case NPCID.GoldDragonfly: + case NPCID.Seagull: + case NPCID.Seagull2: + case NPCID.LadyBug: + case NPCID.GoldLadyBug: + case NPCID.Maggot: + case NPCID.Grebe: + case NPCID.Grebe2: + case NPCID.Rat: + case NPCID.Owl: + case NPCID.WaterStrider: + case NPCID.GoldWaterStrider: + case NPCID.ExplosiveBunny: + case NPCID.EmpressButterfly: + case NPCID.Stinkbug: + case NPCID.ScarletMacaw: + case NPCID.BlueMacaw: + case NPCID.Toucan: + case NPCID.YellowCockatiel: + case NPCID.GrayCockatiel: + case NPCID.Shimmerfly: + case NPCID.BoundTownSlimeYellow: + VulnerableToCold = true; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + // Water Critters + case NPCID.Goldfish: + case NPCID.GoldfishWalker: + case NPCID.GoldGoldfish: + case NPCID.GoldGoldfishWalker: + case NPCID.Pupfish: + case NPCID.Dolphin: + case NPCID.Turtle: + case NPCID.TurtleJungle: + case NPCID.SeaTurtle: + case NPCID.Seahorse: + case NPCID.GoldSeahorse: + VulnerableToHeat = false; + VulnerableToSickness = true; + VulnerableToElectricity = true; + VulnerableToWater = false; + break; + // Penguins + case NPCID.Penguin: + case NPCID.PenguinBlack: + VulnerableToCold = false; + VulnerableToHeat = true; + VulnerableToSickness = true; + break; + // Fairies + case NPCID.FairyCritterPink: + case NPCID.FairyCritterGreen: + case NPCID.FairyCritterBlue: + VulnerableToSickness = false; + break; + // Gem Critters + case NPCID.GemSquirrelAmethyst: + case NPCID.GemSquirrelTopaz: + case NPCID.GemSquirrelSapphire: + case NPCID.GemSquirrelEmerald: + case NPCID.GemSquirrelRuby: + case NPCID.GemSquirrelDiamond: + case NPCID.GemSquirrelAmber: + case NPCID.GemBunnyAmethyst: + case NPCID.GemBunnyTopaz: + case NPCID.GemBunnySapphire: + case NPCID.GemBunnyEmerald: + case NPCID.GemBunnyDiamond: + case NPCID.GemBunnyAmber: + VulnerableToCold = true; + VulnerableToSickness = true; + VulnerableToWater = true; + break; + // Underworld Critters + case NPCID.HellButterfly: + case NPCID.Lavafly: + case NPCID.MagmaSnail: + VulnerableToCold = true; + VulnerableToHeat = false; + VulnerableToSickness = true; + VulnerableToWater = true; + break; } } #endregion @@ -2344,13 +2540,6 @@ namespace CalamityMod.NPCs canBreakPlayerDefense = true; break; - // Enemies that should have coldDamage set to true - case NPCID.IceMimic: - case NPCID.IceBat: - case NPCID.IceTortoise: - npc.coldDamage = true; - break; - // These go through walls and are very annoying with the new tombstone breaking spawning them mechanic in 1.4 case NPCID.Ghost: npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.5); @@ -4300,7 +4489,6 @@ namespace CalamityMod.NPCs case NPCID.JungleSlime: case NPCID.BabySlime: case NPCID.Pinky: - case NPCID.BunnySlimed: case NPCID.Slimeling: case NPCID.Slimer2: npc.damage = (npc.velocity.Y == 0f || npc.velocity.Length() < 3f) ? 0 : npc.defDamage; @@ -4841,28 +5029,10 @@ namespace CalamityMod.NPCs target.AddBuff(BuffID.BrokenArmor, 300); break; - case NPCID.PossessedArmor: - target.AddBuff(BuffID.Cursed, 60); - break; - - case NPCID.Ghost: - case NPCID.PirateGhost: - target.AddBuff(BuffID.Cursed, 60); - target.AddBuff(BuffID.Silenced, 180); - break; - - case NPCID.ChaosElemental: - target.AddBuff(BuffID.Silenced, 180); - break; - case NPCID.IlluminantBat: target.AddBuff(BuffID.Confused, 120); break; - case NPCID.IlluminantSlime: - target.AddBuff(BuffID.Slow, 180); - break; - case NPCID.Piranha: target.AddBuff(BuffID.Bleeding, 180); break; @@ -5185,29 +5355,15 @@ namespace CalamityMod.NPCs if (!projectile.npcProj && !projectile.trap) { - // Plague Reaper deals 1.1x damage to Plagued enemies + // Plague Reaper deals extra damage to Plagued enemies if (projectile.CountsAsClass() && modPlayer.plagueReaper && plague) - modifiers.SourceDamage *= 1.1f; + modifiers.SourceDamage *= PlagueReaperMask.SetBonusPlaguedRangedDamageMult; // True Vulnerability Hex causes enemies to take 1.15x damage, 2.5x from Calamity itself if (trueVulnerabilityHex) modifiers.SourceDamage *= (projectile.type == ProjectileType() && projectile.ai[1] == 255f) ? 2.5f : 1.15f; } - // Any weapons that shoot projectiles from anywhere other than the player's center aren't affected by point-blank shot damage boost. - if (!Main.player[projectile.owner].ActiveItem().IsAir && Main.player[projectile.owner].ActiveItem().Calamity().canFirePointBlankShots && projectile.CountsAsClass()) - { - if (projectile.Calamity().pointBlankShotDuration > 0 && projectile.Calamity().pointBlankShotDistanceTravelled < CalamityGlobalProjectile.PointBlankShotDistanceLimit) - { - float pointBlankShotDurationRatio = projectile.Calamity().pointBlankShotDuration / (float)CalamityGlobalProjectile.DefaultPointBlankDuration; - float pointBlankShotDistanceRatio = 1f - projectile.Calamity().pointBlankShotDistanceTravelled / CalamityGlobalProjectile.PointBlankShotDistanceLimit; - float pointBlankDamageRatio = (pointBlankShotDurationRatio < pointBlankShotDistanceRatio ? pointBlankShotDurationRatio : pointBlankShotDistanceRatio) * 0.25f; - float pointBlankShotDamageMultiplier = 1f + pointBlankDamageRatio; - modifiers.SourceDamage *= pointBlankShotDamageMultiplier; - projectile.Calamity().pointBlankShotDuration = 0; - } - } - // Apply balancing resists/vulnerabilities. BalancingChangesManager.ApplyFromProjectile(npc, ref modifiers, projectile); @@ -5437,7 +5593,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int slimeAmt = CalamityWorld.LegendaryMode ? Main.rand.Next(6) + 10 : Main.rand.Next(2) + 2; // 2 to 3 extra + int slimeAmt = Main.rand.Next(2) + 2; // 2 to 3 extra for (int s = 0; s < slimeAmt; s++) { int slime = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); @@ -5445,8 +5601,8 @@ namespace CalamityMod.NPCs npc2.SetDefaults(NPCID.BabySlime); npc2.velocity.X = npc.velocity.X * 2f; npc2.velocity.Y = npc.velocity.Y; - npc2.velocity.X += Main.rand.Next(-20, 20) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s * npc.direction * (CalamityWorld.LegendaryMode ? 0.5f : 0.3f); - npc2.velocity.Y -= Main.rand.Next(0, 10) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s; + npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + s * npc.direction * 0.3f; + npc2.velocity.Y -= Main.rand.Next(10) * 0.1f + s; npc2.ai[0] = -1000 * Main.rand.Next(3); if (Main.dedServ && slime < Main.maxNPCs) @@ -5459,7 +5615,7 @@ namespace CalamityMod.NPCs case NPCID.CursedHammer: case NPCID.EnchantedSword: case NPCID.CrimsonAxe: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; @@ -5470,13 +5626,13 @@ namespace CalamityMod.NPCs case NPCID.IceTortoise: case NPCID.BlackRecluse: case NPCID.BlackRecluseWall: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; case NPCID.Paladin: - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; break; @@ -5484,7 +5640,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCType()) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.justHit = false; } } @@ -5733,12 +5889,12 @@ namespace CalamityMod.NPCs if (CalamityWorld.death && Main.bloodMoon) { spawnRate = (int)(spawnRate * 0.25); - maxSpawns = (int)(maxSpawns * 10f); + maxSpawns = (int)(maxSpawns * 5f); } if (CalamityWorld.death && player.ZoneGraveyard) { - spawnRate = (int)(spawnRate * 0.6); + spawnRate = (int)(spawnRate * 0.6667); maxSpawns = (int)(maxSpawns * 1.5f); } @@ -5755,27 +5911,18 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge) spawnRate = (int)(spawnRate * 0.85); - if (Main.SceneMetrics.WaterCandleCount > 0) - spawnRate = (int)(spawnRate * 0.8888); // On top of 0.75 = 0.6666x (1.33x -> 1.5x spawn rate) - if (player.enemySpawns) // Battle Potion - { - spawnRate = (int)(spawnRate * 0.8); // On top of 0.5 = 0.4x (2x -> 2.5x spawn rate) - maxSpawns = (int)(maxSpawns * 1.25f); // On top of 2 (2x -> 2.5x max spawns) - } if (player.Calamity().chaosCandle) { - spawnRate = (int)(spawnRate * 0.4); // 2.5x spawn rate - maxSpawns = (int)(maxSpawns * 2.5f); + spawnRate = (int)(spawnRate * 0.5); // 2x spawn rate + maxSpawns = (int)(maxSpawns * 2f); } if (player.Calamity().zerg) { - spawnRate = (int)(spawnRate * 0.2); // 5x spawn rate - maxSpawns = (int)(maxSpawns * 5f); + spawnRate = (int)(spawnRate * 0.25); // 4x spawn rate + maxSpawns = (int)(maxSpawns * 4f); } // Reductions - if (Main.SceneMetrics.PeaceCandleCount > 0) - spawnRate = (int)(spawnRate * 1.0989); // On top of 1.3 = 1.4286x (0.77x -> 0.7x spawn rate) if (player.Calamity().tranquilityCandle) { spawnRate = (int)(spawnRate * 1.6666); // 0.6x spawn rate @@ -5783,8 +5930,8 @@ namespace CalamityMod.NPCs } if (player.Calamity().zen || (CalamityServerConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode)) { - spawnRate = (int)(spawnRate * 3.3333); // 0.3x spawn rate - maxSpawns = (int)(maxSpawns * 0.3f); + spawnRate = (int)(spawnRate * 2.5); // 0.4x spawn rate + maxSpawns = (int)(maxSpawns * 0.4f); } if (player.Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen) { @@ -6464,7 +6611,7 @@ namespace CalamityMod.NPCs if (npc.IsABestiaryIconDummy) return null; - if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode)) + if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && Main.zenithWorld)) return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && CalamityWorld.death) @@ -7224,7 +7371,7 @@ namespace CalamityMod.NPCs Color currentColor = npc.GetAlpha(drawColor); float opacity = (1f - Main.npc[NPC.crimsonBoss].life / (float)Main.npc[NPC.crimsonBoss].lifeMax) * 2f; opacity *= opacity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) opacity = 1f; opacity = MathHelper.Clamp(opacity, 0f, 1f); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 19690e1177..819ac0d178 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -98,12 +98,6 @@ namespace CalamityMod.NPCs case NPCID.Werewolf: npcLoot.ChangeDropRate(ItemID.MoonCharm, 1, 20); break; - - // Possessed Armor - // Nazar @ 1% Normal, 2% Expert+ - case NPCID.PossessedArmor: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - break; #endregion #region Sky / Space @@ -465,14 +459,10 @@ namespace CalamityMod.NPCs break; // Chaos Elemental - // Megaphone @ 1% Normal, 2% Expert+ // Rod of Discord @ 0.5% Normal, 0.625% Expert+ (2.5 times higher chance than vanilla) case NPCID.ChaosElemental: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); - // Remove the vanilla loot rule for Rod of Discord. npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.RodofDiscord); - // Define a replacement rule which has an increased chance. npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.RodofDiscord, 200, 160)); break; @@ -483,12 +473,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.TrifoldMap, 100, 50)); break; - // Illuminant Slime - // Fast Clock @ 1% Normal, 2% Expert+ - case NPCID.IlluminantSlime: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.FastClock, 100, 50)); - break; - // Gastropod // 5-10 Pink Gel @ 100% case NPCID.Gastropod: @@ -712,11 +696,8 @@ namespace CalamityMod.NPCs break; // Ghost Bracelet @ 5% (Dandy requests this drops at a "high chance" but inventory clutter is real so) - // Nazar and Megaphone @ 1% Normal, 2% Expert case NPCID.Ghost: npcLoot.Add(ModContent.ItemType(), 20); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); break; #endregion @@ -815,13 +796,6 @@ namespace CalamityMod.NPCs rev.Add(ItemID.FlyingDutchmanMasterTrophy); rev.Add(ItemID.PirateShipMountItem, 4); break; - - // Pirate's Curse - // Nazar and Megaphone @ 1% Normal, 2% Expert - case NPCID.PirateGhost: - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Nazar, 100, 50)); - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Megaphone, 100, 50)); - break; #endregion #region Solar Eclipse @@ -1157,10 +1131,10 @@ namespace CalamityMod.NPCs npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.RoyalGel)); // Would be in the bag otherwise - npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.Remix, ItemID.Keybrand, 4)); - npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.NotRemix, ItemID.Katana, 4)); + npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.Remix, ItemID.Keybrand, DropHelper.NormalWeaponDropRateInt)); + npcLoot.AddNormalOnly(ItemDropRule.ByCondition(DropHelper.NotRemix, ItemID.Katana, DropHelper.NormalWeaponDropRateInt)); - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); // Master items drop in Revengeance @@ -1179,8 +1153,8 @@ namespace CalamityMod.NPCs npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.EoCShield)); // Would be in the bag otherwise - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); - npcLoot.AddNormalOnly(ModContent.ItemType(), 4); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); // Master items drop in Revengeance @@ -1304,7 +1278,7 @@ namespace CalamityMod.NPCs // Expert+ drops are also available on Normal npcLoot.AddNormalOnly(DropHelper.PerPlayer(ItemID.HiveBackpack)); - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); + npcLoot.AddNormalOnly(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), ThankYouPainting.DropInt); @@ -1370,6 +1344,7 @@ namespace CalamityMod.NPCs var wofWeapons = new int[] { ItemID.BreakerBlade, + ModContent.ItemType(), ItemID.ClockworkAssaultRifle, ModContent.ItemType(), ItemID.LaserRifle, @@ -1406,9 +1381,6 @@ namespace CalamityMod.NPCs } catch (ArgumentNullException) { } - // Would be in the bag otherwise - npcLoot.AddNormalOnly(ModContent.ItemType(), 10); - // Drop Hermit's Box directly for EACH player, regardles of Expert or not. 100% chance on first kill, 10% chance afterwards. // The special first kill rule is unlisted in the Bestiary LeadingConditionRule firstWoFKill = new(DropHelper.If(() => !Main.hardMode)); @@ -1509,7 +1481,6 @@ namespace CalamityMod.NPCs // Expert+ drops are also available on Normal. These are done manually due to Last Twin Standing. npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ItemID.MechanicalWheelPiece); - npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), 10); // Would be in the bag otherwise npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), ThankYouPainting.DropInt); diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 71432bcd0c..04e4c25760 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -232,6 +232,7 @@ namespace CalamityMod.NPCs "Xsiana", // <@!625780237489143839> (lokistic) "Lain", // <@!655201622863118337> (literallyadeerfr) "Hamis", // <@!608455754093035521> (haefer) + "Brio Scarlet", // <@!358576903701004289> (brio_scarlet) }; private static readonly string[] TavernkeepNames = { @@ -1174,7 +1175,8 @@ namespace CalamityMod.NPCs if (type == NPCID.ArmsDealer) { - shop.Add(Condition.Hardmode) + shop.AddWithCustomValue(ItemType(), Item.buyPrice(gold: 20), Condition.DownedSkeletron) + .Add(Condition.Hardmode) .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee) .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera) .AddWithCustomValue(ItemID.TacticalShotgun, Item.buyPrice(platinum: 1), Condition.DownedGolem) diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index b330aaeae8..6554662478 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.defense = 80; NPC.Calamity().DR = 0.5f; NPC.LifeMaxNERB(65000, 78000, 72000); - NPC.value = Item.buyPrice(platinum: 1); + NPC.value = Item.buyPrice(gold: 50); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (phase4) darkEnergyAmt += 1; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) darkEnergyAmt *= 2; // Spawn a few Dark Energies as soon as the fight starts @@ -211,23 +211,18 @@ namespace CalamityMod.NPCs.CeaselessVoid else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - float maliceBuffMult = CalamityWorld.MaliceMode ? 1.5f : 1f; - - // Set AI variable to be used by Dark Energies - NPC.ai[1] = maliceBuffMult; - // Increase projectile fire rate based on number of nearby active tiles - float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((maliceBuffMult - 1f) / 0.5f)); + float projectileFireRateMultiplier = Main.getGoodWorld ? 0.5f : 1.5f; // Decides whether Ceaseless moves closer to its target or not - float distanceRequiredToMove = CalamityWorld.LegendaryMode ? 300f : 720f; + float distanceRequiredToMove = Main.getGoodWorld ? 300f : 720f; bool move = Vector2.Distance(NPC.Center, player.Center) > distanceRequiredToMove || !Collision.CanHit(NPC.Center, 1, 1, player.Center, 1, 1); // Succ attack if (!anyDarkEnergies) { // This is here because it's used in multiple places - float suckDistance = CalamityWorld.MaliceMode ? 2400f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; + float suckDistance = death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; // Move closer to the target before trying to succ if (movingDuringSuccPhase) @@ -527,8 +522,8 @@ namespace CalamityMod.NPCs.CeaselessVoid // Basic movement towards a location void Movement(bool succ) { - float velocity = ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * maliceBuffMult; - float acceleration = (death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f) * maliceBuffMult; + float velocity = ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)); + float acceleration = (death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f); // Increase speed dramatically in succ phase if (succ) @@ -544,7 +539,7 @@ namespace CalamityMod.NPCs.CeaselessVoid acceleration *= 5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -554,8 +549,8 @@ namespace CalamityMod.NPCs.CeaselessVoid // Move between 8 different positions around the player, in order float maxDistance = 320f; - Vector2 moveToOffset = succ ? Vector2.Zero : CalamityWorld.LegendaryMode ? new Vector2(0f, -maxDistance) : Vector2.Zero; - if ((!succ && CalamityWorld.LegendaryMode) || !madeItToLocation) + Vector2 moveToOffset = succ ? Vector2.Zero : Main.getGoodWorld ? new Vector2(0f, -maxDistance) : Vector2.Zero; + if ((!succ && Main.getGoodWorld) || !madeItToLocation) { // Move to a new location every few seconds calamityGlobalNPC.newAI[2] += 1f; @@ -577,7 +572,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Vector2 distanceFromDestination = destination - NPC.Center; // Movement - if (NPC.Distance(destination) > maxDistance || succ || (!CalamityWorld.LegendaryMode && !madeItToLocation)) + if (NPC.Distance(destination) > maxDistance || succ || (!Main.getGoodWorld && !madeItToLocation)) CalamityUtils.SmoothMovement(NPC, 0f, distanceFromDestination, velocity, acceleration, true); if (NPC.Distance(destination) < 80) { diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index c242ed17af..f147f52a7f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.Opacity > 1f) NPC.Opacity = 1f; - NPC.scale = MathHelper.Lerp(0.05f, CalamityWorld.LegendaryMode ? 0.5f : 1f, NPC.Opacity); + NPC.scale = MathHelper.Lerp(0.05f, Main.getGoodWorld ? 0.5f : 1f, NPC.Opacity); } else { @@ -161,13 +161,10 @@ namespace CalamityMod.NPCs.CeaselessVoid bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - // Gets how enraged Ceaseless Void is - float tileEnrageMult = Main.npc[CalamityGlobalNPC.voidBoss].ai[1]; - // Distance from Ceaseless Void double maxDistance = death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; - double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; + double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) { distance += rateOfChange; @@ -188,7 +185,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } // Rotation velocity - float minRotationVelocity = 0.5f + tileEnrageMult - 1f; + float minRotationVelocity = 0.5f; float rotationVelocityIncrease = death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0f; rotationVelocityIncrease += rotationVelocityIncrease * (NPC.ai[1] * 0.5f); diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 7a979cac62..665ccc03c2 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -31,14 +31,12 @@ namespace CalamityMod.NPCs.Crabulon NPC.damage = 18; // 36 NPC.width = 14; NPC.height = 14; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale = 2f; - NPC.lifeMax = CalamityWorld.LegendaryMode ? 180 : 15; + NPC.lifeMax = 15; if (BossRushEvent.BossRushActive) NPC.lifeMax = 6000; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 2; AIType = -1; NPC.knockBackResist = 0.5f; NPC.noGravity = true; @@ -67,7 +65,7 @@ namespace CalamityMod.NPCs.Crabulon bool death = CalamityWorld.death || BossRushEvent.BossRushActive; float xVelocityLimit = death ? 8f : revenge ? 6f : 5f; - float yVelocityLimit = CalamityWorld.LegendaryMode ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; + float yVelocityLimit = Main.getGoodWorld ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -99,7 +97,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.rotation = NPC.velocity.X * 0.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { float pushVelocity = 0.5f; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 806459c5c7..531fdd9487 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.scale *= 1.5f; NPC.defense += 12; @@ -257,7 +257,7 @@ namespace CalamityMod.NPCs.Crabulon walkingVelocity += 0.75f; if (phase4) walkingVelocity += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) walkingVelocity *= 2f; bool shouldWalkSlower = false; @@ -950,7 +950,7 @@ namespace CalamityMod.NPCs.Crabulon { if (Main.netMode != NetmodeID.MultiplayerClient) { - int crabShroomSpawnFreq = (int)(NPC.lifeMax * (CalamityWorld.LegendaryMode ? 0.02 : 0.05)); + int crabShroomSpawnFreq = (int)(NPC.lifeMax * (Main.getGoodWorld ? 0.02 : 0.05)); if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; @@ -962,8 +962,8 @@ namespace CalamityMod.NPCs.Crabulon int npcType = ModContent.NPCType(); int crabShroom = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, npcType); Main.npc[crabShroom].SetDefaults(npcType); - Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); - Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (Main.getGoodWorld ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (Main.getGoodWorld ? 0.2f : 0.1f); if (Main.dedServ && crabShroom < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, crabShroom); } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index adb129ed17..6e9427f179 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Cryogen public static int IceBlastDamage = 23; // 92; Also applies to GFB darts public static int IceRainDamage = 23; // 92; Also applies to GFB darts - public static int IceBombDamage = 30; // 120; Also applies to GFB fireblasts + public static int IceBombDamage = 28; // 112; Also applies to GFB fireblasts public override void SetDefaults() { @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -270,7 +270,7 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { int spawnType = Main.zenithWorld ? NPCID.RedDevil : NPCID.IceGolem; if (!NPC.AnyNPCs(spawnType)) @@ -298,13 +298,13 @@ namespace CalamityMod.NPCs.Cryogen float chargePhaseGateValue = 360f; float chargeDuration = 60f; - float chargeTelegraphTime = NPC.ai[0] == 2f ? (CalamityWorld.LegendaryMode ? 60f : 80f) : (CalamityWorld.LegendaryMode ? 90f : 120f); + float chargeTelegraphTime = NPC.ai[0] == 2f ? (Main.getGoodWorld ? 60f : 80f) : (Main.getGoodWorld ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; float chargeTelegraphRotationIncrement = chargeTelegraphMaxRotationIncrement / chargeTelegraphTime; float chargeSlowDownTime = 15f; - float chargeVelocityMin = CalamityWorld.LegendaryMode ? 24f : 12f; - float chargeVelocityMax = CalamityWorld.LegendaryMode ? 42f : 30f; - if (CalamityWorld.LegendaryMode) + float chargeVelocityMin = Main.getGoodWorld ? 24f : 12f; + float chargeVelocityMax = Main.getGoodWorld ? 42f : 30f; + if (Main.getGoodWorld) { chargePhaseGateValue *= 0.7f; chargeDuration *= 0.8f; @@ -387,7 +387,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -655,7 +655,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -815,7 +815,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -1092,7 +1092,7 @@ namespace CalamityMod.NPCs.Cryogen } float inertia = 30f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerchargeXDist) / (inertia + 1f); diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index b936f757f6..a2befaa003 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.coldDamage = true; NPC.width = 216; NPC.height = 216; - NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) ? 0.8f : 1f; + NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f; NPC.DR_NERD(0.4f); NPC.LifeMaxNERB(2800, 3360, 33600); NPC.Opacity = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index 1af12df8f8..d696d93a50 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -44,12 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 88; NPC.defense = 5; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 27; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 6fff24e78e..74ab964b4a 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -44,12 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 78; NPC.defense = 4; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 26; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 24e74f0275..d3be799c43 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -56,15 +56,15 @@ namespace CalamityMod.NPCs.DesertScourge NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 3; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 19; NPC.width = 88; NPC.height = 88; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 2; int bodyTypeAIVariable = 0; @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -295,12 +295,6 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode) - { - speed *= 1.5f; - turnSpeed *= 1.5f; - } - Vector2 npcCenter = NPC.Center; float playerX = Main.player[NPC.target].Center.X; float targettingPosition = Main.player[NPC.target].Center.Y; diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 45b3676e8b..0b8353912f 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -48,15 +48,15 @@ namespace CalamityMod.NPCs.DesertScourge NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 2; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 18; NPC.width = 78; NPC.height = 78; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.07f * enrageScale; turnSpeed += 0.14f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 2; int bodyTypeAIVariable = 0; @@ -306,7 +306,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -333,12 +333,6 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode) - { - speed *= 1.5f; - turnSpeed *= 1.5f; - } - Vector2 npcCenter = NPC.Center; float playerX = Main.player[NPC.target].Center.X; float targettingPosition = Main.player[NPC.target].Center.Y; diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 06b472173f..56ce8db014 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 88; NPC.defense = 8; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 34; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4800; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 6bec098fe0..5b6bc7ee94 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -26,12 +26,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 78; NPC.defense = 7; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.defense += 33; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax = 4000; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index ea3d5a8279..916fa6ba25 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -49,8 +49,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 6; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -64,7 +64,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 4440d7ba44..8ade55c3dc 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.DesertScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } - public static int SpitDamage = 8; // 32 + public static int SpitDamage = 10; // 40 public override void SetDefaults() { @@ -96,8 +96,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.height = 104; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -111,9 +111,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; - if (Main.zenithWorld) NPC.scale *= 4f; @@ -254,7 +253,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -426,7 +425,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = death ? 24 : revenge ? 21 : expertMode ? 18 : 15; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) minLength *= 3; int bodyTypeAIVariable = 0; @@ -537,7 +536,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : + Main.getGoodWorld ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : expertMode ? SegmentVelocity_Expert : SegmentVelocity_Normal; @@ -596,14 +595,14 @@ namespace CalamityMod.NPCs.DesertScourge { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SandBlastSound, NPC.Center); - float velocity = CalamityWorld.LegendaryMode ? 16f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; + float velocity = Main.getGoodWorld ? 16f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; int type = ModContent.ProjectileType(); Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; int numProj = death ? 24 : revenge ? 21 : expertMode ? 18 : 12; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numProj *= 2; - int spread = CalamityWorld.LegendaryMode ? 120 : 90; + int spread = Main.getGoodWorld ? 120 : 90; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 4647a5e631..c736d3dab9 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.defense = 9; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 2; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 4df6789f0d..43dd699c66 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -271,7 +271,7 @@ namespace CalamityMod.NPCs.DevourerofGods float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) segmentVelocity *= 1.1f; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 87f324a67b..fee6b77511 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -427,7 +427,7 @@ namespace CalamityMod.NPCs.DevourerofGods groundPhaseTurnSpeed += Vector2.Distance(destination, NPC.Center) * 0.0002f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity *= 1.1f; speed *= 1.1f; @@ -753,10 +753,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Fireballs // Check angle and distance to make sure it's realistic that they'd be fired - if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || CalamityWorld.LegendaryMode) && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) + if (NPC.Opacity >= 1f && distanceFromTarget > 480f && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) { calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] >= (CalamityWorld.LegendaryMode ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (CalamityWorld.LegendaryMode ? 30f : phase7 ? 30f : 60f) == 0f) + if (calamityGlobalNPC.newAI[0] >= (Main.getGoodWorld ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (Main.getGoodWorld ? 30f : phase7 ? 30f : 60f) == 0f) { float fireballSpeed = 8f; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * fireballSpeed + NPC.velocity * 0.5f; @@ -771,7 +771,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, damage, 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { for (int l = 0; l < 8; l++) { @@ -1113,7 +1113,7 @@ namespace CalamityMod.NPCs.DevourerofGods speedCopy += Vector2.Distance(destination, NPC.Center) * 0.005f; turnSpeedCopy += Vector2.Distance(destination, NPC.Center) * 0.00025f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -1271,7 +1271,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -1872,7 +1872,7 @@ namespace CalamityMod.NPCs.DevourerofGods turnSpeedCopy += distanceFromTarget * 0.0001f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -2016,7 +2016,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -2319,7 +2319,7 @@ namespace CalamityMod.NPCs.DevourerofGods float mult = revenge ? 1.5f : 3f; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = (CalamityWorld.LegendaryMode) ? 30 : 12; + int totalProjectiles = Main.getGoodWorld ? 30 : 12; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = finalVelocity - i * mult; float velocityMult = 1f + ((finalVelocity - newVelocity) / (newVelocity * 2f) / 100f); @@ -2606,7 +2606,6 @@ namespace CalamityMod.NPCs.DevourerofGods }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); normalOnly.Add(ModContent.ItemType(), 10); - normalOnly.Add(ModContent.ItemType(), 10); // Vanity normalOnly.Add(ModContent.ItemType(), 7); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index c7f9c2c798..64e31b8cae 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.takenDamageMultiplier = 1.25f; NPC.dontCountMe = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.5f; } @@ -304,7 +304,7 @@ namespace CalamityMod.NPCs.DevourerofGods float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) segmentVelocity *= 1.1f; } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 254c93ea4e..a38606dec9 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -144,14 +144,14 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo } } - public static int FireballDamage = 85; // 340 - public static int BoltDamage = 75; // 300 - public static int RocketDamage = 100; // 400 + public static int FireballDamage = 80; // 320 + public static int BoltDamage = 70; // 280 + public static int RocketDamage = 95; // 380 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 250; // 500 + NPC.damage = 240; // 480 NPC.npcSlots = 5f; NPC.width = 204; NPC.height = 226; @@ -424,7 +424,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float timeToLineUpAttack = 30f; float timeToLineUpCharge = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { timeToLineUpAttack *= 0.5f; timeToLineUpCharge *= 0.5f; @@ -445,7 +445,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Charge velocity float chargeVelocity = death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { baseVelocity *= 1.5f; chargeVelocity *= 1.15f; @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float rocketPhaseDuration = lastMechAlive ? 60f : 90f; int numRockets = nerfedAttacks ? 2 : 3; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numRockets += 3; // Default vector to fly to @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -1178,7 +1178,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.ForceNetUpdate(); // Plasma bolts on charge - if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode))) + if (Main.netMode != NetmodeID.MultiplayerClient && !(Main.zenithWorld && !exoMechdusa)) { int totalProjectiles = death ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 055a1b2733..cf48624756 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -219,10 +219,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public static int BlenderDamage = 110; // 440 + public static int BlenderDamage = 105; // 420 // Hekate (GFB) - public static int NeuronLaserDamage = 85; // 340 + public static int NeuronLaserDamage = 80; // 320 public override void SetDefaults() { @@ -889,7 +889,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else { // Enrage if the target is more than the deathray length away - if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode)) && EnragedState == (float)Enraged.No) + if ((distanceFromTarget > DeathrayEnrageDistance || Main.zenithWorld) && EnragedState == (float)Enraged.No) { // Play enrage sound if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance) @@ -909,7 +909,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.velocity *= decelerationVelocityMult; int totalProjectiles = death ? 10 : revenge ? 9 : expertMode ? 8 : 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles += 4; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index ca65cea2bd..96f6790a80 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } public static int NukeDamage = 135; // 540 - public static int SparkDamage = 75; // 300 + public static int SparkDamage = 70; // 280 public override void SetDefaults() { diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 52ce8f335c..01137624d4 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -88,8 +88,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public static int LaserDamage = 85; // 340 - public static int BeamDamage = 110; // 440 + public static int LaserDamage = 80; // 320 + public static int BeamDamage = 105; // 420 public override void SetDefaults() { diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 93d07c3f3a..145ad2fd20 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -82,8 +82,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public static int FireballDamage = 85; // 340 - public static int BoltDamage = 75; // 300 + public static int FireballDamage = 80; // 320 + public static int BoltDamage = 70; // 280 public override void SetDefaults() { diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 3a73886432..9f7c029980 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public static int OrbDamage = 85; // 340 + public static int OrbDamage = 80; // 320 public override void SetDefaults() { diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 51e7694438..7cc58477a2 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -174,13 +174,13 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } - public static int LaserDamage = 85; // 340 - public static int BeamDamage = 110; // 440 + public static int LaserDamage = 80; // 320 + public static int BeamDamage = 105; // 420 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 200; // 400 + NPC.damage = 190; // 380 NPC.npcSlots = 5f; NPC.width = 204; NPC.height = 226; @@ -456,7 +456,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = phase2 ? 30f : 45f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) timeToLineUpAttack *= 0.5f; // Spin variables @@ -495,7 +495,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Charge variables float chargeVelocity = nerfedAttacks ? 60f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; float chargeDistance = 2000f; @@ -520,7 +520,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float baseVelocity = ((AIState == (int)Phase.Deathray || lineUpAttack || AIState == (int)Phase.LaserShotgun) ? 40f : 20f) * baseVelocityMult; float decelerationVelocityMult = 0.85f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.5f; // Laser shotgun variables @@ -534,7 +534,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index d0e4c41861..ad8ffb7bb4 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -112,6 +112,9 @@ namespace CalamityMod.NPCs.ExoMechs } } + // GFB + public static int PulseRifleDamage = 100; // 400 + public override void SetDefaults() { NPC.damage = 0; @@ -524,7 +527,7 @@ namespace CalamityMod.NPCs.ExoMechs Vector2 shoot = PlayerToFollow.Center - NPC.Center; shoot.Normalize(); shoot *= 4; - int p = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center - Vector2.UnitY * 30, shoot, ModContent.ProjectileType(), 116, 0, Main.myPlayer); + int p = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center - Vector2.UnitY * 30, shoot, ModContent.ProjectileType(), PulseRifleDamage, 0, Main.myPlayer); if (p.WithinBounds(Main.maxProjectiles)) { Main.projectile[p].timeLeft *= 2; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 208d7695ab..63d10f0991 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -525,7 +525,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 5c35828c78..fb5343f815 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -528,7 +528,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index ac548a2b24..7e3b79d92b 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -166,13 +166,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - public static int LaserDamage = 85; // 340 + public static int LaserDamage = 80; // 320 public static int BeamDamage = 135; // 540 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 250; // 500 + NPC.damage = 240; // 480 NPC.npcSlots = 5f; NPC.width = 164; NPC.height = 164; @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : CalamityWorld.LegendaryMode ? 0.5f : 1f); + (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.75f : 1f); public int CheckForOtherMechs(ref int targetIndex, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -526,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; float turnDegrees = baseVelocity * 0.1f * (shouldGetBuffedByBerserkPhase ? 1.25f : 1.1f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 748c09e955..5e888f834e 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -526,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; } diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index ac7cd01e1f..baef197d63 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 120; if (BossRushEvent.BossRushActive) NPC.lifeMax = 2000; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; - - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) + { + NPC.lifeMax *= 3; NPC.reflectsProjectiles = true; + } NPC.aiStyle = -1; AIType = -1; diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index dd5b6714b7..3970830b8e 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -29,8 +29,8 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 75; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1800; - if (CalamityWorld.LegendaryMode) - NPC.lifeMax *= 4; + if (Main.getGoodWorld) + NPC.lifeMax *= 3; NPC.aiStyle = -1; AIType = -1; @@ -82,9 +82,9 @@ namespace CalamityMod.NPCs.HiveMind NPC.active = false; } - float velocity = CalamityWorld.LegendaryMode ? 10f : death ? 7f : revenge ? 6f : 4f; - float acceleration = CalamityWorld.LegendaryMode ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; - float deceleration = CalamityWorld.LegendaryMode ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; + float velocity = Main.getGoodWorld ? 10f : death ? 7f : revenge ? 6f : 4f; + float acceleration = Main.getGoodWorld ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; + float deceleration = Main.getGoodWorld ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; if (NPC.position.Y > Main.player[NPC.target].position.Y - 400f) { @@ -125,14 +125,14 @@ namespace CalamityMod.NPCs.HiveMind if (dropRain && Main.netMode != NetmodeID.MultiplayerClient) { NPC.ai[0] += 1f; - float rainDropRate = CalamityWorld.LegendaryMode ? 10f : death ? 15f : revenge ? 20f : 30f; + float rainDropRate = Main.getGoodWorld ? 10f : death ? 15f : revenge ? 20f : 30f; if (NPC.ai[0] >= rainDropRate) { NPC.ai[0] = 0f; int shaderainXPos = (int)(NPC.position.X + 10f + Main.rand.Next(NPC.width - 20)); int shaderainYos = (int)(NPC.position.Y + NPC.height + 4f); int type = ModContent.ProjectileType(); - float randomXVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextFloat() * 5f : 0f; + float randomXVelocity = Main.getGoodWorld ? Main.rand.NextFloat() * 5f : 0f; float velocityY = 8f; Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, velocityY, type, HiveMind.ShaderainDamage, 0f, Main.myPlayer); } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 3730e1e0c8..f9467741d4 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 50; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1300; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.lifeMax *= 2; NPC.knockBackResist = 0.9f; @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.HiveMind float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f; float acceleration = 0.8f; float distanceFromMind = FastVariant ? 96f : 128f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) distanceFromMind *= 2; float hiveMindX = Main.npc[hiveMind].Center.X; @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.HiveMind if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) { float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) projSpeed *= 1.5f; Vector2 projDirection = NPC.Center; @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.HiveMind playerDist = projSpeed / playerDist; playerX *= playerDist; playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); + int type = (Main.getGoodWorld && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); int damage = type == ProjectileID.CursedFlameHostile ? CursedFlameDamage : VileClotDamage; Vector2 projectileVelocity = new Vector2(playerX, playerY); if (type == ProjectileID.CursedFlameHostile) diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 1713dae743..accf78c801 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.HiveMind driftBoost = 1.5f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { reelbackFade *= 10; arcTime *= 0.5f; @@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.HiveMind { NPC.localAI[0] = 1f; int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxBlobs *= 2; if (Main.zenithWorld) maxBlobs = 50; @@ -1072,7 +1072,7 @@ namespace CalamityMod.NPCs.HiveMind { int type = ModContent.ProjectileType(); Vector2 cloudSpawnPos = new Vector2(NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height)); - Vector2 randomVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; + Vector2 randomVelocity = Main.getGoodWorld ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, ShaderainDamage, 0, Main.myPlayer, 11f); } diff --git a/NPCs/HiveMind/HiveTumor.cs b/NPCs/HiveMind/HiveTumor.cs index a438f60a4b..a092cd754e 100644 --- a/NPCs/HiveMind/HiveTumor.cs +++ b/NPCs/HiveMind/HiveTumor.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.width = 30; //324 NPC.height = 30; //216 NPC.defense = 0; - NPC.lifeMax = CalamityWorld.LegendaryMode ? 10 : 1000; + NPC.lifeMax = Main.zenithWorld ? 10 : 1000; NPC.knockBackResist = 0f; NPC.chaseable = false; NPC.HitSound = SoundID.NPCHit1; @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || CalamityWorld.LegendaryMode)) + if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || Main.zenithWorld)) { Vector2 spawnAt = NPC.Bottom; NPC.NewNPC(NPC.GetSource_Death(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index d5922b0ff9..5f6a77634e 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Leviathan private int frameUsed = 0; public bool HasBegunSummoningLeviathan = false; private int DrawProjectileTelegraphTimer = 0; - private int LegendaryModeAttackChosen = 0; + private int GetGoodAttackChosen = 0; public static Asset ChargeTexture; public bool WaitingForLeviathan { @@ -59,15 +59,15 @@ namespace CalamityMod.NPCs.Leviathan } } - public static float DashDamageMult = 1.5f; // 165 - public static int SpearDamage = 24; // 96 + public static float DashDamageMult = 1.5f; // 150 + public static int SpearDamage = 27; // 108 public static int MistDamage = 24; // 96 public static int SongDamage = 30; // 120 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 55; // 110 + NPC.damage = 50; // 100 NPC.npcSlots = 16f; NPC.width = 100; NPC.height = 100; @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -190,9 +190,7 @@ namespace CalamityMod.NPCs.Leviathan bubbleVelocity += 4f * enrageScale; if (!leviAlive) bubbleVelocity += 2f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) - bubbleVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) bubbleVelocity *= 2f; // Phases @@ -617,14 +615,14 @@ namespace CalamityMod.NPCs.Leviathan float velocity = death ? 13.5f : 12f; velocity += 6f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.15f; Vector2 chargeSetupLocation = Vector2.Normalize(targetVector - NPC.Center - NPC.velocity) * velocity; float acceleration = death ? 0.28f : 0.25f; acceleration += 0.2f * enrageScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) acceleration *= 1.15f; if (Math.Abs(NPC.Center.Y - targetVector.Y) > 50f * NPC.scale || Math.Abs(NPC.Center.X - player.Center.X) > 350f * NPC.scale) @@ -653,17 +651,17 @@ namespace CalamityMod.NPCs.Leviathan int totalTelegraphs = 8; float telegraphDist = 500f; - // In Legendary, the projectiles she fires is randomized - if (CalamityWorld.LegendaryMode) + // In FTW, the projectiles she fires is randomized + if (Main.getGoodWorld) { - LegendaryModeAttackChosen = Main.rand.Next(3); - if (LegendaryModeAttackChosen == 2) + GetGoodAttackChosen = Main.rand.Next(3); + if (GetGoodAttackChosen == 2) telegraphDist -= 50f; for (int i = 0; i < totalTelegraphs; i++) { Vector2 spawnVector = player.Center - Vector2.UnitY.RotatedBy(MathHelper.TwoPi / totalTelegraphs * i) * telegraphDist; - int tele = Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, player.whoAmI, LegendaryModeAttackChosen); + int tele = Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, player.whoAmI, GetGoodAttackChosen); Main.projectile[tele].netUpdate = true; } @@ -709,12 +707,12 @@ namespace CalamityMod.NPCs.Leviathan int projectileDistance = 600; int type = ModContent.ProjectileType(); int damage = SpearDamage; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { float radians = MathHelper.TwoPi / totalProjectiles; for (int i = 0; i < totalProjectiles; i++) { - switch (LegendaryModeAttackChosen) + switch (GetGoodAttackChosen) { case 0: SoundEngine.PlaySound(SoundID.Item21, player.Center); @@ -829,7 +827,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge) chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; // Stunt velocity at the end of the charge attack to prevent her flying off if (NPC.ai[0] == -1f) @@ -857,7 +855,7 @@ namespace CalamityMod.NPCs.Leviathan { NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); - if (CalamityWorld.LegendaryMode && NPC.ai[1] % 5f == 0f) + if (Main.zenithWorld && NPC.ai[1] % 5f == 0f) { SoundEngine.PlaySound(SoundID.Item85, NPC.Center); Vector2 bubbleSpawnPos = new Vector2(NPC.position.X + (NPC.width / 2) + (15 * NPC.direction * NPC.scale), NPC.position.Y + 30 * NPC.scale); @@ -927,7 +925,7 @@ namespace CalamityMod.NPCs.Leviathan Vector2 chargeSetupLocation = Vector2.Normalize(player.Center + new Vector2(NPC.localAI[0], -distance) - NPC.Center - NPC.velocity) * 12f; float acceleration = revenge ? 0.75f : 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) acceleration *= 1.15f; NPC.SimpleFlyMovement(chargeSetupLocation, acceleration); @@ -984,7 +982,7 @@ namespace CalamityMod.NPCs.Leviathan if (DrawProjectileTelegraphTimer > 0) { Color telegraphColor = Color.Black; - switch (CalamityWorld.LegendaryMode ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) + switch (Main.getGoodWorld ? GetGoodAttackChosen : (int)NPC.localAI[3]) { case 0: telegraphColor = new Color(55, 70, 240); diff --git a/NPCs/Leviathan/AnahitasIceShield.cs b/NPCs/Leviathan/AnahitasIceShield.cs index bc01f7169c..2341a2fbde 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { - NPC.damage = 45; // 90 + NPC.damage = 50; // 100 NPC.aiStyle = -1; AIType = -1; NPC.noTileCollide = true; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 152244ae2b..e809b6b408 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.3f; } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 0eacfebad3..fc7a3933a7 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 1.3f; if (Main.zenithWorld) @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.Leviathan hoverAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed *= 1.15f; hoverAcceleration *= 1.15f; @@ -409,7 +409,7 @@ namespace CalamityMod.NPCs.Leviathan if (Main.zenithWorld) { - type = CalamityWorld.LegendaryMode ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; + type = Main.rand.NextBool() ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; leviCenter.Y -= 5; //Shoot a bit more up since boulders are affected by gravity } @@ -439,7 +439,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.ai[1] += 1f; bool spawnedAberration = false; - float aberrationSpawnDelay = CalamityWorld.LegendaryMode ? 20f : (!sirenAlive || phase4) ? 60f : 50f; + float aberrationSpawnDelay = Main.zenithWorld ? 20f : (!sirenAlive || phase4) ? 60f : 50f; if (NPC.ai[1] > aberrationSpawnDelay) { NPC.ai[1] = 0f; @@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.Leviathan spawnedAberration = true; } - int spawnLimit = CalamityWorld.LegendaryMode ? 10 : (sirenAlive && !phase4) ? 0 : 2; + int spawnLimit = Main.zenithWorld ? 20 : Main.getGoodWorld ? 6 : (sirenAlive && !phase4) ? 0 : 2; if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit && NPC.ai[2] <= spawnLimit) { SoundEngine.PlaySound(soundChoice with { Pitch = soundChoice.Pitch + extrapitch }, npcCenter); @@ -562,7 +562,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge && (!sirenAlive || phase4)) lineupSpeed += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lineupSpeed *= 1.15f; Vector2 leviChargeCenter = npcCenter; @@ -598,7 +598,7 @@ namespace CalamityMod.NPCs.Leviathan chargeAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 35ddf96f39..7aeb82cfcf 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToWater = false; NPC.Calamity().ProvidesProximityRage = false; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.8f; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index dfed057395..5b812c76be 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -421,7 +421,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) { - float spawnRateDivisor = CalamityWorld.LegendaryMode ? 125f : CalamityWorld.revenge ? 425f : 500f; + float spawnRateDivisor = CalamityWorld.revenge ? 425f : 500f; return 1 / spawnRateDivisor; } } diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index 34e87385bb..0da926be3c 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 15; NPC.damage = 16; NPC.knockBackResist = 0.45f; + NPC.npcSlots = 1.15f; // Equal to the strongest variants NPC.value = Item.buyPrice(silver: 1); Banner = NPCID.Zombie; BannerItem = ItemID.ZombieBanner; diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 0ab71a7709..0908378d3d 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.NormalNPCs bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.rand.NextBool(5)) NPC.reflectsProjectiles = true; @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.NormalNPCs Vector2 idealVelocity = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (death ? 7f : 5.5f); float acceleration = death ? 0.14f : 0.105f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { idealVelocity *= 1.2f; acceleration *= 1.4f; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index fc28052dc9..4d0f33e355 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -85,8 +85,8 @@ namespace CalamityMod.NPCs.NormalNPCs npcPos.X += velocity.X; npcPos.Y += velocity.Y; - int spread = CalamityWorld.LegendaryMode ? 100 : 20; - for (int i = 0; i < (CalamityWorld.LegendaryMode ? 10 : 2); i++) + int spread = 20; + for (int i = 0; i < 2; i++) { velocity = Main.player[NPC.target].Center - npcPos; targetDist = velocity.Length(); @@ -404,7 +404,7 @@ namespace CalamityMod.NPCs.NormalNPCs { return 0f; } - return SpawnCondition.Sky.Chance * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f); + return SpawnCondition.Sky.Chance * 0.1f; } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/WildBumblebirb.cs b/NPCs/NormalNPCs/WildBumblebirb.cs index 9ad32c868c..6734a6b014 100644 --- a/NPCs/NormalNPCs/WildBumblebirb.cs +++ b/NPCs/NormalNPCs/WildBumblebirb.cs @@ -154,8 +154,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerIdleTargetDist.Normalize(); swarmerIdleTargetDist *= swarmerIdleSpeed; NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; } else if (NPC.velocity.Length() > 2f) NPC.velocity *= 0.95f; @@ -202,8 +200,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerChargeTargetDist.Normalize(); swarmerChargeTargetDist *= swarmerChargeSpeed; NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; NPC.ForceNetUpdate(); @@ -230,8 +226,6 @@ namespace CalamityMod.NPCs.NormalNPCs swarmerDecelerateTargetDist.Normalize(); swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; @@ -247,8 +241,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = NPC.defDamage; NPC.velocity = swarmerDecelerateTargetDist; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - NPC.velocity *= 1.15f; if (NPC.velocity.X < 0f) NPC.direction = -1; diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 8546cfcaf7..525ddc4bdb 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Spawn some off-screen enemies to act as threats if the player enters the field. if (Main.netMode != NetmodeID.MultiplayerClient) { - int enemiesToSpawn = CalamityWorld.LegendaryMode ? 4 : CalamityWorld.death ? 3 : CalamityWorld.revenge ? 2 : 1; + int enemiesToSpawn = Main.getGoodWorld ? 4 : CalamityWorld.death ? 3 : CalamityWorld.revenge ? 2 : 1; for (int i = 0; i < enemiesToSpawn; i++) { int tries = 0; @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.NormalNPCs else if (tries < 500 && Main.zenithWorld) { //Summon the army - int npcToSpawn = CalamityWorld.LegendaryMode ? 0 : Main.rand.Next(0, 4); + int npcToSpawn = Main.rand.Next(0, 4); switch (enemiesToSpawn) { case 0: @@ -186,11 +186,11 @@ namespace CalamityMod.NPCs.NormalNPCs Dust.NewDust(npcAtIndex.position, npcAtIndex.width, npcAtIndex.height, DustID.Electric); } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { laserDelay--; NPC.spriteDirection = (player.Center.X - NPC.Center.X < 0).ToDirectionInt(); - for (int times = CalamityWorld.LegendaryMode ? 3 : 2; times > 0 && laserDelay == 0; times--) + for (int times = 3; times > 0 && laserDelay == 0; times--) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitX * 6f * NPC.spriteDirection, NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 4.5f, ProjectileID.SaucerMissile, 10, 0f); } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 784c9cd5f4..7a041ec944 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.zenithWorld) { int spread = 15; - for (int times = CalamityWorld.LegendaryMode ? 3 : 2; times > 0; times--) + for (int times = 3; times > 0; times--) { Vector2 velocity = NPC.SafeDirectionTo(player.Center, Vector2.UnitY) * 6f; Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2, 3), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread)); diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 6d089b7204..a93af36bb5 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -128,8 +128,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.direction = direction; NPC.ForceNetUpdate(); } - //GOTTA GO FAST (Legendary only) - if (CalamityWorld.LegendaryMode) + //GOTTA GO FAST (FTW only) + if (Main.getGoodWorld) { NPC.velocity *= 1.01f; //Overcharged diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 56c020c681..fe522f1f96 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -317,8 +317,8 @@ namespace CalamityMod.NPCs.NormalNPCs } } } - //Become a spark piñata in Legendary - if (CalamityWorld.LegendaryMode && Supercharged) + //Become a spark piñata in FTW + if (Main.getGoodWorld && Supercharged) { for (int Sparks = Main.rand.Next(2, 5); Sparks > 0; Sparks--) { diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index ced5a43f1d..abb690b689 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -97,11 +97,11 @@ namespace CalamityMod.NPCs.NormalNPCs if (Supercharged) { SuperchargeTimer--; - NPC.defense = CalamityWorld.LegendaryMode ? 20 : 13; + NPC.defense = Main.getGoodWorld ? 20 : 13; } else if (!Supercharged) { - NPC.defense = CalamityWorld.LegendaryMode ? 10 : 4; + NPC.defense = Main.getGoodWorld ? 10 : 4; } Player player = Main.player[NPC.target]; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.projectile[mine].hostile = true; Main.projectile[mine].timeLeft = 60; } - mineDelay = CalamityWorld.LegendaryMode ? 3 : 5; + mineDelay = 3; } else if (Main.zenithWorld && mineDelay >= 1) mineDelay--; diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index d45c0316c4..b568b5ea57 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.OldDuke public static float Phase2ContactDamageMult = 1.1f; // 308 public static float Phase3ContactDamageMult = 1.2f; // 336 - public static int GoreDamage = 60; // 240 + public static int GoreDamage = 55; // 220 public static int VortexDamage = 105; // 420 // GFB exclusive @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.OldDuke bool death = CalamityWorld.death || BossRushEvent.BossRushActive; float exhaustionGateValue = 360f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) exhaustionGateValue *= 0.5f; float numberOfAttacksBeforeExhaustion = 12f; @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) chargeVelocity *= 1.25f; if (exhausted) @@ -363,9 +363,23 @@ namespace CalamityMod.NPCs.OldDuke // Disable contact damage while tired NPC.damage = 0; - // Play exhausted sound + // Play exhausted sound and huff fumes if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) + { SoundEngine.PlaySound(HuffSound with { Volume = HuffSound.Volume * 1.25f }, Main.LocalPlayer.Center); + for (int i = 0; i < 40; i++) + { + float scale = Main.rand.NextFloat(1f, 3f); + Vector2 fumePos = NPC.Center + NPC.rotation.ToRotationVector2() * (Main.rand.NextBool() ? 100f : 80f) * NPC.direction; + Vector2 fumeVel = Vector2.UnitX * NPC.velocity.X + Vector2.UnitY.RotatedByRandom(MathHelper.ToRadians(12f)) * scale * -8f * Main.rand.NextFloat(1f, 1.25f); + MediumMistParticle fume = new(fumePos, fumeVel, GlowColor, Color.DarkSlateGray, scale, 150f); + GeneralParticleHandler.SpawnParticle(fume); + } + + Vector2 pulsePos = NPC.Center + NPC.rotation.ToRotationVector2() * 88f * NPC.direction; + CustomPulse pulse = new(pulsePos, Vector2.Zero, Color.White * 0.2f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.125f, 30); + GeneralParticleHandler.SpawnParticle(pulse); + } if (Main.zenithWorld) { @@ -450,7 +464,7 @@ namespace CalamityMod.NPCs.OldDuke } // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode) + if (Main.zenithWorld) chargeTime *= 2; // Set variables for spawn effects @@ -748,7 +762,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 1f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 10f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 10f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -914,7 +928,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); @@ -958,7 +972,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); @@ -1108,7 +1122,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 6f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 8f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 8f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1257,13 +1271,13 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase2GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + int totalGore = Main.getGoodWorld ? 40 : 20; for (int i = 0; i < totalGore; i++) { float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= Main.rand.NextFloat() + 0.5f; velocityY *= Main.rand.NextFloat() + 0.5f; @@ -1324,7 +1338,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); @@ -1486,7 +1500,7 @@ namespace CalamityMod.NPCs.OldDuke else if (NPC.ai[0] == 11f) { // The dumbest thing to ever exist - if (CalamityWorld.MaliceMode && NPC.ai[2] % 6f == 0f) + if (Main.zenithWorld && NPC.ai[2] % 6f == 0f) { // Rotation and direction int dir = Math.Sign(player.Center.X - NPC.Center.X); @@ -1620,13 +1634,13 @@ namespace CalamityMod.NPCs.OldDuke { Vector2 phase3GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; int type = ModContent.ProjectileType(); - int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + int totalGore = Main.getGoodWorld ? 40 : 20; for (int i = 0; i < totalGore; i++) { float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= Main.rand.NextFloat() + 0.5f; velocityY *= Main.rand.NextFloat() + 0.5f; @@ -1649,7 +1663,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 03bc136dcb..0b1fbeba78 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.OldDuke this.HideFromBestiary(); } - public static int ToothDamage = 60; // 240 + public static int ToothDamage = 55; // 220 public static int CloudDamage = 70; // 280 public override void SetDefaults() diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index ea7de4d8dd..d399c527f3 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.OldDuke if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) { int spawnX = NPC.width / 2; int type = ModContent.ProjectileType(); diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index 5811af7d54..516be41821 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -584,8 +584,7 @@ namespace CalamityMod.NPCs.Other public override void ModifyNPCLoot(NPCLoot npcLoot) { double pisquaredover6 = Math.Pow(MathHelper.Pi, 2) / 6; - npcLoot.AddIf(() => CalamityWorld.LegendaryMode, ModContent.ItemType()); // guaranteed in Legendary mode - npcLoot.AddIf(() => !CalamityWorld.LegendaryMode, ModContent.ItemType(), 27); // otherwise 1 in 27 + npcLoot.Add(ModContent.ItemType()); npcLoot.Add(ModContent.ItemType(), 1, 22, (int)(pisquaredover6 * 100)); } } diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 9d2065858e..05bf4dca42 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.Perforator public static int GetMediumPerforatorSegmentsCount() { - return CalamityWorld.LegendaryMode ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; + return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 5cdfd90c16..3889abcdb1 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -165,9 +165,9 @@ namespace CalamityMod.NPCs.Perforator // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; - bool spawnSmall = CalamityWorld.LegendaryMode ? lifeRatio < 0.85f : lifeRatio < 0.75f; - bool spawnMedium = CalamityWorld.LegendaryMode ? lifeRatio < 0.60f : lifeRatio < 0.50f; - bool spawnLarge = CalamityWorld.LegendaryMode ? lifeRatio < 0.45f : lifeRatio < 0.25f; + bool spawnSmall = Main.getGoodWorld ? lifeRatio < 0.85f : lifeRatio < 0.75f; + bool spawnMedium = Main.getGoodWorld ? lifeRatio < 0.60f : lifeRatio < 0.50f; + bool spawnLarge = Main.getGoodWorld ? lifeRatio < 0.45f : lifeRatio < 0.25f; if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f || !(player.ZoneCrimson || BossRushEvent.BossRushActive)) { @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Perforator } - if (CalamityWorld.LegendaryMode && lifeRatio < 0.5f) + if (Main.getGoodWorld && lifeRatio < 0.5f) { if (lifeRatio > 0.35f) NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) + if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || Main.getGoodWorld) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -433,7 +433,7 @@ namespace CalamityMod.NPCs.Perforator bool ichorBlobBigWormPhase = wormsAlive > 0 && largeSpawned; int numBlobs = expertMode ? (ichorBlobBigWormPhase ? 4 : 6) : (ichorBlobBigWormPhase ? 2 : 4); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numBlobs *= 2; int type = ModContent.ProjectileType(); @@ -445,7 +445,7 @@ namespace CalamityMod.NPCs.Perforator blobVelocity.Normalize(); blobVelocity *= Main.rand.Next(400, 801) * 0.01f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.25f; @@ -484,7 +484,7 @@ namespace CalamityMod.NPCs.Perforator SoundEngine.PlaySound(GeyserShoot, NPC.Center); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numProj *= 2; int spread = 75; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 43581aab22..0bd369b793 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float challengeAmt = (1f - lifeRatio) * 100f; float nukeBarrageChallengeAmt = (0.5f - lifeRatio) * 200f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { challengeAmt *= 1.5f; nukeBarrageChallengeAmt *= 1.5f; @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Missile countdown if (halfLife && MissileCountdown == 0) - MissileCountdown = CalamityWorld.LegendaryMode ? 300 : 600; + MissileCountdown = Main.getGoodWorld ? 300 : 600; if (MissileCountdown > 1) MissileCountdown--; @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (enrageScale > 1.5f) enrageScale = 1.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrageScale += 0.5f; bool diagonalDash = (revenge && phase2); @@ -539,8 +539,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (calamityGlobalNPC.newAI[0] > 90f) NPC.velocity *= 1.01f; - // Spawn honey in legendary rev+ - if (CalamityWorld.LegendaryMode && calamityGlobalNPC.newAI[0] % 6f == 0f) + // Spawn honey in the stupid seed + if (Main.zenithWorld && calamityGlobalNPC.newAI[0] % 6f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -798,7 +798,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.direction = playerLocation < 0 ? 1 : -1; NPC.spriteDirection = NPC.direction; - if (NPC.ai[2] > (CalamityWorld.LegendaryMode ? 3f : 5f)) + if (NPC.ai[2] > 5f) { NPC.ai[0] = -1f; NPC.ai[1] = 2f; diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 25af8a694d..9d828e3f88 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.Polterghast NPCID.Sets.TrailingMode[Type] = 1; } - public static int MineDamage = 75; // 300 + public static int MineDamage = 70; // 280 public override void SetDefaults() { @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -99,11 +99,11 @@ namespace CalamityMod.NPCs.Polterghast direction *= 0.5f; NPC.rotation = direction.ToRotation(); - if (!chargePhase || CalamityWorld.LegendaryMode) + if (!chargePhase || Main.getGoodWorld) { NPC.ai[2] += 1f; float shootMineGateValue = 150f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) shootMineGateValue *= 0.5f; if (NPC.ai[2] >= shootMineGateValue) @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.Polterghast if (SPEEN < 0f) SPEEN = 0f; - NPC.ai[1] += (CalamityWorld.LegendaryMode ? 1.5f : 0.5f) + SPEEN; + NPC.ai[1] += (Main.getGoodWorld ? 1.5f : 0.5f) + SPEEN; } public override Color? GetAlpha(Color drawColor) => new Color(200, 200, 200, 0); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index de5e306d6a..d1e74b8527 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.defense = 45; NPC.DR_NERD(0.1f); NPC.LifeMaxNERB(62500, 75000, 60000); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) NPC.lifeMax *= 4; NPC.knockBackResist = 0f; @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector = NPC.Center; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Polterghast spriteEffects = SpriteEffects.FlipHorizontally; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index cd6f59240f..f0ff0c4677 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -105,10 +105,10 @@ namespace CalamityMod.NPCs.Polterghast public static float Phase2ContactDamageMult = 1.25f; // 300 public static float Phase3ContactDamageMult = 1.5f; // 360 - public static int BlueShotDamage = 65; // 260 - public static int BlueBlastDamage = 70; // 280 - public static int RedShotDamage = 70; // 280 - public static int RedBlastDamage = 75; // 300 + public static int BlueShotDamage = 60; // 240 + public static int BlueBlastDamage = 65; // 260 + public static int RedShotDamage = 65; // 260 + public static int RedBlastDamage = 70; // 280 public override void SetDefaults() { @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.Polterghast // Velocity and acceleration calamityGlobalNPC.newAI[0] += 1f; float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = calamityGlobalNPC.newAI[0] >= chargePhaseGateValue; @@ -1103,7 +1103,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 44a72cfd55..1a19e9ce1f 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.Polterghast } } - public static int ShotDamage = 60; // 240 + public static int ShotDamage = 55; // 220 public override void SetDefaults() { @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.ai[2] += 1f; if (NPC.ai[3] == 0f) { - if (NPC.ai[2] > ((CalamityWorld.LegendaryMode) ? 12f : 120f)) + if (NPC.ai[2] > (Main.getGoodWorld ? 40f : 120f)) { NPC.ai[2] = 0f; NPC.ai[3] = 1f; @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Polterghast private void Movement(bool phase2, bool expertMode, bool revenge, bool death, bool speedBoost, bool despawnBoost, float lifeRatio, float tileEnrageMult, Player player) { float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -326,7 +326,7 @@ namespace CalamityMod.NPCs.Polterghast Color lightRed = new Color(255, 100, 100, 255); float chargePhaseGateValue = 480f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index d898aa06cd..8786ae0910 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -336,7 +336,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm float ancientDoomGateValue = death ? 95f : revenge ? 100f : expertMode ? 105f : 120f; float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { lightningRainDuration *= 0.5f; eidolonWyrmPhaseDuration *= 0.25f; @@ -454,7 +454,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm // Velocity and turn speed values float velocityScale = death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; float baseVelocity = (targetDownDeep ? 10f : 15f) + (targetDownDeep ? velocityScale : velocityScale * 1.5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseVelocity *= 1.15f; float turnSpeed = baseVelocity * 0.015f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 7080a84d05..c18317d5c6 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -65,15 +65,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - public static int FireDamage = 42; // 168; HolyFire, HolyFire2 - public static int SpearDamage = 55; // 220; HolySpear, ProfanedSpear - public static int HolyBlastDamage = 64; // 256 + public static int FireDamage = 36; // 144; HolyFire, HolyFire2 + public static int SpearDamage = 42; // 168; HolySpear, ProfanedSpear + public static int HolyBlastDamage = 60; // 240 public static int RayDamage = 80; // 320 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 110; // 220 + NPC.damage = 120; // 240 NPC.npcSlots = 20f; NPC.aiStyle = -1; NPC.width = 228; @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians AIType = -1; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(platinum: 1); + NPC.value = Item.buyPrice(gold: 50); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; @@ -369,9 +369,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; float maxChargeVelocity = death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; - if (CalamityWorld.LegendaryMode) - maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 2f; float inertia = death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; @@ -379,7 +377,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians inertia *= 0.8f; if (!phase1) inertia *= 0.75f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; bool speedUp = Vector2.Distance(NPC.Center, player.Center) > 960f; @@ -458,7 +456,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians calamityGlobalNPC.newAI[0] = -NPC.direction; float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; if (healerAlive) velocity *= 0.8f; @@ -786,7 +784,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; if (boostVelocityToCatchUp) velocity *= 2f; @@ -843,7 +841,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (NPC.ai[1] % spearShootDivisor == 0f) { float spearVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) spearVelocity *= 1.5f; @@ -898,7 +896,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float velocity = death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; calamityGlobalNPC.newAI[0] = -NPC.direction; @@ -916,7 +914,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Limit Y velocity while firing laser if (NPC.ai[1] >= laserGateValue) { - float speedCap = CalamityWorld.LegendaryMode ? 4f : 2f; + float speedCap = Main.getGoodWorld ? 4f : 2f; if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -973,7 +971,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (revenge) Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); - if (CalamityWorld.LegendaryMode) + if (CalamityWorld.death) { rotation *= 0.33f; laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); @@ -1201,7 +1199,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { npcLoot.Add(ModContent.ItemType(), 4); npcLoot.Add(ModContent.ItemType(), 7); - npcLoot.Add(ModContent.ItemType(), 5); + npcLoot.Add(ModContent.ItemType(), 4); npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ModContent.ItemType()); npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 15, 20, 20, 25)); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index f8fe31cd81..096b038dc9 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -54,16 +54,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - public static int FireDamage = 42; // 168; HolyFlare - public static int BlobDamage = 42; // 168 - public static int FireSentryDamage = 55; // 220; HolyBomb - public static int MoltenBlastDamage = 55; // 220 + public static int FireDamage = 36; // 144; HolyFlare + public static int BlobDamage = 36; // 144 + public static int FireSentryDamage = 54; // 216; HolyBomb + public static int MoltenBlastDamage = 54; // 216 public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 110; // 220 + NPC.damage = 108; // 216 NPC.npcSlots = 3f; NPC.aiStyle = -1; NPC.width = 228; @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; float maxChargeVelocity = death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; // Whether the commander is calling all guardians together for the laser attack @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float moveVelocity = death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) moveVelocity *= 1.25f; if (healerAlive) moveVelocity *= 0.8f; @@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = (commanderUsingLaser || commanderGoingLowOrHighInPhase1) ? 10f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -487,7 +487,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] >= -throwRocksGateValue) { NPC.velocity *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.velocity *= 0.5f; } @@ -548,7 +548,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = commanderGoingLowOrHighInPhase2 ? 8f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index fda7a1b29a..2f7cc1f54d 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -50,6 +50,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Main.npcFrameCount[Type] = 10; NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { PortraitPositionXOverride = 0, @@ -67,8 +68,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - public static int CrystalDamage = 55; // 220 - public static int StarDamage = 55; // 220; HolyBurnOrb + public static int CrystalDamage = 48; // 192 + public static int StarDamage = 54; // 216; HolyBurnOrb public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight @@ -76,7 +77,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 100; // 200 + NPC.damage = 0; // No contact damage NPC.npcSlots = 3f; NPC.aiStyle = -1; NPC.width = 228; @@ -135,9 +136,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians { CalamityGlobalNPC.doughnutBossHealer = NPC.whoAmI; - // Avoid cheap bullshit - NPC.damage = 0; - Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1.1f, 0.9f, 0f); if (CalamityGlobalNPC.doughnutBoss < 0 || !Main.npc[CalamityGlobalNPC.doughnutBoss].active) @@ -216,7 +214,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool useCrystalShards = AIState == (float)Phase.CrystalShards; float velocity = useCrystalShards ? (death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 1.25f; float idealDistanceFromDestination = useCrystalShards ? 80f : 160f; @@ -250,7 +248,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = 10f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -403,7 +401,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float inertia = death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 234672c46b..d9988fbf75 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -208,7 +208,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Start off slow Vector2 finalVelocity = NPC.SafeDirectionTo(player.Center, -Vector2.UnitY) * chargeSpeed; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) finalVelocity *= Main.rand.NextFloat(1f, 1.7f); NPC.Calamity().newAI[2] = finalVelocity.X; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 3ba404d415..6c9361bfb6 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -169,6 +169,7 @@ namespace CalamityMod.NPCs.Providence Main.npcFrameCount[Type] = 3; NPCID.Sets.TrailingMode[Type] = 1; NPCID.Sets.BossBestiaryPriority.Add(Type); + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { Scale = 0.2f, @@ -237,14 +238,14 @@ namespace CalamityMod.NPCs.Providence base.ModifyHoverBoundingBox(ref boundingBox); } - public static int FireDamage = 42; // 168; HolyFire, HolyFire2, HolyFlare - public static int BlobDamage = 42; // 168 - public static int FireSentryDamage = 55; // 220; HolyBomb - public static int MoltenBlastDamage = 55; // 220 - public static int StarDamage = 55; // 220; HolyBurnOrb - public static int SpearDamage = 55; // 220 - public static int CrystalDamage = 55; // 220 - public static int HolyBlastDamage = 64; // 256 + public static int FireDamage = 36; // 144; HolyFire, HolyFire2, HolyFlare + public static int BlobDamage = 36; // 144 + public static int FireSentryDamage = 54; // 216; HolyBomb + public static int MoltenBlastDamage = 54; // 216 + public static int StarDamage = 54; // 216; HolyBurnOrb + public static int SpearDamage = 42; // 168 + public static int CrystalDamage = 48; // 192 + public static int HolyBlastDamage = 60; // 240 public static int RayDamage = 100; // 400 public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight @@ -273,7 +274,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.25f; } @@ -854,7 +855,7 @@ namespace CalamityMod.NPCs.Providence velocity = 30f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.2f; acceleration *= 1.2f; @@ -870,12 +871,12 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= CalamityWorld.LegendaryMode ? 0.4f : 0.2f; + NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += CalamityWorld.LegendaryMode ? 0.4f : 0.2f; + NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) speedCap *= 1.5f; if (NPC.velocity.Y > speedCap) @@ -1524,7 +1525,7 @@ namespace CalamityMod.NPCs.Providence { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1551,7 +1552,7 @@ namespace CalamityMod.NPCs.Providence { Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 589c2fea98..1807ed445f 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -491,7 +491,7 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] += 1f; } - float jumpGateValue = CalamityWorld.LegendaryMode ? 0f : 180f; + float jumpGateValue = Main.getGoodWorld ? 0f : 180f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -588,30 +588,6 @@ namespace CalamityMod.NPCs.Ravager bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityWorld.LegendaryMode) - { - if (!expertMode || anyRockPillars || anyFlamePillars) - SoundEngine.PlaySound(PillarSound, NPC.Center); - - // Eruption of bouncing rock projectiles - float projectileVelocity = 12f; - int type = ModContent.ProjectileType(); - Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; - destination.Normalize(); - destination *= projectileVelocity; - int numProj = 11; - float rotation = MathHelper.ToRadians(90); - for (int i = 0; i < numProj; i++) - { - // Spawn projectiles 0, 1, 2, 3, 7, 8, 9 and 10 - if (i < 4 || i > 6) - { - Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, RockDamage, 0f, Main.myPlayer); - } - } - } - if (expertMode) { foreach (NPC n in Main.ActiveNPCs) @@ -630,12 +606,12 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(PillarSound, NPC.Center); } - if (!anyRockPillars || CalamityWorld.LegendaryMode) + if (!anyRockPillars || Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } - else if (!anyFlamePillars || CalamityWorld.LegendaryMode) + else if (!anyFlamePillars || Main.getGoodWorld) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index cceffde46d..b1eb2b27f6 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Signus NPC.height = 130; NPC.defense = 60; NPC.LifeMaxNERB(320000, 375000, 380000); - NPC.value = Item.buyPrice(platinum: 1); + NPC.value = Item.buyPrice(gold: 50); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; @@ -140,12 +140,12 @@ namespace CalamityMod.NPCs.Signus double lifeRatio = NPC.life / (double)NPC.lifeMax; - lifeToAlpha = (int)((CalamityWorld.LegendaryMode ? 200D : 100D) * (1D - lifeRatio)); + lifeToAlpha = (int)((Main.getGoodWorld ? 200D : 100D) * (1D - lifeRatio)); int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; int maxTeleports = (death && lifeRatio < 0.9) ? 1 : revenge ? 2 : expertMode ? 3 : 4; float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { inertia *= 0.5f; chargeVelocity *= 1.15f; @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.Signus else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (lifeToAlpha < (CalamityWorld.LegendaryMode ? 100 : 50) && NPC.ai[0] != 1f) + if (lifeToAlpha < (Main.getGoodWorld ? 100 : 50) && NPC.ai[0] != 1f) { for (int i = 0; i < 2; i++) { @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.Signus playerYDist *= playerDistance; float inertia2 = 50f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia2 *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia2 + playerXDist) / (inertia2 + 1f); @@ -294,7 +294,7 @@ namespace CalamityMod.NPCs.Signus if (expertMode) NPC.localAI[1] += death ? 3f * (float)(1D - lifeRatio) : 2f * (float)(1D - lifeRatio); - if (NPC.localAI[1] >= (CalamityWorld.LegendaryMode ? 0f : 120f)) + if (NPC.localAI[1] >= (Main.getGoodWorld ? 0f : 120f)) { NPC.localAI[1] = 0f; @@ -563,7 +563,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalLamps = (CalamityWorld.LegendaryMode && !Main.zenithWorld) ? 10 : 5; + int totalLamps = (Main.getGoodWorld && !Main.zenithWorld) ? 10 : 5; if (NPC.CountNPCS(ModContent.NPCType()) < totalLamps) { bool buffed = false; @@ -690,12 +690,8 @@ namespace CalamityMod.NPCs.Signus if ((phase2 || buffed) && NPC.ai[2] % 3f == 0f) { SoundEngine.PlaySound(SoundID.Item73, NPC.Center); - int type = (CalamityWorld.LegendaryMode) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - Vector2 velocity = Main.zenithWorld ? new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) : Vector2.Zero; - if (CalamityWorld.LegendaryMode && !Main.zenithWorld) - { - velocity = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); - } + int type = Main.zenithWorld ? ModContent.ProjectileType() : ModContent.ProjectileType(); + Vector2 velocity = Main.rand.NextVector2Circular(Main.zenithWorld ? 10f : 0f, Main.zenithWorld ? 10f : 0f); int ai = buffed ? 69 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, velocity, type, DustDamage, 0f, Main.myPlayer, ai); } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index ab8ea6601f..fd9842e659 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -29,11 +29,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 360 : 180; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : 180; NPC.knockBackResist = 0.7f; AnimationType = NPCID.Slimer; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index 35eb93535f..2a4539f271 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -26,11 +26,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : CalamityWorld.LegendaryMode ? 180 : 90; + NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : 90; NPC.knockBackResist = 0.9f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 70d731eb17..acbf43a7cf 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -25,11 +25,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 220 : 110; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : 110; NPC.knockBackResist = 0.8f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 635c400287..49d8410197 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -34,11 +34,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode) - NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : CalamityWorld.LegendaryMode ? 260 : 130; + NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : 130; NPC.knockBackResist = 0.7f; NPC.lavaImmune = false; NPC.noGravity = false; diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 92b31f87e7..852cfe7269 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { // Spread of random globs in meme mode - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index c45b32cdef..b28982e265 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.SlimeGod setDamage += SlimeGodCore.PossessionDamageBoost; } - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; NPC.aiAction = 0; // Get a target @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.netMode != NetmodeID.MultiplayerClient) { - int numProjectiles = CalamityWorld.LegendaryMode ? 12 : death ? 6 : 4; + int numProjectiles = Main.getGoodWorld ? 12 : death ? 6 : 4; float projectileVelocity = death ? 8f : 6f; int type = ModContent.ProjectileType(); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; for (int i = 0; i < numProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) destination *= Main.rand.NextFloat() + 0.5f; Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProjectiles - 1))); @@ -486,15 +486,13 @@ namespace CalamityMod.NPCs.SlimeGod // Charge variables float chargeVelocityMult = 0.1f; float maxChargeVelocity = enraged ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; - if (CalamityWorld.LegendaryMode) - maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxChargeVelocity *= 2f; float inertia = death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; if (lifeRatio < 0.75f) inertia *= 0.8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) inertia *= 0.8f; // Start charge diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index df352658d5..e305a07cb0 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.npcSlots = 10f; NPC.width = 96; NPC.height = 98; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale = 2f; NPC.defense = 6; @@ -529,7 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod flySpeed += 3f; if (phase2) flySpeed *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) flySpeed *= 1.3f; Vector2 flyDestination = aggressionLevel >= (int)AggressionLevel.ChargeAtPlayer ? player.Center : player.Center - Vector2.UnitY * 320f; @@ -571,10 +571,8 @@ namespace CalamityMod.NPCs.SlimeGod float maxInertiaDistance = 600f; float totalInertiaAdjustmentDistance = maxInertiaDistance - minInertiaDistance; float distanceFromInertiaAdjustmentCutoff = distanceFromFlyDestination - minInertiaDistance; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxInertia *= 0.8f; - if (CalamityWorld.LegendaryMode) - maxInertia *= Main.rand.NextFloat(0.2f, 1f); float inertia = distanceFromFlyDestination >= maxInertiaDistance ? maxInertia : distanceFromFlyDestination <= minInertiaDistance ? minInertia : diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 985b530688..54c404647b 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index b827299dcf..94812533c6 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; - float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; + float scale = Main.getGoodWorld ? 0.8f : 1f; // How fast the slime slams down float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index ec54f5f5de..70d85d9033 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - public static int LaserDamage = 55; // 220 + public static int LaserDamage = 54; // 216 public override void SetDefaults() { @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.StormWeaver Player player = Main.player[NPC.target]; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !revenge)) + if (phase2 && (!Main.zenithWorld || !revenge)) { // Spawn armor gore and set other crucial variables if (!NPC.chaseable) @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && (!Main.zenithWorld || !revenge); bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 2254d75035..1b104433df 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.StormWeaver public static int LightningDamage = 64; // 256 public static int FrostWaveDamage = 64; // 256 - public static int TornadoDamage = 66; // 264 + public static int TornadoDamage = 72; // 288 public override void SetDefaults() { @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 74; NPC.lifeMax = 825000; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 500000); - NPC.value = Item.buyPrice(platinum: 1); + NPC.value = Item.buyPrice(gold: 50); // Phase one settings CalamityGlobalNPC global = NPC.Calamity(); @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings - if (phase2 && !CalamityWorld.LegendaryMode) + if (phase2 && !Main.zenithWorld) { // Spawn armor gore, roar and set other crucial variables if (!NPC.chaseable) @@ -278,7 +278,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Used for body and tail projectile firing timings in phase 1 - if (!phase2 || CalamityWorld.LegendaryMode) + if (!phase2 || Main.zenithWorld) NPC.localAI[0] += 1f; } @@ -618,7 +618,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.4f; acceleration *= 1.4f; @@ -829,7 +829,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && !CalamityWorld.LegendaryMode; + bool phase2 = lifeRatio < 0.8f && !Main.zenithWorld; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index f4a1862d72..3608b9cc4d 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.StormWeaver else if (Main.expertMode) NPC.scale *= 1.1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !CalamityWorld.revenge)) + if (phase2 && (!Main.zenithWorld || !CalamityWorld.revenge)) { // Spawn armor gore and set other crucial variables if (NPC.takenDamageMultiplier == 2f) @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && (!Main.zenithWorld || !revenge); bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index 027c5905b4..f172a5c609 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -334,7 +334,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (CurrentBehavior == (int)PhaseType.Idle) { - pathfinding.ClearResults(); + pathfinding?.ClearResults(); CurrentBehavior = (int)PhaseType.Flee; AlertPolyp(); } diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index ad485a77d8..7dde9bb49e 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -3,6 +3,7 @@ using CalamityMod.Enums; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Projectiles.Enemy; +using CalamityMod.Tiles.SunkenSea; using CalamityMod.Tiles.SunkenSea.Ambient; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -118,7 +119,7 @@ namespace CalamityMod.NPCs.SunkenSea // TODO // Change this to kelp when it's added - int tileType = ModContent.TileType(); + int tileType = ModContent.TileType(); // Assure the kelp still exists, if it's gone, clear the tile if ((TileX != 0 || TileY != 0) && t.TileType != tileType) diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 7d8bdd188c..10c78e8c89 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(spark2); } - float distanceFromSCal = CalamityWorld.LegendaryMode ? 300f : 225f; + float distanceFromSCal = Main.getGoodWorld ? 300f : 225f; NPC.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * distanceFromSCal - NPC.Size * 0.5f; NPC.velocity = Vector2.Zero; RotationalDegreeOffset += 0.5f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 94eb32e22f..28130edbd6 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -253,16 +253,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public static int DartDamage = 85; // 340 - public static int SkullDamage = 90; // 360 - public static int HellblastDamage = 100; // 400 - public static int FireblastDamage = 100; // 400 - public static int GigablastDamage = 110; // 440 + public static int DartDamage = 80; // 320 + public static int SkullDamage = 85; // 340 + public static int HellblastDamage = 95; // 380 + public static int FireblastDamage = 95; // 380 + public static int GigablastDamage = 105; // 420 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 220; // 440 + NPC.damage = 210; // 420 NPC.npcSlots = 50f; NPC.width = NPC.height = 44; NPC.defense = 100; @@ -455,8 +455,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Used for Scal's teleport at the start of brothers phase bool teleport = false; - // permafrost and zenith scal are mutually exclusive unless it's legendary - bool zenithAI = Main.zenithWorld && (!permafrost || (CalamityWorld.LegendaryMode && permafrost)); + // permafrost and zenith scal are mutually exclusive + bool zenithAI = Main.zenithWorld && !permafrost; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -472,7 +472,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int bodyHeight = 42; int baseBulletHellProjectileGateValue = revenge ? 8 : expertMode ? 9 : 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) baseBulletHellProjectileGateValue -= 2; Vector2 vectorCenter = NPC.Center; @@ -1952,9 +1952,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { SoundEngine.PlaySound(SoundID.Item74, NPC.Center); - int totalSeekers = CalamityWorld.LegendaryMode ? 20 : 10; + int totalSeekers = Main.getGoodWorld ? 20 : 10; int degreesBetweenEachSeeker = 360 / totalSeekers; - int distanceFromSCal = CalamityWorld.LegendaryMode ? 300 : 225; + int distanceFromSCal = Main.getGoodWorld ? 300 : 225; for (int i = 0; i < totalSeekers; i++) { int FireEye = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(vectorCenter.X + (Math.Sin(i * degreesBetweenEachSeeker) * distanceFromSCal)), (int)(vectorCenter.Y + (Math.Cos(i * degreesBetweenEachSeeker) * distanceFromSCal)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); @@ -2165,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2279,7 +2279,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2381,7 +2381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2460,7 +2460,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2732,7 +2732,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2841,7 +2841,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2915,7 +2915,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2999,7 +2999,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index dc946029a9..c4ff5971a3 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public static int FistDamage = 105; // 420 + public static int FistDamage = 100; // 400 public override void SetDefaults() { diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index a86a36d1ec..e6179b759c 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public static int SlashDamage = 105; // 420 + public static int SlashDamage = 100; // 400 public static int TrailedSlashDamage = 120; // 480 public override void SetDefaults() diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index 0a62a3a2f0..0ce196767d 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -65,6 +65,8 @@ namespace CalamityMod.NPCs.TownNPCs NPC.catchItem = (short)ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; NPC.dontTakeDamage = true; + NPC.Calamity().VulnerableToSickness = false; + NPC.Calamity().VulnerableToElectricity = true; } public override bool CanChat() => false; diff --git a/NPCs/TownNPCs/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index bd63a27136..9e3e4458ef 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -65,6 +65,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.8f; AnimationType = NPCID.Guide; + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index 99f0e985d1..c87c764726 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -70,6 +70,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.5f; AnimationType = NPCID.PartyGirl; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/TownNPCs/BrimstoneWitch.cs b/NPCs/TownNPCs/BrimstoneWitch.cs index 2657f75b43..e2ddf3ba9c 100644 --- a/NPCs/TownNPCs/BrimstoneWitch.cs +++ b/NPCs/TownNPCs/BrimstoneWitch.cs @@ -66,6 +66,9 @@ namespace CalamityMod.NPCs.TownNPCs NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath6; NPC.knockBackResist = 0.8f; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/TownNPCs/SeaKing.cs b/NPCs/TownNPCs/SeaKing.cs index f920b1a131..d7680a3acc 100644 --- a/NPCs/TownNPCs/SeaKing.cs +++ b/NPCs/TownNPCs/SeaKing.cs @@ -61,6 +61,10 @@ namespace CalamityMod.NPCs.TownNPCs NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.65f; AnimationType = NPCID.Guide; + NPC.Calamity().VulnerableToElectricity = true; + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToSickness = true; + NPC.Calamity().VulnerableToWater = false; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index 8d979d3d03..cfdfcb7410 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -17,7 +17,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const int SpinRadius = 45; // Rev+ exclusive - public static int BloodShotDamage = 11; // 44 + public static float ContactDamageMult = 1.15f; // 62 (buffed from 54) + public static int BloodShotDamage = 12; // 48 public static bool BuffedBrainofCthulhuAI(NPC npc, Mod mod) { @@ -86,7 +87,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 if (npc.ai[0] < 0f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) NPC.brainOfGravity = npc.whoAmI; // Spawn gore @@ -216,7 +217,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); float nonChargeSpeed = (death ? 25.5f : 18f) + velocityBoost; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) nonChargeSpeed *= 1.15f; float minInertia = death ? 50f : 75f; @@ -247,7 +248,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); } // Teleport @@ -270,7 +271,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 1.15f; } } @@ -287,7 +288,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (!Main.dedServ) { @@ -315,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -chargeVelocity; if (death) npc.velocity *= 1.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 1.15f; } } @@ -478,7 +479,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == -1f || npc.ai[0] == -6f) { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -705,7 +706,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetYDistPhase1 = Main.player[npc.target].Center.Y - brainCenterPhase1.Y; float targetDistancePhase1 = (float)Math.Sqrt(targetXDistPhase1 * targetXDistPhase1 + targetYDistPhase1 * targetYDistPhase1); float maxMoveVelocity = (death ? 4f : 1.5f) + velocityScale; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) maxMoveVelocity *= 2f; if (targetDistancePhase1 < maxMoveVelocity) @@ -954,12 +955,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!brainIsInPhase2) { // Set damage - npc.damage = npc.defDamage; + npc.damage = (int)Math.Round(npc.defDamage * ContactDamageMult); Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f : Vector2.Zero); Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { targetDirection *= chargeVelocity + 6f; npc.velocity = (npc.velocity * 49f + targetDirection) / 50f; @@ -1013,7 +1014,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetBrainOfCthuluCreepersCountRevDeath() { - return CalamityWorld.LegendaryMode ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; + return Main.getGoodWorld ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; } private static float GetCrimsonBossKnockBack(NPC npc, int numPlayers, float lifeScale, float baseKnockBackResist) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index 404908d767..9c2853f6ba 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int idleTime = phase8 ? 20 : phase7 ? 30 : phase3 ? 35 : 40; float timeToFinishRitual = phase8 ? 180f : phase7 ? 240f : phase5 ? 300f : 360f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { iceMistFireRate = 40; iceMistSpeed = 15f; @@ -1195,7 +1195,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses kill = true; if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = CalamityWorld.LegendaryMode ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : death ? 5 : 4; + int totalProjectiles = Main.getGoodWorld ? 9 : (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss && !phase3) ? 8 : death ? 5 : 4; float radians = MathHelper.TwoPi / totalProjectiles; Vector2 spinningPoint = new Vector2(0f, -splitProjVelocity); for (int k = 0; k < totalProjectiles; k++) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index 389bca8d8b..8fba6d9d83 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -25,9 +25,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static Vector2 lastDeerclopsPosition; // Vanilla values - public static int IceSpikeDamage = 13; // 52 public static int DebrisDamage = 18; // 72 - public static int HandDamage = 10; // 40 + + // Rev+ exclusive + public static int IceSpikeDamage = 16; // 64 (buffed from 52) + public static int HandDamage = 13; // 52 (buffed from 40) public static bool BuffedDeerclopsAI(NPC npc, Mod mod) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 5bb3ee3d51..78436ec1da 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -175,7 +175,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Total segment variable - int totalSegments = CalamityWorld.LegendaryMode ? 100 : 80; + int totalSegments = Main.getGoodWorld ? 100 : 80; // Calculate aggression based on how many broken segments there are float brokenSegmentAggressionMultiplier = 1f; @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speed *= brokenSegmentAggressionMultiplier; turnSpeed *= brokenSegmentAggressionMultiplier; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity *= 1.2f; speed *= 1.2f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index a717274bf3..a6c99486c7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -61,7 +61,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idlePhaseVelocity = 10f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { idlePhaseAcceleration *= 1.15f; idlePhaseVelocity *= 1.15f; @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity *= 1.13f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeVelocity *= 1.15f; int bubbleBelchPhaseTimer = death ? 60 : 80; @@ -97,7 +97,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleBelchPhaseAcceleration = death ? 0.35f : 0.3f; float bubbleBelchPhaseVelocity = death ? 5.5f : 5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { bubbleBelchPhaseAcceleration *= 1.5f; bubbleBelchPhaseVelocity *= 1.5f; @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleSpinPhaseVelocity = 20f; float bubbleSpinPhaseRotation = MathHelper.TwoPi / (bubbleSpinPhaseTimer / 2); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) bubbleSpinBubbleVelocity *= 1.5f; int spawnEffectPhaseTimer = 75; @@ -188,11 +188,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 3f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeTime += Main.rand.Next(5, 66); // Spawn cthulhunadoes in phase 3 - if (phase3AI && ((!phase4 && !deathModeSurprise) || CalamityWorld.LegendaryMode)) + if (phase3AI && ((!phase4 && !deathModeSurprise) || Main.getGoodWorld)) { calamityGlobalNPC.newAI[0] += 1f; float timeGateValue = 600f; @@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int attackPicker = 0; switch ((int)npc.ai[3]) @@ -589,7 +589,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int phase2AttackPicker = 0; switch ((int)npc.ai[3]) @@ -730,7 +730,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 phase2BubbleSharkronDirection = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + npc.Center; int phase2Bubbles = NPC.NewNPC(npc.GetSource_FromAI(), (int)phase2BubbleSharkronDirection.X, (int)phase2BubbleSharkronDirection.Y + 45, NPCID.DetonatingBubble); Main.npc[phase2Bubbles].target = npc.target; - Main.npc[phase2Bubbles].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity * (CalamityWorld.LegendaryMode ? (Main.rand.NextFloat() + 0.5f) : 1f); + Main.npc[phase2Bubbles].velocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * bubbleSpinBubbleVelocity * (Main.getGoodWorld ? (Main.rand.NextFloat() + 0.5f) : 1f); Main.npc[phase2Bubbles].netUpdate = true; Main.npc[phase2Bubbles].ai[3] = Main.rand.Next(80, 121) / 100f; @@ -861,7 +861,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase switch npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || CalamityWorld.LegendaryMode) + if (npc.ai[2] >= idlePhaseTimer || Main.zenithWorld) { int phase3AttackPicker = 0; if (phase4) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index f2d3702a09..7aade7a6d2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -18,6 +18,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float DRIncreaseTime = 600f; // Rev+ exclusive + public static float HeadDamageMult = 1.25f; // 60 (buffed from 48) + public static float BodyDamageMult = 1.5f; // 30 (buffed from 20) + public static float TailDamageMult = 1.5f; // 26 (buffed from 17) public static int FireballDamage = 12; // 48; Applies to both Cursed Flames and (Death) Shadowflame fireballs public static bool BuffedEaterofWorldsAI(NPC npc, Mod mod) @@ -26,14 +29,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + // Set contact damage + npc.damage = (int)Math.Round(npc.defDamage * (npc.type == NPCID.EaterofWorldsHead ? HeadDamageMult : npc.type == NPCID.EaterofWorldsBody ? BodyDamageMult : TailDamageMult)); + // Causes it to split far more in death mode - if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || CalamityWorld.LegendaryMode) + if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || Main.getGoodWorld) { calamityGlobalNPC.DR = 0.5f; npc.defense = npc.defDefense * 2; } - if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofWorldsHead) + if (Main.getGoodWorld && npc.type == NPCID.EaterofWorldsHead) npc.reflectsProjectiles = true; // Get a target @@ -76,7 +82,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] -= 1f; int vileSpitGateValue = (int)MathHelper.Lerp(death ? 45f : 90f, 900f, lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) vileSpitGateValue = (int)(vileSpitGateValue * 0.5f); Vector2 vileSpitShootLocation = npc.Center + npc.velocity; @@ -378,7 +384,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { segmentVelocity += 4f; segmentAcceleration += 0.05f; @@ -415,7 +421,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int npcWidth = npc.width; npcWidth = (int)(npcWidth * npc.scale); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npcWidth = 62; targetDistance = (targetDistance - npcWidth) / targetDistance; @@ -707,7 +713,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetEaterOfWorldsSegmentsCountRevDeath() { - return CalamityWorld.LegendaryMode ? 100 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 57 : 62; + return Main.getGoodWorld ? 100 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 57 : 62; } } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index b4672ca23f..5a5ab61042 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool visible = true; bool takeDamage = true; float lessTimeSpentPerPhaseMultiplier = phase2 ? (death ? 0.375f : 0.5f) : (death ? 0.75f : 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lessTimeSpentPerPhaseMultiplier *= 0.2f; float extraPhaseTime; @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; float idleTimer = phase2 ? (death ? 10f : 15f) : (death ? 20f : 30f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) idleTimer *= 0.5f; if (idleTimer < 10f) idleTimer = 10f; @@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] < 60f) AI_120_HallowBoss_DoMagicEffect(npc.Center + randomStreakOffset, 1, Utils.GetLerpValue(0f, 60f, npc.ai[1], clamped: true), npc); - int streakSpawnFrequency = CalamityWorld.LegendaryMode ? 1 : 2; + int streakSpawnFrequency = Main.getGoodWorld ? 1 : 2; if (phase3) streakSpawnFrequency *= 2; @@ -441,21 +441,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); if (phase3) { - int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, -rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - ai3); - if (Main.rand.NextBool(60) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj2].extraUpdates += 1; - Main.projectile[proj2].netUpdate = true; - } - } - - if (Main.rand.NextBool(60) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + randomStreakOffset, -rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - ai3); } } @@ -637,7 +626,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] % 42f == 0f && npc.ai[1] < 42f) { float projRotation = MathHelper.TwoPi * Main.rand.NextFloat(); - float totalProjectiles = CalamityWorld.LegendaryMode ? 30f : death ? (dayTimeEnrage ? 22f : 15f) : (dayTimeEnrage ? 18f : 13f); + float totalProjectiles = Main.getGoodWorld ? 30f : death ? (dayTimeEnrage ? 22f : 15f) : (dayTimeEnrage ? 18f : 13f); int projIndex = 0; bool inversePhase2SpreadPattern = Main.rand.NextBool(); for (float i = 0f; i < 1f; i += 1f / totalProjectiles) @@ -653,7 +642,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float initialVelocity = death ? 2f : 1.75f; if (dayTimeEnrage && projIndex % 2 == 0) initialVelocity *= 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) initialVelocity *= 1.5f; // Given that maxAddedVelocity = 2 @@ -935,11 +924,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, ai3); - if (Main.rand.NextBool(30) && CalamityWorld.LegendaryMode) - { + if (Main.getGoodWorld) Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; - } } // Spawn extra homing Rainbow Streaks per player. @@ -1171,22 +1157,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 vector = new Vector2(0f, (death ? -24f : -22f) - (phase3 ? ((death ? 6f : 4f) * streakHomeTime) : 0f)).RotatedBy(MathHelper.TwoPi * streakHomeTime); if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, streakHomeTime); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, streakHomeTime); if (phase3) { int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, npc.target, 1f - streakHomeTime); - if (Main.rand.NextBool(15) && CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { Main.projectile[proj2].extraUpdates += 1; Main.projectile[proj2].netUpdate = true; } } - - if (Main.rand.NextBool(15) && CalamityWorld.LegendaryMode) - { - Main.projectile[proj].extraUpdates += 1; - Main.projectile[proj].netUpdate = true; - } } // Spawn extra homing Rainbow Streaks per player. diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index d948eacfd0..a5cd8b3f9e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -14,9 +14,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { private const float ProjectileOffset = 50f; - // Vanilla values - public static float Phase2ContactDamageMult = 1.2f; // 36 - public static float Phase3ContactDamageMult = 1.333f; // 40 + // Rev+ exclusive + public static float Phase1ContactDamageMult = 1.333f; // 40 (buffed from 30) + public static float Phase2ContactDamageMult = 1.6f; // 48 (buffed from 36) + public static float Phase3ContactDamageMult = 1.8f; // 54 (buffed from 40) public static int BloodShotDamage = 8; // 32 public static bool BuffedEyeofCthulhuAI(NPC npc, Mod mod) @@ -44,6 +45,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpDist = death ? 15f : 20f; + // Set contact damage + npc.damage = (int)Math.Round(npc.defDamage * (phase3 ? Phase3ContactDamageMult : phase2 ? Phase2ContactDamageMult : Phase1ContactDamageMult)); + // Servant and projectile velocity, the projectile velocity is multiplied by 2 float servantAndProjectileVelocity = death ? 10f : 6f; npc.reflectsProjectiles = false; @@ -130,7 +134,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hoverSpeed = death ? 9.5f + 7f * (1f - lifeRatio) : 7f; float hoverAcceleration = death ? 0.2f + 0.15f * (1f - lifeRatio) : 0.15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 3f; hoverAcceleration += 0.08f; @@ -159,7 +163,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; float servantSpawnGateValue = death ? 10f : 40f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) servantSpawnGateValue *= 0.8f; if (npc.ai[3] >= servantSpawnGateValue && shootProjectile) @@ -207,7 +211,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = (death ? 10.5f : 8f) + npc.ai[3] * additionalVelocityPerCharge; if (death) chargeSpeed += 10f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 4f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -218,7 +222,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 2f) { int chargeDelay = death ? (75 - (int)Math.Round(30f * (1f - lifeRatio))) : 95; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeDelay -= 30; float slowDownGateValue = chargeDelay * (death ? 0.85f : 0.65f); @@ -231,7 +235,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses decelerationScalar = 0f; npc.velocity *= (MathHelper.Lerp(death ? 0.76f : 0.92f, death ? 0.88f : 0.96f, decelerationScalar)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.velocity *= 0.99f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) @@ -273,7 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.reflectsProjectiles = true; if (npc.ai[0] == 1f) @@ -292,13 +296,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; float phaseChangeRate = death ? 2f : 1f; - float servantSpawnGateValue = CalamityWorld.LegendaryMode ? 4f : 20f; + float servantSpawnGateValue = Main.getGoodWorld ? 4f : 20f; npc.ai[1] += phaseChangeRate; if (npc.ai[1] % servantSpawnGateValue == 0f) { float servantVelocity = death ? 11.3f : 5.65f; Vector2 servantSpawnVelocity = Main.rand.NextVector2CircularEdge(servantVelocity, servantVelocity); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) servantSpawnVelocity *= 3f; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; @@ -310,21 +314,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.dedServ && servantSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, servantSpawn); - - if (CalamityWorld.LegendaryMode) - { - int type = ProjectileID.BloodNautilusShot; - Vector2 projectileVelocity = Main.rand.NextVector2CircularEdge(15f, 15f); - int numProj = 3; - int spread = 20; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, 15, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 600; - } - } } for (int n = 0; n < 10; n++) @@ -373,7 +362,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { npc.defense = 0; - npc.damage = (int)Math.Round(npc.defDamage * (phase3 ? Phase3ContactDamageMult : Phase2ContactDamageMult)); if (npc.ai[1] == 0f & phase3) npc.ai[1] = 5f; @@ -402,7 +390,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { hoverSpeed += 1f; hoverAcceleration += 0.1f; @@ -458,7 +446,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeSpeed *= 1.15f; if (npc.ai[3] == 2f) chargeSpeed *= 1.3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -688,14 +676,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.dedServ && eye < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye); } - else if (!CalamityWorld.LegendaryMode) + else if (!Main.getGoodWorld) { int projType = ProjectileID.BloodNautilusShot; int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { int type = ProjectileID.BloodNautilusShot; Vector2 projectileVelocity = servantSpawnVelocity * 3f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index bbbacdbfe6..fcbbdc7270 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -64,12 +64,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage); @@ -90,13 +90,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool headAlive = NPC.AnyNPCs(NPCID.GolemHead); bool leftFistAlive = NPC.AnyNPCs(NPCID.GolemFistLeft); bool rightFistAlive = NPC.AnyNPCs(NPCID.GolemFistRight); - npc.dontTakeDamage = (headAlive || leftFistAlive || rightFistAlive) && !CalamityWorld.LegendaryMode; + npc.dontTakeDamage = headAlive || leftFistAlive || rightFistAlive; // Distance required for despawning int despawnDistance = turboEnrage ? 7500 : enrage ? 6000 : 4500; // Deactivate torches - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.velocity.Y > 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.velocity.Y > 0f) { for (int j = (int)(npc.position.X / 16f); (float)j < (npc.position.X + (float)npc.width) / 16f; j++) { @@ -113,7 +113,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn arm dust - if (!CalamityWorld.LegendaryMode) + if (!Main.getGoodWorld) { if (!leftFistAlive) { @@ -185,7 +185,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] > 0f) { npc.ai[1] += death ? 1.5f : 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[1] += 100f; if (enrage || death) @@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float speedMult = 1f; float multiplier = turboEnrage ? 0.00275f : enrage ? 0.0025f : 0.00175f; - if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) + if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage)) speedMult += distanceBelowTarget * multiplier; float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speedMult = speedMultLimit; if (Main.player[npc.target].position.Y < npc.Bottom.Y) - npc.velocity.Y = (((turboEnrage || CalamityWorld.LegendaryMode) ? -15.5f : -11.75f) + (enrage ? -4f : 0f)) * speedMult; + npc.velocity.Y = ((turboEnrage ? -15.5f : -11.75f) + (enrage ? -4f : 0f)) * speedMult; else npc.velocity.Y = 1f; @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float speedMult = 1f; float multiplier = turboEnrage ? 0.0025f : enrage ? 0.002f : 0.0015f; - if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage || CalamityWorld.LegendaryMode)) + if (distanceBelowTarget > 0f && ((!leftFistAlive && !rightFistAlive) || turboEnrage)) speedMult += distanceBelowTarget * multiplier; float speedMultLimit = turboEnrage ? 3.25f : enrage ? 3f : 2.5f; @@ -369,7 +369,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Fireball explosion when head is detached - if (Main.netMode != NetmodeID.MultiplayerClient && (!headAlive || turboEnrage || CalamityWorld.LegendaryMode)) + if (Main.netMode != NetmodeID.MultiplayerClient && (!headAlive || turboEnrage)) { for (int i = 0; i < 10; i++) { @@ -403,7 +403,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses destination.Normalize(); destination *= projectileVelocity; int totalFireballsPerSide = 3; - int totalIterations = (turboEnrage && CalamityWorld.LegendaryMode) ? 11 : death ? 40 : 60; + int totalIterations = turboEnrage ? 11 : death ? 40 : 60; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < totalIterations; i++) { @@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(totalIterations - 1))); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.UnitY * (npc.height / 2 * 0.8f) * npc.scale + Vector2.Normalize(perturbedSpeed) * (npc.width / 3) * npc.scale, perturbedSpeed, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = enrage ? 480 : 150; // The difference is meant to be this stark. - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[proj].extraUpdates += 1; } } @@ -474,8 +474,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses void CustomGravity(bool isSlamming) { - float gravity = turboEnrage ? (CalamityWorld.LegendaryMode ? 1.15f : 0.85f) : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; - float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? (CalamityWorld.LegendaryMode ? 40f : 30f) : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; + float gravity = turboEnrage ? 0.85f : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; + float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? 30f : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; if (isSlamming && !reduceFallSpeed) { gravity *= 4f; @@ -545,15 +545,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; - float aggression = turboEnrage ? (CalamityWorld.LegendaryMode ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; + float aggression = turboEnrage ? 3f : enrage ? 2f : death ? 1.7f : 1f; Vector2 fistCenter = golem.Center + golem.velocity + new Vector2(0f, -9f * npc.scale); fistCenter.X += (float)((npc.type == NPCID.GolemFistLeft) ? -84 : 78) * npc.scale; @@ -635,7 +635,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Dust dust = Dust.NewDustPerfect(npc.Center + largeRandDustRecoil + largeRandDustRadius + smallRandDustRadius, 228, largeRandDustRecoil); dust.fadeIn = 1.5f; dust.scale = 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) dust.noLight = true; dust.noGravity = true; @@ -676,7 +676,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) { for (int j = (int)(npc.position.X / 16f) - 1; (float)j < (npc.position.X + (float)npc.width) / 16f + 1f; j++) { @@ -820,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Count body parts bool leftFistAlive = NPC.AnyNPCs(NPCID.GolemFistLeft); bool rightFistAlive = NPC.AnyNPCs(NPCID.GolemFistRight); - npc.dontTakeDamage = (leftFistAlive || rightFistAlive) && !CalamityWorld.LegendaryMode; + npc.dontTakeDamage = leftFistAlive || rightFistAlive; // Stay in position on top of body npc.Center = Main.npc[NPC.golemBoss].Center - new Vector2(3f, 57f) * npc.scale; @@ -838,12 +838,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; // Alpha @@ -996,7 +996,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[bodyLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[bodyLaser].extraUpdates += 1; npc.netUpdate = true; @@ -1025,7 +1025,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int extraLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[extraLasers].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[extraLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1059,7 +1059,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int extraLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnLocation + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, ProjectileID.EyeBeam, LaserDamage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[extraLasers].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[extraLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1084,7 +1084,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Laser fire if arms are dead - if ((!leftFistAlive && !rightFistAlive) || death || CalamityWorld.LegendaryMode) + if ((!leftFistAlive && !rightFistAlive) || death || Main.getGoodWorld) { if (npc.ai[0] <= 1f) npc.ai[0] = 1f; @@ -1138,12 +1138,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; } else - turboEnrage = CalamityWorld.LegendaryMode; + turboEnrage = Main.getGoodWorld; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) enrage = true; // Float through tiles or not @@ -1284,7 +1284,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int spreadLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), spawnLocation + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, ProjectileID.EyeBeam, LaserDamage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[spreadLasers].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[spreadLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1342,12 +1342,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int damage = LaserDamage; int freeHeadLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), freeHeadProjSpawn + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, damage, 0f, Main.myPlayer); Main.projectile[freeHeadLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && CalamityWorld.LegendaryMode) + if (turboEnrage) Main.projectile[freeHeadLaser].extraUpdates += 1; } } - if (!CalamityWorld.LegendaryMode) + if (!Main.getGoodWorld) { npc.position += npc.netOffset; int randDustOffset = Main.rand.Next(2) * 2 - 1; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 83b4b1c189..d9d895141c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool teleported = false; npc.aiAction = 0; float teleportScaleSpeed = 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { teleportScaleSpeed -= 1f - lifeRatio; teleportScale *= teleportScaleSpeed; @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 60f) @@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) @@ -513,7 +513,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float jumpVelocityLimit = redCrystalAlive ? 3f : 4.5f; if (death) jumpVelocityLimit += 3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) jumpVelocityLimit = 8f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocityLimit) || (npc.direction == -1 && npc.velocity.X > -jumpVelocityLimit)) @@ -551,12 +551,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; // Adjust size based on HP - float maxScale = CalamityWorld.LegendaryMode ? 3f : death ? 2.5f : 1.5f; + float maxScale = Main.getGoodWorld ? 3f : death ? 2.5f : 1.5f; float minScale = death ? 0.5f : 0.75f; float maxScaledValue = maxScale - minScale; // Inversed scale in FTW - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) lifeRatio = (maxScaledValue - lifeRatio * maxScaledValue) + minScale; else lifeRatio = lifeRatio * maxScaledValue + minScale; @@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.rand.NextBool(100)) npcType = NPCID.Pinky; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) npcType = NPCID.RainbowSlime; int offset = 16; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs index 3d1f562c38..f6c6d16f79 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) aggressionLevel = 6; if (npc.type == NPCID.MoonLordCore) @@ -820,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] < 0f) { npc.localAI[1] = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && Main.remixWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { for (int k = 0; k < 30; k++) { @@ -1863,7 +1863,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeRotation.X, npc.Center.Y + freeEyeRotation.Y, trueEyeSphereDirection.X, trueEyeSphereDirection.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { for (int k = 0; k < 3; k++) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index 838fd80a88..8093a7ec60 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocity *= 1.15f; acceleration *= 1.15f; @@ -315,7 +315,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 36 : 30; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; + float velocity2 = Main.getGoodWorld ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) { @@ -522,7 +522,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = secondCharge ? 6 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; + float velocity2 = Main.getGoodWorld ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) { @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrage) npc.localAI[1] += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.localAI[1] += 1f; float shootProjectileGateValue = death ? 30f : 60f; @@ -671,7 +671,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - bool shootPoisonSeed = (CalamityWorld.LegendaryMode || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; + bool shootPoisonSeed = (Main.getGoodWorld || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; float projectileSpeed = death ? 16f : 14f; int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; @@ -724,15 +724,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 2f; int totalTentacles = death ? 12 : 8; - if (CalamityWorld.LegendaryMode) - totalTentacles += 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalTentacles *= 2; for (int i = 0; i < totalTentacles; i++) NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { foreach (NPC n in Main.ActiveNPCs) { @@ -1088,7 +1086,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hookMoveDistance = (float)Math.Sqrt(hookMoveX * hookMoveX + hookMoveY * hookMoveY); if (hookMoveDistance < 12f + velocity) { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.localAI[3] == 1f) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.localAI[3] == 1f) { npc.localAI[3] = 0f; WorldGen.SpawnPlanteraThorns(npc.Center); @@ -1099,7 +1097,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) + if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) npc.localAI[3] = 1f; hookMoveDistance = velocity / hookMoveDistance; @@ -1133,7 +1131,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.rand.NextBool(5)) npc.reflectsProjectiles = true; @@ -1208,7 +1206,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) tentacleAcceleration += 4f; // Fast retraction diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index d2cd39bd11..b695a3093d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -45,16 +45,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.position.Y / 16f) < Main.worldSurface && enrage) { calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 0.5f; + enrageScale += 1f; } if (!Main.player[npc.target].ZoneJungle && enrage) { calamityGlobalNPC.CurrentlyEnraged = true; - enrageScale += 0.5f; + enrageScale += 1f; } - if (CalamityWorld.LegendaryMode) - enrageScale += 1f; + if (Main.getGoodWorld) + enrageScale += 0.5f; if (enrageScale > maxEnrageScale) enrageScale = maxEnrageScale; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index c16a8274e0..2949c7af76 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { int numGelProjectiles = 12; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) numGelProjectiles = 15; float gelVelocity = death ? 20f : 16f; @@ -345,7 +345,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 spinningpoint = new Vector2(gelVelocity, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((float)(-j) * MathHelper.TwoPi / (float)numGelProjectiles, Vector2.Zero); @@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; float jumpVelocity = death ? 7f : 4.5f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) jumpVelocity = 12f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity)) @@ -516,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) slamDelay = 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) slamDelay = 0; if (npc.velocity.Y == 0f) @@ -628,7 +628,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y += death ? 1.75f : 1.5f; float slamVelocity = death ? 15.5f : 15f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { npc.velocity.Y += 1f; slamVelocity = 15.99f; @@ -733,8 +733,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numGelProjectiles = phase4 ? Main.rand.Next(9, 12) : phase2 ? Main.rand.Next(6, 9) : 12; if (phase5) numGelProjectiles += 6; - if (CalamityWorld.LegendaryMode) - numGelProjectiles = 20; + if (Main.getGoodWorld) + numGelProjectiles = 15; float projectileVelocity = death ? 12f : 10.5f; int type = ProjectileID.QueenSlimeGelAttack; @@ -745,7 +745,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float rotation = MathHelper.ToRadians(120); for (int i = 0; i < numGelProjectiles; i++) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) destination *= Main.rand.NextFloat() + 0.5f; Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1))); @@ -759,7 +759,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 spinningpoint = new Vector2(projectileVelocity, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((-j) * MathHelper.TwoPi / numGelProjectiles, Vector2.Zero); @@ -871,7 +871,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float slimeSpawnHealthGateValue = CalamityWorld.LegendaryMode ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f; + float slimeSpawnHealthGateValue = Main.zenithWorld ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f; if (death) slimeSpawnHealthGateValue *= 0.5f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 830249b332..4d20d1977f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -162,39 +162,39 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Hand variables bool handsDead = numHandsAlive == 0; - int numProj = CalamityWorld.LegendaryMode ? 22 : death ? 5 : 3; - float spread = CalamityWorld.LegendaryMode ? 180 : 60; + int numProj = Main.getGoodWorld ? 22 : death ? 5 : 3; + float spread = Main.getGoodWorld ? 180 : 60; float headSpinVelocityMult = phase3 ? 12f : 4.5f; switch (numHandsAlive) { case 0: - numProj = CalamityWorld.LegendaryMode ? 36 : death ? 9 : 7; - spread = CalamityWorld.LegendaryMode ? 180 : death ? 90 : 82; + numProj = Main.getGoodWorld ? 36 : death ? 9 : 7; + spread = Main.getGoodWorld ? 180 : death ? 90 : 82; headSpinVelocityMult = phase3 ? 12f : 6f; break; case 1: - numProj = CalamityWorld.LegendaryMode ? 27 : death ? 7 : 5; - spread = CalamityWorld.LegendaryMode ? 150 : death ? 76 : 68; + numProj = Main.getGoodWorld ? 27 : death ? 7 : 5; + spread = Main.getGoodWorld ? 150 : death ? 76 : 68; headSpinVelocityMult = phase3 ? 11.5f : 5f; break; case 2: - numProj = CalamityWorld.LegendaryMode ? 18 : death ? 6 : 4; - spread = CalamityWorld.LegendaryMode ? 140 : death ? 70 : 62; + numProj = Main.getGoodWorld ? 18 : death ? 6 : 4; + spread = Main.getGoodWorld ? 140 : death ? 70 : 62; headSpinVelocityMult = phase3 ? 11f : 4.5f; break; case 3: - numProj = CalamityWorld.LegendaryMode ? 15 : death ? 5 : 3; - spread = CalamityWorld.LegendaryMode ? 130 : death ? 64 : 56; + numProj = Main.getGoodWorld ? 15 : death ? 5 : 3; + spread = Main.getGoodWorld ? 130 : death ? 64 : 56; headSpinVelocityMult = phase3 ? 10.5f : 4f; break; case 4: - numProj = CalamityWorld.LegendaryMode ? 12 : death ? 4 : 3; - spread = CalamityWorld.LegendaryMode ? 120 : 56; + numProj = Main.getGoodWorld ? 12 : death ? 4 : 3; + spread = Main.getGoodWorld ? 120 : 56; headSpinVelocityMult = phase3 ? 10f : 3.5f; break; } @@ -354,7 +354,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((handsDead || death) && npc.ai[1] == 0f && !phase4) { float skullProjFrequency = phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) skullProjFrequency *= 0.8f; skullProjFrequency = (float)Math.Ceiling(skullProjFrequency); @@ -428,11 +428,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - float headYAcceleration = (CalamityWorld.LegendaryMode ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); + float headYAcceleration = (Main.getGoodWorld ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); float headYTopSpeed = headYAcceleration * 100f; - float headXAcceleration = (CalamityWorld.LegendaryMode ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); + float headXAcceleration = (Main.getGoodWorld ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); float headXTopSpeed = headXAcceleration * 100f; - float deceleration = CalamityWorld.LegendaryMode ? 0.83f : death ? 0.86f : 0.89f; + float deceleration = Main.getGoodWorld ? 0.83f : death ? 0.86f : 0.89f; float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; @@ -518,7 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin charge else if (npc.ai[1] == 1f) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { npc.reflectsProjectiles = true; if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 0f) @@ -545,7 +545,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) { if (!NPC.AnyNPCs(NPCID.DiabolistWhite)) { @@ -619,7 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float dashPhaseTime = death ? 210f : 300f; if (npc.ai[2] >= dashPhaseTime) { - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.DarkCaster) < 6) { @@ -707,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult *= baseDistanceVelocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) headSpinVelocityMult *= 1.3f; headSpinTargetDist = headSpinVelocityMult / headSpinTargetDist; @@ -868,7 +868,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityMultiplier = MathHelper.Lerp(death ? 0.6f : 0.7f, 1f, skeletronLifeRatio); float velocityIncrement = MathHelper.Lerp(0.2f, death ? 0.4f : 0.3f, 1f - skeletronLifeRatio); float handSwipeVelocity = MathHelper.Lerp(16f, death ? 24f : 20f, 1f - skeletronLifeRatio); - float deceleration = CalamityWorld.LegendaryMode ? 0.78f : death ? 0.82f : 0.86f; + float deceleration = Main.getGoodWorld ? 0.78f : death ? 0.82f : 0.86f; if (death) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 77cd83cc81..fc48a09a9c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int LaserDamage = 25; // 100 // Rev+ exclusive - public static int SkullDamage = 25; // 100 + public static int SkullDamage = 22; // 88 public static int RocketDamage = 30; // 120 public static bool BuffedSkeletronPrimeAI(NPC npc, Mod mod) @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f || npc.ai[1] == 4f) { // Start other phases; if arms are dead, start with spin phase - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) + if (phase2 || Main.getGoodWorld || allArmsDead) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index b9c320c399..5cbbaedfe1 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int FireballDamage = 22; // 88; Applies to both fireball types // Rev+ exclusive - public static int LaserDamage = 23; // 92 (buffed) + public static int LaserDamage = 21; // 84 (buffed) public static int RedLaserDamage = 27; // 108 (buffed) public static int HomingDartDamage = 27; // 108 @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -202,7 +202,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[3] += 0.5f; } @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = death ? 18f : 15f; if (death) chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; float acceleration = death ? 0.1975f + 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -463,7 +463,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -520,7 +520,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeSpeed = (death ? 25f : 22f) + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (!spazAlive) chargeSpeed += 2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; @@ -630,7 +630,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -773,7 +773,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -818,7 +818,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[3] += 0.4f; } @@ -845,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1029,7 +1029,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (distanceFromDestination > distanceFromTarget) maxVelocity += MathHelper.Lerp(0f, death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -1118,7 +1118,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float chargeSpeed = (death ? 22.8f : 18f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1192,7 +1192,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float spazmatismPhase3ChargeSpeed = (death ? 23f : 20f) + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (npc.ai[2] == -1f || (!retAlive && npc.ai[3] == secondFastCharge)) spazmatismPhase3ChargeSpeed *= 1.3f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) spazmatismPhase3ChargeSpeed *= 1.2f; Vector2 distanceVector = Main.player[npc.target].Center - npc.Center; @@ -1293,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 70a5fb1b21..e1fe967125 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = lifeRatio < 0.66f; bool phase3 = lifeRatio < 0.33f; - if (CalamityWorld.LegendaryMode && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) + if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) { if (NPC.CountNPCS(NPCID.FireImp) < 4) { @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; if (phase3) npc.ai[1] += 1f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) npc.ai[1] += 9f; if (npc.ai[1] > 2700f) @@ -323,7 +323,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) velocityX *= 1.2f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { velocityX *= 1.1f; velocityX += 0.1f; diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index 16c8b29ac6..f9db3ad02d 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -4167,7 +4167,7 @@ PrepareToShoot: if (Main.netMode != NetmodeID.MultiplayerClient && !targetDead) { - if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofSouls) + if (Main.getGoodWorld && npc.type == NPCID.EaterofSouls) { if (NPC.AnyNPCs(NPCID.EaterofWorldsHead)) { @@ -5433,7 +5433,7 @@ PrepareToShoot: } else { - if (CalamityWorld.LegendaryMode && npc.type == NPCID.FireImp) + if (Main.getGoodWorld && npc.type == NPCID.FireImp) { if (NPC.AnyNPCs(NPCID.WallofFlesh)) { @@ -6790,15 +6790,8 @@ PrepareToShoot: int projType = ProjectileID.SandBallFalling; - // If Legendary is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) - int projAmt = 1; - if (CalamityWorld.LegendaryMode) - { - projAmt = Main.rand.Next(8, 14); - if (Main.rand.NextBool(1000) || Main.zenithWorld) - projAmt = Main.rand.Next(80, 131); - } - + // In FTW, can fire 8 sand balls (100 in stupid meme seed) + int projAmt = Main.zenithWorld ? 100 : Main.getGoodWorld ? 8 : 1; for (int i = 0; i < projAmt; i++) { // Adjust the velocity to make it a shotgun-like spread diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 2c2ca4eb76..8304c47e1a 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -97,18 +97,18 @@ namespace CalamityMod.NPCs.Yharon } } - public static int FlareDamage = 72; // 288; FlareBomb, FlareDust, FlareDust2 - public static int FireballDamage = 72; // 288 - public static int TornadoDamage = 90; // 360; Flarenado, Infernado, Infernado2 + public static int FlareDamage = 66; // 264; FlareBomb, FlareDust, FlareDust2 + public static int FireballDamage = 66; // 264 + public static int TornadoDamage = 85; // 340; Flarenado, Infernado, Infernado2 public static int BordernadoDamage = 125; // 500; SkyFlareRevenge // GFB exclusive - public static int VortexDamage = 90; // 360 + public static int VortexDamage = 85; // 340 public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 220; // 440 + NPC.damage = 210; // 420 NPC.npcSlots = 50f; NPC.width = 200; NPC.height = 200; @@ -368,12 +368,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)Main.topWorld; - safeBox.Width = Main.zenithWorld ? 3000 : CalamityWorld.LegendaryMode ? 2000 : revenge ? 6000 : 7000; + safeBox.Width = Main.zenithWorld ? 3000 : Main.getGoodWorld ? 2000 : revenge ? 6000 : 7000; safeBox.Height = Main.maxTilesY * 16; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -395,7 +395,7 @@ namespace CalamityMod.NPCs.Yharon protectionBoost = false; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) phaseSwitchTimer /= 2; // Set DR based on protection boost (aka enrage) @@ -1808,7 +1808,7 @@ namespace CalamityMod.NPCs.Yharon chargeSpeed *= velocityMult; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) phaseSwitchTimer *= 0.5f; if (NPC.ai[0] == 0f) diff --git a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs index d9d042c6df..9be0eb5191 100644 --- a/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSwordHoldoutProjectile.cs @@ -366,6 +366,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { var player = Main.player[Projectile.owner]; + Projectile.gfxOffY = player.gfxOffY; var modplayer = player.GetModPlayer(); float adust = MathHelper.ToRadians(225); if (timer < StartupTime || timer > StartupTime + swingTime) @@ -393,7 +394,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles if (AfterImageLength > 0) { oldProjectileRot.Add(Projectile.rotation); - oldProjectilePos.Add(Projectile.Center); + oldProjectilePos.Add(Projectile.Center + new Vector2(0, Projectile.gfxOffY)); if (oldProjectileRot.Count > AfterImageLength) { oldProjectileRot.RemoveAt(0); @@ -440,11 +441,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles var col = Projectile.Opacity * (i / (float)AfterImageLength) * 0.1f; if (Projectile.spriteDirection == 1) { - Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, oldScale[i], SpriteEffects.None, 0); } else { - Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, 1, SpriteEffects.FlipHorizontally, 0); + Main.EntitySpriteDraw(texture, oldProjectilePos[i] - Main.screenPosition, null, Color.White * col, oldProjectileRot[i], texture.Size() / 2, oldScale[i], SpriteEffects.FlipHorizontally, 0); } } } diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index f2e9d814cd..ea5ebbe5b6 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Projectile.timeLeft = death ? 60 : revenge ? 68 : expertMode ? 75 : 90; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.timeLeft /= 2; } @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss // Determine opacity float telegraphTotalTime = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) telegraphTotalTime *= 0.5f; Projectile.Opacity = Utils.GetLerpValue(0f, 6f, Projectile.timeLeft, true) * Utils.GetLerpValue(telegraphTotalTime, telegraphTotalTime - 6f, Projectile.timeLeft, true); diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 5bf8a352df..ce9f32c87a 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; Projectile.timeLeft = timeLeft; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index cd81ae8c20..197657c4fe 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index fc740c018b..b3c3cdd0de 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 600; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index de5275700d..2bf79eff7a 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -134,8 +134,6 @@ namespace CalamityMod.Projectiles.Boss Vector2 projVelocity = Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, BrimstoneElemental.DartDamage, 0f, Main.myPlayer, death ? 2f : 1f, 0f, projectileVelocityToPass); Main.projectile[proj].tileCollide = true; - if (CalamityWorld.LegendaryMode) - Main.projectile[proj].extraUpdates += 1; } fireFrom += velocity * distanceBetweenProjectiles; } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 498edb8a4e..69a37de561 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 53e95b4bfe..d0de4c0066 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DesertScourgeSpit.cs b/Projectiles/Boss/DesertScourgeSpit.cs index 8f1271c812..7f66e9cd0f 100644 --- a/Projectiles/Boss/DesertScourgeSpit.cs +++ b/Projectiles/Boss/DesertScourgeSpit.cs @@ -25,12 +25,10 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 16; Projectile.height = 16; - if (CalamityWorld.LegendaryMode) - Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; + Projectile.timeLeft = 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 7336ec46f6..50ffd783ae 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 960; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index dcaba5ba77..f1c0368464 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Boss center.Y += 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 11f, Projectile.ai[1] - 1f); } - int tornadoSpeed = 10; + int tornadoSpeed = 15; int breakThreshold = 300; Projectile.localAI[1] += 1f; bool breakapart = Main.zenithWorld && Projectile.localAI[1] >= breakThreshold; @@ -128,9 +128,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - - if (CalamityWorld.LegendaryMode) - Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 480) diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index cbceb613d7..86ac452813 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -22,12 +22,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 10; Projectile.height = 10; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; + Projectile.timeLeft = Main.getGoodWorld ? 900 : 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 90d11517e0..9fcca7cfd2 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 0ac7a0ce8b..693c5353ec 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 0a3936aef6..b64fc8f3e2 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -93,12 +93,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -109,12 +109,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); diff --git a/Projectiles/Boss/HomingGasBulbSporeGas.cs b/Projectiles/Boss/HomingGasBulbSporeGas.cs index f7f002d02e..2fbf24928d 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.ai[1] += 1f; - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { Projectile.localAI[0] += 10f; } @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.rotation += Projectile.direction * 0.002f; - if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 2f : 0.5f)) + if (Projectile.velocity.Length() > (Main.getGoodWorld ? 2f : 0.5f)) Projectile.velocity *= 0.985f; if (Projectile.timeLeft <= 40) @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f) + if (Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f) target.AddBuff(BuffID.Poisoned, 240); } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index a312ab8007..884a3aa3af 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss center.Y += 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 11f, Projectile.ai[1] - 1f); } - int tornadoSpeed = 10; + int tornadoSpeed = 15; int breakThreshold = 300; Projectile.localAI[1] += 1f; bool breakapart = Main.zenithWorld && Projectile.localAI[1] >= breakThreshold; @@ -130,9 +130,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.localAI[1] == breakThreshold && Main.zenithWorld) { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - - if (CalamityWorld.LegendaryMode) - Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 600) diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index f23933c8f6..19d312fc7d 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) velocity *= 2f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index ace2a64f74..ddc7a8bf6c 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= Projectile.ai[0]; } - if (CalamityWorld.LegendaryMode) + if (Main.getGoodWorld) { if (Projectile.velocity.Length() >= Projectile.ai[0]) { diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index cc42d08de0..a4e68db418 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss else { Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= (CalamityWorld.LegendaryMode ? 10f : 36f)) + if (Projectile.ai[0] >= (Main.getGoodWorld ? 10f : 36f)) { Projectile.ai[0] = 0f; int rainSpawnX = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28)); diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 37da7212b3..f84715fe34 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { Projectile.ai[1] += 1f; - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { Projectile.localAI[0] += 10f; Projectile.damage = 0; @@ -68,17 +68,17 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.rotation += Projectile.direction * 0.002f; - if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 4f : 2f)) + if (Projectile.velocity.Length() > (Main.getGoodWorld ? 4f : 2f)) Projectile.velocity *= 0.985f; } - public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f; + public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f; public override Color? GetAlpha(Color lightColor) { - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) + if (Projectile.ai[1] > (Main.getGoodWorld ? 600f : 900f)) { - byte b2 = (byte)((26f - (Projectile.ai[1] - (CalamityWorld.LegendaryMode ? 600f : 900f))) * 10f); + byte b2 = (byte)((26f - (Projectile.ai[1] - (Main.getGoodWorld ? 600f : 900f))) * 10f); byte a2 = (byte)(Projectile.alpha * (b2 / 255f)); return new Color(b2, b2, b2, a2); } @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f) + if (Projectile.ai[1] <= (Main.getGoodWorld ? 600f : 900f) && Projectile.ai[1] > 120f) target.AddBuff(BuffID.Poisoned, 480); } } diff --git a/Projectiles/Boss/THanosSideLaser.cs b/Projectiles/Boss/THanosSideLaser.cs index e17154f9d9..d3d797b890 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 570c563721..f2c2441310 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Boss } // Periodically fire beams along the laser perpendicular to its direction. - float laserFireRate = (CalamityWorld.LegendaryMode) ? 60f : expertMode ? 80f : 160f; + float laserFireRate = Main.getGoodWorld ? 60f : expertMode ? 80f : 160f; if (Main.npc[OwnerIndex].Calamity().newAI[2] % laserFireRate == 0f) { // Play a laser sound to go with the beams. @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss float radians = MathHelper.TwoPi / totalProjectiles; for (int j = 0; j < totalProjectiles; j++) { - Vector2 projVelocity = (CalamityWorld.LegendaryMode) ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; + Vector2 projVelocity = Main.getGoodWorld ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserFirePosition, projVelocity, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, -1f); } laserFirePosition += beamDirection * distanceBetweenProjectiles; diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index 48e3353558..c0bbc975d5 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index 3db3a7a054..2a49abbf7c 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index 95ef39e3df..6a1cc8636b 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = false; Projectile.timeLeft = CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; - if (CalamityWorld.LegendaryMode) + if (Main.zenithWorld) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index 430144499a..906fe2c972 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.width = Projectile.height = (int)(408f * Projectile.scale); float inertia = 5f; - float speed = CalamityWorld.LegendaryMode ? 10.7f : 5.35f; + float speed = 5.35f; float minDist = 160f; if (victim >= 0 && Main.player[victim].active && !Main.player[victim].dead) { @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss } // Fly away from other vortices - float pushForce = CalamityWorld.LegendaryMode ? 0.1f : 0.05f; + float pushForce = 0.05f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 5b1357566c..4a119a31f7 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -14,6 +14,7 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; using CalamityMod.Items.Armor.Daedalus; +using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; @@ -192,21 +193,6 @@ namespace CalamityMod.Projectiles ///
public int timesPierced = 0; - /// - /// If this projectile uses point-blank damage, this gets set to , then is decremented every frame.
- /// If it reaches 0, this projectile can no longer deal point-blank damage. - ///
- public int pointBlankShotDuration = 0; - /// - /// If this projectile uses point-blank damage, this value is incremented on every update by the distance the projectile traveled on that update.
- /// If it exceeds , this projectile can no longer deal point-blank damage. - ///
- public float pointBlankShotDistanceTravelled = 0f; - /// Constant variable which stores how many frames a projectile is allowed to deal point-blank damage. - public const int DefaultPointBlankDuration = 18; - /// Constant variable which stores the maximum distance a projectile can travel to deal point-blank damage, in pixels. - public const float PointBlankShotDistanceLimit = 240f; // 15 tiles - // Empress of Light variables private const float EmpressRainbowStreakSpreadOutCutoff = 140f; private const int EmpressLastingRainbowTotalDuration = 660; @@ -406,12 +392,6 @@ namespace CalamityMod.Projectiles #endregion - if (!Main.player[projectile.owner].ActiveItem().IsAir && !Main.player[projectile.owner].ActiveItem().Calamity().canFirePointBlankShots) - pointBlankShotDuration = 0; - - if (pointBlankShotDuration > 0) - pointBlankShotDuration--; - // Reduce secondary yoyo damage if the player has Yoyo Glove // Brief behavior documentation of yoyo AI: ai[0, 1] are the x, y co-ords and localAI[0] is the airtime in frames // All secondary yoyos are spawned with ai[0] of 1 which tells then tell its AI to do secondary yoyo AI @@ -451,10 +431,6 @@ namespace CalamityMod.Projectiles projectile.Kill(); } - // Chlorophyte Crystal AI rework. - if (projectile.type == ProjectileID.CrystalLeaf) - return ChlorophyteCrystalAI.DoChlorophyteCrystalAI(projectile); - if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; @@ -2186,7 +2162,7 @@ namespace CalamityMod.Projectiles if (projectile.velocity.Y > 16f) projectile.velocity.Y = 16f; - if (CalamityWorld.LegendaryMode && projectile.velocity.Length() > 4f) + if (Main.getGoodWorld && projectile.velocity.Length() > 4f) projectile.velocity *= 0.985f; return false; @@ -3653,12 +3629,6 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner, projectile.whoAmI); } - // CIT 29JUN2024: Moved from PreAI to PostAI so that it is called every update instead of every frame. - // This makes the distance traveled increment more accurately for projectiles with extra updates, as previously projectiles with extra updates - // would add the distance traveled for the whole frame on the first update, making the distance checking much choppier. - if (pointBlankShotDistanceTravelled < PointBlankShotDistanceLimit) - pointBlankShotDistanceTravelled += projectile.velocity.Length(); - // optimization to remove conversion X/Y loop for irrelevant projectiles bool isConversionProjectile = projectile.type == ProjectileID.PurificationPowder || projectile.type == ProjectileID.VilePowder @@ -3760,7 +3730,7 @@ namespace CalamityMod.Projectiles { float mult = 1f; if (player.Calamity().reaverSpeed) - mult += 0.5f; + mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) @@ -3776,7 +3746,7 @@ namespace CalamityMod.Projectiles { float mult = 1f; if (player.Calamity().reaverSpeed) - mult += 0.5f; + mult += ReaverHeadMobility.SetBonusHookBoost; if (player.Calamity().tungstenArmorHookBoost) mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) @@ -4226,13 +4196,6 @@ namespace CalamityMod.Projectiles shouldDrawBool = false; } - // Chlorophyte Crystal AI rework. - if (projectile.type == ProjectileID.CrystalLeaf) - { - ChlorophyteCrystalAI.DoChlorophyteCrystalDrawing(projectile); - shouldDrawBool = false; - } - if (Main.LocalPlayer.Calamity().trippy) OddMushroomProjectileDrawing(projectile); diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 077a3c2d18..e190ebfb24 100644 --- a/Projectiles/CalamityGlobalProjectileTweaks.cs +++ b/Projectiles/CalamityGlobalProjectileTweaks.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles IProjectileTweak[] defenseDamage = Do(DefenseDamage); IProjectileTweak[] trueMelee = Do(TrueMelee, DefaultIDStaticIFrames); // All the tweaked true melee projectiles need to be changed from global to static as well IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed, DefaultIDStaticIFrames); - IProjectileTweak[] pointBlank = Do(PointBlank); - IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2)); + IProjectileTweak[] defaultIFrames = Do(DefaultIDStaticIFrames); + IProjectileTweak[] standardBulletTweaks = Do(ExtraUpdatesDelta(+2)); IProjectileTweak[] standardChainsawTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5)); IProjectileTweak[] standardDrillTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+25), LocalIFrames(5)); IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), DefaultIDStaticIFrames); @@ -117,12 +117,12 @@ namespace CalamityMod.Projectiles { ProjectileID.Anchor, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.Arkhalis, Do(TrueMeleeNoSpeed, ScaleExact(1.25f), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.Bee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, - { ProjectileID.BeeArrow, Do(PointBlank, ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, + { ProjectileID.BeeArrow, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.BlackCounterweight, counterweightTweaks }, { ProjectileID.BlueCounterweight, counterweightTweaks }, { ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.Bullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, - { ProjectileID.BulletHighVelocity, Do(PointBlank, LocalIFrames(-1)) }, + { ProjectileID.Bullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.BulletHighVelocity, Do(LocalIFrames(-1)) }, { ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(7), ScaleExact(1.5f)) }, { ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks }, { ProjectileID.ChlorophyteDrill, standardDrillTweaks }, @@ -130,10 +130,10 @@ namespace CalamityMod.Projectiles { ProjectileID.CobaltChainsaw, standardChainsawTweaks }, { ProjectileID.CobaltDrill, standardDrillTweaks }, { ProjectileID.CobaltNaginata, Do(TrueMelee, LocalIFrames(9)) }, - { ProjectileID.CrystalBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.CrystalBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.CrystalVileShardHead, Do(LocalIFrames(23)) }, { ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(23)) }, - { ProjectileID.CursedBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.CursedBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.ClusterRocketI, Do(LocalIFrames(15)) }, { ProjectileID.ClusterFragmentsI, Do(IDStaticIFrames(15)) }, { ProjectileID.ClusterRocketII, Do(LocalIFrames(15)) }, @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles { ProjectileID.EmeraldBolt, Do(NoPiercing) }, { ProjectileID.EmpressBlade, Do(LocalIFrames(30)) }, // Terraprisma { ProjectileID.EnchantedBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, - { ProjectileID.ExplosiveBullet, Do(PointBlank, ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.ExplosiveBullet, Do(ExtraUpdatesDelta(+2), IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes { ProjectileID.FairyQueenRangedItemShot, Do(PiercingExact(7), ExtraUpdatesExact(1)) }, // Eventide Convert { ProjectileID.FlaironBubble, Do(ExtraUpdatesExact(1), TimeLeftExact(150), DefaultIDStaticIFrames) }, { ProjectileID.Flamarang, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, @@ -158,13 +158,14 @@ namespace CalamityMod.Projectiles { ProjectileID.FruitcakeChakram, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.GiantBee, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GladiusStab, Do(TrueMelee, LocalIFrames(-1)) }, - { ProjectileID.GoldenBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.GoldenBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) + { ProjectileID.HellfireArrow, Do(ExtraUpdatesDelta(+2)) }, { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, - { ProjectileID.IchorBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.IchorBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) }, { ProjectileID.InfernoFriendlyBolt, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.InfernoFriendlyBlast, Do(ExtraUpdatesExact(2), DefaultIDStaticIFrames) }, @@ -181,14 +182,14 @@ namespace CalamityMod.Projectiles { ProjectileID.MythrilChainsaw, standardChainsawTweaks }, { ProjectileID.MythrilDrill, standardDrillTweaks }, { ProjectileID.MythrilHalberd, Do(TrueMelee, LocalIFrames(8)) }, - { ProjectileID.NanoBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.NanoBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.NebulaDrill, standardDrillTweaks }, { ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(-1)) }, { ProjectileID.OrichalcumChainsaw, standardChainsawTweaks }, { ProjectileID.OrichalcumDrill, standardDrillTweaks }, { ProjectileID.PalladiumChainsaw, standardChainsawTweaks }, { ProjectileID.PalladiumDrill, standardDrillTweaks }, - { ProjectileID.PartyBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.PartyBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.PoisonFang, Do(LocalIFrames(10)) }, { ProjectileID.PurpleCounterweight, counterweightTweaks }, { ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) }, @@ -212,7 +213,7 @@ namespace CalamityMod.Projectiles { ProjectileID.TitaniumDrill, standardDrillTweaks }, { ProjectileID.Trimarang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.TrueNightsEdge, Do(PiercingExact(4)) }, - { ProjectileID.VenomBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, + { ProjectileID.VenomBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, { ProjectileID.VenomFang, Do(LocalIFrames(10)) }, { ProjectileID.VenomSpider, Do( ExtraUpdatesExact(2), LocalIFrames(45)) }, //Spider Staff spiders. It has Venom, Dangerous, and Jumping spiders. { ProjectileID.VortexDrill, standardDrillTweaks }, @@ -253,45 +254,7 @@ namespace CalamityMod.Projectiles { ProjectileID.VortexChainsaw, trueMeleeNoSpeed }, #endregion - #region CATEGORY 4: Point Blank support - { ProjectileID.Blizzard, Do(PointBlank, DefaultIDStaticIFrames) }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. - { ProjectileID.BlueFlare, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.BoneArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CandyCorn, Do(PointBlank, IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes - { ProjectileID.ChlorophyteArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.ChlorophyteBullet, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CrimsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CrystalDart, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CursedArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.CursedDart, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.DD2PhoenixBowShot, pointBlank }, // Phantom Phoenix - { ProjectileID.EbonsandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.FireArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Flare, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.FrostburnArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Harpoon, pointBlank }, - { ProjectileID.Hellwing, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.HellfireArrow, Do(PointBlank, ExtraUpdatesDelta(+2)) }, - { ProjectileID.HolyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.IchorArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.JestersArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.MoonlordArrow, pointBlank }, // Luminite Arrow - { ProjectileID.PainterPaintball, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PearlSandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PhantasmArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PoisonDartBlowgun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.PulseBolt, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.SandBallGun, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Seed, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.ShadowFlameArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.SnowBallFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.Stake, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.UnholyArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.VenomArrow, Do(PointBlank, DefaultIDStaticIFrames) }, - { ProjectileID.WoodenArrowFriendly, Do(PointBlank, DefaultIDStaticIFrames) }, - #endregion - - #region CATEGORY 5: Defense Damage support + #region CATEGORY 4: Defense Damage support { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, @@ -306,310 +269,341 @@ namespace CalamityMod.Projectiles { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls #endregion - #region CATEGORY 6: ID-Static Immunity Frame changes - {ProjectileID.AbigailCounter, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Ale, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AmberBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AmethystBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.AshBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BallofFire, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BallofFrost, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bananarang, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bat, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BeeHive, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Beenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BlackCat, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodButcherer, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodNautilusTears, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BloodyMachete, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BombFish, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bone, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoneArrowFromMerchant, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoneDagger, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BookOfSkullsSkull, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BookStaffShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Boulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoulderStaffOfEarth, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyDynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BouncyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.BoxingGlove, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bubble, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Bunny, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CannonballFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CavelingGardener, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2Rocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketExplosive, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketExplosiveLarge, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2RocketLarge, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Celeb2Weapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChainGuillotine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChainKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterCannon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChargedBlasterOrb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ChlorophytePartisan, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClothiersCurse, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterSnowmanFragmentsI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ClusterSnowmanFragmentsII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CoinPortal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CopperCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CorruptSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsonHeart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrimsonSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalLeaf, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalLeafShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalPulse, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalPulse2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CrystalStorm, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedDartFlame, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedFlameFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.CursedFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DD2PhoenixBow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DemonScythe, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DiamondBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DirtStickyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DripplerFlailExtraBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryadsWardCircle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DryRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.DrySnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Dynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EatersBite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EbonsandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EighthNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Electrosphere, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes - {ProjectileID.ElectrosphereMissile, Do(DefaultIDStaticIFrames)}, - {ProjectileID.EnchantedBeam, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Explosives, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FallingStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Flairon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FlamesTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FlowerPowPetal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FrostArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.FrostDaggerfish, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GasTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GelBalloon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Geode, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GeyserTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GoldCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GolemFist, Do(DefaultIDStaticIFrames)}, - {ProjectileID.GreenLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Grenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HallowSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HallowStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HeatRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HolyWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneyRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoneySnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HornetStinger, Do(DefaultIDStaticIFrames)}, - {ProjectileID.HoundiusShootiusFireball, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IceBlock, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IceBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.IchorDart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.JackOLantern, Do(DefaultIDStaticIFrames)}, - {ProjectileID.JavelinFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Landmine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LaserMachinegun, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LaserMachinegunLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LastPrism, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LastPrismLaser, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.LavaBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LavaSnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Leaf, Do(DefaultIDStaticIFrames)}, - {ProjectileID.LifeCrystalBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MagicMissile, Do(IDStaticIFrames(8))}, // Has an exception in Vanilla iframe code, uses 8 iframes - {ProjectileID.MagnetSphereBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MedusaHead, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MedusaHeadRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Meteor1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.Meteor2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.Meteor3, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.MinecartMechLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniBoulder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniMinotaur, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeRocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeRocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeSnowmanRocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniNukeSnowmanRocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniRetinaLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MiniSharkron, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovCocktail, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MolotovFire3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MonkStaffT3_AltShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MudBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Mushroom, Do(DefaultIDStaticIFrames)}, - {ProjectileID.MushroomSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NailFriendly, Do(IDStaticIFrames(1))}, // Has an exception in Vanilla iframe code, uses 1 iframe - {ProjectileID.NebulaArcanumExplosionShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NebulaArcanumExplosionShotShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.NettleBurstEnd, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NettleBurstLeft, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NettleBurstRight, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NightBeam, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleSnowflake, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleSpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NorthPoleWeapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NurseSyringeHeal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.NurseSyringeHurt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.OrnamentFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.OrnamentStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaladinsHammerFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaperAirplaneA, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PaperAirplaneB, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PartyGirlGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PearlSandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PewMaticHornShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Phantasm, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PineNeedleFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PlatinumCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonDart, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonDartTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PoisonedKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PossessedHatchet, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PrincessWeapon, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ProximityMineIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PureSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PurificationPowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PurpleLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.PygmySpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.QuarterNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RainbowFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxBlue, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxGreen, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxRed, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketFireworksBoxYellow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanI, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanIII, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RocketSnowmanIV, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RollingCactus, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RollingCactusSpike, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RottenEgg, Do(DefaultIDStaticIFrames)}, - {ProjectileID.RubyBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SandBallFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SandSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SantaBombs, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SantankMountRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SapphireBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScarabBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScutlixLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ScutlixLaserFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SeedlerNut, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SeedlerThorn, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShadowBeamFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShadowFlameKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShellPileFalling, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShimmerArrow, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ShimmerFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Shuriken, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SiltBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SilverBullet, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SilverCoin, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SkyFracture, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SlushBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SnowSpray, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SolarCounter, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SolarFlareRay, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SoulDrain, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpearTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpelunkerFlare, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Spider, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpiderEgg, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpikyBall, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpikyBallTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SpiritFlame, Do(IDStaticIFrames(5))}, // Has an exception in Vanilla iframe code, uses 5 iframes - {ProjectileID.SporeGas, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeGas2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeGas3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.SporeTrap2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StarAnise, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StarCannonStar, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StardustCellMinion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StardustGuardianExplosion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyDynamite, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StickyGrenade, Do(DefaultIDStaticIFrames)}, - {ProjectileID.StormTigerGem, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Stynger, Do(IDStaticIFrames(7))}, // Has an exception in Vanilla iframe code, uses 7 iframes - {ProjectileID.StyngerShrapnel, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TentacleSpike, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThornChakram, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThrowingKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThunderSpear, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ThunderSpearShot, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TiedEighthNote, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TitaniumStormShard, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TopazBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicBubble, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud2, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicCloud3, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ToxicFlask, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Truffle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.TruffleSpore, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Typhoon, Do(IDStaticIFrames(6))}, // Has an exception in Vanilla iframe code, uses 6 iframes - {ProjectileID.UFOLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UFOMinion, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UnholyTridentFriendly, Do(DefaultIDStaticIFrames)}, - {ProjectileID.UnholyWater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VampireKnife, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VenomDartTrap, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ViciousPowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilePowder, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilethornBase, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VilethornTip, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexBeater, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexBeaterRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexVortexLightning, Do(DefaultIDStaticIFrames)}, - {ProjectileID.VortexVortexPortal, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Waffle, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WandOfFrostingFrost, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WandOfSparkingSpark, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WaterBolt, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WaterStream, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Web, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetBomb, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetMine, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WetSnowmanRocket, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Wisp, Do(DefaultIDStaticIFrames)}, - {ProjectileID.WoodenBoomerang, Do(DefaultIDStaticIFrames)}, - {ProjectileID.Xenopopper, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZapinatorLaser, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZoologistStrikeGreen, Do(DefaultIDStaticIFrames)}, - {ProjectileID.ZoologistStrikeRed, Do(DefaultIDStaticIFrames)}, + #region CATEGORY 5: ID-Static Immunity Frame changes + { ProjectileID.AbigailCounter, defaultIFrames }, + { ProjectileID.Ale, defaultIFrames }, + { ProjectileID.AmberBolt, defaultIFrames }, + { ProjectileID.AmethystBolt, defaultIFrames }, + { ProjectileID.AshBallFalling, defaultIFrames }, + { ProjectileID.BallofFire, defaultIFrames }, + { ProjectileID.BallofFrost, defaultIFrames }, + { ProjectileID.Bananarang, defaultIFrames }, + { ProjectileID.Bat, defaultIFrames }, + { ProjectileID.BeeHive, defaultIFrames }, + { ProjectileID.Beenade, defaultIFrames }, + { ProjectileID.BlackCat, defaultIFrames }, + { ProjectileID.Blizzard, defaultIFrames }, // Blizzard Staff projectiles, re-used in Frostbite Blaster. + { ProjectileID.BloodArrow, defaultIFrames }, + { ProjectileID.BloodButcherer, defaultIFrames }, + { ProjectileID.BloodNautilusTears, defaultIFrames }, + { ProjectileID.BloodWater, defaultIFrames }, + { ProjectileID.BloodyMachete, defaultIFrames }, + { ProjectileID.BlueFlare, defaultIFrames }, + { ProjectileID.Bomb, defaultIFrames }, + { ProjectileID.BombFish, defaultIFrames }, + { ProjectileID.Bone, defaultIFrames }, + { ProjectileID.BoneArrow, defaultIFrames }, + { ProjectileID.BoneArrowFromMerchant, defaultIFrames }, + { ProjectileID.BoneDagger, defaultIFrames }, + { ProjectileID.BookOfSkullsSkull, defaultIFrames }, + { ProjectileID.BookStaffShot, defaultIFrames }, + { ProjectileID.Boulder, defaultIFrames }, + { ProjectileID.BoulderStaffOfEarth, defaultIFrames }, + { ProjectileID.BouncyBomb, defaultIFrames }, + { ProjectileID.BouncyBoulder, defaultIFrames }, + { ProjectileID.BouncyDynamite, defaultIFrames }, + { ProjectileID.BouncyGrenade, defaultIFrames }, + { ProjectileID.BoxingGlove, defaultIFrames }, + { ProjectileID.Bubble, defaultIFrames }, + { ProjectileID.Bunny, defaultIFrames }, + { ProjectileID.CandyCorn, Do(IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes + { ProjectileID.CannonballFriendly, defaultIFrames }, + { ProjectileID.CavelingGardener, defaultIFrames }, + { ProjectileID.Celeb2Rocket, defaultIFrames }, + { ProjectileID.Celeb2RocketExplosive, defaultIFrames }, + { ProjectileID.Celeb2RocketExplosiveLarge, defaultIFrames }, + { ProjectileID.Celeb2RocketLarge, defaultIFrames }, + { ProjectileID.Celeb2Weapon, defaultIFrames }, + { ProjectileID.ChainGuillotine, defaultIFrames }, + { ProjectileID.ChainKnife, defaultIFrames }, + { ProjectileID.ChargedBlasterCannon, defaultIFrames }, + { ProjectileID.ChargedBlasterLaser, defaultIFrames }, + { ProjectileID.ChargedBlasterOrb, defaultIFrames }, + { ProjectileID.ChlorophyteArrow, defaultIFrames }, + { ProjectileID.ChlorophyteBullet, defaultIFrames }, + { ProjectileID.ChlorophytePartisan, defaultIFrames }, + { ProjectileID.ClothiersCurse, defaultIFrames }, + { ProjectileID.ClusterMineI, defaultIFrames }, + { ProjectileID.ClusterMineII, defaultIFrames }, + { ProjectileID.ClusterSnowmanFragmentsI, defaultIFrames }, + { ProjectileID.ClusterSnowmanFragmentsII, defaultIFrames }, + { ProjectileID.CoinPortal, defaultIFrames }, + { ProjectileID.CopperCoin, defaultIFrames }, + { ProjectileID.CorruptSpray, defaultIFrames }, + { ProjectileID.CrimsandBallFalling, defaultIFrames }, + { ProjectileID.CrimsandBallGun, defaultIFrames }, + { ProjectileID.CrimsonHeart, defaultIFrames }, + { ProjectileID.CrimsonSpray, defaultIFrames }, + { ProjectileID.CrystalDart, defaultIFrames }, + { ProjectileID.CrystalLeaf, defaultIFrames }, + { ProjectileID.CrystalLeafShot, defaultIFrames }, + { ProjectileID.CrystalPulse, defaultIFrames }, + { ProjectileID.CrystalPulse2, defaultIFrames }, + { ProjectileID.CrystalShard, defaultIFrames }, + { ProjectileID.CrystalStorm, defaultIFrames }, + { ProjectileID.CursedArrow, defaultIFrames }, + { ProjectileID.CursedDart, defaultIFrames }, + { ProjectileID.CursedDartFlame, defaultIFrames }, + { ProjectileID.CursedFlameFriendly, defaultIFrames }, + { ProjectileID.CursedFlare, defaultIFrames }, + { ProjectileID.DD2PhoenixBow, defaultIFrames }, + { ProjectileID.DemonScythe, defaultIFrames }, + { ProjectileID.DiamondBolt, defaultIFrames }, + { ProjectileID.DirtBall, defaultIFrames }, + { ProjectileID.DirtBomb, defaultIFrames }, + { ProjectileID.DirtSpray, defaultIFrames }, + { ProjectileID.DirtStickyBomb, defaultIFrames }, + { ProjectileID.DripplerFlailExtraBall, defaultIFrames }, + { ProjectileID.DryadsWardCircle, defaultIFrames }, + { ProjectileID.DryBomb, defaultIFrames }, + { ProjectileID.DryMine, defaultIFrames }, + { ProjectileID.DryRocket, defaultIFrames }, + { ProjectileID.DrySnowmanRocket, defaultIFrames }, + { ProjectileID.Dynamite, defaultIFrames }, + { ProjectileID.EatersBite, defaultIFrames }, + { ProjectileID.EbonsandBallFalling, defaultIFrames }, + { ProjectileID.EbonsandBallGun, defaultIFrames }, + { ProjectileID.EighthNote, defaultIFrames }, + { ProjectileID.Electrosphere, Do(IDStaticIFrames(8)) }, // Has an exception in Vanilla iframe code, uses 8 iframes + { ProjectileID.ElectrosphereMissile, defaultIFrames }, + { ProjectileID.EnchantedBeam, defaultIFrames }, + { ProjectileID.Explosives, defaultIFrames }, + { ProjectileID.FallingStar, defaultIFrames }, + { ProjectileID.FireArrow, defaultIFrames }, + { ProjectileID.Flairon, defaultIFrames }, + { ProjectileID.FlamesTrap, defaultIFrames }, + { ProjectileID.Flare, defaultIFrames }, + { ProjectileID.FlowerPowPetal, defaultIFrames }, + { ProjectileID.FrostArrow, defaultIFrames }, + { ProjectileID.FrostburnArrow, defaultIFrames }, + { ProjectileID.FrostDaggerfish, defaultIFrames }, + { ProjectileID.GasTrap, defaultIFrames }, + { ProjectileID.GelBalloon, defaultIFrames }, + { ProjectileID.Geode, defaultIFrames }, + { ProjectileID.GeyserTrap, defaultIFrames }, + { ProjectileID.GoldCoin, defaultIFrames }, + { ProjectileID.GolemFist, defaultIFrames }, + { ProjectileID.GreenLaser, defaultIFrames }, + { ProjectileID.Grenade, defaultIFrames }, + { ProjectileID.HallowSpray, defaultIFrames }, + { ProjectileID.HallowStar, defaultIFrames }, + { ProjectileID.Hellwing, defaultIFrames }, + { ProjectileID.HolyArrow, defaultIFrames }, + { ProjectileID.HeatRay, Do(DefaultIDStaticIFrames) }, + { ProjectileID.HolyWater, defaultIFrames }, + { ProjectileID.HoneyBomb, defaultIFrames }, + { ProjectileID.HoneyGrenade, defaultIFrames }, + { ProjectileID.HoneyMine, defaultIFrames }, + { ProjectileID.HoneyRocket, defaultIFrames }, + { ProjectileID.HoneySnowmanRocket, defaultIFrames }, + { ProjectileID.HornetStinger, defaultIFrames }, + { ProjectileID.HoundiusShootiusFireball, defaultIFrames }, + { ProjectileID.IceBlock, defaultIFrames }, + { ProjectileID.IceBolt, defaultIFrames }, + { ProjectileID.IchorArrow, defaultIFrames }, + { ProjectileID.IchorDart, defaultIFrames }, + { ProjectileID.JackOLantern, defaultIFrames }, + { ProjectileID.JavelinFriendly, defaultIFrames }, + { ProjectileID.JestersArrow, defaultIFrames }, + { ProjectileID.Landmine, defaultIFrames }, + { ProjectileID.LaserMachinegun, defaultIFrames }, + { ProjectileID.LaserMachinegunLaser, defaultIFrames }, + { ProjectileID.LastPrism, defaultIFrames }, + { ProjectileID.LastPrismLaser, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.LavaBomb, defaultIFrames }, + { ProjectileID.LavaMine, defaultIFrames }, + { ProjectileID.LavaRocket, defaultIFrames }, + { ProjectileID.LavaSnowmanRocket, defaultIFrames }, + { ProjectileID.Leaf, defaultIFrames }, + { ProjectileID.LifeCrystalBoulder, defaultIFrames }, + { ProjectileID.MagicMissile, Do(IDStaticIFrames(8)) }, // Has an exception in Vanilla iframe code, uses 8 iframes + { ProjectileID.MagnetSphereBolt, defaultIFrames }, + { ProjectileID.MedusaHead, defaultIFrames }, + { ProjectileID.MedusaHeadRay, defaultIFrames }, + { ProjectileID.Meteor1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.Meteor2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.Meteor3, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.MinecartMechLaser, defaultIFrames }, + { ProjectileID.MiniBoulder, defaultIFrames }, + { ProjectileID.MiniMinotaur, defaultIFrames }, + { ProjectileID.MiniNukeMineI, defaultIFrames }, + { ProjectileID.MiniNukeMineII, defaultIFrames }, + { ProjectileID.MiniNukeRocketI, defaultIFrames }, + { ProjectileID.MiniNukeRocketII, defaultIFrames }, + { ProjectileID.MiniNukeSnowmanRocketI, defaultIFrames }, + { ProjectileID.MiniNukeSnowmanRocketII, defaultIFrames }, + { ProjectileID.MiniRetinaLaser, defaultIFrames }, + { ProjectileID.MiniSharkron, defaultIFrames }, + { ProjectileID.MolotovCocktail, defaultIFrames }, + { ProjectileID.MolotovFire, defaultIFrames }, + { ProjectileID.MolotovFire2, defaultIFrames }, + { ProjectileID.MolotovFire3, defaultIFrames }, + { ProjectileID.MonkStaffT3_AltShot, defaultIFrames }, + { ProjectileID.MudBall, defaultIFrames }, + { ProjectileID.Mushroom, defaultIFrames }, + { ProjectileID.MushroomSpray, defaultIFrames }, + { ProjectileID.NailFriendly, Do(IDStaticIFrames(1)) }, // Has an exception in Vanilla iframe code, uses 1 iframe + { ProjectileID.NebulaArcanumExplosionShot, defaultIFrames }, + { ProjectileID.NebulaArcanumExplosionShotShard, defaultIFrames }, + { ProjectileID.NebulaBlaze1, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.NebulaBlaze2, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.NettleBurstEnd, defaultIFrames }, + { ProjectileID.NettleBurstLeft, defaultIFrames }, + { ProjectileID.NettleBurstRight, defaultIFrames }, + { ProjectileID.NightBeam, defaultIFrames }, + { ProjectileID.NorthPoleSnowflake, defaultIFrames }, + { ProjectileID.NorthPoleSpear, defaultIFrames }, + { ProjectileID.NorthPoleWeapon, defaultIFrames }, + { ProjectileID.NurseSyringeHeal, defaultIFrames }, + { ProjectileID.NurseSyringeHurt, defaultIFrames }, + { ProjectileID.OrnamentFriendly, defaultIFrames }, + { ProjectileID.OrnamentStar, defaultIFrames }, + { ProjectileID.PainterPaintball, defaultIFrames }, + { ProjectileID.PaladinsHammerFriendly, defaultIFrames }, + { ProjectileID.PaperAirplaneA, defaultIFrames }, + { ProjectileID.PaperAirplaneB, defaultIFrames }, + { ProjectileID.PartyGirlGrenade, defaultIFrames }, + { ProjectileID.PearlSandBallFalling, defaultIFrames }, + { ProjectileID.PearlSandBallGun, defaultIFrames }, + { ProjectileID.PewMaticHornShot, defaultIFrames }, + { ProjectileID.Phantasm, defaultIFrames }, + { ProjectileID.PhantasmArrow, defaultIFrames }, + { ProjectileID.PineNeedleFriendly, defaultIFrames }, + { ProjectileID.PlatinumCoin, defaultIFrames }, + { ProjectileID.PoisonDart, defaultIFrames }, + { ProjectileID.PoisonDartBlowgun, defaultIFrames }, + { ProjectileID.PoisonDartTrap, defaultIFrames }, + { ProjectileID.PoisonedKnife, defaultIFrames }, + { ProjectileID.PossessedHatchet, defaultIFrames }, + { ProjectileID.PrincessWeapon, defaultIFrames }, + { ProjectileID.ProximityMineI, defaultIFrames }, + { ProjectileID.ProximityMineII, defaultIFrames }, + { ProjectileID.ProximityMineIII, defaultIFrames }, + { ProjectileID.ProximityMineIV, defaultIFrames }, + { ProjectileID.PulseBolt, defaultIFrames }, + { ProjectileID.PureSpray, defaultIFrames }, + { ProjectileID.PurificationPowder, defaultIFrames }, + { ProjectileID.PurpleLaser, defaultIFrames }, + { ProjectileID.PygmySpear, defaultIFrames }, + { ProjectileID.QuarterNote, defaultIFrames }, + { ProjectileID.RainbowFlare, defaultIFrames }, + { ProjectileID.RocketFireworksBoxBlue, defaultIFrames }, + { ProjectileID.RocketFireworksBoxGreen, defaultIFrames }, + { ProjectileID.RocketFireworksBoxRed, defaultIFrames }, + { ProjectileID.RocketFireworksBoxYellow, defaultIFrames }, + { ProjectileID.RocketI, defaultIFrames }, + { ProjectileID.RocketII, defaultIFrames }, + { ProjectileID.RocketIII, defaultIFrames }, + { ProjectileID.RocketIV, defaultIFrames }, + { ProjectileID.RocketSnowmanI, defaultIFrames }, + { ProjectileID.RocketSnowmanII, defaultIFrames }, + { ProjectileID.RocketSnowmanIII, defaultIFrames }, + { ProjectileID.RocketSnowmanIV, defaultIFrames }, + { ProjectileID.RollingCactus, defaultIFrames }, + { ProjectileID.RollingCactusSpike, defaultIFrames }, + { ProjectileID.RottenEgg, defaultIFrames }, + { ProjectileID.RubyBolt, defaultIFrames }, + { ProjectileID.SandBallFalling, defaultIFrames }, + { ProjectileID.SandBallGun, defaultIFrames }, + { ProjectileID.SandSpray, defaultIFrames }, + { ProjectileID.SantaBombs, defaultIFrames }, + { ProjectileID.SantankMountRocket, defaultIFrames }, + { ProjectileID.SapphireBolt, defaultIFrames }, + { ProjectileID.ScarabBomb, defaultIFrames }, + { ProjectileID.ScutlixLaser, defaultIFrames }, + { ProjectileID.ScutlixLaserFriendly, defaultIFrames }, + { ProjectileID.Seed, defaultIFrames }, + { ProjectileID.SeedlerNut, defaultIFrames }, + { ProjectileID.SeedlerThorn, defaultIFrames }, + { ProjectileID.ShadowBeamFriendly, defaultIFrames }, + { ProjectileID.ShadowFlameArrow, defaultIFrames }, + { ProjectileID.ShadowFlameKnife, defaultIFrames }, + { ProjectileID.ShellPileFalling, defaultIFrames }, + { ProjectileID.ShimmerArrow, defaultIFrames }, + { ProjectileID.ShimmerFlare, defaultIFrames }, + { ProjectileID.Shuriken, defaultIFrames }, + { ProjectileID.SiltBall, defaultIFrames }, + { ProjectileID.SilverBullet, defaultIFrames }, + { ProjectileID.SilverCoin, defaultIFrames }, + { ProjectileID.SkyFracture, defaultIFrames }, + { ProjectileID.SlushBall, defaultIFrames }, + { ProjectileID.SnowBallFriendly, defaultIFrames }, + { ProjectileID.SnowSpray, defaultIFrames }, + { ProjectileID.SolarCounter, defaultIFrames }, + { ProjectileID.SolarFlareRay, defaultIFrames }, + { ProjectileID.SoulDrain, defaultIFrames }, + { ProjectileID.SpearTrap, defaultIFrames }, + { ProjectileID.SpelunkerFlare, defaultIFrames }, + { ProjectileID.Spider, defaultIFrames }, + { ProjectileID.SpiderEgg, defaultIFrames }, + { ProjectileID.SpikyBall, defaultIFrames }, + { ProjectileID.SpikyBallTrap, defaultIFrames }, + { ProjectileID.SpiritFlame, Do(IDStaticIFrames(5)) }, // Has an exception in Vanilla iframe code, uses 5 iframes + { ProjectileID.SporeGas, defaultIFrames }, + { ProjectileID.SporeGas2, defaultIFrames }, + { ProjectileID.SporeGas3, defaultIFrames }, + { ProjectileID.SporeTrap, defaultIFrames }, + { ProjectileID.SporeTrap2, defaultIFrames }, + { ProjectileID.Stake, defaultIFrames }, + { ProjectileID.StarAnise, defaultIFrames }, + { ProjectileID.StarCannonStar, defaultIFrames }, + { ProjectileID.StardustCellMinion, defaultIFrames }, + { ProjectileID.StardustGuardianExplosion, defaultIFrames }, + { ProjectileID.StickyBomb, defaultIFrames }, + { ProjectileID.StickyDynamite, defaultIFrames }, + { ProjectileID.StickyGrenade, defaultIFrames }, + { ProjectileID.StormTigerGem, defaultIFrames }, + { ProjectileID.Stynger, Do(IDStaticIFrames(7)) }, // Has an exception in Vanilla iframe code, uses 7 iframes + { ProjectileID.StyngerShrapnel, defaultIFrames }, + { ProjectileID.TentacleSpike, defaultIFrames }, + { ProjectileID.ThornChakram, defaultIFrames }, + { ProjectileID.ThrowingKnife, defaultIFrames }, + { ProjectileID.ThunderSpear, defaultIFrames }, + { ProjectileID.ThunderSpearShot, defaultIFrames }, + { ProjectileID.TiedEighthNote, defaultIFrames }, + { ProjectileID.TitaniumStormShard, defaultIFrames }, + { ProjectileID.TopazBolt, defaultIFrames }, + { ProjectileID.ToxicBubble, defaultIFrames }, + { ProjectileID.ToxicCloud, defaultIFrames }, + { ProjectileID.ToxicCloud2, defaultIFrames }, + { ProjectileID.ToxicCloud3, defaultIFrames }, + { ProjectileID.ToxicFlask, defaultIFrames }, + { ProjectileID.Truffle, defaultIFrames }, + { ProjectileID.TruffleSpore, defaultIFrames }, + { ProjectileID.Typhoon, Do(IDStaticIFrames(6)) }, // Has an exception in Vanilla iframe code, uses 6 iframes + { ProjectileID.UFOLaser, defaultIFrames }, + { ProjectileID.UFOMinion, defaultIFrames }, + { ProjectileID.UnholyArrow, defaultIFrames }, + { ProjectileID.UnholyTridentFriendly, defaultIFrames }, + { ProjectileID.UnholyWater, defaultIFrames }, + { ProjectileID.VampireKnife, defaultIFrames }, + { ProjectileID.VenomArrow, defaultIFrames }, + { ProjectileID.VenomDartTrap, defaultIFrames }, + { ProjectileID.ViciousPowder, defaultIFrames }, + { ProjectileID.VilePowder, defaultIFrames }, + { ProjectileID.VilethornBase, defaultIFrames }, + { ProjectileID.VilethornTip, defaultIFrames }, + { ProjectileID.VortexBeater, defaultIFrames }, + { ProjectileID.VortexBeaterRocket, defaultIFrames }, + { ProjectileID.VortexVortexLightning, defaultIFrames }, + { ProjectileID.VortexVortexPortal, defaultIFrames }, + { ProjectileID.Waffle, defaultIFrames }, + { ProjectileID.WandOfFrostingFrost, defaultIFrames }, + { ProjectileID.WandOfSparkingSpark, defaultIFrames }, + { ProjectileID.WaterBolt, defaultIFrames }, + { ProjectileID.WaterStream, defaultIFrames }, + { ProjectileID.Web, defaultIFrames }, + { ProjectileID.WetBomb, defaultIFrames }, + { ProjectileID.WetMine, defaultIFrames }, + { ProjectileID.WetRocket, defaultIFrames }, + { ProjectileID.WetSnowmanRocket, defaultIFrames }, + { ProjectileID.Wisp, defaultIFrames }, + { ProjectileID.WoodenArrowFriendly, defaultIFrames }, + { ProjectileID.WoodenBoomerang, defaultIFrames }, + { ProjectileID.Xenopopper, defaultIFrames }, + { ProjectileID.ZapinatorLaser, defaultIFrames }, + { ProjectileID.ZoologistStrikeGreen, defaultIFrames }, + { ProjectileID.ZoologistStrikeRed, defaultIFrames }, #endregion @@ -829,16 +823,6 @@ namespace CalamityMod.Projectiles internal static IProjectileTweak InfinitePiercing = new PiercingExactRule(-1); #endregion - #region Point Blank - internal class PointBlankRule : IProjectileTweak - { - public bool AppliesTo(Projectile proj) => true; - public void ApplyTweak(Projectile proj) - => proj.Calamity().pointBlankShotDuration = DefaultPointBlankDuration; - } - internal static IProjectileTweak PointBlank => new PointBlankRule(); - #endregion - #region Scale internal class ScaleDeltaRule : IProjectileTweak { diff --git a/Projectiles/DraedonsArsenal/AqueousHunterDroneSummon.cs b/Projectiles/DraedonsArsenal/AqueousHunterDroneSummon.cs new file mode 100644 index 0000000000..fe2f34fec7 --- /dev/null +++ b/Projectiles/DraedonsArsenal/AqueousHunterDroneSummon.cs @@ -0,0 +1,428 @@ +using System; +using CalamityMod.Buffs.Summon; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AqueousHunterDroneSummon : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public Player Owner => Main.player[Projectile.owner]; + public int time = 0; + public ref float attackTimer => ref Projectile.ai[0]; + public ref float interactionTimer => ref Projectile.ai[1]; + public int interactionPoint = 600; // The time needed before shimps do their idle animation + public int cooldownGiven = 450; + public bool pressedRight => Projectile.ai[2] == 5; + public bool doingSpecialAttack = false; + public float moveSpeed = 30; // Lower is actually faster + public NPC targetedNPC; // The NPC being targeted + public float tailRot = 0; // Extra rotation on the tail + public float tailRecoil = 0; // Recoil for the tail after firing + public int facingDir = 0; + public Vector2 headPlace; + public Vector2 tailPlace; + public float lastFirePositionX; // Used for some of the movement + public Vector2 chillSpot; // Stored position for intro animation and some movement + public Vector2 spawnAnimStart; // Second stored position for the spawn animation + public Vector2 lastTargetCenter; + public int attackDowntime = 0; // Timer used for post attack effects + public int surpriseTimer = 0; // Used for the jump animation when surprized + public float slidingDirection = 0; // Value that lerps from left to right + public int animationClickTime = 70; // Time before body and tail click together in spawn anim + public bool doSpin = false; // If the shrimp will spin for it's attack + public float specialAttackfx = 0; // spinnning effect opacity mult + public override void SetStaticDefaults() + { + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0f; + ProjectileID.Sets.MinionTargettingFeature[Type] = true; + } + public override void SetDefaults() + { + Projectile.width = 1; + Projectile.height = 1; + Projectile.netImportant = true; + Projectile.friendly = true; + Projectile.minionSlots = 4f; + Projectile.timeLeft = 18000; + Projectile.penetrate = -1; + Projectile.minion = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 5; + Projectile.DamageType = DamageClass.Summon; + } + + public override void AI() + { + int shrimpNum = Owner.ownedProjectileCounts[Projectile.type]; + facingDir = Math.Sign(Projectile.velocity.X); + GrantBuffs(Owner); + if ((targetedNPC == null || targetedNPC.life <= 0 || !targetedNPC.CanBeChasedBy() || attackDowntime == 20) && attackDowntime < 30) + targetedNPC = Projectile.Center.MinionHoming(2000f, Owner); + + // All the stuff for the spawn animation + if (time < animationClickTime + 20) + { + if (time == 0) + { + chillSpot = Projectile.Center; + spawnAnimStart = Projectile.Center; + int chosenDir = Math.Sign(Projectile.Center.DirectionTo(Owner.Center).X); + Projectile.velocity.X = (chosenDir * 16); + tailRot = -2f * chosenDir; + attackTimer += 8 * Projectile.localAI[2]; + } + SpawnAnim(); + facingDir = Math.Sign(Projectile.velocity.X); + time++; + return; + } + + slidingDirection = MathHelper.Lerp(slidingDirection, Owner.direction, 0.03f); + + bool isSummonWeapon = (Owner.HeldItem.DamageType == DamageClass.Summon) || (Owner.HeldItem.DamageType == DamageClass.SummonMeleeSpeed) || (Owner.HeldItem.DamageType == DamageClass.MagicSummonHybrid); + if (Owner.Calamity().mouseRight && Owner.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && Owner.Calamity().arsenalCooldown <= 0 && isSummonWeapon) + { + Projectile.ai[2] = 5; + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == Projectile.type && p.owner == Projectile.owner) + { + p.ai[2] = 5; + } + } + } + + if (doingSpecialAttack) + { + SpecialAttack(); + } + else + { + specialAttackfx = MathHelper.Lerp(specialAttackfx, 0, 0.15f); + if (targetedNPC != null || attackDowntime > 0) + { + lastTargetCenter = (targetedNPC == null ? Owner.Center : targetedNPC.Center); + Attacking(); + } + else + { + Passive(); + CheckForSpecialAttack(); + } + } + + if (tailRecoil > 0) + tailRecoil = MathHelper.Lerp(tailRecoil, 0, 0.2f); + if (attackDowntime > 0) + attackDowntime--; + time++; + SetVisualPlacement(); + } + public void CheckForSpecialAttack() + { + if (pressedRight) + { + Projectile.ai[2] = 0; + doingSpecialAttack = true; + attackTimer = 0; + if (Projectile.velocity.Length() < 5) + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 12; + else + Projectile.velocity *= 1.3f; + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + } + } + public void SpecialAttack() + { + interactionTimer = 0; + int length = 33; + specialAttackfx = MathHelper.Lerp(specialAttackfx, 1, 0.2f); + + facingDir = Math.Sign(Projectile.Center.DirectionTo(Owner.Center).X); + Projectile.velocity *= 0.98f; + Projectile.rotation += ((MathHelper.TwoPi * 3) / length) * facingDir; + + tailRot = MathHelper.Lerp(tailRot, 0.75f * -facingDir, 0.2f); + for (int i = -1; i <= 1; i += 2) + { + bool noFall = !Main.rand.NextBool(5); + Vector2 vel = Vector2.UnitY.RotatedBy(Projectile.rotation * -5) * i; + int dustStyle = noFall ? ModContent.DustType() : Effects.ArsenalEffects.ArsenalPlasmaDust; + Dust dust = Dust.NewDustPerfect(Projectile.Center + vel * 43 * specialAttackfx, dustStyle); + dust.scale = Main.rand.NextFloat(0.8f, 1.1f) + (noFall ? 0 : 0.5f); + dust.velocity = vel.RotatedBy(Main.rand.NextFloat(-0.2f, 0.2f) - MathHelper.PiOver4 * facingDir) * Main.rand.NextFloat(4, 5.5f); + dust.noGravity = noFall; + dust.color = Effects.ArsenalEffects.ArsenalPlasmaColor; + dust.fadeIn = noFall ? 0 : 0.7f; + } + + if (attackTimer % 3 == 0) + { + int usedTimer = (int)(facingDir == -1 ? (length - attackTimer) : attackTimer); + SoundEngine.PlaySound(AqueousHunterDrone.Fire with { Volume = 0.7f, Pitch = 0.0f, PitchVariance = 0.3f, MaxInstances = 10 }, Projectile.Center); + Vector2 shootVel = (MathHelper.PiOver2 / 10 * (int)(usedTimer / 3 - 1)).ToRotationVector2().RotatedBy(-MathHelper.PiOver2 - MathHelper.PiOver4); + Vector2 shootPlace = Projectile.Center + shootVel * 10; + + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), shootPlace, shootVel * 8, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner, 0, 0, attackTimer + 1); + } + attackTimer++; + if (attackTimer > length) + { + attackTimer = 8 * Projectile.localAI[2]; + doingSpecialAttack = false; + } + } + public void SpawnAnim() + { + Vector2 tailDist = new Vector2((30 - Math.Abs(tailRot) * 15) * (-facingDir), 7 - Math.Abs(tailRot) * 3).RotatedBy(Projectile.rotation); + Vector2 headDist = new Vector2(0, 0); + headPlace = Projectile.Center + headDist; + if (time < animationClickTime) + { + tailRot += 0.05f * Projectile.direction; + Projectile.velocity *= 0.98f; + Projectile.Center -= Projectile.velocity; + spawnAnimStart = new Vector2(spawnAnimStart.X, Owner.Center.Y - 700); + + tailPlace = chillSpot + tailDist + (Vector2.UnitY * ((float)Math.Pow(time, 2.05f) * 0.085f) + Vector2.UnitX * (16 - Math.Abs(Projectile.velocity.X)) * 10 * Projectile.direction); + } + else + tailPlace = Projectile.Center + tailDist; + + if (time > animationClickTime - 40) + { + if (time == animationClickTime - 1) + { + Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.PiOver4 * Projectile.direction) * 3; + SoundStyle click = new("CalamityMod/Sounds/Item/DudFire"); + SoundEngine.PlaySound(click with { Pitch = 0.4f }, Projectile.Center); + SoundEngine.PlaySound((Main.rand.NextBool() ? AqueousHunterDrone.Sound1 : AqueousHunterDrone.Sound2) with { Volume = 0.6f, Pitch = 0.3f, MaxInstances = 10 }, Projectile.Center); + + for (int i = -9; i <= 9; i++) + { + int dustStyle = Effects.ArsenalEffects.ArsenalPlasmaDust; + Dust dust = Dust.NewDustPerfect(tailPlace + Main.rand.NextVector2Circular(5, 5), dustStyle); + dust.scale = Main.rand.NextFloat(0.7f, 1.3f); + dust.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.Pi * (Math.Sign(i) == 1 ? 0 : 1)) * Main.rand.NextFloat(1, 5); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalPlasmaColor; + dust.fadeIn = 0.1f; + if (i == -1) + i++; + } + for (int i = 0; i < 2; i++) + { + Particle spark = new CustomSpark(tailPlace, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 15, 0.4f, Effects.ArsenalEffects.ArsenalPlasmaColor, new Vector2(1, 1), true, true, 0, false, false); + GeneralParticleHandler.SpawnParticle(spark); + } + } + if (time > animationClickTime - 1) + { + Projectile.velocity *= 0.97f; + tailRot = MathHelper.Lerp(tailRot, 0, 0.1f); + } + else + { + Projectile.Center = Vector2.Lerp(spawnAnimStart, tailPlace, Utils.GetLerpValue(animationClickTime - 40, animationClickTime, time, true)); + } + } + } + public void Passive() + { + float sine = (float)Math.Sin((time + Projectile.localAI[2] * 3) * 0.075f / MathHelper.Pi); + float sine2 = (float)Math.Sin(((time + Projectile.localAI[2] * 3) * 0.075f / MathHelper.Pi) * 2); + + TailRotationBasedOnMovement(); + + attackTimer = 8 * Projectile.localAI[2]; + + if (interactionTimer == interactionPoint) + { + chillSpot = Owner.Center + Main.rand.NextVector2CircularEdge(190, 190); + } + Projectile.rotation = Projectile.rotation.AngleLerp(0, 0.04f); + Vector2 destination = interactionTimer > interactionPoint ? (chillSpot + new Vector2(220 * sine, -90 + 130 * sine2)) : Owner.Center + new Vector2((-50 + -85 * Projectile.localAI[2]) * slidingDirection, -80 + 30 * sine); + + if (surpriseTimer == 0) + Projectile.velocity = (destination - Projectile.Center) / (moveSpeed + (interactionTimer > interactionPoint ? 20 : 0) - 9 + 9 * sine2); + else + surpriseTimer--; + if (interactionTimer > interactionPoint) + { + if (time % 25 == 0) + { + Particle spark2 = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(5, 5) - Vector2.UnitY * 20, -Vector2.UnitY.RotatedByRandom(0.1f) * Main.rand.NextFloat(3.3f, 5.5f), "CalamityMod/Projectiles/Magic/MelterNote1", false, 32, Main.rand.NextFloat(1.2f, 1.3f), Color.Lerp(Color.Green, Color.Chartreuse, Main.rand.NextFloat(0, 0.7f)), new Vector2(1, 1), true, false, 0, false, false); + GeneralParticleHandler.SpawnParticle(spark2); + } + if (time % (480 + Projectile.localAI[2] * 120) == 0 && Owner.miscCounter != 0) + { + SoundEngine.PlaySound((Main.rand.NextBool() ? AqueousHunterDrone.Sound1 : AqueousHunterDrone.Sound2) with { Volume = 0.3f, Pitch = 0f + Projectile.localAI[2] * 0.1f * (Projectile.localAI[2] % 2 == 0 ? -1 : 1), MaxInstances = 10 }, Projectile.Center); + } + } + if (Owner.Center.Distance(Projectile.Center) > 450 && interactionTimer > interactionPoint && Owner.velocity.Length() > 5) + { + CombatText.NewText(Projectile.Hitbox, Effects.ArsenalEffects.ArsenalPlasmaColor, "!", true); + SoundEngine.PlaySound(AqueousHunterDrone.Surprise with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + Projectile.velocity = Projectile.Center.DirectionTo(Owner.Center); + surpriseTimer = 25; + interactionTimer = 0; + } + if (Projectile.velocity.Length() < 5) + interactionTimer++; + else if (interactionTimer > 0 && interactionTimer < interactionPoint) + interactionTimer -= 2; + } + public void Attacking() + { + interactionTimer = 0; + facingDir = Math.Sign(Projectile.Center.DirectionTo(lastTargetCenter).X); + if (tailRecoil > 1 && doSpin) // Little spin + { + Projectile.rotation += 0.35f * facingDir; + } + else + Projectile.rotation = (Projectile.rotation).AngleLerp(tailPlace.DirectionTo(lastTargetCenter).ToRotation() + (facingDir == -1 ? MathHelper.Pi : 0) + (MathHelper.PiOver4 * -facingDir), 0.18f); + if (Utils.Distance(Projectile.Center, lastTargetCenter) > 250 && Projectile.velocity.Length() < 15) + Projectile.velocity += tailPlace.DirectionTo(lastTargetCenter) * 0.3f; + else + Projectile.velocity *= 0.96f; + if (lastTargetCenter.Y - 80 < tailPlace.Y) + Projectile.velocity.Y -= 0.7f; + + Projectile.velocity *= 0.99f; + if (attackDowntime > 35) // Reposition to somewhere on the other side of the target + { + Projectile.velocity.X += 0.8f * Math.Sign(lastTargetCenter.X - lastFirePositionX); + TailRotationBasedOnMovement(); + } + else + { + CheckForSpecialAttack(); + tailRot = MathHelper.Lerp(tailRot, 0, 0.1f); + } + if (attackTimer > 60) // Fire the missiles + { + Vector2 shootVel = tailPlace.DirectionTo(lastTargetCenter); + Vector2 shootPlace = tailPlace + shootVel * 10; + + lastFirePositionX = Projectile.Center.X; + SoundEngine.PlaySound(AqueousHunterDrone.Fire with { Volume = 0.7f, Pitch = 0.0f, PitchVariance = 0.3f, MaxInstances = 10 }, Projectile.Center); + + for (int i = 0; i < 13; i++) + { + bool noFall = !Main.rand.NextBool(5); + float variance = Main.rand.NextFloat(-0.7f, 0.7f); + int dustStyle = noFall ? ModContent.DustType() : Effects.ArsenalEffects.ArsenalPlasmaDust; + Dust dust = Dust.NewDustPerfect(tailPlace, dustStyle); + dust.scale = Main.rand.NextFloat(1.4f, 1.8f) - Math.Abs(variance); + dust.velocity = shootVel.RotatedBy(variance) * Main.rand.NextFloat(9, 9.5f) * (1 - Math.Abs(variance)); + dust.noGravity = noFall; + dust.color = Effects.ArsenalEffects.ArsenalPlasmaColor; + dust.fadeIn = noFall ? 0 : 1.1f; + } + + Particle bolt2 = new CustomPulse(shootPlace, shootVel * 0.2f, Effects.ArsenalEffects.ArsenalPlasmaColor, "CalamityMod/Particles/BloomRing", new Vector2(0.5f, 1f), shootVel.ToRotation(), 0f, 0.6f, 23); + GeneralParticleHandler.SpawnParticle(bolt2); + for (int i = 0; i < 2; i++) + { + Particle spark = new CustomSpark(shootPlace, shootVel * 0.2f, "CalamityMod/Particles/BloomCircle", false, 28, 0.6f, Effects.ArsenalEffects.ArsenalPlasmaColor, new Vector2(1f, 0.5f), true, true, 0, false, false); + GeneralParticleHandler.SpawnParticle(spark); + } + + for (int i = -1; i <= 1; i++) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), shootPlace, shootVel.RotatedBy(0.5f * i) * 8, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner, 0, 0, 0); + + doSpin = Main.rand.NextBool(5); + if (doSpin) + SoundEngine.PlaySound((Main.rand.NextBool() ? AqueousHunterDrone.Sound1 : AqueousHunterDrone.Sound2) with { Volume = 0.4f, Pitch = 0.2f, MaxInstances = 10 }, Projectile.Center); + tailRecoil = 25f; + Projectile.velocity += shootVel * (doSpin ? -18 : -9); + attackTimer = 0; + attackDowntime = 60; + } + attackTimer++; + } + public void TailRotationBasedOnMovement() + { + float sine = (float)Math.Sin(time * 0.1f / MathHelper.Pi); + tailRot = (sine * 0.2f) + 1.2f * (float)Math.Pow(Utils.GetLerpValue(0, 12 * facingDir, Projectile.velocity.X, true), 1.5f) * facingDir; + } + public void SetVisualPlacement() + { + float sine = (float)Math.Sin(time * 0.35f / MathHelper.Pi); + float sine2 = (float)Math.Sin(time * 0.05f / MathHelper.Pi); + Vector2 shake = new Vector2(3 * sine * (facingDir), 7 * sine2); + Vector2 visualPlace = Projectile.Center + shake + Vector2.UnitY * (surpriseTimer > 20 ? Utils.GetLerpValue(25, 20, surpriseTimer) : 1 - (float)Math.Pow(Utils.GetLerpValue(20, 15, surpriseTimer, true), 2)) * -25; + Vector2 tailDist = new Vector2((30 - Math.Abs(tailRot) * 15) * (-facingDir), 7 - Math.Abs(tailRot) * 3).RotatedBy(Projectile.rotation); + Vector2 headDist = new Vector2(0, 0); + Vector2 recoilPlace = ((Projectile.rotation - (facingDir == -1 ? MathHelper.Pi : 0) - (MathHelper.PiOver4 * -facingDir)).ToRotationVector2() * -tailRecoil); + headPlace = visualPlace + headDist; + tailPlace = visualPlace + tailDist + recoilPlace; + } + public void GrantBuffs(Player player) + { + bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (isCorrectProjectile) + { + if (player.dead) + { + player.Calamity().aqueousHunterDrone = false; + } + if (player.Calamity().aqueousHunterDrone) + { + Projectile.timeLeft = 2; + } + } + } + public override bool MinionContactDamage() => false; + public override bool PreDraw(ref Color lightColor) + { + Texture2D head = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/ShrimpBody").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/ShrimpBodyGlow").Value; + Texture2D tail = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/ShrimpTail").Value; + Texture2D glow2 = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/ShrimpTailGlow").Value; + Texture2D spin = ModContent.Request("CalamityMod/Particles/CircularSmearSmokey").Value; + Color drawColor = Projectile.GetAlpha(lightColor); + bool left = facingDir == -1; + float rotation = Projectile.rotation; + + // Tail + Main.EntitySpriteDraw(tail, tailPlace - Main.screenPosition, null, drawColor, rotation + tailRot, new Vector2(left ? tail.Height : 0, 0), Projectile.scale, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + Main.EntitySpriteDraw(glow2, tailPlace - Main.screenPosition, null, Color.White, rotation + tailRot, new Vector2(left ? glow2.Height : 0, 0), Projectile.scale, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + float sine = (float)Math.Sin(time * 0.35f / MathHelper.Pi); + float headFadeIn = (float)Math.Pow(Utils.GetLerpValue(0, animationClickTime - 25, time, true), 8); + // Head + Main.EntitySpriteDraw(head, headPlace - Main.screenPosition, null, drawColor * headFadeIn, rotation + sine * 0.1f, head.Size() * 0.5f, Projectile.scale, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + Main.EntitySpriteDraw(glow, headPlace - Main.screenPosition, null, Color.White * headFadeIn, rotation + sine * 0.1f, glow.Size() * 0.5f, Projectile.scale, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + // Spin effect + Main.EntitySpriteDraw(spin, Vector2.Lerp(headPlace, tailPlace, 0f) - Main.screenPosition, null, Effects.ArsenalEffects.ArsenalPlasmaColor with { A = 0 } * specialAttackfx, rotation * 1.8f, spin.Size() * 0.5f, Projectile.scale * 0.53f * specialAttackfx, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + + if (tailRecoil > 0) // Glowing on the gun after firing + { + float fade = Utils.GetLerpValue(0, 15, tailRecoil, true); + for (int i = 0; i < 12; i++) + { + Vector2 vel = (MathHelper.TwoPi * i / 12f).ToRotationVector2() * (2 + 2 * fade); + Main.EntitySpriteDraw(glow2, tailPlace - Main.screenPosition + vel, null, Color.White with { A = 0 } * fade, rotation + tailRot, new Vector2(left ? glow2.Height : 0, 0), Projectile.scale, left ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + } + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/ShrimpBody.png b/Projectiles/DraedonsArsenal/ShrimpBody.png new file mode 100644 index 0000000000..6a9768e1f1 Binary files /dev/null and b/Projectiles/DraedonsArsenal/ShrimpBody.png differ diff --git a/Projectiles/DraedonsArsenal/ShrimpBodyGlow.png b/Projectiles/DraedonsArsenal/ShrimpBodyGlow.png new file mode 100644 index 0000000000..5ddf245160 Binary files /dev/null and b/Projectiles/DraedonsArsenal/ShrimpBodyGlow.png differ diff --git a/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs new file mode 100644 index 0000000000..b38c669e64 --- /dev/null +++ b/Projectiles/DraedonsArsenal/ShrimpPlasmaMissile.cs @@ -0,0 +1,181 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class ShrimpPlasmaMissile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public NPC closestNPC; + public Vector2 offset = Vector2.Zero; + public bool hitTile = false; + public float randomRate = 0; + public float randomSize = 0; + public override void SetStaticDefaults() + { + //ProjectileID.Sets.SummonTagDamageMultiplier[Type] = 0f; // The balance people will say if this is needed + } + public override void SetDefaults() + { + Projectile.width = Projectile.height = 10; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.DamageType = DamageClass.Summon; + Projectile.timeLeft = 300; + Projectile.extraUpdates = 3; + Projectile.penetrate = -1; + Projectile.ArmorPenetration = 15; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + if (time == 0) + { + randomRate = Main.rand.NextFloat(1, 3); + randomSize = Main.rand.NextFloat(1, 5); + } + float sine = (float)Math.Sin(time * 0.075f / MathHelper.Pi * randomRate); + + if (time > 0 && Projectile.numHits == 0) + { + if (Utils.Distance(Owner.Center, Projectile.Center) < 1400) + { + Particle spark = new CustomSpark(Projectile.Center, Projectile.velocity * -0.01f, "CalamityMod/Particles/BloomCircle", false, 12, 0.18f, Effects.ArsenalEffects.ArsenalPlasmaColor, new Vector2(0.3f, 1), true, true, 0, false, false, 0.3f, glowCenterScale: 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Projectile.ai[2] == 0) + { + if (time > 10) + { + if (closestNPC == null || closestNPC.life <= 0 || !closestNPC.CanBeChasedBy()) + closestNPC = Projectile.Center.ClosestNPCAt(900); + if (closestNPC != null) + { + Projectile.timeLeft++; + float distMult = ((float)Math.Pow(Utils.GetLerpValue(140, 80, Projectile.Center.Distance(closestNPC.Center), true), 3)); + CalamityUtils.HomeInOnSelectedNPC(Projectile, closestNPC, true, 0.2f + 0.3f * distMult, 8, 0.99f - 0.1f * distMult, accelerate: true); + } + } + } + else + { + Vector2 goalPosition = Owner.Calamity().mouseWorld + offset; + int fallTime = 300 - (int)Projectile.ai[2] * Projectile.extraUpdates; + offset = Vector2.UnitX * sine * 15 * randomSize; + if (time == fallTime) + { + Projectile.timeLeft = 600; + Projectile.extraUpdates = 6; + Projectile.scale = 1.5f; + } + if (time > fallTime) + { + float distMult = (float)Math.Pow(Utils.GetLerpValue(480, 340, time, true), 3); + + Vector2 moveTo = (goalPosition - Projectile.Center).SafeNormalize(Vector2.UnitX); + + if (Projectile.velocity.Y < 8) + Projectile.velocity.Y += 0.1f; + Projectile.velocity.X += moveTo.X * 0.5f; + Projectile.velocity.X *= 0.975f; + } + else + Projectile.timeLeft++; + } + + if (Main.rand.NextBool(5)) + { + int dustStyle = Effects.ArsenalEffects.ArsenalPlasmaDust; + Dust dust = Dust.NewDustPerfect(Projectile.Center, dustStyle); + dust.scale = Main.rand.NextFloat(0.5f, 0.7f); + dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.3f); + dust.noGravity = false; + dust.color = Effects.ArsenalEffects.ArsenalPlasmaColor; + dust.fadeIn = -0.2f; + } + } + if (Collision.SolidCollision(Projectile.Center, 8, 8) && Projectile.numHits == 0 && Projectile.ai[2] > 0 && Projectile.Center.Y > Owner.Calamity().mouseWorld.Y && Projectile.scale > 1) + { + hitTile = true; + Projectile.numHits = 1; + Explode(); + } + time++; + } + public void Explode() + { + float lifetimeMult = (hitTile ? 5 : 1); + if (hitTile) + Projectile.localNPCHitCooldown = 8; + Projectile.extraUpdates = 0; + Projectile.timeLeft = (int)(12 * lifetimeMult); + Projectile.velocity = Vector2.Zero; + for (int i = 0; i < (int)(12 * Projectile.scale); i++) + { + bool noFall = !Main.rand.NextBool(5); + int dustStyle = noFall ? ModContent.DustType() : Effects.ArsenalEffects.ArsenalPlasmaDust; + Dust dust = Dust.NewDustPerfect(Projectile.Center, dustStyle); + dust.scale = Main.rand.NextFloat(0.9f, 1.7f) * (noFall ? 2 : 0.75f) * Projectile.scale; + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(6.4f, 7.5f) * (noFall ? 0.7f : 1.2f) * Projectile.scale; + dust.noGravity = noFall; + dust.color = Effects.ArsenalEffects.ArsenalPlasmaColor; + dust.fadeIn = (noFall ? 4.5f * Projectile.scale : 1f); + } + SoundEngine.PlaySound(AqueousHunterDrone.Hit with { Volume = 0.4f * Projectile.scale, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 30 }, Projectile.Center); + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalPlasmaColor * 0.95f, "CalamityMod/Particles/SmokeExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.1f * Projectile.scale, 14); + GeneralParticleHandler.SpawnParticle(bolt2); + + Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalPlasmaColor * 0.75f, "CalamityMod/Particles/WaterFoam", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.77f * Projectile.scale, (int)(10 * lifetimeMult)); + GeneralParticleHandler.SpawnParticle(bolt3); + + Particle spark = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, (int)(17 * lifetimeMult), 0.6f * Projectile.scale, Effects.ArsenalEffects.ArsenalPlasmaColor, new Vector2(1, 1), true, true, 0, false, false); + GeneralParticleHandler.SpawnParticle(spark); + if (hitTile) + { + Particle spark2 = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, (int)(20 * lifetimeMult), 0.6f * Projectile.scale * lifetimeMult, Effects.ArsenalEffects.ArsenalPlasmaColor * 0.35f, new Vector2(1, 1), true, true, 0, false, false, glowOpacity: 0.35f); + GeneralParticleHandler.SpawnParticle(spark2); + } + if (Projectile.scale > 1) + { + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().GeneralScreenShakePower = 2.5f; + } + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.numHits == 0) + { + Explode(); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.numHits > 0) + { + float minMult = 0.5f; + int hitsToMinMult = 8; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult * 0.5f; + } + } + public override bool? CanDamage() => ((time > 5 && Projectile.ai[2] == 0) || (Projectile.scale > 1)) ? null : false; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * (Projectile.numHits > 0 ? 10 : 1) * Projectile.scale, targetHitbox); + } + public override bool PreDraw(ref Color lightColor) + { + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/ShrimpTail.png b/Projectiles/DraedonsArsenal/ShrimpTail.png new file mode 100644 index 0000000000..ea5481c028 Binary files /dev/null and b/Projectiles/DraedonsArsenal/ShrimpTail.png differ diff --git a/Projectiles/DraedonsArsenal/ShrimpTailGlow.png b/Projectiles/DraedonsArsenal/ShrimpTailGlow.png new file mode 100644 index 0000000000..0d7d5e8d71 Binary files /dev/null and b/Projectiles/DraedonsArsenal/ShrimpTailGlow.png differ diff --git a/Projectiles/Magic/ThunderboltOrb.cs b/Projectiles/Magic/VolterionOrb.cs similarity index 100% rename from Projectiles/Magic/ThunderboltOrb.cs rename to Projectiles/Magic/VolterionOrb.cs diff --git a/Projectiles/Magic/ThunderboltShot.cs b/Projectiles/Magic/VolterionShot.cs similarity index 100% rename from Projectiles/Magic/ThunderboltShot.cs rename to Projectiles/Magic/VolterionShot.cs diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 5a96b2970e..0d5cf451c9 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -264,7 +264,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 900); Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.002)); } } diff --git a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs index a562a8cc32..2bc10c3cc6 100644 --- a/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs +++ b/Projectiles/Melee/TheMutilatorHoldoutProjectile.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Projectiles.Melee public override int StartupTime { get; set; } public override int CooldownTime { get; set; } + public override SoundStyle? UseSound => SoundID.Item1; + + public bool hasGivenBlood = false; public override void Spawn(IEntitySource source) diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index 76cb205252..0b926f5740 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AnimosityBullet.cs b/Projectiles/Ranged/AnimosityBullet.cs index 546f2b7cf2..afced06a79 100644 --- a/Projectiles/Ranged/AnimosityBullet.cs +++ b/Projectiles/Ranged/AnimosityBullet.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = Main.zenithWorld ? 3 : 1; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() { diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index 4a0a100b61..bc67355089 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = Lifetime; Projectile.extraUpdates = 2; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 7aaa3c6e6a..2731b8fc06 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ArcherfishRing.cs b/Projectiles/Ranged/ArcherfishRing.cs index afbe1a3107..a2c7a234a2 100644 --- a/Projectiles/Ranged/ArcherfishRing.cs +++ b/Projectiles/Ranged/ArcherfishRing.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox); diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 918ebc8a95..d2dc2ab678 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 834728bd1c..8f89a2b96b 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 2; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index fca008bd42..44efefd7a5 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 4d72d5c9f0..0878dab0af 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AuralisBullet.cs b/Projectiles/Ranged/AuralisBullet.cs index 9de76738f3..6051520954 100644 --- a/Projectiles/Ranged/AuralisBullet.cs +++ b/Projectiles/Ranged/AuralisBullet.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 10; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/AuricBullet.cs b/Projectiles/Ranged/AuricBullet.cs index 61d6186699..a88a7029c2 100644 --- a/Projectiles/Ranged/AuricBullet.cs +++ b/Projectiles/Ranged/AuricBullet.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 15; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; Projectile.ArmorPenetration = 50; Projectile.alpha = 255; diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 6ce0a50098..51e9c5e621 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.WoodenArrowFriendly; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BarinadeArrow.cs b/Projectiles/Ranged/BarinadeArrow.cs index 8e5a2ad405..7d177158e3 100644 --- a/Projectiles/Ranged/BarinadeArrow.cs +++ b/Projectiles/Ranged/BarinadeArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() { diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index a72db98d46..caf1e8b0b1 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index a793e5aad8..fa3534bfaa 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 9; Projectile.timeLeft = 1200; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index 5fddf998a1..3f13d793b9 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 12; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; } diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index 69ea77610f..7750c3a0b1 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Electrified, 60); diff --git a/Projectiles/Ranged/BouncingShotgunPellet.cs b/Projectiles/Ranged/BouncingShotgunPellet.cs index 926212c0fa..c912fea852 100644 --- a/Projectiles/Ranged/BouncingShotgunPellet.cs +++ b/Projectiles/Ranged/BouncingShotgunPellet.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.BulletHighVelocity; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index 70666e710f..1ff6ff8ae1 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 3; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/BubonicRoundProj.cs b/Projectiles/Ranged/BubonicRoundProj.cs index d591810015..23a22b4d46 100644 --- a/Projectiles/Ranged/BubonicRoundProj.cs +++ b/Projectiles/Ranged/BubonicRoundProj.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/BuzzkillSaw.cs b/Projectiles/Ranged/BuzzkillSaw.cs index a9d383fd87..4a736dbb47 100644 --- a/Projectiles/Ranged/BuzzkillSaw.cs +++ b/Projectiles/Ranged/BuzzkillSaw.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; // Saw pierce is set when the saw is spawned, due to it being dynamic based on charge. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 0f1420d688..a61c09f6b7 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 6; Projectile.timeLeft = 360; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index aa7d906b6b..2dee125be4 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 2; Projectile.timeLeft = 600; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index ce6bb0907b..0ce05c97c7 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index a3f208088d..617e839429 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.extraUpdates = 2; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index 067c7820e3..cb75277d92 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index d70b68fad7..bd470fb368 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 12; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index 74f4fb6f83..6160c3f44e 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 5; Projectile.timeLeft = 600; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 81766cb87a..48d0f4c787 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 5; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 6cf4dfc842..c823175f28 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 1200; Projectile.extraUpdates = 2; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ExoCrystalArrow.cs b/Projectiles/Ranged/ExoCrystalArrow.cs index e51f5150fe..fb03247967 100644 --- a/Projectiles/Ranged/ExoCrystalArrow.cs +++ b/Projectiles/Ranged/ExoCrystalArrow.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.timeLeft = 300; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index db3737de73..c0e0124b8d 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index eec96dfc86..70e03eed6a 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlashRoundProj.cs b/Projectiles/Ranged/FlashRoundProj.cs index 097af310b5..bab429e622 100644 --- a/Projectiles/Ranged/FlashRoundProj.cs +++ b/Projectiles/Ranged/FlashRoundProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = -1; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 33f031585d..39b2db16d6 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.coldDamage = true; Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index b0917fb7a7..08be24b2b6 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index 812366bf1c..42e5f8155c 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = Lifetime; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(Projectile.tileCollide); @@ -99,10 +98,9 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ai[1] = BlueNoCollideFrames; Projectile.tileCollide = false; - // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. Reset the point blank timer. + // Reduce damage, but remove piercing. Reset local iframes so the bullet, turned blue, may always strike again. Projectile.damage = (int)(0.25f * Projectile.damage); Projectile.penetrate = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 17620c79fa..72f591fa25 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HallowPointRoundProj.cs b/Projectiles/Ranged/HallowPointRoundProj.cs index 8d8ec76fec..02da6911c5 100644 --- a/Projectiles/Ranged/HallowPointRoundProj.cs +++ b/Projectiles/Ranged/HallowPointRoundProj.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged // Invisible for the first few frames Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs index 132e147bf5..ff222b2b20 100644 --- a/Projectiles/Ranged/HellbornProj.cs +++ b/Projectiles/Ranged/HellbornProj.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 2; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 3c3fdd2a79..f0ecc0e263 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -35,7 +35,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 7; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/HydraHeadLaunch.cs b/Projectiles/Ranged/HydraHeadLaunch.cs index db6d8fc4aa..48edcc98f4 100644 --- a/Projectiles/Ranged/HydraHeadLaunch.cs +++ b/Projectiles/Ranged/HydraHeadLaunch.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.penetrate = 1; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } //Normal hitbox size for explosion, rotated otherwise diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 777dee25c5..0b08d01060 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; AIType = ProjectileID.Bullet; Projectile.ignoreWater = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 85a3f2a673..bb2953d0f9 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 1000; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 9dae2a8086..bd6a72442c 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = Lifetime; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index e5fb34f26e..800f0c3249 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index b7fa456499..b5883c7d61 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/M1GarandBulletCasing.cs b/Projectiles/Ranged/M1GarandBulletCasing.cs new file mode 100644 index 0000000000..50acf6549c --- /dev/null +++ b/Projectiles/Ranged/M1GarandBulletCasing.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandBulletCasing : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "CalamityMod/Projectiles/Ranged/M1GarandBulletCasing"; + public int Time = 0; + public bool TouchedGrass = false; + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 12; + Projectile.friendly = true; + Projectile.ignoreWater = false; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = -1; + Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Projectile.scale = 1f; + Projectile.extraUpdates = 1; + Time++; + Player Owner = Main.player[Projectile.owner]; + if (!TouchedGrass) + { + if (Projectile.timeLeft <= 240) + Projectile.rotation += 0.04f * Projectile.direction; + else + Projectile.rotation = (new Vector2(0, -5 * Projectile.direction) + Projectile.velocity * -1.2f).ToRotation(); + + Projectile.velocity.Y += 0.087f; + Projectile.velocity.X *= 0.99f; + + if (Main.rand.NextBool(3)) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, 303, -Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.2f, 1f), 140, default, Main.rand.NextFloat(0.35f, 0.5f)); + dust.noGravity = false; + dust.color = Color.White; + } + } + else + { + Projectile.velocity = Vector2.Zero; + } + Projectile.alpha = (int)(255 * Utils.GetLerpValue(60, 0, Projectile.timeLeft, true)); + if (Collision.SolidCollision(Projectile.Center - Projectile.velocity * 1.5f, 2, 2)) + Projectile.tileCollide = true; + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.damage = 0; + TouchedGrass = true; + Projectile.velocity = Vector2.Zero; + return false; + } + } +} diff --git a/Projectiles/Ranged/M1GarandBulletCasing.png b/Projectiles/Ranged/M1GarandBulletCasing.png new file mode 100644 index 0000000000..2e3aeeab4f Binary files /dev/null and b/Projectiles/Ranged/M1GarandBulletCasing.png differ diff --git a/Projectiles/Ranged/M1GarandEmptyClip.cs b/Projectiles/Ranged/M1GarandEmptyClip.cs new file mode 100644 index 0000000000..e04b8068b6 --- /dev/null +++ b/Projectiles/Ranged/M1GarandEmptyClip.cs @@ -0,0 +1,146 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandEmptyClip : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + internal static readonly SoundStyle BlingSound = new("CalamityMod/Sounds/Custom/Ultrabling") { PitchVariance = 0.5f }; + internal static readonly SoundStyle BlingHitSound = new("CalamityMod/Sounds/Custom/UltrablingHit") { PitchVariance = 0.5f }; + private static Asset sheenAsset; + private static Asset bloomAsset; + + public static float UsedCoinGrabRangeMultiplier = 5f; + public static float ClipTossForce = 7.33f; + + public static float MaxIntraClipRicoshotDistance = 1000f; + + public static readonly float RicoshotSearchDistance = 2000f; + + public static float SuperpredictionRatio = 0.1f; + + public static float ClipBonus = 2.5f; + public static float ClipMulticlipBonus = 0.9f; // lmar + + internal static readonly int UpdateCount = 4; + internal static readonly int ClipLifetime = UpdateCount * CalamityUtils.SecondsToFrames(7); + + // Clips fade out for the last 30 frames of their existence. + private static readonly int FadeoutTime = UpdateCount * 30; + private static readonly float ForceFadeDistance = 2000f; + public static int CritDelayFrames = 22; + internal static int CritDelayTime => UpdateCount * CritDelayFrames; + internal ref float ShotFreezeTimer => ref Projectile.ai[1]; + internal static int RicochetPause = UpdateCount * 22; + public bool HasBeenShot => Projectile.localAI[0] > 0f; + + public Player Owner => Main.player[Projectile.owner]; + + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 60; + ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 1; + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } + + public override void SetDefaults() + { + Projectile.width = 12; + Projectile.height = 14; + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.MaxUpdates = UpdateCount; + Projectile.timeLeft = ClipLifetime; + // Draws very small otherwise + Projectile.scale = 1.5f; + } + + public override bool? CanDamage() => false; + + public override bool ShouldUpdatePosition() => ShotFreezeTimer <= 0; + + public override void AI() + { + if (ShotFreezeTimer > 0f) + { + --ShotFreezeTimer; + if (ShotFreezeTimer <= 0) + { + Projectile.Kill(); + return; + } + } + + Lighting.AddLight(Projectile.Center, Color.LightGray.ToVector3() * 0.2f); + + if (Main.rand.NextBool(10)) + { + Dust d = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke); + d.noGravity = true; + } + + Projectile.rotation = Projectile.velocity.X * 0.5f; + + if (Projectile.FinalExtraUpdate()) + { + float clipGravity = Player.defaultGravity / Projectile.MaxUpdates; + Projectile.velocity.Y += clipGravity / 1.75f; + } + + if (Projectile.timeLeft > FadeoutTime && Projectile.Center.Distance(Owner.MountedCenter) > ForceFadeDistance) + Projectile.timeLeft = FadeoutTime; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height); + return base.OnTileCollide(oldVelocity); + } + // Pretty much all from ricoshot coins from here. + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, 1); + float fadingOpacity = Math.Clamp(Projectile.timeLeft / (float)FadeoutTime, 0f, 1f); + Color alphaColor = Projectile.GetAlpha(lightColor) * fadingOpacity; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, alphaColor, Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + + int numUpdatesPassed = ClipLifetime - Projectile.timeLeft; + float x = Math.Clamp((float)numUpdatesPassed / CritDelayTime, 0f, 2f); + float sheenFunction = Math.Min(MathF.Pow(x + 0.1f, 10f), MathF.Pow(x - 2.1f, 10f)); + float sheenOpacity = Math.Clamp(sheenFunction, 0f, 2f); + + if (sheenOpacity > 0f) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + sheenAsset ??= ModContent.Request("CalamityMod/Particles/HalfStar"); + Texture2D shineTex = sheenAsset.Value; + + bloomAsset ??= ModContent.Request("CalamityMod/Particles/BloomCircle"); + Texture2D bloomTex = bloomAsset.Value; + + Vector2 shineScale = new Vector2(1f, 3f - sheenOpacity * 2f); + Color shineColor = Color.LightGray; + + Main.EntitySpriteDraw(bloomTex, Projectile.Center - Main.screenPosition, null, shineColor * sheenOpacity * 0.3f, MathHelper.PiOver2, bloomTex.Size() / 2f, shineScale * Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(shineTex, Projectile.Center - Main.screenPosition, null, shineColor * sheenOpacity, MathHelper.PiOver2, shineTex.Size() / 2f, shineScale * Projectile.scale, SpriteEffects.None, 0); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + + return false; + } + } +} diff --git a/Projectiles/Ranged/M1GarandEmptyClip.png b/Projectiles/Ranged/M1GarandEmptyClip.png new file mode 100644 index 0000000000..c08f6def56 Binary files /dev/null and b/Projectiles/Ranged/M1GarandEmptyClip.png differ diff --git a/Projectiles/Ranged/M1GarandHoldout.cs b/Projectiles/Ranged/M1GarandHoldout.cs new file mode 100644 index 0000000000..6beff9770c --- /dev/null +++ b/Projectiles/Ranged/M1GarandHoldout.cs @@ -0,0 +1,357 @@ +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ModLoader; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class M1GarandHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + + public ref float CurrentState => ref Projectile.ai[0]; + public ref float Timer => ref Projectile.ai[1]; + + private float muzzleFlashTimer; + private float flashVariant; + + private int pingAnimationTimer = 0; + private const int PingAnimationDuration = 120; + private bool shouldPing = false; + + public override float RecoilResolveSpeed => 0.13f; + public override float MaxOffsetLengthFromArm => 28f; + public override float BaseOffsetY => -4f; + public override float OffsetXUpwards => -6f; + public override float OffsetXDownwards => 0f; + public override float OffsetYUpwards => 0f; + public override float OffsetYDownwards => 0f; + + public override Vector2 GunTipPosition => (Projectile.Center + new Vector2(1.5f, -2.5f)) + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.425f; + public override string Texture => "CalamityMod/Projectiles/Ranged/M1GarandHoldout"; + + // Muzzle flash textures + public static Asset MuzzleFlash; + public static Asset GlowTexture; + + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/WulfrumBlunderbussFire") { PitchVariance = 0.1f }; + public static readonly SoundStyle PingSound = new("CalamityMod/Sounds/Item/M1GarandPing"); + public static readonly SoundStyle ReloadSound = new("CalamityMod/Sounds/Item/M1GarandReload"); + + public override void Load() + { + MuzzleFlash = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandMuzzleFlash", AssetRequestMode.ImmediateLoad); + GlowTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandHoldoutGlow", AssetRequestMode.ImmediateLoad); + } + + public override void SetStaticDefaults() => Main.projFrames[Type] = 6; + + public override void KillHoldoutLogic() + { + // Only allow the projectile to kill if we're not reloading + if (CurrentState == 0 && HeldItem.type != Owner.ActiveItem().type) + { + Projectile.Kill(); + Projectile.netUpdate = true; + } + } + + public override void HoldoutAI() + { + // Decrements the timer which controls the duration of the flash + if (muzzleFlashTimer > 0f) + muzzleFlashTimer -= 1f; + + switch (CurrentState) + { + // Normal Firing State + case 0: + // Time between firing (as the player continues to hold) + if (Projectile.frame == 5) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= MathHelper.Clamp(Owner.ActiveItem().useAnimation - 18, 0f, Owner.ActiveItem().useAnimation)) + { + if (Owner.CantUseHoldout()) + Projectile.Kill(); + + Projectile.frame = 0; + Projectile.frameCounter = 0; + } + } + // Begin firing + else if (Projectile.frame == 0) + { + if (Projectile.frameCounter != 1) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + return; + } + + Projectile.frameCounter++; + + // Check if the player has any shots left + if (Owner.Calamity().garandShots > 0) + { + // -- Firing Logic & FX -- + muzzleFlashTimer = 2f; + flashVariant = Main.rand.Next(3); + SoundEngine.PlaySound(FireSound, GunTipPosition); + + if (Owner.Calamity().garandShots == 1) + { + SoundEngine.PlaySound(PingSound, GunTipPosition); + shouldPing = true; + } + + OffsetLengthFromArm -= 3f; + + // Consume a shot + Owner.Calamity().garandShots--; + + Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * HeldItem.shootSpeed; + + // Eject bullet casing + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity.RotatedBy(Main.rand.NextFloat(2.5f, 2.65f) * -Projectile.direction) * 0.5f, ModContent.ProjectileType(), 0, 0, Projectile.owner); + + if (Owner.Calamity().garandShots == 0) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity.RotatedBy(Main.rand.NextFloat(1.175f, 1.25f) * -Projectile.direction) * 0.285f, ModContent.ProjectileType(), 0, 0, Projectile.owner); + + GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.PaleGoldenrod, Color.Gold * 0.25f, 1.25f, 5, Projectile.velocity.ToRotation() + Main.rand.NextFloat(-0.15f, 0.15f), 1f); + GeneralParticleHandler.SpawnParticle(sparker); + } + + // Direct smoke + for (int i = 0; i < 8; i++) + { + Particle smoke = new HeavySmokeParticle(GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 7f * Main.rand.NextFloat(0.4f, 1.5f), Color.Gray, Main.rand.Next(30, 50), Main.rand.NextFloat(0.22f, 0.44f), 0.35f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + GeneralParticleHandler.SpawnParticle(smoke); + } + + // "Smoke" ring + Particle shootPulse = new DirectionalPulseRing(GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * 4f, Color.Gray * 0.5f, new Vector2(0.5f, 1f), Projectile.velocity.ToRotation(), 0.1f, 0.475f, 18); + GeneralParticleHandler.SpawnParticle(shootPulse); + + // Shot starts from slightly behind the tip + Vector2 offsetPos = GunTipPosition - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 18f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), offsetPos, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + else + { + OffsetLengthFromArm -= 1f; + CurrentState = 1; // Change state to reloading + Timer = 120; + } + } + // The firing animation + else if (Projectile.frame > 0) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + + } + } + break; + + // Reloading + case 1: + + Timer--; + + // Keep the player from switching weapons + Owner.channel = true; + + // The gun points slightly downwards during the first part + if (Timer <= 120 && Timer > 75) + { + Projectile.rotation += 0.15f * Projectile.spriteDirection; + } + // Lerp back to the normal pos + else if (Timer < 75 && Timer >= 64) + { + float progress = (75f - Timer) / (75f - 64f); + float lerpedOffset = MathHelper.Lerp(0.15f, 0f, progress); + Projectile.rotation += lerpedOffset * Projectile.spriteDirection; + } + else if (Timer == 39) + { + OffsetLengthFromArm -= 2f; + } + + // Hold frame 3 until this point + if (Timer > 40) + { + Projectile.frame = 3; + Projectile.frameCounter = 0; + } + + else if (Projectile.frame < Main.projFrames[Type] - 1) + { + Projectile.frameCounter++; + if (Projectile.frameCounter >= 3) + { + Projectile.frame++; + Projectile.frameCounter = 0; + } + } + + else + { + // Hold + Projectile.frame = Main.projFrames[Type] - 1; + } + + if (Timer == 110) + { + SoundEngine.PlaySound(ReloadSound, Projectile.Center); + } + + // Reload and cull the projectile + if (Timer <= 0) + { + Owner.Calamity().garandShots += 8; + Projectile.Kill(); + Projectile.netUpdate = true; + } + + break; + } + } + + // Can damage when firing. + public override bool? CanDamage() => muzzleFlashTimer > 0f; + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(GunTipPosition + Vector2.UnitX.RotatedBy(Projectile.rotation) * MuzzleFlash.Width() * 0.5f, 64f, targetHitbox); + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Math.Clamp(Projectile.frame, 0, Main.projFrames[Type] - 1)); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + float scale = Projectile.scale * Owner.gravDir; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, frame.Size() * 0.5f, scale, flipSprite); + + // Flash + if (muzzleFlashTimer > 0f) + { + Texture2D flashTex = MuzzleFlash.Value; + int flashFrameY = (int)flashVariant; + Vector2 flashPos = GunTipPosition + Vector2.UnitX.RotatedBy(Projectile.rotation) * MuzzleFlash.Width() * 0.5f - Main.screenPosition; + Rectangle flashFrame = flashTex.Frame(verticalFrames: 3, frameY: flashFrameY); + Main.EntitySpriteDraw(flashTex, flashPos, flashFrame, Color.White, drawRotation, flashFrame.Size() * 0.5f, scale * 0.8f, flipSprite); + } + + // PING! + if (shouldPing) + { + pingAnimationTimer++; + + if (pingAnimationTimer <= PingAnimationDuration) + { + Texture2D pingTexture = ModContent.Request("CalamityMod/Projectiles/Ranged/M1GarandPingText").Value; + Vector2 origin = pingTexture.Size() * 0.5f; + Vector2 pingDrawPosition; + + Vector2 finalPosition = Owner.Center + new Vector2(40f * -Owner.direction, -40f); + float progress = (float)pingAnimationTimer / PingAnimationDuration; + + if (pingAnimationTimer < 15) + { + float popOutProgress = (float)pingAnimationTimer / 15; + pingDrawPosition = Vector2.Lerp(Owner.Center, finalPosition, popOutProgress); + } + else + { + pingDrawPosition = finalPosition; + } + + pingDrawPosition -= Main.screenPosition; + + float stretchFactorY = 0f; + + if (progress < 0.25f) // Stretch Up + { + float stretchProgress = progress / 0.25f; + stretchFactorY = MathHelper.Lerp(-1.4f, 0.5f, (float)Math.Sin(stretchProgress * MathHelper.PiOver2)); + } + else if (progress < 0.5f) // Squash Down and overadjust + { + float squashProgress = (progress - 0.25f) / 0.3f; + stretchFactorY = MathHelper.Lerp(0.5f, -0.25f, squashProgress * squashProgress); + } + else if (progress < 0.8f) // Stretch up again at a slower pace to a bit above the normal scale + { + float stretchProgress = (progress - 0.6f) / 0.2f; + stretchFactorY = MathHelper.Lerp(-0.25f, 0f, stretchProgress * stretchProgress); + } + else // Return to normal + { + stretchFactorY = 0f; + } + + // Draw without any additions + Color drawColor = Color.White; + int fadeDuration = 30; + int fadeStartFrame = PingAnimationDuration - fadeDuration; + + // Fade out over 30 frames + if (pingAnimationTimer >= fadeStartFrame) + { + float fadeProgress = (float)(pingAnimationTimer - fadeStartFrame) / fadeDuration; + drawColor = Color.White * MathHelper.Lerp(1f, 0f, fadeProgress); + } + + float basePingDrawScale = 1f; + float stretchScaleY = 1f + stretchFactorY; + float stretchScaleX = 1f - (stretchFactorY * 0.5f); + + // Calculate scale to display with all factors combined + Vector2 finalPingScale = new Vector2(basePingDrawScale * stretchScaleX, basePingDrawScale * stretchScaleY); + Main.EntitySpriteDraw(pingTexture, pingDrawPosition, null, drawColor, Owner.direction == 1 ? -0.25f : 0.25f, origin, finalPingScale, SpriteEffects.None, 0f); + } + else + { + // Reset the flag and timer once the animation is complete. + shouldPing = false; + pingAnimationTimer = 0; + } + } + + return false; + } + + // Glowmask. + public override void PostDraw(Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Math.Clamp(Projectile.frame, 0, Main.projFrames[Type] - 1)); + Texture2D glowTexture = GlowTexture.Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 origin = frame.Size() * 0.5f; + float scale = Projectile.scale * Owner.gravDir; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(glowTexture, drawPosition, frame, Color.White, drawRotation, origin, scale, flipSprite); + } + } +} diff --git a/Projectiles/Ranged/M1GarandHoldout.png b/Projectiles/Ranged/M1GarandHoldout.png new file mode 100644 index 0000000000..59767b1acd Binary files /dev/null and b/Projectiles/Ranged/M1GarandHoldout.png differ diff --git a/Projectiles/Ranged/M1GarandHoldoutGlow.png b/Projectiles/Ranged/M1GarandHoldoutGlow.png new file mode 100644 index 0000000000..fff673165b Binary files /dev/null and b/Projectiles/Ranged/M1GarandHoldoutGlow.png differ diff --git a/Projectiles/Ranged/M1GarandMuzzleFlash.png b/Projectiles/Ranged/M1GarandMuzzleFlash.png new file mode 100644 index 0000000000..30764d9ece Binary files /dev/null and b/Projectiles/Ranged/M1GarandMuzzleFlash.png differ diff --git a/Projectiles/Ranged/M1GarandPingText.png b/Projectiles/Ranged/M1GarandPingText.png new file mode 100644 index 0000000000..2d49dc5f35 Binary files /dev/null and b/Projectiles/Ranged/M1GarandPingText.png differ diff --git a/Projectiles/Ranged/MagnaShot.cs b/Projectiles/Ranged/MagnaShot.cs index 874aa255a4..4538ed3922 100644 --- a/Projectiles/Ranged/MagnaShot.cs +++ b/Projectiles/Ranged/MagnaShot.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index f0ed4e0c90..38ff47a336 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -110,18 +110,25 @@ namespace CalamityMod.Projectiles.Ranged { // Assemble an array of the remaining coins. Projectile[] otherCoins = validCoins.Where((proj) => proj.whoAmI != struckCoin.whoAmI).ToArray(); - + RicoshotTarget nextCoin = Projectile.FindRicochetTarget(Projectile.Center, otherCoins, true); + RicochetOffCoin(nextCoin, struckCoin); // Ricochet off of this coin to the next target. // This coin (and potential further coins) may have already been recursively frozen. // As long as those coins have not yet been struck, they are valid targets. - RicoshotTarget nextTarget = Projectile.FindRicochetTarget(Projectile.Center, otherCoins, true); - RicochetOffCoin(nextTarget, struckCoin); - - // If the next target is another coin, freeze it to (almost) guarantee it will be hit. - if (nextTarget.type == RicoshotTargetType.Coin) + // If the next target is another coin/clip, freeze it. + if (nextCoin.type == RicoshotTargetType.Coin) { - Projectile nextCoin = Main.projectile[nextTarget.entityID]; - nextCoin.ai[1] = RicoshotCoin.RicochetPause; + Projectile nextCoinProj = Main.projectile[nextCoin.entityID]; + + // Use the correct RicochetPause value based on the projectile type + if (nextCoinProj.type == ModContent.ProjectileType()) + { + nextCoinProj.ai[1] = M1GarandEmptyClip.RicochetPause; + } + else + { + nextCoinProj.ai[1] = RicoshotCoin.RicochetPause; + } } } } @@ -142,18 +149,42 @@ namespace CalamityMod.Projectiles.Ranged if (NumRicochets == 0 && CalamityUtils.CanRicoshotCoinForceCrit(struckCoin)) cgp.forcedCrit = true; - // Apply bonus damage to the projectile. This is an additive multiplier between multiple coins. - float bonusDamageRatio = struckCoin.ai[0] switch + // Apply bonus damage to the projectile based on the projectile type. This is an additive multiplier between multiple coins/clips. + float bonusDamageRatio = 0f; + if (struckCoin.type == ModContent.ProjectileType()) { - 1f => NumRicochets > 0 ? RicoshotCoin.SilverMulticoinBonus : RicoshotCoin.SilverBonus, - 2f => NumRicochets > 0 ? RicoshotCoin.GoldMulticoinBonus : RicoshotCoin.GoldBonus, - _ => NumRicochets > 0 ? RicoshotCoin.CopperMulticoinBonus : RicoshotCoin.CopperBonus, - }; + bonusDamageRatio = struckCoin.ai[0] switch + { + 1f => NumRicochets > 0 ? RicoshotCoin.SilverMulticoinBonus : RicoshotCoin.SilverBonus, + 2f => NumRicochets > 0 ? RicoshotCoin.GoldMulticoinBonus : RicoshotCoin.GoldBonus, + _ => NumRicochets > 0 ? RicoshotCoin.CopperMulticoinBonus : RicoshotCoin.CopperBonus, + }; + } + else if (struckCoin.type == ModContent.ProjectileType()) + { + bonusDamageRatio = NumRicochets > 0 ? M1GarandEmptyClip.ClipMulticlipBonus : M1GarandEmptyClip.ClipBonus; + } + cgp.totalRicoshotDamageBonus += bonusDamageRatio; // Increment the ricochet count, relegating further coins to only give the multicoin bonus damage. NumRicochets++; + // If the target was valid, freeze the shot in place for a brief moment. + if (target.IsValid) + { + if (struckCoin.type == ModContent.ProjectileType()) + { + RicochetFreezeTimer = M1GarandEmptyClip.RicochetPause; + } + else + { + RicochetFreezeTimer = RicoshotCoin.RicochetPause; + } + } + + SoundEngine.PlaySound(RicoshotCoin.BlingHitSound, struckCoin.Center); + // If the target was valid, freeze the shot in place for a brief moment. if (target.IsValid) RicochetFreezeTimer = RicochetPause; diff --git a/Projectiles/Ranged/MegalodonShot.cs b/Projectiles/Ranged/MegalodonShot.cs index 9ecee22bea..08d42679d7 100644 --- a/Projectiles/Ranged/MegalodonShot.cs +++ b/Projectiles/Ranged/MegalodonShot.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index cb77b3d678..07831fa91b 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 60782c2b63..30bacffc92 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.WoodenArrowFriendly; Projectile.arrow = true; Projectile.coldDamage = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/NitroShot.cs b/Projectiles/Ranged/NitroShot.cs index 5496c63ec7..33ca4ed10f 100644 --- a/Projectiles/Ranged/NitroShot.cs +++ b/Projectiles/Ranged/NitroShot.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index a2d0eedeeb..4e1a34b204 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged private SlotId NorfleetRecharge; private ref float OffsetLength => ref Projectile.localAI[0]; - private ref float loadedShots => ref Projectile.ai[2]; private Player Owner; @@ -92,7 +91,7 @@ namespace CalamityMod.Projectiles.Ranged { hum?.Stop(); } - if (loadedShots > 1) + if (Owner.Calamity().NorfleetCounter < 2) { ShootRocket(heldItem); PostFireCooldown = PUNISHMENTMODE ? 1000 : 55; @@ -191,6 +190,7 @@ namespace CalamityMod.Projectiles.Ranged // Spawns the projectile. SoundStyle fire = new("CalamityMod/Sounds/Item/NorfleetFire"); SoundEngine.PlaySound(fire with { Volume = 0.9f, PitchVariance = 0.25f }, Projectile.Center); + Owner.Calamity().NorfleetCounter++; for (int i = 0; i < 3; i++) { @@ -328,6 +328,12 @@ namespace CalamityMod.Projectiles.Ranged { Owner = Main.player[Projectile.owner]; OffsetLength = MaxOffsetLength; + + if (Main.zenithWorld && Main.rand.NextBool(1000)) + { + PUNISHMENTMODE = true; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/NuhUhUh"), Owner.Center); + } } // Because we use the velocity as a direction, we don't need it to change its position. diff --git a/Projectiles/Ranged/NovaChargedShot.cs b/Projectiles/Ranged/NovaChargedShot.cs index 26e5da2318..8839304a71 100644 --- a/Projectiles/Ranged/NovaChargedShot.cs +++ b/Projectiles/Ranged/NovaChargedShot.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 1200; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 24; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; diff --git a/Projectiles/Ranged/NovaShot.cs b/Projectiles/Ranged/NovaShot.cs index c121177a34..cdddb8ab0e 100644 --- a/Projectiles/Ranged/NovaShot.cs +++ b/Projectiles/Ranged/NovaShot.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; diff --git a/Projectiles/Ranged/OpalChargedStrike.cs b/Projectiles/Ranged/OpalChargedStrike.cs index 52cf57f8aa..b4f268199b 100644 --- a/Projectiles/Ranged/OpalChargedStrike.cs +++ b/Projectiles/Ranged/OpalChargedStrike.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 3; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 3; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index c2d0bbc307..2799d09ce6 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; diff --git a/Projectiles/Ranged/P90Round.cs b/Projectiles/Ranged/P90Round.cs index 1fb3cf5ea8..0616130e94 100644 --- a/Projectiles/Ranged/P90Round.cs +++ b/Projectiles/Ranged/P90Round.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 5; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.tileCollide = false; // Custom tile collision since the hitbox is large Projectile.ArmorPenetration = 30; } diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index 650721a4f8..e7cd9580f2 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Ranged AIType = ProjectileID.BulletHighVelocity; Projectile.penetrate = 1; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index f6ee408e98..144d8c151b 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/PlagueTaintedProjectile.cs b/Projectiles/Ranged/PlagueTaintedProjectile.cs index 1c24282b48..b1661d4d99 100644 --- a/Projectiles/Ranged/PlagueTaintedProjectile.cs +++ b/Projectiles/Ranged/PlagueTaintedProjectile.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 2; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 49223801bc..da0808050a 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.aiStyle = ProjAIStyleID.Arrow; AIType = ProjectileID.BulletHighVelocity; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/PumplerGrenade.cs b/Projectiles/Ranged/PumplerGrenade.cs index 04ff44cbea..422818de55 100644 --- a/Projectiles/Ranged/PumplerGrenade.cs +++ b/Projectiles/Ranged/PumplerGrenade.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.DamageType = DamageClass.Ranged; Projectile.ignoreWater = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 20; diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 76570d8ccd..2b74fcb9f6 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 3; Projectile.penetrate = 1; Projectile.timeLeft = 90; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SandblasterBullet.cs b/Projectiles/Ranged/SandblasterBullet.cs index 7bdf86ebc3..1291a1650f 100644 --- a/Projectiles/Ranged/SandblasterBullet.cs +++ b/Projectiles/Ranged/SandblasterBullet.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs b/Projectiles/Ranged/SeaDragonMuzzleBlast.cs index 245b8e92fe..f6cee980a4 100644 --- a/Projectiles/Ranged/SeaDragonMuzzleBlast.cs +++ b/Projectiles/Ranged/SeaDragonMuzzleBlast.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 4; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - // This projectile is already point blank. It cannot be boosted by point blank. } public override void AI() diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index b34f8aae17..67362e8980 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -74,7 +74,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.localNPCHitCooldown = -1; Projectile.extraUpdates = 1; Projectile.timeLeft = 900; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/Shell.cs b/Projectiles/Ranged/Shell.cs index df5f7620f1..a9f54ada25 100644 --- a/Projectiles/Ranged/Shell.cs +++ b/Projectiles/Ranged/Shell.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.arrow = true; Projectile.timeLeft = 600; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 8fafacd105..6e945c6f49 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.5f; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index b67f488a47..1d7e5cb26b 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.25f; Projectile.extraUpdates = 4; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index bc9098440e..b54b01b1a6 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.extraUpdates = 3; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SpeedBlasterShot.cs b/Projectiles/Ranged/SpeedBlasterShot.cs index 25f6e366d2..5a942152a9 100644 --- a/Projectiles/Ranged/SpeedBlasterShot.cs +++ b/Projectiles/Ranged/SpeedBlasterShot.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 2; Projectile.timeLeft = 150 * Projectile.MaxUpdates; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 38971fbaa1..af42a4fbfc 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 80; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.ArmorPenetration = 8; Projectile.tileCollide = false; } diff --git a/Projectiles/Ranged/SuperradiantSaw.cs b/Projectiles/Ranged/SuperradiantSaw.cs index 5515cfb2db..6099118d71 100644 --- a/Projectiles/Ranged/SuperradiantSaw.cs +++ b/Projectiles/Ranged/SuperradiantSaw.cs @@ -56,7 +56,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; // Saws only pierce a certain number of times before returning, and don't deal direct damage while returning Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/SuperradiantSawLingering.cs b/Projectiles/Ranged/SuperradiantSawLingering.cs index 2397d1ca85..3b2f14b333 100644 --- a/Projectiles/Ranged/SuperradiantSawLingering.cs +++ b/Projectiles/Ranged/SuperradiantSawLingering.cs @@ -40,7 +40,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index d970edad12..ad3d462b5e 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; // Can hit many enemies. Will explode extremely soon after hitting the first, though. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanDamage() => (Projectile.timeLeft < Lifetime - 4) ? null : false; diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index a9a4037ffe..5d9614fdd9 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 1; Projectile.Opacity = 0f; Projectile.DamageType = DamageClass.Ranged; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index 885533921d..648535d215 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.arrow = true; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/ToxicArrow.cs b/Projectiles/Ranged/ToxicArrow.cs index e010f3eb95..42160ce9af 100644 --- a/Projectiles/Ranged/ToxicArrow.cs +++ b/Projectiles/Ranged/ToxicArrow.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 240; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 0c15bffcfa..03721e4fec 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.timeLeft = 600; AIType = ProjectileID.WoodenArrowFriendly; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void OnKill(int timeLeft) diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs index 2c321b7ad7..20dde73355 100644 --- a/Projectiles/Ranged/UltimaBolt.cs +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.arrow = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index 2e708b4d05..a2f2483888 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 600; Projectile.extraUpdates = 1; AIType = ProjectileID.Bullet; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index 80980a8125..31f5215ec9 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 2; Projectile.timeLeft = 600; Projectile.extraUpdates = 7; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 15 * Projectile.extraUpdates; } diff --git a/Projectiles/Ranged/VeriumBoltProj.cs b/Projectiles/Ranged/VeriumBoltProj.cs index 3c62464ca2..8e2d75014e 100644 --- a/Projectiles/Ranged/VeriumBoltProj.cs +++ b/Projectiles/Ranged/VeriumBoltProj.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.timeLeft = 600; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/VernalBolt.cs b/Projectiles/Ranged/VernalBolt.cs index f548e85826..2cd58bc842 100644 --- a/Projectiles/Ranged/VernalBolt.cs +++ b/Projectiles/Ranged/VernalBolt.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = 1; Projectile.extraUpdates = 1; Projectile.timeLeft = 180; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Ranged/VoidragonTentacle.cs b/Projectiles/Ranged/VoidragonTentacle.cs index cf7887c1db..5b41a1d3d8 100644 --- a/Projectiles/Ranged/VoidragonTentacle.cs +++ b/Projectiles/Ranged/VoidragonTentacle.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Projectiles.Ranged Projectile.MaxUpdates = 3; Projectile.DamageType = DamageClass.Ranged; Projectile.extraUpdates = 1; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override void AI() diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index 4163e97a2c..aa11a82aa0 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.Accessories; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(SoundID.NPCHit25, Projectile.Center); for (int i = 0; i < 4; i++) { - int damage = (int)player.GetTotalDamage().ApplyTo(32); + int damage = (int)player.GetTotalDamage().ApplyTo(InkBomb.InkDamage); int inkID = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, 7, Projectile.owner, Main.rand.Next(3) + 1); Main.projectile[inkID].timeLeft += Main.rand.Next(-15, 15 + 1); diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index d0f71b3f6f..3ed53a60cd 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.DamageType = RogueDamageClass.Instance; Projectile.extraUpdates = 1; Projectile.alpha = 150; - Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } public override bool? CanHitNPC(NPC target) => (Projectile.timeLeft < 210 || Projectile.ai[0] == 2f) && target.CanBeChasedBy(Projectile); diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 3377e232ea..62857a92d2 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -73,6 +73,12 @@ namespace CalamityMod.Projectiles.Summon public override bool MinionContactDamage() => true; + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) + { + fallThrough = true; // Should always be able to fly through platforms + return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); + } + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Typeless/ChlorophyteLifePulse.cs b/Projectiles/Typeless/ChlorophyteLifePulse.cs deleted file mode 100644 index 98e98e702e..0000000000 --- a/Projectiles/Typeless/ChlorophyteLifePulse.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.Projectiles.VanillaProjectileOverrides; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class ChlorophyteLifePulse : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - - public const int Lifetime = 60; - - public float LifetimeCompletion => 1f - Projectile.timeLeft / (float)Lifetime; - - public override void SetDefaults() - { - Projectile.width = 96; - Projectile.height = 96; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 30; - Projectile.timeLeft = Lifetime; - } - - public override bool? CanHitNPC(NPC target) => !target.CountsAsACritter && !target.friendly && target.chaseable; - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.damage = (int)(Projectile.damage * 0.8f); - - public override void AI() - { - Projectile.Opacity = 1f - (float)Math.Pow(LifetimeCompletion, 1.56); - Projectile.scale = MathHelper.Lerp(0.5f, 6f, LifetimeCompletion); - - // Heal all members of the same team. - if (Projectile.timeLeft == (int)(Lifetime * 0.925f)) - { - Player owner = Main.player[Projectile.owner]; - List membersOfSameTeam = new List() - { - owner - }; - if (owner.team != 0) - membersOfSameTeam.AddRange(Main.player.Where(p => p.team == owner.team && p.active && !p.dead)); - - foreach (Player player in membersOfSameTeam) - { - if (player.Calamity().ChlorophyteHealDelay > 0) - continue; - - int healQuantity = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.AmountToHealPerPulse); - player.HealPlayer(healQuantity); - player.Calamity().ChlorophyteHealDelay = ChlorophyteArmorSetChange.DelayBetweenHeals; - } - } - } - - public override Color? GetAlpha(Color lightColor) - { - Color c1 = new Color(142, 255, 155, 0); - Color c2 = new Color(0, 142, 113, 92); - return Color.Lerp(c1, c2, 1f - Projectile.Opacity) * Projectile.Opacity * 0.67f; - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Color drawColor = Projectile.GetAlpha(lightColor) * 0.4f; - for (int i = 0; i < 8; i++) - { - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 4f; - Vector2 drawPosition = Projectile.Center - Main.screenPosition + drawOffset; - Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, 0f, texture.Size() * 0.5f, Projectile.scale, 0, 0); - } - return false; - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.scale * 48f, targetHitbox); - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Typeless/ChlorophyteLifePulse.png b/Projectiles/Typeless/ChlorophyteLifePulse.png deleted file mode 100644 index f51029ba21..0000000000 Binary files a/Projectiles/Typeless/ChlorophyteLifePulse.png and /dev/null differ diff --git a/Projectiles/Typeless/ReaverOrb.cs b/Projectiles/Typeless/ReaverOrb.cs deleted file mode 100644 index e2557bb25b..0000000000 --- a/Projectiles/Typeless/ReaverOrb.cs +++ /dev/null @@ -1,79 +0,0 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class ReaverOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public int dust = 3; - - public override void SetDefaults() - { - Projectile.width = 48; - Projectile.height = 50; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 18000; - Projectile.alpha = 50; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.timeLeft *= 5; - } - - public override void AI() - { - bool correctMinion = Projectile.type == ModContent.ProjectileType(); - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.reaverExplore) - { - Projectile.active = false; - return; - } - if (correctMinion) - { - if (player.dead) - { - modPlayer.rOrb = false; - } - if (modPlayer.rOrb) - { - Projectile.timeLeft = 2; - } - } - dust--; - if (dust >= 0) - { - int dustAmt = 50; - for (int d = 0; d < dustAmt; d++) - { - int idx = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, DustID.ChlorophyteWeapon, 0f, 0f, 0, default, 1f); - Main.dust[idx].velocity *= 2f; - Main.dust[idx].scale *= 1.15f; - } - } - - Lighting.AddLight(Projectile.Center, 0.5f, 2f, 0.5f); - - Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); - if (player.gravDir == -1f) - { - Projectile.position.Y += 120f; - Projectile.rotation = MathHelper.Pi; - } - else - { - Projectile.rotation = 0f; - } - Projectile.position.X = (int)Projectile.position.X; - Projectile.position.Y = (int)Projectile.position.Y; - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Typeless/ReaverOrb.png b/Projectiles/Typeless/ReaverOrb.png deleted file mode 100644 index 4832434cb8..0000000000 Binary files a/Projectiles/Typeless/ReaverOrb.png and /dev/null differ diff --git a/Projectiles/Typeless/VictideBarrier.cs b/Projectiles/Typeless/VictideBarrier.cs index 181ab8790b..7ee97c9e22 100644 --- a/Projectiles/Typeless/VictideBarrier.cs +++ b/Projectiles/Typeless/VictideBarrier.cs @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Typeless if (Owner.Calamity().victideBarrierHeal > 0) { HealTimer++; - if (HealTimer % 10f == 9f) + if (HealTimer % VictideHeadBarrier.BarrierFramesPerHeal == VictideHeadBarrier.BarrierFramesPerHeal - 1) { Owner.Calamity().victideBarrierHeal--; Owner.HealPlayer(1); diff --git a/Projectiles/Typeless/XykWings.cs b/Projectiles/Typeless/XykWings.cs index a602acf9bd..5c4a83a9a4 100644 --- a/Projectiles/Typeless/XykWings.cs +++ b/Projectiles/Typeless/XykWings.cs @@ -52,9 +52,6 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - if (!BreakApart) - lastDir = Owner.direction; - float intendedScale = 0.85f; float spawnAnimTime = 12 + wingNum; if (time == 0) @@ -267,6 +264,11 @@ namespace CalamityMod.Projectiles.Typeless time++; } } + public override void PostDraw(Color lightColor) + { + if (!BreakApart) + lastDir = Owner.direction; + } public override bool PreDraw(ref Color lightColor) { float topWingNum = (checkActiveWings() - 1); diff --git a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs deleted file mode 100644 index dcc0ff7262..0000000000 --- a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using CalamityMod.Items.VanillaArmorChanges; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.VanillaProjectileOverrides -{ - public static class ChlorophyteCrystalAI - { - public static bool DoChlorophyteCrystalAI(Projectile projectile) - { - Player owner = Main.player[projectile.owner]; - ref float timer = ref projectile.ai[1]; - - timer++; - projectile.aiStyle = -1; - if (!owner.crystalLeaf) - { - projectile.Kill(); - return false; - } - - // Stay above the player. - projectile.Center = owner.Center + Vector2.UnitY * (owner.gfxOffY - 60f); - if (Main.player[projectile.owner].gravDir == -1f) - { - projectile.position.Y += 120f; - projectile.rotation = MathHelper.Pi; - } - else - projectile.rotation = 0f; - projectile.Center = projectile.Center.Floor(); - - // Disable hardcoded spaghetti that fires crystal shots in vanilla code. - owner.petalTimer = 2; - - // Have a periodically pulsing scale. - projectile.scale = MathHelper.Lerp(0.9f, 1.15f, (float)Math.Sin(timer / 27f) * 0.5f + 0.5f); - - // Emit life pulses periodically. - NPC potentialTarget = projectile.Center.ClosestNPCAt(560f, true, true); - bool ownerNotFullHealth = owner.statLife < owner.statLifeMax2; - bool willFirePulses = (potentialTarget is not null) || ownerNotFullHealth; - if (timer % ChlorophyteArmorSetChange.PulseReleaseRate == ChlorophyteArmorSetChange.PulseReleaseRate - 1f && willFirePulses) - { - if (Main.myPlayer == projectile.owner) - { - int pulseDamage = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.BaseDamageToEnemies); - - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ModContent.ProjectileType(), pulseDamage, 0f, projectile.owner); - } - } - - return false; - } - - public static void DoChlorophyteCrystalDrawing(Projectile projectile) - { - // Why doesn't this work? How does one access the texture path of a vanilla projectile? Left bugged for someone else to figure out :) - // It's me. I was that someone - Dominic - // TextureAssets is the answer, along with Main.instance.LoadProjectile(projID), to ensure that the texture is loaded into memory. - // In this instance, however, that should happen already on vanilla's end. - Texture2D texture = TextureAssets.Projectile[projectile.type].Value; - Vector2 drawPosition = projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() * 0.5f; - - float backglowColorInterpolant = MathHelper.Lerp(0.44f, 0.88f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 1.1f) * 0.5f + 0.5f); - Color backglowColor = Color.Lerp(Color.Cyan, Color.Lime, backglowColorInterpolant) * 0.37f; - backglowColor.A = 0; - for (int i = 0; i < 8; i++) - { - Vector2 drawOffset = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 3f; - Main.EntitySpriteDraw(texture, drawPosition + drawOffset, null, projectile.GetAlpha(backglowColor), projectile.rotation, origin, projectile.scale, 0, 0); - } - - Main.EntitySpriteDraw(texture, drawPosition, null, projectile.GetAlpha(Color.White * 0.75f), projectile.rotation, origin, projectile.scale, 0, 0); - } - } -} diff --git a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs index 70fb82de7f..8c0337b7be 100644 --- a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs +++ b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Systems { if (CalamityGlobalNPC.aquaticScourge == -1) return false; - return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode; + return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.zenithWorld; } } } diff --git a/Sounds/Item/M1GarandPing.ogg b/Sounds/Item/M1GarandPing.ogg new file mode 100644 index 0000000000..f05bb8a0da Binary files /dev/null and b/Sounds/Item/M1GarandPing.ogg differ diff --git a/Sounds/Item/M1GarandReload.ogg b/Sounds/Item/M1GarandReload.ogg new file mode 100644 index 0000000000..d43965eff8 Binary files /dev/null and b/Sounds/Item/M1GarandReload.ogg differ diff --git a/Sounds/Item/ShrimpFire.ogg b/Sounds/Item/ShrimpFire.ogg new file mode 100644 index 0000000000..b60d95c9aa Binary files /dev/null and b/Sounds/Item/ShrimpFire.ogg differ diff --git a/Sounds/Item/ShrimpMissileHit.ogg b/Sounds/Item/ShrimpMissileHit.ogg new file mode 100644 index 0000000000..c34fcac6cf Binary files /dev/null and b/Sounds/Item/ShrimpMissileHit.ogg differ diff --git a/Sounds/Item/ShrimpSound1.ogg b/Sounds/Item/ShrimpSound1.ogg new file mode 100644 index 0000000000..38d7eae4ea Binary files /dev/null and b/Sounds/Item/ShrimpSound1.ogg differ diff --git a/Sounds/Item/ShrimpSound2.ogg b/Sounds/Item/ShrimpSound2.ogg new file mode 100644 index 0000000000..f8106c6edf Binary files /dev/null and b/Sounds/Item/ShrimpSound2.ogg differ diff --git a/Sounds/Item/ShrimpSurprise.ogg b/Sounds/Item/ShrimpSurprise.ogg new file mode 100644 index 0000000000..5eb8fbad6d Binary files /dev/null and b/Sounds/Item/ShrimpSurprise.ogg differ diff --git a/Systems/Collections/CalamityProjectileSets.cs b/Systems/Collections/CalamityProjectileSets.cs index 072afb2b7f..3e0b91e9f0 100644 --- a/Systems/Collections/CalamityProjectileSets.cs +++ b/Systems/Collections/CalamityProjectileSets.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Systems.Collections /// /// If for a projectile type, then that projectile is considered a friendly bee.
- /// Used to allow the projectile to inflict Plague while wearing the Plaguebringer Carapace.
+ /// Used to allow the projectile to inflict Plague while wearing the Plaguebringer armor.
/// Defaults to . ///
public static bool[] IsFriendlyBeeProjectile = Factory.CreateBoolSet(ProjectileID.GiantBee, ProjectileID.Bee, ProjectileID.Wasp, ProjectileType(), diff --git a/Systems/Graphic/LightingEffectsSystem.cs b/Systems/Graphic/LightingEffectsSystem.cs index 6fa1fddea4..1bc1a1631b 100644 --- a/Systems/Graphic/LightingEffectsSystem.cs +++ b/Systems/Graphic/LightingEffectsSystem.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Systems // Total darkness float signusDarkness = signusLifeRatio * multiplier; darkRatio = MathHelper.Clamp(signusDarkness, 0f, 1f); - scale += (CalamityWorld.LegendaryMode ? MaxGFBSignusDarkness : MaxSignusDarkness) * darkRatio; + scale += (Main.zenithWorld ? MaxGFBSignusDarkness : MaxSignusDarkness) * darkRatio; } } } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 5a830c84ac..ba26817d84 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -1632,30 +1632,6 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); - // Mechanical Glove directly from correct class emblem for cheaper (compromise) - r = Recipe.Create(ItemID.MechanicalGlove); - r.AddIngredient(ItemID.PowerGlove); - r.AddIngredient(ItemID.WarriorEmblem); - r.AddIngredient(ItemID.SoulofFright); - r.AddIngredient(ItemID.SoulofMight); - r.AddIngredient(ItemID.SoulofSight); - r.AddTile(TileID.TinkerersWorkbench); - r.Register(); - r.SortAfterFirstRecipesOf(ItemID.MechanicalGlove); - r.DisableDecraft(); - - // Celestial Emblem directly from correct class emblem for cheaper (compromise) - r = Recipe.Create(ItemID.CelestialEmblem); - r.AddIngredient(ItemID.CelestialMagnet); - r.AddIngredient(ItemID.SorcererEmblem); - r.AddIngredient(ItemID.SoulofFright); - r.AddIngredient(ItemID.SoulofMight); - r.AddIngredient(ItemID.SoulofSight); - r.AddTile(TileID.TinkerersWorkbench); - r.Register(); - r.SortAfterFirstRecipesOf(ItemID.CelestialEmblem); - r.DisableDecraft(); - // Tiershift Mini Nuke 1s to post Moon Lord. r = Recipe.Create(ItemID.MiniNukeI, 333); r.AddIngredient(ItemID.RocketIII, 333); diff --git a/Systems/Tile/TileFramingSystem.cs b/Systems/Tile/TileFramingSystem.cs index 8294009f1b..169adcfb8c 100644 --- a/Systems/Tile/TileFramingSystem.cs +++ b/Systems/Tile/TileFramingSystem.cs @@ -93,6 +93,8 @@ namespace CalamityMod.Systems (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), ]; private static int[][] PlantValidGrounds; @@ -121,7 +123,7 @@ namespace CalamityMod.Systems PlantValidGrounds[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantValidGrounds[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantValidGrounds[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType() }; - PlantValidGrounds[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantValidGrounds[ModContent.TileType()] = new int[2] { ModContent.TileType(), ModContent.TileType() }; VineToGrass = new Dictionary { diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 4b21d53067..be54ad4ca5 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -32,7 +32,13 @@ namespace CalamityMod.Tiles TileType(), TileType(), TileType(), + TileType(), + TileType(), + TileType(), + TileType(), + TileType(), TileType(), + TileType(), TileType() }; diff --git a/Tiles/FurnitureBasalt/BasaltSlab.cs b/Tiles/FurnitureBasalt/BasaltSlab.cs new file mode 100644 index 0000000000..c1056c95cb --- /dev/null +++ b/Tiles/FurnitureBasalt/BasaltSlab.cs @@ -0,0 +1,57 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureBasalt +{ + public class BasaltSlab : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileShine2[Type] = true; + Main.tileBlendAll[Type] = true; + + Main.tileLargeFrames[Type] = 1; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + + DustType = DustID.Ash; + HitSound = SoundID.Tink; + + AddMapEntry(new Color(58, 55, 70)); + + MinPick = 110; + + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + } +} diff --git a/Tiles/FurnitureBasalt/BasaltSlab.png b/Tiles/FurnitureBasalt/BasaltSlab.png new file mode 100644 index 0000000000..a81c872726 Binary files /dev/null and b/Tiles/FurnitureBasalt/BasaltSlab.png differ diff --git a/Tiles/Merges/VolcanicSandMerge.cs b/Tiles/Merges/VolcanicSandMerge.cs new file mode 100644 index 0000000000..24e96261eb --- /dev/null +++ b/Tiles/Merges/VolcanicSandMerge.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Merges +{ + public sealed class VolcanicSandMerge : TileBlendTexture + { + public override int TileType => ModContent.TileType(); + } +} diff --git a/Tiles/Merges/VolcanicSandMerge.png b/Tiles/Merges/VolcanicSandMerge.png new file mode 100644 index 0000000000..2f351b6d1a Binary files /dev/null and b/Tiles/Merges/VolcanicSandMerge.png differ diff --git a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs index 28345f79b5..ebe0e4e805 100644 --- a/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/TableCoralEcho.cs @@ -50,14 +50,4 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea frameYOffset = yPos * subsheetHeight; } } - - public class TableCoralEcho2 : TableCoralEcho - { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TableCoral2"; - } - - public class TableCoralEcho3 : TableCoralEcho - { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/TableCoral3"; - } } diff --git a/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs b/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs index da444b3432..f7ef145f92 100644 --- a/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/WallCoralEcho.cs @@ -5,9 +5,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Rubblemaker.SunkenSea { - public class WallCoral1Echo : WallCoral1 + public class WallCoralEcho : WallCoral { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral1"; + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral"; public override void SetStaticDefaults() { base.SetStaticDefaults(); @@ -17,31 +17,9 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea } } - public class WallCoral2Echo : WallCoral2 + public class WallCoralLeftEcho : WallCoralLeft { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral2"; - public override void SetStaticDefaults() - { - base.SetStaticDefaults(); - RegisterItemDrop(ModContent.ItemType(), Type, 0); - //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); - } - } - - public class WallCoral3Echo : WallCoral3 - { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral3"; - public override void SetStaticDefaults() - { - base.SetStaticDefaults(); - RegisterItemDrop(ModContent.ItemType(), Type, 0); - //FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); - } - } - - public class WallCoral4Echo : WallCoral4 - { - public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoral4"; + public override string Texture => "CalamityMod/Tiles/SunkenSea/Ambient/WallCoralLeft"; public override void SetStaticDefaults() { base.SetStaticDefaults(); diff --git a/Tiles/SunkenSea/Ambient/GilHerb.cs b/Tiles/SunkenSea/Ambient/GilHerb.cs new file mode 100644 index 0000000000..a3b6f3b65d --- /dev/null +++ b/Tiles/SunkenSea/Ambient/GilHerb.cs @@ -0,0 +1,79 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.SunkenSea.Ambient +{ + public class GilHerb : ModTile + { + public override void SetStaticDefaults() + { + Main.tileCut[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoFail[Type] = true; + Main.tileNoAttach[Type] = true; + TileID.Sets.IsVine[Type] = true; + TileID.Sets.VineThreads[Type] = true; + AddMapEntry(new Color(41, 97, 126)); + DustType = DustID.Grass; + HitSound = SoundID.Grass; + } + + public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) + { + Tile tile = Framing.GetTileSafely(i, j + 1); + if (tile.HasTile && tile.TileType == Type) + WorldGen.KillTile(i, j + 1); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + Tile tileAbove = Framing.GetTileSafely(i, j - 1); + int type = -1; + if (tileAbove.HasTile && !tileAbove.BottomSlope) + type = tileAbove.TileType; + + if (type == ModContent.TileType() || type == Type) + return true; + + WorldGen.KillTile(i, j); + return true; + } + + public override void RandomUpdate(int i, int j) + { + Tile tileBelow = Framing.GetTileSafely(i, j + 1); + if (WorldGen.genRand.NextBool(5) && !tileBelow.HasTile && tileBelow.LiquidType != LiquidID.Lava) + { + bool PlaceVine = false; + int Test = j; + while (Test > j - 10) + { + Tile testTile = Framing.GetTileSafely(i, Test); + if (testTile.BottomSlope) + { + break; + } + else if (!testTile.HasTile || testTile.TileType != ModContent.TileType()) + { + Test--; + continue; + } + PlaceVine = true; + break; + } + + if (PlaceVine) + { + tileBelow.TileType = Type; + tileBelow.HasTile = true; + WorldGen.SquareTileFrame(i, j + 1, true); + if (Main.dedServ) + NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); + } + } + } + } +} diff --git a/Tiles/SunkenSea/Ambient/GilHerb.png b/Tiles/SunkenSea/Ambient/GilHerb.png new file mode 100644 index 0000000000..5f73fb2918 Binary files /dev/null and b/Tiles/SunkenSea/Ambient/GilHerb.png differ diff --git a/Tiles/SunkenSea/Ambient/SunkenShip.cs b/Tiles/SunkenSea/Ambient/SunkenShip.cs new file mode 100644 index 0000000000..d32f8472c6 --- /dev/null +++ b/Tiles/SunkenSea/Ambient/SunkenShip.cs @@ -0,0 +1,41 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.Enums; +using Terraria.DataStructures; +using Terraria.Localization; + +namespace CalamityMod.Tiles.SunkenSea.Ambient +{ + public class SunkenShip : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileBlockLight[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.Width = 14; + TileObjectData.newTile.Height = 8; + TileObjectData.newTile.Origin = new Point16(7, 7); + TileObjectData.newTile.CoordinateHeights = new[] { 16, 16, 16, 16, 16, 16, 16, 16 }; + TileObjectData.newTile.AnchorBottom = new AnchorData( + AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, 14, 0); + + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + + TileObjectData.addTile(Type); + + AddMapEntry(new Color(100, 80, 70), Language.GetText("Sunken Ship")); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/Ambient/SunkenShip.png b/Tiles/SunkenSea/Ambient/SunkenShip.png new file mode 100644 index 0000000000..496c1e2555 Binary files /dev/null and b/Tiles/SunkenSea/Ambient/SunkenShip.png differ diff --git a/Tiles/SunkenSea/Ambient/TableCoral.cs b/Tiles/SunkenSea/Ambient/TableCoral.cs index 8d2c9bd58d..fc71856e8d 100644 --- a/Tiles/SunkenSea/Ambient/TableCoral.cs +++ b/Tiles/SunkenSea/Ambient/TableCoral.cs @@ -10,21 +10,21 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public class TableCoral : ModTile { + private const int Variants = 3; public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileSolidTop[Type] = true; + + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = Variants; + TileObjectData.newTile.RandomStyleRange = Variants; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.StyleMultiplier = 2; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); + TileObjectData.newTile.AnchorBottom = AnchorData.Empty; TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.addTile(Type); + DustType = 253; AddMapEntry(new Color(54, 69, 72)); } @@ -34,12 +34,4 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient num = fail ? 1 : 3; } } - - public class TableCoral2 : TableCoral - { - } - - public class TableCoral3 : TableCoral - { - } } diff --git a/Tiles/SunkenSea/Ambient/TableCoral.png b/Tiles/SunkenSea/Ambient/TableCoral.png index 45ea42abfd..be8d875999 100644 Binary files a/Tiles/SunkenSea/Ambient/TableCoral.png and b/Tiles/SunkenSea/Ambient/TableCoral.png differ diff --git a/Tiles/SunkenSea/Ambient/TableCoral2.png b/Tiles/SunkenSea/Ambient/TableCoral2.png deleted file mode 100644 index 90c37eaa63..0000000000 Binary files a/Tiles/SunkenSea/Ambient/TableCoral2.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/TableCoral3.png b/Tiles/SunkenSea/Ambient/TableCoral3.png deleted file mode 100644 index 4b9b83df62..0000000000 Binary files a/Tiles/SunkenSea/Ambient/TableCoral3.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/TableCoralLeft.cs b/Tiles/SunkenSea/Ambient/TableCoralLeft.cs new file mode 100644 index 0000000000..d483514583 --- /dev/null +++ b/Tiles/SunkenSea/Ambient/TableCoralLeft.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.SunkenSea.Ambient +{ + public class TableCoralLeft : ModTile + { + private const int Variants = 3; + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileSolidTop[Type] = true; + + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = Variants; + TileObjectData.newTile.RandomStyleRange = Variants; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.newTile.AnchorBottom = AnchorData.Empty; + TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); + TileObjectData.addTile(Type); + + DustType = 253; + AddMapEntry(new Color(54, 69, 72)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/Ambient/TableCoralLeft.png b/Tiles/SunkenSea/Ambient/TableCoralLeft.png new file mode 100644 index 0000000000..e107da9ede Binary files /dev/null and b/Tiles/SunkenSea/Ambient/TableCoralLeft.png differ diff --git a/Tiles/SunkenSea/Ambient/WallCoral.cs b/Tiles/SunkenSea/Ambient/WallCoral.cs index 39e2e2dd73..a01eefb85c 100644 --- a/Tiles/SunkenSea/Ambient/WallCoral.cs +++ b/Tiles/SunkenSea/Ambient/WallCoral.cs @@ -2,25 +2,27 @@ using Terraria; using Terraria.DataStructures; using Terraria.Enums; -using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.SunkenSea.Ambient { - public class WallCoral1 : ModTile + public class WallCoral : ModTile { + private const int Variants = 4; public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; Main.tileSolidTop[Type] = false; Main.tileLighted[Type] = true; + + + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = Variants; + TileObjectData.newTile.RandomStyleRange = Variants; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); - TileObjectData.addAlternate(1); + TileObjectData.newTile.AnchorBottom = AnchorData.Empty; TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, 2, 0); TileObjectData.addTile(Type); DustType = 253; @@ -31,42 +33,5 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { num = fail ? 1 : 3; } - - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.42f; - g = 0.16f; - b = 0.16f; - } - } - - public class WallCoral2 : WallCoral1 - { - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.213f; - g = 0.349f; - b = 0.416f; - } - } - - public class WallCoral3 : WallCoral1 - { - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.151f; - g = 0.342f; - b = 0.284f; - } - } - - public class WallCoral4 : WallCoral1 - { - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.38f; - g = 0.28f; - b = 0.32f; - } } } diff --git a/Tiles/SunkenSea/Ambient/WallCoral.png b/Tiles/SunkenSea/Ambient/WallCoral.png new file mode 100644 index 0000000000..6ef197c60b Binary files /dev/null and b/Tiles/SunkenSea/Ambient/WallCoral.png differ diff --git a/Tiles/SunkenSea/Ambient/WallCoral1.png b/Tiles/SunkenSea/Ambient/WallCoral1.png deleted file mode 100644 index 5efc01eaec..0000000000 Binary files a/Tiles/SunkenSea/Ambient/WallCoral1.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/WallCoral2.png b/Tiles/SunkenSea/Ambient/WallCoral2.png deleted file mode 100644 index ab007eeb0f..0000000000 Binary files a/Tiles/SunkenSea/Ambient/WallCoral2.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/WallCoral3.png b/Tiles/SunkenSea/Ambient/WallCoral3.png deleted file mode 100644 index c5017e1401..0000000000 Binary files a/Tiles/SunkenSea/Ambient/WallCoral3.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/WallCoral4.png b/Tiles/SunkenSea/Ambient/WallCoral4.png deleted file mode 100644 index 901f50fcdb..0000000000 Binary files a/Tiles/SunkenSea/Ambient/WallCoral4.png and /dev/null differ diff --git a/Tiles/SunkenSea/Ambient/WallCoralLeft.cs b/Tiles/SunkenSea/Ambient/WallCoralLeft.cs new file mode 100644 index 0000000000..377e2b0457 --- /dev/null +++ b/Tiles/SunkenSea/Ambient/WallCoralLeft.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.SunkenSea.Ambient +{ + public class WallCoralLeft : ModTile + { + public const int Variants = 4; + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileSolidTop[Type] = false; + Main.tileLighted[Type] = true; + + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = Variants; + TileObjectData.newTile.RandomStyleRange = Variants; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); + TileObjectData.newTile.AnchorBottom = AnchorData.Empty; + TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile, 2, 0); + TileObjectData.addTile(Type); + DustType = 253; + AddMapEntry(new Color(54, 69, 72)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/SunkenSea/Ambient/WallCoralLeft.png b/Tiles/SunkenSea/Ambient/WallCoralLeft.png new file mode 100644 index 0000000000..f8e349d9e8 Binary files /dev/null and b/Tiles/SunkenSea/Ambient/WallCoralLeft.png differ diff --git a/Tiles/SunkenSea/AridSoil.cs b/Tiles/SunkenSea/AridSoil.cs index e0a83dfa7d..8d6ced2822 100644 --- a/Tiles/SunkenSea/AridSoil.cs +++ b/Tiles/SunkenSea/AridSoil.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -26,13 +27,25 @@ namespace CalamityMod.Tiles.SunkenSea DustType = DustID.Hive; AddMapEntry(new Color(171, 101, 87)); + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/SunkenSea/Basalt.cs b/Tiles/SunkenSea/Basalt.cs index 08dcb46d06..6c8ee7e5ef 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; Main.tileShine2[Type] = false; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -26,13 +27,17 @@ namespace CalamityMod.Tiles.SunkenSea MinPick = 110; + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); diff --git a/Tiles/SunkenSea/BlackPearlPile.cs b/Tiles/SunkenSea/BlackPearlPile.cs index 7749b43860..1a9223e6af 100644 --- a/Tiles/SunkenSea/BlackPearlPile.cs +++ b/Tiles/SunkenSea/BlackPearlPile.cs @@ -1,7 +1,9 @@ -using CalamityMod.Sounds; +using System; +using CalamityMod.Sounds; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +18,9 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileBlockLight[Type] = true; TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileLighted[Type] = true; + + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); Main.tileShine[Type] = 3500; @@ -28,23 +33,133 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.CanBeDugByShovel[Type] = true; + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PyreMantleMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); - this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); - this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); - this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + //Normal merges this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + int frameX = tile.TileFrameX + (i % 1); + int frameY = tile.TileFrameY + (j % 1); + + Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16); + + Texture2D GlintTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/BlackPearlPile_Glint").Value; + + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.05f, // upper glint + screenDiagonalLength * 0.5f, // middle glint + screenDiagonalLength * 1.05f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, sourceRect, (Lighting.GetColor(i, j) * 6) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + // figure out if the tile is exposed - taken from the coral tiles + if (Main.tile[i, j] == null || + (Main.tile[i - 1, j].HasTile && Main.tile[i + 1, j].HasTile && Main.tile[i, j - 1].HasTile && Main.tile[i, j + 1].HasTile)) + return; + + // get in-game lighting color at this tile + Color litColor = Lighting.GetColor(i, j); + + // convert to brightness factor (0 = dark, 1 = full bright) + float brightness = (litColor.R + litColor.G + litColor.B) / (3f * 255f); + + // flip it so the glow is strongest in the dark + float darknessFactor = 1f - brightness; + + // diagonal glint math + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = new Vector2(i * 16, j * 16) - Main.screenPosition; + float projection = Vector2.Dot(screenPos, glintDir); + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + + float[] beamCenters = + { + screenDiagonalLength * 0.05f, + screenDiagonalLength * 0.5f, + screenDiagonalLength * 1.05f + }; + + float stripeWidth = 100f; + float maxStrength = 0f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + if (strength > maxStrength) + maxStrength = strength; + } + + if (maxStrength > 0f) + { + // base intensity scaled by glint strength and darkness + float intensity = 0.6f * maxStrength * (0.5f + darknessFactor * 0.5f); + + r = (67f / 155f) * intensity; + g = (68f / 155f) * intensity; + b = (87f / 155f) * intensity; + } + } } } diff --git a/Tiles/SunkenSea/BlackPearlPile_Glint.png b/Tiles/SunkenSea/BlackPearlPile_Glint.png new file mode 100644 index 0000000000..693c93520c Binary files /dev/null and b/Tiles/SunkenSea/BlackPearlPile_Glint.png differ diff --git a/Tiles/SunkenSea/EutrophicGlass.cs b/Tiles/SunkenSea/EutrophicGlass.cs index 77f47816d1..ebde80d594 100644 --- a/Tiles/SunkenSea/EutrophicGlass.cs +++ b/Tiles/SunkenSea/EutrophicGlass.cs @@ -1,4 +1,6 @@ -using CalamityMod.Systems; +using System; +using CalamityMod.Systems; +using Microsoft.CodeAnalysis.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -40,12 +42,22 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { if (Main.tile[i, j].IsTileActuallyInvisible()) return; - float transparency = 0.6f; + float transparency = 0.4f; // Must be set here TileID.Sets.DrawsWalls[Type] = true; @@ -62,6 +74,41 @@ namespace CalamityMod.Tiles.SunkenSea Color color = Lighting.GetColor(i, j) * transparency; TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, color, false), default); + + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + Texture2D GlintTex = ModContent.Request(Texture + "_Glint").Value; + + Vector2 glintDir = new Vector2(1f, 1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.53f, // upper glint + screenDiagonalLength * 0.63f, // middle glint + screenDiagonalLength * 0.73f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, frame, (Lighting.GetColor(i, j) * 2 ) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/SunkenSea/EutrophicGlass_Glint.png b/Tiles/SunkenSea/EutrophicGlass_Glint.png new file mode 100644 index 0000000000..3b890a78f2 Binary files /dev/null and b/Tiles/SunkenSea/EutrophicGlass_Glint.png differ diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 586129ae10..0d161b29fd 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -21,12 +21,13 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Sand"]); CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); // Tile blends with sandstone, which it is set to merge with here - Main.tileShine[Type] = 1800; + Main.tileShine[Type] = 2500; TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; @@ -44,26 +45,12 @@ namespace CalamityMod.Tiles.SunkenSea public override void RandomUpdate(int i, int j) { - if (!WorldGen.genRand.NextBool(8)) - return; - Tile tile = Main.tile[i, j]; - if (tile.HasTile || tile.LiquidAmount <= 0) - return; - - if (tile.LeftSlope || tile.RightSlope || tile.IsHalfBlock) - return; - Tile up = Main.tile[i, j - 1]; - if (up.HasTile || up.LiquidAmount <= 0) - return; - Tile up2 = Main.tile[i, j - 2]; - if (up2.HasTile || up2.LiquidAmount <= 0) - return; // Place corals - if (WorldGen.genRand.NextBool(3)) + if (WorldGen.genRand.NextBool(8) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; @@ -78,57 +65,18 @@ namespace CalamityMod.Tiles.SunkenSea NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } - - //multi-colored corals - if (WorldGen.genRand.NextBool(3)) + // Place sunken kelp + if (WorldGen.genRand.NextBool(2) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { - ushort[] ColoredCorals = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; - ushort newObject = Main.rand.Next(ColoredCorals); + WorldGen.SquareTileFrame(i, j - 1, true); - WorldGen.PlaceObject(i, j - 1, newObject, true); - NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1); - } - - //blue coral trees - if (WorldGen.genRand.NextBool(6)) - { - ushort[] BlueCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - ushort newObject = Main.rand.Next(BlueCorals); - - WorldGen.PlaceObject(i, j - 1, newObject, true); - NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1); - } - - //brown coral trees - if (WorldGen.genRand.NextBool(6)) - { - ushort[] BrownCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - ushort newObject = Main.rand.Next(BrownCorals); - - WorldGen.PlaceObject(i, j - 1, newObject, true); - NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1); - } - - //fan coral - if (WorldGen.genRand.NextBool(10)) - { - WorldGen.PlaceObject(i, j - 1, (ushort)ModContent.TileType()); - } - - //misc corals - if (WorldGen.genRand.NextBool()) - { - ushort[] MiscCorals = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - ushort newObject = Main.rand.Next(MiscCorals); - - WorldGen.PlaceObject(i, j - 1, newObject, true); - NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1); + if (Main.dedServ) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } } } @@ -139,7 +87,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } } } diff --git a/Tiles/SunkenSea/EutrophicSand.png b/Tiles/SunkenSea/EutrophicSand.png index 7561c14ec6..0e4be4e4ad 100644 Binary files a/Tiles/SunkenSea/EutrophicSand.png and b/Tiles/SunkenSea/EutrophicSand.png differ diff --git a/Tiles/SunkenSea/HardenedEutrophicSand.cs b/Tiles/SunkenSea/HardenedEutrophicSand.cs index c85a907006..957214a8c7 100644 --- a/Tiles/SunkenSea/HardenedEutrophicSand.cs +++ b/Tiles/SunkenSea/HardenedEutrophicSand.cs @@ -17,11 +17,12 @@ namespace CalamityMod.Tiles.SunkenSea { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); - Main.tileShine[Type] = 1800; + Main.tileShine[Type] = 2500; Main.tileShine2[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; @@ -44,7 +45,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } public override void RandomUpdate(int i, int j) @@ -84,6 +85,20 @@ namespace CalamityMod.Tiles.SunkenSea NetMessage.SendObjectPlacement(-1, i, j - 1, (ushort)ModContent.TileType(), 0, 0, -1, -1); } } + + // Place sunken kelp + if (WorldGen.genRand.NextBool(2) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; + + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.dedServ) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } } } } diff --git a/Tiles/SunkenSea/HardenedEutrophicSand.png b/Tiles/SunkenSea/HardenedEutrophicSand.png index 5f80ec3a45..f0dfb21ae8 100644 Binary files a/Tiles/SunkenSea/HardenedEutrophicSand.png and b/Tiles/SunkenSea/HardenedEutrophicSand.png differ diff --git a/Tiles/SunkenSea/LimeCoral.cs b/Tiles/SunkenSea/LimeCoral.cs index 9aaf526827..3bf70a96fd 100644 --- a/Tiles/SunkenSea/LimeCoral.cs +++ b/Tiles/SunkenSea/LimeCoral.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Tiles.SunkenSea { if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile) { - r = 0.59f; - g = 0.81f; - b = 0.32f; + r = 139f / 255f; + g = 206f / 255f; + b = 56f / 255f; } } diff --git a/Tiles/SunkenSea/LimeCoral.png b/Tiles/SunkenSea/LimeCoral.png index b7fb07b8d0..fb914d3a3b 100644 Binary files a/Tiles/SunkenSea/LimeCoral.png and b/Tiles/SunkenSea/LimeCoral.png differ diff --git a/Tiles/SunkenSea/Limestone.cs b/Tiles/SunkenSea/Limestone.cs index 6c05789b43..fb13b3429f 100644 --- a/Tiles/SunkenSea/Limestone.cs +++ b/Tiles/SunkenSea/Limestone.cs @@ -1,5 +1,6 @@ using CalamityMod.Systems; using CalamityMod.Tiles.Merges; +using CalamityMod.Tiles.SunkenSea.Ambient; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -14,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + Main.tileBlendAll[Type] = true; CalamityUtils.MergeWithGeneral(Type); TileID.Sets.HasSlopeFrames[Type] = true; @@ -21,18 +23,52 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Tink; DustType = DustID.Pot; - AddMapEntry(new Color(154, 119, 119)); + AddMapEntry(new Color(206, 166, 142)); + //Stone merges this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); - this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + public override void RandomUpdate(int i, int j) + { + Tile Tile = Framing.GetTileSafely(i, j); + Tile Below = Framing.GetTileSafely(i, j + 1); + Tile Above = Framing.GetTileSafely(i, j - 1); + + if (!Below.HasTile && Below.LiquidType <= 0 && !Tile.BottomSlope) + { + if (Main.rand.NextBool(10)) + { + Below.TileType = (ushort)ModContent.TileType(); + Below.HasTile = true; + WorldGen.SquareTileFrame(i, j + 1, true); + if (Main.dedServ) + { + NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); + } + } + } + } } } diff --git a/Tiles/SunkenSea/Limestone.png b/Tiles/SunkenSea/Limestone.png index 8663309de3..1ff28b15d7 100644 Binary files a/Tiles/SunkenSea/Limestone.png and b/Tiles/SunkenSea/Limestone.png differ diff --git a/Tiles/SunkenSea/LimestoneCobble.cs b/Tiles/SunkenSea/LimestoneCobble.cs new file mode 100644 index 0000000000..2fb987d704 --- /dev/null +++ b/Tiles/SunkenSea/LimestoneCobble.cs @@ -0,0 +1,53 @@ +using CalamityMod.Systems; +using CalamityMod.Tiles.Merges; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class LimestoneCobble : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + Main.tileBlendAll[Type] = true; + CalamityUtils.MergeWithGeneral(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + + TileID.Sets.ChecksForMerge[Type] = true; + HitSound = SoundID.Tink; + DustType = DustID.Pot; + AddMapEntry(new Color(154, 119, 119)); + + //Stone merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + + //Sand merges + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/PolypSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ScarletSeaGrassTile"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/VolcanicSandMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + //Normal merges + this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); + this.RegisterUniversalMerge(TileID.Ash, "CalamityMod/Tiles/Merges/AshMerge"); + this.RegisterUniversalMerge(TileID.Mud, "CalamityMod/Tiles/Merges/MudMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/SunkenSea/LimestoneCobble.png b/Tiles/SunkenSea/LimestoneCobble.png new file mode 100644 index 0000000000..8663309de3 Binary files /dev/null and b/Tiles/SunkenSea/LimestoneCobble.png differ diff --git a/Tiles/SunkenSea/MagentaCoral.png b/Tiles/SunkenSea/MagentaCoral.png index e02ef96fce..83ac873383 100644 Binary files a/Tiles/SunkenSea/MagentaCoral.png and b/Tiles/SunkenSea/MagentaCoral.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs index 430664f3a3..97f84eec2c 100644 --- a/Tiles/SunkenSea/MediumSeaPrismCrystal.cs +++ b/Tiles/SunkenSea/MediumSeaPrismCrystal.cs @@ -10,6 +10,8 @@ using Terraria.Enums; using Terraria.ObjectData; using CalamityMod.Items.Weapons.Melee; using Terraria.GameContent; +using CalamityMod.Systems; +using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Tiles.SunkenSea { @@ -22,7 +24,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = true; Main.tileSpelunker[Type] = true; - Main.tileShine[Type] = 3500; + Main.tileShine[Type] = 5600; Main.tileShine2[Type] = true; HitSound = SoundID.Item27; @@ -70,20 +72,52 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - var tile = Main.tile[i, j]; - bool lessLightDueToLowWater = tile.LiquidAmount > 50 && tile.LiquidType == LiquidID.Water; + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); - //Blue - Color blue = new Color(202, 236, 238); - Color darkviolet = new Color(18, 67, 116); - Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 10) / 50f + Main.GameUpdateCount * 0.064f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.27f : 0.36f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; + } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/MediumSeaPrismCrystal_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal.png b/Tiles/SunkenSea/MediumSeaPrismCrystal.png index e087780707..ceef890ebe 100644 Binary files a/Tiles/SunkenSea/MediumSeaPrismCrystal.png and b/Tiles/SunkenSea/MediumSeaPrismCrystal.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png new file mode 100644 index 0000000000..ceef890ebe Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Blue.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png new file mode 100644 index 0000000000..4667f80b89 Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Glint.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png new file mode 100644 index 0000000000..e10cc3ce4f Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Green.png differ diff --git a/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png new file mode 100644 index 0000000000..b0d2462bd5 Binary files /dev/null and b/Tiles/SunkenSea/MediumSeaPrismCrystal_Purple.png differ diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index f599048eec..112f32cfe5 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.HasSlopeFrames[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -37,7 +38,7 @@ namespace CalamityMod.Tiles.SunkenSea public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - return TileFramingSystem.BrimstoneFraming(i, j, resetFrame); + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } public override void RandomUpdate(int i, int j) diff --git a/Tiles/SunkenSea/Navystone.png b/Tiles/SunkenSea/Navystone.png index d81a8b93bb..a0cc7f0beb 100644 Binary files a/Tiles/SunkenSea/Navystone.png and b/Tiles/SunkenSea/Navystone.png differ diff --git a/Tiles/SunkenSea/PinkPearlPile.cs b/Tiles/SunkenSea/PinkPearlPile.cs index 7bcd41ef34..2ef85911ee 100644 --- a/Tiles/SunkenSea/PinkPearlPile.cs +++ b/Tiles/SunkenSea/PinkPearlPile.cs @@ -1,10 +1,14 @@ -using CalamityMod.Sounds; +using System; +using CalamityMod.Sounds; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss; +using Microsoft.CodeAnalysis.Text; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using static CalamityMod.Projectiles.Rogue.FinalDawnFlame; namespace CalamityMod.Tiles.SunkenSea { @@ -14,6 +18,7 @@ namespace CalamityMod.Tiles.SunkenSea { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + Main.tileLighted[Type] = true; CalamityUtils.MergeWithGeneral(Type); @@ -46,5 +51,113 @@ namespace CalamityMod.Tiles.SunkenSea { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + int frameX = tile.TileFrameX + (i % 1 ); + int frameY = tile.TileFrameY + (j % 1 ); + + Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16); + + + Texture2D GlintTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/PinkPearlPile_Glint").Value; + + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.05f, // upper glint + screenDiagonalLength * 0.5f, // middle glint + screenDiagonalLength * 1.05f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, sourceRect, (Lighting.GetColor(i, j) * 6 ) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + // figure out if the tile is exposed - taken from the coral tiles + if (Main.tile[i, j] == null || + (Main.tile[i - 1, j].HasTile && Main.tile[i + 1, j].HasTile && Main.tile[i, j - 1].HasTile && Main.tile[i, j + 1].HasTile)) + return; + + // get in-game lighting color at this tile + Color litColor = Lighting.GetColor(i, j); + + // convert to brightness factor (0 = dark, 1 = full bright) + float brightness = (litColor.R + litColor.G + litColor.B) / (3f * 255f); + + // flip it so the glow is strongest in the dark + float darknessFactor = 1f - brightness; + + // diagonal glint math + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = new Vector2(i * 16, j * 16) - Main.screenPosition; + float projection = Vector2.Dot(screenPos, glintDir); + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + + float[] beamCenters = + { + screenDiagonalLength * 0.05f, + screenDiagonalLength * 0.5f, + screenDiagonalLength * 1.05f + }; + + float stripeWidth = 100f; + float maxStrength = 0f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + if (strength > maxStrength) + maxStrength = strength; + } + + if (maxStrength > 0f) + { + // base intensity scaled by glint strength and darkness + float intensity = 0.6f * maxStrength * (0.5f + darknessFactor * 0.5f); + + r = (172f / 255f) * intensity; + g = (112f / 255f) * intensity; + b = (145f / 255f) * intensity; + } + } + } } diff --git a/Tiles/SunkenSea/PinkPearlPile_Glint.png b/Tiles/SunkenSea/PinkPearlPile_Glint.png new file mode 100644 index 0000000000..bd5253d1eb Binary files /dev/null and b/Tiles/SunkenSea/PinkPearlPile_Glint.png differ diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 3c3f1ae585..22310dc258 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -1,7 +1,9 @@ using System; using CalamityMod.Systems; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,18 +12,20 @@ namespace CalamityMod.Tiles.SunkenSea public class SeaPrism : ModTile { private const short subsheetWidth = 468; - private const short subsheetHeight = 90; - + private const short subsheetHeight = 90; + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = false; TileID.Sets.HasSlopeFrames[Type] = true; + Main.tileMerge[Type][ModContent.TileType()] = true; + + Main.tileMerge[Type][ModContent.TileType()] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); Main.tileLighted[Type] = true; - Main.tileShine[Type] = 5000; Main.tileShine2[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; @@ -48,22 +52,95 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - float brightness = 0.9f; - Color blue = new Color(162, 216, 218); - Color darkviolet = new Color(18, 78, 96); - Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); - r = (value.R + value1.R) / 800f; - g = (value.G + value1.G) / 800f; - b = (value.B + value1.B) / 800f; - r *= brightness; - g *= brightness; - b *= brightness; + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + int frameX = tile.TileFrameX + (i % 8 * subsheetWidth); + int frameY = tile.TileFrameY + (j % 8 * subsheetHeight); + + Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Blue").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); + + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Texture2D GlintTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrism_GlintMask").Value; + + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.05f, // upper glint + screenDiagonalLength * 0.5f, // middle glint + screenDiagonalLength * 1.05f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, sourceRect, Color.White * strength, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } +} + return true; + + } } } diff --git a/Tiles/SunkenSea/SeaPrism.png b/Tiles/SunkenSea/SeaPrism.png index 7e6c12266c..01220e2182 100644 Binary files a/Tiles/SunkenSea/SeaPrism.png and b/Tiles/SunkenSea/SeaPrism.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index dd064e88e7..8c008a9ff8 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -1,6 +1,7 @@ using System; using CalamityMod.Items.Placeables.SunkenSea; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -31,52 +32,51 @@ namespace CalamityMod.Tiles.SunkenSea public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - var tile = Main.tile[i, j]; - bool lessLightDueToLowWater = tile.LiquidAmount > 50 && tile.LiquidType == LiquidID.Water; - int xframe = tile.TileFrameX / 18; - if (xframe > 7 && xframe < 14) - { - //Purple - Color darkviolet = new Color(75, 54, 103); - Color violet = new Color(231, 205, 245); - Color value = Color.Lerp(darkviolet, violet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.037f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(darkviolet, violet, (MathF.Sin((j - 120) / 50f + Main.GameUpdateCount * 0.014f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.36f : 0.48f; - g = lessLightDueToLowWater ? 0.315f : 0.42f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; - - } - else if (xframe >= 14) - { - //Green - Color murkeygreen = new Color(28, 68, 54); - Color lightgreen = new Color(166, 234, 198); - Color value2 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.027f + i / 40f) + 1f) / 2f); - Color value3 = Color.Lerp(murkeygreen, lightgreen, (MathF.Sin((j - 80) / 50f + Main.GameUpdateCount * 0.034f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.225f : 0.3f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.315f : 0.42f; - r *= (value2.R + value3.R) / 300f; - g *= (value2.G + value3.G) / 300f; - b *= (value2.B + value3.B) / 300f; - } - else - { - //Blue - Color blue = new Color(67, 187, 204); - Color darkviolet = new Color(18, 67, 116); - Color value = Color.Lerp(blue, darkviolet, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); - Color value1 = Color.Lerp(blue, darkviolet, (MathF.Sin((j - 10) / 50f + Main.GameUpdateCount * 0.064f + -i / 30f) + 1f) / 2f); - r = lessLightDueToLowWater ? 0.27f : 0.36f; - g = lessLightDueToLowWater ? 0.405f : 0.54f; - b = lessLightDueToLowWater ? 0.405f : 0.54f; - r *= (value.R + value1.R) / 300f; - g *= (value.G + value1.G) / 300f; - b *= (value.B + value1.B) / 300f; - } + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + Color baseColor = new Color(162, 216, 218); //Blue + Color glow1 = new Color(171, 113, 215); //Purple + Color glow2 = new Color(56, 174, 117); //Green + + Vector3 blended = baseColor.ToVector3(); + + blended = Vector3.Lerp(blended, glow1.ToVector3(), fade1 * 0.5f); + blended = Vector3.Lerp(blended, glow2.ToVector3(), fade2 * 0.5f); + + float brightness = 0.6f; + blended *= brightness; + + r = blended.X; + g = blended.Y; + b = blended.Z; + } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + Rectangle sourceRect = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); + + Texture2D baseTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals").Value; + spriteBatch.Draw(baseTex, position, sourceRect, Lighting.GetColor(i, j) * 1.5f); + + Texture2D tex1 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Purple").Value; + Texture2D tex2 = ModContent.Request("CalamityMod/Tiles/SunkenSea/SeaPrismCrystals_Green").Value; + + spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j)); + spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j)); } public override bool CanPlace(int i, int j) diff --git a/Tiles/SunkenSea/SeaPrismCrystals.png b/Tiles/SunkenSea/SeaPrismCrystals.png index c4646c40c6..574fd43f13 100644 Binary files a/Tiles/SunkenSea/SeaPrismCrystals.png and b/Tiles/SunkenSea/SeaPrismCrystals.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Green.png b/Tiles/SunkenSea/SeaPrismCrystals_Green.png new file mode 100644 index 0000000000..d167aa4b1e Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Green.png differ diff --git a/Tiles/SunkenSea/SeaPrismCrystals_Purple.png b/Tiles/SunkenSea/SeaPrismCrystals_Purple.png new file mode 100644 index 0000000000..52616c685f Binary files /dev/null and b/Tiles/SunkenSea/SeaPrismCrystals_Purple.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Blue.png b/Tiles/SunkenSea/SeaPrism_Blue.png new file mode 100644 index 0000000000..7e6c12266c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Blue.png differ diff --git a/Tiles/SunkenSea/SeaPrism_GlintMask.png b/Tiles/SunkenSea/SeaPrism_GlintMask.png new file mode 100644 index 0000000000..b80a7aaa41 Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_GlintMask.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Green.png b/Tiles/SunkenSea/SeaPrism_Green.png new file mode 100644 index 0000000000..9ad3fbf00c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Green.png differ diff --git a/Tiles/SunkenSea/SeaPrism_Purple.png b/Tiles/SunkenSea/SeaPrism_Purple.png new file mode 100644 index 0000000000..00eb510c4c Binary files /dev/null and b/Tiles/SunkenSea/SeaPrism_Purple.png differ diff --git a/Tiles/SunkenSea/SunkenKelp.cs b/Tiles/SunkenSea/SunkenKelp.cs new file mode 100644 index 0000000000..d8c6aab42d --- /dev/null +++ b/Tiles/SunkenSea/SunkenKelp.cs @@ -0,0 +1,147 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class SunkenKelp : ModTile + { + private const int MaxChainLength = 18; + private static readonly ushort[] ValidAnchors = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + private const short FrameBottom = 0; + private const short FrameMid = 18; + private const short FrameTop = 36; + private const short FrameWidth = 18; + + public override void SetStaticDefaults() + { + Main.tileCut[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileObsidianKill[Type] = true; + + TileID.Sets.IsVine[Type] = true; + TileID.Sets.DisableSmartCursor[Type] = true; + + HitSound = SoundID.Grass; + DustType = DustID.Grass; + + AddMapEntry(new Color(27, 112, 68)); + } + + public override void RandomUpdate(int i, int j) + { + if (!IsTopmostSegment(i, j)) + return; + + if (j <= 0 || Main.tile[i, j - 1].HasTile) + return; + + if (!IsSupportedFromBelow(i, j)) + return; + + if (GetChainLengthUpward(i, j) >= MaxChainLength) + return; + + bool placed = WorldGen.PlaceTile(i, j - 1, Type, mute: true, forced: true); + if (placed) + { + SetFrame(i, j - 1, FrameTop); + SetFrame(i, j, FrameMid); + UpdateBaseSegment(i, j + GetChainLengthDownward(i, j)); + } + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + if (!IsSupportedFromBelow(i, j)) + { + WorldGen.KillTile(i, j, noItem: true, effectOnly: false); + return false; + } + + if (IsTopmostSegment(i, j)) + SetFrame(i, j, FrameTop); + else if (IsBottomSegment(i, j)) + SetFrame(i, j, FrameBottom); + else + SetFrame(i, j, FrameMid); + + return false; + } + + private static bool IsSupportedFromBelow(int i, int j) + { + if (j >= Main.maxTilesY - 1) return false; + Tile below = Main.tile[i, j + 1]; + if (!below.HasTile) return false; + + ushort t = below.TileType; + if (t == ModContent.TileType()) + return true; + + foreach (ushort anchor in ValidAnchors) + if (t == anchor) + return true; + + return false; + } + + private static bool IsTopmostSegment(int i, int j) + { + if (j <= 0) return true; + Tile above = Main.tile[i, j - 1]; + return !(above.HasTile && above.TileType == ModContent.TileType()); + } + + private static bool IsBottomSegment(int i, int j) + { + if (j >= Main.maxTilesY - 1) return true; + Tile below = Main.tile[i, j + 1]; + return !(below.HasTile && below.TileType == ModContent.TileType()); + } + + private static int GetChainLengthUpward(int i, int j) + { + int length = 1; + int y = j - 1; + int vineType = ModContent.TileType(); + while (y >= 0 && Main.tile[i, y].HasTile && Main.tile[i, y].TileType == vineType) + { + length++; + y--; + if (length > MaxChainLength) break; + } + return length; + } + + private static int GetChainLengthDownward(int i, int j) + { + int length = 0; + int y = j + 1; + int vineType = ModContent.TileType(); + while (y < Main.maxTilesY && Main.tile[i, y].HasTile && Main.tile[i, y].TileType == vineType) + { + length++; + y++; + } + return length; + } + + private static void SetFrame(int i, int j, short frameYRow) + { + Tile tile = Main.tile[i, j]; + tile.TileFrameX = (short)(WorldGen.genRand.Next(3) * FrameWidth); + tile.TileFrameY = frameYRow; + } + + private static void UpdateBaseSegment(int i, int bottomY) + { + Tile t = Main.tile[i, bottomY]; + if (t.HasTile && t.TileType == ModContent.TileType()) + SetFrame(i, bottomY, FrameBottom); + } + } +} diff --git a/Tiles/SunkenSea/SunkenKelp.png b/Tiles/SunkenSea/SunkenKelp.png index d6ef19a3c6..46c82c6488 100644 Binary files a/Tiles/SunkenSea/SunkenKelp.png and b/Tiles/SunkenSea/SunkenKelp.png differ diff --git a/Tiles/SunkenSea/VolcanicSand.png b/Tiles/SunkenSea/VolcanicSand.png index a85b4c8dee..624e5b075c 100644 Binary files a/Tiles/SunkenSea/VolcanicSand.png and b/Tiles/SunkenSea/VolcanicSand.png differ diff --git a/Tiles/SunkenSea/WhitePearlPile.cs b/Tiles/SunkenSea/WhitePearlPile.cs index 94938f9b10..6d01cbef09 100644 --- a/Tiles/SunkenSea/WhitePearlPile.cs +++ b/Tiles/SunkenSea/WhitePearlPile.cs @@ -1,7 +1,9 @@ -using CalamityMod.Sounds; +using System; +using CalamityMod.Sounds; using CalamityMod.Systems; using CalamityMod.Tiles.Abyss; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,6 +16,7 @@ namespace CalamityMod.Tiles.SunkenSea { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; + Main.tileLighted[Type] = true; CalamityUtils.MergeWithGeneral(Type); @@ -47,5 +50,113 @@ namespace CalamityMod.Tiles.SunkenSea { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } + + private static float GetFade1(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + } + + private static float GetFade2(int i, int j) + { + return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + //IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's + + Tile tile = Framing.GetTileSafely(i, j); + Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen; + + int frameX = tile.TileFrameX + (i % 1); + int frameY = tile.TileFrameY + (j % 1); + + Rectangle sourceRect = new Rectangle(frameX, frameY, 16, 16); + + Texture2D GlintTex = ModContent.Request("CalamityMod/Tiles/SunkenSea/WhitePearlPile_Glint").Value; + + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = position; + + float projection = Vector2.Dot(screenPos, glintDir); + + // this sets the length between the glints diagonally + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + float[] beamCenters = new float[] + { + screenDiagonalLength * 0.05f, // upper glint + screenDiagonalLength * 0.5f, // middle glint + screenDiagonalLength * 1.05f // lower glint + }; + + float stripeWidth = 100f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + + if (strength > 0f) + { + spriteBatch.Draw(GlintTex, position, sourceRect, (Lighting.GetColor(i, j) * 6) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + // figure out if the tile is exposed - taken from the coral tiles + if (Main.tile[i, j] == null || + (Main.tile[i - 1, j].HasTile && Main.tile[i + 1, j].HasTile && Main.tile[i, j - 1].HasTile && Main.tile[i, j + 1].HasTile)) + return; + + // get in-game lighting color at this tile + Color litColor = Lighting.GetColor(i, j); + + // convert to brightness factor (0 = dark, 1 = full bright) + float brightness = (litColor.R + litColor.G + litColor.B) / (3f * 255f); + + // flip it so the glow is strongest in the dark + float darknessFactor = 1f - brightness; + + // diagonal glint math + Vector2 glintDir = new Vector2(1f, -1f); + glintDir.Normalize(); + + Vector2 screenPos = new Vector2(i * 16, j * 16) - Main.screenPosition; + float projection = Vector2.Dot(screenPos, glintDir); + float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir); + + float[] beamCenters = + { + screenDiagonalLength * 0.05f, + screenDiagonalLength * 0.5f, + screenDiagonalLength * 1.05f + }; + + float stripeWidth = 100f; + float maxStrength = 0f; + + foreach (float bc in beamCenters) + { + float dist = Math.Abs(projection - bc); + float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f); + if (strength > maxStrength) + maxStrength = strength; + } + + if (maxStrength > 0f) + { + // base intensity scaled by glint strength and darkness (min = 0.0f, max = 1.0f) + float intensity = 0.6f * maxStrength * (0.5f + darknessFactor * 0.5f); + //float intensity = ((float)(Math.Pow(10.0, (brightness * 2 - 2))) - 0.01f) / 0.99f; was trying to do something cool, may come back to it later + + + r = (185f / 255f) * intensity; + g = (164f / 255f) * intensity; + b = (184f / 255f) * intensity; + } + } } } diff --git a/Tiles/SunkenSea/WhitePearlPile_Glint.png b/Tiles/SunkenSea/WhitePearlPile_Glint.png new file mode 100644 index 0000000000..3a8280eeb8 Binary files /dev/null and b/Tiles/SunkenSea/WhitePearlPile_Glint.png differ diff --git a/Tiles/SunkenSea/YellowCoral.png b/Tiles/SunkenSea/YellowCoral.png index ef005dc85b..7c2ad9d150 100644 Binary files a/Tiles/SunkenSea/YellowCoral.png and b/Tiles/SunkenSea/YellowCoral.png differ diff --git a/UI/VanillaBossBars/CeaselessVoidBossBar.cs b/UI/VanillaBossBars/CeaselessVoidBossBar.cs index 55c3541beb..29fb7c446c 100644 --- a/UI/VanillaBossBars/CeaselessVoidBossBar.cs +++ b/UI/VanillaBossBars/CeaselessVoidBossBar.cs @@ -40,7 +40,7 @@ namespace CalamityMod.UI.VanillaBossBars // Determine the shield health // Amount of Dark Energies expected from each phase/difficulty - int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (CalamityWorld.LegendaryMode ? 6 : 3) + 2; + int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (Main.getGoodWorld ? 6 : 3) + 2; // The Dark Energies will instantly all die at a certain point of their total max health float RatioToCombust = 0.2f; if (NPC.AnyNPCs(NPCType())) diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 2c059e617d..7fb1b3e804 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -211,12 +211,15 @@ namespace CalamityMod list.Add(type); } + public static int ScaleWithDifficulty(this int value) => value * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1); + public static int SecondsToFrames(int seconds) => seconds * 60; public static int SecondsToFrames(float seconds) => (int)MathF.Round(seconds * 60); public static int MinutesToFrames(int minutes) => minutes * 3600; public static bool WithinBounds(this int index, int cap) => index >= 0 && index < cap; + /// /// Clamps the distance between vectors via normalization. /// /// The starting point. diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 19b85c5d58..44011b1330 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -9,7 +9,7 @@ using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; -using CalamityMod.Items.Armor.Statigel; +using CalamityMod.Items.Armor.GodSlayer; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Systems.Collections; using CalamityMod.World; @@ -437,10 +437,8 @@ namespace CalamityMod CalamityPlayer modPlayer = player.Calamity(); int extraIFrames = 0; - if (modPlayer.godSlayerThrowing && hurtInfo.Damage > 80) - extraIFrames += 30; - if (modPlayer.statigelSet && hurtInfo.Damage > StatigelArmor.SetBonusHurtDamageThreshold) - extraIFrames += StatigelArmor.SetBonusIFrameExtension; + if (modPlayer.godSlayerThrowing && hurtInfo.Damage > GodSlayerHeadRogue.SetBonusHurtDamageThreshold) + extraIFrames += GodSlayerHeadRogue.ExtraIFrames; // Deific Amulet provides 10 to 40 bonus immunity frames when you get hit which scale with your missing health. // If you only take 1 damage, you get 5 iframes. diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 132ca8c0e9..20c28a596a 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -184,10 +184,12 @@ namespace CalamityMod foreach (NPC n in Main.ActiveNPCs) { float extraDistance = (n.width / 2) + (n.height / 2); - if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance) || (respectIFrames && (projectile.localNPCImmunity[n.whoAmI] > 0 || n.immune[projectile.owner] > 0 || Projectile.perIDStaticNPCImmunity[projectile.type][n.whoAmI] > 0))) + if (!n.CanBeChasedBy(projectile, false) || !projectile.WithinRange(n.Center, maxDistance + extraDistance) || (respectIFrames && (projectile.localNPCImmunity[n.whoAmI] > 0 || projectile.localNPCImmunity[n.whoAmI] == -1 || n.immune[projectile.owner] > 0))) continue; float currentNPCDist = Vector2.Distance(n.Center, projectile.Center); + if (respectIFrames && Projectile.perIDStaticNPCImmunity[projectile.type][n.whoAmI] > Main.GameUpdateCount) + currentNPCDist += 1600; //Prioritize things that don't currently have iframes, but still home in on stuff that has static iframes if needed. if ((currentNPCDist < npcDistCompare) && (ignoreTiles || Collision.CanHit(projectile.Center, 1, 1, n.Center, 1, 1))) { npcDistCompare = currentNPCDist; diff --git a/Utilities/RicoshotUtils.cs b/Utilities/RicoshotUtils.cs index 1f54d392cb..a1edc37fb3 100644 --- a/Utilities/RicoshotUtils.cs +++ b/Utilities/RicoshotUtils.cs @@ -30,13 +30,14 @@ namespace CalamityMod public static int GetActiveRicoshotCoinCount(this Player player) { int count = 0; - int id = ModContent.ProjectileType(); + int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); foreach (Projectile p in Main.ActiveProjectiles) { if (p.owner != player.whoAmI) continue; - if (p.type == id) + if (p.type == coinID || p.type == clipID) ++count; } return count; @@ -45,10 +46,18 @@ namespace CalamityMod // Intentionally not an extension so it doesn't clog the Visual Studio recommendation lists. This is not generally useful. public static bool CanRicoshotCoinForceCrit(Projectile p) { - int id = ModContent.ProjectileType(); - if (!p.active || p.type != id) + int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); + + if (!p.active || (p.type != coinID && p.type != clipID)) return false; + if (p.type == clipID) + { + int clipUpdateCount = M1GarandEmptyClip.ClipLifetime - p.timeLeft; + return clipUpdateCount >= M1GarandEmptyClip.CritDelayTime; + } + int coinUpdateCount = RicoshotCoin.CoinLifetime - p.timeLeft; return coinUpdateCount >= RicoshotCoin.CritDelayTime; } @@ -96,21 +105,28 @@ namespace CalamityMod { IList coins = new List(); - // Search for all nearby coins. - // Coins do not necessarily have to be owned by the same player as the searching projectile! + // Search for all nearby coins/clips. + // Coins/clips do not necessarily have to be owned by the same player as the searching projectile! int coinID = ModContent.ProjectileType(); + int clipID = ModContent.ProjectileType(); + foreach (Projectile proj in Main.ActiveProjectiles) { - if (proj.ModProjectile is null || proj.type != coinID) + if (proj.ModProjectile is null) + continue; + + // Check if the projectile is either a coin or clip + if (proj.type != coinID && proj.type != clipID) continue; // Coins that have already been struck are ignored. if (proj.localAI[0] > 0f) continue; - // Finally, do a distance check + // Use the appropriate distance check based on the projectile type + float maxDistance = proj.type == clipID ? M1GarandEmptyClip.MaxIntraClipRicoshotDistance : RicoshotCoin.MaxIntraCoinRicoshotDistance; float dist = searchingShot.DistanceSQ(proj.Center); - if (dist <= RicoshotCoin.MaxIntraCoinRicoshotDistance * RicoshotCoin.MaxIntraCoinRicoshotDistance) + if (dist <= maxDistance * maxDistance) coins.Add(proj); } @@ -143,6 +159,11 @@ namespace CalamityMod float closestCoinDistance = RicoshotCoin.MaxIntraCoinRicoshotDistance; foreach (Projectile coin in availableCoins) { + // Determine the max ricochet distance based on the target type + float maxDistance = coin.type == ModContent.ProjectileType() ? M1GarandEmptyClip.MaxIntraClipRicoshotDistance : RicoshotCoin.MaxIntraCoinRicoshotDistance; // New line. Use different distance based on proj type. + if (coin.Distance(startPos) > maxDistance) + continue; + // Skip coins which are already frozen (part of an ongoing ricoshot), unless considering them if (!considerFrozenCoins && coin.ai[1] > 0f) continue; diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 0d1e3e5774..f0ea7eb99e 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -450,6 +450,8 @@ namespace CalamityMod TileType(), TileType(), TileType(), + TileType(), + TileType(), TileType(), TileType(), TileType(), @@ -520,6 +522,7 @@ namespace CalamityMod TileType(), // Sunken Sea TileType(), + TileType(), TileType(), TileType(), TileType(), diff --git a/Walls/SeaPrismWall.cs b/Walls/SeaPrismWall.cs new file mode 100644 index 0000000000..333b163bdf --- /dev/null +++ b/Walls/SeaPrismWall.cs @@ -0,0 +1,85 @@ +using System; +using CalamityMod.Tiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class SeaPrismWall : MultiVariantModWall + { + internal static FramedMaskTexture GlowMaskBlue; + internal static FramedMaskTexture GlowMaskPurple; + internal static FramedMaskTexture GlowMaskGreen; + public override void SetStaticDefaults() + { + GlowMaskBlue = new("CalamityMod/Walls/SeaPrismWall_Blue", 36, 36); + GlowMaskPurple = new("CalamityMod/Walls/SeaPrismWall_Purple", 36, 36); + GlowMaskGreen = new("CalamityMod/Walls/SeaPrismWall_Green", 36, 36); + Main.wallHouse[Type] = true; + DustType = 108; + + AddMapEntry(new Color(27, 123, 131)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override void PopulateWallVariant(int i, int j, ref int frameXOffset, ref int frameYOffset) + { + frameXOffset = (i % 8) * 468; + frameYOffset = (j % 8) * 180; + } + private static float GetFade1(int i, int j) => + (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f; + + private static float GetFade2(int i, int j) => + (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f; + + public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + { + Tile tile = Main.tile[i, j]; + int xLength = 32; + + int frameXOffset = (i % 8) * 468; + int frameYOffset = (j % 8) * 180; + + int xPos = tile.WallFrameX + frameXOffset; + int yPos = tile.WallFrameY + frameYOffset; + + Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; + + // base wall + spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8, -8), frame, Lighting.GetColor(i, j)); + + // glow layers + float fade1 = GetFade1(i, j); + float fade2 = GetFade2(i, j); + + if (GlowMaskBlue.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskBlue.Texture, pos + new Vector2(-8, -8), frame, (Color.White * 1.1f)); + } + if (GlowMaskPurple.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskPurple.Texture, pos + new Vector2(-8, -8), frame, Color.White * (fade1 * 1.1f)); + } + if (GlowMaskGreen.HasContentInFramePos(xPos, yPos)) + { + spriteBatch.Draw(GlowMaskGreen.Texture, pos + new Vector2(-8, -8), frame, Color.White * (fade2 * 1.5f)); + } + + Color wallColor = Lighting.GetColor(i, j) * 1.2f; // brighten a bit + wallColor.A = 255; + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + DrawWallGlow(Type, i, j, spriteBatch); + return false; + } + } +} diff --git a/Walls/SeaPrismWall.png b/Walls/SeaPrismWall.png new file mode 100644 index 0000000000..5e4988e6b2 Binary files /dev/null and b/Walls/SeaPrismWall.png differ diff --git a/Walls/SeaPrismWall_Blue.png b/Walls/SeaPrismWall_Blue.png new file mode 100644 index 0000000000..63996bc848 Binary files /dev/null and b/Walls/SeaPrismWall_Blue.png differ diff --git a/Walls/SeaPrismWall_Green.png b/Walls/SeaPrismWall_Green.png new file mode 100644 index 0000000000..228fcd2e0b Binary files /dev/null and b/Walls/SeaPrismWall_Green.png differ diff --git a/Walls/SeaPrismWall_Purple.png b/Walls/SeaPrismWall_Purple.png new file mode 100644 index 0000000000..600a9643ff Binary files /dev/null and b/Walls/SeaPrismWall_Purple.png differ diff --git a/Waters/BasaltGullyLava.cs b/Waters/BasaltGullyLava.cs index d81e1570c5..ba11110a93 100644 --- a/Waters/BasaltGullyLava.cs +++ b/Waters/BasaltGullyLava.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Waters public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 2.48f / 4; - g = 1.29f / 4; - b = 0.48f / 4; + r = 248f / 255; + g = 73f / 255; + b = 73f / 255; } } } diff --git a/Waters/BasaltGullyLava.png b/Waters/BasaltGullyLava.png index 2459b3cf5e..489de52258 100644 Binary files a/Waters/BasaltGullyLava.png and b/Waters/BasaltGullyLava.png differ diff --git a/Waters/BasaltGullyLava_Block.png b/Waters/BasaltGullyLava_Block.png index e1c8be0e19..6fd6bc9bf5 100644 Binary files a/Waters/BasaltGullyLava_Block.png and b/Waters/BasaltGullyLava_Block.png differ diff --git a/Waters/BasaltGullyLava_Slope.png b/Waters/BasaltGullyLava_Slope.png index a6a89147f9..3f4a9dda65 100644 Binary files a/Waters/BasaltGullyLava_Slope.png and b/Waters/BasaltGullyLava_Slope.png differ diff --git a/Waters/BasaltGullyLavaflow.png b/Waters/BasaltGullyLavaflow.png index 791bdd5ff1..162dcce323 100644 Binary files a/Waters/BasaltGullyLavaflow.png and b/Waters/BasaltGullyLavaflow.png differ diff --git a/Waters/SunkenSeaBurrowsWater.png b/Waters/SunkenSeaBurrowsWater.png index 1dd5bd9f12..b5445b95b0 100644 Binary files a/Waters/SunkenSeaBurrowsWater.png and b/Waters/SunkenSeaBurrowsWater.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Block.png b/Waters/SunkenSeaBurrowsWater_Block.png index bbf43cea00..55f4835baf 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Block.png and b/Waters/SunkenSeaBurrowsWater_Block.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Slope.png b/Waters/SunkenSeaBurrowsWater_Slope.png index fcd463d89f..c8c200a00e 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Slope.png and b/Waters/SunkenSeaBurrowsWater_Slope.png differ diff --git a/Waters/SunkenSeaBurrowsWaterflow.png b/Waters/SunkenSeaBurrowsWaterflow.png index f2ea06818a..7dfa31563c 100644 Binary files a/Waters/SunkenSeaBurrowsWaterflow.png and b/Waters/SunkenSeaBurrowsWaterflow.png differ diff --git a/Waters/SunkenSeaPolypWater.png b/Waters/SunkenSeaPolypWater.png index 682fb25774..d49ec9cb77 100644 Binary files a/Waters/SunkenSeaPolypWater.png and b/Waters/SunkenSeaPolypWater.png differ diff --git a/Waters/SunkenSeaPolypWater_Block.png b/Waters/SunkenSeaPolypWater_Block.png index 1f823d0ea9..7cb531a45a 100644 Binary files a/Waters/SunkenSeaPolypWater_Block.png and b/Waters/SunkenSeaPolypWater_Block.png differ diff --git a/Waters/SunkenSeaPolypWater_Slope.png b/Waters/SunkenSeaPolypWater_Slope.png index ddf2446ee4..7786b18561 100644 Binary files a/Waters/SunkenSeaPolypWater_Slope.png and b/Waters/SunkenSeaPolypWater_Slope.png differ diff --git a/Waters/SunkenSeaPolypWaterflow.png b/Waters/SunkenSeaPolypWaterflow.png index ee3de90b50..d1fca985c2 100644 Binary files a/Waters/SunkenSeaPolypWaterflow.png and b/Waters/SunkenSeaPolypWaterflow.png differ diff --git a/Waters/SunkenSeaReefsWater.png b/Waters/SunkenSeaReefsWater.png index f29cd37d8b..62239832c4 100644 Binary files a/Waters/SunkenSeaReefsWater.png and b/Waters/SunkenSeaReefsWater.png differ diff --git a/Waters/SunkenSeaReefsWater_Block.png b/Waters/SunkenSeaReefsWater_Block.png index 025f317ee5..f93b5fb6c1 100644 Binary files a/Waters/SunkenSeaReefsWater_Block.png and b/Waters/SunkenSeaReefsWater_Block.png differ diff --git a/Waters/SunkenSeaReefsWater_Slope.png b/Waters/SunkenSeaReefsWater_Slope.png index 5a485e545f..b9fd91405c 100644 Binary files a/Waters/SunkenSeaReefsWater_Slope.png and b/Waters/SunkenSeaReefsWater_Slope.png differ diff --git a/Waters/SunkenSeaReefsWaterflow.png b/Waters/SunkenSeaReefsWaterflow.png index 33755735bd..18a47b1801 100644 Binary files a/Waters/SunkenSeaReefsWaterflow.png and b/Waters/SunkenSeaReefsWaterflow.png differ diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 411b8181db..9b34b7222f 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -48,7 +48,7 @@ namespace CalamityMod.World if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || tile.WallType == ModContent.WallType() || // hardened eutrophic sand doesnt have a wall lol tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType() || diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index c9fbf8af15..317f14dd43 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -19,7 +19,18 @@ namespace CalamityMod.World { public class SunkenSea { - /* + + internal static class SSOffsets + { + public static int TimelessShoresX = 0, TimelessShoresY = 0; + public static int RadiantReefsX = 0, RadiantReefsY = 55; + public static int PolypForestX = 0, PolypForestY = 0; + public static int GleamingBurrowsX = 0, GleamingBurrowsY = 75; + public static int ClamDenX = 0, ClamDenY = 75; + public static int BasaltGullyX = 0, BasaltGullyY = 15; + public static int GlobalX = 0, GlobalY = -20; + } +/* checklist: -Add the wall corals properly @@ -38,6 +49,10 @@ namespace CalamityMod.World public static void PlaceTimelessShores(int startPosX, int startPosY) { + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.TimelessShoresX; + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.TimelessShoresY; + int biomeSize = 250 + (Main.maxTilesX / 180); // @@ -53,10 +68,10 @@ namespace CalamityMod.World else return -steepness * x + steepness; } - ParallelFor(startPosX - biomeSize - 5, startPosX + biomeSize + 20, 15, (X) => + ParallelFor(startX - biomeSize - 5, startX + biomeSize + 20, 15, (X) => { - float height = MathHelper.Lerp(startPosY + 35, startPosY - 15, trapezoidLateralSteep(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX + biomeSize + 20, X))); - for (int Y = startPosY + 25; Y >= height; Y -= 10) + float height = MathHelper.Lerp(startY + 35, startY - 15, trapezoidLateralSteep(Utils.GetLerpValue(startX - biomeSize - 20, startX + biomeSize + 20, X))); + for (int Y = startY + 25; Y >= height; Y -= 10) { ShapeData circle = new ShapeData(); WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(30), Actions.Chain(new GenAction[] @@ -72,10 +87,10 @@ namespace CalamityMod.World // Makes the bottom borders of the Timeless Shores curved downwards. // const int totalCuveDepth = 90; - ParallelFor(startPosX - biomeSize - 10, startPosX - biomeSize + 200, 10, (x) => + ParallelFor(startX - biomeSize - 10, startX - biomeSize + 200, 10, (x) => { - int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true))); - for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) + int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 17, startX - biomeSize + 200, x, true))); + for (int y = startY + 50; y <= startY + 70 + curveDepth; y += 5) { ShapeData circle = new(); WorldUtils.Gen(new Point(x, y), new Shapes.Slime(30), Actions.Chain(new GenAction[] @@ -86,10 +101,10 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } }); - ParallelFor(startPosX + biomeSize - 200, startPosX + biomeSize + 10, 5, (x) => + ParallelFor(startX + biomeSize - 200, startX + biomeSize + 10, 5, (x) => { - int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true))); - for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) + int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 20, startX + biomeSize - 200, x, true))); + for (int y = startY + 50; y <= startY + 70 + curveDepth; y += 5) { ShapeData circle = new(); WorldUtils.Gen(new Point(x, y), new Shapes.Slime(30), Actions.Chain(new GenAction[] @@ -103,13 +118,13 @@ namespace CalamityMod.World // Clear a smaller square out of the center where the biomes stuff will be // Added curves to the top of the biome via curve depth -hpu 02/19/25 - ParallelFor(startPosX - biomeSize + 10, startPosX + biomeSize - 10, 1, (X) => + ParallelFor(startX - biomeSize + 10, startX + biomeSize - 10, 1, (X) => { - int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true))); - int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, X, true))); + int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 20, startX + biomeSize - 200, X, true))); + int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 17, startX - biomeSize + 200, X, true))); int random = WorldGen.genRand.Next(-40, 10); - for (int Y = startPosY - 25 + curveDepth + curveDepth2; Y <= startPosY + 50; Y++) + for (int Y = startY - 25 + curveDepth + curveDepth2; Y <= startY + 50; Y++) { ShapeData circle = new ShapeData(); GenAction blotchMod = new Modifiers.Blotches(2, 0.4); @@ -128,24 +143,24 @@ namespace CalamityMod.World // // Places slopes at the sides of the shores to actually make shores. // - ParallelFor(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) => + ParallelFor(startX - biomeSize - 15, startX - biomeSize + 200, 20, (moundX) => { int RandomX = Main.rand.Next(15, 20); ShapeData mound = new(); GenAction blotchMod = new Modifiers.Blotches().Output(mound); - int moundY = startPosY + 75; - int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize + 27, startPosX - biomeSize + 200, moundX))); + int moundY = startY + 75; + int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize + 27, startX - biomeSize + 200, moundX))); WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.PlaceWall((ushort)ModContent.WallType())); }); - ParallelFor(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) => + ParallelFor(startX + biomeSize - 200, startX + biomeSize - 15, 20, (moundX) => { ShapeData mound = new(); GenAction blotchMod = new Modifiers.Blotches().Output(mound); - int moundY = startPosY + 75; - int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize - 27, startPosX + biomeSize - 200, moundX))); + int moundY = startY + 75; + int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize - 27, startX + biomeSize - 200, moundX))); WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); @@ -158,11 +173,11 @@ namespace CalamityMod.World const int platformSize = 130; const int platformHeight = 35; // Remember that because of Terraria's coordinate system, making it lower actually makes it higher. const int platformDepth = 35; // How deep it goes. Like above, the higher it is, the lower it goes. - ParallelFor(startPosX - platformSize / 2, startPosX + platformSize / 2, 5, (platformX) => + ParallelFor(startX - platformSize / 2, startX + platformSize / 2, 5, (platformX) => { // This makes the "stem" of the platform be thinner towards the base and then expand on the top. - int thickness = (int)(MathF.Pow(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, platformX)), 3f) * platformDepth) + platformHeight; - for (int platformY = startPosY + platformHeight; platformY <= startPosY + thickness; platformY++) + int thickness = (int)(MathF.Pow(CalamityUtils.Convert01To010(Utils.GetLerpValue(startX - platformSize / 2, startX + platformSize / 2, platformX)), 3f) * platformDepth) + platformHeight; + for (int platformY = startY + platformHeight; platformY <= startY + thickness; platformY++) { WorldUtils.Gen(new Point(platformX, platformY), new Shapes.Circle(5), Actions.Chain(new GenAction[] { @@ -172,28 +187,28 @@ namespace CalamityMod.World })); } }); - ParallelFor(startPosX - platformSize / 2, startPosX + platformSize / 2, 1, (x) => + ParallelFor(startX - platformSize / 2, startX + platformSize / 2, 1, (x) => { - float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, x, true)); + float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startX - platformSize / 2, startX + platformSize / 2, x, true)); int elevation = (int)MathHelper.Lerp(4f, 1f, interpolator); - WorldUtils.Gen(new Point(x, startPosY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), })); + WorldUtils.Gen(new Point(x, startY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), })); }); // Plateau - ParallelFor(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) => + ParallelFor(startX - biomeSize, startX + biomeSize, 100, (wallPillarX) => { int randomDisplacement = WorldGen.genRand.Next(-27, 46); int RandomX = Main.rand.Next(15, 20); int RandomH = Main.rand.Next(20, 35); - for (int wallPillarY = startPosY + RandomH; wallPillarY <= startPosY + 60; wallPillarY += 10) + for (int wallPillarY = startY + RandomH; wallPillarY <= startY + 60; wallPillarY += 10) { // Along the height of the pillar, it becomes shorter the more closer to the center we get. - int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosY - RandomH, startPosY + 45, wallPillarY)) * 25); + int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startY - RandomH, startY + 45, wallPillarY)) * 25); ShapeData rectangle = new ShapeData(); GenAction blotchFilter = new Modifiers.Blotches(1, 0.4); - GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startPosY + 30, startPosY + 70, wallPillarY) + 0.25, 1)); + GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startY + 30, startY + 70, wallPillarY) + 0.25, 1)); WorldUtils.Gen(new Point(randomDisplacement + wallPillarX + pillarWidth / 2, wallPillarY), new Shapes.Circle(RandomX - pillarWidth + 3, RandomX), Actions.Chain(new GenAction[] { @@ -211,9 +226,9 @@ namespace CalamityMod.World }); //place water below the clear barrier for the islands so that theres water inbetween them - ParallelFor(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => + ParallelFor(startX - biomeSize + 35, startX + biomeSize - 35, 1, (WaterX) => { - for (int WaterY = startPosY + 37; WaterY <= startPosY + 60; WaterY++) + for (int WaterY = startY + 37; WaterY <= startY + 60; WaterY++) { Main.tile[WaterX, WaterY].Get().LiquidType = LiquidID.Water; Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue; @@ -224,19 +239,19 @@ namespace CalamityMod.World // Generates pillars made out of walls at random points in the Timeless Shores. // const int furthestDistanceFromCenter = 100; - ParallelFor(startPosX - (biomeSize / 2) - furthestDistanceFromCenter, startPosX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) => + ParallelFor(startX - (biomeSize / 2) - furthestDistanceFromCenter, startX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) => { int randomDisplacementX = WorldGen.genRand.Next(-10, 10); int RandomX = Main.rand.Next(3, 6); - for (int wallPillarY = startPosY - 75; wallPillarY <= startPosY + 80; wallPillarY += 10) + for (int wallPillarY = startY - 75; wallPillarY <= startY + 80; wallPillarY += 10) { // Along the height of the pillar, it becomes shorter the more closer to the center we get. - int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosY - 75, startPosY + 50, wallPillarY)) * 25); + int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startY - 75, startY + 50, wallPillarY)) * 25); ShapeData rectangle = new ShapeData(); GenAction blotchFilter = new Modifiers.Blotches(2, 0.4); - GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startPosY + 40, startPosY + 70, wallPillarY) + 0.25, 1)); + GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startY + 40, startY + 70, wallPillarY) + 0.25, 1)); WorldUtils.Gen(new Point(randomDisplacementX + wallPillarX + pillarWidth / 2, wallPillarY), new Shapes.Rectangle(25 - pillarWidth + 3, 15), Actions.Chain(new GenAction[] { @@ -256,14 +271,14 @@ namespace CalamityMod.World // Makes the transition area to the Timeless Shores. // Replaces tiles, walls, and places some water spots. // - ParallelFor(startPosX - biomeSize - 30, startPosX + biomeSize + 30, 20, (x) => + ParallelFor(startX - biomeSize - 30, startX + biomeSize + 30, 20, (x) => { - int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 30, startPosX + biomeSize - 200, x, true))); - int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 30, startPosX - biomeSize + 200, x, true))); + int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 30, startX + biomeSize - 200, x, true))); + int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 30, startX - biomeSize + 200, x, true))); - for (int y = startPosY - 5; y >= startPosY - 149; y -= 15) + for (int y = startY - 5; y >= startY - 149; y -= 15) { - float interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 150, y, true); + float interpolator = Utils.GetLerpValue(startY - 90, startY - 150, y, true); // This lerp does absolutely nothing. float ditherStrength = MathHelper.Lerp(0f, 0f, interpolator); @@ -277,7 +292,7 @@ namespace CalamityMod.World })); // Changing these makes the walls dither higher up than tiles, to prevent the biome from changing earlier than expected. Still looks nice imo :) - interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 200, y, true); + interpolator = Utils.GetLerpValue(startY - 90, startY - 200, y, true); ditherStrength = MathHelper.Lerp(0f, 0f, interpolator); WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[] @@ -289,7 +304,7 @@ namespace CalamityMod.World })); // I forgot to change this one. :peepotired: - interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 150, y, true); + interpolator = Utils.GetLerpValue(startY - 90, startY - 150, y, true); ditherStrength = MathHelper.Lerp(0f, 0f, interpolator); WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[] { @@ -298,7 +313,7 @@ namespace CalamityMod.World new Actions.ClearTile(), new Actions.PlaceTile((ushort)ModContent.TileType()), })); - interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 150, y, true); + interpolator = Utils.GetLerpValue(startY - 90, startY - 150, y, true); ditherStrength = MathHelper.Lerp(0f, 0f, interpolator); WorldUtils.Gen(new Point(x, y + curveDepth + curveDepth2), new Shapes.Circle(15), Actions.Chain(new GenAction[] { @@ -311,7 +326,7 @@ namespace CalamityMod.World if (Main.tile[x, y].Get().LiquidType == LiquidID.Lava) WorldUtils.Gen(new Point(x, y), new Shapes.Rectangle(5, 5), new Actions.SetLiquid(LiquidID.Lava, 0)); - if (WorldGen.genRand.NextBool(5) && y < startPosY - 100) + if (WorldGen.genRand.NextBool(5) && y < startY - 100) { WorldUtils.Gen(new Point(x, y), new Shapes.Circle(WorldGen.genRand.Next(5, 7)), Actions.Chain(new GenAction[] { @@ -322,9 +337,9 @@ namespace CalamityMod.World } // Place layer of sand on valid runestone blocks. - for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) + for (int X = startX - biomeSize; X < startX + biomeSize; X += 1) { - for (int Y = startPosY - 100; Y <= startPosY + 100; Y++) + for (int Y = startY - 100; Y <= startY + 100; Y++) { bool canPlaceSand = Main.tile[X, Y].TileType == ModContent.TileType() && @@ -352,9 +367,9 @@ namespace CalamityMod.World } // Slope tiles and Soil Spawn - for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) + for (int X = startX - biomeSize; X < startX + biomeSize; X += 1) { - for (int Y = startPosY - 300; Y <= startPosY + 200; Y++) + for (int Y = startY - 300; Y <= startY + 200; Y++) { Tile.SmoothSlope(X, Y); @@ -387,13 +402,17 @@ namespace CalamityMod.World // Sides of the sunken sea (radiant reefs) public static void PlaceRadiantReefs(int startPosX, int startPosY) { + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.RadiantReefsX; + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.RadiantReefsY; + int cavePerlinSeed = WorldGen.genRand.Next(); int cavePerlinSeedWalls = WorldGen.genRand.Next(); - Point origin = new Point(startPosX, startPosY); + Point origin = new Point(startX, startY); Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); - float angle = MathHelper.Pi * 0.20f; + float angle = MathHelper.Pi * 0.15f; float otherAngle = MathHelper.PiOver2 - angle; int biomeSize = 280 + (Main.maxTilesX / 180); @@ -401,7 +420,7 @@ namespace CalamityMod.World float constant = actualSize * 2f / (float)Math.Sin(angle); float fociSpacing = actualSize * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle); - int verticalRadius = (int)(constant / 20f); + int verticalRadius = (int)(constant / 50f); Vector2 fociOffset = Vector2.UnitY * fociSpacing; Vector2 topFoci = center - fociOffset; @@ -547,10 +566,17 @@ namespace CalamityMod.World // Middle of the sunken sea (polyp forest) public static void PlacePolypForest(int startPosX, int startPosY) { + + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.PolypForestX; + + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.PolypForestY; + + int cavePerlinSeed = WorldGen.genRand.Next(); int cavePerlinSeedWalls = WorldGen.genRand.Next(); - Point origin = new Point(startPosX, startPosY - 200); + Point origin = new Point(startX, startY - 200); Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); float angle = MathHelper.Pi * 0.15f; @@ -649,7 +675,7 @@ namespace CalamityMod.World { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y > origin.Y)) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y < origin.Y)) { //clean tiles that are sticking out (aka tiles only attached to one tile on one side) bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; @@ -674,9 +700,9 @@ namespace CalamityMod.World //place extra tiles for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y > origin.Y)) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y < origin.Y)) { bool canPlaceSand = false; @@ -699,11 +725,11 @@ namespace CalamityMod.World { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y > origin.Y)) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y < origin.Y)) { bool canPlaceGrass = false; - //place sand clumps on top of exposed limestone + //place grass on top of exposed sand if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) { @@ -715,6 +741,27 @@ namespace CalamityMod.World PlaceSand(X, Y, 0, ModContent.TileType()); } } + if (Main.tile[X, Y].TileType == ModContent.TileType()) + { + if (WorldGen.genRand.NextBool(25) && !Main.tile[X - 1, Y].HasTile) + { + ushort[] Soil = new ushort[] { (ushort)ModContent.TileType() }; + + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 7)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Actions.ClearTile(), new Actions.PlaceTile(WorldGen.genRand.Next(Soil)) + })); + + } + } } } @@ -758,10 +805,14 @@ namespace CalamityMod.World //bottom of the biome (gleaming burrows) public static void PlaceGleamingBurrows(int startPosX, int startPosY) { + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.GleamingBurrowsX; + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.GleamingBurrowsY; + int cavePerlinSeed = WorldGen.genRand.Next(); int cavePerlinSeedWalls = WorldGen.genRand.Next(); - Point origin = new Point(startPosX, startPosY); + Point origin = new Point(startX, startY); Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); float angle = MathHelper.Pi * 0.15f; @@ -824,7 +875,7 @@ namespace CalamityMod.World if (percent > blurPercent) { - if (Y > origin.Y - 50) + if (Y > origin.Y - 15) { //place smaller navystone clumps infront of the basalt so the basalt isnt actually inside of the biome itself WorldGen.TileRunner(X, Y, WorldGen.genRand.Next(8, 12), WorldGen.genRand.Next(8, 12), ModContent.TileType(), true, 0f, 0f, true, true); @@ -986,10 +1037,14 @@ namespace CalamityMod.World //Very bottom of the biome (Clam Den) public static void PlaceClamDen(int startPosX, int startPosY) { + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.ClamDenX; + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.ClamDenY; + int cavePerlinSeed = WorldGen.genRand.Next(); int cavePerlinSeedWalls = WorldGen.genRand.Next(); - Point origin = new Point(startPosX, startPosY); + Point origin = new Point(startX, startY); Vector2 center = origin.ToVector2() * 16f + new Vector2(8f); float angle = MathHelper.Pi * 0.70f; @@ -1156,38 +1211,46 @@ namespace CalamityMod.World //basalt biome underneath the sunken sea public static void PlaceBasaltGully(int startPosX, int startPosY) { + int startX = startPosX + SSOffsets.GlobalX + SSOffsets.BasaltGullyX; + + int startY = startPosY + SSOffsets.GlobalY + SSOffsets.BasaltGullyY; + int biomeSize = 250 + (Main.maxTilesX / 180); int XLeft = GenVars.UndergroundDesertLocation.Left + 40; int XRight = GenVars.UndergroundDesertLocation.Right - 70; //place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance - for (int X = startPosX - biomeSize - 60; X < startPosX + biomeSize + 60; X += 1) + for (int X = startX - biomeSize - 80; X < startX + biomeSize + 80; X += 1) { - //const int totalCuveDepth = -120; - //const int totalCuveDepth2 = 120; - int basaltbordernoise = Main.rand.Next(180, 185); - int basaltbordernoisetop = Main.rand.Next(645, 650); - const int totalCuveDepth = -220; - const int totalCuveDepth2 = 90; + int leftEdge = startX - biomeSize - 60; + int rightEdge = startX + biomeSize + 60; + int basaltbordernoise = Main.rand.Next(0, 4); + int basaltbordernoisetop = Main.rand.Next(0, 4); + const int totalCurveDepth = -320; + const int totalCurveDepthTop = 45; int curveDepth = (int)MathHelper.Lerp( - totalCuveDepth, + totalCurveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 60, startPosX + biomeSize - 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 60, startX + biomeSize - 200, X, true))); int curveDepth2 = (int)MathHelper.Lerp( - totalCuveDepth, + totalCurveDepth, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 60, startPosX - biomeSize + 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 60, startX - biomeSize + 200, X, true))); int curveDepthtop = (int)MathHelper.Lerp( - totalCuveDepth2, + totalCurveDepthTop, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 60, startPosX + biomeSize - 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startX + biomeSize + 60, startX + biomeSize - 200, X, true))); int curveDepth2top = (int)MathHelper.Lerp( - totalCuveDepth2, + totalCurveDepthTop, 0f, - MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 60, startPosX - biomeSize + 200, X, true))); + MathF.Sqrt(Utils.GetLerpValue(startX - biomeSize - 60, startX - biomeSize + 200, X, true))); - for (int Y = startPosY - 650 + curveDepthtop + curveDepth2top; Y <= Main.maxTilesY - 185 + curveDepth + curveDepth2; Y++) + for (int Y = startY - (625 + basaltbordernoisetop) + curveDepthtop + curveDepth2top; Y <= Main.maxTilesY - (270 + basaltbordernoise) + curveDepth + curveDepth2; Y++) { + int leftIndent = Main.rand.Next(0, 12); + int rightIndent = Main.rand.Next(0, 12); + if (X < leftEdge + leftIndent || X > rightEdge - rightIndent) + continue; Main.tile[X, Y].ClearEverything(); WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); WorldGen.PlaceWall(X, Y, ModContent.WallType()); @@ -1195,9 +1258,9 @@ namespace CalamityMod.World } //place caverns and lava - for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) + for (int X = startX - biomeSize - (Main.maxTilesX / 25); X <= startX + biomeSize + (Main.maxTilesX / 25); X++) { - for (int Y = startPosY; Y <= Main.maxTilesY - 190; Y++) + for (int Y = startY; Y <= Main.maxTilesY - 190; Y++) { if (Main.tile[X, Y].TileType == ModContent.TileType()) { @@ -1219,9 +1282,9 @@ namespace CalamityMod.World } //place sand blocks - for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) + for (int X = startX - biomeSize - (Main.maxTilesX / 25); X < startX + biomeSize + (Main.maxTilesX / 25); X += 1) { - for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) + for (int Y = startY; Y <= Main.maxTilesY - 210; Y++) { bool canPlaceSand = false; @@ -1239,9 +1302,9 @@ namespace CalamityMod.World } //cleanup - for(int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) + for(int X = startX - biomeSize - (Main.maxTilesX / 25); X < startX + biomeSize + (Main.maxTilesX / 25); X += 1) { - for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) + for (int Y = startY; Y <= Main.maxTilesY - 210; Y++) { //clean tiles that are sticking out (aka tiles only attached to one tile on one side) bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; @@ -1302,6 +1365,7 @@ namespace CalamityMod.World //place all the ambient tiles in the sunken sea public static void PlaceSunkenSeaAmbience() { + bool shipPlaced = false; //first clean up unnecessary chunks of tiles CleanOutSmallClumps(); @@ -1311,7 +1375,7 @@ namespace CalamityMod.World for (int Y = 20; Y <= Main.maxTilesY - 20; Y++) { //place coral blobs in the radiant reefs - if (WorldGen.genRand.NextBool(1000) && ((Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile) || + if (WorldGen.genRand.NextBool(400) && ((Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile) || (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile))) { ushort[] Corals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), @@ -1333,7 +1397,7 @@ namespace CalamityMod.World if (Main.tile[X, Y].TileType == ModContent.TileType()) { //Driftwood Ambiance - if (WorldGen.genRand.NextBool(100)) + if (WorldGen.genRand.NextBool(50)) { ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1343,7 +1407,7 @@ namespace CalamityMod.World if (Main.tile[X, Y].TileType == ModContent.TileType()) { //Driftwood Ambiance - if (WorldGen.genRand.NextBool(100)) + if (WorldGen.genRand.NextBool(75)) { ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1400,30 +1464,45 @@ namespace CalamityMod.World } if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); //Medium Sea Prism down if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 7); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 5); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 4); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } if (WorldGen.genRand.NextBool(9)) { ushort[] CrystalRandom = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, 2); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(CrystalRandom), true, 0, 0, style); } } if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyleTable() => WorldGen.genRand.Next(3); + int styletable = RandStyleTable(); + + if (WorldGen.genRand.NextBool(5) && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.PlaceTile(X + 2, Y, ModContent.TileType(), true, false, -1, styletable); + } + + if (WorldGen.genRand.NextBool(5) && !Main.tile[X - 1, Y].HasTile) + { + WorldGen.PlaceTile(X - 2, Y, ModContent.TileType(), true, false, -1, styletable); + } + //stalactites if (WorldGen.genRand.NextBool(10)) { @@ -1465,111 +1544,54 @@ namespace CalamityMod.World if (WorldGen.genRand.NextBool()) { ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType()}; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(Piles)); } - if (WorldGen.genRand.NextBool(8)) - { - ushort[] NavystoneAmbients = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(NavystoneAmbients)); - } } //Polyp Forest Ambient tiles if (Main.tile[X, Y].TileType == ModContent.TileType()) { + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); //BranchCoralsOnLimestone if (WorldGen.genRand.NextBool(15)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 7); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } if (WorldGen.genRand.NextBool(15)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 1); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 5); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 4); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 2); - } - if (WorldGen.genRand.NextBool(15)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 6); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } + } if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(50) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] - { - new Modifiers.OnlyTiles((ushort)ModContent.TileType(),(ushort)ModContent.TileType()), - new Actions.ClearTile(), - new Actions.PlaceTile((ushort)ModContent.TileType()), - })); + int RandStyle() => WorldGen.genRand.Next(8); + int style = RandStyle(); + //BranchCoralsOnSand - if (WorldGen.genRand.NextBool(55)) + if (WorldGen.genRand.NextBool(25)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); + WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } - if (WorldGen.genRand.NextBool(55)) + if (WorldGen.genRand.NextBool(25)) { ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 1); + WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, style); } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 5); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 4); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 3); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 2); - } - if (WorldGen.genRand.NextBool(55)) - { - ushort[] BranchCorals = new ushort[] { (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 8); - } - if (WorldGen.genRand.NextBool(30)) + if (WorldGen.genRand.NextBool(25)) { ushort[] DigitateCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DigitateCorals)); } - if (WorldGen.genRand.NextBool(15)) + if (WorldGen.genRand.NextBool(8)) { ushort[] FryCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; @@ -1612,18 +1634,16 @@ namespace CalamityMod.World WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); } + if (!shipPlaced) + { + if (WorldGen.PlaceObject(X, Y - 1, ModContent.TileType(), mute: true)) + shipPlaced = true; + } } //radiant reefs ambient tiles if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(100) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(7), Actions.Chain(new GenAction[] - { - new Modifiers.OnlyTiles((ushort)ModContent.TileType()), - new Actions.ClearTile(), - new Actions.PlaceTile((ushort)ModContent.TileType()), - })); //Driftwood Ambiance if (WorldGen.genRand.NextBool(15)) { @@ -1683,10 +1703,18 @@ namespace CalamityMod.World CalamityUtils.GrowVines(X, Y, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType()); } + if (Main.tile[X, Y].TileType == ModContent.TileType() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile && !Main.tile[X, Y + 2].HasTile) + { + WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); + } + if (Main.tile[X, Y].TileType == ModContent.TileType()) + { + CalamityUtils.GrowVines(X, Y, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType()); + } + //grow depth vines on navystone if (Main.tile[X, Y].TileType == ModContent.TileType() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile && !Main.tile[X, Y + 2].HasTile) { - // 18APR2025: Ozzatron: removed guaranteed RNG check here, since it was intended to be guaranteed WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); } if (Main.tile[X, Y].TileType == ModContent.TileType()) @@ -1697,45 +1725,50 @@ namespace CalamityMod.World //wall corals if (Main.tile[X, Y].TileType == ModContent.TileType()) { + + int RandStyleWall() => WorldGen.genRand.Next(4); + int stylewall = RandStyleWall(); + if (WorldGen.genRand.NextBool(5) && !Main.tile[X + 1, Y].HasTile) { - ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceTile(X + 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0); + WorldGen.PlaceTile(X + 2, Y, ModContent.TileType(), true, false, -1, stylewall); } if (WorldGen.genRand.NextBool(5) && !Main.tile[X - 1, Y].HasTile) { - ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceTile(X - 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0); + WorldGen.PlaceTile(X - 2, Y, ModContent.TileType(), true, false, -1, stylewall); } } // Pearl Autism - if (Main.tile[X, Y].TileType == ModContent.TileType()) + if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(50) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] + if (WorldGen.genRand.NextBool(60) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(2), Actions.Chain(new GenAction[] { - new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), new Actions.ClearTile(), new Actions.PlaceTile((ushort)ModContent.TileType()), })); } if (Main.tile[X, Y].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(30) && !Main.tile[X - 1, Y].HasTile) - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(3), Actions.Chain(new GenAction[] + if (WorldGen.genRand.NextBool(60) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(2), Actions.Chain(new GenAction[] { new Modifiers.OnlyTiles((ushort)ModContent.TileType()), new Actions.ClearTile(), new Actions.PlaceTile((ushort)ModContent.TileType()), })); } + + if (Main.tile[X, Y].TileType == ModContent.TileType()) + if (WorldGen.genRand.NextBool(60) && !Main.tile[X - 1, Y].HasTile) + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(2), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + })); } } } @@ -1819,7 +1852,11 @@ namespace CalamityMod.World { new Actions.ClearTile(), new Actions.SetLiquid(), - new Actions.PlaceWall((ushort)ModContent.WallType()) + })); + + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(radius - 4), Actions.Chain(new GenAction[] + { + new Actions.PlaceWall((ushort)ModContent.WallType()) })); return true;