diff --git a/Buffs/Pets/SCalPetBuff.png b/Buffs/Pets/SCalPetBuff.png index ccce6a3ad1..39869b3c91 100644 Binary files a/Buffs/Pets/SCalPetBuff.png and b/Buffs/Pets/SCalPetBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4f53a2bfd7..e4155cf49d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1043,6 +1043,7 @@ namespace CalamityMod.CalPlayer public bool witheringWeaponEnchant = false; public bool witheredDebuff = false; public int witheredWeaponHoldTime = 0; + public int witheringDamageDone = 0; public bool persecutedEnchant = false; public int persecutedEnchantSummonTimer = 0; @@ -1791,6 +1792,7 @@ namespace CalamityMod.CalPlayer aCrunch = false; irradiated = false; bFlames = false; + witheredDebuff = false; weakBrimstoneFlames = false; aFlames = false; gsInferno = false; @@ -2171,6 +2173,7 @@ namespace CalamityMod.CalPlayer aCrunch = false; irradiated = false; bFlames = false; + witheredDebuff = false; weakBrimstoneFlames = false; aFlames = false; gsInferno = false; @@ -4827,10 +4830,13 @@ namespace CalamityMod.CalPlayer if (player.whoAmI != Main.myPlayer) return; + if (witheringWeaponEnchant) + witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); + switch (item.type) { case ItemID.CobaltSword: - target.defense = (int)(target.defDefense * 0.9); + target.Calamity().miscDefenseLoss = (int)(target.defense * 0.25); break; case ItemID.PalladiumSword: @@ -4910,9 +4916,6 @@ namespace CalamityMod.CalPlayer break; } - if (item.type == ModContent.ItemType()) - target.damage = (int)(target.defDamage * 0.9); - CalamityPlayerOnHit.ItemLifesteal(player, mod, target, item, damage); CalamityPlayerOnHit.ItemOnHit(player, mod, item, damage, target.Center, crit, (target.damage > 5 || target.boss) && !target.SpawnedFromStatue); CalamityPlayerOnHit.NPCDebuffs(player, mod, target, item.melee, item.ranged, item.magic, item.summon, item.Calamity().rogue, false); @@ -4931,11 +4934,14 @@ namespace CalamityMod.CalPlayer if (player.whoAmI != Main.myPlayer) return; + if (witheringWeaponEnchant) + witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); + switch (proj.type) { case ProjectileID.CobaltNaginata: - target.defense = (int)(target.defDefense * 0.9); - break; + target.Calamity().miscDefenseLoss = (int)(target.defense * 0.25); + break; case ProjectileID.PalladiumPike: if (!target.canGhostHeal || player.moonLeech) @@ -4967,9 +4973,14 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.TheRottedFork: + case ProjectileID.TheMeatball: target.AddBuff(ModContent.BuffType(), 60); break; + case ProjectileID.BallOHurt: + target.AddBuff(BuffID.ShadowFlame, 60); + break; + case ProjectileID.ObsidianSwordfish: target.AddBuff(BuffID.OnFire, 180); break; @@ -5042,9 +5053,6 @@ namespace CalamityMod.CalPlayer break; } - if (proj.type == ModContent.ProjectileType()) - target.damage = (int)(target.defDamage * 0.9); - if (ProjectileID.Sets.StardustDragon[proj.type]) target.immune[proj.owner] = 10; @@ -5263,6 +5271,10 @@ namespace CalamityMod.CalPlayer { damageMult += 1.25; } + + if (witheredDebuff) + damageMult += 0.6; + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { CalamityUtils.ApplyRippersToDamage(this, ref damageMult); @@ -5385,7 +5397,9 @@ namespace CalamityMod.CalPlayer if (enraged) damageMult += 1.25; - if (proj.type == ProjectileID.InfernoFriendlyBlast) + // Calamity buffs Inferno Fork by 33%. + // However, because the weapon is coded like spaghetti, you have to multiply the explosion's damage too. + if (proj.type == ProjectileID.InfernoFriendlyBlast) damageMult += 0.33; if (brimflameFrenzy && brimflameSet) @@ -5394,6 +5408,9 @@ namespace CalamityMod.CalPlayer damageMult += 0.3; } + if (witheredDebuff) + damageMult += 0.6; + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) CalamityUtils.ApplyRippersToDamage(this, ref damageMult); @@ -7403,7 +7420,19 @@ namespace CalamityMod.CalPlayer player.HealEffect(healAmt); } - if (CalamityConfig.Instance.Rippers && CalamityWorld.revenge) + if (witheringDamageDone > 0) + { + double healCompenstationRatio = Math.Log(witheringDamageDone) * Math.Pow(witheringDamageDone, 2D / 3D) / 177000D; + if (healCompenstationRatio > 1D) + healCompenstationRatio = 1D; + int healCompensation = (int)(healCompenstationRatio * damage); + player.statLife += (int)(healCompenstationRatio * damage); + player.HealEffect(healCompensation); + player.AddBuff(ModContent.BuffType(), 1080); + witheringDamageDone = 0; + } + + if (CalamityConfig.Instance.Rippers && CalamityWorld.revenge) { if (!adrenalineModeActive && damage > 0) // To prevent paladin's shield ruining adren even with 0 dmg taken { @@ -10093,48 +10122,48 @@ namespace CalamityMod.CalPlayer #region MeleeLevelBoosts if (meleeLevel >= 12500) { - player.meleeDamage += 0.12f; - player.meleeCrit += 6; + player.meleeDamage += 0.06f; + player.meleeCrit += 3; } else if (meleeLevel >= 10500) - { - player.meleeDamage += 0.1f; - player.meleeCrit += 5; - } - else if (meleeLevel >= 9100) - { - player.meleeDamage += 0.09f; - player.meleeCrit += 5; - } - else if (meleeLevel >= 7800) - { - player.meleeDamage += 0.08f; - player.meleeCrit += 4; - } - else if (meleeLevel >= 6600) - { - player.meleeDamage += 0.07f; - player.meleeCrit += 4; - } - else if (meleeLevel >= 5500) //hm limit { player.meleeDamage += 0.06f; player.meleeCrit += 3; } - else if (meleeLevel >= 4500) + else if (meleeLevel >= 9100) + { + player.meleeDamage += 0.06f; + player.meleeCrit += 3; + } + else if (meleeLevel >= 7800) { player.meleeDamage += 0.05f; player.meleeCrit += 3; } - else if (meleeLevel >= 3600) + else if (meleeLevel >= 6600) { player.meleeDamage += 0.05f; + player.meleeCrit += 3; + } + else if (meleeLevel >= 5500) //hm limit + { + player.meleeDamage += 0.05f; + player.meleeCrit += 2; + } + else if (meleeLevel >= 4500) + { + player.meleeDamage += 0.05f; + player.meleeCrit += 2; + } + else if (meleeLevel >= 3600) + { + player.meleeDamage += 0.04f; player.meleeCrit += 2; } else if (meleeLevel >= 2800) { player.meleeDamage += 0.04f; - player.meleeCrit += 2; + player.meleeCrit += 1; } else if (meleeLevel >= 2100) { @@ -10148,7 +10177,7 @@ namespace CalamityMod.CalPlayer } else if (meleeLevel >= 1000) { - player.meleeDamage += 0.03f; + player.meleeDamage += 0.02f; player.meleeCrit += 1; } else if (meleeLevel >= 600) @@ -10164,73 +10193,73 @@ namespace CalamityMod.CalPlayer #region RangedLevelBoosts if (rangedLevel >= 12500) { - player.rangedDamage += 0.12f; + player.rangedDamage += 0.06f; player.moveSpeed += 0.06f; - player.rangedCrit += 6; + player.rangedCrit += 3; } else if (rangedLevel >= 10500) { - player.rangedDamage += 0.1f; - player.moveSpeed += 0.05f; - player.rangedCrit += 5; + player.rangedDamage += 0.05f; + player.moveSpeed += 0.06f; + player.rangedCrit += 3; } else if (rangedLevel >= 9100) { - player.rangedDamage += 0.09f; - player.moveSpeed += 0.04f; - player.rangedCrit += 5; + player.rangedDamage += 0.05f; + player.moveSpeed += 0.05f; + player.rangedCrit += 3; } else if (rangedLevel >= 7800) { - player.rangedDamage += 0.08f; - player.moveSpeed += 0.04f; - player.rangedCrit += 4; + player.rangedDamage += 0.04f; + player.moveSpeed += 0.05f; + player.rangedCrit += 3; } else if (rangedLevel >= 6600) { - player.rangedDamage += 0.07f; - player.moveSpeed += 0.03f; - player.rangedCrit += 4; + player.rangedDamage += 0.04f; + player.moveSpeed += 0.04f; + player.rangedCrit += 3; } else if (rangedLevel >= 5500) { - player.rangedDamage += 0.06f; - player.moveSpeed += 0.03f; - player.rangedCrit += 3; + player.rangedDamage += 0.04f; + player.moveSpeed += 0.04f; + player.rangedCrit += 2; } else if (rangedLevel >= 4500) { - player.rangedDamage += 0.05f; - player.moveSpeed += 0.02f; - player.rangedCrit += 3; + player.rangedDamage += 0.03f; + player.moveSpeed += 0.04f; + player.rangedCrit += 2; } else if (rangedLevel >= 3600) { - player.rangedDamage += 0.05f; - player.moveSpeed += 0.02f; + player.rangedDamage += 0.03f; + player.moveSpeed += 0.03f; player.rangedCrit += 2; } else if (rangedLevel >= 2800) { - player.rangedDamage += 0.04f; - player.moveSpeed += 0.02f; + player.rangedDamage += 0.02f; + player.moveSpeed += 0.03f; player.rangedCrit += 2; } else if (rangedLevel >= 2100) { - player.rangedDamage += 0.04f; - player.moveSpeed += 0.01f; + player.rangedDamage += 0.02f; + player.moveSpeed += 0.03f; player.rangedCrit += 1; } else if (rangedLevel >= 1500) { - player.rangedDamage += 0.03f; - player.moveSpeed += 0.01f; + player.rangedDamage += 0.02f; + player.moveSpeed += 0.02f; player.rangedCrit += 1; } else if (rangedLevel >= 1000) { - player.rangedDamage += 0.03f; + player.rangedDamage += 0.02f; player.moveSpeed += 0.01f; player.rangedCrit += 1; } @@ -10247,74 +10276,74 @@ namespace CalamityMod.CalPlayer #region MagicLevelBoosts if (magicLevel >= 12500) - { - player.magicDamage += 0.12f; - player.manaCost *= 0.88f; - player.magicCrit += 6; - } - else if (magicLevel >= 10500) - { - player.magicDamage += 0.1f; - player.manaCost *= 0.9f; - player.magicCrit += 5; - } - else if (magicLevel >= 9100) - { - player.magicDamage += 0.09f; - player.manaCost *= 0.91f; - player.magicCrit += 5; - } - else if (magicLevel >= 7800) - { - player.magicDamage += 0.08f; - player.manaCost *= 0.92f; - player.magicCrit += 4; - } - else if (magicLevel >= 6600) - { - player.magicDamage += 0.07f; - player.manaCost *= 0.93f; - player.magicCrit += 4; - } - else if (magicLevel >= 5500) { player.magicDamage += 0.06f; player.manaCost *= 0.94f; player.magicCrit += 3; } - else if (magicLevel >= 4500) + else if (magicLevel >= 10500) + { + player.magicDamage += 0.05f; + player.manaCost *= 0.94f; + player.magicCrit += 3; + } + else if (magicLevel >= 9100) { player.magicDamage += 0.05f; player.manaCost *= 0.95f; player.magicCrit += 3; } - else if (magicLevel >= 3600) + else if (magicLevel >= 7800) { - player.magicDamage += 0.05f; + player.magicDamage += 0.04f; player.manaCost *= 0.95f; - player.magicCrit += 2; + player.magicCrit += 3; } - else if (magicLevel >= 2800) + else if (magicLevel >= 6600) + { + player.magicDamage += 0.04f; + player.manaCost *= 0.96f; + player.magicCrit += 3; + } + else if (magicLevel >= 5500) { player.magicDamage += 0.04f; player.manaCost *= 0.96f; player.magicCrit += 2; } - else if (magicLevel >= 2100) + else if (magicLevel >= 4500) { player.magicDamage += 0.04f; player.manaCost *= 0.97f; - player.magicCrit += 1; + player.magicCrit += 2; } - else if (magicLevel >= 1500) + else if (magicLevel >= 3600) + { + player.magicDamage += 0.03f; + player.manaCost *= 0.97f; + player.magicCrit += 2; + } + else if (magicLevel >= 2800) + { + player.magicDamage += 0.03f; + player.manaCost *= 0.98f; + player.magicCrit += 2; + } + else if (magicLevel >= 2100) { player.magicDamage += 0.03f; player.manaCost *= 0.98f; player.magicCrit += 1; } + else if (magicLevel >= 1500) + { + player.magicDamage += 0.02f; + player.manaCost *= 0.98f; + player.magicCrit += 1; + } else if (magicLevel >= 1000) { - player.magicDamage += 0.03f; + player.magicDamage += 0.02f; player.manaCost *= 0.99f; player.magicCrit += 1; } @@ -10334,43 +10363,36 @@ namespace CalamityMod.CalPlayer { player.minionDamage += 0.12f; player.minionKB += 3.0f; - player.maxMinions += 2; } else if (summonLevel >= 10500) { player.minionDamage += 0.1f; player.minionKB += 3.0f; - player.maxMinions++; } else if (summonLevel >= 9100) { player.minionDamage += 0.09f; player.minionKB += 2.7f; - player.maxMinions++; } else if (summonLevel >= 7800) { player.minionDamage += 0.08f; player.minionKB += 2.4f; - player.maxMinions++; } else if (summonLevel >= 6600) { player.minionDamage += 0.07f; player.minionKB += 2.1f; - player.maxMinions++; } else if (summonLevel >= 5500) { - player.minionDamage += 0.06f; + player.minionDamage += 0.07f; player.minionKB += 1.8f; - player.maxMinions++; } else if (summonLevel >= 4500) { player.minionDamage += 0.06f; player.minionKB += 1.8f; - player.maxMinions++; } else if (summonLevel >= 3600) { @@ -10410,74 +10432,74 @@ namespace CalamityMod.CalPlayer #region RogueLevelBoosts if (rogueLevel >= 12500) - { - throwingDamage += 0.12f; - throwingVelocity += 0.12f; - throwingCrit += 6; - } - else if (rogueLevel >= 10500) - { - throwingDamage += 0.1f; - throwingVelocity += 0.1f; - throwingCrit += 5; - } - else if (rogueLevel >= 9100) - { - throwingDamage += 0.09f; - throwingVelocity += 0.09f; - throwingCrit += 5; - } - else if (rogueLevel >= 7800) - { - throwingDamage += 0.08f; - throwingVelocity += 0.08f; - throwingCrit += 4; - } - else if (rogueLevel >= 6600) - { - throwingDamage += 0.07f; - throwingVelocity += 0.07f; - throwingCrit += 4; - } - else if (rogueLevel >= 5500) { throwingDamage += 0.06f; throwingVelocity += 0.06f; throwingCrit += 3; } - else if (rogueLevel >= 4500) + else if (rogueLevel >= 10500) + { + throwingDamage += 0.05f; + throwingVelocity += 0.06f; + throwingCrit += 3; + } + else if (rogueLevel >= 9100) { throwingDamage += 0.05f; throwingVelocity += 0.05f; throwingCrit += 3; } - else if (rogueLevel >= 3600) + else if (rogueLevel >= 7800) { - throwingDamage += 0.05f; + throwingDamage += 0.04f; throwingVelocity += 0.05f; - throwingCrit += 2; + throwingCrit += 3; } - else if (rogueLevel >= 2800) + else if (rogueLevel >= 6600) + { + throwingDamage += 0.04f; + throwingVelocity += 0.04f; + throwingCrit += 3; + } + else if (rogueLevel >= 5500) { throwingDamage += 0.04f; throwingVelocity += 0.04f; throwingCrit += 2; } + else if (rogueLevel >= 4500) + { + throwingDamage += 0.03f; + throwingVelocity += 0.04f; + throwingCrit += 2; + } + else if (rogueLevel >= 3600) + { + throwingDamage += 0.03f; + throwingVelocity += 0.03f; + throwingCrit += 2; + } + else if (rogueLevel >= 2800) + { + throwingDamage += 0.03f; + throwingVelocity += 0.03f; + throwingCrit += 1; + } else if (rogueLevel >= 2100) { - throwingDamage += 0.04f; + throwingDamage += 0.02f; throwingVelocity += 0.03f; throwingCrit += 1; } else if (rogueLevel >= 1500) { - throwingDamage += 0.03f; + throwingDamage += 0.02f; throwingVelocity += 0.02f; throwingCrit += 1; } else if (rogueLevel >= 1000) { - throwingDamage += 0.03f; + throwingDamage += 0.02f; throwingVelocity += 0.01f; throwingCrit += 1; } @@ -10498,47 +10520,47 @@ namespace CalamityMod.CalPlayer float meleeSpeedBonus = 0f; if (meleeLevel >= 12500) { - meleeSpeedBonus += 0.12f; + meleeSpeedBonus += 0.06f; } else if (meleeLevel >= 10500) { - meleeSpeedBonus += 0.1f; + meleeSpeedBonus += 0.05f; } else if (meleeLevel >= 9100) { - meleeSpeedBonus += 0.09f; + meleeSpeedBonus += 0.04f; } else if (meleeLevel >= 7800) { - meleeSpeedBonus += 0.08f; + meleeSpeedBonus += 0.04f; } else if (meleeLevel >= 6600) { - meleeSpeedBonus += 0.07f; + meleeSpeedBonus += 0.03f; } else if (meleeLevel >= 5500) //hm limit { - meleeSpeedBonus += 0.06f; + meleeSpeedBonus += 0.03f; } else if (meleeLevel >= 4500) { - meleeSpeedBonus += 0.05f; + meleeSpeedBonus += 0.02f; } else if (meleeLevel >= 3600) { - meleeSpeedBonus += 0.05f; + meleeSpeedBonus += 0.02f; } else if (meleeLevel >= 2800) { - meleeSpeedBonus += 0.04f; + meleeSpeedBonus += 0.02f; } else if (meleeLevel >= 2100) { - meleeSpeedBonus += 0.03f; + meleeSpeedBonus += 0.01f; } else if (meleeLevel >= 1500) //prehm limit { - meleeSpeedBonus += 0.02f; + meleeSpeedBonus += 0.01f; } else if (meleeLevel >= 1000) { diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 3dfb8137f3..e5221f2e72 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -410,6 +410,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; lifeRegenLost += 42; //the meaning of death } + if (modPlayer.witheredDebuff) { modPlayer.witheredWeaponHoldTime += modPlayer.witheringWeaponEnchant.ToDirectionInt(); @@ -419,7 +420,7 @@ namespace CalamityMod.CalPlayer } else { - lifeRegenLost += (int)(4D * Math.Pow(1.5D, modPlayer.witheredWeaponHoldTime / 87D)); + lifeRegenLost += (int)(5D * Math.Pow(1.5D, modPlayer.witheredWeaponHoldTime / 87D)); if (player.lifeRegen > 0) player.lifeRegen = 0; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b83e14bd8c..a7f76432d3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2569,7 +2569,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.irradiated) { - player.statDefense -= 10; + player.statDefense -= 10; player.moveSpeed -= 0.1f; player.allDamage += 0.05f; player.minionKB += 0.5f; diff --git a/CalamityLists.cs b/CalamityLists.cs index 20c225f816..bbea353b68 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -151,6 +151,7 @@ namespace CalamityMod public static List bossMinionList; public static List minibossList; public static List heartDropBlockList; + public static List pierceResistList; public static List legOverrideList; @@ -1151,14 +1152,17 @@ namespace CalamityMod ItemID.TrueExcalibur, ItemID.TrueNightsEdge, ItemID.TheHorsemansBlade, - ItemID.Keybrand + ItemID.Keybrand, + ItemID.PsychoKnife, + ItemID.BeeKeeper, + ItemID.ChristmasTreeSword, + ItemID.BoneSword }; twentyUseTimeBuffList = new List() { ItemID.CobaltSword, ItemID.PalladiumSword, - ItemID.MythrilSword, ItemID.OrichalcumSword, ItemID.AdamantiteSword, ItemID.TitaniumSword, @@ -1166,7 +1170,6 @@ namespace CalamityMod ItemID.Bladetongue, ItemID.Cutlass, ItemID.TheHorsemansBlade, - ItemID.Keybrand, ItemID.AdamantiteGlaive, ItemID.ChlorophytePartisan, ItemID.CobaltNaginata, @@ -1175,7 +1178,8 @@ namespace CalamityMod ItemID.OrichalcumHalberd, ItemID.PalladiumPike, ItemID.TitaniumTrident, - ItemID.MushroomSpear + ItemID.MushroomSpear, + ItemID.TaxCollectorsStickOfDoom }; fiftySizeBuffList = new List() @@ -1190,7 +1194,6 @@ namespace CalamityMod ItemID.OrichalcumSword, ItemID.TitaniumSword, ItemID.Excalibur, - ItemID.Bladetongue, ItemID.TheHorsemansBlade, ItemID.Keybrand, ItemID.SlapHand, @@ -1217,45 +1220,22 @@ namespace CalamityMod ItemID.PurplePhaseblade, ItemID.AntlionClaw, ItemID.DyeTradersScimitar, - ItemID.BoneSword + ItemID.BoneSword, + ItemID.TaxCollectorsStickOfDoom, + ItemID.PurpleClubberfish }; quadrupleDamageBuffList = new List() { - ItemID.SlapHand, - ItemID.PsychoKnife, - ItemID.TaxCollectorsStickOfDoom + ItemID.PsychoKnife }; tripleDamageBuffList = new List() { - ItemID.SpectreStaff, - ItemID.Anchor, + ItemID.SpectreStaff, ItemID.KOCannon, - ItemID.GolemFist, - ItemID.BreakerBlade, - ItemID.StylistKilLaKillScissorsIWish, - ItemID.BladeofGrass, - ItemID.FieryGreatsword, ItemID.NightsEdge, - ItemID.CobaltSword, - ItemID.MythrilSword, - ItemID.AdamantiteSword, - ItemID.PalladiumSword, - ItemID.OrichalcumSword, - ItemID.TitaniumSword, - ItemID.Excalibur, - ItemID.Bladetongue, - ItemID.TheHorsemansBlade, - ItemID.Keybrand, - ItemID.AdamantiteGlaive, - ItemID.ChlorophytePartisan, - ItemID.CobaltNaginata, - ItemID.Gungnir, - ItemID.MythrilHalberd, - ItemID.OrichalcumHalberd, - ItemID.PalladiumPike, - ItemID.TitaniumTrident + ItemID.PalladiumPike }; doubleDamageBuffList = new List() @@ -1264,7 +1244,6 @@ namespace CalamityMod ItemID.TheMeatball, ItemID.BlueMoon, ItemID.Sunfury, - ItemID.DaoofPow, ItemID.FlowerPow, ItemID.MonkStaffT2, ItemID.ProximityMineLauncher, @@ -1280,9 +1259,6 @@ namespace CalamityMod ItemID.Muramasa, ItemID.Spear, ItemID.Trident, - ItemID.TheRottedFork, - ItemID.Swordfish, - ItemID.DarkLance, ItemID.WoodenBoomerang, ItemID.EnchantedBoomerang, ItemID.IceBoomerang, @@ -1290,13 +1266,6 @@ namespace CalamityMod ItemID.ThornChakram, ItemID.Flamarang, ItemID.Cutlass, - ItemID.MushroomSpear, - ItemID.BluePhasesaber, - ItemID.RedPhasesaber, - ItemID.GreenPhasesaber, - ItemID.WhitePhasesaber, - ItemID.YellowPhasesaber, - ItemID.PurplePhasesaber, ItemID.BluePhaseblade, ItemID.RedPhaseblade, ItemID.GreenPhaseblade, @@ -1313,8 +1282,6 @@ namespace CalamityMod ItemID.TrueNightsEdge, ItemID.MedusaHead, ItemID.StaffofEarth, - ItemID.ChristmasTreeSword, - ItemID.MonkStaffT1, ItemID.InfernoFork, ItemID.Frostbrand, ItemID.BloodButcherer @@ -1328,7 +1295,6 @@ namespace CalamityMod ItemID.Flamethrower, ItemID.MoonlordTurretStaff, ItemID.WaspGun, - ItemID.PaladinsHammer, ItemID.SolarEruption, ItemID.DayBreak, ItemID.LunarFlareBook, @@ -1338,7 +1304,6 @@ namespace CalamityMod ItemID.TungstenBroadsword, ItemID.AntlionClaw, ItemID.Katana, - ItemID.FalconBlade, ItemID.Seedler }; @@ -1496,7 +1461,10 @@ namespace CalamityMod ItemID.GreenPhaseblade, ItemID.WhitePhaseblade, ItemID.YellowPhaseblade, - ItemID.PurplePhaseblade + ItemID.PurplePhaseblade, + ItemID.BladeofGrass, + ItemID.ChristmasTreeSword, + ItemID.ChainKnife //ItemID.StormSpear }; @@ -2145,7 +2113,6 @@ namespace CalamityMod ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), @@ -2526,6 +2493,54 @@ namespace CalamityMod NPCType() }; + pierceResistList = new List() + { + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.Creeper, + NPCID.TheDestroyer, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + }; + bossMinionList = new List() { NPCType(), @@ -2744,6 +2759,7 @@ namespace CalamityMod bossMinionList = null; minibossList = null; heartDropBlockList = null; + pierceResistList = null; legOverrideList = null; diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index adf8ec7167..3c4aea4405 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -126,6 +126,7 @@ namespace CalamityMod.ILEditing IncorporateMinionExplodingCountdown(); UseCoolFireCursorEffect(); MakeMouseHoverItemsSupportAnimations(); + IncorporateEnchantmentInAffix(); } /// @@ -500,10 +501,21 @@ namespace CalamityMod.ILEditing }; } + private static void IncorporateEnchantmentInAffix() + { + On.Terraria.Item.AffixName += (orig, self) => + { + string result = orig(self); + if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue) + result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}"; + return result; + }; + } + #endregion - #region IL Editing Injected/Hooked Functions - private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) + #region IL Editing Injected/Hooked Functions + private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) { orig(); foreach (int npcType in NeedsFourLifeBytes) diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index d96bc93ed9..e96f8d759d 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories Tooltip.SetDefault("Lights your mouse ablaze with a brimstone fire and causes a flaming aura to appear around it\n" + "Enemies near the aura take immense damage and are inflicted with Vulnerability Hex\n" + "The mouse fire effect can be shown without the aura and damage effects by putting this item in a vanity slot"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); } public override void SetDefaults() diff --git a/Items/Accessories/Calamity.png b/Items/Accessories/Calamity.png index f4f939e40b..16df4d3f9b 100644 Binary files a/Items/Accessories/Calamity.png and b/Items/Accessories/Calamity.png differ diff --git a/Items/Accessories/MagicLevelMeter.cs b/Items/Accessories/MagicLevelMeter.cs index 004bbd610a..cd7f579dae 100644 --- a/Items/Accessories/MagicLevelMeter.cs +++ b/Items/Accessories/MagicLevelMeter.cs @@ -45,64 +45,64 @@ namespace CalamityMod.Items.Accessories manaUsage = 1; break; case 4: - damageGain = 3; + damageGain = 2; manaUsage = 1; critGain = 1; break; case 5: - damageGain = 3; + damageGain = 2; manaUsage = 2; critGain = 1; break; case 6: - damageGain = 4; - manaUsage = 3; + damageGain = 3; + manaUsage = 2; critGain = 1; break; case 7: + damageGain = 3; + manaUsage = 2; + critGain = 2; + break; + case 8: + damageGain = 3; + manaUsage = 3; + critGain = 2; + break; + case 9: + damageGain = 4; + manaUsage = 3; + critGain = 2; + break; + case 10: damageGain = 4; manaUsage = 4; critGain = 2; break; - case 8: - damageGain = 5; - manaUsage = 5; - critGain = 2; + case 11: + damageGain = 4; + manaUsage = 4; + critGain = 3; break; - case 9: + case 12: + damageGain = 4; + manaUsage = 5; + critGain = 3; + break; + case 13: damageGain = 5; manaUsage = 5; critGain = 3; break; - case 10: - damageGain = 6; + case 14: + damageGain = 5; manaUsage = 6; critGain = 3; break; - case 11: - damageGain = 7; - manaUsage = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - manaUsage = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - manaUsage = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - manaUsage = 10; - critGain = 5; - break; case 15: - damageGain = 12; - manaUsage = 12; - critGain = 6; + damageGain = 6; + manaUsage = 6; + critGain = 3; break; } foreach (TooltipLine line2 in list) diff --git a/Items/Accessories/MeleeLevelMeter.cs b/Items/Accessories/MeleeLevelMeter.cs index eeb21d6a4d..4e93b1a7dc 100644 --- a/Items/Accessories/MeleeLevelMeter.cs +++ b/Items/Accessories/MeleeLevelMeter.cs @@ -45,65 +45,65 @@ namespace CalamityMod.Items.Accessories meleeSpeed = 1; break; case 4: - damageGain = 3; + damageGain = 2; meleeSpeed = 1; critGain = 1; break; case 5: damageGain = 3; - meleeSpeed = 2; + meleeSpeed = 1; critGain = 1; break; case 6: damageGain = 4; - meleeSpeed = 3; + meleeSpeed = 1; critGain = 1; break; case 7: damageGain = 4; - meleeSpeed = 4; - critGain = 2; + meleeSpeed = 2; + critGain = 1; break; case 8: - damageGain = 5; - meleeSpeed = 5; + damageGain = 4; + meleeSpeed = 2; critGain = 2; break; case 9: damageGain = 5; + meleeSpeed = 2; + critGain = 2; + break; + case 10: + damageGain = 5; + meleeSpeed = 3; + critGain = 2; + break; + case 11: + damageGain = 5; + meleeSpeed = 3; + critGain = 3; + break; + case 12: + damageGain = 5; + meleeSpeed = 4; + critGain = 3; + break; + case 13: + damageGain = 6; + meleeSpeed = 4; + critGain = 3; + break; + case 14: + damageGain = 6; meleeSpeed = 5; critGain = 3; break; - case 10: + case 15: damageGain = 6; meleeSpeed = 6; critGain = 3; break; - case 11: - damageGain = 7; - meleeSpeed = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - meleeSpeed = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - meleeSpeed = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - meleeSpeed = 10; - critGain = 5; - break; - case 15: - damageGain = 12; - meleeSpeed = 12; - critGain = 6; - break; } foreach (TooltipLine line2 in list) { diff --git a/Items/Accessories/RangedLevelMeter.cs b/Items/Accessories/RangedLevelMeter.cs index 73f5fe0240..2f77a86eb4 100644 --- a/Items/Accessories/RangedLevelMeter.cs +++ b/Items/Accessories/RangedLevelMeter.cs @@ -45,64 +45,64 @@ namespace CalamityMod.Items.Accessories critGain = 1; break; case 4: - damageGain = 3; - critGain = 1; - moveSpeed = 1; + damageGain = 2; + moveSpeed = 1; + critGain = 1; break; case 5: - damageGain = 3; - moveSpeed = 1; + damageGain = 2; + moveSpeed = 2; critGain = 1; break; case 6: - damageGain = 4; - moveSpeed = 1; + damageGain = 2; + moveSpeed = 3; critGain = 1; break; case 7: - damageGain = 4; - moveSpeed = 2; + damageGain = 2; + moveSpeed = 3; critGain = 2; break; case 8: - damageGain = 5; - moveSpeed = 2; + damageGain = 3; + moveSpeed = 3; critGain = 2; break; case 9: - damageGain = 5; - moveSpeed = 2; - critGain = 3; + damageGain = 3; + moveSpeed = 4; + critGain = 2; break; case 10: - damageGain = 6; - moveSpeed = 3; - critGain = 3; + damageGain = 4; + moveSpeed = 4; + critGain = 2; break; case 11: - damageGain = 7; - moveSpeed = 3; - critGain = 4; + damageGain = 4; + moveSpeed = 4; + critGain = 3; break; case 12: - damageGain = 8; - moveSpeed = 4; - critGain = 4; + damageGain = 4; + moveSpeed = 5; + critGain = 3; break; case 13: - damageGain = 9; - moveSpeed = 4; - critGain = 5; + damageGain = 5; + moveSpeed = 5; + critGain = 3; break; case 14: - damageGain = 10; - moveSpeed = 5; - critGain = 5; + damageGain = 5; + moveSpeed = 6; + critGain = 3; break; case 15: - damageGain = 12; + damageGain = 6; moveSpeed = 6; - critGain = 6; + critGain = 3; break; } foreach (TooltipLine line2 in list) diff --git a/Items/Accessories/RogueLevelMeter.cs b/Items/Accessories/RogueLevelMeter.cs index e90a840331..824d973d79 100644 --- a/Items/Accessories/RogueLevelMeter.cs +++ b/Items/Accessories/RogueLevelMeter.cs @@ -45,64 +45,64 @@ namespace CalamityMod.Items.Accessories velocityGain = 1; break; case 4: - damageGain = 3; - critGain = 1; - velocityGain = 1; + damageGain = 2; + velocityGain = 1; + critGain = 1; break; case 5: - damageGain = 3; + damageGain = 2; velocityGain = 2; critGain = 1; break; case 6: - damageGain = 4; + damageGain = 2; velocityGain = 3; critGain = 1; break; case 7: + damageGain = 3; + velocityGain = 3; + critGain = 1; + break; + case 8: + damageGain = 3; + velocityGain = 3; + critGain = 2; + break; + case 9: + damageGain = 3; + velocityGain = 4; + critGain = 2; + break; + case 10: damageGain = 4; velocityGain = 4; critGain = 2; break; - case 8: - damageGain = 5; - velocityGain = 5; - critGain = 2; + case 11: + damageGain = 4; + velocityGain = 4; + critGain = 3; break; - case 9: + case 12: + damageGain = 4; + velocityGain = 5; + critGain = 3; + break; + case 13: damageGain = 5; velocityGain = 5; critGain = 3; break; - case 10: - damageGain = 6; + case 14: + damageGain = 5; velocityGain = 6; critGain = 3; break; - case 11: - damageGain = 7; - velocityGain = 7; - critGain = 4; - break; - case 12: - damageGain = 8; - velocityGain = 8; - critGain = 4; - break; - case 13: - damageGain = 9; - velocityGain = 9; - critGain = 5; - break; - case 14: - damageGain = 10; - velocityGain = 10; - critGain = 5; - break; case 15: - damageGain = 12; - velocityGain = 12; - critGain = 6; + damageGain = 6; + velocityGain = 6; + critGain = 3; break; } foreach (TooltipLine line2 in list) diff --git a/Items/Accessories/SummonLevelMeter.cs b/Items/Accessories/SummonLevelMeter.cs index 38198fe849..bfca6a8561 100644 --- a/Items/Accessories/SummonLevelMeter.cs +++ b/Items/Accessories/SummonLevelMeter.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Accessories int exactLevel = Main.player[Main.myPlayer].Calamity().exactSummonLevel; int damageGain = 0; int minionKB = 0; - int minionSlots = 0; switch (exactLevel) { case 0: @@ -67,37 +66,30 @@ namespace CalamityMod.Items.Accessories case 9: damageGain = 6; minionKB = 180; - minionSlots = 1; break; case 10: - damageGain = 6; + damageGain = 7; minionKB = 180; - minionSlots = 1; break; case 11: damageGain = 7; minionKB = 210; - minionSlots = 1; break; case 12: damageGain = 8; minionKB = 240; - minionSlots = 1; break; case 13: damageGain = 9; minionKB = 270; - minionSlots = 1; break; case 14: damageGain = 10; minionKB = 300; - minionSlots = 1; break; case 15: damageGain = 12; minionKB = 300; - minionSlots = 2; break; } foreach (TooltipLine line2 in list) @@ -106,12 +98,11 @@ namespace CalamityMod.Items.Accessories { line2.text = "Tells you how high your summon proficiency is\n" + "While equipped you will gain summon proficiency faster\n" + - "The higher your summon level the higher your minion damage, knockback, and slots\n" + + "The higher your summon level the higher your minion damage and knockback\n" + "Summon proficiency (max of 12500): " + (level - (level > 12500 ? 1 : 0)) + "\n" + "Summon level (max of 15): " + exactLevel + "\n" + "Minion damage increase: " + damageGain + "%\n" + - "Minion knockback increase: " + minionKB + "%\n" + - "Minion slot increase: " + minionSlots; + "Minion knockback increase: " + minionKB; } } } diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 59c452eddd..cc89ef06c3 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Armor player.setBonus = "Summoner Tarragon, Bloodflare and Silva armor effects\n" + "All projectiles spawn healing auric orbs on enemy hits\n" + "Max run speed and acceleration boosted by 10%\n" + - "+8 max minions and 90% increased minion damage"; + "+6 max minions and 90% increased minion damage"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraSummon = true; @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Armor player.ignoreWater = true; player.crimsonRegen = true; player.minionDamage += 0.9f; - player.maxMinions += 8; + player.maxMinions += 6; if (player.lavaWet) { player.statDefense += 30; diff --git a/Items/Armor/Vanity/AshenHorns.cs b/Items/Armor/Vanity/AshenHorns.cs new file mode 100644 index 0000000000..ef4b0359fe --- /dev/null +++ b/Items/Armor/Vanity/AshenHorns.cs @@ -0,0 +1,24 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class AshenHorns : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Ashen Horns"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = true; + } + } +} diff --git a/Items/Armor/Vanity/AshenHorns.png b/Items/Armor/Vanity/AshenHorns.png new file mode 100644 index 0000000000..0085c11cf3 Binary files /dev/null and b/Items/Armor/Vanity/AshenHorns.png differ diff --git a/Items/Armor/Vanity/AshenHorns_Head.png b/Items/Armor/Vanity/AshenHorns_Head.png new file mode 100644 index 0000000000..12cc0083ee Binary files /dev/null and b/Items/Armor/Vanity/AshenHorns_Head.png differ diff --git a/Items/Armor/Vanity/SCalBoots.cs b/Items/Armor/Vanity/SCalBoots.cs new file mode 100644 index 0000000000..5557bb0bdc --- /dev/null +++ b/Items/Armor/Vanity/SCalBoots.cs @@ -0,0 +1,19 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Legs)] + public class SCalBoots : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Boots"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + } +} diff --git a/Items/Armor/Vanity/SCalBoots.png b/Items/Armor/Vanity/SCalBoots.png new file mode 100644 index 0000000000..2c4283bcd3 Binary files /dev/null and b/Items/Armor/Vanity/SCalBoots.png differ diff --git a/Items/Armor/Vanity/SCalBoots_Legs.png b/Items/Armor/Vanity/SCalBoots_Legs.png new file mode 100644 index 0000000000..867d3c73ea Binary files /dev/null and b/Items/Armor/Vanity/SCalBoots_Legs.png differ diff --git a/Items/Armor/Vanity/SCalMask.cs b/Items/Armor/Vanity/SCalMask.cs new file mode 100644 index 0000000000..b5776465da --- /dev/null +++ b/Items/Armor/Vanity/SCalMask.cs @@ -0,0 +1,21 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class SCalMask : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Hood"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + + public override bool DrawHead() => false; + } +} diff --git a/Items/Armor/Vanity/SCalMask.png b/Items/Armor/Vanity/SCalMask.png new file mode 100644 index 0000000000..bdb80ee25a Binary files /dev/null and b/Items/Armor/Vanity/SCalMask.png differ diff --git a/Items/Armor/Vanity/SCalMask_Head.png b/Items/Armor/Vanity/SCalMask_Head.png new file mode 100644 index 0000000000..818608cb43 Binary files /dev/null and b/Items/Armor/Vanity/SCalMask_Head.png differ diff --git a/Items/Armor/Vanity/SCalRobes.cs b/Items/Armor/Vanity/SCalRobes.cs new file mode 100644 index 0000000000..912ca647e9 --- /dev/null +++ b/Items/Armor/Vanity/SCalRobes.cs @@ -0,0 +1,19 @@ +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Body)] + public class SCalRobes : ModItem + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Calamitous Robes"); + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = ItemRarityID.Blue; + item.vanity = true; + } + } +} diff --git a/Items/Armor/Vanity/SCalRobes.png b/Items/Armor/Vanity/SCalRobes.png new file mode 100644 index 0000000000..3ddf36518f Binary files /dev/null and b/Items/Armor/Vanity/SCalRobes.png differ diff --git a/Items/Armor/Vanity/SCalRobes_Arms.png b/Items/Armor/Vanity/SCalRobes_Arms.png new file mode 100644 index 0000000000..9e678c9974 Binary files /dev/null and b/Items/Armor/Vanity/SCalRobes_Arms.png differ diff --git a/Items/Armor/Vanity/SCalRobes_Body.png b/Items/Armor/Vanity/SCalRobes_Body.png new file mode 100644 index 0000000000..facccaeb4b Binary files /dev/null and b/Items/Armor/Vanity/SCalRobes_Body.png differ diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index fedf738286..87574c2767 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -79,6 +79,7 @@ namespace CalamityMod.Items public bool donorItem = false; public bool devItem = false; public bool challengeDrop = false; + public bool canFirePointBlankShots = false; public static readonly Color[] ExoPalette = new Color[] { @@ -123,19 +124,9 @@ namespace CalamityMod.Items if (customRarity.IsPostML() && item.rare != ItemRarityID.Purple) item.rare = ItemRarityID.Purple; - if (item.maxStack == 99 || item.type == ItemID.Dynamite || item.type == ItemID.StickyDynamite || - item.type == ItemID.BouncyDynamite || item.type == ItemID.StickyBomb || item.type == ItemID.BouncyBomb) + if (item.maxStack == 99) item.maxStack = 999; - if (item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe) - item.maxStack = 20; - - if (item.type == ItemID.CelestialSigil) - item.maxStack = 1; - - if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) - item.value = Item.buyPrice(0, 0, 5, 0); - if (CalamityLists.useTurnList?.Contains(item.type) ?? false) item.useTurn = true; @@ -151,16 +142,403 @@ namespace CalamityMod.Items item.useAnimation = (int)(item.useAnimation * 0.8); } + switch (item.type) + { + // Point-blank shot weapons + case ItemID.WoodenBow: + case ItemID.BorealWoodBow: + case ItemID.PalmWoodBow: + case ItemID.RichMahoganyBow: + case ItemID.CopperBow: + case ItemID.TinBow: + case ItemID.ShadewoodBow: + case ItemID.EbonwoodBow: + case ItemID.IronBow: + case ItemID.LeadBow: + case ItemID.SilverBow: + case ItemID.TungstenBow: + case ItemID.GoldBow: + case ItemID.PlatinumBow: + case ItemID.DemonBow: + case ItemID.TendonBow: + case ItemID.MoltenFury: + case ItemID.BeesKnees: + case ItemID.HellwingBow: + case ItemID.FlareGun: + case ItemID.Minishark: + case ItemID.Blowpipe: + case ItemID.FlintlockPistol: + case ItemID.SnowballCannon: + case ItemID.Boomstick: + case ItemID.Revolver: + case ItemID.RedRyder: + case ItemID.Sandgun: + case ItemID.Musket: + case ItemID.TheUndertaker: + case ItemID.Blowgun: + //case ItemID.QuadBarrelShotgun: + case ItemID.Handgun: + case ItemID.PhoenixBlaster: + case ItemID.PainterPaintballGun: + case ItemID.Harpoon: + case ItemID.IceBow: + case ItemID.ShadowFlameBow: + case ItemID.Marrow: + case ItemID.PulseBow: + case ItemID.DD2PhoenixBow: + case ItemID.Tsunami: + //case ItemID.Eventide: + case ItemID.Phantasm: + case ItemID.CobaltRepeater: + case ItemID.PalladiumRepeater: + case ItemID.MythrilRepeater: + case ItemID.OrichalcumRepeater: + case ItemID.AdamantiteRepeater: + case ItemID.TitaniumRepeater: + case ItemID.HallowedRepeater: + case ItemID.ChlorophyteShotbow: + case ItemID.StakeLauncher: + case ItemID.ClockworkAssaultRifle: + case ItemID.Gatligator: + case ItemID.Shotgun: + case ItemID.OnyxBlaster: + case ItemID.Uzi: + case ItemID.DartRifle: + case ItemID.DartPistol: + case ItemID.Megashark: + case ItemID.VenusMagnum: + case ItemID.TacticalShotgun: + case ItemID.SniperRifle: + case ItemID.CandyCornRifle: + case ItemID.ChainGun: + case ItemID.VortexBeater: + case ItemID.SDMG: + canFirePointBlankShots = true; + break; + + case ItemID.Dynamite: + case ItemID.StickyDynamite: + case ItemID.BouncyDynamite: + case ItemID.StickyBomb: + case ItemID.BouncyBomb: + item.maxStack = 999; + break; + + case ItemID.BlueSolution: + case ItemID.DarkBlueSolution: + case ItemID.GreenSolution: + case ItemID.PurpleSolution: + case ItemID.RedSolution: + item.value = Item.buyPrice(0, 0, 5, 0); + break; + + // Increase Pirate Map and Snow Globe stacks to 20 + case ItemID.PirateMap: + case ItemID.SnowGlobe: + item.maxStack = 20; + break; + + // Set Celestial Sigil stack to 1 because it's not consumable anymore + case ItemID.CelestialSigil: + item.maxStack = 1; + item.consumable = false; + break; + + // True melee weapon adjustments + case ItemID.SlapHand: + item.damage = 120; + break; + + case ItemID.TaxCollectorsStickOfDoom: + item.damage = 70; + break; + + case ItemID.Anchor: + item.damage = 107; + break; + + case ItemID.GolemFist: + item.damage = 185; + break; + + case ItemID.BreakerBlade: + item.damage = 97; + break; + + case ItemID.StylistKilLaKillScissorsIWish: + item.damage = 33; + break; + + case ItemID.BladeofGrass: + item.damage = 65; + break; + + case ItemID.FieryGreatsword: + item.damage = 98; + item.useTime = 45; + item.useAnimation = 45; + break; + + case ItemID.CobaltSword: + item.damage = 80; + break; + + case ItemID.MythrilSword: + item.damage = 100; + item.useTime = 25; + item.useAnimation = 25; + break; + + case ItemID.AdamantiteSword: + item.damage = 77; + break; + + case ItemID.PalladiumSword: + item.damage = 100; + break; + + case ItemID.OrichalcumSword: + item.damage = 82; + break; + + case ItemID.TitaniumSword: + item.damage = 77; + break; + + case ItemID.Excalibur: + item.damage = 125; + break; + + case ItemID.Bladetongue: + item.damage = 120; + item.scale = 1.75f; + break; + + case ItemID.TheHorsemansBlade: + item.damage = 95; + break; + + case ItemID.Keybrand: + item.damage = 184; + item.useTime = 18; + item.useAnimation = 18; + break; + + case ItemID.AdamantiteGlaive: + item.damage = 65; + item.shootSpeed *= 1.25f; + break; + + case ItemID.ChlorophytePartisan: + item.damage = 100; + break; + + case ItemID.CobaltNaginata: + item.damage = 90; + break; + + case ItemID.Gungnir: + item.damage = 92; + item.shootSpeed *= 1.25f; + break; + + case ItemID.MythrilHalberd: + item.damage = 95; + item.shootSpeed *= 1.25f; + break; + + case ItemID.OrichalcumHalberd: + item.damage = 98; + item.shootSpeed *= 1.25f; + break; + + case ItemID.TitaniumTrident: + item.damage = 72; + item.shootSpeed *= 1.25f; + break; + + case ItemID.DaoofPow: + item.damage = 160; + break; + + case ItemID.TheRottedFork: + item.damage = 20; + break; + + case ItemID.Swordfish: + item.damage = 38; + break; + + case ItemID.DarkLance: + item.damage = 68; + break; + + case ItemID.MushroomSpear: + item.damage = 100; + break; + + case ItemID.BluePhasesaber: + case ItemID.RedPhasesaber: + case ItemID.GreenPhasesaber: + case ItemID.WhitePhasesaber: + case ItemID.YellowPhasesaber: + case ItemID.PurplePhasesaber: + item.damage = 72; + item.useTime = 20; + item.useAnimation = 20; + break; + + case ItemID.PaladinsHammer: + item.damage = 100; + break; + + case ItemID.Katana: + item.useTime = 15; + item.useAnimation = 15; + break; + + case ItemID.FalconBlade: + item.damage = 40; + break; + + case ItemID.ChainKnife: + item.damage = 14; + break; + + case ItemID.DD2SquireDemonSword: + item.damage = 110; + break; + + case ItemID.PurpleClubberfish: + item.damage = 45; + item.knockBack = 10f; + break; + + case ItemID.ChristmasTreeSword: + item.damage = 155; + break; + + case ItemID.MonkStaffT1: + item.damage = 110; + break; + + case ItemID.Terrarian: + item.damage = 352; + break; + + case ItemID.RainbowRod: + item.damage = 130; + break; + + case ItemID.BlizzardStaff: + item.damage = 41; + item.mana = 7; + break; + + case ItemID.LaserMachinegun: + item.damage = 39; + break; + + case ItemID.StardustDragonStaff: + item.damage = 20; + break; + + case ItemID.BookStaff: + item.mana = 10; + break; + + case ItemID.UnholyTrident: + item.mana = 14; + break; + + case ItemID.FrostStaff: + item.mana = 9; + break; + + case ItemID.BookofSkulls: + item.mana = 12; + break; + + // Total defense pre-buff = 78, Total defense post-buff = 94 + case ItemID.SolarFlareHelmet: + item.defense = 29; // 5 more defense + break; + + case ItemID.SolarFlareBreastplate: + item.defense = 41; // 7 more defense + break; + + case ItemID.SolarFlareLeggings: + item.defense = 24; // 4 more defense + break; + + // Total defense pre-buff = 7, Total defense post-buff = 15 + case ItemID.GladiatorHelmet: + item.defense = 3; // 1 more defense + break; + + case ItemID.GladiatorBreastplate: + item.defense = 5; // 2 more defense + break; + + case ItemID.GladiatorLeggings: + item.defense = 4; // 2 more defense + break; + + // Total defense pre-buff = 31, 50, 35, Total defense post-buff = 36, 55, 40 + case ItemID.HallowedPlateMail: + item.defense = 18; // 3 more defense + break; + + case ItemID.HallowedGreaves: + item.defense = 13; // 2 more defense + break; + + // Not Expert because ML drops it in Normal so that it can be used with the lore item + case ItemID.GravityGlobe: + item.expert = false; + item.rare = ItemRarityID.Red; + break; + + case ItemID.SuspiciousLookingTentacle: + item.expert = true; + break; + + case ItemID.PearlwoodHammer: + item.hammer += 35; // 80% hammer power + item.useAnimation = 20; + item.useTime = 15; + item.damage *= 4; + item.tileBoost += 1; + item.rare = ItemRarityID.LightRed; + break; + + case ItemID.PearlwoodBow: + item.useAnimation += 8; // 35 + item.useTime += 8; // 35 + item.shootSpeed += 3.4f; // 10f + item.knockBack += 1f; // 1f + item.rare = ItemRarityID.LightRed; + item.damage = (int)(item.damage * 2.1); + canFirePointBlankShots = true; + break; + + case ItemID.PearlwoodSword: + item.damage *= 4; + item.rare = ItemRarityID.LightRed; + break; + + case ItemID.StarCannon: + item.UseSound = null; + break; + } + if (CalamityLists.quadrupleDamageBuffList?.Contains(item.type) ?? false) item.damage *= 4; else if (CalamityLists.tripleDamageBuffList?.Contains(item.type) ?? false) item.damage *= 3; else if (CalamityLists.doubleDamageBuffList?.Contains(item.type) ?? false) item.damage *= 2; - else if (item.type == ItemID.Terrarian) - item.damage = (int)(item.damage * 1.85); - else if (item.type == ItemID.RainbowRod) - item.damage = (int)(item.damage * 1.75); else if (CalamityLists.sixtySixDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)(item.damage * 1.66); else if (CalamityLists.fiftyDamageBuffList?.Contains(item.type) ?? false) @@ -177,82 +555,12 @@ namespace CalamityMod.Items item.damage = (int)(item.damage * 0.9); else if (CalamityLists.quarterDamageNerfList?.Contains(item.type) ?? false) item.damage = (int)(item.damage * 0.75); - else if (item.type == ItemID.BlizzardStaff) - item.damage = (int)(item.damage * 0.7); - else if (item.type == ItemID.LaserMachinegun) - item.damage = (int)(item.damage * 0.65); - else if (item.type == ItemID.StardustDragonStaff) - item.damage = (int)(item.damage * 0.5); - - if (item.type == ItemID.BookStaff) - item.mana = 10; - else if (item.type == ItemID.UnholyTrident) - item.mana = 14; - else if (item.type == ItemID.FrostStaff) - item.mana = 9; - else if (item.type == ItemID.BookofSkulls) - item.mana = 12; - else if (item.type == ItemID.BlizzardStaff) - item.mana = 7; - else if (item.type == ItemID.SolarFlareHelmet) //total defense pre-buff = 78 post-buff = 94 - item.defense = 29; //5 more defense - else if (item.type == ItemID.SolarFlareBreastplate) - item.defense = 41; //7 more defense - else if (item.type == ItemID.SolarFlareLeggings) - item.defense = 24; //4 more defense - else if (item.type == ItemID.GladiatorHelmet) //total defense pre-buff = 7 post-buff = 15 - item.defense = 3; //1 more defense - else if (item.type == ItemID.GladiatorBreastplate) - item.defense = 5; //2 more defense - else if (item.type == ItemID.GladiatorLeggings) - item.defense = 4; //2 more defense - else if (item.type == ItemID.HallowedPlateMail) //total defense pre-buff = 31, 50, 35 post-buff = 36, 55, 40 - item.defense = 18; //3 more defense - else if (item.type == ItemID.HallowedGreaves) - item.defense = 13; //2 more defense if (CalamityLists.noGravityList.Contains(item.type)) ItemID.Sets.ItemNoGravity[item.type] = true; + if (CalamityLists.lavaFishList.Contains(item.type)) ItemID.Sets.CanFishInLava[item.type] = true; - - // not expert because ML drops it in normal so that it can be used with the lore item - if (item.type == ItemID.GravityGlobe) - { - item.expert = false; - item.rare = ItemRarityID.Red; - } - - if (item.type == ItemID.SuspiciousLookingTentacle) - item.expert = true; - - if (item.type == ItemID.PearlwoodHammer) - { - item.hammer += 35; //80% hammer power - item.useAnimation = 20; - item.useTime = 15; - item.damage *= 4; - item.tileBoost += 1; - item.rare = ItemRarityID.LightRed; - } - if (item.type == ItemID.PearlwoodBow) - { - item.useAnimation += 8; //35 - item.useTime += 8; //35 - item.shootSpeed += 3.4f; //10f - item.knockBack += 1f; //1f - item.rare = ItemRarityID.LightRed; - item.damage = (int)(item.damage * 2.1); - } - if (item.type == ItemID.PearlwoodSword) - { - item.damage *= 4; - item.rare = ItemRarityID.LightRed; - } - if (item.type == ItemID.StarCannon) - item.UseSound = null; - if (item.type == ItemID.CelestialSigil) - item.consumable = false; } #endregion @@ -506,7 +814,7 @@ namespace CalamityMod.Items #region SavingAndLoading public override bool NeedsSaving(Item item) { - return rogue || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0; + return rogue || canFirePointBlankShots || timesUsed != 0 || customRarity != 0 || Charge != 0 || reforgeTier != 0 || AppliedEnchantment.HasValue || DischargeEnchantExhaustion != 0; } public override TagCompound Save(Item item) @@ -519,14 +827,16 @@ namespace CalamityMod.Items ["charge"] = Charge, ["reforgeTier"] = reforgeTier, ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0, - ["DischargeEnchantExhaustion"] = DischargeEnchantExhaustion + ["DischargeEnchantExhaustion"] = DischargeEnchantExhaustion, + ["canFirePointBlankShots"] = canFirePointBlankShots }; } public override void Load(Item item, TagCompound tag) { rogue = tag.GetBool("rogue"); - timesUsed = tag.GetInt("timesUsed"); + canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); + timesUsed = tag.GetInt("timesUsed"); customRarity = (CalamityRarity)tag.GetInt("rarity"); // Changed charge from int to float. If an old charge int is present, load that instead. @@ -558,6 +868,7 @@ namespace CalamityMod.Items { BitsByte flags = reader.ReadByte(); rogue = flags[0]; + canFirePointBlankShots = flags[1]; } else { @@ -569,6 +880,7 @@ namespace CalamityMod.Items { BitsByte flags = new BitsByte(); flags[0] = rogue; + flags[1] = canFirePointBlankShots; writer.Write(flags); writer.Write((int)customRarity); @@ -583,6 +895,7 @@ namespace CalamityMod.Items { BitsByte flags = reader.ReadByte(); rogue = flags[0]; + canFirePointBlankShots = flags[1]; customRarity = (CalamityRarity)reader.ReadInt32(); timesUsed = reader.ReadInt32(); @@ -633,6 +946,15 @@ namespace CalamityMod.Items player.Calamity().evilSmasherBoost = 0; } + if (player.HasBuff(BuffID.ParryDamageBuff)) + { + if (item.type != ItemID.DD2SquireDemonSword) + { + player.parryDamageBuff = false; + player.ClearBuff(BuffID.ParryDamageBuff); + } + } + // Give 2 minutes of Honey buff when drinking Bottled Honey. if (item.type == ItemID.BottledHoney) player.AddBuff(BuffID.Honey, 7200); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 18e8914eb6..8c6b99fe0f 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -76,6 +76,13 @@ namespace CalamityMod.Items tooltips.Add(line); } + // Adds "Does extra damage to enemies shot at point-blank range" to weapons capable of it. + if (canFirePointBlankShots) + { + TooltipLine line = new TooltipLine(mod, "PointBlankShot", "Does extra damage to enemies shot at point-blank range"); + tooltips.Add(line); + } + // Adds "Challenge Drop" or "Legendary Challenge Drop" to Malice Mode drops. // For Legendary Challenge Drops, this tooltip matches their unique rarity color. if (challengeDrop) @@ -238,8 +245,6 @@ namespace CalamityMod.Items { if (!item.IsAir && AppliedEnchantment.HasValue) { - tooltips[0].text = $"{AppliedEnchantment.Value.Name} {tooltips[0].text}"; - TooltipLine descriptionLine = new TooltipLine(mod, "Enchantment", CalamityUtils.ColorMessage(AppliedEnchantment.Value.Description, Color.DarkRed)); tooltips.Add(descriptionLine); } @@ -357,7 +362,7 @@ namespace CalamityMod.Items // Cobalt if (item.type == ItemID.CobaltSword || item.type == ItemID.CobaltNaginata) - EditTooltipByName("Knockback", (line) => line.text += "\nDecreases enemy defense by 10% on hit"); + EditTooltipByName("Knockback", (line) => line.text += "\nDecreases enemy defense by 25% on hit"); // Palladium if (item.type == ItemID.PalladiumSword || item.type == ItemID.PalladiumPike) @@ -397,10 +402,10 @@ namespace CalamityMod.Items if (item.type == ItemID.AntlionClaw || item.type == ItemID.BoneSword || item.type == ItemID.BreakerBlade) EditTooltipByName("Knockback", (line) => line.text += "\nIgnores 50% of enemy defense"); - if (item.type == ItemID.LightsBane || item.type == ItemID.NightsEdge || item.type == ItemID.TrueNightsEdge) + if (item.type == ItemID.LightsBane || item.type == ItemID.NightsEdge || item.type == ItemID.TrueNightsEdge || item.type == ItemID.BallOHurt) EditTooltipByName("Knockback", (line) => line.text += "\nInflicts Shadowflame on hit"); - if (item.type == ItemID.BloodButcherer || item.type == ItemID.TheRottedFork) + if (item.type == ItemID.BloodButcherer || item.type == ItemID.TheRottedFork || item.type == ItemID.TheMeatball) EditTooltipByName("Knockback", (line) => line.text += "\nInflicts Burning Blood on hit"); #endregion diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index bc057d54a7..c345697fd0 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.DifficultyItems DisplayName.SetDefault("Revengeance"); Tooltip.SetDefault("Enables/disables Revengeance Mode, can only be used in expert mode.\n" + "RAGE TOOLTIP LINE HERE\n" + - "You gain Rage when you take damage or by using special items.\n" + + "You gain Rage when in proximity of enemies or by using special items.\n" + "ADRENALINE TOOLTIP LINE HERE\n" + "You gain Adrenaline whenever a boss is alive. Getting hit drops Adrenaline back to 0.\n" + "All enemies drop 50% more coins and spawn 15% more frequently\n" + diff --git a/Items/Materials/CalamitousEssence.cs b/Items/Materials/CalamitousEssence.cs index 4c84d1f343..80c39e2ecc 100644 --- a/Items/Materials/CalamitousEssence.cs +++ b/Items/Materials/CalamitousEssence.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -10,28 +12,52 @@ namespace CalamityMod.Items.Materials { public override void SetStaticDefaults() { - DisplayName.SetDefault("Calamitous Essence"); + DisplayName.SetDefault("Ashes of Annihilation"); + Tooltip.SetDefault("It burns with untold power"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(7, 6)); } public override void SetDefaults() { - item.width = 20; - item.height = 34; + item.width = 54; + item.height = 56; item.maxStack = 999; item.rare = ItemRarityID.Purple; item.value = Item.sellPrice(gold: 24); - item.Calamity().customRarity = CalamityRarity.HotPink; + item.Calamity().customRarity = CalamityRarity.Violet; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); - } + public void DrawPulsingAfterimage(SpriteBatch spriteBatch, Vector2 baseDrawPosition, Rectangle frame, float baseScale) + { + float pulse = Main.GlobalTime * 0.68f % 1f; + float outwardness = pulse * baseScale * 8f; + Color drawColor = Color.BlueViolet * (float)Math.Sqrt(1f - pulse) * 0.7f; + drawColor.A = 0; + for (int i = 0; i < 4; i++) + { + float scale = baseScale * MathHelper.Lerp(1f, 1.45f, pulse); + Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * outwardness - Vector2.UnitY * 2f; + spriteBatch.Draw(Main.itemTexture[item.type], drawPosition, frame, drawColor, item.velocity.X * 0.2f, frame.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + } + + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + DrawPulsingAfterimage(spriteBatch, position + frame.Size() * 0.25f, frame, scale); + return true; + } + + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Rectangle frame = Main.itemAnimations[item.type].GetFrame(Main.itemTexture[item.type]); + DrawPulsingAfterimage(spriteBatch, item.position - Main.screenPosition + frame.Size() * 0.5f, frame, scale); + return true; + } public override void Update(ref float gravity, ref float maxFallSpeed) { float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(item.Center, 0.1f * brightness, 0.1f * brightness, 0.1f * brightness); + Lighting.AddLight(item.Center, 0.34f * brightness, 0.08f * brightness, 0.155f * brightness); } } } diff --git a/Items/Materials/CalamitousEssence.png b/Items/Materials/CalamitousEssence.png index ea43c8bf7e..23495a4f6e 100644 Binary files a/Items/Materials/CalamitousEssence.png and b/Items/Materials/CalamitousEssence.png differ diff --git a/Items/Pets/BrimstoneJewel.png b/Items/Pets/BrimstoneJewel.png index b3b5cd5605..decd583bf9 100644 Binary files a/Items/Pets/BrimstoneJewel.png and b/Items/Pets/BrimstoneJewel.png differ diff --git a/Items/Potions/ProfanedRagePotion.cs b/Items/Potions/ProfanedRagePotion.cs index c54b52b384..4433276eba 100644 --- a/Items/Potions/ProfanedRagePotion.cs +++ b/Items/Potions/ProfanedRagePotion.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Items.Potions { DisplayName.SetDefault("Profaned Rage Potion"); Tooltip.SetDefault("Increases critical strike chance by 12% and increases movement and horizontal flight speed by 5%\n" + - "In Revengeance Mode you gain more rage when damaged\n" + "While this potion's buff is active the Rage Potion's buff is disabled"); } diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index db0e0df95b..707160f059 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -132,7 +132,8 @@ namespace CalamityMod.Items.Tools { if (crit) { - int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + damage /= 2; + int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) Main.projectile[boom].Calamity().forceMelee = true; } diff --git a/Items/TreasureBags/SCalBag.cs b/Items/TreasureBags/SCalBag.cs new file mode 100644 index 0000000000..0478b55c4a --- /dev/null +++ b/Items/TreasureBags/SCalBag.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.Pets; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas; + +namespace CalamityMod.Items.TreasureBags +{ + public class SCalBag : ModItem + { + public override int BossBagNPC => ModContent.NPCType(); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Coffer"); + Tooltip.SetDefault("{$CommonItemTooltip.RightClickToOpen}"); + } + + public override void SetDefaults() + { + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + item.rare = ItemRarityID.Purple; + item.expert = true; + } + + public override bool CanRightClick() => true; + + public override void OpenBossBag(Player player) + { + player.TryGettingDevArmor(); + + // Weapons + float w = DropHelper.BagWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(player, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); + + // Vanity + if (Main.rand.NextBool(7)) + { + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); + } + } + } +} diff --git a/Items/TreasureBags/SCalBag.png b/Items/TreasureBags/SCalBag.png new file mode 100644 index 0000000000..2fc6a926b0 Binary files /dev/null and b/Items/TreasureBags/SCalBag.png differ diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index 0d597fed37..fb0c702115 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = item.Calamity(); - item.damage = 30; + item.damage = 20; item.melee = true; item.width = 26; item.height = 26; @@ -51,7 +51,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal target.Calamity().GaussFluxTimer = 0; if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), 0f, player.whoAmI, 0f, target.whoAmI); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, target.whoAmI); } } } diff --git a/Items/Weapons/Magic/UndinesRetribution.png b/Items/Weapons/Magic/UndinesRetribution.png index 96f3ce9794..1be7a44f6c 100644 Binary files a/Items/Weapons/Magic/UndinesRetribution.png and b/Items/Weapons/Magic/UndinesRetribution.png differ diff --git a/Items/Weapons/Magic/Vehemenc.png b/Items/Weapons/Magic/Vehemenc.png index 382701bacb..8bb4dd73ed 100644 Binary files a/Items/Weapons/Magic/Vehemenc.png and b/Items/Weapons/Magic/Vehemenc.png differ diff --git a/Items/Weapons/Magic/WrathoftheAncients.png b/Items/Weapons/Magic/WrathoftheAncients.png index ba43cf6134..4412f19055 100644 Binary files a/Items/Weapons/Magic/WrathoftheAncients.png and b/Items/Weapons/Magic/WrathoftheAncients.png differ diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index 3f04f7afad..0914c23ccc 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -38,7 +38,10 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 600); target.AddBuff(ModContent.BuffType(), 60); - int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockBack * 3f, player.whoAmI); + if (crit) + damage /= 2; + + int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack * 3f, player.whoAmI); Main.projectile[p].Kill(); } @@ -47,7 +50,10 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 600); target.AddBuff(ModContent.BuffType(), 60); - int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), 12f, player.whoAmI); + if (crit) + damage /= 2; + + int p = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 12f, player.whoAmI); Main.projectile[p].Kill(); } } diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index a6de95ecd1..b473d99535 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -78,12 +78,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/Aftershock.cs b/Items/Weapons/Melee/Aftershock.cs index 5bea4aa6e4..f028bfd87d 100644 --- a/Items/Weapons/Melee/Aftershock.cs +++ b/Items/Weapons/Melee/Aftershock.cs @@ -18,11 +18,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 60; + item.damage = 65; item.melee = true; item.width = 54; item.height = 58; - item.scale = 1.5f; + item.scale = 1.75f; item.useTime = 28; item.useAnimation = 28; item.useTurn = true; diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index a147cafbf9..a11e598ff8 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee { public class AnarchyBlade : ModItem { - private static int BaseDamage = 110; + private static int BaseDamage = 150; public override void SetStaticDefaults() { @@ -66,7 +66,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); target.AddBuff(ModContent.BuffType(), 300); if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5)) @@ -83,7 +86,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); target.AddBuff(ModContent.BuffType(), 300); } } diff --git a/Items/Weapons/Melee/AncientCrusher.cs b/Items/Weapons/Melee/AncientCrusher.cs index 4782348d18..9f320ff101 100644 --- a/Items/Weapons/Melee/AncientCrusher.cs +++ b/Items/Weapons/Melee/AncientCrusher.cs @@ -46,12 +46,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index be6de2f35d..0f929bad35 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 110; + item.damage = 85; item.melee = true; item.width = 80; item.height = 80; diff --git a/Items/Weapons/Melee/BalefulHarvester.cs b/Items/Weapons/Melee/BalefulHarvester.cs index c6d80d2d2d..7af9d268f7 100644 --- a/Items/Weapons/Melee/BalefulHarvester.cs +++ b/Items/Weapons/Melee/BalefulHarvester.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 160; + item.damage = 90; item.width = 66; item.height = 66; item.scale = 1.5f; @@ -45,15 +45,21 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { + if (crit) + damage /= 2; + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ProjectileID.FlamingJack; - CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, (int)(item.damage * player.MeleeDamage() * 1.5f), knockback, 0, type); + CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, (int)(damage * 1.5f), knockback, 0, type); target.AddBuff(BuffID.OnFire, 300); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (crit) + damage /= 2; + int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ProjectileID.FlamingJack; - CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, (int)(item.damage * player.MeleeDamage() * 1.5f), item.knockBack, 0, type); + CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, (int)(damage * 1.5f), item.knockBack, 0, type); target.AddBuff(BuffID.OnFire, 300); } } diff --git a/Items/Weapons/Melee/BloodyEdge.cs b/Items/Weapons/Melee/BloodyEdge.cs index a08db2cae6..6f058c8b8b 100644 --- a/Items/Weapons/Melee/BloodyEdge.cs +++ b/Items/Weapons/Melee/BloodyEdge.cs @@ -65,20 +65,17 @@ namespace CalamityMod.Items.Weapons.Melee if (!target.canGhostHeal || player.moonLeech) return; - int healAmount = Main.rand.Next(3) + 1; - if (Main.rand.NextBool(2)) - { - player.statLife += healAmount; - player.HealEffect(healAmount); - } + int healAmount = Main.rand.Next(2) + 2; + player.statLife += healAmount; + player.HealEffect(healAmount); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 60); - int healAmount = Main.rand.Next(3) + 1; - if (Main.rand.NextBool(2) && !player.moonLeech) + int healAmount = Main.rand.Next(2) + 2; + if (!player.moonLeech) { player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 0a684e7d0e..81c28ce962 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 56; - item.damage = 100; + item.damage = 58; item.melee = true; item.noMelee = true; item.useTurn = true; diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index d7851ac814..0e7e4c6097 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 120; + item.damage = 200; item.knockBack = 4f; item.useAnimation = item.useTime = 15; item.melee = true; @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons.Melee 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, ModContent.ProjectileType(), damage / 2, knockBack, player.whoAmI); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage / 3, knockBack, player.whoAmI); return false; } @@ -78,12 +78,20 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI); + if (crit) + damage /= 2; + + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI); + if (crit) + damage /= 2; + + if (player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, player.whoAmI); } } } diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index f14e12e71b..868ce445f1 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.useTurn = true; item.height = 60; - item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.scale = 1.25f; + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = ItemRarityID.Orange; item.Calamity().challengeDrop = true; } diff --git a/Items/Weapons/Melee/CausticEdge.cs b/Items/Weapons/Melee/CausticEdge.cs index a787a4047b..f83190f06a 100644 --- a/Items/Weapons/Melee/CausticEdge.cs +++ b/Items/Weapons/Melee/CausticEdge.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 46; - item.damage = 98; - item.scale = 1.5f; + item.damage = 70; + item.scale = 1.4f; item.melee = true; item.useTurn = true; item.useAnimation = 27; diff --git a/Items/Weapons/Melee/CometQuasher.cs b/Items/Weapons/Melee/CometQuasher.cs index dd5aa04bda..79259b0776 100644 --- a/Items/Weapons/Melee/CometQuasher.cs +++ b/Items/Weapons/Melee/CometQuasher.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 46; item.height = 62; item.scale = 1.5f; - item.damage = 120; + item.damage = 90; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -56,7 +56,10 @@ namespace CalamityMod.Items.Weapons.Melee num80 = num72 / num80; } - for (int num113 = 0; num113 < 2; num113++) + if (crit) + damage /= 2; + + for (int num113 = 0; num113 < 2; num113++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); @@ -77,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.5f), knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(damage * 0.5f), knockback, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); Main.projectile[proj].Calamity().lineColor = Main.rand.Next(3); } } @@ -104,8 +107,10 @@ namespace CalamityMod.Items.Weapons.Melee num80 = num72 / num80; } - int num112 = 3; - for (int num113 = 0; num113 < num112; num113++) + if (crit) + damage /= 2; + + for (int num113 = 0; num113 < 2; num113++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); @@ -126,7 +131,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.75f), item.knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114 * 0.75f, num115 * 0.75f, ModContent.ProjectileType(), (int)(damage * 0.5f), item.knockBack, player.whoAmI, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); Main.projectile[proj].Calamity().lineColor = Main.rand.Next(3); } } diff --git a/Items/Weapons/Melee/CorruptedCrusherBlade.cs b/Items/Weapons/Melee/CorruptedCrusherBlade.cs index 922dc6ff30..9563e48a2b 100644 --- a/Items/Weapons/Melee/CorruptedCrusherBlade.cs +++ b/Items/Weapons/Melee/CorruptedCrusherBlade.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Corrupted Crusher Blade"); - Tooltip.SetDefault("Inflicts cursed inferno and critical hits lower enemy defense"); + Tooltip.SetDefault("Inflicts cursed inferno and critical hits reduce enemy defense by 10"); } public override void SetDefaults() @@ -21,7 +21,8 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.width = 66; item.height = 80; - item.useTime = 26; + item.scale = 1.25f; + item.useTime = 26; item.useAnimation = 26; item.useTurn = true; item.useStyle = ItemUseStyleID.SwingThrow; @@ -35,16 +36,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void MeleeEffects(Player player, Rectangle hitbox) { if (Main.rand.NextBool(7)) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.CursedInferno, 300); - if (target.defense > 0 && crit && !CalamityPlayer.areThereAnyDamnBosses) - target.defense = target.defDefense - 5; + if (crit) + target.Calamity().miscDefenseLoss = 10; } public override void OnHitPvp(Player player, Player target, int damage, bool crit) diff --git a/Items/Weapons/Melee/CrimsonCrusherBlade.cs b/Items/Weapons/Melee/CrimsonCrusherBlade.cs index a3a64d33ad..6e5dbe15e5 100644 --- a/Items/Weapons/Melee/CrimsonCrusherBlade.cs +++ b/Items/Weapons/Melee/CrimsonCrusherBlade.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.width = 70; item.height = 80; - item.useTime = 28; + item.scale = 1.25f; + item.useTime = 28; item.useAnimation = 28; item.useTurn = true; item.useStyle = ItemUseStyleID.SwingThrow; diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 922b9d7692..96bab233f9 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -126,9 +126,10 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.OnFire, 300); if (crit) { + damage /= 2; target.AddBuff(BuffID.ShadowFlame, 900); target.AddBuff(BuffID.OnFire, 900); - player.ApplyDamageToNPC(target, (int)(item.damage * player.MeleeDamage()) * 4, 0f, 0, false); + player.ApplyDamageToNPC(target, damage * 4, 0f, 0, false); float scalar1 = 1.7f; float scalar2 = 0.8f; float scalar3 = 2f; diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 5a119fb044..c604af4598 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -56,8 +56,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { + if (crit) + damage /= 2; + if (target.life <= (target.lifeMax * 0.05f)) - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); target.ExoDebuffs(); Main.PlaySound(SoundID.Item88, player.Center); @@ -75,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int comet = 0; comet < 2; comet++) { float ai1 = Main.rand.NextFloat() + 0.5f; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, ai1); + Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, ai1); } } @@ -89,8 +92,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (crit) + damage /= 2; + if (target.statLife <= (target.statLifeMax2 * 0.05f)) - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); target.ExoDebuffs(); Main.PlaySound(SoundID.Item88, player.Center); @@ -108,7 +114,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int comet = 0; comet < 2; comet++) { float ai1 = Main.rand.NextFloat() + 0.5f; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, ai1); + Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), damage, item.knockBack, player.whoAmI, 0f, ai1); } } diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 683d97d6be..87d83b467d 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Dragon Rage"); - Tooltip.SetDefault("Twirls a dual-bladed baton that causes explosions on enemy hits\n" + + Tooltip.SetDefault("Twirls a baton that causes explosions on enemy hits\n" + "Every ten hits will summon a ring of fireballs"); } diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 4f36e38f17..68f6d23c3d 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Earth"); - Tooltip.SetDefault("Has a 50% chance to lower enemy defense by 50 when striking them\n" + + Tooltip.SetDefault("Lowers enemy defense by 1 with every strike\n" + "Your attacks will heal you a lot\n" + "Rains RGB meteors that explode into more meteors after a short time on enemy hits\n" + "Ice meteors freeze enemies\n" + @@ -89,12 +89,8 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); } - if (Main.rand.NextBool(2) && target.defense > 0) - { - target.defense -= 50; - if (target.defense < 0) - target.defense = 0; - } + if (target.Calamity().miscDefenseLoss < target.defense) + target.Calamity().miscDefenseLoss += 1; if (!target.canGhostHeal || player.moonLeech) return; diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 1f1d31d5d1..5e83b123f6 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 64; item.height = 66; item.scale = 2f; - item.damage = 80; + item.damage = 125; item.melee = true; item.useAnimation = item.useTime = 38; item.useStyle = ItemUseStyleID.SwingThrow; diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index 6b5617c632..733f11b7db 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 44; - item.damage = 130; + item.damage = 60; item.melee = true; item.noMelee = true; item.useTurn = true; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.value = Item.buyPrice(0, 80, 0, 0); item.rare = ItemRarityID.Yellow; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 8f; + item.shootSpeed = 10f; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/FeralthornClaymore.cs b/Items/Weapons/Melee/FeralthornClaymore.cs index 039b478069..3fef252d59 100644 --- a/Items/Weapons/Melee/FeralthornClaymore.cs +++ b/Items/Weapons/Melee/FeralthornClaymore.cs @@ -51,16 +51,22 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.Venom, 300); - Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(damage * 0.25), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(damage * 0.25), 0f, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(BuffID.Venom, 300); - Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); - Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.4), 0f, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(player.position.X + 40f + Main.rand.Next(0, 151), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(damage * 0.25), 0f, Main.myPlayer); + Projectile.NewProjectile(player.position.X - 40f + Main.rand.Next(-150, 1), player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), (int)(damage * 0.25), 0f, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index 47cb18a20d..be3b231ab3 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Fulguration Halberd"); - Tooltip.SetDefault("Inflicts burning blood on enemy hits and decreases enemy contact damage by 10% on hit\n" + + Tooltip.SetDefault("Inflicts burning blood on enemy hits\n" + "Right click to use as a spear"); } @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 60; item.height = 64; item.scale = 1.5f; - item.damage = 120; + item.damage = 70; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -80,15 +80,13 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CrystalShard, 20); - recipe.AddIngredient(ItemID.OrichalcumHalberd); - recipe.AddIngredient(ItemID.HellstoneBar, 10); + recipe.AddIngredient(ItemID.AdamantiteBar, 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CrystalShard, 20); - recipe.AddIngredient(ItemID.MythrilHalberd); - recipe.AddIngredient(ItemID.HellstoneBar, 10); + recipe.AddIngredient(ItemID.TitaniumBar, 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 7eff57e476..e3892577bc 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 66; - item.damage = 400; + item.damage = 315; item.melee = true; item.noMelee = true; item.useTurn = true; diff --git a/Items/Weapons/Melee/GrandGuardian.cs b/Items/Weapons/Melee/GrandGuardian.cs index d1073c5775..eb922de395 100644 --- a/Items/Weapons/Melee/GrandGuardian.cs +++ b/Items/Weapons/Melee/GrandGuardian.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Grand Guardian"); - Tooltip.SetDefault("Has a 20% chance to lower enemy defense by 15 when striking them\n" + + Tooltip.SetDefault("Lowers enemy defense by 1 with every strike\n" + "If enemy defense is 0 or below your attacks will heal you\n" + "Striking enemies causes a large explosion\n" + "Striking enemies that have under half life will make you release rainbow bolts\n" + @@ -45,37 +45,36 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(5) && target.defense > 0) - { - target.defense -= 15; - if (target.defense < 0) - target.defense = 0; - } + if (target.Calamity().miscDefenseLoss < target.defense) + target.Calamity().miscDefenseLoss += 1; - if (target.defense <= 0 && target.canGhostHeal && !player.moonLeech) + if (target.Calamity().miscDefenseLoss >= target.defense && target.canGhostHeal && !player.moonLeech) { player.statLife += 4; player.HealEffect(4); } - OnHitEffects(player, target.Center, target.life, target.lifeMax, knockback); + OnHitEffects(player, target.Center, target.life, target.lifeMax, knockback, damage, crit); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - OnHitEffects(player, target.Center, target.statLife, target.statLifeMax2, item.knockBack); + OnHitEffects(player, target.Center, target.statLife, target.statLifeMax2, item.knockBack, damage, crit); } - private void OnHitEffects(Player player, Vector2 targetPos, int targetLife, int targetMaxLife, float knockback) + private void OnHitEffects(Player player, Vector2 targetPos, int targetLife, int targetMaxLife, float knockback, int damage, bool crit) { - Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.5f), 0f, player.whoAmI); + if (crit) + damage /= 2; + + Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * 0.5f), 0f, player.whoAmI); if (targetLife <= (targetMaxLife * 0.5f) && player.ownedProjectileCounts[ModContent.ProjectileType()] < 3) { float randomSpeedX = Main.rand.Next(9); float randomSpeedY = Main.rand.Next(6, 15); - Projectile.NewProjectile(player.Center.X, player.Center.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.75f), knockback, player.whoAmI); - Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.75f), knockback, player.whoAmI); - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.75f), knockback, player.whoAmI); + Projectile.NewProjectile(player.Center.X, player.Center.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(damage * 0.75f), knockback, player.whoAmI); + Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(damage * 0.75f), knockback, player.whoAmI); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)(damage * 0.75f), knockback, player.whoAmI); } if (targetLife <= 0 && !player.moonLeech && player.ownedProjectileCounts[ModContent.ProjectileType()] < 3) { diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index c6c5a4150a..12cff13204 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -18,11 +18,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 84; - item.damage = 150; + item.damage = 180; item.melee = true; - item.useAnimation = 22; + item.useAnimation = 30; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 22; + item.useTime = 30; item.useTurn = true; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/LionHeart.cs b/Items/Weapons/Melee/LionHeart.cs index 386badac26..9c84e74c35 100644 --- a/Items/Weapons/Melee/LionHeart.cs +++ b/Items/Weapons/Melee/LionHeart.cs @@ -72,14 +72,20 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI); + if (crit) + damage /= 2; + + int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (explosion.WithinBounds(Main.maxProjectiles)) Main.projectile[explosion].Calamity().forceMelee = true; } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI); + if (crit) + damage /= 2; + + int explosion = Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, player.whoAmI); if (explosion.WithinBounds(Main.maxProjectiles)) Main.projectile[explosion].Calamity().forceMelee = true; } diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index c958afacf2..7c9d9533a1 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Majestic Guard"); - Tooltip.SetDefault("Has a 20% chance to lower enemy defense by 10 when striking them\n" + + Tooltip.SetDefault("Lowers enemy defense by 1 with every strike\n" + "If enemy defense is 0 or below your attacks will heal you"); } @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 98; item.height = 98; item.scale = 1.5f; - item.damage = 120; + item.damage = 70; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -33,18 +33,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(5) && target.defense > 0) - { - target.defense -= 10; - if (target.defense < 0) - target.defense = 0; - } + if (target.Calamity().miscDefenseLoss < target.defense) + target.Calamity().miscDefenseLoss += 1; // Healing effect does not trigger versus dummies if (player.moonLeech) return; - if (target.defense <= 0 && target.canGhostHeal) + if (target.Calamity().miscDefenseLoss >= target.defense && target.canGhostHeal) { player.statLife += 3; player.HealEffect(3); diff --git a/Items/Weapons/Melee/MandibleClaws.cs b/Items/Weapons/Melee/MandibleClaws.cs index 341d1d4dea..214d4185a0 100644 --- a/Items/Weapons/Melee/MandibleClaws.cs +++ b/Items/Weapons/Melee/MandibleClaws.cs @@ -14,11 +14,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 26; - item.damage = 14; + item.damage = 13; item.melee = true; - item.useAnimation = 6; + item.useAnimation = 7; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 6; + item.useTime = 7; item.useTurn = true; item.knockBack = 3.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/MantisClaws.cs b/Items/Weapons/Melee/MantisClaws.cs index 9619862fdb..1593ec0ae0 100644 --- a/Items/Weapons/Melee/MantisClaws.cs +++ b/Items/Weapons/Melee/MantisClaws.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 26; - item.damage = 120; + item.damage = 88; item.melee = true; - item.useAnimation = 8; + item.useAnimation = 6; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 8; + item.useTime = 6; item.useTurn = true; item.knockBack = 7f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/MycelialClaws.cs b/Items/Weapons/Melee/MycelialClaws.cs index 21848f6af2..6c026eadc3 100644 --- a/Items/Weapons/Melee/MycelialClaws.cs +++ b/Items/Weapons/Melee/MycelialClaws.cs @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 22; - item.damage = 21; + item.damage = 20; item.melee = true; - item.useAnimation = 6; + item.useAnimation = 7; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 6; + item.useTime = 7; item.useTurn = true; item.knockBack = 3.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/NightsStabber.cs b/Items/Weapons/Melee/NightsStabber.cs index ba500843cb..185974f036 100644 --- a/Items/Weapons/Melee/NightsStabber.cs +++ b/Items/Weapons/Melee/NightsStabber.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 15; item.width = 28; item.height = 34; - item.damage = 52; + item.damage = 60; item.melee = true; item.knockBack = 6.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/PhoenixBlade.cs b/Items/Weapons/Melee/PhoenixBlade.cs index f7cac4b223..8166f627c6 100644 --- a/Items/Weapons/Melee/PhoenixBlade.cs +++ b/Items/Weapons/Melee/PhoenixBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 106; - item.damage = 120; + item.damage = 160; item.melee = true; item.useAnimation = 27; item.useStyle = ItemUseStyleID.SwingThrow; @@ -37,25 +37,28 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { if (target.life <= 0) - OnHitEffects(player, target.Center, knockback); + OnHitEffects(player, target.Center, knockback, damage, crit); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { if (target.statLife <= 0) - OnHitEffects(player, target.Center, item.knockBack); + OnHitEffects(player, target.Center, item.knockBack, damage, crit); } - private void OnHitEffects(Player player, Vector2 targetPos, float kBack) + private void OnHitEffects(Player player, Vector2 targetPos, float kBack, int damage, bool crit) { - int boom = Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + if (crit) + damage /= 2; + + int boom = Projectile.NewProjectile(targetPos, Vector2.Zero, ModContent.ProjectileType(), damage, kBack, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); if (boom.WithinBounds(Main.maxProjectiles)) Main.projectile[boom].Calamity().forceMelee = true; float randomSpeedX = Main.rand.Next(5); float randomSpeedY = Main.rand.Next(3, 7); - Projectile.NewProjectile(targetPos.X, targetPos.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI); - Projectile.NewProjectile(targetPos.X, targetPos.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), kBack, player.whoAmI); + Projectile.NewProjectile(targetPos.X, targetPos.Y, -randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), damage, kBack, player.whoAmI); + Projectile.NewProjectile(targetPos.X, targetPos.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), damage, kBack, player.whoAmI); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index 4167740a72..29d9a5ff8d 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -12,14 +12,14 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Phosphorescent Gauntlet"); Tooltip.SetDefault("Releases rapid sulphurous punches\n" + - "On use, you lunge in the direction of the mouse.\n" + + "On use, you lunge in the direction of the mouse\n" + "On collision, you are knocked back"); } public override void SetDefaults() { item.width = item.height = 40; - item.damage = 750; + item.damage = 930; item.melee = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index aa3deafe46..24e2d87a0e 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -11,17 +11,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Photon Ripper"); - Tooltip.SetDefault("Unleashes a flurry of prismatic crystals at extremely fast speeds\n" + - "These crystals are capable of breaking trees"); + Tooltip.SetDefault("Projects a directed stream of hardlight teeth at ultra high velocity\n" + + "This weapon and its projectiles function as a chainsaw"); } public override void SetDefaults() { item.height = 134; item.width = 54; - item.damage = 305; - item.axe = 3330; - item.axe /= 5; + item.damage = 3660; + + // Displayed axe% is 1/5th of axePower here because trees have 500% hardness. This corrects for that. + item.axe = 6000 / 5; item.melee = true; item.noMelee = true; item.noUseGraphic = true; @@ -31,11 +32,12 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.knockBack = 12f; item.autoReuse = false; - item.value = CalamityGlobalItem.RarityVioletBuyPrice; - item.rare = ItemRarityID.Red; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1f; + + item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.Violet; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; } public override void GetWeaponCrit(Player player, ref int crit) => crit += 18; diff --git a/Items/Weapons/Melee/PlagueKeeper.cs b/Items/Weapons/Melee/PlagueKeeper.cs index f2e62911c2..068124e44a 100644 --- a/Items/Weapons/Melee/PlagueKeeper.cs +++ b/Items/Weapons/Melee/PlagueKeeper.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -49,11 +50,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + if (crit) + damage /= 2; + + target.AddBuff(ModContent.BuffType(), 300); for (int i = 0; i < 3; i++) { - int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(), - player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI); + int bee = Projectile.NewProjectile(player.Center, Vector2.Zero, player.beeType(), + player.beeDamage(damage / 3), player.beeKB(0f), player.whoAmI); if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 1; @@ -64,11 +68,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + if (crit) + damage /= 2; + + target.AddBuff(ModContent.BuffType(), 300); for (int i = 0; i < 3; i++) { - int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, player.beeType(), - player.beeDamage((int)(item.damage * player.MeleeDamage()) / 3), player.beeKB(0f), player.whoAmI); + int bee = Projectile.NewProjectile(player.Center, Vector2.Zero, player.beeType(), + player.beeDamage(damage / 3), player.beeKB(0f), player.whoAmI); if (bee.WithinBounds(Main.maxProjectiles)) { Main.projectile[bee].penetrate = 1; diff --git a/Items/Weapons/Melee/ProfanedSword.cs b/Items/Weapons/Melee/ProfanedSword.cs index 49b457db38..06916b6641 100644 --- a/Items/Weapons/Melee/ProfanedSword.cs +++ b/Items/Weapons/Melee/ProfanedSword.cs @@ -66,14 +66,20 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, Main.myPlayer); + if (crit) + damage /= 2; + + target.AddBuff(ModContent.BuffType(), 300); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, Main.myPlayer); + if (crit) + damage /= 2; + + target.AddBuff(ModContent.BuffType(), 300); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs index 69b7b1c1df..e702cd99ac 100644 --- a/Items/Weapons/Melee/SpineOfThanatos.cs +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = item.height = 28; - item.damage = 410; + item.damage = 369; item.rare = ItemRarityID.Red; item.value = CalamityGlobalItem.RarityVioletBuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 92f2bff48a..f105df58ec 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -36,16 +36,16 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { if (player.whoAmI == Main.myPlayer) - SpawnFlares(player, knockback); + SpawnFlares(player, knockback, damage, crit); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { if (player.whoAmI == Main.myPlayer) - SpawnFlares(player, item.knockBack); + SpawnFlares(player, item.knockBack, damage, crit); } - private void SpawnFlares(Player player, float knockBack) + private void SpawnFlares(Player player, float knockBack, int damage, bool crit) { Main.PlaySound(SoundID.Item88, player.position); int i = Main.myPlayer; @@ -69,7 +69,10 @@ namespace CalamityMod.Items.Weapons.Melee num80 = num72 / num80; } - int num112 = 2; + if (crit) + damage /= 2; + + int num112 = 2; for (int num113 = 0; num113 < num112; num113++) { vector2 = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); @@ -91,7 +94,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float num114 = num78; float num115 = num79 + (float)Main.rand.Next(-80, 81) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(item.damage * player.MeleeDamage() * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3)); + int proj = Projectile.NewProjectile(vector2.X, vector2.Y, num114, num115, ProjectileID.LunarFlare, (int)(damage * 0.5), knockBack, i, 0f, (float)Main.rand.Next(3)); if (proj.WithinBounds(Main.maxProjectiles)) Main.projectile[proj].Calamity().forceMelee = true; } diff --git a/Items/Weapons/Melee/SubmarineShocker.cs b/Items/Weapons/Melee/SubmarineShocker.cs index 47a3a376c3..1678372b82 100644 --- a/Items/Weapons/Melee/SubmarineShocker.cs +++ b/Items/Weapons/Melee/SubmarineShocker.cs @@ -42,12 +42,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.7f), knockback, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * 0.7f), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.7f), item.knockBack, Main.myPlayer); + if (crit) + damage /= 2; + + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(damage * 0.7f), item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/Terracotta.cs b/Items/Weapons/Melee/Terracotta.cs index ac821a0a04..11a4fa4edb 100644 --- a/Items/Weapons/Melee/Terracotta.cs +++ b/Items/Weapons/Melee/Terracotta.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 50; item.height = 62; item.scale = 1.5f; - item.damage = 125; + item.damage = 110; item.melee = true; - item.useAnimation = 17; - item.useTime = 17; + item.useAnimation = 15; + item.useTime = 15; item.useTurn = true; item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; diff --git a/Items/Weapons/Melee/TheLastMourning.cs b/Items/Weapons/Melee/TheLastMourning.cs index f7fa845cff..b2c126470f 100644 --- a/Items/Weapons/Melee/TheLastMourning.cs +++ b/Items/Weapons/Melee/TheLastMourning.cs @@ -41,22 +41,26 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - int projDamage = (int)(item.damage * player.MeleeDamage()); + if (crit) + damage /= 2; + bool isDoGSegment = target.type == ModContent.NPCType() || target.type == ModContent.NPCType() || target.type == ModContent.NPCType(); if (!isDoGSegment || Main.rand.NextBool(3)) { - CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, projDamage, knockback, 0, ModContent.ProjectileType()); - CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, projDamage, knockback, 1); + CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, damage, knockback, 0, ModContent.ProjectileType()); + CalamityPlayerOnHit.HorsemansBladeOnHit(player, target.whoAmI, damage, knockback, 1); } } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - int projDamage = (int)(item.damage * player.MeleeDamage()); - CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, projDamage, item.knockBack, 0, ModContent.ProjectileType()); - CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, projDamage, item.knockBack, 1); + if (crit) + damage /= 2; + + CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, damage, item.knockBack, 0, ModContent.ProjectileType()); + CalamityPlayerOnHit.HorsemansBladeOnHit(player, -1, damage, item.knockBack, 1); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/TitanArm.cs b/Items/Weapons/Melee/TitanArm.cs index 766b2a7224..6c777fe941 100644 --- a/Items/Weapons/Melee/TitanArm.cs +++ b/Items/Weapons/Melee/TitanArm.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 46; item.height = 58; - item.damage = 60; - item.scale = 1.5f; + item.damage = 69; + item.scale = 1.75f; item.knockBack = 20f; //This number doesn't mean anything, but it's not 9001f because that caused bugs. item.useAnimation = item.useTime = 12; item.melee = true; diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index bb5728702a..f06bbd0fee 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -35,7 +35,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/Aeries.cs b/Items/Weapons/Ranged/Aeries.cs index f90f550d02..8f7b53b5d6 100644 --- a/Items/Weapons/Ranged/Aeries.cs +++ b/Items/Weapons/Ranged/Aeries.cs @@ -32,6 +32,7 @@ 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/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index a04e4965b7..3b4e1c9946 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -38,7 +38,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.useAmmo = AmmoID.Arrow; item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index b726106762..c7dbbbf0d5 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -44,7 +44,8 @@ Fighting 'til the war's won"); item.shootSpeed = BulletSpeed; 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 523bde51be..b51b1c2387 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -34,7 +34,8 @@ Right click to fire a burst of bullets"); item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 11f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index 90f54c7d50..8b4e8a262f 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -33,7 +33,8 @@ 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 public override void GetWeaponCrit(Player player, ref int crit) => crit += 6; diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 7cb7a5f98d..39150ef06c 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -38,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.useAmmo = AmmoID.Arrow; item.Calamity().challengeDrop = true; + item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index 0c82d04774..8b6ec50918 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 11f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index 3487062645..6255a3defb 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -33,7 +33,8 @@ 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 public override void GetWeaponCrit(Player player, ref int crit) => crit += 25; diff --git a/Items/Weapons/Ranged/AstralRepeater.cs b/Items/Weapons/Ranged/AstralRepeater.cs index 43525a57a8..1ae1daabb4 100644 --- a/Items/Weapons/Ranged/AstralRepeater.cs +++ b/Items/Weapons/Ranged/AstralRepeater.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 16f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 25; diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 5dd3378fd9..596c4b2117 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -36,7 +36,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index 2512ea6945..ca38b36f73 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -45,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity12BuyPrice; item.Calamity().customRarity = CalamityRarity.Turquoise; item.Calamity().donorItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index df949f4a2a..869e4e609e 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -3,7 +3,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -//using TerrariaOverhaul; namespace CalamityMod.Items.Weapons.Ranged { @@ -33,12 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; item.useAmmo = AmmoID.Arrow; - } - - /*public void OverhaulInit() - { - this.SetTag("bow"); - }*/ + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 5497dd59bb..f31c43fc25 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeGreatbow.cs index 835e63e05b..bb0ec23516 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeGreatbow.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 14f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 76746e2800..6067fa792a 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; item.Calamity().challengeDrop = true; + 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 b2c3c43ffa..c4cb43dbc0 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index 0dcb7bf48a..7f1e333b9f 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity3BuyPrice; 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/Butcher.cs b/Items/Weapons/Ranged/Butcher.cs index f8f6f3c4c7..c9901d3439 100644 --- a/Items/Weapons/Ranged/Butcher.cs +++ b/Items/Weapons/Ranged/Butcher.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; + item.Calamity().canFirePointBlankShots = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/ChargedDartRifle.cs b/Items/Weapons/Ranged/ChargedDartRifle.cs index abd42eb38a..fe9fa2c295 100644 --- a/Items/Weapons/Ranged/ChargedDartRifle.cs +++ b/Items/Weapons/Ranged/ChargedDartRifle.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 22f; item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Dart; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 8e0a8b2ad6..ff6720a85e 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -32,6 +32,7 @@ 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/ClaretCannon.cs b/Items/Weapons/Ranged/ClaretCannon.cs index 30346eaad8..92ffba69f4 100644 --- a/Items/Weapons/Ranged/ClaretCannon.cs +++ b/Items/Weapons/Ranged/ClaretCannon.cs @@ -35,7 +35,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 24f; item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/ClockGatlignum.cs b/Items/Weapons/Ranged/ClockGatlignum.cs index 941cd00e63..99d9dabe11 100644 --- a/Items/Weapons/Ranged/ClockGatlignum.cs +++ b/Items/Weapons/Ranged/ClockGatlignum.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; 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/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index ae59eee27d..0e1ac58cf0 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14.5f; 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 669d33a369..9ee11ae909 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -37,7 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity16BuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; 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/CoralCannon.cs b/Items/Weapons/Ranged/CoralCannon.cs index 0cf18ca551..7c52f826c1 100644 --- a/Items/Weapons/Ranged/CoralCannon.cs +++ b/Items/Weapons/Ranged/CoralCannon.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 10; diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 5c23f18ce0..a8e60906e1 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -33,7 +33,8 @@ 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 public override void GetWeaponCrit(Player player, ref int crit) => crit += 20; diff --git a/Items/Weapons/Ranged/CosmicBolter.cs b/Items/Weapons/Ranged/CosmicBolter.cs index 068e05a682..c2be9197fb 100644 --- a/Items/Weapons/Ranged/CosmicBolter.cs +++ b/Items/Weapons/Ranged/CosmicBolter.cs @@ -35,7 +35,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/CursedCapper.cs b/Items/Weapons/Ranged/CursedCapper.cs index df2055a052..28213ab0d1 100644 --- a/Items/Weapons/Ranged/CursedCapper.cs +++ b/Items/Weapons/Ranged/CursedCapper.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 14f; item.shoot = ProjectileID.CursedBullet; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index fea2ef351e..b6d40846c7 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; - } + 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 d125919ff9..6221cf189a 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 11cf5186af..1134e3999e 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -35,7 +35,8 @@ 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/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 74adf9c5a1..6780da79fc 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -40,7 +40,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; item.Calamity().donorItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index daafd98c11..c5e82ea8db 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -8,12 +8,22 @@ namespace CalamityMod.Items.Weapons.Ranged { public class DragonsBreath : ModItem { + public const int BetweenShotsPause = 15; + public const int PelletsPerShot = 6; + public const float FullAutoFireRateMult = 0.8f; + public const float FullAutoDamageMult = 0.85f; + // note this is extremely low because it's per pellet + public const float Spread = 0.018f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Dragon's Breath"); - Tooltip.SetDefault("80% chance to not consume ammo\n" + - "Fires a spread of 8 bullets\n" + - "Converts musket balls into exploding dragonfire bullets"); + Tooltip.SetDefault("Left click fires in two-shot bursts\n" + + "The first shot is a spread of 6 normal bullets\n" + + "The second shot is a tight spread of 6 Dragon's Breath rounds\n" + + "Right click fires full auto and mixes the bullets randomly, but does 15% less damage\n" + + "This weapon has no randomness to its spread pattern\n" + + "66% chance to not consume ammo"); } public override void SetDefaults() @@ -22,42 +32,132 @@ namespace CalamityMod.Items.Weapons.Ranged item.ranged = true; item.width = 64; item.height = 28; - item.useTime = 20; - item.useAnimation = 20; + + item.useTime = 9; + item.useAnimation = 18; + item.reuseDelay = BetweenShotsPause; + item.autoReuse = true; item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; item.knockBack = 6.5f; - item.value = CalamityGlobalItem.Rarity15BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.Violet; - item.UseSound = SoundID.Item36; - item.autoReuse = true; - item.shoot = ProjectileID.PurificationPowder; + // item.UseSound = SoundID.Item38; + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; + item.Calamity().canFirePointBlankShots = true; + + item.Calamity().customRarity = CalamityRarity.Violet; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + } + public override bool ConsumeAmmo(Player player) => Main.rand.NextFloat() > 0.66f; + + public override Vector2? HoldoutOffset() => new Vector2(-5, 5); + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + item.reuseDelay = player.altFunctionUse == 2 ? 0 : BetweenShotsPause; + return base.CanUseItem(player); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 5); - } + public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? FullAutoFireRateMult : 1f; - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - for (int i = 0; i < 8; i++) + Main.PlaySound(SoundID.Item38, position); + bool doDust = false; + Vector2 vel = new Vector2(speedX, speedY); + int[] bulletIDs = new int[PelletsPerShot]; + float spreadFactor = 1f; + + // Right click full auto: Randomly intermix three regular bullets and three Dragon's Breath Rounds in a wider spread + if (player.altFunctionUse == 2) { - float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + damage = (int)(damage * FullAutoDamageMult); + + for (int i = 0; i < PelletsPerShot; ++i) + bulletIDs[i] = type; + int dragonsBreathAdded = 0; + while (dragonsBreathAdded < PelletsPerShot / 2) + { + int i = Main.rand.Next(PelletsPerShot); + if (bulletIDs[i] == item.shoot) + continue; + bulletIDs[i] = item.shoot; + ++dragonsBreathAdded; + } + + spreadFactor = 1.52f; + } + // Left click first shot: Six regular bullets, low spread + else if (player.itemAnimation == player.itemAnimationMax - 1) + { + for (int i = 0; i < PelletsPerShot; ++i) + bulletIDs[i] = type; + } + // Left click second shot: Six Dragon's Breath Rounds, very low spread. Extra sound and dust blast. + else + { + Main.PlaySound(SoundID.Item74, position); + for (int i = 0; i < PelletsPerShot; ++i) + bulletIDs[i] = item.shoot; + + spreadFactor = 0.5f; + doDust = true; + } + + // Actually fire the chosen bullets. + float angleOffset = Spread * -0.5f * (PelletsPerShot - 1) * spreadFactor; + for (int i = 0; i < PelletsPerShot; ++i) + { + Vector2 rotatedVel = vel.RotatedBy(angleOffset); + Projectile.NewProjectile(position, rotatedVel, bulletIDs[i], damage, knockBack, player.whoAmI); + angleOffset += Spread * spreadFactor; + + if (doDust) + SpawnDragonsBreathDust(position, rotatedVel); } return false; } - public override bool ConsumeAmmo(Player player) + // TODO -- this is just copied Handheld Tank dust, but it looks good enough. Could definitely be improved. + private void SpawnDragonsBreathDust(Vector2 pos, Vector2 velocity) { - if (Main.rand.Next(0, 100) < 80) - return false; - return true; + for (int i = 0; i < 30; ++i) + { + // Pick a random type of smoke (there's a little fire mixed in) + int dustID; + switch (Main.rand.Next(6)) + { + case 0: + dustID = 55; + break; + case 1: + case 2: + dustID = 54; + break; + default: + dustID = 53; + break; + } + + // Choose a random speed and angle to belch out the smoke + float dustSpeed = Main.rand.NextFloat(3.0f, 13.0f); + float angleRandom = 0.06f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(velocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the smoke particle + float scale = Main.rand.NextFloat(0.5f, 1.6f); + + // Actually spawn the smoke + int idx = Dust.NewDust(pos, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale); + Main.dust[idx].noGravity = true; + Main.dust[idx].position = pos; + } } } } diff --git a/Items/Weapons/Ranged/Dualpoon.cs b/Items/Weapons/Ranged/Dualpoon.cs index c3ef822c9f..c6f3e6783a 100644 --- a/Items/Weapons/Ranged/Dualpoon.cs +++ b/Items/Weapons/Ranged/Dualpoon.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/EffluviumBow.cs b/Items/Weapons/Ranged/EffluviumBow.cs index b6ea7a4a0c..45eeade8dc 100644 --- a/Items/Weapons/Ranged/EffluviumBow.cs +++ b/Items/Weapons/Ranged/EffluviumBow.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index 0655bc5e9f..55791beb74 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -32,7 +32,9 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f; diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index bfd6db554f..ccfc2e8e32 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -33,7 +33,8 @@ 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 public override void GetWeaponCrit(Player player, ref int crit) => crit += 25; diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 462de59b1e..c504882bee 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 021319e732..4acca964fc 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.Flare; item.shootSpeed = 5.5f; item.useAmmo = AmmoID.Flare; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index 6c4e1d6f48..0da50d130c 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 16f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/FlurrystormCannon.cs b/Items/Weapons/Ranged/FlurrystormCannon.cs index 658ac2bd01..0be4c97d96 100644 --- a/Items/Weapons/Ranged/FlurrystormCannon.cs +++ b/Items/Weapons/Ranged/FlurrystormCannon.cs @@ -40,7 +40,8 @@ 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 4ef484eb78..f8dec6064c 100644 --- a/Items/Weapons/Ranged/FrostbiteBlaster.cs +++ b/Items/Weapons/Ranged/FrostbiteBlaster.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shoot = ProjectileID.Blizzard; item.shootSpeed = 9f; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 70faf0ea86..7b135c185f 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -32,7 +32,8 @@ 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 07fb34fb34..c91ba8a8ea 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index aeaeacb84e..ce1c8d6cd5 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -33,7 +33,8 @@ 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 2683865d18..da1b21c01d 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index ee6f68dc88..43fea7ed39 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -34,7 +34,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 46610b07a1..37489dd7dd 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -33,7 +33,8 @@ 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 a51dfae60f..ec0d89ae76 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -31,7 +31,8 @@ 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 232861159f..d4de9703bb 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -2,8 +2,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,15 +11,27 @@ namespace CalamityMod.Items.Weapons.Ranged { public class HeavenlyGale : ModItem { + public const float NormalArrowDamageMult = 1.2f; + private static int[] ExoArrows; + public override void SetStaticDefaults() { DisplayName.SetDefault("Heavenly Gale"); Tooltip.SetDefault("Converts wooden arrows into barrages of 5 random exo arrows\n" + - "Green exo arrows explode into a tornado on death\n" + - "Blue exo arrows cause a second group of arrows to fire on enemy hits\n" + - "Orange exo arrows cause explosions on death\n" + - "Teal exo arrows ignore enemy immunity frames\n" + + "Green exo arrows erupt into swirling tornadoes\n" + + "Blue exo arrows burst into barrages of following arrows\n" + + "Orange exo arrows explode into flames\n" + + "Teal exo arrows pierce infinitely and ignore immunity frames\n" + + "Any non-wooden arrows used will deal 1.2x damage\n" + "66% chance to not consume ammo"); + + ExoArrows = new int[] + { + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() + }; } public override void SetDefaults() @@ -35,77 +45,49 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = ItemRarityID.Red; item.UseSound = SoundID.Item5; item.autoReuse = true; item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 12f; item.useAmmo = AmmoID.Arrow; item.Calamity().customRarity = CalamityRarity.Violet; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.Calamity().canFirePointBlankShots = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 vel = new Vector2(speedX, speedY); float piOver10 = MathHelper.Pi * 0.1f; - int arrowAmt = 5; - Vector2 speed = new Vector2(speedX, speedY); - speed.Normalize(); - speed *= 40f; - bool canHit = Collision.CanHit(source, 0, 0, source + speed, 0, 0); - for (int i = 0; i < arrowAmt; i++) + + // This is not related to speed, but rather placing the arrows correctly along the large bow. + Vector2 baseOffset = new Vector2(speedX, speedY); + baseOffset.Normalize(); + baseOffset *= 40f; + + bool againstWall = !Collision.CanHit(source, 0, 0, source + baseOffset, 0, 0); + + int numArrows = 5; + for (int i = 0; i < numArrows; i++) { - float offsetAmt = i - (arrowAmt - 1f) / 2f; - Vector2 offset = speed.RotatedBy(piOver10 * offsetAmt); - if (!canHit) - offset -= speed; + float offsetAmt = i - (numArrows - 1f) / 2f; + Vector2 offset = baseOffset.RotatedBy(piOver10 * offsetAmt); + if (againstWall) + offset -= baseOffset; if (type == ProjectileID.WoodenArrowFriendly) { - int[] arrowTypes = new int[5] - { ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType() - }; - int j = arrowTypes.Length; - var rng = new Random(); - while (j > 1) - { - int k = rng.Next(j--); - int randomArrow = arrowTypes[j]; - arrowTypes[j] = arrowTypes[k]; - arrowTypes[k] = randomArrow; - } - int newType = type; - switch (i) - { - case 0: - case 4: - newType = ProjectileType(); - break; - case 1: - newType = ProjectileType(); - break; - case 2: - newType = ProjectileType(); - break; - case 3: - newType = ProjectileType(); - break; - } - - float dmgMult = 1f; - if (arrowTypes[i] == ProjectileType()) - dmgMult = 0.5f; - - Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, arrowTypes[i], (int)(damage * dmgMult), knockBack, player.whoAmI); + int thisArrowType = Main.rand.Next(ExoArrows); + // Teal exo arrows deal less damage. + float dmgMult = thisArrowType == ProjectileType() ? 0.66f : 1f; + int finalDamage = (int)(damage * dmgMult); + Projectile.NewProjectile(source + offset, vel, thisArrowType, finalDamage, knockBack, player.whoAmI); } else { - int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + int normalArrowDamage = (int)(damage * NormalArrowDamageMult); + int proj = Projectile.NewProjectile(source + offset, vel, type, normalArrowDamage, knockBack, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index f22b732621..bb73630b3b 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; item.Calamity().challengeDrop = true; + item.Calamity().canFirePointBlankShots = true; } public override float UseTimeMultiplier(Player player) => 1f + (player.Calamity().hellbornBoost * (1f / 600f)); diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index 3244f78a2c..ee77c727ed 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -32,7 +32,8 @@ 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/Impaler.cs b/Items/Weapons/Ranged/Impaler.cs index 9d41f519b9..4dd46de45c 100644 --- a/Items/Weapons/Ranged/Impaler.cs +++ b/Items/Weapons/Ranged/Impaler.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.useAmmo = AmmoID.Stake; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 14; diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index ecb6f2812d..2a3cbd3923 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; item.Calamity().challengeDrop = true; + item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/LeadWizard.cs b/Items/Weapons/Ranged/LeadWizard.cs index 10a18374f4..9b22bf7de4 100644 --- a/Items/Weapons/Ranged/LeadWizard.cs +++ b/Items/Weapons/Ranged/LeadWizard.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 20f; item.useAmmo = AmmoID.Bullet; item.Calamity().challengeDrop = true; + item.Calamity().canFirePointBlankShots = true; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 70496f47a5..1e44e0b934 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; + item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index b7ac84a6a4..1d84649a85 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -35,7 +35,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs index 9e2014dc78..77800c71bd 100644 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ b/Items/Weapons/Ranged/MagnaStriker.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index b56dc12554..69e1b179d9 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 340; + item.damage = 357; item.ranged = true; item.width = 84; item.height = 30; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index 5f6ad22d3b..0c716b2a55 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/MandibleBow.cs b/Items/Weapons/Ranged/MandibleBow.cs index 1efd420107..509c79b3e2 100644 --- a/Items/Weapons/Ranged/MandibleBow.cs +++ b/Items/Weapons/Ranged/MandibleBow.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 15f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } } } diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 7e1aba9f60..449cbaa2db 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = Item.buyPrice(gold: 80); // crafted out of nothing but 31 ectoplasm so it has unique pricing item.rare = ItemRarityID.Yellow; item.Calamity().donorItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 20; diff --git a/Items/Weapons/Ranged/MarniteRifleSpear.cs b/Items/Weapons/Ranged/MarniteRifleSpear.cs index 49b7e515a6..7b4e91d3e8 100644 --- a/Items/Weapons/Ranged/MarniteRifleSpear.cs +++ b/Items/Weapons/Ranged/MarniteRifleSpear.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 22f; item.useAmmo = AmmoID.Bullet; item.shoot = ProjectileID.PurificationPowder; - } + item.Calamity().canFirePointBlankShots = true; + } public override void AddRecipes() { diff --git a/Items/Weapons/Ranged/Megafleet.cs b/Items/Weapons/Ranged/Megafleet.cs index 8ab31a915b..916f0af691 100644 --- a/Items/Weapons/Ranged/Megafleet.cs +++ b/Items/Weapons/Ranged/Megafleet.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity16BuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 849d42f2cd..cb018c0fec 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/Minigun.cs b/Items/Weapons/Ranged/Minigun.cs index 2b43961d10..264737882c 100644 --- a/Items/Weapons/Ranged/Minigun.cs +++ b/Items/Weapons/Ranged/Minigun.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 22f; item.useAmmo = AmmoID.Bullet; item.Calamity().customRarity = CalamityRarity.Violet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/MolecularManipulator.cs b/Items/Weapons/Ranged/MolecularManipulator.cs index 145380355f..3f795bc38f 100644 --- a/Items/Weapons/Ranged/MolecularManipulator.cs +++ b/Items/Weapons/Ranged/MolecularManipulator.cs @@ -35,7 +35,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 25f; item.shoot = ModContent.ProjectileType(); - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index b83678ce00..95672567ba 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -35,7 +35,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/NettlelineGreatbow.cs b/Items/Weapons/Ranged/NettlelineGreatbow.cs index 12e903e8e3..abc109ad35 100644 --- a/Items/Weapons/Ranged/NettlelineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlelineGreatbow.cs @@ -34,7 +34,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/NullificationRifle.cs b/Items/Weapons/Ranged/NullificationRifle.cs index 5d0e07d2b2..c7f533c1c6 100644 --- a/Items/Weapons/Ranged/NullificationRifle.cs +++ b/Items/Weapons/Ranged/NullificationRifle.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 25f; item.shoot = ModContent.ProjectileType(); - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index 08a8cba9aa..3dff3384bc 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.BlackBolt; item.shootSpeed = 24f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 49eb1c93ca..339b09ecaf 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -36,7 +36,8 @@ 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 b0424ac12e..a02e22c36e 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 6f; item.useAmmo = AmmoID.Bullet; + item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/P90.cs b/Items/Weapons/Ranged/P90.cs index 31534259d5..72c81187b2 100644 --- a/Items/Weapons/Ranged/P90.cs +++ b/Items/Weapons/Ranged/P90.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 18f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/PaintballBlaster.cs b/Items/Weapons/Ranged/PaintballBlaster.cs index 7746d167d8..d4fd52c7da 100644 --- a/Items/Weapons/Ranged/PaintballBlaster.cs +++ b/Items/Weapons/Ranged/PaintballBlaster.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ProjectileID.PainterPaintball; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 09058c828c..3450057d44 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -40,6 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Bullet; item.Calamity().challengeDrop = true; + item.Calamity().canFirePointBlankShots = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index 4ba8057b74..d3a9ceb651 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -32,7 +32,8 @@ 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/Phangasm.cs b/Items/Weapons/Ranged/Phangasm.cs index 443615e0cd..d661f44127 100644 --- a/Items/Weapons/Ranged/Phangasm.cs +++ b/Items/Weapons/Ranged/Phangasm.cs @@ -37,7 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 20f; item.useAmmo = AmmoID.Arrow; item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index 3193e384ae..a3ccae8ffb 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Weapons.Ranged public class Photoviscerator : ModItem { public const int CooldownTime = 60 * 7; // 7 second cooldown. - public const double AltFireDamageMult = 2.5; - + public const double AltFireDamageMult = 1.5; + public override void SetStaticDefaults() { DisplayName.SetDefault("Photoviscerator"); @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 75; + item.damage = 71; item.ranged = true; item.width = 84; item.height = 30; @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 velocity = new Vector2(speedX, speedY).RotatedByRandom(0.05f); Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI, 0f, 0f); } - if (Main.rand.NextBool(8)) + if (Main.rand.NextBool(10)) { for (int i = 0; i < 2; i++) { @@ -110,8 +110,8 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddTile(ModContent.TileType()); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs index b56223fe63..49d5d0873b 100644 --- a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs @@ -44,7 +44,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity11BuyPrice; 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/ProporsePistol.cs b/Items/Weapons/Ranged/ProporsePistol.cs index 621f8f2a04..9e492d98cc 100644 --- a/Items/Weapons/Ranged/ProporsePistol.cs +++ b/Items/Weapons/Ranged/ProporsePistol.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 3d2e2ad53c..b3292b61a8 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 11f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/RaidersGlory.cs b/Items/Weapons/Ranged/RaidersGlory.cs index e9455cec62..ef08ed1baf 100644 --- a/Items/Weapons/Ranged/RaidersGlory.cs +++ b/Items/Weapons/Ranged/RaidersGlory.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 15f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 10; diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index 70688250dc..da4d1c8c9d 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -33,7 +33,8 @@ 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/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 912f0250ec..786a4e731a 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -39,7 +39,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity14BuyPrice; item.Calamity().customRarity = CalamityRarity.DarkBlue; item.Calamity().donorItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 40; diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index b92f2bf714..db5d24a737 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -37,7 +37,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 16f; item.useAmmo = AmmoID.Bullet; item.Calamity().customRarity = CalamityRarity.DarkBlue; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 15; diff --git a/Items/Weapons/Ranged/SandstormGun.cs b/Items/Weapons/Ranged/SandstormGun.cs index e3a070c1a5..b4ecebc218 100644 --- a/Items/Weapons/Ranged/SandstormGun.cs +++ b/Items/Weapons/Ranged/SandstormGun.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Sand; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/Seabow.cs b/Items/Weapons/Ranged/Seabow.cs index 88ea30d220..3c457a1b88 100644 --- a/Items/Weapons/Ranged/Seabow.cs +++ b/Items/Weapons/Ranged/Seabow.cs @@ -33,7 +33,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 88f2b8952c..5031c0d67e 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index eafb4117c4..d996f36aeb 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; - } + 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 3239ae9374..02e0b70984 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1.5f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 15; diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 37782e74e5..a3e65695b0 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -36,7 +36,8 @@ 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(-5, 0); diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 82f7ab4ab1..41e50b4277 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -32,7 +32,8 @@ 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 public override void GetWeaponCrit(Player player, ref int crit) => crit += 35; diff --git a/Items/Weapons/Ranged/SlagMagnum.cs b/Items/Weapons/Ranged/SlagMagnum.cs index 0b20d445bd..0906533a84 100644 --- a/Items/Weapons/Ranged/SlagMagnum.cs +++ b/Items/Weapons/Ranged/SlagMagnum.cs @@ -32,7 +32,8 @@ 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 b04090c06e..b32aa6ea8b 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -36,7 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity16BuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; item.Calamity().devItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 40; diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index de9976da87..576599aa0f 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.Flare; item.shootSpeed = 9.5f; item.useAmmo = AmmoID.Flare; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/SpectreRifle.cs b/Items/Weapons/Ranged/SpectreRifle.cs index fb6d7094d7..e8eb645419 100644 --- a/Items/Weapons/Ranged/SpectreRifle.cs +++ b/Items/Weapons/Ranged/SpectreRifle.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.LostSoulFriendly; item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 22; diff --git a/Items/Weapons/Ranged/StormDragoon.cs b/Items/Weapons/Ranged/StormDragoon.cs index d4b0f1c398..bb848061a3 100644 --- a/Items/Weapons/Ranged/StormDragoon.cs +++ b/Items/Weapons/Ranged/StormDragoon.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 18f; item.useAmmo = AmmoID.Bullet; - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index 6d0280ffd7..abdf89fff4 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -36,7 +36,8 @@ 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); diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 947b4357db..346e55e7e0 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -32,7 +32,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index 88451afad2..c6e9cd92cc 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item14; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 11f; + item.shootSpeed = 14.5f; item.useAmmo = AmmoID.Bullet; } diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index 54d92d0889..d01476ce31 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -32,7 +32,8 @@ 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, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/Triploon.cs b/Items/Weapons/Ranged/Triploon.cs index d912265222..c867012af2 100644 --- a/Items/Weapons/Ranged/Triploon.cs +++ b/Items/Weapons/Ranged/Triploon.cs @@ -33,7 +33,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); - } + item.Calamity().canFirePointBlankShots = true; + } public override Vector2? HoldoutOffset() { diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 2506f776bb..60ea879ec3 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; 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 19d0b237cf..4454ddcbbf 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -43,7 +43,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity14BuyPrice; item.Calamity().customRarity = CalamityRarity.DarkBlue; item.Calamity().donorItem = true; - } + item.Calamity().canFirePointBlankShots = true; + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index 1660639d10..0d62042ba2 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = AmmoID.Arrow; - } + item.Calamity().canFirePointBlankShots = true; + } public override void AddRecipes() { diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index af511ced9e..c56e6934f7 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 272; + item.damage = 259; item.knockBack = 6f; item.useAnimation = item.useTime = 20; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 709098ebd9..5ea623f27b 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -9,45 +9,44 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Eradicator : RogueWeapon { + public static float Speed = 10.5f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Eradicator"); Tooltip.SetDefault("Throws a disk that fires lasers at nearby enemies\n" + - "Stealth strikes stick to enemies and unleash a barrage of lasers in all directions"); + "Stealth strikes stick to enemies and unleash a barrage of lasers in all directions"); } public override void SafeSetDefaults() { item.width = 38; - item.damage = 270; + item.damage = 410; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; - item.useAnimation = 19; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 19; + item.useTime = 33; + item.useAnimation = 33; item.knockBack = 7f; item.UseSound = SoundID.Item1; item.height = 54; - item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; + item.value = CalamityGlobalItem.Rarity14BuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = Speed; item.Calamity().rogue = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.Calamity().StealthStrikeAvailable()) - damage = (int)(damage * 0.4); + damage = (int)(damage * 0.66D); int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].Calamity().stealthStrike = true; - Main.projectile[proj].timeLeft *= 2; - } + if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) + Main.projectile[proj].Calamity().stealthStrike = true; return false; } diff --git a/Items/Weapons/Rogue/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index 16b39952a0..9bc6ada7d3 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -11,18 +11,17 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Refraction Rotor"); - Tooltip.SetDefault("Fires a large prismatic razorblade\n" + - "After hitting something, the blade dies moments later\n" + - "The blade explodes into rockets on death\n" + - "Stealth strikes explode into more rockets on death"); + Tooltip.SetDefault("Fires a huge prismatic disk shuriken\n" + + "The shuriken shatters moments after impact into homing rockets\n" + + "Stealth strikes shatter into many more rockets"); } public override void SafeSetDefaults() { item.width = item.height = 120; - item.damage = 110; + item.damage = 660; item.knockBack = 8.5f; - item.useAnimation = item.useTime = 14; + item.useAnimation = item.useTime = 17; item.Calamity().rogue = true; item.autoReuse = true; item.shootSpeed = 18f; @@ -39,6 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (player.Calamity().StealthStrikeAvailable()) + damage = (int)(damage * 0.75D); + int shuriken = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && Main.projectile.IndexInRange(shuriken)) Main.projectile[shuriken].Calamity().stealthStrike = true; diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index c3665fa0c6..df429d45e3 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Rogue DisplayName.SetDefault("Sacrifice"); Tooltip.SetDefault("Releases a dagger that sticks to enemies\n" + "Right clicking causes all stuck daggers to fly back at you and give you life\n" + - "Daggers stuck to enemies release bloodsplosions over time"); + "Daggers stuck to enemies release bloodsplosions over time\n" + + "Stealth strikes provide much more life when returning to you"); } public override void SafeSetDefaults() @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } - public override bool AltFunctionUse(Player player) => true; + public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[item.shoot] > 0; public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { diff --git a/Items/Weapons/Rogue/TheAtomSplitter.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs index 18635adb8b..d37d9ee856 100644 --- a/Items/Weapons/Rogue/TheAtomSplitter.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -11,16 +11,16 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("The Atom Splitter"); - Tooltip.SetDefault("Fires a javelin that releases energy duplicates at enemies it hits\n" + - "Stealth strikes release duplicates much more quickly"); + Tooltip.SetDefault("Throws a quantum-superimposed javelin that strikes from numerous timelines at once\n" + + "Stealth strikes perform far more simultaneous strikes"); } public override void SafeSetDefaults() { item.width = item.height = 128; - item.damage = 256; + item.damage = 456; item.knockBack = 7f; - item.useAnimation = item.useTime = 14; + item.useAnimation = item.useTime = 25; item.Calamity().rogue = true; item.autoReuse = true; item.shootSpeed = 24f; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index ed08789e23..7bc6ada075 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -12,8 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon { DisplayName.SetDefault("Perdition"); Tooltip.SetDefault("Summons a beacon at the position of the mouse\n" + - "When a target is manually selected via right click it releases torrents of souls from below onto the target\n" + - "The beacon does not move"); + "When a target is manually selected via right click it releases torrents of souls from below onto the target"); } public override void SetDefaults() diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.cs b/Items/Weapons/Typeless/FiniteUse/Magnum.cs index 28be93b197..40baee1e7e 100644 --- a/Items/Weapons/Typeless/FiniteUse/Magnum.cs +++ b/Items/Weapons/Typeless/FiniteUse/Magnum.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse public override void SetDefaults() { item.damage = 80; - item.width = 46; - item.height = 24; + item.width = 52; + item.height = 28; item.useTime = 25; item.useAnimation = 25; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.png b/Items/Weapons/Typeless/FiniteUse/Magnum.png index 10f48dd4eb..8e1aa0e9f4 100644 Binary files a/Items/Weapons/Typeless/FiniteUse/Magnum.png and b/Items/Weapons/Typeless/FiniteUse/Magnum.png differ diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 2a0af9787e..d7798bcc38 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -577,7 +577,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs index dab9292565..1b9d7ad58f 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 60; npc.height = 88; npc.defense = 0; - npc.LifeMaxNERB(1750000, 2012500); + npc.LifeMaxNERB(2100000, 2415000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.cs b/NPCs/Abyss/EidolonWyrmBodyHuge.cs index 6b6f7a32b3..8d975e6f76 100644 --- a/NPCs/Abyss/EidolonWyrmBodyHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyHuge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 60; npc.height = 88; npc.defense = 0; - npc.LifeMaxNERB(1750000, 2012500); + npc.LifeMaxNERB(2100000, 2415000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index c55de5c02b..1e937bdafa 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.Abyss npc.DR_NERD(0.4f); CalamityGlobalNPC global = npc.Calamity(); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); - npc.LifeMaxNERB(1750000, 2012500); + npc.LifeMaxNERB(2100000, 2415000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/Abyss/EidolonWyrmTailHuge.cs b/NPCs/Abyss/EidolonWyrmTailHuge.cs index 0c16cde15c..f4884a0383 100644 --- a/NPCs/Abyss/EidolonWyrmTailHuge.cs +++ b/NPCs/Abyss/EidolonWyrmTailHuge.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 86; npc.height = 120; npc.defense = 0; - npc.LifeMaxNERB(1750000, 2012500); + npc.LifeMaxNERB(2100000, 2415000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2.png b/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2.png new file mode 100644 index 0000000000..80988be266 Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusBodyGlow3.png b/NPCs/AstrumDeus/AstrumDeusBodyGlow3.png new file mode 100644 index 0000000000..a84bb78a17 Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusBodyGlow3.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusBodyGlow4.png b/NPCs/AstrumDeus/AstrumDeusBodyGlow4.png new file mode 100644 index 0000000000..30363b9f3d Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusBodyGlow4.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index f4ac21e06f..3a3c4ffa73 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -80,7 +80,11 @@ namespace CalamityMod.NPCs.AstrumDeus if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral") : Main.npcTexture[npc.type]; + bool altBodyTextures = npc.localAI[3] == 1f; + bool drawCyan = npc.Calamity().newAI[3] >= 600f; + bool doubleWormPhase = npc.Calamity().newAI[0] != 0f; + + Texture2D texture2D15 = altBodyTextures ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral") : Main.npcTexture[npc.type]; Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2"); Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Color color36 = Color.White; @@ -107,10 +111,15 @@ namespace CalamityMod.NPCs.AstrumDeus vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow"); - Color phaseColor = npc.Calamity().newAI[3] >= 600f ? Color.Cyan : Color.Orange; - Color color37 = Color.Lerp(Color.White, npc.Calamity().newAI[0] != 0f ? phaseColor : Color.Cyan, 0.5f) * npc.Opacity; - Color color42 = Color.Lerp(Color.White, npc.Calamity().newAI[0] != 0f ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; + texture2D15 = altBodyTextures ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow"); + Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; + if (doubleWormPhase) + { + texture2D15 = drawCyan ? texture2D15 : (altBodyTextures ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltGlow2") : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow3")); + texture2D16 = drawCyan ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow4") : texture2D16; + } + Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; if (CalamityConfig.Instance.Afterimages) { @@ -124,7 +133,7 @@ namespace CalamityMod.NPCs.AstrumDeus vector44 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - if (npc.localAI[3] != 1f) + if (!altBodyTextures) { Color color43 = color42; color43 = Color.Lerp(color43, color36, amount9); @@ -134,10 +143,16 @@ namespace CalamityMod.NPCs.AstrumDeus } } - spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + int timesToDraw = drawCyan ? 1 : 2; + for (int i = 0; i < timesToDraw; i++) + spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - if (npc.localAI[3] != 1f) - spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + if (!altBodyTextures) + { + timesToDraw = drawCyan ? 2 : 1; + for (int i = 0; i < timesToDraw; i++) + spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + } return false; } diff --git a/NPCs/AstrumDeus/AstrumDeusHeadGlow3.png b/NPCs/AstrumDeus/AstrumDeusHeadGlow3.png new file mode 100644 index 0000000000..fc07ca9a11 Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusHeadGlow3.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusHeadGlow4.png b/NPCs/AstrumDeus/AstrumDeusHeadGlow4.png new file mode 100644 index 0000000000..cfa0f73fb3 Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusHeadGlow4.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 2723515d0a..a156498159 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -95,6 +95,9 @@ namespace CalamityMod.NPCs.AstrumDeus if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; + bool drawCyan = npc.Calamity().newAI[3] >= 600f; + bool doubleWormPhase = npc.Calamity().newAI[0] != 0f; + Texture2D texture2D15 = Main.npcTexture[npc.type]; Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2"); Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); @@ -123,9 +126,14 @@ namespace CalamityMod.NPCs.AstrumDeus spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow"); - Color phaseColor = npc.Calamity().newAI[3] >= 600f ? Color.Cyan : Color.Orange; - Color color37 = Color.Lerp(Color.White, npc.Calamity().newAI[0] != 0f ? phaseColor : Color.Cyan, 0.5f) * npc.Opacity; - Color color42 = Color.Lerp(Color.White, npc.Calamity().newAI[0] != 0f ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; + Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; + if (doubleWormPhase) + { + texture2D15 = drawCyan ? texture2D15 : ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow3"); + texture2D16 = drawCyan ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow4") : texture2D16; + } + Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Cyan, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; if (CalamityConfig.Instance.Afterimages) { @@ -146,9 +154,13 @@ namespace CalamityMod.NPCs.AstrumDeus } } - spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + int timesToDraw = drawCyan ? 1 : 2; + for (int i = 0; i < timesToDraw; i++) + spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + timesToDraw = drawCyan ? 2 : 1; + for (int i = 0; i < timesToDraw; i++) + spriteBatch.Draw(texture2D16, vector43, npc.frame, color42, npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/AstrumDeus/AstrumDeusTailGlow2.png b/NPCs/AstrumDeus/AstrumDeusTailGlow2.png new file mode 100644 index 0000000000..b511857357 Binary files /dev/null and b/NPCs/AstrumDeus/AstrumDeusTailGlow2.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index ffcde84d21..27a4014a79 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -80,6 +80,9 @@ namespace CalamityMod.NPCs.AstrumDeus if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; + bool drawCyan = npc.Calamity().newAI[3] >= 600f; + bool doubleWormPhase = npc.Calamity().newAI[0] != 0f; + Texture2D texture2D15 = Main.npcTexture[npc.type]; Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Color color36 = Color.White; @@ -107,8 +110,12 @@ namespace CalamityMod.NPCs.AstrumDeus spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow"); - Color phaseColor = npc.Calamity().newAI[3] >= 600f ? Color.Cyan : Color.Orange; - Color color37 = Color.Lerp(Color.White, npc.Calamity().newAI[0] != 0f ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; + Color phaseColor = drawCyan ? Color.Cyan : Color.Orange; + if (doubleWormPhase) + { + texture2D15 = drawCyan ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow2") : texture2D15; + } + Color color37 = Color.Lerp(Color.White, doubleWormPhase ? phaseColor : Color.Orange, 0.5f) * npc.Opacity; if (CalamityConfig.Instance.Afterimages) { @@ -124,7 +131,9 @@ namespace CalamityMod.NPCs.AstrumDeus } } - spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + int timesToDraw = drawCyan ? 2 : 1; + for (int i = 0; i < timesToDraw; i++) + spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); return false; } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index ce4e8dccf5..274b8c4afa 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -6326,15 +6326,21 @@ namespace CalamityMod.NPCs npc.TargetClosest(); float enrageScale = 0f; - if (Main.dayTime || malice) - enrageScale += 1f; - if (BossRushEvent.BossRushActive) - enrageScale += 0.5f; - if (enraged) - enrageScale += 0.5f; + if (Main.dayTime || malice) + { + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + enrageScale += 1f; + } + if (BossRushEvent.BossRushActive) + enrageScale += 0.5f; + if (enraged) + { + npc.Calamity().CurrentlyEnraged = true; + enrageScale += 0.5f; + } - // Enrage variable if player is floating upside down - bool targetFloatingUp = Main.player[npc.target].gravDir == -1f; + // Enrage variable if player is floating upside down + bool targetFloatingUp = Main.player[npc.target].gravDir == -1f; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -7230,6 +7236,8 @@ namespace CalamityMod.NPCs npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + bool normalLaserRotation = calamityGlobalNPC.newAI[3] % 2f == 0f; + // Float near player if (npc.ai[1] == 0f || npc.ai[1] == 4f) { @@ -7277,14 +7285,15 @@ namespace CalamityMod.NPCs double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX2 = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = Main.rand.NextBool() ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); + Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 300; } - } + calamityGlobalNPC.newAI[3] += 1f; + } } // Spread of rockets if cannon is dead @@ -7429,14 +7438,15 @@ namespace CalamityMod.NPCs double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = Main.rand.NextBool() ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); + Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 300; } - } + calamityGlobalNPC.newAI[3] += 1f; + } } npc.ai[2] += 1f; @@ -7783,6 +7793,8 @@ namespace CalamityMod.NPCs else npc.damage = npc.defDamage; + bool normalLaserRotation = npc.localAI[1] % 2f == 0f; + // Phase 1 if (npc.ai[2] == 0f) { @@ -7972,14 +7984,15 @@ namespace CalamityMod.NPCs double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = Main.rand.NextBool() ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); + Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); int proj = Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = enraged ? 600 : 300; } - } + npc.localAI[1] += 1f; + } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 27a4a28a04..fe3ee4c34a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5,9 +5,10 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; -using CalamityMod.Items; +using CalamityMod.Items.Tools; using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; @@ -90,6 +91,9 @@ namespace CalamityMod.NPCs /// public bool canBreakPlayerDefense = false; + // Total defense loss from some true melee hits and other things that reduce defense + public int miscDefenseLoss = 0; + // Distance values for when bosses increase velocity to catch up to their target public const float CatchUpDistance200Tiles = 3200f; public const float CatchUpDistance350Tiles = 5600f; @@ -1190,6 +1194,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.death) npc.lifeMax = (int)(npc.lifeMax * 0.5); } + if (npc.type == NPCID.Mothron) { npc.scale = 1.25f; @@ -1228,11 +1233,13 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.GolemHeadFree) { npc.lifeMax = (int)(npc.lifeMax * 1.7); + npc.width = 88; + npc.height = 90; npc.dontTakeDamage = false; } else if (npc.type == NPCID.Plantera) { - npc.lifeMax = (int)(npc.lifeMax * 2.6); + npc.lifeMax = (int)(npc.lifeMax * 3.0); npc.npcSlots = 32f; } else if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye) @@ -1822,7 +1829,8 @@ namespace CalamityMod.NPCs (gState > 0 ? GlacialState.DefenseReduction : 0) - (aCrunch > 0 ? ArmorCrunch.DefenseReduction : 0) - (marked > 0 && DR <= 0f ? MarkedforDeath.DefenseReduction : 0) - - Main.LocalPlayer.armorPenetration; + Main.LocalPlayer.armorPenetration - + miscDefenseLoss; // Defense can never be negative and has a minimum value of zero. if (effectiveDefense < 0) @@ -3196,7 +3204,7 @@ namespace CalamityMod.NPCs if (npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && - npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; @@ -3704,7 +3712,13 @@ namespace CalamityMod.NPCs if (modPlayer.camper && !player.StandingStill()) damage = (int)(damage * 0.1); - if (npc.type == NPCType()) + // True melee resists + if (AquaticScourgeIDs.Contains(npc.type) || DestroyerIDs.Contains(npc.type) || AstrumDeusIDs.Contains(npc.type) || StormWeaverIDs.Contains(npc.type) || ThanatosIDs.Contains(npc.type) || npc.type == NPCType()) + { + if (item.melee && item.type != ItemType() && item.type != ItemType()) + damage = (int)(damage * 0.5); + } + else if (npc.type == NPCType()) { if (item.type == ItemType()) damage = (int)(damage * 0.75); @@ -3725,283 +3739,194 @@ namespace CalamityMod.NPCs CalamityGlobalTownNPC.MakeTownNPCsTakeMoreDamage(npc, projectile, mod, ref damage); - if (modPlayer.camper && !player.StandingStill()) - damage = (int)(damage * 0.1); - if (!projectile.npcProj && !projectile.trap) { if (projectile.ranged && modPlayer.plagueReaper && pFlames > 0) damage = (int)(damage * 1.1); } - // Nerfed because these are really overpowered + // 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.ranged) + { + if (projectile.Calamity().pointBlankShotDuration > 0) + { + projectile.Calamity().pointBlankShotDuration = 0; + damage = (int)(damage * 1.5); + } + } + + // Nerfed because these are really overpowered. if (projectile.type == ProjectileID.CursedDartFlame) damage /= 2; - // Expert Mode resists, mostly worms - if (Main.expertMode) + // Nerf Mushroom Spear mushrooms. + if (projectile.type == ProjectileID.Mushroom && Main.player[projectile.owner].ActiveItem().type == ItemID.MushroomSpear) + damage /= 2; + + if (projectile.type == ProjectileID.SeedlerNut || projectile.type == ProjectileID.SeedlerThorn) + damage /= 3; + + if (CalamityLists.pierceResistList.Contains(npc.type)) + PierceResistGlobal(projectile, npc, ref damage); + + if (ThanatosIDs.Contains(npc.type)) { - if (ThanatosIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } - else if (AstrumDeusIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - - if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.25); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.5); - } - else if (projectile.type == ProjectileID.Electrosphere) - { - damage = (int)(damage * 0.6); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileID.InfernoFriendlyBolt || projectile.type == ProjectileID.InfernoFriendlyBlast || projectile.type == ProjectileID.RainbowFront || projectile.type == ProjectileID.RainbowBack || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.ChargedBlasterLaser) - { - damage = (int)(damage * 0.75); - } - } - else if (npc.type == NPCType()) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } - else if (DevourerOfGodsIDs.Contains(npc.type)) - { - // No grenade or global pierce resist here, body DR covers this appropriately - - // 50% resist to Sealed Singularity - if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.5); - - // 25% resist to Wave Pounder - else if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.75); - - // 15% resist to Dark Spark - else if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.85); - } - else if (CosmicGuardianIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } - else if (npc.type == NPCType()) - { - // 50% resist to Nuclear Fury - if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.5); - - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } - else if (StormWeaverIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - - if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.9); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - if (projectile.penetrate == -1) - projectile.penetrate = projectile.Calamity().stealthStrike ? 6 : 9; - damage = (int)(damage * 0.75); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.5); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.5); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.4); - } - else if (ProjectileID.Sets.StardustDragon[projectile.type]) - { - damage = (int)(damage * 0.1); - } - } - else if (DestroyerIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.75); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.5); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.38); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.3); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.25); - } - } - else if (AquaticScourgeIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.9); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.75); - } - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.5); - } - else if (projectile.type == ProjectileType()) - { - if (projectile.penetrate == -1) - projectile.penetrate = 2; - damage = (int)(damage * 0.1); - } - } - else if (PerforatorIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } - else if (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper) - { - if (npc.type == NPCID.Creeper) - GrenadeResist(projectile, ref damage); - - PierceResistGlobal(projectile, ref damage); - - if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.7); - } - } - else if (DesertScourgeIDs.Contains(npc.type)) - { - GrenadeResist(projectile, ref damage); - PierceResistGlobal(projectile, ref damage); - } + // 50% resist to true melee. + if (projectile.Calamity().trueMelee) + damage = (int)(damage * 0.5); } - - if (DevourerOfGodsIDs.Contains(npc.type)) + else if (AstrumDeusIDs.Contains(npc.type)) { - if (projectile.Calamity().stealthStrike) + // 75% resist to Stardust Dragon Staff and Plaguenades. + if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + damage = (int)(damage * 0.25); + + // 50% resist to true melee. + else if (projectile.Calamity().trueMelee) + damage = (int)(damage * 0.5); + + // 25% resist to Lazhar, Inferno Fork, Cosmic Rainbow, Plague Staff, Resurrection Butterfly, Eidolon Staff and Charged Blaster Cannon. + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + damage = (int)(damage * 0.75); + } + else if (npc.type == NPCType()) + { + // 20% resist to Executioner's Blade stealth strikes. + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.8); + } + else if (DevourerOfGodsIDs.Contains(npc.type)) + { + // 15% increased damage from Time Bolt stealth strikes. + if (projectile.type == ProjectileType()) { - if (projectile.type == ProjectileType()) + if (projectile.Calamity().stealthStrike) damage = (int)(damage * 1.15); } - - if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.9); } - - // Other projectile resists - if (npc.type == NPCType()) + else if (npc.type == NPCType()) { + // 50% resist to true melee. + if (projectile.Calamity().trueMelee) + damage = (int)(damage * 0.5); + } + else if (StormWeaverIDs.Contains(npc.type)) + { + // 10% resist to Shattered Sun. + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.9); + + // 25% resist to Molten Amputator blobs. + else if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.75); + + // 50% resist to true melee, Elemental Axe, Dazzling Stabber Staff and Pristine Fury. + else if (projectile.Calamity().trueMelee || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + damage = (int)(damage * 0.5); + + // 90% resist to Stardust Dragon Staff. + else if (ProjectileID.Sets.StardustDragon[projectile.type]) + damage = (int)(damage * 0.1); + } + else if (DestroyerIDs.Contains(npc.type)) + { + // 25% resist to Spear of Paleolith, Desecrated Water, Kelvin Catalyst and Pearlwood Bow. + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + damage = (int)(damage * 0.75); + + // 50% resist to true melee and Dormant Brimseekers. + else if (projectile.Calamity().trueMelee || projectile.type == ProjectileType()) + damage = (int)(damage * 0.5); + } + else if (AquaticScourgeIDs.Contains(npc.type)) + { + // 50% resist to true melee and Dormant Brimseekers. + if (projectile.Calamity().trueMelee || projectile.type == ProjectileType()) + damage = (int)(damage * 0.5); + } + else if (npc.type == NPCType()) + { + // 20.5% resist to Time Bolt. if (projectile.type == ProjectileType()) damage = (int)(damage * 0.795); - if (projectile.type == ProjectileType() || projectile.type == ProjectileID.FlamingJack) + // 61% resist to Last Mourning. + else if (projectile.type == ProjectileType() || projectile.type == ProjectileID.FlamingJack) damage = (int)(damage * 0.39); } else if (npc.type == NPCType()) { + // 5% resist to Celestial Reaper. if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) damage = (int)(damage * 0.95); } else if (npc.type == NPCType()) { + // 5% resist to Celestial Reaper. if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) damage = (int)(damage * 0.95); } - else if (npc.type == NPCType()) - { - if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.5); - } else if (npc.type == NPCType()) { - // For Onyxia. + // 10% resist to Onyxia. if (projectile.type == ProjectileID.BlackBolt) damage = (int)(damage * 0.9); } else if (npc.type == NPCType() || npc.type == NPCType()) { + // 10% resist to Phoenix Flame Barrage. if (projectile.type == ProjectileType()) damage = (int)(damage * 0.9); } - else if (npc.type == NPCType()) - { - if (projectile.type == ProjectileType()) - damage = (int)(damage * 0.8); - } else if (npc.type == NPCType()) { + // 30% resist to Murasama. if (projectile.type == ProjectileType()) damage = (int)(damage * 0.7); - if (projectile.type == ProjectileType()) + + // 25% resist to Yharim's Crystal. + else if (projectile.type == ProjectileType()) damage = (int)(damage * 0.75); - if (projectile.type == ProjectileType()) + + // 10% resist to Executioner's Blade stealth strikes. + else if (projectile.type == ProjectileType()) damage = (int)(damage * 0.9); } else if (npc.type == NPCID.CultistBoss) { + // 25% resist to Resurrection Butterfly. if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) damage = (int)(damage * 0.75); } else if (npc.type == NPCID.DukeFishron) { + // 35% increased damage from Resurrection Butterfly. if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) damage = (int)(damage * 1.35); } + + if (modPlayer.camper && !player.StandingStill()) + damage = (int)(damage * 0.1); } - private void GrenadeResist(Projectile projectile, ref int damage) + private void PierceResistGlobal(Projectile projectile, NPC npc, ref int damage) { if (GrenadeResistIDs.Contains(projectile.type)) - damage = (int)(damage * 0.2); - } - - private void PierceResistGlobal(Projectile projectile, ref int damage) - { - if (projectile.IsSummon() || projectile.aiStyle == 99) - return; - - if (projectile.penetrate == -1) { - damage = (int)(damage * 0.5); - } - else if (projectile.penetrate > 1) - { - float newBaseDamage = damage * (float)Math.Pow(0.9, projectile.penetrate) / projectile.Calamity().ResistDamagePenaltyHarshness; - damage = (int)MathHelper.Clamp(newBaseDamage, damage * projectile.Calamity().ResistDamagePenaltyMinCapFactor, damage); + if (!EaterofWorldsIDs.Contains(npc.type)) + damage = (int)(damage * 0.2); + else if (!Main.expertMode) + damage = (int)(damage * 0.2); } + + float damageReduction = projectile.Calamity().timesPierced * projectile.Calamity().PierceResistHarshness; + if (damageReduction > projectile.Calamity().PierceResistCap) + damageReduction = projectile.Calamity().PierceResistCap; + + damage -= (int)(damage * damageReduction); + + if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !projectile.IsSummon() && projectile.aiStyle != 99) + projectile.Calamity().timesPierced++; } #endregion @@ -4903,6 +4828,21 @@ namespace CalamityMod.NPCs return false; } + if (npc.type == NPCID.GolemHeadFree) + { + // Draw the head as usual. + Texture2D golemHeadTexture = Main.npcTexture[npc.type]; + Vector2 headDrawPosition = npc.Center + Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + spriteBatch.Draw(golemHeadTexture, headDrawPosition, npc.frame, npc.GetAlpha(drawColor), 0f, npc.frame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + + // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. + Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); + Vector2 eyesDrawPosition = headDrawPosition - npc.scale * new Vector2(1f, 12f); + Rectangle eyesFrame = new Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2); + spriteBatch.Draw(Main.golemTexture[1], eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f); + return false; + } + if (Main.LocalPlayer.Calamity().trippy) { SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index d3c2e2fb14..e7f6f32399 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Cryogen npc.width = 86; npc.height = 88; npc.defense = 12; - npc.DR_NERD(0.1f); + npc.DR_NERD(0.3f); npc.LifeMaxNERB(18795, 27615, 300000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); @@ -992,8 +992,27 @@ namespace CalamityMod.NPCs.Cryogen Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryoChipGore" + i), 1f); currentPhase = newPhase; - } + switch (currentPhase) + { + case 0: + case 1: + break; + case 2: + npc.Calamity().DR = 0.27f; + break; + case 3: + npc.Calamity().DR = 0.21f; + break; + case 4: + npc.Calamity().DR = 0.12f; + break; + case 5: + case 6: + npc.Calamity().DR = 0f; + break; + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures { diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index d4a60a001d..5f46bb5c3a 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Other { npc.width = 68; npc.height = 68; - npc.damage = 0; + npc.damage = 270; npc.defense = 0; // This is meant to be created after SCal is defeated and should be at least a little challenging. diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index d191adca3f..fccc9ca839 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -622,6 +622,6 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Weak, 300, true); - } + } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index d88d886bc5..1ce4c50f6a 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -737,6 +737,8 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 120, true); - } + player.AddBuff(BuffID.Weak, 120, true); + player.AddBuff(BuffID.Darkness, 120, true); + } } } diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 83216147d2..8d820be23e 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -631,7 +631,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 120, true); - } + player.AddBuff(BuffID.Darkness, 300, true); + } } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index e696bad571..0e21bacfe2 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -627,7 +627,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 45, true); - } + player.AddBuff(BuffID.Darkness, 120, true); + } } } diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 655062459a..82451a5909 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -620,7 +620,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 120, true); - } + player.AddBuff(BuffID.Weak, 120, true); + } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index f18304783f..7a7605dbb9 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 90, true); - } + player.AddBuff(BuffID.Weak, 90, true); + } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index a8a73973e2..5d8e7756fe 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Weak, 90, true); - } + player.AddBuff(BuffID.Weak, 90, true); + } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index e279b841b3..272da43c7e 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -53,12 +53,12 @@ namespace CalamityMod.NPCs.SlimeGod public override void NPCLoot() { - DropHelper.DropItemChance(npc, ItemID.Nazar, Main.expertMode ? 50 : 100); + DropHelper.DropItemChance(npc, ItemID.Blindfold, Main.expertMode ? 50 : 100); } public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 30, true); - } + player.AddBuff(BuffID.Darkness, 90, true); + } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index 6396750e57..41a8fc097d 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -113,12 +113,12 @@ namespace CalamityMod.NPCs.SlimeGod public override void NPCLoot() { - DropHelper.DropItemChance(npc, ItemID.Nazar, Main.expertMode ? 50 : 100); + DropHelper.DropItemChance(npc, ItemID.Blindfold, Main.expertMode ? 50 : 100); } public override void OnHitPlayer(Player player, int damage, bool crit) { - player.AddBuff(BuffID.Cursed, 30, true); - } + player.AddBuff(BuffID.Darkness, 90, true); + } } } diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 501b36265e..913ddad300 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -98,7 +98,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else npc.alpha = HeadSegment.alpha; - AttackTimer += CalamityWorld.malice ? 2f : 1f; + AttackTimer += CalamityWorld.malice ? 1.5f : 1f; if (AttackTimer >= 900f) { AttackTimer = 0f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 1242739ac4..a9f7d1da88 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2,12 +2,14 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.Tools; +using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -200,6 +202,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; music = CalamityMod.Instance.GetMusicFromMusicMod("SCG") ?? MusicID.Boss2; + bossBag = ModContent.ItemType(); } public override void BossHeadSlot(ref int index) @@ -2736,6 +2739,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Make the town NPC spawn. NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 12, ModContent.NPCType()); + DropHelper.DropBags(npc); + // Increase the player's SCal kill count if (Main.player[npc.target].Calamity().sCalKillCount < 5) Main.player[npc.target].Calamity().sCalKillCount++; @@ -2748,32 +2753,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas int essenceMax = Main.expertMode ? 40 : 30; DropHelper.DropItem(npc, ModContent.ItemType(), true, essenceMin, essenceMax); - // Weapons - // Rejoice! Hybrid weapons are no more, so this list is no longer cluttered. - DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode, - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), // Flamsteed Ring - ModContent.ItemType(), // Illustrious Knives - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), // Staff of Blushie - ModContent.ItemType(), - ModContent.ItemType(), // Temporal Umbrella - ModContent.ItemType(), // The Dance of Light - ModContent.ItemType(), - ModContent.ItemType() // Voidragon - ); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityWorld.revenge); + if (!Main.expertMode) + { + // Weapons. + float w = DropHelper.NormalWeaponDropRateFloat; + DropHelper.DropEntireWeightedSet(npc, + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); + + // Vanity. + if (Main.rand.NextBool(7)) + { + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); + } + } // Vanity DropHelper.DropItem(npc, ModContent.ItemType(), Main.expertMode); diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 0313ce6017..a86bed73e7 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -4,10 +4,7 @@ using CalamityMod.Items; using CalamityMod.Projectiles.Magic; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; -using Microsoft.Xna.Framework; -using System.Collections.Generic; using Terraria; -using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; @@ -54,7 +51,7 @@ namespace CalamityMod.NPCs.TownNPCs animationType = NPCID.Wizard; } - public override bool CanTownNPCSpawn(int numTownNPCs, int money) => CalamityWorld.downedSCal; + public override bool CanTownNPCSpawn(int numTownNPCs, int money) => CalamityWorld.downedSCal && !NPC.AnyNPCs(NPCType()); public override string TownNPCName() => "Calamitas"; diff --git a/Projectiles/Boss/AbyssBallVolley2.cs b/Projectiles/Boss/AbyssBallVolley2.cs index eda2d5205d..da550b14e6 100644 --- a/Projectiles/Boss/AbyssBallVolley2.cs +++ b/Projectiles/Boss/AbyssBallVolley2.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.timeLeft < 60) return; - target.AddBuff(BuffID.Cursed, 45); + target.AddBuff(BuffID.Darkness, 120); } } } diff --git a/Projectiles/Boss/AbyssMine2.cs b/Projectiles/Boss/AbyssMine2.cs index 6653b7e5c8..a34223c454 100644 --- a/Projectiles/Boss/AbyssMine2.cs +++ b/Projectiles/Boss/AbyssMine2.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Cursed, 90); + target.AddBuff(BuffID.Darkness, 240); } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 92dbedfac3..acaf027920 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -52,14 +52,21 @@ namespace CalamityMod.Projectiles // Damage Adjusters private bool setDamageValues = true; public float spawnedPlayerMinionDamageValue = 1f; - public float ResistDamagePenaltyHarshness = 1f; - public float ResistDamagePenaltyMinCapFactor = 0.5f; + public float PierceResistHarshness = 0.12f; + public float PierceResistCap = 0.8f; public int spawnedPlayerMinionProjectileDamageValue = 0; public int defDamage = 0; // Amount of extra updates that are set in SetDefaults. public int defExtraUpdates = -1; + // How many times this projectile has pierced. + public int timesPierced = 0; + + // Point-blank shot timer. + public int pointBlankShotDuration = 0; + public const int basePointBlankShotDuration = 12; + /// /// Allows hostile Projectiles to deal damage to the player's defense stat, used mostly for hard-hitting bosses. /// @@ -126,10 +133,83 @@ namespace CalamityMod.Projectiles switch (projectile.type) { + case ProjectileID.Bullet: + case ProjectileID.MeteorShot: + case ProjectileID.BulletHighVelocity: + case ProjectileID.ChlorophyteBullet: + case ProjectileID.CrystalBullet: + case ProjectileID.CursedBullet: + case ProjectileID.ExplosiveBullet: + case ProjectileID.GoldenBullet: + case ProjectileID.IchorBullet: + case ProjectileID.MoonlordBullet: + case ProjectileID.NanoBullet: + case ProjectileID.PartyBullet: + case ProjectileID.VenomBullet: + case ProjectileID.WoodenArrowFriendly: + case ProjectileID.BeeArrow: + case ProjectileID.BoneArrow: + case ProjectileID.ChlorophyteArrow: + case ProjectileID.CursedArrow: + case ProjectileID.FireArrow: + case ProjectileID.FrostArrow: + case ProjectileID.FrostburnArrow: + case ProjectileID.HellfireArrow: + case ProjectileID.HolyArrow: + case ProjectileID.IchorArrow: + case ProjectileID.JestersArrow: + case ProjectileID.MoonlordArrow: + case ProjectileID.PhantasmArrow: + case ProjectileID.ShadowFlameArrow: + case ProjectileID.UnholyArrow: + case ProjectileID.VenomArrow: + case ProjectileID.Hellwing: + case ProjectileID.Flare: + case ProjectileID.BlueFlare: + case ProjectileID.Seed: + case ProjectileID.CrystalDart: + case ProjectileID.CursedDart: + case ProjectileID.PoisonDartBlowgun: + case ProjectileID.SnowBallFriendly: + case ProjectileID.SandBallGun: + case ProjectileID.PearlSandBallGun: + case ProjectileID.CrimsandBallGun: + case ProjectileID.EbonsandBallGun: + case ProjectileID.PainterPaintball: + case ProjectileID.Harpoon: + case ProjectileID.DD2PhoenixBowShot: + case ProjectileID.PulseBolt: + case ProjectileID.Stake: + case ProjectileID.CandyCorn: + case ProjectileID.Blizzard: + case ProjectileID.LostSoulFriendly: + pointBlankShotDuration = basePointBlankShotDuration; + break; + case ProjectileID.FlamingJack: + case ProjectileID.Anchor: + case ProjectileID.Sunfury: + case ProjectileID.FlowerPow: + case ProjectileID.EnchantedBoomerang: + case ProjectileID.IceBoomerang: + case ProjectileID.FruitcakeChakram: projectile.extraUpdates = 1; break; + case ProjectileID.BlueMoon: + case ProjectileID.Flamarang: + projectile.extraUpdates = 2; + break; + + case ProjectileID.Arkhalis: + case ProjectileID.ButchersChainsaw: + projectile.scale = 1.5f; + break; + + case ProjectileID.MonkStaffT1: + projectile.scale = 3f; + break; + case ProjectileID.ShadowBeamHostile: projectile.timeLeft = 60; break; @@ -146,6 +226,10 @@ namespace CalamityMod.Projectiles projectile.penetrate = projectile.maxPenetrate = 1; break; + case ProjectileID.MonkStaffT2: + projectile.idStaticNPCHitCooldown = 18; + break; + case ProjectileID.Retanimini: case ProjectileID.MiniRetinaLaser: case ProjectileID.FlowerPetal: @@ -236,6 +320,12 @@ namespace CalamityMod.Projectiles canBreakPlayerDefense = affectedByMaliceModeVelocityMultiplier = true; break; + case ProjectileID.LastPrismLaser: + case ProjectileID.ChargedBlasterLaser: + PierceResistHarshness = 0.06f; + PierceResistCap = 0.4f; + break; + default: break; } @@ -255,6 +345,12 @@ namespace CalamityMod.Projectiles #region PreAI public override bool PreAI(Projectile projectile) { + if (!Main.player[projectile.owner].ActiveItem().IsAir && !Main.player[projectile.owner].ActiveItem().Calamity().canFirePointBlankShots) + pointBlankShotDuration = 0; + + if (pointBlankShotDuration > 0) + pointBlankShotDuration--; + if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index e52b822ca0..02b81cda59 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.hide = true; projectile.ownerHitCheck = true; projectile.melee = true; - projectile.scale = 1.3f; + projectile.scale = 1.75f; } public override void AI() diff --git a/Projectiles/Enemy/CrimsonSpike.cs b/Projectiles/Enemy/CrimsonSpike.cs index 5fca704356..16c948f9f8 100644 --- a/Projectiles/Enemy/CrimsonSpike.cs +++ b/Projectiles/Enemy/CrimsonSpike.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Enemy public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Cursed, 60); + target.AddBuff(BuffID.Darkness, 90); } public override void Kill(int timeLeft) diff --git a/Projectiles/Healing/RainHeal.cs b/Projectiles/Healing/RainHeal.cs index 7ba926fb5d..7ec71fe52d 100644 --- a/Projectiles/Healing/RainHeal.cs +++ b/Projectiles/Healing/RainHeal.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; + projectile.velocity *= 0.99f; + projectile.HealingProjectile(8, projectile.owner, 12f, 15f, false); float num498 = projectile.velocity.X * 0.2f; diff --git a/Projectiles/Healing/TerracottaProj.cs b/Projectiles/Healing/TerracottaProj.cs index fbf7809d65..25e4c0c8ec 100644 --- a/Projectiles/Healing/TerracottaProj.cs +++ b/Projectiles/Healing/TerracottaProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - projectile.velocity *= 0.95f; + projectile.velocity *= 0.99f; projectile.HealingProjectile(9, (int)projectile.ai[0], 8f, 15f, false, 300); float num498 = projectile.velocity.X * 0.2f; diff --git a/Projectiles/Magic/BlushieStaffProj.cs b/Projectiles/Magic/BlushieStaffProj.cs index e4b2f0fadb..4584a1e29a 100644 --- a/Projectiles/Magic/BlushieStaffProj.cs +++ b/Projectiles/Magic/BlushieStaffProj.cs @@ -26,7 +26,9 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.ignoreWater = true; projectile.magic = true; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override void AI() { diff --git a/Projectiles/Magic/DarkSparkBeam.cs b/Projectiles/Magic/DarkSparkBeam.cs index 8685c20a6d..19d4f71cf9 100644 --- a/Projectiles/Magic/DarkSparkBeam.cs +++ b/Projectiles/Magic/DarkSparkBeam.cs @@ -31,7 +31,9 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 15; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override void SendExtraAI(BinaryWriter writer) { diff --git a/Projectiles/Magic/EidolicWailSoundwave.cs b/Projectiles/Magic/EidolicWailSoundwave.cs index 8cf2ea2e50..e5b0f97d40 100644 --- a/Projectiles/Magic/EidolicWailSoundwave.cs +++ b/Projectiles/Magic/EidolicWailSoundwave.cs @@ -29,7 +29,9 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; projectile.timeLeft = 450; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override void AI() { diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.cs b/Projectiles/Magic/HadopelagicEchoSoundwave.cs index 3f00099ef9..57c09aec8e 100644 --- a/Projectiles/Magic/HadopelagicEchoSoundwave.cs +++ b/Projectiles/Magic/HadopelagicEchoSoundwave.cs @@ -35,7 +35,9 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; projectile.timeLeft = 450; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override void AI() { diff --git a/Projectiles/Magic/ManaMonster.cs b/Projectiles/Magic/ManaMonster.cs index 934b90e21c..8b82332280 100644 --- a/Projectiles/Magic/ManaMonster.cs +++ b/Projectiles/Magic/ManaMonster.cs @@ -88,11 +88,8 @@ namespace CalamityMod.Projectiles.Magic } } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - // Ensure damage is not absolutely obscene when hitting players. - damage = Main.rand.Next(150, 225); - } + // Ensure damage is not absolutely obscene when hitting players. + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = 102; public override bool CanDamage() => projectile.Opacity >= 1f; diff --git a/Projectiles/Magic/MelterNote1.cs b/Projectiles/Magic/MelterNote1.cs index ad042f3403..b7888c4edd 100644 --- a/Projectiles/Magic/MelterNote1.cs +++ b/Projectiles/Magic/MelterNote1.cs @@ -21,28 +21,23 @@ namespace CalamityMod.Projectiles.Magic projectile.localNPCHitCooldown = 5; projectile.tileCollide = false; projectile.ignoreWater = true; - projectile.Calamity().ResistDamagePenaltyHarshness = 1.65f; } public override void AI() { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; + projectile.velocity *= 0.985f; + if (projectile.localAI[0] == 0f) { projectile.scale += 0.02f; if (projectile.scale >= 1.25f) - { projectile.localAI[0] = 1f; - } } else if (projectile.localAI[0] == 1f) { projectile.scale -= 0.02f; if (projectile.scale <= 0.75f) - { projectile.localAI[0] = 0f; - } } } diff --git a/Projectiles/Magic/MelterNote2.cs b/Projectiles/Magic/MelterNote2.cs index 6c41fb1f68..c877cde6fd 100644 --- a/Projectiles/Magic/MelterNote2.cs +++ b/Projectiles/Magic/MelterNote2.cs @@ -21,28 +21,23 @@ namespace CalamityMod.Projectiles.Magic projectile.localNPCHitCooldown = 7; projectile.tileCollide = false; projectile.ignoreWater = true; - projectile.Calamity().ResistDamagePenaltyHarshness = 1.65f; } public override void AI() { - projectile.velocity.X *= 0.99f; - projectile.velocity.Y *= 0.99f; + projectile.velocity *= 0.99f; + if (projectile.localAI[0] == 0f) { projectile.scale += 0.02f; if (projectile.scale >= 1.25f) - { projectile.localAI[0] = 1f; - } } else if (projectile.localAI[0] == 1f) { projectile.scale -= 0.02f; if (projectile.scale <= 0.75f) - { projectile.localAI[0] = 0f; - } } } diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs index 0ed8ed8033..e26f49cc93 100644 --- a/Projectiles/Magic/SparklingBeam.cs +++ b/Projectiles/Magic/SparklingBeam.cs @@ -55,6 +55,8 @@ namespace CalamityMod.Projectiles.Magic projectile.timeLeft = 300; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 19; + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 875d18a6a5..0f7433da39 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = projectile.height = 26; + projectile.width = projectile.height = 32; projectile.friendly = true; projectile.ignoreWater = true; projectile.penetrate = 1; @@ -69,8 +69,8 @@ namespace CalamityMod.Projectiles.Magic // Helical brimstone dust from the back of the projectile. for (int i = -1; i <= 1; i += 2) { - float helixOffset = (float)Math.Sin(Time / 45f * MathHelper.TwoPi) * 11f * i; - Vector2 spawnOffset = new Vector2(helixOffset, -28f).RotatedBy(projectile.rotation); + float helixOffset = (float)Math.Sin(Time / 45f * MathHelper.TwoPi) * i * 8f; + Vector2 spawnOffset = new Vector2(helixOffset, 10f).RotatedBy(projectile.rotation); Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + spawnOffset, (int)CalamityDusts.Brimstone); brimstoneMagic.velocity = Vector2.Zero; diff --git a/Projectiles/Magic/Vehemence.png b/Projectiles/Magic/Vehemence.png index 940cd6a110..14fc508850 100644 Binary files a/Projectiles/Magic/Vehemence.png and b/Projectiles/Magic/Vehemence.png differ diff --git a/Projectiles/Magic/VehemenceHoldout.cs b/Projectiles/Magic/VehemenceHoldout.cs index 9052a882ed..f5cbe5d1a2 100644 --- a/Projectiles/Magic/VehemenceHoldout.cs +++ b/Projectiles/Magic/VehemenceHoldout.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Magic public ref float Time => ref projectile.ai[0]; public const int ChargeTime = 90; + public override string Texture => "CalamityMod/Items/Weapons/Magic/Vehemenc"; public override void SetStaticDefaults() { DisplayName.SetDefault("Vehemence"); @@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = projectile.height = 96; + projectile.width = projectile.height = 114; projectile.friendly = false; projectile.magic = false; projectile.tileCollide = false; @@ -80,11 +81,12 @@ namespace CalamityMod.Projectiles.Magic if (Main.dedServ) return; - Vector2 spawnOffset = projectile.velocity * 70f; + Vector2 spawnOffset = projectile.velocity * 94f; for (int i = 0; i < 18; i++) { - Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + spawnOffset + Main.rand.NextVector2CircularEdge(30f, 30f), (int)CalamityDusts.Brimstone); - brimstoneMagic.velocity = (projectile.Center + spawnOffset - brimstoneMagic.position).SafeNormalize(Vector2.Zero) * 2f + Owner.velocity; + Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + spawnOffset + Main.rand.NextVector2CircularEdge(20f, 20f), (int)CalamityDusts.Brimstone); + brimstoneMagic.velocity = (projectile.Center + spawnOffset - brimstoneMagic.position).SafeNormalize(Vector2.Zero) * 0.3f + Owner.velocity; + brimstoneMagic.velocity.Y -= 2f; brimstoneMagic.scale = 1.2f; brimstoneMagic.noGravity = true; } diff --git a/Projectiles/Magic/VehemenceHoldout.png b/Projectiles/Magic/VehemenceHoldout.png deleted file mode 100644 index 382701bacb..0000000000 Binary files a/Projectiles/Magic/VehemenceHoldout.png and /dev/null differ diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index cd10ef85a0..51ecb8c15f 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -53,7 +53,9 @@ namespace CalamityMod.Projectiles.Magic projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override void SendExtraAI(BinaryWriter writer) => writer.Write(projectile.localAI[1]); public override void ReceiveExtraAI(BinaryReader reader) => projectile.localAI[1] = reader.ReadSingle(); diff --git a/Projectiles/Melee/AftershockRock.cs b/Projectiles/Melee/AftershockRock.cs index 83270509ba..5b019aba3b 100644 --- a/Projectiles/Melee/AftershockRock.cs +++ b/Projectiles/Melee/AftershockRock.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Melee projectile.aiStyle = 14; projectile.friendly = true; projectile.penetrate = 6; + projectile.extraUpdates = 1; projectile.melee = true; projectile.ignoreWater = true; aiType = ProjectileID.BoulderStaffOfEarth; diff --git a/Projectiles/Melee/BrinySpout.cs b/Projectiles/Melee/BrinySpout.cs index 4db7e562e6..5045a576e4 100644 --- a/Projectiles/Melee/BrinySpout.cs +++ b/Projectiles/Melee/BrinySpout.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Melee projectile.tileCollide = false; projectile.ignoreWater = true; projectile.melee = true; - projectile.penetrate = 2; + projectile.penetrate = -1; projectile.alpha = 255; - projectile.timeLeft = 90; + projectile.timeLeft = 60; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 8; } diff --git a/Projectiles/Melee/MarianaProjectile.cs b/Projectiles/Melee/MarianaProjectile.cs index 999c67817c..c6bac1aa4d 100644 --- a/Projectiles/Melee/MarianaProjectile.cs +++ b/Projectiles/Melee/MarianaProjectile.cs @@ -18,14 +18,19 @@ namespace CalamityMod.Projectiles.Melee projectile.height = 16; projectile.friendly = true; projectile.melee = true; - projectile.penetrate = 3; - projectile.timeLeft = 120; + projectile.penetrate = 1; + projectile.timeLeft = 180; } - public override void AI() + public override bool? CanHitNPC(NPC target) => projectile.timeLeft < 150 && target.CanBeChasedBy(projectile); + + public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.2f, 0.8f); - } + + if (projectile.timeLeft < 150) + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 9f, 20f); + } public override Color? GetAlpha(Color lightColor) { diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 62588db1aa..9cdf90ee11 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -10,12 +10,20 @@ namespace CalamityMod.Projectiles.Melee public class PhotonRipperProjectile : ModProjectile { public Player Owner => Main.player[projectile.owner]; - public const int CrystalShootRate = 5; - public const int ChargeUpTime = 360; + public const float ZeroChargeDamageRatio = 0.36f; + public const float ToothDamageRatio = 0.1666667f; + public const int ToothShootRate = 5; // One chainsaw tooth is emitted every this many frames. + public const int ChargeUpTime = 150; public ref float Time => ref projectile.ai[0]; - public ref float OriginalDamage => ref projectile.ai[1]; + + // This is the damage dealt by the chainsaw teeth. It is recalculated every frame in two steps: + // 1) The chainsaw's damage itself is calculated as a long-lasting holdout (like Last Prism -- in case buffs wear off or similar) + // 2) The chainsaw teeth damage scales with charging up. The chainsaw's own damage does not. + public ref float ToothDamage => ref projectile.ai[1]; public float ChargeUpPower => MathHelper.Clamp((float)Math.Pow(Time / ChargeUpTime, 1.6D), 0f, 1f); - public override void SetStaticDefaults() => DisplayName.SetDefault("An extraordinarily cost inefficient chainsaw"); // Seriously though Draedon this seems a bit over the top lmfao. + + // Seriously though Draedon this seems a bit over the top lmfao. + public override void SetStaticDefaults() => DisplayName.SetDefault("Extraordinarily Cost-Inefficient Chainsaw"); public override void SetDefaults() { @@ -26,8 +34,9 @@ namespace CalamityMod.Projectiles.Melee projectile.tileCollide = false; projectile.melee = true; projectile.ownerHitCheck = true; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 8; + // No reason to ID-static the chainsaw -- multiple players can true melee simultaneously! + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -46,9 +55,13 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - PlayChainsawSounds(); + // Recalculate damage every frame for balance reasons, as this is a long-lasting holdout. + // This is important because you could start using it while benefitting from Auric Tesla standstill bonus, for example. + projectile.damage = (int)((Owner.ActiveItem()?.damage ?? 0) * Owner.MeleeDamage()); DetermineDamage(); + PlayChainsawSounds(); + // Determines the owner's position whilst incorporating their fullRotation field. // It uses vector transformation on a Z rotation matrix based on said rotation under the hood. // This is essentially just the pure mathematical definition of the RotatedBy method. @@ -65,7 +78,7 @@ namespace CalamityMod.Projectiles.Melee ManipulatePlayerValues(); EmitPrettyDust(); - if (Time % CrystalShootRate == CrystalShootRate - 1f) + if (Time % ToothShootRate == ToothShootRate - 1f) ReleasePrismTeeth(); // Prevent the projectile from dying normally. However, if anything for whatever reason @@ -86,16 +99,21 @@ namespace CalamityMod.Projectiles.Melee public void DetermineDamage() { - // Set the initial damage the moment it's created. - if (Main.myPlayer == projectile.owner && OriginalDamage == 0f) + // Set the initial tooth damage the instant the projectile is created. + if (Main.myPlayer == projectile.owner && ToothDamage == 0f) { - OriginalDamage = projectile.damage; + ToothDamage = ToothDamageRatio * projectile.damage; projectile.netUpdate = true; } // And then do time based damage calculations. This does not execute if the original damage is 0. - if (OriginalDamage != 0f) - projectile.damage = (int)MathHelper.SmoothStep(OriginalDamage * 0.36f, OriginalDamage, ChargeUpPower); + // This line covers adjusting tooth damage if the projectile's own damage changes. + if (ToothDamage != 0f) + { + float fullMult = ToothDamageRatio; + float zeroMult = ZeroChargeDamageRatio * ToothDamageRatio; + ToothDamage = (int)MathHelper.SmoothStep(projectile.damage * zeroMult, projectile.damage * fullMult, ChargeUpPower); + } } public void DetermineVisuals(Vector2 playerRotatedPosition) @@ -193,6 +211,7 @@ namespace CalamityMod.Projectiles.Melee float shootReach = MathHelper.SmoothStep(projectile.width * 1.8f, projectile.width * 5.3f + 16f, ChargeUpPower); // Incorporate item shoot speed into the range of the crystals. + // This means that projectile speed boosts will improve the range of the chainsaw. shootReach *= Owner.ActiveItem().shootSpeed; float distanceFromMouse = Owner.Distance(Main.MouseWorld); @@ -203,7 +222,7 @@ namespace CalamityMod.Projectiles.Melee if (distanceFromMouse < shootReach && distanceFromMouse > 40f) shootReach = distanceFromMouse + 32f; - Projectile.NewProjectile(Owner.Center, projectile.velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, shootReach, projectile.whoAmI); + Projectile.NewProjectile(Owner.Center, projectile.velocity, ModContent.ProjectileType(), (int)ToothDamage, 0f, projectile.owner, shootReach, projectile.whoAmI); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index a7ac09c06d..b6e58cdb05 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -18,21 +18,22 @@ namespace CalamityMod.Projectiles.Melee public ref float Time => ref projectile.ai[1]; public override void SetStaticDefaults() { - DisplayName.SetDefault("Prism Tooth"); + DisplayName.SetDefault("Photon Ripper"); ProjectileID.Sets.TrailingMode[projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[projectile.type] = 36; } public override void SetDefaults() { - projectile.scale = 0.6f; - projectile.width = projectile.height = 40; + projectile.width = 30; + projectile.height = 52; projectile.friendly = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 5; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4 * projectile.MaxUpdates; + projectile.usesIDStaticNPCImmunity = true; + // THIS IS INTENTIONALLY VERY LOW. Do not increase this; it is essential for Photon Ripper to function properly. + projectile.idStaticNPCHitCooldown = 4; projectile.timeLeft = Lifetime; projectile.melee = true; } @@ -75,6 +76,8 @@ namespace CalamityMod.Projectiles.Melee Time++; } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + public void AbsolutelyFuckingAnnihilateTrees(int x, int y) { Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(x, y); diff --git a/Projectiles/Melee/PrismaticBeam.cs b/Projectiles/Melee/PrismaticBeam.cs index eceb62eb13..a04f42a986 100644 --- a/Projectiles/Melee/PrismaticBeam.cs +++ b/Projectiles/Melee/PrismaticBeam.cs @@ -85,7 +85,9 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = 300; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - } + projectile.Calamity().PierceResistHarshness = 0.06f; + projectile.Calamity().PierceResistCap = 0.4f; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Melee/SpineOfThanatosProjectile.cs b/Projectiles/Melee/SpineOfThanatosProjectile.cs index 80a001416c..2ae22e3951 100644 --- a/Projectiles/Melee/SpineOfThanatosProjectile.cs +++ b/Projectiles/Melee/SpineOfThanatosProjectile.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Melee float rayRotation = projectile.rotation + MathHelper.Lerp(-0.57f, 0.57f, i / (float)LaserRayCount); float targetAimDisparity = 0f; if (potentialTarget != null) - targetAimDisparity = projectile.rotation.ToRotationVector2().AngleBetween((potentialTarget.Center - WhipEnd).SafeNormalize(Vector2.Zero)); + targetAimDisparity = projectile.rotation.ToRotationVector2().AngleBetween((potentialTarget.Center - projectile.Center).SafeNormalize(Vector2.Zero)); // By default, make the prism rays go outward a good amount based on their rotation // to give a fan look. diff --git a/Projectiles/Pets/SCalPet.cs b/Projectiles/Pets/SCalPet.cs index 20b29b0c08..52a12fd38f 100644 --- a/Projectiles/Pets/SCalPet.cs +++ b/Projectiles/Pets/SCalPet.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets @@ -8,7 +9,7 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { DisplayName.SetDefault("Supreme Calamitas"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 6; Main.projPet[projectile.type] = true; } @@ -40,16 +41,13 @@ namespace CalamityMod.Projectiles.Pets projectile.timeLeft = 2; } projectile.FloatingPetAI(false, 0.05f); + projectile.rotation -= projectile.spriteDirection * MathHelper.PiOver2; projectile.frameCounter++; if (projectile.frameCounter > 6) { - projectile.frame++; + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; projectile.frameCounter = 0; } - if (projectile.frame >= 4) - { - projectile.frame = 0; - } } } } diff --git a/Projectiles/Pets/SCalPet.png b/Projectiles/Pets/SCalPet.png index 418e48c9d1..b5c0fc9f56 100644 Binary files a/Projectiles/Pets/SCalPet.png and b/Projectiles/Pets/SCalPet.png differ diff --git a/Projectiles/Ranged/AMR2.cs b/Projectiles/Ranged/AMR2.cs index 797aeb955a..bb2cc8786b 100644 --- a/Projectiles/Ranged/AMR2.cs +++ b/Projectiles/Ranged/AMR2.cs @@ -27,6 +27,6 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; - } + } } } diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index 3519d9c6b2..7949bc4aa9 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ignoreWater = true; projectile.penetrate = 1; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { @@ -61,8 +62,7 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(ModContent.BuffType(), 600); - if (target.defense > 50) - target.defense -= 50; + target.Calamity().miscDefenseLoss = 25; } public override void OnHitPvp(Player target, int damage, bool crit) diff --git a/Projectiles/Ranged/AccelerationBulletProj.cs b/Projectiles/Ranged/AccelerationBulletProj.cs index 6a37f8f4fd..291f488c2d 100644 --- a/Projectiles/Ranged/AccelerationBulletProj.cs +++ b/Projectiles/Ranged/AccelerationBulletProj.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/AcidBulletProj.cs b/Projectiles/Ranged/AcidBulletProj.cs index 221ab4bd3e..c4e4e71fa7 100644 --- a/Projectiles/Ranged/AcidBulletProj.cs +++ b/Projectiles/Ranged/AcidBulletProj.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index d106df0762..60812d6a9a 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.ranged = true; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 9b1576518c..0205a1e62e 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.ranged = true; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index a63512977a..0901bbb88b 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 300; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index d36e96bbf3..288fc83ba5 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = 255; projectile.timeLeft = 600; projectile.extraUpdates = 2; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index 4b4258b268..f4b013e427 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.aiStyle = 1; projectile.coldDamage = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index 9602483a75..431920b962 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.light = 0.25f; projectile.extraUpdates = 2; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Ranged/AstralSandgun.cs b/Projectiles/Ranged/AstralSandgun.cs index 53fc80c00b..805cab0fe6 100644 --- a/Projectiles/Ranged/AstralSandgun.cs +++ b/Projectiles/Ranged/AstralSandgun.cs @@ -18,7 +18,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = -1; base.SetDefaults(); - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 3f2a15f679..9fa02fadee 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 1; projectile.penetrate = 1; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/AuralisBullet.cs b/Projectiles/Ranged/AuralisBullet.cs index 446b4100e7..07e1a2c33f 100644 --- a/Projectiles/Ranged/AuralisBullet.cs +++ b/Projectiles/Ranged/AuralisBullet.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 10; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 35687ea5fb..d1e0043fa1 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 2; projectile.aiStyle = 1; aiType = ProjectileID.WoodenArrowFriendly; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Ranged/BigCoral.cs b/Projectiles/Ranged/BigCoral.cs index c0c02f433c..44f34218f5 100644 --- a/Projectiles/Ranged/BigCoral.cs +++ b/Projectiles/Ranged/BigCoral.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index c2e6141be2..87a203e222 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -31,8 +31,6 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 5; projectile.timeLeft = 300; - projectile.Calamity().ResistDamagePenaltyMinCapFactor = 0.33f; - projectile.Calamity().ResistDamagePenaltyHarshness = 1.625f; } public override void AI() @@ -44,10 +42,10 @@ namespace CalamityMod.Projectiles.Ranged } if (projectile.scale <= 3f) - { projectile.scale *= 1.01f; - } + Lighting.AddLight(projectile.Center, 1f, 0f, 0f); + if (projectile.ai[0] > 7f) { float num296 = 1f; diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index 78b262e084..40dd3cd2d4 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 29a3d6017b..e5048e45b6 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 1; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index 8e231ca279..868cd23a15 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 4; projectile.timeLeft = Lifetime; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() diff --git a/Projectiles/Ranged/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs index 14357bb61c..73d739d372 100644 --- a/Projectiles/Ranged/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -1,10 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -14,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Arrow"); + DisplayName.SetDefault("Blue Exo Arrow"); } public override void SetDefaults() @@ -28,6 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 300; projectile.ranged = true; projectile.arrow = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() @@ -66,24 +63,24 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitPvp(Player target, int damage, bool crit) { - target.ExoDebuffs(); - OnHitEffects(target.Center); + target.ExoDebuffs(); + OnHitEffects(target.Center); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.ExoDebuffs(); - OnHitEffects(target.Center); + target.ExoDebuffs(); + OnHitEffects(target.Center); } - private void OnHitEffects(Vector2 targetPos) - { + private void OnHitEffects(Vector2 targetPos) + { for (int x = 0; x < 3; x++) { - if (projectile.owner == Main.myPlayer) - { - CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(2), 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.7f, projectile.owner); - } + if (projectile.owner == Main.myPlayer) + { + CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, Main.rand.NextBool(2), 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.7f, projectile.owner); + } } } } diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index 6021c400d3..7e078b4130 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 1; projectile.timeLeft = 180; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/BouncingShotgunPellet.cs b/Projectiles/Ranged/BouncingShotgunPellet.cs index 75ab8ea2ff..a7228035d5 100644 --- a/Projectiles/Ranged/BouncingShotgunPellet.cs +++ b/Projectiles/Ranged/BouncingShotgunPellet.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; aiType = ProjectileID.BulletHighVelocity; projectile.timeLeft = 180; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index 9e4bb1a7f5..91a19aac79 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.extraUpdates = 2; projectile.timeLeft = 300; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 77148c4120..8585178a6d 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.alpha = 255; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs index 80b4c01193..74048584fd 100644 --- a/Projectiles/Ranged/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.alpha = 255; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index 0f3bc0490e..b144b352b2 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -19,7 +19,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ignoreWater = true; projectile.penetrate = 1; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ClaretCannonProj.cs b/Projectiles/Ranged/ClaretCannonProj.cs index c5c7248978..04acae19ad 100644 --- a/Projectiles/Ranged/ClaretCannonProj.cs +++ b/Projectiles/Ranged/ClaretCannonProj.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 1; projectile.aiStyle = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index ea57b89d1e..9417892842 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.extraUpdates = 1; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index fc4dc14986..63715891da 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index 55eb1d8d3c..5d71414ead 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index d555d5a753..6bf19e4db3 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.arrow = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/DragonBurst.cs b/Projectiles/Ranged/DragonsBreathRound.cs similarity index 88% rename from Projectiles/Ranged/DragonBurst.cs rename to Projectiles/Ranged/DragonsBreathRound.cs index 224b1967c9..a675df0cbb 100644 --- a/Projectiles/Ranged/DragonBurst.cs +++ b/Projectiles/Ranged/DragonsBreathRound.cs @@ -7,11 +7,11 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class DragonBurst : ModProjectile + public class DragonsBreathRound : ModProjectile { public override void SetStaticDefaults() { - DisplayName.SetDefault("Burst"); + DisplayName.SetDefault("Dragon's Breath Round"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 180; projectile.ranged = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() @@ -62,8 +63,8 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().forceRanged = true; + if (proj.WithinBounds(Main.maxProjectiles)) + Main.projectile[proj].Calamity().forceRanged = true; } } @@ -74,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } } diff --git a/Projectiles/Ranged/DragonBurst.png b/Projectiles/Ranged/DragonsBreathRound.png similarity index 100% rename from Projectiles/Ranged/DragonBurst.png rename to Projectiles/Ranged/DragonsBreathRound.png diff --git a/Projectiles/Ranged/DualpoonProj.cs b/Projectiles/Ranged/DualpoonProj.cs index d5ff61e800..8f11d8514a 100644 --- a/Projectiles/Ranged/DualpoonProj.cs +++ b/Projectiles/Ranged/DualpoonProj.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 0; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index fc69453386..dee738bca3 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/EnhancedNanoRoundProj.cs b/Projectiles/Ranged/EnhancedNanoRoundProj.cs index 1241d3ced3..b3e2b15138 100644 --- a/Projectiles/Ranged/EnhancedNanoRoundProj.cs +++ b/Projectiles/Ranged/EnhancedNanoRoundProj.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index fc1f095f60..c6d7734c8e 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.aiStyle = 1; aiType = ProjectileID.Stake; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index 3bbc1eb80e..bdafaa3dbe 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs index 437c767942..42badc0ff5 100644 --- a/Projectiles/Ranged/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.aiStyle = 1; aiType = ProjectileID.Stake; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index 7eab0f6951..e6ad5a58d9 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.light = 0.25f; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FlashBulletProj.cs b/Projectiles/Ranged/FlashBulletProj.cs index d0bd78479a..6f9e5b4708 100644 --- a/Projectiles/Ranged/FlashBulletProj.cs +++ b/Projectiles/Ranged/FlashBulletProj.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index b32c4b8ad7..b0d25dcfdd 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.coldDamage = true; projectile.penetrate = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FrostsparkBulletProj.cs b/Projectiles/Ranged/FrostsparkBulletProj.cs index e4d3ae7e9e..c7f1a4c317 100644 --- a/Projectiles/Ranged/FrostsparkBulletProj.cs +++ b/Projectiles/Ranged/FrostsparkBulletProj.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index fc37827460..db8cea8ace 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index 88b15e7043..029616278d 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -43,7 +43,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = -1; projectile.timeLeft = Lifetime; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void SendExtraAI(BinaryWriter writer) => writer.Write(projectile.tileCollide); public override void ReceiveExtraAI(BinaryReader reader) => projectile.tileCollide = reader.ReadBoolean(); diff --git a/Projectiles/Ranged/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs index 65c54c1fdb..2da0e02ad4 100644 --- a/Projectiles/Ranged/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -1,7 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -11,7 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Arrow"); + DisplayName.SetDefault("Green Exo Arrow"); } public override void SetDefaults() @@ -25,6 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 300; projectile.ranged = true; projectile.arrow = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index a05a0067df..bf75ff42f5 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 4; projectile.timeLeft = Lifetime; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 383ebb69ba..255640f7b4 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index bdf140f83f..2e4161ee24 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.coldDamage = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/IcyBulletProj.cs b/Projectiles/Ranged/IcyBulletProj.cs index d13fe4ba97..473aa6dc22 100644 --- a/Projectiles/Ranged/IcyBulletProj.cs +++ b/Projectiles/Ranged/IcyBulletProj.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; projectile.coldDamage = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/IlluminatedBullet.cs b/Projectiles/Ranged/IlluminatedBullet.cs index 23a0885f17..75cbf19659 100644 --- a/Projectiles/Ranged/IlluminatedBullet.cs +++ b/Projectiles/Ranged/IlluminatedBullet.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Ranged // Invisible for the first few frames projectile.alpha = 255; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 2446751a0f..60d9eb92ff 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index fcae4dab98..90bb1ec76a 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 1; projectile.timeLeft = 300; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index 754ecb0a8b..528e2adf84 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.timeLeft = 180; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/LunarBolt2.cs b/Projectiles/Ranged/LunarBolt2.cs index 8b7db4aafd..34c4c9a36f 100644 --- a/Projectiles/Ranged/LunarBolt2.cs +++ b/Projectiles/Ranged/LunarBolt2.cs @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.extraUpdates = 1; projectile.timeLeft = 180; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/MagnaStrike.cs b/Projectiles/Ranged/MagnaStrike.cs index 6b27032315..8731255296 100644 --- a/Projectiles/Ranged/MagnaStrike.cs +++ b/Projectiles/Ranged/MagnaStrike.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 300; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index 16b4eb5b44..32d0e16985 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = 255; projectile.ignoreWater = true; projectile.ranged = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index f61c8a76e9..b2e2563fcd 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.WoodenArrowFriendly; projectile.arrow = true; projectile.coldDamage = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 3ece134f2f..31df40787c 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index c3ac22da12..ed961fbbc7 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 120; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index 755e0ac735..845c02b29e 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 120; projectile.ranged = true; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index b2147a49ec..667b806e43 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -24,7 +24,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 300; projectile.ranged = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index 37cea96471..77407f29f5 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Ranged { public class OrangeExoArrow : ModProjectile @@ -11,7 +12,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Arrow"); + DisplayName.SetDefault("Orange Exo Arrow"); } public override void SetDefaults() @@ -25,6 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 300; projectile.ranged = true; projectile.arrow = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() @@ -67,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - CalamityGlobalProjectile.ExpandHitboxBy(projectile, 188); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 188); projectile.maxPenetrate = -1; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/PiercingBullet.cs b/Projectiles/Ranged/PiercingBullet.cs index c9c50654df..0d5def5d21 100644 --- a/Projectiles/Ranged/PiercingBullet.cs +++ b/Projectiles/Ranged/PiercingBullet.cs @@ -30,7 +30,8 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index 66f7df7444..dea634e090 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.timeLeft = 600; aiType = ProjectileID.WoodenArrowFriendly; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 92075b8126..2d28d1819f 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.aiStyle = 1; aiType = ProjectileID.BulletHighVelocity; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/PrismExplosionLarge.cs b/Projectiles/Ranged/PrismExplosionLarge.cs index 6ed873f793..c79abef3d0 100644 --- a/Projectiles/Ranged/PrismExplosionLarge.cs +++ b/Projectiles/Ranged/PrismExplosionLarge.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = projectile.height = 300; + projectile.width = projectile.height = 520; projectile.friendly = true; projectile.ignoreWater = false; projectile.tileCollide = false; @@ -51,9 +51,9 @@ namespace CalamityMod.Projectiles.Ranged Color lightBurstColor = CalamityUtils.MulticolorLerp(projectile.timeLeft / 144f, Items.CalamityGlobalItem.ExoPalette); lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * projectile.Opacity * 0.04f; lightBurstColor.A = 0; - spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, projectile.scale * 2.5f, SpriteEffects.None, 0f); + spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, projectile.scale * 4.5f, SpriteEffects.None, 0f); } - spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0f); return false; } } diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index 406e1be8af..5be27c2cb6 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Ranged { public List MinesToConnectTo = new List(); public ref float Time => ref projectile.ai[0]; - public const float MineConnectDistanceMax = 850f; + public const float MineConnectDistanceMax = 1200f; public override void SetStaticDefaults() => DisplayName.SetDefault("Mine"); public override void SetDefaults() @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - projectile.velocity *= 0.94f; + projectile.velocity *= 0.96f; Lighting.AddLight(projectile.Center, Color.Cyan.ToVector3()); float idealScale = MathHelper.Lerp(0.93f, 1.07f, (float)Math.Sin(MathHelper.TwoPi * projectile.timeLeft / 14f) * 0.5f + 0.5f); diff --git a/Projectiles/Ranged/ProBolt.cs b/Projectiles/Ranged/ProBolt.cs index fe28af83db..933ca2cb8c 100644 --- a/Projectiles/Ranged/ProBolt.cs +++ b/Projectiles/Ranged/ProBolt.cs @@ -23,7 +23,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 3; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 6b93f23fdd..45466c59a7 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 90; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Ranged/SandstormBullet.cs b/Projectiles/Ranged/SandstormBullet.cs index 9856dfdea1..cd29b7fbd2 100644 --- a/Projectiles/Ranged/SandstormBullet.cs +++ b/Projectiles/Ranged/SandstormBullet.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 1; projectile.aiStyle = 1; projectile.alpha = 255; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index bce2cb5c9d..2d1471cfae 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; projectile.timeLeft = 900; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/Shell.cs b/Projectiles/Ranged/Shell.cs index 356d2eac5e..acccef7873 100644 --- a/Projectiles/Ranged/Shell.cs +++ b/Projectiles/Ranged/Shell.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.arrow = true; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 72be7cf7d8..535c115982 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -29,7 +29,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.light = 0.5f; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index 6c7ecf6175..5a760a16d5 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.light = 0.25f; projectile.extraUpdates = 2; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index 7b8a42feb1..fa82eeda44 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/SlashRound.cs b/Projectiles/Ranged/SlashRound.cs index 998100265d..e10e810451 100644 --- a/Projectiles/Ranged/SlashRound.cs +++ b/Projectiles/Ranged/SlashRound.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Ranged/SmallCoral.cs b/Projectiles/Ranged/SmallCoral.cs index 0f66c294f1..f8350d0b1b 100644 --- a/Projectiles/Ranged/SmallCoral.cs +++ b/Projectiles/Ranged/SmallCoral.cs @@ -19,7 +19,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.aiStyle = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/SuperballBulletProj.cs b/Projectiles/Ranged/SuperballBulletProj.cs index 34da52f062..51d6be2175 100644 --- a/Projectiles/Ranged/SuperballBulletProj.cs +++ b/Projectiles/Ranged/SuperballBulletProj.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.extraUpdates = 1; aiType = ProjectileID.Bullet; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs index 221a71cef2..8f7f2b288b 100644 --- a/Projectiles/Ranged/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Ranged { public class TealExoArrow : ModProjectile @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Arrow"); + DisplayName.SetDefault("Teal Exo Arrow"); } public override void SetDefaults() @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.arrow = true; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override void AI() diff --git a/Projectiles/Ranged/TelluricGlareArrow.cs b/Projectiles/Ranged/TelluricGlareArrow.cs index f23a879cc9..f7a3b32874 100644 --- a/Projectiles/Ranged/TelluricGlareArrow.cs +++ b/Projectiles/Ranged/TelluricGlareArrow.cs @@ -41,7 +41,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 2; // Can hit up to two enemies. Will explode extremely soon after hitting the first, though. projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = -1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override bool CanDamage() => projectile.timeLeft < Lifetime - 4; diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 34fd3af1ee..0472b5c8e0 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/TerraBulletMain.cs b/Projectiles/Ranged/TerraBulletMain.cs index ee8a6eb7ee..1173112c0d 100644 --- a/Projectiles/Ranged/TerraBulletMain.cs +++ b/Projectiles/Ranged/TerraBulletMain.cs @@ -28,7 +28,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.alpha = 255; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index 41e822fead..4ca8bb805d 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.arrow = true; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/ToxicArrow.cs b/Projectiles/Ranged/ToxicArrow.cs index e0e8fb48f5..c0f2993e8c 100644 --- a/Projectiles/Ranged/ToxicArrow.cs +++ b/Projectiles/Ranged/ToxicArrow.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 1; projectile.timeLeft = 240; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/TriploonProj.cs b/Projectiles/Ranged/TriploonProj.cs index be1796a307..878a4b1c23 100644 --- a/Projectiles/Ranged/TriploonProj.cs +++ b/Projectiles/Ranged/TriploonProj.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 0; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 656ef65779..4f0b0b9f22 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.timeLeft = 600; aiType = ProjectileID.WoodenArrowFriendly; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void Kill(int timeLeft) { diff --git a/Projectiles/Ranged/UltimaBolt.cs b/Projectiles/Ranged/UltimaBolt.cs index 1201e4a9ae..cc4ac59014 100644 --- a/Projectiles/Ranged/UltimaBolt.cs +++ b/Projectiles/Ranged/UltimaBolt.cs @@ -31,7 +31,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 1; projectile.timeLeft = 300; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/VanquisherArrowMain.cs b/Projectiles/Ranged/VanquisherArrowMain.cs index 81d6437ae8..d81d560126 100644 --- a/Projectiles/Ranged/VanquisherArrowMain.cs +++ b/Projectiles/Ranged/VanquisherArrowMain.cs @@ -27,7 +27,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 90; projectile.extraUpdates = 1; - } + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; + } public override void AI() { diff --git a/Projectiles/Ranged/VeriumBulletProj.cs b/Projectiles/Ranged/VeriumBulletProj.cs index b1dad5bc8f..27f22dda0a 100644 --- a/Projectiles/Ranged/VeriumBulletProj.cs +++ b/Projectiles/Ranged/VeriumBulletProj.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.Ranged aiType = ProjectileID.Bullet; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/ApoctolithProj.cs b/Projectiles/Rogue/ApoctolithProj.cs index 9e5a6b3342..a34331ba52 100644 --- a/Projectiles/Rogue/ApoctolithProj.cs +++ b/Projectiles/Rogue/ApoctolithProj.cs @@ -46,14 +46,12 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - if (crit && target.defense > 0) - { - target.defense -= Math.Min(target.defense, 15); - } + + if (crit) + target.Calamity().miscDefenseLoss = Math.Min(target.defense, 15); + if (projectile.Calamity().stealthStrike) - { target.AddBuff(ModContent.BuffType(), 120); - } } public override void OnHitPvp(Player target, int damage, bool crit) diff --git a/Projectiles/Rogue/EradicatorProjectile.cs b/Projectiles/Rogue/EradicatorProjectile.cs index a9392ef4b6..2d61ad64a7 100644 --- a/Projectiles/Rogue/EradicatorProjectile.cs +++ b/Projectiles/Rogue/EradicatorProjectile.cs @@ -1,6 +1,8 @@ +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,15 +12,17 @@ namespace CalamityMod.Projectiles.Rogue public class EradicatorProjectile : ModProjectile { public override string Texture => "CalamityMod/Items/Weapons/Rogue/Eradicator"; - internal float rotationDirection = 1f; - internal float rotationAmt = 0f; - internal float shootCounter = 0f; + private const float RotationIncrement = 0.09f; + private const int Lifetime = 140; + private const float ReboundTime = 40f; + + private float randomLaserCharge = 0f; public override void SetStaticDefaults() { DisplayName.SetDefault("Eradicator"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; } public override void SetDefaults() @@ -28,9 +32,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = false; projectile.ignoreWater = true; projectile.penetrate = -1; - projectile.aiStyle = 3; - projectile.timeLeft = 180; - aiType = ProjectileID.WoodenBoomerang; + projectile.MaxUpdates = 2; + projectile.timeLeft = Lifetime; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 18; projectile.Calamity().rogue = true; @@ -38,29 +41,95 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + // + // Boomerang AI copied from Nanoblack Reaper + // + + // On the frame the disc begins returning, send a net update. + if (projectile.timeLeft == Lifetime - ReboundTime) + projectile.netUpdate = true; + + // The disc runs its returning AI if it has existed longer than ReboundTime frames. + if (projectile.timeLeft <= Lifetime - ReboundTime) + { + float returnSpeed = Eradicator.Speed; + float acceleration = 0.25f; + Player owner = Main.player[projectile.owner]; + + // Delete the disc if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - projectile.Center.X; + float yDist = playerCenter.Y - projectile.Center.Y; + float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); + if (dist > 3000f) + projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (projectile.velocity.X < xDist) + { + projectile.velocity.X = projectile.velocity.X + acceleration; + if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + } + else if (projectile.velocity.X > xDist) + { + projectile.velocity.X = projectile.velocity.X - acceleration; + if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + } + if (projectile.velocity.Y < yDist) + { + projectile.velocity.Y = projectile.velocity.Y + acceleration; + if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + } + else if (projectile.velocity.Y > yDist) + { + projectile.velocity.Y = projectile.velocity.Y - acceleration; + if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + } + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == projectile.owner) + if (projectile.Hitbox.Intersects(owner.Hitbox)) + projectile.Kill(); + } + + // Lighting. Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); - if (projectile.aiStyle == 3) - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType(), 1D, true); + + // Rotate the disc as it flies. + float spin = projectile.direction <= 0 ? -1f : 1f; + projectile.rotation += spin * RotationIncrement; + + // If not currently glued to a target with sticky AI, fire lasers at up to 2 nearby targets for 75% damage. + if (projectile.ai[0] == 1f) + StealthStrikeGrind(spin); else - StealthStrikeAI(); + { + float laserFrames = projectile.MaxUpdates * 8f; + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, laserFrames, 2, ModContent.ProjectileType(), 0.4D, true); + } } - private void StealthStrikeAI() + private void StealthStrikeGrind(float spinDir) { - if (rotationAmt < 0.75f) - rotationAmt += 0.005f; - projectile.rotation += rotationAmt * rotationDirection; - shootCounter += Main.rand.NextFloat(0f, 2f); + // Spin extra fast to visually shred the enemy. + projectile.rotation += spinDir * RotationIncrement * 0.8f; - //Fire lasers at random - if (shootCounter >= 8f) + // Randomly fire lasers while grinding. + randomLaserCharge += Main.rand.NextFloat(0.09f, 0.14f); + if (randomLaserCharge >= 1f) { - shootCounter = 0f; + randomLaserCharge -= 1f; Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int laserDamage = (int)(projectile.damage * 0.5); - if (projectile.Calamity().stealthStrike) - laserDamage /= 4; + int laserDamage = (int)(projectile.damage * 0.15D); Projectile laser = Projectile.NewProjectileDirect(projectile.Center, velocity, ModContent.ProjectileType(), laserDamage, 0f, projectile.owner); if (laser.whoAmI.WithinBounds(Main.maxProjectiles)) { @@ -74,17 +143,20 @@ namespace CalamityMod.Projectiles.Rogue } } + // Stay stuck to the target. projectile.StickyProjAI(6, true); + // If still attached to a target, do nothing. if (projectile.ai[0] != 0f) return; - //Lazily homes in on the nearest NPC (boss preferential) + + // If the target died, look for a new one. const float turnSpeed = 30f; const float speedMult = 5f; const float homingRange = 600f; - NPC uDie = projectile.Center.ClosestNPCAt(homingRange, true, true); - if (uDie != null) - { + NPC uDie = projectile.Center.ClosestNPCAt(homingRange, true, true); + if (uDie != null) + { Vector2 distNorm = (uDie.Center - projectile.Center).SafeNormalize(Vector2.UnitX); projectile.velocity = (projectile.velocity * (turnSpeed - 1f) + distNorm * speedMult) / turnSpeed; } @@ -102,26 +174,31 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.Frostburn, 600); } - public override void ModifyHitPvp(Player target, ref int damage, ref bool crit) => StealthStrikeSetup(); - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - StealthStrikeSetup(); - projectile.ModifyHitNPCSticky(3, true); - } + public override void ModifyHitPvp(Player target, ref int damage, ref bool crit) => OnHit(); + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) => OnHit(); - private void StealthStrikeSetup() + private void OnHit() { - if (!projectile.Calamity().stealthStrike || projectile.aiStyle == -1) + // Non-stealth strikes do nothing special on hit. + if (!projectile.Calamity().stealthStrike) return; - rotationDirection = projectile.direction; - projectile.aiStyle = -1; - projectile.velocity *= 0.1f; - projectile.ai[0] = projectile.ai[1] = 0f; + + // On the first frame of impact, slow down massively so it'll effectively stay stuck to an enemy. + if (projectile.ai[0] == 0f && projectile.ai[1] == 0f) + { + projectile.velocity *= 0.1f; + + // Also provide a lot of extra time to grind. + projectile.timeLeft += Lifetime; + } + + // Apply sticky AI. + projectile.ModifyHitNPCSticky(3, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 2); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index f63beb3aeb..c10ed1cd31 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.Calamity().rogue = true; projectile.extraUpdates = 1; projectile.alpha = 150; + projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } public override bool? CanHitNPC(NPC target) => (projectile.timeLeft < 210 || projectile.ai[0] == 2f) && target.CanBeChasedBy(projectile); diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs index 31e90538bb..7ac5b498b5 100644 --- a/Projectiles/Rogue/PrismShurikenBlade.cs +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -17,12 +17,12 @@ namespace CalamityMod.Projectiles.Rogue projectile.ignoreWater = true; projectile.Calamity().rogue = true; projectile.extraUpdates = 1; - projectile.timeLeft = 360; + projectile.timeLeft = projectile.MaxUpdates * 300; } public override void AI() { - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 850f, 14.5f, 35f); + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 850f, 19f, 30f); projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index f79817c000..411a06934a 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Projectiles.Summon { public class IceClasperMinion : ModProjectile { - public override string Texture => "CalamityMod/NPCs/NormalNPCs/IceClasper"; private int dust = 3; diff --git a/Projectiles/Summon/IceClasperMinion.png b/Projectiles/Summon/IceClasperMinion.png new file mode 100644 index 0000000000..5d35882b80 Binary files /dev/null and b/Projectiles/Summon/IceClasperMinion.png differ diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 33d750b2a0..36d8fe419b 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { if (projectile.ai[0] == 3f) - CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 150f, 12f, 20); + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 12f, 20); if (projectile.ai[0] == 2f) { diff --git a/Projectiles/Typeless/SuicideBomberDemon.cs b/Projectiles/Typeless/SuicideBomberDemon.cs index a712fd1b16..0f59f549de 100644 --- a/Projectiles/Typeless/SuicideBomberDemon.cs +++ b/Projectiles/Typeless/SuicideBomberDemon.cs @@ -76,8 +76,6 @@ namespace CalamityMod.Projectiles.Typeless { projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(Owner.Center) * 16f, 1.4f); projectile.spriteDirection = (Owner.Center.X > projectile.Center.X).ToDirectionInt(); - if (projectile.Hitbox.Intersects(Owner.Hitbox)) - projectile.Kill(); } else if (projectile.friendly) { @@ -88,11 +86,7 @@ namespace CalamityMod.Projectiles.Typeless { projectile.spriteDirection = (potentialTarget.Center.X > projectile.Center.X).ToDirectionInt(); projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(potentialTarget.Center) * 18.5f, 3f); - if (projectile.Hitbox.Intersects(potentialTarget.Hitbox)) - { - projectile.Damage(); - projectile.Kill(); - } + projectile.friendly = true; } } } @@ -112,6 +106,11 @@ namespace CalamityMod.Projectiles.Typeless public override bool CanDamage() => projectile.Opacity >= 1f; - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = Main.rand.Next(60, 70); + // Ensure damage is not absolutely obscene when hitting players. + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = 95; + + public override void OnHitPlayer(Player target, int damage, bool crit) => projectile.Kill(); + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => projectile.Kill(); } } diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 39ade9da0c..71007090c9 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; @@ -260,6 +261,9 @@ namespace CalamityMod.UI.CalamitasEnchants itemScale *= inventoryScale * baseScale; drawPosition += Vector2.One * 23f * baseScale; + if (Main.LocalPlayer.InventoryHas(ModContent.ItemType()) && EnchantmentManager.ItemUpgradeRelationship.ContainsKey(CurrentlyHeldItem.type)) + drawPosition -= itemFrame.Size() * 0.25f; + // Draw the item. if (hasMultipleFrames || ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index e30094da53..09c384f8cb 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -260,7 +260,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().persecutedEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), - new Enchantment("Lecherous", "Spawns a resiliant brimstone orb that stays between you and your mouse that interferes with your homing weapons. It releases a bunch of hearts on death.", + new Enchantment("Lecherous", "Spawns a resilient brimstone orb that stays between you and your mouse that interferes with your homing weapons. It releases a bunch of hearts on death.", 1200, "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous", null, diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 120f2af03a..e7c0734d42 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -32,6 +32,7 @@ namespace CalamityMod EditFireGauntletRecipe(); EditMechBossSummonRecipes(); EditWingRecipes(); + EditPhasesaberRecipes(); AstralAlternatives(); AddPotionRecipes(); @@ -185,6 +186,17 @@ namespace CalamityMod }); } + // Change Phasesaber recipes to require 20 Crystal Shards + private static void EditPhasesaberRecipes() + { + List rec = Main.recipe.ToList(); + rec.Where(x => x.createItem.type == ItemID.BluePhasesaber || x.createItem.type == ItemID.GreenPhasesaber || x.createItem.type == ItemID.PurplePhasesaber || + x.createItem.type == ItemID.RedPhasesaber || x.createItem.type == ItemID.WhitePhasesaber || x.createItem.type == ItemID.YellowPhasesaber).ToList().ForEach(s => + { + s.requiredItem[1].stack = 20; + }); + } + #region Astral Alternatives private static void AstralAlternatives() { @@ -825,8 +837,8 @@ namespace CalamityMod // Nazar (curse) r = GetNewRecipe(); - r.AddIngredient(ItemID.SoulofNight, 20); - r.AddIngredient(ItemID.Lens, 5); + r.AddIngredient(ItemID.SoulofNight, 15); + r.AddIngredient(ItemID.Lens, 3); r.AddTile(TileID.MythrilAnvil); r.SetResult(ItemID.Nazar); r.AddRecipe();