diff --git a/Buffs/StatDebuffs/GlacialState.png b/Buffs/StatDebuffs/GlacialState.png index f38b37b8bb..b3d02f6cff 100644 Binary files a/Buffs/StatDebuffs/GlacialState.png and b/Buffs/StatDebuffs/GlacialState.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ee7a375f76..a7eab5ff5c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3633,7 +3633,7 @@ namespace CalamityMod.CalPlayer #region Get Weapon Damage And KB public override void ModifyWeaponDamage(Item item, ref float add, ref float mult, ref float flat) { - bool isTrueMelee = item.melee && (item.shoot == 0 || (item.noMelee && item.noUseGraphic && item.useStyle == 5 && !CalamityMod.trueMeleeBoostExceptionList.Contains(item.type) && ItemID.Sets.Yoyo[item.type] != true)); + bool isTrueMelee = item.melee && (item.shoot == 0 || item.Calamity().trueMelee); if (isTrueMelee) { if (tScale) @@ -3760,7 +3760,7 @@ namespace CalamityMod.CalPlayer } } } - bool isTrueMelee = item.melee && (item.shoot == 0 || (item.noMelee && item.noUseGraphic && item.useStyle == 5 && !CalamityMod.trueMeleeBoostExceptionList.Contains(item.type) && ItemID.Sets.Yoyo[item.type] != true)); + bool isTrueMelee = item.melee && (item.shoot == 0 || item.Calamity().trueMelee); if (isTrueMelee) { if (fungalSymbiote && player.whoAmI == Main.myPlayer) @@ -9138,6 +9138,20 @@ namespace CalamityMod.CalPlayer fullBright = true; } } + if (cadence && !player.loveStruck) + { + if (Main.rand.NextBool(5) && drawInfo.shadow == 0f) + { + Vector2 vector2_2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11)); + vector2_2.Normalize(); + vector2_2.X *= 0.66f; + int heart = Gore.NewGore(drawInfo.position + new Vector2((float)Main.rand.Next(player.width + 1), (float)Main.rand.Next(player.height + 1)), vector2_2 * (float)Main.rand.Next(3, 6) * 0.33f, 331, (float)Main.rand.Next(40, 121) * 0.01f); + Main.gore[heart].sticky = false; + Main.gore[heart].velocity *= 0.4f; + Main.gore[heart].velocity.Y -= 0.6f; + Main.playerDrawGore.Add(heart); + } + } } #endregion diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 1d70f34cc7..f9d30b3803 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -164,7 +164,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - lifeRegenLost += 12; + lifeRegenLost += 6; } if (modPlayer.hFlames) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ea981c87b5..8e32f3ee89 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2687,7 +2687,6 @@ namespace CalamityMod.CalPlayer player.discount = true; player.lifeMagnet = true; player.calmed = true; - player.loveStruck = true; } if (modPlayer.community) diff --git a/CalamityMod.cs b/CalamityMod.cs index c2934300a3..295ec5b0e4 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -165,7 +165,6 @@ namespace CalamityMod public static List movementImpairImmuneList; public static List trapProjectileList; public static List scopedWeaponList; - public static List trueMeleeBoostExceptionList; public static List boomerangList; public static List javelinList; public static List daggerList; @@ -374,7 +373,6 @@ namespace CalamityMod movementImpairImmuneList = null; trapProjectileList = null; scopedWeaponList = null; - trueMeleeBoostExceptionList = null; boomerangList = null; javelinList = null; daggerList = null; @@ -1820,73 +1818,6 @@ namespace CalamityMod ModContent.ItemType() }; - trueMeleeBoostExceptionList = new List() - { - ItemID.FlowerPow, - ItemID.Flairon, - ItemID.ChlorophytePartisan, - ItemID.MushroomSpear, - ItemID.NorthPole, - ItemID.WoodYoyo, - ItemID.CorruptYoyo, - ItemID.CrimsonYoyo, - ItemID.JungleYoyo, - ItemID.Cascade, - ItemID.Chik, - ItemID.Code1, - ItemID.Code2, - ItemID.Rally, - ItemID.Yelets, - ItemID.RedsYoyo, - ItemID.ValkyrieYoyo, - ItemID.Amarok, - ItemID.HelFire, - ItemID.Kraken, - ItemID.TheEyeOfCthulhu, - ItemID.FormatC, - ItemID.Gradient, - ItemID.Valor, - ItemID.Terrarian, - - // flails - ModContent.ItemType(), - ModContent.ItemType(), - - // spears - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - - // yoyos - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - - // other - ModContent.ItemType(), - ModContent.ItemType() - }; - boomerangList = new List() { ModContent.ItemType(), diff --git a/Configs.cs b/Configs.cs index d1289c8b91..f4a3160ce5 100644 --- a/Configs.cs +++ b/Configs.cs @@ -63,12 +63,6 @@ namespace CalamityMod [Tooltip("Prevents the movement of the Adrenaline, Rage and Stealth bars with the Mouse")] public bool MeterPosLock { get; set; } - [DefaultValue(2f)] - [Range(0f, 4f)] - [Label("Adrenaline and Rage Meter Shake")] - [Tooltip("How much the Adrenaline and Rage Meter shake while in use. Set to 0 to disable.")] - public float MeterShake { get; set; } - [DefaultValue(true)] [Label("Boss Health Bar Small Text")] [Tooltip("Enables the small text below the health bar\nThis displays the exact health amount or remaining boss parts")] @@ -143,6 +137,12 @@ namespace CalamityMod [DefaultValue(RipperUI.DefaultAdrenPosY)] public float AdrenalineMeterPosY { get; set; } + [DefaultValue(2f)] + [Range(0f, 4f)] + [Label("Adrenaline and Rage Meter Shake")] + [Tooltip("How much the Adrenaline and Rage Meter shake while in use. Set to 0 to disable.")] + public float MeterShake { get; set; } + [DefaultValue(false)] [Label("Revengeance and Death Thorium Boss buff")] [Tooltip("Buffs the health of Thorium bosses if Revengeance or Death is enabled")] diff --git a/Items/Armor/SulfurHelmet.cs b/Items/Armor/SulfurHelmet.cs index dedc824eeb..7a46af18f9 100644 --- a/Items/Armor/SulfurHelmet.cs +++ b/Items/Armor/SulfurHelmet.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { player.setBonus = "Attacking and being attacked by enemies inflicts poison\n" + - "Grants a sulphurous bubble jump that applies venom on hit\n" + + "Grants an additional jump\n" + + "Jumping off the ground leaves behind a sulphurous bubble that applies venom on hit\n" + "Slightly reduces breath loss in the abyss\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 17f7bcd7aa..538234fbe8 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Potions; +using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -54,6 +55,7 @@ namespace CalamityMod.Items #endregion public bool rogue = false; + public bool trueMelee = false; public int timesUsed = 0; @@ -180,6 +182,29 @@ namespace CalamityMod.Items item.damage *= 4; item.rare = 4; } + + switch (item.type) + { + case ItemID.Spear: + case ItemID.TheRottedFork: + case ItemID.Swordfish: + case ItemID.Arkhalis: + case ItemID.DarkLance: + case ItemID.CobaltNaginata: + case ItemID.PalladiumPike: + case ItemID.MythrilHalberd: + case ItemID.OrichalcumHalberd: + case ItemID.AdamantiteGlaive: + case ItemID.TitaniumTrident: + case ItemID.Gungnir: + case ItemID.ObsidianSwordfish: + case ItemID.MonkStaffT3: + case ItemID.MonkStaffT1: + trueMelee = true; + break; + default: + break; + } } #endregion @@ -851,7 +876,19 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(255 - Main.DiscoG < 80 ? 80 : Main.DiscoG < 50 ? 255 : 255 - Main.DiscoG, Main.DiscoG < 126 ? 126 : Main.DiscoG, 0); //alternates between emerald green and amber (BanditHueh) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 2f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 2f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 2f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 2f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(146, 0, 0); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(129, 29, 149); // Uniquely colored legendary weapons and Yharim's Crystal if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) @@ -871,7 +908,7 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(255, Main.DiscoG, 0); if (item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(255, 255, Main.DiscoB); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); break; } } diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 3834460bfc..061966f0cd 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Tools item.rare = 10; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/CrystylCharge"); item.shoot = ModContent.ProjectileType(); - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override Vector2? HoldoutOrigin() diff --git a/Items/Tools/PurityAxe.cs b/Items/Tools/PurityAxe.cs index bdc6bf04f6..9fced17a3a 100644 --- a/Items/Tools/PurityAxe.cs +++ b/Items/Tools/PurityAxe.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Tools recipe.AddIngredient(ItemID.PurificationPowder, 20); recipe.AddIngredient(ItemID.PixieDust, 10); recipe.AddIngredient(ItemID.CrystalShard, 5); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 4e7c7c12fd..a204e8aac4 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 5; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; + item.Calamity().trueMelee = true; } } } diff --git a/Items/Weapons/Melee/CelestialClaymore.cs b/Items/Weapons/Melee/CelestialClaymore.cs index 217c9754e0..7cba73378e 100644 --- a/Items/Weapons/Melee/CelestialClaymore.cs +++ b/Items/Weapons/Melee/CelestialClaymore.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 50; - item.damage = 63; + item.damage = 70; item.melee = true; item.useAnimation = 23; item.useTime = 23; @@ -88,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Melee default: break; } - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, type, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(3)); + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, (float)Main.rand.Next(3)); } return false; } diff --git a/Items/Weapons/Melee/ClamCrusher.cs b/Items/Weapons/Melee/ClamCrusher.cs index 5d9ed99c23..08562b8c22 100644 --- a/Items/Weapons/Melee/ClamCrusher.cs +++ b/Items/Weapons/Melee/ClamCrusher.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 140; + item.damage = 100; item.melee = true; item.width = 40; item.height = 60; diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index e0efd6d5f8..a7a9b0c133 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; + item.Calamity().trueMelee = true; } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index fbcf8cb69d..3f6d1ecbba 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; + item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 2fd2356777..1bb40c681d 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/EutrophicScimitar.cs b/Items/Weapons/Melee/EutrophicScimitar.cs index e018ff715f..907f8f29c2 100644 --- a/Items/Weapons/Melee/EutrophicScimitar.cs +++ b/Items/Weapons/Melee/EutrophicScimitar.cs @@ -42,7 +42,9 @@ namespace CalamityMod.Items.Weapons.Melee dust.noGravity = true; dust.fadeIn = 0.9473684f; } - return true; + + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.7), knockBack, player.whoAmI, 0f, 0f); + return false; } } } diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index 838bf0e9f9..0dd40697fe 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 8; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 8f; + item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Melee/ForsakenSaber.cs b/Items/Weapons/Melee/ForsakenSaber.cs index 2492ffdc2f..de304b98f0 100644 --- a/Items/Weapons/Melee/ForsakenSaber.cs +++ b/Items/Weapons/Melee/ForsakenSaber.cs @@ -33,6 +33,12 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, 0f); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index 3dcb5c06b6..e033e89a45 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shootSpeed = 6f; + item.Calamity().trueMelee = true; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 2934847dd8..5d3964a5e3 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; - item.Calamity().customRarity = CalamityRarity.Violet; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; item.useStyle = ItemUseStyleID.SwingThrow; } public override void HoldItem(Player player) diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 1f80a37c3c..d50a4f8fa7 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = 13f; item.Calamity().customRarity = CalamityRarity.Turquoise; + item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Melee/HeartRapier.cs b/Items/Weapons/Melee/HeartRapier.cs index a87a3c2330..eb2b398344 100644 --- a/Items/Weapons/Melee/HeartRapier.cs +++ b/Items/Weapons/Melee/HeartRapier.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 5; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; + item.Calamity().trueMelee = true; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 4cbf780e06..367ac7d2aa 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 2; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; + item.Calamity().trueMelee = true; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index afb2d14bee..0e79619fa7 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; item.Calamity().customRarity = CalamityRarity.Violet; + item.Calamity().trueMelee = true; } public override bool CanUseItem(Player player) diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index 97f9d5e6b0..0c0b6a3054 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 3; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 6f; + item.Calamity().trueMelee = true; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index aafa76768b..ebe427f352 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -11,13 +11,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Storm Saber"); - Tooltip.SetDefault("Fires a storm beam"); + Tooltip.SetDefault("Fires two storm beams\n" + + "One from blade and one from the sky"); } public override void SetDefaults() { item.width = 58; - item.damage = 42; + item.damage = 50; item.melee = true; item.useAnimation = 23; item.useTime = 23; @@ -33,6 +34,20 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 12f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, 0f); + + Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f); + Vector2 targetPos = Main.MouseWorld + new Vector2(Main.rand.Next(-30, 31), Main.rand.Next(-30, 31)); + Vector2 velocity = targetPos - spawnPos; + velocity.Normalize(); + velocity *= 13f; + + Projectile.NewProjectile(spawnPos, velocity, type, (int)(damage * 0.6), knockBack, player.whoAmI); + return false; + } + public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(5)) diff --git a/Items/Weapons/Melee/TrueCausticEdge.cs b/Items/Weapons/Melee/TrueCausticEdge.cs index 2004d477f6..7be9f192e0 100644 --- a/Items/Weapons/Melee/TrueCausticEdge.cs +++ b/Items/Weapons/Melee/TrueCausticEdge.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 64; - item.damage = 42; + item.damage = 75; item.melee = true; item.useAnimation = 28; item.useStyle = 1; @@ -34,19 +34,17 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 16f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.8), knockBack, player.whoAmI, 0f, 0f); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.FlaskofCursedFlames, 5); - recipe.AddIngredient(ItemID.FlaskofPoison, 5); - recipe.AddIngredient(ItemID.Deathweed, 3); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.FlaskofIchor, 5); + recipe.AddRecipeGroup("AnyEvilFlask", 5); recipe.AddIngredient(ItemID.FlaskofPoison, 5); recipe.AddIngredient(ItemID.Deathweed, 3); recipe.AddTile(TileID.DemonAltar); diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 4851938639..427455d81a 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -60,6 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 33; item.useTime = 33; item.shootSpeed = 4.5f; + item.Calamity().trueMelee = true; } else { @@ -68,6 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.useTime = 22; item.shootSpeed = ShootSpeed; + item.Calamity().trueMelee = false; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 3ee0dea505..1ecdf007f8 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 20; + item.damage = 23; item.ranged = true; item.width = 30; item.height = 42; diff --git a/Items/Weapons/Rogue/IceStar.png b/Items/Weapons/Rogue/IceStar.png index c71cf0bd49..cfeebe4f90 100644 Binary files a/Items/Weapons/Rogue/IceStar.png and b/Items/Weapons/Rogue/IceStar.png differ diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index 03e4534a45..5f760e2c66 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.shoot = ModContent.ProjectileType(); item.shootSpeed = 30f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index f83c0ec086..d448b643a0 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Summon item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(5, 0, 0, 0); - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; item.rare = 10; item.UseSound = SoundID.Item68; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index b08bd918ae..10abe1e3a1 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon item.shootSpeed = 10f; item.value = Item.buyPrice(5, 0, 0, 0); - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool CanUseItem(Player player) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 78bc745f74..f46e160544 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -73,31 +73,20 @@ namespace CalamityMod.Projectiles switch (projectile.type) { case ProjectileID.Spear: - case ProjectileID.ChainKnife: case ProjectileID.TheRottedFork: - case ProjectileID.BallOHurt: - case ProjectileID.TheMeatball: case ProjectileID.Swordfish: case ProjectileID.Arkhalis: - case ProjectileID.BlueMoon: case ProjectileID.DarkLance: - case ProjectileID.Sunfury: - case ProjectileID.Anchor: - case ProjectileID.BoxingGlove: case ProjectileID.CobaltNaginata: case ProjectileID.PalladiumPike: case ProjectileID.MythrilHalberd: case ProjectileID.OrichalcumHalberd: case ProjectileID.AdamantiteGlaive: case ProjectileID.TitaniumTrident: - case ProjectileID.TheDaoofPow: - case ProjectileID.GolemFist: case ProjectileID.Gungnir: case ProjectileID.ObsidianSwordfish: - case ProjectileID.ChainGuillotine: case ProjectileID.MonkStaffT3: case ProjectileID.MonkStaffT1: - case ProjectileID.SolarWhipSword: trueMelee = true; break; case ProjectileID.StarWrath: diff --git a/Projectiles/Melee/ClamCrusherFlail.cs b/Projectiles/Melee/ClamCrusherFlail.cs index 1821044352..ab30de06fa 100644 --- a/Projectiles/Melee/ClamCrusherFlail.cs +++ b/Projectiles/Melee/ClamCrusherFlail.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.alpha = 255; projectile.tileCollide = false; - projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index 67332b2145..2f3aed3202 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -30,7 +30,6 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; - projectile.Calamity().trueMelee = true; projectile.coldDamage = true; } public override Color SpecialDrawColor => new Color(150, 255, 255); diff --git a/Projectiles/Melee/MourningstarFlail.cs b/Projectiles/Melee/MourningstarFlail.cs index eeeb42a21a..7a602f1b75 100644 --- a/Projectiles/Melee/MourningstarFlail.cs +++ b/Projectiles/Melee/MourningstarFlail.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - projectile.Calamity().trueMelee = true; } } } diff --git a/Projectiles/Melee/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 9ae8afc278..47cba7fb60 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 2; - projectile.Calamity().trueMelee = true; } public override Color SpecialDrawColor => new Color(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); diff --git a/Projectiles/Melee/TumbleweedFlail.cs b/Projectiles/Melee/TumbleweedFlail.cs index 9994353091..8d412f1c10 100644 --- a/Projectiles/Melee/TumbleweedFlail.cs +++ b/Projectiles/Melee/TumbleweedFlail.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.melee = true; projectile.alpha = 255; - projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/UrchinBall.cs b/Projectiles/Melee/UrchinBall.cs index 4eeac5a8a6..7f48fa8765 100644 --- a/Projectiles/Melee/UrchinBall.cs +++ b/Projectiles/Melee/UrchinBall.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Melee projectile.alpha = 255; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; - projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/YateveoBloomProj.cs b/Projectiles/Melee/YateveoBloomProj.cs index c1634de9a4..9ff164c273 100644 --- a/Projectiles/Melee/YateveoBloomProj.cs +++ b/Projectiles/Melee/YateveoBloomProj.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.melee = true; projectile.alpha = 255; - projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Ranged/PristineFire.cs b/Projectiles/Ranged/PristineFire.cs index b4c6f15f6c..43fee8ce6b 100644 --- a/Projectiles/Ranged/PristineFire.cs +++ b/Projectiles/Ranged/PristineFire.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; Main.dust[num448].velocity *= 0.2f; Main.dust[num448].noLight = true; - Main.dust[num448].color = new Color(255, 255, Main.DiscoB); + Main.dust[num448].color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); } projectile.ai[0] += 1f; if (projectile.ai[0] == 48f) @@ -84,7 +85,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num42].position = projectile.Center + value8; Main.dust[num42].velocity = projectile.velocity; Main.dust[num42].noLight = true; - Main.dust[num42].color = new Color(255, 255, Main.DiscoB); + Main.dust[num42].color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); } } } @@ -124,14 +125,14 @@ namespace CalamityMod.Projectiles.Ranged dust.noGravity = true; dust.velocity *= 3f; dust.velocity += value4 * Main.rand.NextFloat(); - dust.color = new Color(255, 255, Main.DiscoB); - num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, new Color(255, 255, Main.DiscoB), num51); + dust.color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); + num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, num51); dust.position = projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; dust.velocity += value4 * Main.rand.NextFloat(); - dust.color = new Color(255, 255, Main.DiscoB); + dust.color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); } for (int num55 = 0; num55 < 20; num55++) { @@ -141,7 +142,7 @@ namespace CalamityMod.Projectiles.Ranged dust.noGravity = true; dust.velocity *= 0.5f; dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - dust.color = new Color(255, 255, Main.DiscoB); + dust.color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); } } } diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 71ce99a83b..6c00a74439 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged dust.velocity.Y *= 1.2f; dust.scale *= num296; dust.noLight = true; - dust.color = new Color(255, 255, Main.DiscoB); + dust.color = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); } } } diff --git a/Projectiles/Rogue/IceStarProjectile.png b/Projectiles/Rogue/IceStarProjectile.png index c71cf0bd49..cfeebe4f90 100644 Binary files a/Projectiles/Rogue/IceStarProjectile.png and b/Projectiles/Rogue/IceStarProjectile.png differ diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 6f53f0d3f1..e7d5691396 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -11,9 +11,6 @@ namespace CalamityMod.Projectiles.Rogue { public class LuminousStrikerProj : ModProjectile { - public int shardRainTimer = 3; - bool stealthStrike = false; - public override void SetStaticDefaults() { DisplayName.SetDefault("Luminous Striker"); @@ -37,29 +34,26 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 0f && modPlayer.StealthStrikeAvailable()) { projectile.Calamity().stealthStrike = true; - stealthStrike = true; projectile.timeLeft = 600; projectile.ai[0] = 1f; } - shardRainTimer--; if (Main.rand.NextBool(4)) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 176, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; - if (shardRainTimer == 0) + if (projectile.timeLeft % 4 == 0) { if (projectile.owner == Main.myPlayer) { - if (stealthStrike) + if (projectile.Calamity().stealthStrike) { Projectile.NewProjectile(projectile.Center.X + Main.rand.NextFloat(-15f, 15f), projectile.Center.Y + Main.rand.NextFloat(-15f, 15f), projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack * 0.25f, projectile.owner, 0f, 0f); } else Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, -2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack * 0.25f, projectile.owner, 0f, 0f); } - shardRainTimer = 4; } } diff --git a/Projectiles/Rogue/NightsGazeProjectile.cs b/Projectiles/Rogue/NightsGazeProjectile.cs index 59b92265e6..fcc2008c1a 100644 --- a/Projectiles/Rogue/NightsGazeProjectile.cs +++ b/Projectiles/Rogue/NightsGazeProjectile.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike) { - if (Main.rand.Next(8) == 0) + if (Main.rand.NextBool(8)) { int projectileDamage = (int)(projectile.damage * 0.75f); int projectileType = ModContent.ProjectileType(); @@ -127,20 +127,12 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 5; i++) { - int dustToUse = Main.rand.Next(0, 3); - int dustType = 0; - switch (dustToUse) - { - case 0: - dustType = 109; - break; - case 1: - dustType = 111; - break; - case 2: - dustType = 132; - break; - } + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 109, + 111, + 132 + }); int dust = Dust.NewDust(projectile.Center, 1, 1, dustType, projectile.velocity.X / 3f, projectile.velocity.Y / 3f, 0, default, 1.5f); Main.dust[dust].noGravity = true; diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index 60e9ef165e..4c8e102722 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -10,8 +10,6 @@ namespace CalamityMod.Projectiles.Rogue { public class PhantasmalRuinProj : ModProjectile { - private int projCount = 18; - public override void SetStaticDefaults() { DisplayName.SetDefault("Phantasmal Ruin"); @@ -41,8 +39,7 @@ namespace CalamityMod.Projectiles.Rogue { projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default(Color), 0.85f); - projCount--; - if (projCount <= 0) + if (projectile.timeLeft % 18 == 0) { if (projectile.owner == Main.myPlayer) { @@ -54,13 +51,12 @@ namespace CalamityMod.Projectiles.Rogue { if (Main.rand.NextBool(3)) { - int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, Main.rand.Next(-2,3), ProjectileID.LostSoulFriendly, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, Main.rand.NextFloat(-2,2), ProjectileID.LostSoulFriendly, (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[soul].Calamity().forceRogue = true; Main.projectile[soul].timeLeft = 180; } } } - projCount = 18; } } @@ -87,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue } else { - damage = (int)((double)damage * 0.9); + damage = (int)(damage * 0.9); } } } @@ -111,6 +107,10 @@ namespace CalamityMod.Projectiles.Rogue int num24 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.05), 0f, projectile.owner, 1f, ai1); } } + else + { + damage = (int)(damage * 0.9); + } } } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index de038da53d..104c5466d0 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -10,8 +10,6 @@ namespace CalamityMod.Projectiles.Rogue { public class ScarletDevilProjectile : ModProjectile { - bool lifesteal = false; - public override void SetStaticDefaults() { DisplayName.SetDefault("Spear the Gungnir"); @@ -41,7 +39,6 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 1f && modPlayer.StealthStrikeAvailable()) { projectile.Calamity().stealthStrike = true; - lifesteal = true; } if ((projectile.ai[0] %= 5f) == 0f) { @@ -79,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); - if (target.type == NPCID.TargetDummy || !lifesteal) + if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike) { return; } @@ -94,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); - if (!lifesteal) + if (!projectile.Calamity().stealthStrike) { return; } diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index b1ce0e8d2c..346463ddb8 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -10,7 +10,6 @@ namespace CalamityMod.Projectiles.Rogue { public class SpearofPaleolithProj : ModProjectile { - private int shardRainTimer = 3; private bool stealthInit = false; public override void SetStaticDefaults() @@ -40,8 +39,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.timeLeft = 1800; stealthInit = true; } - shardRainTimer--; - if (Main.rand.NextBool(4)) { @@ -52,13 +49,12 @@ namespace CalamityMod.Projectiles.Rogue { projectile.rotation -= 1.57f; } - if (shardRainTimer == 0) + if (projectile.timeLeft % 3 == 0) { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } - shardRainTimer = 3; } } diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 27ecf14550..47aa2b6774 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -11,8 +11,6 @@ namespace CalamityMod.Projectiles.Rogue { public class SupernovaBomb : ModProjectile { - private int stealthTimer = 8; - public override void SetStaticDefaults() { DisplayName.SetDefault("Supernova Bomb"); @@ -68,14 +66,12 @@ namespace CalamityMod.Projectiles.Rogue //stealth strike if (projectile.Calamity().stealthStrike == true) { - stealthTimer--; - if (stealthTimer == 0) + if (projectile.timeLeft % 8 == 0) { if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, 0f); } - stealthTimer = 8; } } } diff --git a/Projectiles/Rogue/SylvanSlashAttack.cs b/Projectiles/Rogue/SylvanSlashAttack.cs index 6198ace61a..b37be1ec9d 100644 --- a/Projectiles/Rogue/SylvanSlashAttack.cs +++ b/Projectiles/Rogue/SylvanSlashAttack.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Projectiles.Rogue { public class SylvanSlashAttack : ModProjectile { - public int cooldown = 6; - public override void SetStaticDefaults() { DisplayName.SetDefault("Sylvan Slash"); @@ -36,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); if (projectile.spriteDirection == -1) { - num = 3.14159274f; + num = MathHelper.Pi; } if (++projectile.frame >= Main.projFrames[projectile.type]) { @@ -93,8 +91,7 @@ namespace CalamityMod.Projectiles.Rogue player.itemAnimation = 2; player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - if (cooldown < 5) - cooldown++; + projectile.ai[0]++; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -103,7 +100,7 @@ namespace CalamityMod.Projectiles.Rogue CalamityPlayer modPlayer = player.Calamity(); if (projectile.owner == Main.myPlayer) { - if (cooldown == 5) + if (projectile.ai[0] % 5 == 0) { if ((target.damage > 5 || target.boss) && !target.SpawnedFromStatue) { @@ -111,16 +108,15 @@ namespace CalamityMod.Projectiles.Rogue { if (modPlayer.rogueStealth < modPlayer.rogueStealthMax) modPlayer.rogueStealth += 0.01f; - cooldown = 0; } } } if (Main.rand.NextBool(8)) { - float speedMult = Main.rand.Next(3,6); + float speedMult = Main.rand.NextFloat(3,6); Vector2 vector1 = new Vector2(projectile.Center.X - player.Center.X, projectile.Center.Y - player.Center.Y); vector1.Normalize(); - Projectile.NewProjectile(player.Center.X, player.Center.Y, -vector1.X * speedMult, -vector1.Y * speedMult, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, -vector1.X * speedMult, -vector1.Y * speedMult, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } } } @@ -131,21 +127,20 @@ namespace CalamityMod.Projectiles.Rogue CalamityPlayer modPlayer = player.Calamity(); if (projectile.owner == Main.myPlayer) { - if (cooldown == 5) + if (projectile.ai[0] >= 5) { if (modPlayer.wearingRogueArmor && modPlayer.rogueStealthMax != 0) { if (modPlayer.rogueStealth < modPlayer.rogueStealthMax) modPlayer.rogueStealth += 0.01f; - cooldown = 0; } } if (Main.rand.NextBool(8)) { - float speedMult = Main.rand.Next(3,6); + float speedMult = Main.rand.NextFloat(3,6); Vector2 vector1 = new Vector2(projectile.Center.X - player.Center.X, projectile.Center.Y - player.Center.Y); vector1.Normalize(); - Projectile.NewProjectile(player.Center.X, player.Center.Y, -vector1.X * speedMult, -vector1.Y * speedMult, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, -vector1.X * speedMult, -vector1.Y * speedMult, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 14530795c5..d3f1ce9e8e 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -8,8 +8,6 @@ namespace CalamityMod.Projectiles.Rogue { public class TotalityFlask : ModProjectile { - private int tarTimer = 10; - public override void SetStaticDefaults() { DisplayName.SetDefault("Totality Flask"); @@ -30,36 +28,34 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.Calamity().stealthStrike == true) { - tarTimer--; - if (tarTimer == 0) + if (projectile.timeLeft % 10 == 0) { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); } - tarTimer = 10; } } Vector2 spinningpoint = new Vector2(4f, -8f); float rotation = projectile.rotation; if (projectile.direction == -1) - spinningpoint.X = -4f; - Vector2 vector2 = spinningpoint.RotatedBy((double) rotation, new Vector2()); + spinningpoint.X = -4f; + Vector2 vector2 = spinningpoint.RotatedBy((double)rotation, new Vector2()); for (int index1 = 0; index1 < 1; ++index1) { - int index2 = Dust.NewDust(projectile.Center + vector2 - Vector2.One * 5f, 4, 4, 6, 0.0f, 0.0f, 0, new Color(), 1f); - Main.dust[index2].scale = 1.5f; - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity = Main.dust[index2].velocity * 0.25f + Vector2.Normalize(vector2) * 1f; - Main.dust[index2].velocity = Main.dust[index2].velocity.RotatedBy(-1.57079637050629 * (double) projectile.direction, new Vector2()); + int index2 = Dust.NewDust(projectile.Center + vector2 - Vector2.One * 5f, 4, 4, 6, 0.0f, 0.0f, 0, new Color(), 1f); + Main.dust[index2].scale = 1.5f; + Main.dust[index2].noGravity = true; + Main.dust[index2].velocity = Main.dust[index2].velocity * 0.25f + Vector2.Normalize(vector2) * 1f; + Main.dust[index2].velocity = Main.dust[index2].velocity.RotatedBy(-MathHelper.PiOver2 * (double)projectile.direction, new Vector2()); } } public override void Kill(int timeLeft) { Main.PlaySound(13, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + //projectile.usesLocalNPCImmunity = true; + //projectile.localNPCHitCooldown = 10; Vector2 vector2 = new Vector2(20f, 20f); for (int index = 0; index < 5; ++index) Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f, 0, Color.Red, 1f); @@ -67,17 +63,17 @@ namespace CalamityMod.Projectiles.Rogue { int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust = Main.dust[index2]; - dust.velocity = dust.velocity * 1.4f; + dust.velocity *= 1.4f; } for (int index1 = 0; index1 < 20; ++index1) { int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 2.5f); - Main.dust[index2].noGravity = true; Dust dust1 = Main.dust[index2]; - dust1.velocity = dust1.velocity * 5f; + dust1.noGravity = true; + dust1.velocity *= 5f; int index3 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, 0.0f, 0.0f, 100, new Color(), 1.5f); Dust dust2 = Main.dust[index3]; - dust2.velocity = dust2.velocity * 3f; + dust2.velocity *= 3f; } int num251 = Main.rand.Next(2, 4); if (projectile.owner == Main.myPlayer) @@ -91,7 +87,7 @@ namespace CalamityMod.Projectiles.Rogue } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.6), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 1a9e896d67..751360327d 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -963,6 +963,13 @@ namespace CalamityMod }); RecipeGroup.RegisterGroup("CursedFlameIchor", group); + group = new RecipeGroup(() => "Any Evil Flask", new int[] + { + ItemID.FlaskofCursedFlames, + ItemID.FlaskofIchor + }); + RecipeGroup.RegisterGroup("AnyEvilFlask", group); + group = new RecipeGroup(() => "Any Evil Water", new int[] { ItemID.UnholyWater, diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 6138b314d9..8987da7f46 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -2311,6 +2311,19 @@ namespace CalamityMod sb.Append("[c/").Append(color.Hex3()).Append(':').Append(msg).Append(']'); return sb.ToString(); } + + /// + /// Returns a color lerp that allows for smooth transitioning between two given colors + /// + /// The first color you want it to switch between + /// The second color you want it to switch between + /// How long you want it to take to swap between colors + public static Color ColorSwap(Color firstColor, Color secondColor, float seconds) + { + double timeMult = (double)(MathHelper.TwoPi / seconds); + float colorMePurple = (float)((Math.Sin(timeMult * Main.GlobalTime) + 1) * 0.5f); + return Color.Lerp(firstColor, secondColor, colorMePurple); + } #endregion #region Miscellaneous Utilities