diff --git a/Backgrounds/AstralDesertSurfaceBGStyle.cs b/Backgrounds/AstralDesertSurfaceBGStyle.cs index 014a06e5ac..d47afe4f29 100644 --- a/Backgrounds/AstralDesertSurfaceBGStyle.cs +++ b/Backgrounds/AstralDesertSurfaceBGStyle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Backgrounds diff --git a/Backgrounds/AstralSnowSurfaceBGStyle.cs b/Backgrounds/AstralSnowSurfaceBGStyle.cs index 386ce9e4b7..e6277edd5a 100644 --- a/Backgrounds/AstralSnowSurfaceBGStyle.cs +++ b/Backgrounds/AstralSnowSurfaceBGStyle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Backgrounds diff --git a/Backgrounds/AstralSurfaceBGStyle.cs b/Backgrounds/AstralSurfaceBGStyle.cs index c0d83b6c83..338b92d53f 100644 --- a/Backgrounds/AstralSurfaceBGStyle.cs +++ b/Backgrounds/AstralSurfaceBGStyle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Backgrounds diff --git a/Backgrounds/AstralUndergroundBGStyle.cs b/Backgrounds/AstralUndergroundBGStyle.cs index dbbb650181..23f177f5c4 100644 --- a/Backgrounds/AstralUndergroundBGStyle.cs +++ b/Backgrounds/AstralUndergroundBGStyle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Backgrounds diff --git a/Backgrounds/SulphurSeaSurfaceBGStyle.cs b/Backgrounds/SulphurSeaSurfaceBGStyle.cs index 4cb0f2d013..43c07e7b1a 100644 --- a/Backgrounds/SulphurSeaSurfaceBGStyle.cs +++ b/Backgrounds/SulphurSeaSurfaceBGStyle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Backgrounds diff --git a/Buffs/Alcohol/AlcoholPoisoning.cs b/Buffs/Alcohol/AlcoholPoisoning.cs index d66d052a76..68b049c383 100644 --- a/Buffs/Alcohol/AlcoholPoisoning.cs +++ b/Buffs/Alcohol/AlcoholPoisoning.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/BloodyMaryBuff.cs b/Buffs/Alcohol/BloodyMaryBuff.cs index d0afa1fd86..3b24a8627d 100644 --- a/Buffs/Alcohol/BloodyMaryBuff.cs +++ b/Buffs/Alcohol/BloodyMaryBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/CaribbeanRumBuff.cs b/Buffs/Alcohol/CaribbeanRumBuff.cs index 36f38562c9..e9146ba1a2 100644 --- a/Buffs/Alcohol/CaribbeanRumBuff.cs +++ b/Buffs/Alcohol/CaribbeanRumBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index 5c0b971a59..feab7cda1e 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/EverclearBuff.cs b/Buffs/Alcohol/EverclearBuff.cs index 2c149361e9..cc2e191393 100644 --- a/Buffs/Alcohol/EverclearBuff.cs +++ b/Buffs/Alcohol/EverclearBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index 4517b2a9d9..ba5f17f12b 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/FabsolVodkaBuff.cs b/Buffs/Alcohol/FabsolVodkaBuff.cs index 21bdc8fd79..afd6016e98 100644 --- a/Buffs/Alcohol/FabsolVodkaBuff.cs +++ b/Buffs/Alcohol/FabsolVodkaBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 09b4565a90..54c7c0aa0b 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index 5096134d15..d0e6f64c81 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index b8c139558d..16490e0b55 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/MoonshineBuff.cs b/Buffs/Alcohol/MoonshineBuff.cs index 2e79c06fd8..9fe7a24fcd 100644 --- a/Buffs/Alcohol/MoonshineBuff.cs +++ b/Buffs/Alcohol/MoonshineBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/MoscowMuleBuff.cs b/Buffs/Alcohol/MoscowMuleBuff.cs index 3c25b9beb3..f9d0c793fe 100644 --- a/Buffs/Alcohol/MoscowMuleBuff.cs +++ b/Buffs/Alcohol/MoscowMuleBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/RedWineBuff.cs b/Buffs/Alcohol/RedWineBuff.cs index e427207cac..7c88708840 100644 --- a/Buffs/Alcohol/RedWineBuff.cs +++ b/Buffs/Alcohol/RedWineBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/RumBuff.cs b/Buffs/Alcohol/RumBuff.cs index e5c206b0f8..2757bb9681 100644 --- a/Buffs/Alcohol/RumBuff.cs +++ b/Buffs/Alcohol/RumBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/ScrewdriverBuff.cs b/Buffs/Alcohol/ScrewdriverBuff.cs index 764ea263fa..d625aa2584 100644 --- a/Buffs/Alcohol/ScrewdriverBuff.cs +++ b/Buffs/Alcohol/ScrewdriverBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/StarBeamRyeBuff.cs b/Buffs/Alcohol/StarBeamRyeBuff.cs index 075390a8dc..f1dd542182 100644 --- a/Buffs/Alcohol/StarBeamRyeBuff.cs +++ b/Buffs/Alcohol/StarBeamRyeBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index 9a7e1c40a2..15355206bd 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/TequilaSunriseBuff.cs b/Buffs/Alcohol/TequilaSunriseBuff.cs index 9f30e1cdcf..325f40f1b1 100644 --- a/Buffs/Alcohol/TequilaSunriseBuff.cs +++ b/Buffs/Alcohol/TequilaSunriseBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/Trippy.cs b/Buffs/Alcohol/Trippy.cs index 97db91c6ef..a8b9cacc85 100644 --- a/Buffs/Alcohol/Trippy.cs +++ b/Buffs/Alcohol/Trippy.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index 037a66ba39..89b12cf0e8 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/WhiskeyBuff.cs b/Buffs/Alcohol/WhiskeyBuff.cs index 238b1ad66d..3b673d0f92 100644 --- a/Buffs/Alcohol/WhiskeyBuff.cs +++ b/Buffs/Alcohol/WhiskeyBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/Alcohol/WhiteWineBuff.cs b/Buffs/Alcohol/WhiteWineBuff.cs index 8d5323fba7..f1b72fcbed 100644 --- a/Buffs/Alcohol/WhiteWineBuff.cs +++ b/Buffs/Alcohol/WhiteWineBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Alcohol diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 295aca016d..591cef7456 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -1,8 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -10,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Buffs { - public class CalamityGlobalBuff : GlobalBuff + public class CalamityGlobalBuff : GlobalBuff { public override void Update(int type, Player player, ref int buffIndex) { @@ -28,7 +24,7 @@ namespace CalamityMod.Buffs } else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) { - float nebulaDamage = 0.075f * (float)player.nebulaLevelDamage; //7.5% to 22.5% + float nebulaDamage = 0.075f * player.nebulaLevelDamage; //7.5% to 22.5% player.allDamage -= nebulaDamage; } else if (type >= BuffID.NebulaUpLife1 && type <= BuffID.NebulaUpLife3) @@ -109,12 +105,6 @@ namespace CalamityMod.Buffs tip = "Rod of Discord teleports are disabled"; break; - case BuffID.Ichor: - tip = "Defense reduced by 20"; - if (CalamityWorld.revenge) - tip += ". All damage taken increased by 25%"; - break; - case BuffID.CursedInferno: if (CalamityWorld.revenge) tip += ". All damage taken increased by 20%"; diff --git a/Buffs/Cooldowns/AbyssalDivingSuitPlatesBroken.cs b/Buffs/Cooldowns/AbyssalDivingSuitPlatesBroken.cs index 999541d5f4..ec07a49c18 100644 --- a/Buffs/Cooldowns/AbyssalDivingSuitPlatesBroken.cs +++ b/Buffs/Cooldowns/AbyssalDivingSuitPlatesBroken.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/AbyssalMirrorCooldown.cs b/Buffs/Cooldowns/AbyssalMirrorCooldown.cs index 9c59353058..94acb27e64 100644 --- a/Buffs/Cooldowns/AbyssalMirrorCooldown.cs +++ b/Buffs/Cooldowns/AbyssalMirrorCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/BloodflareBloodFrenzyCooldown.cs b/Buffs/Cooldowns/BloodflareBloodFrenzyCooldown.cs index 5b82ac39d4..4426ed9486 100644 --- a/Buffs/Cooldowns/BloodflareBloodFrenzyCooldown.cs +++ b/Buffs/Cooldowns/BloodflareBloodFrenzyCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/BloodflareSoulCooldown.cs b/Buffs/Cooldowns/BloodflareSoulCooldown.cs index 656fee4f41..f859c25feb 100644 --- a/Buffs/Cooldowns/BloodflareSoulCooldown.cs +++ b/Buffs/Cooldowns/BloodflareSoulCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/BrimflameFrenzyCooldown.cs b/Buffs/Cooldowns/BrimflameFrenzyCooldown.cs index b59ec13e63..824561c866 100644 --- a/Buffs/Cooldowns/BrimflameFrenzyCooldown.cs +++ b/Buffs/Cooldowns/BrimflameFrenzyCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/EclipseMirrorCooldown.cs b/Buffs/Cooldowns/EclipseMirrorCooldown.cs index c96708afc9..b9936c1f46 100644 --- a/Buffs/Cooldowns/EclipseMirrorCooldown.cs +++ b/Buffs/Cooldowns/EclipseMirrorCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/GodSlayerCooldown.cs b/Buffs/Cooldowns/GodSlayerCooldown.cs index 1c42957b76..304c33027d 100644 --- a/Buffs/Cooldowns/GodSlayerCooldown.cs +++ b/Buffs/Cooldowns/GodSlayerCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/IceShieldBrokenBuff.cs b/Buffs/Cooldowns/IceShieldBrokenBuff.cs index a5395b11aa..b17e45f395 100644 --- a/Buffs/Cooldowns/IceShieldBrokenBuff.cs +++ b/Buffs/Cooldowns/IceShieldBrokenBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/InkBombCooldown.cs b/Buffs/Cooldowns/InkBombCooldown.cs index c3bd0fceef..60718ae735 100644 --- a/Buffs/Cooldowns/InkBombCooldown.cs +++ b/Buffs/Cooldowns/InkBombCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/ResilienceCooldown.cs b/Buffs/Cooldowns/ResilienceCooldown.cs index 66a4975223..76e2810b05 100644 --- a/Buffs/Cooldowns/ResilienceCooldown.cs +++ b/Buffs/Cooldowns/ResilienceCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/ScarfCooldown.cs b/Buffs/Cooldowns/ScarfCooldown.cs index 778f1660ef..edb0553a71 100644 --- a/Buffs/Cooldowns/ScarfCooldown.cs +++ b/Buffs/Cooldowns/ScarfCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/TarragonCloakCooldown.cs b/Buffs/Cooldowns/TarragonCloakCooldown.cs index f28dc1fef5..59e1633c28 100644 --- a/Buffs/Cooldowns/TarragonCloakCooldown.cs +++ b/Buffs/Cooldowns/TarragonCloakCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/Cooldowns/TarragonImmunityCooldown.cs b/Buffs/Cooldowns/TarragonImmunityCooldown.cs index 5e78f4ed75..b5ec547260 100644 --- a/Buffs/Cooldowns/TarragonImmunityCooldown.cs +++ b/Buffs/Cooldowns/TarragonImmunityCooldown.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Cooldowns diff --git a/Buffs/DamageOverTime/AbyssalFlames.cs b/Buffs/DamageOverTime/AbyssalFlames.cs index da5d6845bb..1b4ce689ca 100644 --- a/Buffs/DamageOverTime/AbyssalFlames.cs +++ b/Buffs/DamageOverTime/AbyssalFlames.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/AstralInfectionDebuff.cs b/Buffs/DamageOverTime/AstralInfectionDebuff.cs index 02ad5d3229..4cbf341553 100644 --- a/Buffs/DamageOverTime/AstralInfectionDebuff.cs +++ b/Buffs/DamageOverTime/AstralInfectionDebuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/BrimstoneFlames.cs b/Buffs/DamageOverTime/BrimstoneFlames.cs index 4096ddfa7a..f25b100141 100644 --- a/Buffs/DamageOverTime/BrimstoneFlames.cs +++ b/Buffs/DamageOverTime/BrimstoneFlames.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/BurningBlood.cs b/Buffs/DamageOverTime/BurningBlood.cs index fc7a19fc7a..17aa0a8437 100644 --- a/Buffs/DamageOverTime/BurningBlood.cs +++ b/Buffs/DamageOverTime/BurningBlood.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/CrushDepth.cs b/Buffs/DamageOverTime/CrushDepth.cs index d287d9ee27..0b63b68f55 100644 --- a/Buffs/DamageOverTime/CrushDepth.cs +++ b/Buffs/DamageOverTime/CrushDepth.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/DemonFlames.cs b/Buffs/DamageOverTime/DemonFlames.cs index 0abff5d32e..2a370bbc21 100644 --- a/Buffs/DamageOverTime/DemonFlames.cs +++ b/Buffs/DamageOverTime/DemonFlames.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/GodSlayerInferno.cs b/Buffs/DamageOverTime/GodSlayerInferno.cs index 2798de3dd4..4782500a2f 100644 --- a/Buffs/DamageOverTime/GodSlayerInferno.cs +++ b/Buffs/DamageOverTime/GodSlayerInferno.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/HolyFlames.cs b/Buffs/DamageOverTime/HolyFlames.cs index ae7bd17b1e..9c08d139f3 100644 --- a/Buffs/DamageOverTime/HolyFlames.cs +++ b/Buffs/DamageOverTime/HolyFlames.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/HolyInferno.cs b/Buffs/DamageOverTime/HolyInferno.cs index 5a324320ea..6581fa159d 100644 --- a/Buffs/DamageOverTime/HolyInferno.cs +++ b/Buffs/DamageOverTime/HolyInferno.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/LethalLavaBurn.cs b/Buffs/DamageOverTime/LethalLavaBurn.cs index 964277b993..9ed4184336 100644 --- a/Buffs/DamageOverTime/LethalLavaBurn.cs +++ b/Buffs/DamageOverTime/LethalLavaBurn.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/Nightwither.cs b/Buffs/DamageOverTime/Nightwither.cs index 059f55de47..931cc9b8de 100644 --- a/Buffs/DamageOverTime/Nightwither.cs +++ b/Buffs/DamageOverTime/Nightwither.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/Plague.cs b/Buffs/DamageOverTime/Plague.cs index e0f08c339e..6faa2312f4 100644 --- a/Buffs/DamageOverTime/Plague.cs +++ b/Buffs/DamageOverTime/Plague.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/Shadowflame.cs b/Buffs/DamageOverTime/Shadowflame.cs index 9274e0e671..c752b86b3b 100644 --- a/Buffs/DamageOverTime/Shadowflame.cs +++ b/Buffs/DamageOverTime/Shadowflame.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/ShellfishEating.cs b/Buffs/DamageOverTime/ShellfishEating.cs index 7d933e2606..47540279c0 100644 --- a/Buffs/DamageOverTime/ShellfishEating.cs +++ b/Buffs/DamageOverTime/ShellfishEating.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index b6d1fef7c1..eab185a1f2 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/SnapClamDebuff.cs b/Buffs/DamageOverTime/SnapClamDebuff.cs index bb3b39d842..34ac6157ec 100644 --- a/Buffs/DamageOverTime/SnapClamDebuff.cs +++ b/Buffs/DamageOverTime/SnapClamDebuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index c429efc8be..cdcb28b518 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index c64f88ac73..17b1addd7e 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.DamageOverTime diff --git a/Buffs/Mounts/AlicornBuff.cs b/Buffs/Mounts/AlicornBuff.cs index 40fe164d8f..ccd207a64c 100644 --- a/Buffs/Mounts/AlicornBuff.cs +++ b/Buffs/Mounts/AlicornBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Mounts diff --git a/Buffs/Mounts/AndromedaBuff.cs b/Buffs/Mounts/AndromedaBuff.cs index 27244854ec..344610c871 100644 --- a/Buffs/Mounts/AndromedaBuff.cs +++ b/Buffs/Mounts/AndromedaBuff.cs @@ -1,10 +1,9 @@ -using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Mounts { - public class AndromedaBuff : ModBuff + public class AndromedaBuff : ModBuff { public override void SetDefaults() { diff --git a/Buffs/Mounts/AndromedaSmallBuff.cs b/Buffs/Mounts/AndromedaSmallBuff.cs index b74a088387..a33dd40e35 100644 --- a/Buffs/Mounts/AndromedaSmallBuff.cs +++ b/Buffs/Mounts/AndromedaSmallBuff.cs @@ -1,10 +1,9 @@ -using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Mounts { - public class AndromedaSmallBuff : ModBuff + public class AndromedaSmallBuff : ModBuff { public override void SetDefaults() { diff --git a/Buffs/Mounts/BrimstoneMount.cs b/Buffs/Mounts/BrimstoneMount.cs index 762ecb8387..0bf69688ab 100644 --- a/Buffs/Mounts/BrimstoneMount.cs +++ b/Buffs/Mounts/BrimstoneMount.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Mounts/GazeOfCrysthamyrBuff.cs b/Buffs/Mounts/GazeOfCrysthamyrBuff.cs index b55d333bf8..da5e3fd2b3 100644 --- a/Buffs/Mounts/GazeOfCrysthamyrBuff.cs +++ b/Buffs/Mounts/GazeOfCrysthamyrBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Mounts/OnyxExcavatorBuff.cs b/Buffs/Mounts/OnyxExcavatorBuff.cs index e80fe4ac84..f5ce5a53ce 100644 --- a/Buffs/Mounts/OnyxExcavatorBuff.cs +++ b/Buffs/Mounts/OnyxExcavatorBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Mounts/SquishyBeanBuff.cs b/Buffs/Mounts/SquishyBeanBuff.cs index 0ac7be1658..b912fcdd38 100644 --- a/Buffs/Mounts/SquishyBeanBuff.cs +++ b/Buffs/Mounts/SquishyBeanBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Mounts/TundraLeashBuff.cs b/Buffs/Mounts/TundraLeashBuff.cs index 9e5a4a16b9..90fd6205dc 100644 --- a/Buffs/Mounts/TundraLeashBuff.cs +++ b/Buffs/Mounts/TundraLeashBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Mounts; +using CalamityMod.Items.Mounts; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/AkatoYharonBuff.cs b/Buffs/Pets/AkatoYharonBuff.cs index 38b0fbe89b..123369a3d2 100644 --- a/Buffs/Pets/AkatoYharonBuff.cs +++ b/Buffs/Pets/AkatoYharonBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/BloodBound.cs b/Buffs/Pets/BloodBound.cs index d27219ca5c..adef2fd525 100644 --- a/Buffs/Pets/BloodBound.cs +++ b/Buffs/Pets/BloodBound.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/Fox.cs b/Buffs/Pets/Fox.cs index 1ad555f668..ebe4e31caa 100644 --- a/Buffs/Pets/Fox.cs +++ b/Buffs/Pets/Fox.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/FurtasticDuoBuff.cs b/Buffs/Pets/FurtasticDuoBuff.cs index a6c5a18083..262b042712 100644 --- a/Buffs/Pets/FurtasticDuoBuff.cs +++ b/Buffs/Pets/FurtasticDuoBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; diff --git a/Buffs/Pets/LeviBuff.cs b/Buffs/Pets/LeviBuff.cs index 4f00ade48e..3081f8dfc3 100644 --- a/Buffs/Pets/LeviBuff.cs +++ b/Buffs/Pets/LeviBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/SirenLightPetBuff.cs b/Buffs/Pets/SirenLightPetBuff.cs index ba3a3cac39..a51ffaffb0 100644 --- a/Buffs/Pets/SirenLightPetBuff.cs +++ b/Buffs/Pets/SirenLightPetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Pets/ThirdSageBuff.cs b/Buffs/Pets/ThirdSageBuff.cs index ac3cb8543a..c879217262 100644 --- a/Buffs/Pets/ThirdSageBuff.cs +++ b/Buffs/Pets/ThirdSageBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Pets; +using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Placeables/BlueSpeedCandle.cs b/Buffs/Placeables/BlueSpeedCandle.cs index 3c066828e0..f0233ffbcf 100644 --- a/Buffs/Placeables/BlueSpeedCandle.cs +++ b/Buffs/Placeables/BlueSpeedCandle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/ChaosCandleBuff.cs b/Buffs/Placeables/ChaosCandleBuff.cs index 2b21702305..b395b3f889 100644 --- a/Buffs/Placeables/ChaosCandleBuff.cs +++ b/Buffs/Placeables/ChaosCandleBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/CorruptionEffigyBuff.cs b/Buffs/Placeables/CorruptionEffigyBuff.cs index b5f231f959..b1fa642529 100644 --- a/Buffs/Placeables/CorruptionEffigyBuff.cs +++ b/Buffs/Placeables/CorruptionEffigyBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/CrimsonEffigyBuff.cs b/Buffs/Placeables/CrimsonEffigyBuff.cs index a54c57aad8..8898a5038a 100644 --- a/Buffs/Placeables/CrimsonEffigyBuff.cs +++ b/Buffs/Placeables/CrimsonEffigyBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/EffigyOfDecayBuff.cs b/Buffs/Placeables/EffigyOfDecayBuff.cs index 0965076425..500c66aabd 100644 --- a/Buffs/Placeables/EffigyOfDecayBuff.cs +++ b/Buffs/Placeables/EffigyOfDecayBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/PinkHealthCandle.cs b/Buffs/Placeables/PinkHealthCandle.cs index 4cb81beb9a..6603da177f 100644 --- a/Buffs/Placeables/PinkHealthCandle.cs +++ b/Buffs/Placeables/PinkHealthCandle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/PurpleDefenseCandle.cs b/Buffs/Placeables/PurpleDefenseCandle.cs index 544bbaf306..d6daf5f8f8 100644 --- a/Buffs/Placeables/PurpleDefenseCandle.cs +++ b/Buffs/Placeables/PurpleDefenseCandle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/TranquilityCandleBuff.cs b/Buffs/Placeables/TranquilityCandleBuff.cs index 779941fac6..3ccdc99e70 100644 --- a/Buffs/Placeables/TranquilityCandleBuff.cs +++ b/Buffs/Placeables/TranquilityCandleBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/Placeables/YellowDamageCandle.cs b/Buffs/Placeables/YellowDamageCandle.cs index eaf9e2ec55..64a99338f2 100644 --- a/Buffs/Placeables/YellowDamageCandle.cs +++ b/Buffs/Placeables/YellowDamageCandle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Placeables diff --git a/Buffs/PopoBuff.cs b/Buffs/PopoBuff.cs index a86343f420..c24ce48df9 100644 --- a/Buffs/PopoBuff.cs +++ b/Buffs/PopoBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/PopoNoselessBuff.cs b/Buffs/PopoNoselessBuff.cs index 588b79f89a..244249e5b9 100644 --- a/Buffs/PopoNoselessBuff.cs +++ b/Buffs/PopoNoselessBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Potions/AbyssalWeapon.cs b/Buffs/Potions/AbyssalWeapon.cs index fab27a4913..9b7ee491ef 100644 --- a/Buffs/Potions/AbyssalWeapon.cs +++ b/Buffs/Potions/AbyssalWeapon.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/AnechoicCoatingBuff.cs b/Buffs/Potions/AnechoicCoatingBuff.cs index d93775584a..1fb8082021 100644 --- a/Buffs/Potions/AnechoicCoatingBuff.cs +++ b/Buffs/Potions/AnechoicCoatingBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/ArmorCrumbling.cs b/Buffs/Potions/ArmorCrumbling.cs index 94271b22be..e6cb425ab6 100644 --- a/Buffs/Potions/ArmorCrumbling.cs +++ b/Buffs/Potions/ArmorCrumbling.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/ArmorShattering.cs b/Buffs/Potions/ArmorShattering.cs index e3f7ebf089..79cfe6a4bf 100644 --- a/Buffs/Potions/ArmorShattering.cs +++ b/Buffs/Potions/ArmorShattering.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/AstralInjectionBuff.cs b/Buffs/Potions/AstralInjectionBuff.cs index bd10f7dbfa..9d252305e8 100644 --- a/Buffs/Potions/AstralInjectionBuff.cs +++ b/Buffs/Potions/AstralInjectionBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/BaguetteBuff.cs b/Buffs/Potions/BaguetteBuff.cs index e798ca216e..b37c916aa0 100644 --- a/Buffs/Potions/BaguetteBuff.cs +++ b/Buffs/Potions/BaguetteBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/BoundingBuff.cs b/Buffs/Potions/BoundingBuff.cs index 407282fc29..b5cd8cc4b0 100644 --- a/Buffs/Potions/BoundingBuff.cs +++ b/Buffs/Potions/BoundingBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Cadence.cs b/Buffs/Potions/Cadence.cs index 696ff89931..7999b55a89 100644 --- a/Buffs/Potions/Cadence.cs +++ b/Buffs/Potions/Cadence.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/CalciumBuff.cs b/Buffs/Potions/CalciumBuff.cs index 303cd1f375..b43ebb1e15 100644 --- a/Buffs/Potions/CalciumBuff.cs +++ b/Buffs/Potions/CalciumBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/CeaselessHunger.cs b/Buffs/Potions/CeaselessHunger.cs index 12d2ca909f..2b443d9c9e 100644 --- a/Buffs/Potions/CeaselessHunger.cs +++ b/Buffs/Potions/CeaselessHunger.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/DraconicSurgeBuff.cs b/Buffs/Potions/DraconicSurgeBuff.cs index 65417887d0..13b29873a4 100644 --- a/Buffs/Potions/DraconicSurgeBuff.cs +++ b/Buffs/Potions/DraconicSurgeBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/GravityNormalizerBuff.cs b/Buffs/Potions/GravityNormalizerBuff.cs index aa781ff219..c62b862983 100644 --- a/Buffs/Potions/GravityNormalizerBuff.cs +++ b/Buffs/Potions/GravityNormalizerBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/HolyWrathBuff.cs b/Buffs/Potions/HolyWrathBuff.cs index 8553173bd9..83b9e43fa8 100644 --- a/Buffs/Potions/HolyWrathBuff.cs +++ b/Buffs/Potions/HolyWrathBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Invincible.cs b/Buffs/Potions/Invincible.cs index 89db6eaa6f..e6c9a0bbe8 100644 --- a/Buffs/Potions/Invincible.cs +++ b/Buffs/Potions/Invincible.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Omniscience.cs b/Buffs/Potions/Omniscience.cs index 56aacaa317..a984c8580c 100644 --- a/Buffs/Potions/Omniscience.cs +++ b/Buffs/Potions/Omniscience.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/PenumbraBuff.cs b/Buffs/Potions/PenumbraBuff.cs index d01b300df6..9aa3385d32 100644 --- a/Buffs/Potions/PenumbraBuff.cs +++ b/Buffs/Potions/PenumbraBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/PhotosynthesisBuff.cs b/Buffs/Potions/PhotosynthesisBuff.cs index 0a1278ab60..005a94af14 100644 --- a/Buffs/Potions/PhotosynthesisBuff.cs +++ b/Buffs/Potions/PhotosynthesisBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/ProfanedRageBuff.cs b/Buffs/Potions/ProfanedRageBuff.cs index e4fdd75e65..883e131a87 100644 --- a/Buffs/Potions/ProfanedRageBuff.cs +++ b/Buffs/Potions/ProfanedRageBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Revivify.cs b/Buffs/Potions/Revivify.cs index 74fa3b07f3..92394b9465 100644 --- a/Buffs/Potions/Revivify.cs +++ b/Buffs/Potions/Revivify.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Soaring.cs b/Buffs/Potions/Soaring.cs index c3ff71b531..c881cf16a9 100644 --- a/Buffs/Potions/Soaring.cs +++ b/Buffs/Potions/Soaring.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/TeslaBuff.cs b/Buffs/Potions/TeslaBuff.cs index 3aabc48ec8..a4d3d6bd93 100644 --- a/Buffs/Potions/TeslaBuff.cs +++ b/Buffs/Potions/TeslaBuff.cs @@ -1,10 +1,9 @@ -using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions { - public class TeslaBuff : ModBuff + public class TeslaBuff : ModBuff { public override void SetDefaults() { diff --git a/Buffs/Potions/TitanScale.cs b/Buffs/Potions/TitanScale.cs index 8f72ad20ef..e01f18adea 100644 --- a/Buffs/Potions/TitanScale.cs +++ b/Buffs/Potions/TitanScale.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/TriumphBuff.cs b/Buffs/Potions/TriumphBuff.cs index cbf40f5a7b..b52031dcb9 100644 --- a/Buffs/Potions/TriumphBuff.cs +++ b/Buffs/Potions/TriumphBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/YharimPower.cs b/Buffs/Potions/YharimPower.cs index d2fcae9330..0db7a5081a 100644 --- a/Buffs/Potions/YharimPower.cs +++ b/Buffs/Potions/YharimPower.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Zen.cs b/Buffs/Potions/Zen.cs index 0f398fc3ca..fa5d033f71 100644 --- a/Buffs/Potions/Zen.cs +++ b/Buffs/Potions/Zen.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/Potions/Zerg.cs b/Buffs/Potions/Zerg.cs index 25fd14e83a..e6ae303758 100644 --- a/Buffs/Potions/Zerg.cs +++ b/Buffs/Potions/Zerg.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Potions diff --git a/Buffs/StatBuffs/AbsoluteRage.cs b/Buffs/StatBuffs/AbsoluteRage.cs index b41d3c49b5..6ccc912945 100644 --- a/Buffs/StatBuffs/AbsoluteRage.cs +++ b/Buffs/StatBuffs/AbsoluteRage.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs index 74020ab73b..77c85358ab 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs b/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs index c7f51f46a2..bf4737cdbf 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitPlates.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/AdrenalineMode.cs b/Buffs/StatBuffs/AdrenalineMode.cs index bd00baec9d..868a334e50 100644 --- a/Buffs/StatBuffs/AdrenalineMode.cs +++ b/Buffs/StatBuffs/AdrenalineMode.cs @@ -1,10 +1,9 @@ -using CalamityMod.World; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { - public class AdrenalineMode : ModBuff + public class AdrenalineMode : ModBuff { public override void SetDefaults() { diff --git a/Buffs/StatBuffs/Afflicted.cs b/Buffs/StatBuffs/Afflicted.cs index 6ea97370ef..368e6a2f37 100644 --- a/Buffs/StatBuffs/Afflicted.cs +++ b/Buffs/StatBuffs/Afflicted.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/AmidiasBlessing.cs b/Buffs/StatBuffs/AmidiasBlessing.cs index 96a93a4afd..6c16af5f2f 100644 --- a/Buffs/StatBuffs/AmidiasBlessing.cs +++ b/Buffs/StatBuffs/AmidiasBlessing.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/BloodflareBloodFrenzy.cs b/Buffs/StatBuffs/BloodflareBloodFrenzy.cs index 8c9ad3837d..a8d4390850 100644 --- a/Buffs/StatBuffs/BloodflareBloodFrenzy.cs +++ b/Buffs/StatBuffs/BloodflareBloodFrenzy.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/BossZen.cs b/Buffs/StatBuffs/BossZen.cs index 626b051abc..17f3500cc4 100644 --- a/Buffs/StatBuffs/BossZen.cs +++ b/Buffs/StatBuffs/BossZen.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/BrimflameFrenzyBuff.cs b/Buffs/StatBuffs/BrimflameFrenzyBuff.cs index 3d6bbeb9cf..3cff4e9497 100644 --- a/Buffs/StatBuffs/BrimflameFrenzyBuff.cs +++ b/Buffs/StatBuffs/BrimflameFrenzyBuff.cs @@ -1,12 +1,9 @@ - -using CalamityMod.Buffs.Cooldowns; -using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { - public class BrimflameFrenzyBuff : ModBuff + public class BrimflameFrenzyBuff : ModBuff { public override void SetDefaults() { diff --git a/Buffs/StatBuffs/ChiBuff.cs b/Buffs/StatBuffs/ChiBuff.cs index 59bee34bcd..920a2358b6 100644 --- a/Buffs/StatBuffs/ChiBuff.cs +++ b/Buffs/StatBuffs/ChiBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/CosmicFreeze.cs b/Buffs/StatBuffs/CosmicFreeze.cs index 9e49557b03..12dd1ca5b0 100644 --- a/Buffs/StatBuffs/CosmicFreeze.cs +++ b/Buffs/StatBuffs/CosmicFreeze.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/ElysianGuard.cs b/Buffs/StatBuffs/ElysianGuard.cs index 018030bcc3..b10c1883bd 100644 --- a/Buffs/StatBuffs/ElysianGuard.cs +++ b/Buffs/StatBuffs/ElysianGuard.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/GraxDefense.cs b/Buffs/StatBuffs/GraxDefense.cs index 7e8c832b84..aadc44a528 100644 --- a/Buffs/StatBuffs/GraxDefense.cs +++ b/Buffs/StatBuffs/GraxDefense.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs index b8ddd85f42..7299addb51 100644 --- a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/HallowedRuneDefBuff.cs b/Buffs/StatBuffs/HallowedRuneDefBuff.cs index 912fac2635..3e581e9d36 100644 --- a/Buffs/StatBuffs/HallowedRuneDefBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneDefBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/HallowedRuneRegenBuff.cs b/Buffs/StatBuffs/HallowedRuneRegenBuff.cs index 970e4c1bec..c85e46f920 100644 --- a/Buffs/StatBuffs/HallowedRuneRegenBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneRegenBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/IceShieldBuff.cs b/Buffs/StatBuffs/IceShieldBuff.cs index 8ddcc2408f..493771a2f5 100644 --- a/Buffs/StatBuffs/IceShieldBuff.cs +++ b/Buffs/StatBuffs/IceShieldBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/Molten.cs b/Buffs/StatBuffs/Molten.cs index 21a176a5e2..a49e73b451 100644 --- a/Buffs/StatBuffs/Molten.cs +++ b/Buffs/StatBuffs/Molten.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index c33fee1b9c..eea140a50b 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/ProfanedCrystalBuff.cs b/Buffs/StatBuffs/ProfanedCrystalBuff.cs index e5b54b12a4..a8918d9379 100644 --- a/Buffs/StatBuffs/ProfanedCrystalBuff.cs +++ b/Buffs/StatBuffs/ProfanedCrystalBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/StatBuffs/RageMode.cs b/Buffs/StatBuffs/RageMode.cs index 4bf2402bab..3b4b889811 100644 --- a/Buffs/StatBuffs/RageMode.cs +++ b/Buffs/StatBuffs/RageMode.cs @@ -1,10 +1,9 @@ -using CalamityMod.World; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs { - public class RageMode : ModBuff + public class RageMode : ModBuff { public override void SetDefaults() { diff --git a/Buffs/StatBuffs/ReaverRage.cs b/Buffs/StatBuffs/ReaverRage.cs index 02471e7e62..8e35172d22 100644 --- a/Buffs/StatBuffs/ReaverRage.cs +++ b/Buffs/StatBuffs/ReaverRage.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/ScarfMeleeBoost.cs b/Buffs/StatBuffs/ScarfMeleeBoost.cs index 4733a30f6b..2a769c3254 100644 --- a/Buffs/StatBuffs/ScarfMeleeBoost.cs +++ b/Buffs/StatBuffs/ScarfMeleeBoost.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/ShellBoost.cs b/Buffs/StatBuffs/ShellBoost.cs index 1e146bc8fb..ae1276eec9 100644 --- a/Buffs/StatBuffs/ShellBoost.cs +++ b/Buffs/StatBuffs/ShellBoost.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/SilvaRevival.cs b/Buffs/StatBuffs/SilvaRevival.cs index d7bc1578e8..d8a6574a55 100644 --- a/Buffs/StatBuffs/SilvaRevival.cs +++ b/Buffs/StatBuffs/SilvaRevival.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/SirenBobs.cs b/Buffs/StatBuffs/SirenBobs.cs index dc3e068573..a9980878e3 100644 --- a/Buffs/StatBuffs/SirenBobs.cs +++ b/Buffs/StatBuffs/SirenBobs.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/StatBuffs/SirenBobsAlt.cs b/Buffs/StatBuffs/SirenBobsAlt.cs index f3b774f22f..69acb9cb03 100644 --- a/Buffs/StatBuffs/SirenBobsAlt.cs +++ b/Buffs/StatBuffs/SirenBobsAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/StatBuffs/SirenWaterSpeed.cs b/Buffs/StatBuffs/SirenWaterSpeed.cs index d26aa2fbc2..d8fb876ff5 100644 --- a/Buffs/StatBuffs/SirenWaterSpeed.cs +++ b/Buffs/StatBuffs/SirenWaterSpeed.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs index c0feaf6629..0a4ebc1aa8 100644 --- a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs b/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs index b6f97b4e67..3dcf4b7f7c 100644 --- a/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorDefBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs b/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs index 65a3e88a9c..738fca831e 100644 --- a/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorRegenBuff.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/TarraLifeRegen.cs b/Buffs/StatBuffs/TarraLifeRegen.cs index 08d5c7872d..8faa4969e0 100644 --- a/Buffs/StatBuffs/TarraLifeRegen.cs +++ b/Buffs/StatBuffs/TarraLifeRegen.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/TarragonCloak.cs b/Buffs/StatBuffs/TarragonCloak.cs index d6c7e218a2..7dceada438 100644 --- a/Buffs/StatBuffs/TarragonCloak.cs +++ b/Buffs/StatBuffs/TarragonCloak.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/TarragonImmunity.cs b/Buffs/StatBuffs/TarragonImmunity.cs index 9645bd17cf..2d6cd18ce4 100644 --- a/Buffs/StatBuffs/TarragonImmunity.cs +++ b/Buffs/StatBuffs/TarragonImmunity.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/TyrantsFury.cs b/Buffs/StatBuffs/TyrantsFury.cs index 488b5e5a65..2358138430 100644 --- a/Buffs/StatBuffs/TyrantsFury.cs +++ b/Buffs/StatBuffs/TyrantsFury.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/XerocRage.cs b/Buffs/StatBuffs/XerocRage.cs index 746b5e931a..1f71408fb0 100644 --- a/Buffs/StatBuffs/XerocRage.cs +++ b/Buffs/StatBuffs/XerocRage.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatBuffs/XerocWrath.cs b/Buffs/StatBuffs/XerocWrath.cs index 12e00dedc4..92a8b6e2a7 100644 --- a/Buffs/StatBuffs/XerocWrath.cs +++ b/Buffs/StatBuffs/XerocWrath.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatBuffs diff --git a/Buffs/StatDebuffs/AndromedaCripple.cs b/Buffs/StatDebuffs/AndromedaCripple.cs index 14b103e42b..9488fe4641 100644 --- a/Buffs/StatDebuffs/AndromedaCripple.cs +++ b/Buffs/StatDebuffs/AndromedaCripple.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/ArmorCrunch.cs b/Buffs/StatDebuffs/ArmorCrunch.cs index 16532d0d40..1e5461009b 100644 --- a/Buffs/StatDebuffs/ArmorCrunch.cs +++ b/Buffs/StatDebuffs/ArmorCrunch.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/BurntOut.cs b/Buffs/StatDebuffs/BurntOut.cs index 18d3ce634e..ef7498d4f0 100644 --- a/Buffs/StatDebuffs/BurntOut.cs +++ b/Buffs/StatDebuffs/BurntOut.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/Clamity.cs b/Buffs/StatDebuffs/Clamity.cs index f49cc8748b..439655ea95 100644 --- a/Buffs/StatDebuffs/Clamity.cs +++ b/Buffs/StatDebuffs/Clamity.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/Enraged.cs b/Buffs/StatDebuffs/Enraged.cs index 581d8a3de9..db53b710b4 100644 --- a/Buffs/StatDebuffs/Enraged.cs +++ b/Buffs/StatDebuffs/Enraged.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/ExoFreeze.cs b/Buffs/StatDebuffs/ExoFreeze.cs index f6749e3410..157c74ec41 100644 --- a/Buffs/StatDebuffs/ExoFreeze.cs +++ b/Buffs/StatDebuffs/ExoFreeze.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/ExtremeGrav.cs b/Buffs/StatDebuffs/ExtremeGrav.cs index 08ef77d077..6109c1b548 100644 --- a/Buffs/StatDebuffs/ExtremeGrav.cs +++ b/Buffs/StatDebuffs/ExtremeGrav.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/ExtremeGravity.cs b/Buffs/StatDebuffs/ExtremeGravity.cs index 2bfb98fd8b..90ea126bbf 100644 --- a/Buffs/StatDebuffs/ExtremeGravity.cs +++ b/Buffs/StatDebuffs/ExtremeGravity.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/FishAlert.cs b/Buffs/StatDebuffs/FishAlert.cs index 1fc6e14abe..8f5d741026 100644 --- a/Buffs/StatDebuffs/FishAlert.cs +++ b/Buffs/StatDebuffs/FishAlert.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs index fb417edbc4..fd6d0e04bd 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/GlacialState.png b/Buffs/StatDebuffs/GlacialState.png index b3d02f6cff..f3b591dff6 100644 Binary files a/Buffs/StatDebuffs/GlacialState.png and b/Buffs/StatDebuffs/GlacialState.png differ diff --git a/Buffs/StatDebuffs/Horror.cs b/Buffs/StatDebuffs/Horror.cs index 3b944dedbc..7c50ba4797 100644 --- a/Buffs/StatDebuffs/Horror.cs +++ b/Buffs/StatDebuffs/Horror.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/Irradiated.cs b/Buffs/StatDebuffs/Irradiated.cs index c56852b016..1a2df34e2b 100644 --- a/Buffs/StatDebuffs/Irradiated.cs +++ b/Buffs/StatDebuffs/Irradiated.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/MarkedforDeath.cs b/Buffs/StatDebuffs/MarkedforDeath.cs index 235e32d65d..be18d5d313 100644 --- a/Buffs/StatDebuffs/MarkedforDeath.cs +++ b/Buffs/StatDebuffs/MarkedforDeath.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/PearlAura.cs b/Buffs/StatDebuffs/PearlAura.cs index 815b50b3f2..176563792e 100644 --- a/Buffs/StatDebuffs/PearlAura.cs +++ b/Buffs/StatDebuffs/PearlAura.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/ProfanedWeakness.cs b/Buffs/StatDebuffs/ProfanedWeakness.cs index 6b75ba3d2e..b62b658707 100644 --- a/Buffs/StatDebuffs/ProfanedWeakness.cs +++ b/Buffs/StatDebuffs/ProfanedWeakness.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/SilvaStun.cs b/Buffs/StatDebuffs/SilvaStun.cs index e220ebdfce..e186e72022 100644 --- a/Buffs/StatDebuffs/SilvaStun.cs +++ b/Buffs/StatDebuffs/SilvaStun.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index e9cbdf284a..fb7bc94f0d 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/TeslaFreeze.cs b/Buffs/StatDebuffs/TeslaFreeze.cs index f270835445..737c889a20 100644 --- a/Buffs/StatDebuffs/TeslaFreeze.cs +++ b/Buffs/StatDebuffs/TeslaFreeze.cs @@ -1,10 +1,9 @@ -using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs { - public class TeslaFreeze : ModBuff + public class TeslaFreeze : ModBuff { public override void SetDefaults() { diff --git a/Buffs/StatDebuffs/TimeSlow.cs b/Buffs/StatDebuffs/TimeSlow.cs index 6eed8ac8a9..1e0607b3b1 100644 --- a/Buffs/StatDebuffs/TimeSlow.cs +++ b/Buffs/StatDebuffs/TimeSlow.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/WarCleave.cs b/Buffs/StatDebuffs/WarCleave.cs index 1b3b0a59fa..4ff463e10d 100644 --- a/Buffs/StatDebuffs/WarCleave.cs +++ b/Buffs/StatDebuffs/WarCleave.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/Warped.cs b/Buffs/StatDebuffs/Warped.cs index 8a46d0ff91..c700b2df34 100644 --- a/Buffs/StatDebuffs/Warped.cs +++ b/Buffs/StatDebuffs/Warped.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/WeakPetrification.cs b/Buffs/StatDebuffs/WeakPetrification.cs index afb0e2fdf0..6db6abf11a 100644 --- a/Buffs/StatDebuffs/WeakPetrification.cs +++ b/Buffs/StatDebuffs/WeakPetrification.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/StatDebuffs/WhisperingDeath.cs b/Buffs/StatDebuffs/WhisperingDeath.cs index f3e27198fd..5a27e7c6b0 100644 --- a/Buffs/StatDebuffs/WhisperingDeath.cs +++ b/Buffs/StatDebuffs/WhisperingDeath.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs diff --git a/Buffs/Summon/AerospecSummonSetBuff.cs b/Buffs/Summon/AerospecSummonSetBuff.cs index 18bfbd70ef..37d8bef107 100644 --- a/Buffs/Summon/AerospecSummonSetBuff.cs +++ b/Buffs/Summon/AerospecSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ApexSharkBuff.cs b/Buffs/Summon/ApexSharkBuff.cs index f6ec84e5e6..a0fc7aae8f 100644 --- a/Buffs/Summon/ApexSharkBuff.cs +++ b/Buffs/Summon/ApexSharkBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/AquaticStar.cs b/Buffs/Summon/AquaticStar.cs index d1841e9841..b39e07eb93 100644 --- a/Buffs/Summon/AquaticStar.cs +++ b/Buffs/Summon/AquaticStar.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/AstrageldonBuff.cs b/Buffs/Summon/AstrageldonBuff.cs index a482975266..c5e3899221 100644 --- a/Buffs/Summon/AstrageldonBuff.cs +++ b/Buffs/Summon/AstrageldonBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/AtaxiaSummonSetBuff.cs b/Buffs/Summon/AtaxiaSummonSetBuff.cs index 36bbb63fd6..74410d174b 100644 --- a/Buffs/Summon/AtaxiaSummonSetBuff.cs +++ b/Buffs/Summon/AtaxiaSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/BloodClot.cs b/Buffs/Summon/BloodClot.cs index 695c821ea5..548da363c2 100644 --- a/Buffs/Summon/BloodClot.cs +++ b/Buffs/Summon/BloodClot.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/BrimstoneWaifu.cs b/Buffs/Summon/BrimstoneWaifu.cs index 6fcf2b7323..f76f1420e5 100644 --- a/Buffs/Summon/BrimstoneWaifu.cs +++ b/Buffs/Summon/BrimstoneWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/BrittleStar.cs b/Buffs/Summon/BrittleStar.cs index d41c9c70c1..d5b1d85040 100644 --- a/Buffs/Summon/BrittleStar.cs +++ b/Buffs/Summon/BrittleStar.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Calamari.cs b/Buffs/Summon/Calamari.cs index 21301cd335..91b3f2726d 100644 --- a/Buffs/Summon/Calamari.cs +++ b/Buffs/Summon/Calamari.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/CalamitasEyes.cs b/Buffs/Summon/CalamitasEyes.cs index d5125e9d45..a2c9c3b9c5 100644 --- a/Buffs/Summon/CalamitasEyes.cs +++ b/Buffs/Summon/CalamitasEyes.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/CloudyWaifu.cs b/Buffs/Summon/CloudyWaifu.cs index 6c4b12a739..9a2cb48fae 100644 --- a/Buffs/Summon/CloudyWaifu.cs +++ b/Buffs/Summon/CloudyWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ColdDivinityBuff.cs b/Buffs/Summon/ColdDivinityBuff.cs index 6df8c2e884..f0a86170d7 100644 --- a/Buffs/Summon/ColdDivinityBuff.cs +++ b/Buffs/Summon/ColdDivinityBuff.cs @@ -1,11 +1,10 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class ColdDivinityBuff : ModBuff + public class ColdDivinityBuff : ModBuff { public override void SetDefaults() { diff --git a/Buffs/Summon/Corroslime.cs b/Buffs/Summon/Corroslime.cs index d5eae00600..4ffd7714e1 100644 --- a/Buffs/Summon/Corroslime.cs +++ b/Buffs/Summon/Corroslime.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/CorvidHarbringerBuff.cs b/Buffs/Summon/CorvidHarbringerBuff.cs index e8dd25c59f..4a591c6455 100644 --- a/Buffs/Summon/CorvidHarbringerBuff.cs +++ b/Buffs/Summon/CorvidHarbringerBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/CosmicEnergy.cs b/Buffs/Summon/CosmicEnergy.cs index d215a7f8d7..efc871a22f 100644 --- a/Buffs/Summon/CosmicEnergy.cs +++ b/Buffs/Summon/CosmicEnergy.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/CosmilampBuff.cs b/Buffs/Summon/CosmilampBuff.cs index a6f6158ffa..8cefa9079e 100644 --- a/Buffs/Summon/CosmilampBuff.cs +++ b/Buffs/Summon/CosmilampBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Crimslime.cs b/Buffs/Summon/Crimslime.cs index b5ef2f5972..d34856484c 100644 --- a/Buffs/Summon/Crimslime.cs +++ b/Buffs/Summon/Crimslime.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/DaedalusSummonSetBuff.cs b/Buffs/Summon/DaedalusSummonSetBuff.cs index 96d1fe255f..e7e9d0d86f 100644 --- a/Buffs/Summon/DaedalusSummonSetBuff.cs +++ b/Buffs/Summon/DaedalusSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/DankCreeperBuff.cs b/Buffs/Summon/DankCreeperBuff.cs index aa25da8c48..e28fa746b0 100644 --- a/Buffs/Summon/DankCreeperBuff.cs +++ b/Buffs/Summon/DankCreeperBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/DemonshadeSetDevilBuff.cs b/Buffs/Summon/DemonshadeSetDevilBuff.cs index 273319524f..7e80a547c2 100644 --- a/Buffs/Summon/DemonshadeSetDevilBuff.cs +++ b/Buffs/Summon/DemonshadeSetDevilBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/DormantBrimseekerBuff.cs b/Buffs/Summon/DormantBrimseekerBuff.cs index 6efdc58412..ad5a137102 100644 --- a/Buffs/Summon/DormantBrimseekerBuff.cs +++ b/Buffs/Summon/DormantBrimseekerBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ElementalAxeBuff.cs b/Buffs/Summon/ElementalAxeBuff.cs index 287c05c589..a9385b935c 100644 --- a/Buffs/Summon/ElementalAxeBuff.cs +++ b/Buffs/Summon/ElementalAxeBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/EndoCooperBuff.cs b/Buffs/Summon/EndoCooperBuff.cs index 965bd795e1..92b0cf846a 100644 --- a/Buffs/Summon/EndoCooperBuff.cs +++ b/Buffs/Summon/EndoCooperBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/EndoHydraBuff.cs b/Buffs/Summon/EndoHydraBuff.cs index 36745f20d3..4881c756db 100644 --- a/Buffs/Summon/EndoHydraBuff.cs +++ b/Buffs/Summon/EndoHydraBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/FungalClumpBuff.cs b/Buffs/Summon/FungalClumpBuff.cs index e4e0d74e82..94cd8cde15 100644 --- a/Buffs/Summon/FungalClumpBuff.cs +++ b/Buffs/Summon/FungalClumpBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/GastricBelcherBuff.cs b/Buffs/Summon/GastricBelcherBuff.cs new file mode 100644 index 0000000000..e45bba25a9 --- /dev/null +++ b/Buffs/Summon/GastricBelcherBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class GastricBelcherBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Gastric Aberration"); + Description.SetDefault("The aquatic aberration will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.gastricBelcher = true; + } + if (!modPlayer.gastricBelcher) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/GastricBelcherBuff.png b/Buffs/Summon/GastricBelcherBuff.png new file mode 100644 index 0000000000..7a81dd519c Binary files /dev/null and b/Buffs/Summon/GastricBelcherBuff.png differ diff --git a/Buffs/Summon/GladiatorSwords.cs b/Buffs/Summon/GladiatorSwords.cs index f4d9bc893d..41c70bcd19 100644 --- a/Buffs/Summon/GladiatorSwords.cs +++ b/Buffs/Summon/GladiatorSwords.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/HermitCrab.cs b/Buffs/Summon/HermitCrab.cs index 8890f8f983..993e4c790d 100644 --- a/Buffs/Summon/HermitCrab.cs +++ b/Buffs/Summon/HermitCrab.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Herring.cs b/Buffs/Summon/Herring.cs index ead453d25c..8d43413354 100644 --- a/Buffs/Summon/Herring.cs +++ b/Buffs/Summon/Herring.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/HotE.cs b/Buffs/Summon/HotE.cs index 262e179bf2..cd1317c2df 100644 --- a/Buffs/Summon/HotE.cs +++ b/Buffs/Summon/HotE.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon diff --git a/Buffs/Summon/IceClasper.cs b/Buffs/Summon/IceClasper.cs index f0e7cefd5d..8386cb470e 100644 --- a/Buffs/Summon/IceClasper.cs +++ b/Buffs/Summon/IceClasper.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Mechworm.cs b/Buffs/Summon/Mechworm.cs index 2e9e6bf16d..f659c0ae82 100644 --- a/Buffs/Summon/Mechworm.cs +++ b/Buffs/Summon/Mechworm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/MidnightSunBuff.cs b/Buffs/Summon/MidnightSunBuff.cs index 30b0cc66e6..1170e9ec53 100644 --- a/Buffs/Summon/MidnightSunBuff.cs +++ b/Buffs/Summon/MidnightSunBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Phantom.cs b/Buffs/Summon/Phantom.cs index 003e5530f1..f1816c2448 100644 --- a/Buffs/Summon/Phantom.cs +++ b/Buffs/Summon/Phantom.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ProfanedBabs.cs b/Buffs/Summon/ProfanedBabs.cs index e9ebee0667..9edf4b243e 100644 --- a/Buffs/Summon/ProfanedBabs.cs +++ b/Buffs/Summon/ProfanedBabs.cs @@ -1,12 +1,11 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; +using CalamityMod.CalPlayer; using CalamityMod.World; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class ProfanedBabs : ModBuff //Buff name is reference to how I refer to the guardians as my babs ~Amber + public class ProfanedBabs : ModBuff //Buff name is reference to how I refer to the guardians as my babs ~Amber { public override void SetDefaults() { diff --git a/Buffs/Summon/ReaverSummonSetBuff.cs b/Buffs/Summon/ReaverSummonSetBuff.cs index b962f337f8..381bbfdada 100644 --- a/Buffs/Summon/ReaverSummonSetBuff.cs +++ b/Buffs/Summon/ReaverSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ResurrectionButterflyBuff.cs b/Buffs/Summon/ResurrectionButterflyBuff.cs index 1710fb0543..f72ddf19d1 100644 --- a/Buffs/Summon/ResurrectionButterflyBuff.cs +++ b/Buffs/Summon/ResurrectionButterflyBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/RustyDroneBuff.cs b/Buffs/Summon/RustyDroneBuff.cs index d9d8b6c342..c2186b33dc 100644 --- a/Buffs/Summon/RustyDroneBuff.cs +++ b/Buffs/Summon/RustyDroneBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/Sandnado.cs b/Buffs/Summon/Sandnado.cs index 4ae6662863..5dc6c30805 100644 --- a/Buffs/Summon/Sandnado.cs +++ b/Buffs/Summon/Sandnado.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/SandyHealingWaifu.cs b/Buffs/Summon/SandyHealingWaifu.cs index cdca81edfa..e733a62a75 100644 --- a/Buffs/Summon/SandyHealingWaifu.cs +++ b/Buffs/Summon/SandyHealingWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/SandyWaifu.cs b/Buffs/Summon/SandyWaifu.cs index c6cbc0cecf..7abdd05fd2 100644 --- a/Buffs/Summon/SandyWaifu.cs +++ b/Buffs/Summon/SandyWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/ShellfishBuff.cs b/Buffs/Summon/ShellfishBuff.cs index 9d34d45122..bda0345ae6 100644 --- a/Buffs/Summon/ShellfishBuff.cs +++ b/Buffs/Summon/ShellfishBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/SilvaSummonSetBuff.cs b/Buffs/Summon/SilvaSummonSetBuff.cs index b9cb0c4959..28fdad2904 100644 --- a/Buffs/Summon/SilvaSummonSetBuff.cs +++ b/Buffs/Summon/SilvaSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/SolarSpirit.cs b/Buffs/Summon/SolarSpirit.cs index 6fed57ac21..2216a3c3ed 100644 --- a/Buffs/Summon/SolarSpirit.cs +++ b/Buffs/Summon/SolarSpirit.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/SolarSpiritGod.cs b/Buffs/Summon/SolarSpiritGod.cs index 7681eab2b9..fa9c842496 100644 --- a/Buffs/Summon/SolarSpiritGod.cs +++ b/Buffs/Summon/SolarSpiritGod.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/StatigelSummonSetBuff.cs b/Buffs/Summon/StatigelSummonSetBuff.cs index 8647289a90..b319cf7328 100644 --- a/Buffs/Summon/StatigelSummonSetBuff.cs +++ b/Buffs/Summon/StatigelSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/TundraFlameBlossomsBuff.cs b/Buffs/Summon/TundraFlameBlossomsBuff.cs index c981ea7083..dfa6c4eefa 100644 --- a/Buffs/Summon/TundraFlameBlossomsBuff.cs +++ b/Buffs/Summon/TundraFlameBlossomsBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/VictideSummonSetBuff.cs b/Buffs/Summon/VictideSummonSetBuff.cs index 10011f54f5..1e8cf040cb 100644 --- a/Buffs/Summon/VictideSummonSetBuff.cs +++ b/Buffs/Summon/VictideSummonSetBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/WaterWaifu.cs b/Buffs/Summon/WaterWaifu.cs index cc2cb45a7c..839c4b88b3 100644 --- a/Buffs/Summon/WaterWaifu.cs +++ b/Buffs/Summon/WaterWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/Buffs/Summon/YharonKindleBuff.cs b/Buffs/Summon/YharonKindleBuff.cs index 9c7b86e42a..4a74b567ea 100644 --- a/Buffs/Summon/YharonKindleBuff.cs +++ b/Buffs/Summon/YharonKindleBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1c967fe618..46a91992c7 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5,13 +5,11 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Items.Armor; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; +using CalamityMod.Items.Armor; using CalamityMod.Items.DifficultyItems; -using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Mounts; -using CalamityMod.Items.Pets; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -19,22 +17,30 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Calamitas; +using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.DevourerofGods; +using CalamityMod.NPCs.GreatSandShark; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.StormWeaver; +using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Environment; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; -using CalamityMod.Projectiles.Environment; using CalamityMod.Tiles; using CalamityMod.UI; using CalamityMod.World; @@ -53,8 +59,6 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.ModLoader.Config; -using System.Linq; namespace CalamityMod.CalPlayer { @@ -85,6 +89,7 @@ namespace CalamityMod.CalPlayer #region No Category public static bool areThereAnyDamnBosses = false; + public static bool areThereAnyDamnEvents = false; public bool drawBossHPBar = true; public bool shouldDrawSmallText = true; private const int saveVersion = 0; @@ -96,10 +101,13 @@ namespace CalamityMod.CalPlayer public int actualMaxLife = 0; public int deathModeUnderworldTime = 0; public int deathModeBlizzardTime = 0; - public static int chaosStateDuration = 600; + public static int chaosStateDuration = 360; + public static int chaosStateDurationBoss = 600; public bool killSpikyBalls = false; public Projectile lastProjectileHit; public double acidRoundMultiplier = 1D; + public int waterLeechTarget = -1; + public double trueMeleeDamage = 0D; #endregion #region External variables -- Only set by Mod.Call @@ -135,8 +143,9 @@ namespace CalamityMod.CalPlayer #endregion #region Stat Meter - public int[] damageStats = new int[5]; + public int[] damageStats = new int[6]; public int[] critStats = new int[4]; + public float actualMeleeDamageStat = 0f; public int defenseStat = 0; public int DRStat = 0; public int meleeSpeedStat = 0; @@ -194,6 +203,7 @@ namespace CalamityMod.CalPlayer public int profanedSoulWeaponType = 0; public int hurtSoundTimer = 0; public int danceOfLightCharge = 0; + public int shadowPotCooldown = 0; #endregion #region Sound @@ -232,6 +242,7 @@ namespace CalamityMod.CalPlayer public bool stealthStrikeHalfCost = false; public bool stealthStrikeAlwaysCrits = false; public bool wearingRogueArmor = false; + public float accStealthGenBoost = 0f; public float throwingDamage = 1f; public float throwingVelocity = 1f; @@ -519,13 +530,13 @@ namespace CalamityMod.CalPlayer public bool spectralVeil = false; public int spectralVeilImmunity = 0; public bool hasJetpack = false; - public bool blunderBooster = false; - public bool plaguedFuelPack = false; public int jetPackCooldown = 0; - public int blunderBoosterDash = 0; - public int blunderBoosterDirection = 0; + public bool plaguedFuelPack = false; public int plaguedFuelPackDash = 0; public int plaguedFuelPackDirection = 0; + public bool blunderBooster = false; + public int blunderBoosterDash = 0; + public int blunderBoosterDirection = 0; public bool veneratedLocket = false; public bool camper = false; public bool corrosiveSpine = false; @@ -843,6 +854,7 @@ namespace CalamityMod.CalPlayer public bool rDevil = false; public bool aValkyrie = false; public bool apexShark = false; + public bool gastricBelcher = false; public bool squirrel = false; public bool hauntedDishes = false; public bool stormjaw = false; @@ -1264,13 +1276,14 @@ namespace CalamityMod.CalPlayer player.statLifeMax2 = (int)(player.statLifeMax2 * 0.8); // Extra accessory slots + // This is probably fucked in 1.4 if (extraAccessoryML) player.extraAccessorySlots = 1; if (extraAccessoryML && player.extraAccessory && (Main.expertMode || Main.gameMenu)) player.extraAccessorySlots = 2; if (CalamityWorld.bossRushActive) { - if (CalamityMod.CalamityConfig.BossRushAccessoryCurse) + if (CalamityConfig.Instance.BossRushAccessoryCurse) { player.extraAccessorySlots = 0; } @@ -1284,6 +1297,9 @@ namespace CalamityMod.CalPlayer throwingAmmoCost75 = false; throwingAmmoCost66 = false; throwingAmmoCost50 = false; + accStealthGenBoost = 0f; + + trueMeleeDamage = 0D; dashMod = 0; externalAbyssLight = 0; @@ -1790,6 +1806,7 @@ namespace CalamityMod.CalPlayer eAxe = false; endoCooper = false; apexShark = false; + gastricBelcher = false; squirrel = false; hauntedDishes = false; stormjaw = false; @@ -1897,6 +1914,7 @@ namespace CalamityMod.CalPlayer planarSpeedBoost = 0; galileoCooldown = 0; soundCooldown = 0; + shadowPotCooldown = 0; rage = 0; adrenaline = 0; raiderStack = 0; @@ -2273,7 +2291,7 @@ namespace CalamityMod.CalPlayer bool useFire = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:Yharon", useFire); player.ManageSpecialBiomeVisuals("HeatDistortion", Main.UseHeatDistortion && (useFire || trippy || - aboveGround || ((double)point.Y < Main.worldSurface && player.ZoneDesert && !overworld && !Main.raining && !Filters.Scene["Sandstorm"].IsActive()))); + aboveGround || (point.Y < Main.worldSurface && player.ZoneDesert && !overworld && !Main.raining && !Filters.Scene["Sandstorm"].IsActive()))); bool useWater = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:Leviathan", useWater); @@ -2327,28 +2345,32 @@ namespace CalamityMod.CalPlayer } } - ZoneAbyss = (double)point.Y > (Main.rockLayer - y * 0.05) && + ZoneAbyss = point.Y > (Main.rockLayer - y * 0.05) && !player.lavaWet && !player.honeyWet && abyssPosY && abyssPosX; ZoneAbyssLayer1 = ZoneAbyss && - (double)point.Y <= (Main.rockLayer + y * 0.03); + point.Y <= (Main.rockLayer + y * 0.03); ZoneAbyssLayer2 = ZoneAbyss && - (double)point.Y > (Main.rockLayer + y * 0.03) && - (double)point.Y <= (Main.rockLayer + y * 0.14); + point.Y > (Main.rockLayer + y * 0.03) && + point.Y <= (Main.rockLayer + y * 0.14); ZoneAbyssLayer3 = ZoneAbyss && - (double)point.Y > (Main.rockLayer + y * 0.14) && - (double)point.Y <= (Main.rockLayer + y * 0.26); + point.Y > (Main.rockLayer + y * 0.14) && + point.Y <= (Main.rockLayer + y * 0.26); ZoneAbyssLayer4 = ZoneAbyss && - (double)point.Y > (Main.rockLayer + y * 0.26); + point.Y > (Main.rockLayer + y * 0.26); ZoneSulphur = (CalamityWorld.sulphurTiles > 30 || (player.ZoneOverworldHeight && sulphurPosX)) && !ZoneAbyss; + //Overriding 1.4's ass req boosts + if (Main.snowTiles > 300) + player.ZoneSnow = true; + Mod fargos = ModLoader.GetMod("Fargowiltas"); if (fargos != null) { @@ -2510,14 +2532,16 @@ namespace CalamityMod.CalPlayer if (!Collision.SolidCollision(teleportLocation, player.width, player.height)) { player.Teleport(teleportLocation, 4, 0); - NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + int duration = chaosStateDuration; + if (areThereAnyDamnBosses || areThereAnyDamnEvents) + duration = chaosStateDurationBoss; if (eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true); - else if (scarfCooldown) - player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, chaosStateDuration, true); + duration = (int)(chaosStateDuration * 1.5); + else if (scarfCooldown) + duration = chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); } } } @@ -2528,7 +2552,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 1800, false); //30 seconds rogueStealth -= rogueStealthMax * 0.25f; Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 7, 8, player.whoAmI, 0, 0); - Main.PlaySound(2, player.position, 45); + Main.PlaySound(SoundID.Item, player.position, 45); } if (CalamityMod.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0) @@ -2563,14 +2587,16 @@ namespace CalamityMod.CalPlayer rogueStealth -= rogueStealthMax * 0.25f; player.Teleport(teleportLocation, 1, 0); - NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); - if (eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true); - else if (scarfCooldown) - player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, chaosStateDuration, true); + int duration = chaosStateDuration; + if (areThereAnyDamnBosses || areThereAnyDamnEvents) + duration = chaosStateDurationBoss; + if (eScarfCooldown) + duration = (int)(chaosStateDuration * 1.5); + else if (scarfCooldown) + duration = chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); int numDust = 40; Vector2 step = playerToTeleport / numDust; @@ -2610,8 +2636,8 @@ namespace CalamityMod.CalPlayer plaguedFuelPackDash = 10; plaguedFuelPackDirection = player.direction; rogueStealth -= rogueStealthMax * 0.25f; - Main.PlaySound(2, player.position, 66); - Main.PlaySound(2, player.position, 34); + Main.PlaySound(SoundID.Item, player.position, 66); + Main.PlaySound(SoundID.Item, player.position, 34); } } if (CalamityMod.TarraHotKey.JustPressed) @@ -2629,7 +2655,7 @@ namespace CalamityMod.CalPlayer { brimflameFrenzy = true; player.AddBuff(ModContent.BuffType(), 10 * 60, true); - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 36; num502++) { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); @@ -2663,7 +2689,7 @@ namespace CalamityMod.CalPlayer { player.AddBuff(ModContent.BuffType(), 1800, false); } - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 64; num502++) { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 60, 0f, 0f, 0, default, 1f); @@ -2706,7 +2732,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 300, false); } omegaBlueCooldown = 1800; - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int i = 0; i < 66; i++) { int d = Dust.NewDust(player.position, player.width, player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); @@ -2718,7 +2744,7 @@ namespace CalamityMod.CalPlayer } if (dsSetBonus) { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 36; num502++) { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); @@ -2797,11 +2823,11 @@ namespace CalamityMod.CalPlayer if (Main.netMode == NetmodeID.SinglePlayer) { player.TeleportationPotion(); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 6); } else if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) { - NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TeleportationPotion, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } } @@ -2864,9 +2890,9 @@ namespace CalamityMod.CalPlayer } rage = 0; } - if (rage == rageMax && CalamityMod.CalamityConfig.AdrenalineAndRage && !rageModeActive) + if (rage == rageMax && CalamityConfig.Instance.Rippers && !rageModeActive) { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 64; num502++) { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); @@ -2887,11 +2913,11 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), RageDuration); } } - if (CalamityMod.AdrenalineHotKey.JustPressed && CalamityMod.CalamityConfig.AdrenalineAndRage && CalamityWorld.revenge) + if (CalamityMod.AdrenalineHotKey.JustPressed && CalamityConfig.Instance.Rippers && CalamityWorld.revenge) { if (adrenaline == adrenalineMax && !adrenalineModeActive) { - Main.PlaySound(29, (int)player.position.X, (int)player.position.Y, 104); + Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 64; num502++) { int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 206, 0f, 0f, 0, default, 1f); @@ -3177,7 +3203,7 @@ namespace CalamityMod.CalPlayer } Main.TeleportEffect(player.getRect(), 1); Main.TeleportEffect(player.getRect(), 3); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 6); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 6); if (Main.netMode != NetmodeID.Server) { return; @@ -3185,7 +3211,7 @@ namespace CalamityMod.CalPlayer if (syncData) { RemoteClient.CheckSection(player.whoAmI, player.position, 1); - NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, pos.X, pos.Y, 3, 0, 0); + NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, (float)player.whoAmI, pos.X, pos.Y, 3, 0, 0); } } #endregion @@ -3226,7 +3252,7 @@ namespace CalamityMod.CalPlayer public override void UpdateEquips(ref bool wallSpeedBuff, ref bool tileSpeedBuff, ref bool tileRangeBuff) { - if (CalamityMod.CalamityConfig.DrawBossBar) + if (CalamityConfig.Instance.BossHealthBar) { drawBossHPBar = true; } @@ -3234,7 +3260,7 @@ namespace CalamityMod.CalPlayer { drawBossHPBar = false; } - if (CalamityMod.CalamityConfig.DrawSmallText) + if (CalamityConfig.Instance.BossHealthBarExtraInfo) { shouldDrawSmallText = true; } @@ -3243,7 +3269,7 @@ namespace CalamityMod.CalPlayer shouldDrawSmallText = false; } - if (CalamityMod.CalamityConfig.MiningSpeedBoost) + if (CalamityConfig.Instance.MiningSpeedBoost) { player.pickSpeed *= 0.75f; } @@ -3339,7 +3365,7 @@ namespace CalamityMod.CalPlayer else meleeSpeedMult -= 0.025f; } - if (CalamityMod.CalamityConfig.ProficiencyEnabled) + if (CalamityConfig.Instance.Proficiency) { meleeSpeedMult += GetMeleeSpeedBonus(); } @@ -3419,7 +3445,7 @@ namespace CalamityMod.CalPlayer if (weakPetrification) WeakPetrification(); - if (player.mount.Active || player.mount.Cart || (CalamityMod.CalamityConfig.BossRushDashCurse && CalamityWorld.bossRushActive)) + if (player.mount.Active || player.mount.Cart || (CalamityConfig.Instance.BossRushDashCurse && CalamityWorld.bossRushActive)) { player.dashDelay = 10; dashMod = 0; @@ -3445,7 +3471,7 @@ namespace CalamityMod.CalPlayer if (weakPetrification) WeakPetrification(); - if (player.mount.Active || player.mount.Cart || (CalamityMod.CalamityConfig.BossRushDashCurse && CalamityWorld.bossRushActive)) + if (player.mount.Active || player.mount.Cart || (CalamityConfig.Instance.BossRushDashCurse && CalamityWorld.bossRushActive)) { player.dashDelay = 10; dashMod = 0; @@ -3667,7 +3693,7 @@ namespace CalamityMod.CalPlayer player.hurtCooldowns[k] = player.immuneTime; } - Main.PlaySound(2, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 68); + Main.PlaySound(SoundID.Item, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 68); int eclipseBurst = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(7000 * player.RogueDamage()), 0, player.whoAmI); } } @@ -3713,7 +3739,7 @@ namespace CalamityMod.CalPlayer } if (nCore && Main.rand.NextBool(10)) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 67); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 67); for (int j = 0; j < 25; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 173, 0f, 0f, 100, default, 2f); @@ -3738,7 +3764,7 @@ namespace CalamityMod.CalPlayer } if (godSlayer && !godSlayerCooldown) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 67); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 67); for (int j = 0; j < 50; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 173, 0f, 0f, 100, default, 2f); @@ -3764,7 +3790,17 @@ namespace CalamityMod.CalPlayer { player.ClearBuff(ModContent.BuffType()); player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(60f)); - } + + // Additional potion sickness time + int additionalTime = 0; + for (int i = 0; i < Player.MaxBuffs; i++) + { + if (player.buffType[i] == BuffID.PotionSickness) + additionalTime = player.buffTime[i]; + } + float potionSicknessTime = 30f + (float)Math.Ceiling(additionalTime / 60D); + player.AddBuff(BuffID.PotionSickness, CalamityUtils.SecondsToFrames(potionSicknessTime)); + } player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(45f)); return false; } @@ -3790,7 +3826,17 @@ namespace CalamityMod.CalPlayer { player.ClearBuff(ModContent.BuffType()); player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(60f)); - } + + // Additional potion sickness time + int additionalTime = 0; + for (int i = 0; i < Player.MaxBuffs; i++) + { + if (player.buffType[i] == BuffID.PotionSickness) + additionalTime = player.buffTime[i]; + } + float potionSicknessTime = 30f + (float)Math.Ceiling(additionalTime / 60D); + player.AddBuff(BuffID.PotionSickness, CalamityUtils.SecondsToFrames(potionSicknessTime)); + } } else if (silvaWings) { @@ -4011,9 +4057,9 @@ namespace CalamityMod.CalPlayer acidRoundMultiplier = 1D; } //Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me - if (desertProwler && (item.ranged/* || item.type == ModContent.ItemType()*/)) + if (desertProwler && (item.ranged || item.type == ModContent.ItemType())) { - flat += 2f; + flat += 1f; } } @@ -4063,9 +4109,9 @@ namespace CalamityMod.CalPlayer #region Melee Effects public override void MeleeEffects(Item item, Rectangle hitbox) { - if (!item.melee && !item.noMelee && (!item.noUseGraphic && (int)player.meleeEnchant > 0)) + if (!item.melee && !item.noMelee && (!item.noUseGraphic && player.meleeEnchant > 0)) { - if ((int)player.meleeEnchant == 7) + if (player.meleeEnchant == 7) { if (Main.rand.NextBool(20)) { @@ -4256,18 +4302,19 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); + int duration = 90; + target.AddBuff(BuffID.CursedInferno, duration / 2, false); + target.AddBuff(BuffID.Frostburn, duration, false); + target.AddBuff(BuffID.Ichor, duration, false); + target.AddBuff(BuffID.Venom, duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); if (Main.rand.NextBool(5)) { - target.AddBuff(ModContent.BuffType(), 120, false); + target.AddBuff(ModContent.BuffType(), duration, false); } } if (cryogenSoul || frostFlare) @@ -4351,7 +4398,7 @@ namespace CalamityMod.CalPlayer player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.CursedInferno, 90, false); target.AddBuff(BuffID.Venom, 120, false); } } @@ -4417,11 +4464,13 @@ namespace CalamityMod.CalPlayer } } } + if (proj.Calamity().trueMelee) titanBoost = 600; if (sulfurSet && proj.friendly && !target.friendly) target.AddBuff(BuffID.Poisoned, 120); + if (omegaBlueChestplate && proj.friendly && !target.friendly) target.AddBuff(ModContent.BuffType(), 240); @@ -4448,18 +4497,19 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); + int duration = 90; + target.AddBuff(BuffID.CursedInferno, duration / 2, false); + target.AddBuff(BuffID.Frostburn, duration, false); + target.AddBuff(BuffID.Ichor, duration, false); + target.AddBuff(BuffID.Venom, duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); if (Main.rand.NextBool(5)) { - target.AddBuff(ModContent.BuffType(), 120, false); + target.AddBuff(ModContent.BuffType(), duration, false); } } if (aWeapon) @@ -4563,7 +4613,7 @@ namespace CalamityMod.CalPlayer player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.CursedInferno, 90, false); target.AddBuff(BuffID.Venom, 120, false); } } @@ -4617,18 +4667,19 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); + int duration = 90; + target.AddBuff(BuffID.CursedInferno, duration / 2, false); + target.AddBuff(BuffID.Frostburn, duration, false); + target.AddBuff(BuffID.Ichor, duration, false); + target.AddBuff(BuffID.Venom, duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); if (Main.rand.NextBool(5)) { - target.AddBuff(ModContent.BuffType(), 120, false); + target.AddBuff(ModContent.BuffType(), duration, false); } } if (aWeapon) @@ -4701,7 +4752,7 @@ namespace CalamityMod.CalPlayer player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.CursedInferno, 90, false); target.AddBuff(BuffID.Venom, 120, false); } } @@ -4771,6 +4822,7 @@ namespace CalamityMod.CalPlayer if (sulfurSet && proj.friendly) target.AddBuff(BuffID.Poisoned, 120); + if (omegaBlueChestplate && proj.friendly) target.AddBuff(ModContent.BuffType(), 240); @@ -4794,18 +4846,19 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - target.AddBuff(BuffID.CursedInferno, 120, false); - target.AddBuff(BuffID.Frostburn, 120, false); - target.AddBuff(BuffID.Ichor, 120, false); - target.AddBuff(BuffID.Venom, 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); - target.AddBuff(ModContent.BuffType(), 120, false); + int duration = 90; + target.AddBuff(BuffID.CursedInferno, duration / 2, false); + target.AddBuff(BuffID.Frostburn, duration, false); + target.AddBuff(BuffID.Ichor, duration, false); + target.AddBuff(BuffID.Venom, duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); + target.AddBuff(ModContent.BuffType(), duration, false); if (Main.rand.NextBool(5)) { - target.AddBuff(ModContent.BuffType(), 120, false); + target.AddBuff(ModContent.BuffType(), duration, false); } } if (aWeapon) @@ -4909,7 +4962,7 @@ namespace CalamityMod.CalPlayer player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { - target.AddBuff(BuffID.CursedInferno, 120, false); + target.AddBuff(BuffID.CursedInferno, 90, false); target.AddBuff(BuffID.Venom, 120, false); } } @@ -4932,19 +4985,13 @@ namespace CalamityMod.CalPlayer } if (item.melee) { - double damageAdd = (dodgeScarf ? 0.2 : 0) + - (evasionScarf ? 0.1 : 0) + - ((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 2 : 0) + - (DoGLore ? 0.5 : 0) + - (fungalSymbiote ? 0.25 : 0); - - damageMult += damageAdd; + damageMult += trueMeleeDamage; } - if (enraged && !CalamityMod.CalamityConfig.BossRushXerocCurse) + if (enraged && !CalamityConfig.Instance.BossRushXerocCurse) { damageMult += 1.25; } - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { bool DHorHoD = draedonsHeart || heartOfDarkness; if (rageModeActive && adrenalineModeActive) @@ -5090,7 +5137,7 @@ namespace CalamityMod.CalPlayer player.HealEffect(healAmount); } } - if (CalamityMod.CalamityConfig.ProficiencyEnabled) + if (CalamityConfig.Instance.Proficiency) { if (gainLevelCooldown <= 0) { @@ -5116,7 +5163,7 @@ namespace CalamityMod.CalPlayer } } } - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { if (item.melee) { @@ -5160,7 +5207,7 @@ namespace CalamityMod.CalPlayer { double useTimeMultiplier = 0.85 + (heldItem.useTime * heldItem.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost double wingTimeFraction = player.wingTimeMax / 20D; - double meleeStatMultiplier = (double)(player.meleeDamage * (float)(player.meleeCrit / 10D)); + double meleeStatMultiplier = player.meleeDamage * (float)(player.meleeCrit / 10D); if (player.wingTime < player.wingTimeMax) player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); @@ -5173,7 +5220,7 @@ namespace CalamityMod.CalPlayer double damageMult = 1.0; if (isSummon) { - if (heldItem.type > 0) + if (heldItem.type > ItemID.None) { if (heldItem.summon && !heldItem.melee && !heldItem.ranged && !heldItem.magic && !heldItem.Calamity().rogue) { @@ -5183,13 +5230,7 @@ namespace CalamityMod.CalPlayer } if (isTrueMelee) { - double damageAdd = (dodgeScarf ? 0.2 : 0) + - (evasionScarf ? 0.1 : 0) + - ((aBulwarkRare && aBulwarkRareMeleeBoostTimer > 0) ? 2 : 0) + - (DoGLore ? 0.5 : 0) + - (fungalSymbiote ? 0.25 : 0); - - damageMult += damageAdd; + damageMult += trueMeleeDamage; } if (screwdriver) { @@ -5214,7 +5255,7 @@ namespace CalamityMod.CalPlayer { damageMult += 4.0; } - if (enraged && !CalamityMod.CalamityConfig.BossRushXerocCurse) + if (enraged && !CalamityConfig.Instance.BossRushXerocCurse) { damageMult += 1.25; } @@ -5272,7 +5313,7 @@ namespace CalamityMod.CalPlayer damageMult += 0.5; } } - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { bool DHorHoD = draedonsHeart || heartOfDarkness; if (rageModeActive && adrenalineModeActive) @@ -5416,7 +5457,7 @@ namespace CalamityMod.CalPlayer if (isSummon && !fearmongerSet && !profanedCrystalBuffs && (!forbidden || !heldItem.magic) && (!forbiddenCirclet || !heldItem.Calamity().rogue)) { - if (heldItem.type > 0) + if (heldItem.type > ItemID.None) { if (!heldItem.summon && (heldItem.melee || heldItem.ranged || heldItem.magic || heldItem.Calamity().rogue) && @@ -5464,7 +5505,7 @@ namespace CalamityMod.CalPlayer { if (theBee && player.statLife >= player.statLifeMax2) { - Main.PlaySound(2, (int)proj.position.X, (int)proj.position.Y, 110); + Main.PlaySound(SoundID.Item, (int)proj.position.X, (int)proj.position.Y, 110); } if (unstablePrism && crit) { @@ -5609,7 +5650,7 @@ namespace CalamityMod.CalPlayer { polarisBoostCounter += 1; } - if (CalamityMod.CalamityConfig.ProficiencyEnabled) + if (CalamityConfig.Instance.Proficiency) { if (gainLevelCooldown <= 0) //max is 12501 to avoid setting off fireworks forever { @@ -5716,7 +5757,7 @@ namespace CalamityMod.CalPlayer raiderStack++; raiderCooldown = 30; } - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { if (isTrueMelee) { @@ -5739,23 +5780,46 @@ namespace CalamityMod.CalPlayer } } } - #endregion + #endregion + + #region Modify Hit By NPC + public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) + { + int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2); + if (CalamityWorld.bossRushActive) + { + if (damage < bossRushDamage) + damage = bossRushDamage; + } + + if (areThereAnyDamnBosses && CalamityMod.bossVelocityDamageScaleValues.ContainsKey(npc.type)) + { + CalamityMod.bossVelocityDamageScaleValues.TryGetValue(npc.type, out float velocityScalar); + + if (((npc.type == NPCID.EyeofCthulhu || npc.type == NPCID.Spazmatism) && npc.ai[0] >= 2f) || (npc.type == NPCID.Plantera && npc.life / (float)npc.lifeMax <= 0.5f)) + velocityScalar = CalamityMod.bitingEnemeyVelocityScale; + + if (npc.velocity == Vector2.Zero) + { + damage = (int)(damage * velocityScalar); + } + else + { + float amount = npc.velocity.Length() / npc.Calamity().maxVelocity; + if (amount > 1f) + amount = 1f; + + damage = (int)(damage * MathHelper.Lerp(velocityScalar, 1.1f, amount)); + } + } - #region Modify Hit By NPC - public override void ModifyHitByNPC(NPC npc, ref int damage, ref bool crit) - { - int bossRushDamage = (Main.expertMode ? 500 : 300) + (CalamityWorld.bossRushStage * 2); - if (CalamityWorld.bossRushActive) - { - if (damage < bossRushDamage) - damage = bossRushDamage; - } if (triumph) { - double HPMultiplier = 0.15 * (1.0 - ((double)npc.life / (double)npc.lifeMax)); + double HPMultiplier = 0.15 * (1.0 - (npc.life / (double)npc.lifeMax)); int damageReduction = (int)(damage * HPMultiplier); damage -= damageReduction; } + if (aSparkRare) { if (npc.type == NPCID.BlueJellyfish || npc.type == NPCID.PinkJellyfish || npc.type == NPCID.GreenJellyfish || @@ -5763,32 +5827,46 @@ namespace CalamityMod.CalPlayer npc.type == NPCID.MartianTurret || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) damage /= 2; } + if (fleshTotem && !fleshTotemCooldown) { player.AddBuff(ModContent.BuffType(), 1200, false); //20 seconds damage /= 2; } + if (tarragonCloak && !tarragonCloakCooldown && tarraMelee) { damage /= 2; } + if (bloodflareMelee && bloodflareFrenzy && !bloodFrenzyCooldown) { damage /= 2; } + if (silvaMelee && silvaCountdown <= 0 && hasSilvaEffect) { damage = (int)(damage * 0.8); } + if (aBulwarkRare) { aBulwarkRareMeleeBoostTimer += 3 * damage; if (aBulwarkRareMeleeBoostTimer > 900) aBulwarkRareMeleeBoostTimer = 900; } - if (player.whoAmI == Main.myPlayer && gainRageCooldown <= 0) + + if (Main.hardMode && Main.expertMode) + { + bool reduceChaosBallDamage = npc.type == NPCID.ChaosBall && !NPC.AnyNPCs(NPCID.GoblinSummoner); + + if (reduceChaosBallDamage || npc.type == NPCID.BurningSphere || npc.type == NPCID.WaterSphere) + damage = (int)(damage * 0.6); + } + + if (player.whoAmI == Main.myPlayer && gainRageCooldown <= 0) { - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage && !npc.SpawnedFromStatue) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers && !npc.SpawnedFromStatue) { gainRageCooldown = 60; int stressGain = damage * (profanedRage ? 3 : 2); @@ -5836,37 +5914,90 @@ namespace CalamityMod.CalPlayer damage = 0; } } + + // Reduce projectile damage based on banner type + // IMPORTANT NOTE: Rework this in 1.4! + Point point = player.Center.ToTileCoordinates(); + int buffScanAreaWidth = (Main.maxScreenW + 800) / 16 - 1; + int buffScanAreaHeight = (Main.maxScreenH + 800) / 16 - 1; + Rectangle rectangle = CalamityUtils.ClampToWorld(tileRectangle: new Rectangle(point.X - buffScanAreaWidth / 2, point.Y - buffScanAreaHeight / 2, buffScanAreaWidth, buffScanAreaHeight)); + bool[] NPCBannerBuff = new bool[Main.MaxBannerTypes]; + bool hasBanner = false; + + // Scan area around the player for banners + for (int i = rectangle.Left; i < rectangle.Right; i++) + { + for (int j = rectangle.Top; j < rectangle.Bottom; j++) + { + if (!rectangle.Contains(i, j)) + continue; + + Tile tile = Main.tile[i, j]; + if (tile == null || !tile.active()) + continue; + + if (tile.type == TileID.Banners && (tile.frameX >= 396 || tile.frameY >= 54)) + { + int bannerType = tile.frameX / 18 - 21; + for (int k = tile.frameY; k >= 54; k -= 54) + { + bannerType += 90; + bannerType += 21; + } + + int bannerItemType = Item.BannerToItem(bannerType); + if (ItemID.Sets.BannerStrength[bannerItemType].Enabled) + { + NPCBannerBuff[bannerType] = true; + hasBanner = true; + } + } + } + } + + // Reduce damage + if (hasBanner) + { + BannerProjectileDamageReduction(proj, ref damage, NPCBannerBuff); + } + int bossRushDamage = (Main.expertMode ? 125 : 150) + (CalamityWorld.bossRushStage / 2); if (CalamityWorld.bossRushActive) { if (damage < bossRushDamage) damage = bossRushDamage; } + if (projRefRare) { if (proj.type == projTypeJustHitBy) damage = (int)(damage * 0.85); } + if (aSparkRare) { if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType() || proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet) damage /= 2; } + if (proj.type == ProjectileID.Nail) { damage = (int)(damage * 0.75); } + if (beeResist) { if (CalamityMod.beeProjectileList.Contains(proj.type)) damage = (int)(damage * 0.75); } + if (Main.hardMode && Main.expertMode && !CalamityWorld.spawnedHardBoss && proj.active && !proj.friendly && proj.hostile && damage > 0) { if (CalamityMod.hardModeNerfList.Contains(proj.type)) damage = (int)(damage * 0.75); } + if (CalamityWorld.revenge) { double damageMultiplier = 1D; @@ -5913,7 +6044,7 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer && gainRageCooldown <= 0) { - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage && !CalamityMod.trapProjectileList.Contains(proj.type)) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers && !CalamityMod.trapProjectileList.Contains(proj.type)) { gainRageCooldown = 60; int stressGain = damage * (profanedRage ? 3 : 2); @@ -5934,10 +6065,500 @@ namespace CalamityMod.CalPlayer } } } - #endregion + #endregion - #region On Hit - public override void OnHitByNPC(NPC npc, int damage, bool crit) + #region Banner Projectile Damage Reduction + private void BannerProjectileDamageReduction(Projectile proj, ref int damage, bool[] NPCBannerBuffs) + { + bool? reduceDamage = null; + double bannerDamageMultiplier = Main.expertMode ? 0.5 : 0.75; + + for (int l = 0; l < Main.MaxBannerTypes; l++) + { + int bannerNPCType = Item.BannerToNPC(l); + if (bannerNPCType != 0 && NPCBannerBuffs[l]) + { + if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType() || (bannerNPCType == ModContent.NPCType() && proj.type == ModContent.ProjectileType())) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = true; + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()); + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType() || bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()); + } + else if (proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()); + } + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()); + } + else if (proj.type == ProjectileID.EyeBeam) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(NPCID.Golem); + } + else if (proj.type == ProjectileID.CultistBossIceMist || proj.type == ProjectileID.CultistBossLightningOrbArc) + { + if (bannerNPCType == ModContent.NPCType() || bannerNPCType == ModContent.NPCType()) + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(NPCID.CultistBoss); + } + else if (proj.type == ProjectileID.SaucerScrap) + { + if (bannerNPCType == ModContent.NPCType()) + reduceDamage = Main.invasionType != InvasionID.MartianMadness; + } + else + { + switch (proj.type) + { + case ProjectileID.Stinger: + if (CalamityMod.hornetList.Contains(bannerNPCType) || CalamityMod.mossHornetList.Contains(bannerNPCType)) + { + reduceDamage = !NPC.AnyNPCs(NPCID.QueenBee); + } + break; + + case ProjectileID.PinkLaser: + if (bannerNPCType == NPCID.Gastropod || bannerNPCType == ModContent.NPCType()) + { + reduceDamage = !NPC.AnyNPCs(NPCID.TheDestroyer) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + } + break; + + case ProjectileID.SandBallFalling: + if (bannerNPCType == NPCID.Antlion) + { + reduceDamage = true; + } + break; + + case ProjectileID.DemonSickle: + if (bannerNPCType == NPCID.Demon || bannerNPCType == NPCID.VoodooDemon) + { + reduceDamage = true; + } + break; + + case ProjectileID.HarpyFeather: + if (bannerNPCType == NPCID.Harpy) + { + reduceDamage = true; + } + break; + + case ProjectileID.JavelinHostile: + if (bannerNPCType == NPCID.GreekSkeleton) + { + reduceDamage = true; + } + break; + + case ProjectileID.IceSpike: + if (bannerNPCType == NPCID.SpikedIceSlime) + { + reduceDamage = true; + } + break; + + case ProjectileID.JungleSpike: + if (bannerNPCType == NPCID.SpikedJungleSlime) + { + reduceDamage = true; + } + break; + + case ProjectileID.WebSpit: + if (bannerNPCType == NPCID.BlackRecluse || bannerNPCType == NPCID.BlackRecluseWall) + { + reduceDamage = true; + } + break; + + case ProjectileID.CursedFlameHostile: + if (bannerNPCType == NPCID.Clinger) + { + reduceDamage = !NPC.AnyNPCs(NPCID.Spazmatism); + } + break; + + case ProjectileID.DesertDjinnCurse: + if (bannerNPCType == NPCID.DesertDjinn) + { + reduceDamage = true; + } + break; + + case ProjectileID.InfernoHostileBlast: + case ProjectileID.InfernoHostileBolt: + if (bannerNPCType == NPCID.DiabolistRed || bannerNPCType == NPCID.DiabolistWhite) + { + reduceDamage = true; + } + break; + + case ProjectileID.Shadowflames: + if (bannerNPCType == NPCID.GiantCursedSkull) + { + reduceDamage = true; + } + break; + + case ProjectileID.FrostBlastHostile: + if (bannerNPCType == NPCID.IceElemental || bannerNPCType == ModContent.NPCType()) + { + reduceDamage = true; + } + break; + + case ProjectileID.IcewaterSpit: + if (bannerNPCType == NPCID.IcyMerman) + { + reduceDamage = true; + } + break; + + case ProjectileID.GoldenShowerHostile: + if (bannerNPCType == NPCID.IchorSticker) + { + reduceDamage = true; + } + break; + + case ProjectileID.ShadowBeamHostile: + if (bannerNPCType == NPCID.Necromancer || bannerNPCType == NPCID.NecromancerArmored) + { + reduceDamage = true; + } + break; + + case ProjectileID.PaladinsHammerHostile: + if (bannerNPCType == NPCID.Paladin) + { + reduceDamage = true; + } + break; + + case ProjectileID.LostSoulHostile: + if (bannerNPCType == NPCID.RaggedCaster || bannerNPCType == NPCID.RaggedCasterOpenCoat) + { + reduceDamage = true; + } + break; + + case ProjectileID.UnholyTridentHostile: + if (bannerNPCType == NPCID.RedDevil) + { + reduceDamage = true; + } + break; + + case ProjectileID.RuneBlast: + if (bannerNPCType == NPCID.RuneWizard) + { + reduceDamage = true; + } + break; + + case ProjectileID.FlamingArrow: + if (bannerNPCType == NPCID.SkeletonArcher || bannerNPCType == NPCID.PirateCrossbower || bannerNPCType == NPCID.GoblinArcher || bannerNPCType == NPCID.ElfArcher) + { + reduceDamage = true; + } + break; + + case ProjectileID.RocketSkeleton: + if (bannerNPCType == NPCID.SkeletonCommando) + { + reduceDamage = !NPC.AnyNPCs(NPCID.SkeletronPrime) || !CalamityWorld.revenge; + } + break; + + case ProjectileID.SniperBullet: + if (bannerNPCType == NPCID.SkeletonSniper) + { + reduceDamage = true; + } + break; + + case ProjectileID.BulletDeadeye: + if (bannerNPCType == NPCID.TacticalSkeleton || bannerNPCType == NPCID.SnowmanGangsta || bannerNPCType == NPCID.PirateCaptain || bannerNPCType == NPCID.PirateDeadeye || bannerNPCType == NPCID.ElfCopter) + { + reduceDamage = !NPC.AnyNPCs(NPCID.SantaNK1); + } + break; + + case ProjectileID.RainNimbus: + if (bannerNPCType == NPCID.AngryNimbus) + { + reduceDamage = true; + } + break; + + case ProjectileID.FrostBeam: + if (bannerNPCType == NPCID.IceGolem) + { + reduceDamage = true; + } + break; + + case ProjectileID.SandnadoHostile: + case ProjectileID.SandnadoHostileMark: + if (bannerNPCType == NPCID.SandElemental) + { + reduceDamage = true; + } + break; + + case ProjectileID.SnowBallHostile: + if (bannerNPCType == NPCID.SnowBalla) + { + reduceDamage = true; + } + break; + + case ProjectileID.CannonballHostile: + if (bannerNPCType == NPCID.PirateCaptain) + { + reduceDamage = !NPC.AnyNPCs(NPCID.PirateShip); + } + break; + + case ProjectileID.DrManFlyFlask: + if (bannerNPCType == NPCID.DrManFly) + { + reduceDamage = true; + } + break; + + case ProjectileID.EyeLaser: + if (bannerNPCType == NPCID.Eyezor) + { + reduceDamage = !NPC.AnyNPCs(NPCID.Retinazer); + } + break; + + case ProjectileID.Nail: + if (bannerNPCType == NPCID.Nailhead) + { + reduceDamage = true; + } + break; + + case ProjectileID.NebulaSphere: + if (bannerNPCType == NPCID.NebulaBeast) + { + reduceDamage = true; + } + break; + + case ProjectileID.NebulaLaser: + if (bannerNPCType == NPCID.NebulaBrain) + { + reduceDamage = true; + } + break; + + case ProjectileID.NebulaBolt: + if (bannerNPCType == NPCID.NebulaSoldier) + { + reduceDamage = true; + } + break; + + case ProjectileID.StardustJellyfishSmall: + if (bannerNPCType == NPCID.StardustJellyfishBig) + { + reduceDamage = true; + } + break; + + case ProjectileID.StardustSoldierLaser: + if (bannerNPCType == NPCID.StardustSoldier) + { + reduceDamage = true; + } + break; + + case ProjectileID.VortexAcid: + if (bannerNPCType == NPCID.VortexHornetQueen) + { + reduceDamage = true; + } + break; + + case ProjectileID.VortexLaser: + if (bannerNPCType == NPCID.VortexRifleman) + { + reduceDamage = true; + } + break; + + case ProjectileID.VortexLightning: + if (bannerNPCType == NPCID.VortexSoldier) + { + reduceDamage = true; + } + break; + + case ProjectileID.RayGunnerLaser: + if (bannerNPCType == NPCID.RayGunner) + { + reduceDamage = true; + } + break; + + case ProjectileID.BrainScramblerBolt: + if (bannerNPCType == NPCID.BrainScrambler) + { + reduceDamage = true; + } + break; + + case ProjectileID.MartianWalkerLaser: + if (bannerNPCType == NPCID.MartianWalker) + { + reduceDamage = true; + } + break; + + case ProjectileID.ScutlixLaser: + if (bannerNPCType == NPCID.Scutlix) + { + reduceDamage = true; + } + break; + + case ProjectileID.MartianTurretBolt: + if ((bannerNPCType == NPCID.MartianTurret && Main.invasionType == InvasionID.MartianMadness) || (bannerNPCType == ModContent.NPCType() && Main.invasionType != InvasionID.MartianMadness)) + { + reduceDamage = true; + } + break; + + case ProjectileID.SaucerLaser: + if (bannerNPCType == ModContent.NPCType() && Main.invasionType != InvasionID.MartianMadness) + { + reduceDamage = true; + } + break; + } + } + + if (reduceDamage.HasValue) + { + if (reduceDamage.Value) + damage = (int)(damage * bannerDamageMultiplier); + + break; + } + } + } + } + #endregion + + #region On Hit + public override void OnHitByNPC(NPC npc, int damage, bool crit) { if (sulfurSet) npc.AddBuff(BuffID.Poisoned, 120); @@ -6351,13 +6972,13 @@ namespace CalamityMod.CalPlayer else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) { playSound = false; - Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 4, 1f, 0f); //metal hit noise + Main.PlaySound(SoundID.NPCHit, (int)player.position.X, (int)player.position.Y, 4, 1f, 0f); //metal hit noise hurtSoundTimer = 10; } else if (((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) || ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide)) { playSound = false; - Main.PlaySound(20, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); //female hit noise + Main.PlaySound(SoundID.FemaleHit, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); //female hit noise hurtSoundTimer = 10; } } @@ -6367,7 +6988,7 @@ namespace CalamityMod.CalPlayer double damageMult = 1.0 + (dArtifact ? 0.25 : 0.0) + (DoGLore ? 0.1 : 0.0) + - ((player.beetleDefense && player.beetleOrbs > 0) ? (0.05 * (double)player.beetleOrbs) : 0.0) + + ((player.beetleDefense && player.beetleOrbs > 0) ? (0.05 * player.beetleOrbs) : 0.0) + (enraged ? 0.25 : 0.0) + ((CalamityWorld.defiled && Main.rand.NextBool(4)) ? 0.5 : 0.0) + ((bloodPact && Main.rand.NextBool(4)) ? 1.5 : 0.0); @@ -6376,9 +6997,7 @@ namespace CalamityMod.CalPlayer { if (player.chaosState) damageMult += 0.25; - if (player.ichor) - damageMult += 0.25; - else if (player.onFire2) + if (player.onFire2) damageMult += 0.2; } @@ -6388,7 +7007,7 @@ namespace CalamityMod.CalPlayer if (CalamityWorld.revenge) { customDamage = true; - double newDamage = (double)damage - (player.statDefense * 0.75); + double newDamage = damage - (player.statDefense * 0.75); double newDamageLimit = 5.0 + (Main.hardMode ? 5.0 : 0.0) + (NPC.downedPlantBoss ? 5.0 : 0.0) + (NPC.downedMoonlord ? 5.0 : 0.0); //5, 10, 15, 20 if (newDamage < newDamageLimit) { @@ -6404,7 +7023,7 @@ namespace CalamityMod.CalPlayer } if (purpleCandle) { - damage = (int)((double)damage - (player.statDefense * 0.05)); + damage = (int)(damage - (player.statDefense * 0.05)); } // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. // To prevent abuse, this effect does not work if there are any bosses alive. @@ -6438,7 +7057,7 @@ namespace CalamityMod.CalPlayer if (!CalamityWorld.downedBossAny) damage = (int)(damage * 0.8); - if (CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityConfig.Instance.Rippers) { if (adrenaline == adrenalineMax && !adrenalineModeActive) damage = (int)(damage * 0.5); @@ -6487,7 +7106,7 @@ namespace CalamityMod.CalPlayer modStealth = 1f; if (player.whoAmI == Main.myPlayer) { - if (CalamityMod.CalamityConfig.AdrenalineAndRage && CalamityWorld.revenge) + if (CalamityConfig.Instance.Rippers && CalamityWorld.revenge) { if (!adrenalineModeActive && damage > 0) //to prevent paladin's shield ruining adren even with 0 dmg taken { @@ -6499,7 +7118,7 @@ namespace CalamityMod.CalPlayer if (amidiasBlessing) { player.ClearBuff(ModContent.BuffType()); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 96); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 96); } if ((gShell || fabledTortoise) && !player.panic) { @@ -6510,7 +7129,7 @@ namespace CalamityMod.CalPlayer abyssalDivingSuitPlateHits++; if (abyssalDivingSuitPlateHits >= 3) { - Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 14); + Main.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 14); player.AddBuff(ModContent.BuffType(), 10830); for (int num621 = 0; num621 < 20; num621++) { @@ -6563,7 +7182,7 @@ namespace CalamityMod.CalPlayer } if (sirenIce) { - Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 7); + Main.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 7); player.AddBuff(ModContent.BuffType(), 1800); for (int num621 = 0; num621 < 10; num621++) { @@ -6602,7 +7221,7 @@ namespace CalamityMod.CalPlayer } if (fBarrier || ((sirenBoobs || sirenBoobsAlt) && NPC.downedBoss3)) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 27); for (int m = 0; m < Main.maxNPCs; m++) { if (Main.npc[m].active && !Main.npc[m].friendly) @@ -6737,7 +7356,7 @@ namespace CalamityMod.CalPlayer iFramesToAdd += 10; } } - if (CalamityWorld.bossRushActive && CalamityMod.CalamityConfig.BossRushImmunityFrameCurse) + if (CalamityWorld.bossRushActive && CalamityConfig.Instance.BossRushImmunityFrameCurse) { bossRushImmunityFrameCurseTimer = 300 + player.immuneTime; } @@ -6766,7 +7385,7 @@ namespace CalamityMod.CalPlayer { if (aBulwarkRare) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 5f, player.whoAmI, 0f, 1f); } int starAmt = aBulwarkRare ? 12 : 5; @@ -6855,250 +7474,250 @@ namespace CalamityMod.CalPlayer Main.projectile[bee].localNPCHitCooldown = 5; } } - if (fCarapace) - { - if (damage > 0) - { - Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 45); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int fDamage = (int)(56 * player.AverageDamage()); - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int spore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); - int spore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); - Main.projectile[spore1].timeLeft = 120; - Main.projectile[spore2].timeLeft = 120; - } - } - } - } - if (aSpark) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 93); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int sDamage = hardMode ? 36 : 6; - if (aSparkRare) - sDamage += hardMode ? 12 : 2; - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int spark1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(sDamage * player.AverageDamage()), 1.25f, player.whoAmI, 0f, 0f); - int spark2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(sDamage * player.AverageDamage()), 1.25f, player.whoAmI, 0f, 0f); - Main.projectile[spark1].timeLeft = 120; - Main.projectile[spark2].timeLeft = 120; - Main.projectile[spark1].Calamity().forceTypeless = true; - Main.projectile[spark2].Calamity().forceTypeless = true; - } - } - } - } - if (inkBomb) - { - if (player.whoAmI == Main.myPlayer && !inkBombCooldown) - { - player.AddBuff(ModContent.BuffType(), 1200); - rogueStealth += 0.5f; - for (int i = 0; i < 5; i++) - { - Main.PlaySound(2, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 61); - int inkBomb = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, player.whoAmI); - } - } - } - if (blazingCore) - { - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - for (int i = 0; i < 360; i += 3) - { - Vector2 BCDSpeed = new Vector2(5f, 5f).RotatedBy(MathHelper.ToRadians(i)); - Dust.NewDust(player.Center, 1, 1, 244, BCDSpeed.X, BCDSpeed.Y, 0, default, 1.1f); - } - Main.PlaySound(SoundID.Item14, player.Center); - int blazingSun = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(1690 * player.AverageDamage()), 0f, player.whoAmI, 0f, 0f); - Main.projectile[blazingSun].Center = player.Center; - int blazingSun2 = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); - Main.projectile[blazingSun2].Center = player.Center; - } - } - if (ataxiaBlaze && Main.rand.NextBool(5)) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); - int eDamage = (int)(100 * player.AverageDamage()); - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), eDamage, 1f, player.whoAmI, 0f, 0f); - } - } - } - else if (daedalusShard) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 27); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int sDamage = (int)(27 * player.RangedDamage()); //daedalus ranged helm - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 8; i++) - { - float randomSpeed = (float)Main.rand.Next(1, 7); - float randomSpeed2 = (float)Main.rand.Next(1, 7); - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, 90, sDamage, 1f, player.whoAmI, 0f, 0f); - int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, 90, sDamage, 1f, player.whoAmI, 0f, 0f); - Main.projectile[shard].Calamity().forceTypeless = true; - Main.projectile[shard2].Calamity().forceTypeless = true; - } - } - } - } - else if (reaverSpore) - { - if (damage > 0) - { - Main.PlaySound(3, (int)player.position.X, (int)player.position.Y, 1); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - int rDamage = (int)(58 * player.RogueDamage()); //Reaver rogue helm - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; - Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int rspore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); - Main.projectile[rspore1].usesLocalNPCImmunity = true; - Main.projectile[rspore1].localNPCHitCooldown = 60; - int rspore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 568, rDamage, 2f, player.whoAmI, 0f, 0f); - Main.projectile[rspore2].usesLocalNPCImmunity = true; - Main.projectile[rspore2].localNPCHitCooldown = 60; - } - } - } - } - else if (godSlayerDamage) //god slayer melee helm - { - if (damage > 80) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 73); - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - if (player.whoAmI == Main.myPlayer) - { - for (i = 0; i < 4; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(900 * player.MeleeDamage()), 5f, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(900 * player.MeleeDamage()), 5f, player.whoAmI, 0f, 0f); - } - } - } - } - else if (godSlayerMage) - { - if (damage > 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 74); - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((auricSet ? 2400 : 1200) * player.MagicDamage()), 1f, player.whoAmI, 0f, 0f); - } - } - } - else if (dsSetBonus) - { - if (player.whoAmI == Main.myPlayer) - { - for (int l = 0; l < 2; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.ShadowBeamFriendly, (int)(3000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; - } - for (int l = 0; l < 5; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.DemonScythe, (int)(5000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 10; - Main.projectile[num19].Calamity().forceTypeless = true; - } - } - } - if (lastProjectileHit != null) - { - switch (lastProjectileHit.modProjectile.cooldownSlot) - { - case 0: - case 1: - player.hurtCooldowns[lastProjectileHit.modProjectile.cooldownSlot] += iFramesToAdd; - break; - case -1: - default: - player.immuneTime += iFramesToAdd; - break; - } - } - else - { - player.immuneTime += iFramesToAdd; - } - } + } + if (fCarapace) + { + if (damage > 0) + { + Main.PlaySound(SoundID.NPCHit, (int)player.position.X, (int)player.position.Y, 45); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int fDamage = (int)(56 * player.AverageDamage()); + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 4; i++) + { + float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; + Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int spore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); + int spore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 590, fDamage, 1.25f, player.whoAmI, 0f, 0f); + Main.projectile[spore1].timeLeft = 120; + Main.projectile[spore2].timeLeft = 120; + } + } + } + } + if (aSpark) + { + if (damage > 0) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 93); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int sDamage = hardMode ? 36 : 6; + if (aSparkRare) + sDamage += hardMode ? 12 : 2; + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int spark1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(sDamage * player.AverageDamage()), 1.25f, player.whoAmI, 0f, 0f); + int spark2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(sDamage * player.AverageDamage()), 1.25f, player.whoAmI, 0f, 0f); + Main.projectile[spark1].timeLeft = 120; + Main.projectile[spark2].timeLeft = 120; + Main.projectile[spark1].Calamity().forceTypeless = true; + Main.projectile[spark2].Calamity().forceTypeless = true; + } + } + } + } + if (inkBomb) + { + if (player.whoAmI == Main.myPlayer && !inkBombCooldown) + { + player.AddBuff(ModContent.BuffType(), 1200); + rogueStealth += 0.5f; + for (int i = 0; i < 5; i++) + { + Main.PlaySound(SoundID.Item, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 61); + int inkBomb = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, player.whoAmI); + } + } + } + if (blazingCore) + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1 && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + { + for (int i = 0; i < 360; i += 3) + { + Vector2 BCDSpeed = new Vector2(5f, 5f).RotatedBy(MathHelper.ToRadians(i)); + Dust.NewDust(player.Center, 1, 1, 244, BCDSpeed.X, BCDSpeed.Y, 0, default, 1.1f); + } + Main.PlaySound(SoundID.Item14, player.Center); + int blazingSun = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(1690 * player.AverageDamage()), 0f, player.whoAmI, 0f, 0f); + Main.projectile[blazingSun].Center = player.Center; + int blazingSun2 = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 0f, 0f); + Main.projectile[blazingSun2].Center = player.Center; + } + } + if (ataxiaBlaze && Main.rand.NextBool(5)) + { + if (damage > 0) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); + int eDamage = (int)(100 * player.AverageDamage()); + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), eDamage, 1f, player.whoAmI, 0f, 0f); + } + } + } + else if (daedalusShard) + { + if (damage > 0) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 27); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int sDamage = (int)(27 * player.RangedDamage()); //daedalus ranged helm + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 8; i++) + { + float randomSpeed = (float)Main.rand.Next(1, 7); + float randomSpeed2 = (float)Main.rand.Next(1, 7); + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int shard = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f) + randomSpeed, 90, sDamage, 1f, player.whoAmI, 0f, 0f); + int shard2 = Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f) + randomSpeed2, 90, sDamage, 1f, player.whoAmI, 0f, 0f); + Main.projectile[shard].Calamity().forceTypeless = true; + Main.projectile[shard2].Calamity().forceTypeless = true; + } + } + } + } + else if (reaverSpore) + { + if (damage > 0) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 1); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + int rDamage = (int)(58 * player.RogueDamage()); //Reaver rogue helm + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 4; i++) + { + float xPos = Main.rand.NextBool(2) ? player.Center.X + 100 : player.Center.X - 100; + Vector2 vector2 = new Vector2(xPos, player.Center.Y + Main.rand.Next(-100, 101)); + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int rspore1 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 567, rDamage, 2f, player.whoAmI, 0f, 0f); + Main.projectile[rspore1].usesLocalNPCImmunity = true; + Main.projectile[rspore1].localNPCHitCooldown = 60; + int rspore2 = Projectile.NewProjectile(vector2.X, vector2.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 568, rDamage, 2f, player.whoAmI, 0f, 0f); + Main.projectile[rspore2].usesLocalNPCImmunity = true; + Main.projectile[rspore2].localNPCHitCooldown = 60; + } + } + } + } + else if (godSlayerDamage) //god slayer melee helm + { + if (damage > 80) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 73); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + if (player.whoAmI == Main.myPlayer) + { + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(900 * player.MeleeDamage()), 5f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(900 * player.MeleeDamage()), 5f, player.whoAmI, 0f, 0f); + } + } + } + } + else if (godSlayerMage) + { + if (damage > 0) + { + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((auricSet ? 2400 : 1200) * player.MagicDamage()), 1f, player.whoAmI, 0f, 0f); + } + } + } + else if (dsSetBonus) + { + if (player.whoAmI == Main.myPlayer) + { + for (int l = 0; l < 2; l++) + { + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num15 = player.position.X + (float)(player.width / 2) - vector.X; + float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; + num15 += (float)Main.rand.Next(-100, 101); + int num17 = 22; + float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); + num18 = (float)num17 / num18; + num15 *= num18; + num16 *= num18; + int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.ShadowBeamFriendly, (int)(3000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); + Main.projectile[num19].ai[1] = player.position.Y; + Main.projectile[num19].usesLocalNPCImmunity = true; + Main.projectile[num19].localNPCHitCooldown = 10; + Main.projectile[num19].Calamity().forceTypeless = true; + } + for (int l = 0; l < 5; l++) + { + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num15 = player.position.X + (float)(player.width / 2) - vector.X; + float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; + num15 += (float)Main.rand.Next(-100, 101); + int num17 = 22; + float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); + num18 = (float)num17 / num18; + num15 *= num18; + num16 *= num18; + int num19 = Projectile.NewProjectile(x, y, num15, num16, ProjectileID.DemonScythe, (int)(5000 * player.AverageDamage()), 7f, player.whoAmI, 0f, 0f); + Main.projectile[num19].ai[1] = player.position.Y; + Main.projectile[num19].usesLocalNPCImmunity = true; + Main.projectile[num19].localNPCHitCooldown = 10; + Main.projectile[num19].Calamity().forceTypeless = true; + } + } + } + if (lastProjectileHit != null) + { + switch (lastProjectileHit.modProjectile.cooldownSlot) + { + case 0: + case 1: + player.hurtCooldowns[lastProjectileHit.modProjectile.cooldownSlot] += iFramesToAdd; + break; + case -1: + default: + player.immuneTime += iFramesToAdd; + break; + } + } + else + { + player.immuneTime += iFramesToAdd; + } } #endregion @@ -7137,7 +7756,7 @@ namespace CalamityMod.CalPlayer { for (int i = 0; i < 59; i++) { - if (player.inventory[i].stack > 0 && ((player.inventory[i].type >= 1522 && player.inventory[i].type <= 1527) || player.inventory[i].type == 3643)) + if (player.inventory[i].stack > 0 && ((player.inventory[i].type >= ItemID.LargeAmethyst && player.inventory[i].type <= ItemID.LargeDiamond) || player.inventory[i].type == ItemID.LargeAmber)) { int num = Item.NewItem((int)player.position.X, (int)player.position.Y, player.width, player.height, player.inventory[i].type, 1, false, 0, false, false); Main.item[num].netDefaults(player.inventory[i].netID); @@ -7150,7 +7769,7 @@ namespace CalamityMod.CalPlayer Main.item[num].newAndShiny = false; if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(21, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, num, 0f, 0f, 0f, 0, 0, 0); } player.inventory[i].SetDefaults(0, false); } @@ -7172,7 +7791,7 @@ namespace CalamityMod.CalPlayer } else { - Main.PlaySound(5, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.PlayerKilled, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); } player.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; player.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; @@ -7571,7 +8190,7 @@ namespace CalamityMod.CalPlayer float num8 = 0.985f; float num9 = Math.Max(player.accRunSpeed, player.maxRunSpeed); float num10 = 0.94f; - int num11 = 20; + int delay = 20; if (dashMod == 1) //Counter Scarf { for (int k = 0; k < 2; k++) @@ -7668,6 +8287,7 @@ namespace CalamityMod.CalPlayer } } num7 = 12.5f; //14 + delay = 30; } else if (dashMod == 7) //Statis' Belt of Curses { @@ -7725,7 +8345,7 @@ namespace CalamityMod.CalPlayer player.velocity.X = player.velocity.X * num10; return; } - player.dashDelay = num11; + player.dashDelay = delay; if (player.velocity.X < 0f) { player.velocity.X = -num9; @@ -7743,7 +8363,7 @@ namespace CalamityMod.CalPlayer float dashDistance; if (dashMod == 1) //Counter and Evasion Scarf { - dashDistance = evasionScarf ? 16.9f : 14.5f; + dashDistance = evasionScarf ? 16.3f : 14.5f; int direction = 0; bool justDashed = false; if (dashTimeMod > 0) @@ -8252,7 +8872,7 @@ namespace CalamityMod.CalPlayer { if (evasionScarf) { - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(6f)); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(9f)); player.AddBuff(ModContent.BuffType(), player.chaosState ? CalamityUtils.SecondsToFrames(20f) : CalamityUtils.SecondsToFrames(13f)); } else @@ -8283,7 +8903,7 @@ namespace CalamityMod.CalPlayer } if (player.whoAmI == Main.myPlayer) { - NetMessage.SendData(62, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); } } } @@ -8549,7 +9169,7 @@ namespace CalamityMod.CalPlayer Item item = drawPlayer.ActiveItem(); if (!drawPlayer.frozen && - item.type > 0 && + item.type > ItemID.None && !drawPlayer.dead && !item.noUseGraphic && (!drawPlayer.wet || !item.noWet)) @@ -8716,7 +9336,7 @@ namespace CalamityMod.CalPlayer Item item = drawPlayer.ActiveItem(); if (!drawPlayer.frozen && - (item.type > 0 || item.IsAir) && + (item.IsAir || item.type > ItemID.None) && !drawPlayer.dead && (!drawPlayer.wet || !item.noWet)) { @@ -8797,8 +9417,8 @@ namespace CalamityMod.CalPlayer } public override void PreUpdate() - { - tailFrameUp++; + { + tailFrameUp++; if (tailFrameUp == 8) { tailFrame++; @@ -9159,8 +9779,8 @@ namespace CalamityMod.CalPlayer } } - bool noRogueStealth = rogueStealth == 0f || player.townNPCs > 2f || !CalamityMod.CalamityConfig.StealthInvisbility; - if (rogueStealth > 0f && rogueStealthMax > 0f && player.townNPCs < 3f && CalamityMod.CalamityConfig.StealthInvisbility) + bool noRogueStealth = rogueStealth == 0f || player.townNPCs > 2f || !CalamityConfig.Instance.StealthInvisbility; + if (rogueStealth > 0f && rogueStealthMax > 0f && player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisbility) { //A translucent orchid color, the rogue class color float colorValue = rogueStealth / rogueStealthMax * 0.9f; //0 to 0.9 @@ -9749,7 +10369,7 @@ namespace CalamityMod.CalPlayer // Using any item which deals no damage or is a tool doesn't consume stealth. Item it = player.ActiveItem(); bool hasDamage = it.damage > 0; - bool hasHitboxes = !it.noMelee || it.shoot > 0; + bool hasHitboxes = !it.noMelee || it.shoot > ProjectileID.None; bool isPickaxe = it.pick > 0; bool isAxe = it.axe > 0; bool isHammer = it.hammer > 0; @@ -9820,6 +10440,10 @@ namespace CalamityMod.CalPlayer if (etherealExtorter && Main.moonPhase == 3) // 3 = Waning Crescent stealthGenStandstill += 0.15f; + //Accessory modifiers can boost these stats + stealthGenStandstill += accStealthGenBoost; + stealthGenMoving += accStealthGenBoost; + // // Other code which affects stealth generation goes here. // Increase stealthGenStandstill (default 1.0) to give a % boost to stealth gen while standing still. @@ -11093,6 +11717,7 @@ namespace CalamityMod.CalPlayer int frame = HandlePSCAnimationFrames(animType); player.legFrame.Y = player.legFrame.Height * frame; } + waterLeechTarget = -1; } #endregion diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index 9f2d5cf8ac..01064f7d9d 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -1,11 +1,10 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Fishing; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Fishing.SulphurCatches; using CalamityMod.Items.Fishing.SunkenSeaCatches; -using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Melee; @@ -13,7 +12,6 @@ using CalamityMod.NPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using System.Collections.Generic; using System.Linq; using Terraria; @@ -22,7 +20,7 @@ using Terraria.ModLoader; namespace CalamityMod.CalPlayer { - public class CalamityPlayerFishing + public class CalamityPlayerFishing { #region Catch Fish public static void CalamityCatchFish(Player player, ref Item fishingRod, ref Item bait, ref int power, ref int liquidType, ref int poolSize, diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 558a5f6620..9c54f7e89e 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Ranged; using CalamityMod.World; @@ -6,8 +6,6 @@ using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.CalPlayer { @@ -102,8 +100,8 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - player.lifeRegen -= 16; - } + lifeRegenLost += 16; + } if (modPlayer.vaporfied) { @@ -111,8 +109,8 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - player.lifeRegen -= 8; - } + lifeRegenLost += 8; + } if (modPlayer.cragsLava) { @@ -198,7 +196,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen = 0; player.lifeRegenTime = 0; - lifeRegenLost += 20; + lifeRegenLost += 16; } if (modPlayer.pFlames) @@ -463,7 +461,7 @@ namespace CalamityMod.CalPlayer player.lifeRegen /= 2; } - if (modPlayer.omegaBlueChestplate || player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (modPlayer.omegaBlueChestplate || modPlayer.godSlayerCooldown || player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) { if (player.lifeRegen > 0) player.lifeRegen = 0; @@ -474,7 +472,7 @@ namespace CalamityMod.CalPlayer player.lifeRegenCount = 0; } - if (CalamityMod.CalamityConfig.LethalLava || CalamityWorld.death) //always occurs in Death regardless of config + if (CalamityConfig.Instance.LethalLava || CalamityWorld.death) //always occurs in Death regardless of config { if (Main.myPlayer == player.whoAmI) { @@ -924,7 +922,7 @@ namespace CalamityMod.CalPlayer if (CalamityWorld.bossRushActive) { - if (CalamityMod.CalamityConfig.BossRushHealthCurse) + if (CalamityConfig.Instance.BossRushHealthCurse) { if (player.lifeRegen > 0) player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index a14cc532c1..471aa614a0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Cooldowns; +using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; @@ -16,7 +16,6 @@ using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Environment; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Magic; @@ -50,12 +49,15 @@ namespace CalamityMod.CalPlayer modPlayer.fearmongerRegenFrames--; // Reduce the expert debuff time multiplier to the normal mode multiplier - if (CalamityMod.CalamityConfig.ExpertDebuffDurationReduction) + if (CalamityConfig.Instance.NerfExpertDebuffs) Main.expertDebuffTime = 1f; // Bool for any existing bosses, true if any boss NPC is active CalamityPlayer.areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS(); + // Bool for any existing events, true if any event is active + CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(player); + // If any boss NPC is active, apply Zen to the player to reduce spawn rate if (CalamityPlayer.areThereAnyDamnBosses) { @@ -153,9 +155,10 @@ namespace CalamityMod.CalPlayer } } - // Life Steal nerf - if (player.lifeSteal > (CalamityWorld.death ? 50f : 60f)) - player.lifeSteal = CalamityWorld.death ? 50f : 60f; + // Adjusts the life steal cap in rev/death + float lifeStealCap = CalamityWorld.death ? 50f : 60f; + if (player.lifeSteal > lifeStealCap) + player.lifeSteal = lifeStealCap; if (player.whoAmI == Main.myPlayer) { @@ -175,7 +178,7 @@ namespace CalamityMod.CalPlayer player.immuneTime = 120; // Adrenaline and Rage - if (CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityConfig.Instance.Rippers) { // This is how much Rage will be changed by this frame. float rageDiff = 0; @@ -354,7 +357,7 @@ namespace CalamityMod.CalPlayer } // Proficiency level ups - if (CalamityMod.CalamityConfig.ProficiencyEnabled) + if (CalamityConfig.Instance.Proficiency) modPlayer.GetExactLevelUp(); // Max mana bonuses @@ -365,6 +368,14 @@ namespace CalamityMod.CalPlayer (modPlayer.cShard ? 50 : 0) + (modPlayer.starBeamRye ? 50 : 0); + // Life Steal nerf + // Reduces normal mode life steal recovery rate from 0.6/s to 0.5/s + // Reduces expert mode life steal recovery rate from 0.5/s to 0.35/s + // Revengeance mode recovery rate is 0.3/s + // Death mode recovery rate is 0.25/s + float lifeStealCooldown = CalamityWorld.death ? 0.25f : CalamityWorld.revenge ? 0.2f : Main.expertMode ? 0.15f : 0.1f; + player.lifeSteal -= lifeStealCooldown; + // Nebula Armor nerf if (player.nebulaLevelMana > 0 && player.statMana < player.statManaMax2) { @@ -418,7 +429,7 @@ namespace CalamityMod.CalPlayer { player.buffImmune[ModContent.BuffType()] = true; } - if (CalamityMod.CalamityConfig.ExpertChilledWaterRemoval) + if (CalamityConfig.Instance.ReworkChilledWater) { if (Main.expertMode && player.ZoneSnow && player.wet && !player.lavaWet && !player.honeyWet) { @@ -602,7 +613,7 @@ namespace CalamityMod.CalPlayer if (Main.raining) { - float frequencyMult = (1f - Main.cloudAlpha) * CalamityMod.CalamityConfig.WeatherEffectRateMultiplier; // 3 to 0.055 + float frequencyMult = (1f - Main.cloudAlpha) * CalamityConfig.Instance.DeathWeatherMultiplier; // 3 to 0.055 Vector2 spawnPoint = new Vector2(player.Center.X + (float)Main.rand.Next(-1000, 1001), player.Center.Y - (float)Main.rand.Next(700, 801)); Tile tileSafely = Framing.GetTileSafely((int)(spawnPoint.X / 16f), (int)(spawnPoint.Y / 16f)); @@ -626,7 +637,7 @@ namespace CalamityMod.CalPlayer int randomFrequency = (int)(50f * frequencyMult); if (player.miscCounter == 280 && Main.rand.NextBool(randomFrequency) && player.ownedProjectileCounts[ProjectileID.Cthulunado] < 1) { - Main.PlaySound(4, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y); int num331 = (int)(sharknadoSpawnPoint.Y / 16f); int num332 = (int)(sharknadoSpawnPoint.X / 16f); int num333 = 100; @@ -677,7 +688,7 @@ namespace CalamityMod.CalPlayer { if (player.miscCounter == 280 && Main.rand.NextBool(10) && player.ownedProjectileCounts[ProjectileID.Sharknado] < 1) { - Main.PlaySound(4, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y); int num331 = (int)(sharknadoSpawnPoint.Y / 16f); int num332 = (int)(sharknadoSpawnPoint.X / 16f); int num333 = 100; @@ -894,6 +905,8 @@ namespace CalamityMod.CalPlayer modPlayer.galileoCooldown--; if (modPlayer.soundCooldown > 0) modPlayer.soundCooldown--; + if (modPlayer.shadowPotCooldown > 0) + modPlayer.shadowPotCooldown--; if (modPlayer.raiderCooldown > 0) modPlayer.raiderCooldown--; if (modPlayer.gSabatonCooldown > 0) @@ -1444,6 +1457,10 @@ namespace CalamityMod.CalPlayer { player.pickSpeed -= 0.05f; } + if (modPlayer.dashMod == 6) // Cryogen lore + { + player.statDefense -= 10; + } if (modPlayer.aquaticScourgeLore) { if (player.wellFed) @@ -2121,7 +2138,7 @@ namespace CalamityMod.CalPlayer { modPlayer.aquaticBoost = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } } @@ -2155,7 +2172,7 @@ namespace CalamityMod.CalPlayer { modPlayer.modStealth = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } } @@ -2194,7 +2211,7 @@ namespace CalamityMod.CalPlayer { modPlayer.modStealth = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } } @@ -2240,7 +2257,7 @@ namespace CalamityMod.CalPlayer flag14 = true; if (modPlayer.shieldInvinc == 0f && num29 != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); float damageBoost = (5f - modPlayer.shieldInvinc) * 0.03f; player.allDamage += damageBoost; @@ -2267,7 +2284,7 @@ namespace CalamityMod.CalPlayer flag14 = true; if (modPlayer.shieldInvinc == 5f && num30 != modPlayer.shieldInvinc && Main.netMode == NetmodeID.MultiplayerClient) - NetMessage.SendData(84, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.PlayerStealth, -1, -1, null, player.whoAmI, 0f, 0f, 0f, 0, 0, 0); } // Emit dust @@ -2405,9 +2422,6 @@ namespace CalamityMod.CalPlayer if (modPlayer.xWrath) modPlayer.throwingCrit += 5; - if (modPlayer.godSlayerCooldown) - player.allDamage += 0.1f; - if (modPlayer.graxDefense) { player.statDefense += 30; @@ -2840,13 +2854,13 @@ namespace CalamityMod.CalPlayer player.minionKB += floatTypeBoost; player.moveSpeed += floatTypeBoost; if (player.wingTimeMax > 0) - player.wingTimeMax = (int)((double)player.wingTimeMax * 1.15); + player.wingTimeMax = (int)(player.wingTimeMax * 1.15); } if (modPlayer.ravagerLore) { if (player.wingTimeMax > 0) - player.wingTimeMax = (int)((double)player.wingTimeMax * 0.5); + player.wingTimeMax = (int)(player.wingTimeMax * 0.5); player.allDamage += 0.1f; } @@ -3063,7 +3077,7 @@ namespace CalamityMod.CalPlayer float arg = player.position.X - Main.player[myPlayer].position.X; float num3 = player.position.Y - Main.player[myPlayer].position.Y; - if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) + if ((float)Math.Sqrt(arg * arg + num3 * num3) < 800f) Main.player[myPlayer].AddBuff(43, 20, true); } } @@ -3088,7 +3102,7 @@ namespace CalamityMod.CalPlayer float arg = player.position.X - Main.player[myPlayer].position.X; float num3 = player.position.Y - Main.player[myPlayer].position.Y; - if ((float)Math.Sqrt((double)(arg * arg + num3 * num3)) < 800f) + if ((float)Math.Sqrt(arg * arg + num3 * num3) < 800f) Main.player[myPlayer].AddBuff(43, 20, true); } } @@ -3151,7 +3165,7 @@ namespace CalamityMod.CalPlayer modPlayer.bloodflareSummonTimer = 900; for (int I = 0; I < 3; I++) { - float ai1 = (float)(I * 120); + float ai1 = I * 120; Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * player.MinionDamage()), 1f, player.whoAmI, ai1, 0f); } @@ -3161,7 +3175,6 @@ namespace CalamityMod.CalPlayer if (modPlayer.yInsignia) { player.longInvince = true; - player.kbGlove = true; player.meleeDamage += 0.05f; player.lavaMax += 240; if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) @@ -3339,17 +3352,17 @@ namespace CalamityMod.CalPlayer player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[BuffID.Poisoned] = true; player.buffImmune[BuffID.Venom] = true; - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.75)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.75)) { player.allDamage += 0.06f; modPlayer.AllCritBoost(3); } - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) { player.allDamage += 0.06f; modPlayer.AllCritBoost(3); } - if (player.statLife <= (int)((double)player.statLifeMax2 * 0.25)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.25)) { player.allDamage += 0.06f; modPlayer.AllCritBoost(3); @@ -3363,7 +3376,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.auricSet && modPlayer.silvaMelee) { - double multiplier = (double)player.statLife / (double)player.statLifeMax2; + double multiplier = player.statLife / (double)player.statLifeMax2; player.meleeDamage += (float)(multiplier * 0.2); //ranges from 1.2 times to 1 times } @@ -3392,6 +3405,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(232f * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f); } } + if (modPlayer.pArtifact) { if (player.whoAmI == Main.myPlayer) @@ -3420,6 +3434,7 @@ namespace CalamityMod.CalPlayer } } } + if (modPlayer.profanedCrystalBuffs && modPlayer.gOffense && modPlayer.gDefense) { if (player.whoAmI == Main.myPlayer) @@ -3441,7 +3456,7 @@ namespace CalamityMod.CalPlayer player.moveSpeed += 0.25f; player.statDefense -= 15; if (!player.Calamity().yharonLore) - player.wingTimeMax = (int)((float)player.wingTimeMax * 1.1f); + player.wingTimeMax = (int)(player.wingTimeMax * 1.1f); player.ignoreWater = true; } else @@ -3451,7 +3466,7 @@ namespace CalamityMod.CalPlayer player.statDefense += 15; player.lifeRegen += 5; } - bool enrage = player.statLife <= (int)((double)player.statLifeMax2 * 0.5); + bool enrage = player.statLife <= (int)(player.statLifeMax2 * 0.5); bool notRetro = Lighting.NotRetro; if (!modPlayer.ZoneAbyss) //No abyss memes. Lighting.AddLight(player.Center, enrage ? 60 : offenseBuffs ? 50 : 10, enrage ? 12 : offenseBuffs ? 10 : 2, 0); @@ -3549,17 +3564,17 @@ namespace CalamityMod.CalPlayer if (modPlayer.prismaticLasers > 1800 && player.whoAmI == Main.myPlayer) { float shootSpeed = 18f; - int dmg = (int)(150 * player.MagicDamage()); + int dmg = (int)(50 * player.MagicDamage()); Vector2 startPos = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 velocity = Main.MouseWorld - startPos; if (player.gravDir == -1f) { - velocity.Y = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - startPos.Y; + velocity.Y = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - startPos.Y; } float travelDist = velocity.Length(); if ((float.IsNaN(velocity.X) && float.IsNaN(velocity.Y)) || (velocity.X == 0f && velocity.Y == 0f)) { - velocity.X = (float)player.direction; + velocity.X = player.direction; velocity.Y = 0f; travelDist = shootSpeed; } @@ -3568,14 +3583,14 @@ namespace CalamityMod.CalPlayer travelDist = shootSpeed / travelDist; } - int laserAmt = 2; + int laserAmt = Main.rand.Next(2); for (int index = 0; index < laserAmt; index++) { - startPos = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - startPos.X = (startPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - startPos.Y -= (float)(100 * index); - velocity.X = (float)Main.mouseX + Main.screenPosition.X - startPos.X; - velocity.Y = (float)Main.mouseY + Main.screenPosition.Y - startPos.Y; + startPos = new Vector2(player.Center.X + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + startPos.X = (startPos.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + startPos.Y -= 100 * index; + velocity.X = Main.mouseX + Main.screenPosition.X - startPos.X; + velocity.Y = Main.mouseY + Main.screenPosition.Y - startPos.Y; if (velocity.Y < 0f) { velocity.Y *= -1f; @@ -3588,9 +3603,10 @@ namespace CalamityMod.CalPlayer travelDist = shootSpeed / travelDist; velocity.X *= travelDist; velocity.Y *= travelDist; - velocity.X += (float)Main.rand.Next(-50, 51) * 0.02f; - velocity.Y += (float)Main.rand.Next(-50, 51) * 0.02f; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, (float)Main.rand.Next(10)); + velocity.X += Main.rand.Next(-50, 51) * 0.02f; + velocity.Y += Main.rand.Next(-50, 51) * 0.02f; + int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, Main.rand.Next(10)); + Main.projectile[laser].localNPCHitCooldown = 5; } Main.PlaySound(SoundID.Item12, player.position); } @@ -3620,8 +3636,8 @@ namespace CalamityMod.CalPlayer new Color(255, 0, 255, 50), //Fuschia new Color(255, 0, 128, 50) //Hot Pink }); - Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + player.Center; + Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2(player.width / 2f, player.height) * 0.75f; + vector6 = vector6.RotatedBy((dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / dustAmt, default) + player.Center; Vector2 vector7 = vector6 - player.Center; int dusty = Dust.NewDust(vector6 + vector7, 0, 0, 267, vector7.X * 1f, vector7.Y * 1f, 100, color, 1f); Main.dust[dusty].noGravity = true; @@ -3651,8 +3667,21 @@ namespace CalamityMod.CalPlayer } } - if (CalamityMod.CalamityConfig.ProficiencyEnabled) + if (CalamityConfig.Instance.Proficiency) modPlayer.GetStatBonuses(); + + // True melee damage bonuses + double damageAdd = (modPlayer.dodgeScarf ? 0.2 : 0) + + (modPlayer.evasionScarf ? 0.1 : 0) + + ((modPlayer.aBulwarkRare && modPlayer.aBulwarkRareMeleeBoostTimer > 0) ? 1 : 0) + + (modPlayer.DoGLore ? 0.5 : 0) + + (modPlayer.fungalSymbiote ? 0.25 : 0) + + ((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.3 : 0) + + (player.kbGlove ? 0.25 : 0) + + (modPlayer.eGauntlet ? 0.1 : 0) + + (modPlayer.yInsignia ? 0.1 : 0) + + (modPlayer.badgeOfBraveryRare ? 0.2 : 0); + modPlayer.trueMeleeDamage += damageAdd; } #endregion @@ -3719,11 +3748,13 @@ namespace CalamityMod.CalPlayer private static void UpdateStatMeter(Player player, CalamityPlayer modPlayer) { float allDamageStat = player.allDamage - 1f; + modPlayer.actualMeleeDamageStat = player.meleeDamage + allDamageStat; modPlayer.damageStats[0] = (int)((player.meleeDamage + allDamageStat - 1f) * 100f); modPlayer.damageStats[1] = (int)((player.rangedDamage + allDamageStat - 1f) * 100f); modPlayer.damageStats[2] = (int)((player.magicDamage + allDamageStat - 1f) * 100f); modPlayer.damageStats[3] = (int)((player.minionDamage + allDamageStat - 1f) * 100f); modPlayer.damageStats[4] = (int)((modPlayer.throwingDamage + allDamageStat - 1f) * 100f); + modPlayer.damageStats[5] = (int)(modPlayer.trueMeleeDamage * 100D); modPlayer.critStats[0] = player.meleeCrit; modPlayer.critStats[1] = player.rangedCrit; modPlayer.critStats[2] = player.magicCrit; diff --git a/CalamityConfig.cs b/CalamityConfig.cs new file mode 100644 index 0000000000..a4686a4d84 --- /dev/null +++ b/CalamityConfig.cs @@ -0,0 +1,272 @@ +using CalamityMod.UI; +using System.ComponentModel; +using System.Runtime.Serialization; +using Terraria; +using Terraria.ModLoader.Config; + +namespace CalamityMod +{ + [Label("Config")] + [BackgroundColor(49, 32, 36, 216)] + public class CalamityConfig : ModConfig + { + public static CalamityConfig Instance; + public override ConfigScope Mode => ConfigScope.ClientSide; + + // Clamps values that would cause ugly problems if loaded directly without sanitization. + [OnDeserialized] + internal void ClampValues(StreamingContext context) + { + BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost); + MeterShake = Utils.Clamp(MeterShake, MinMeterShake, MaxMeterShake); + DeathWeatherMultiplier = Utils.Clamp(DeathWeatherMultiplier, MinWeatherMultiplier, MaxWeatherMultiplier); + } + + [Header("Graphics Changes")] + + [Label("Afterimages")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables rendering afterimages for Calamity NPCs, projectiles, etc.\nDisable to improve performance.")] + public bool Afterimages { get; set; } + + [Label("Stealth Invisibility")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables players gradually turning invisible as their Rogue Stealth increases.\nThis effect is visually similar to Shroomite armor's stealth.")] + public bool StealthInvisbility { get; set; } + + [Label("New Shop Inventory Alert")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Adds an icon that appears over Town NPCs when they have new items in their shops.")] + public bool ShopNewAlert { get; set; } + + [Header("UI Changes")] + + [Label("Boss Health Bars")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables Calamity's boss health bar in the bottom right corner of the screen.")] + public bool BossHealthBar { get; set; } + + [Label("Boss Health Bar Extra Info")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Adds extra info to the Calamity boss health bar.\nThis displays either the boss's exact health or number of remaining parts or segments.")] + public bool BossHealthBarExtraInfo { get; set; } + + [Label("Boss and Miniboss Debuff Display")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Adds an array of debuff icons above all bosses and minibosses.")] + public bool DebuffDisplay { get; set; } + + [BackgroundColor(192, 54, 64, 192)] + [Label("Lock Meter Positions")] + [DefaultValue(false)] + [Tooltip("Prevents clicking on the Stealth, Rage and Adrenaline Meters.\nThis stops them from being dragged around with the mouse.")] + public bool MeterPosLock { get; set; } + + [Label("Stealth Meter")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables the Stealth Meter UI, which shows the player's current stealth level.\nThe Stealth Meter is always hidden if not wearing Rogue armor.")] + public bool StealthBar { get; set; } + + [Label("Stealth Meter X Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 3840f)] + [DefaultValue(820f)] + [Tooltip("The X position of the Stealth Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float StealthMeterPosX { get; set; } + + [Label("Stealth Meter Y Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 2160f)] + [DefaultValue(43f)] + [Tooltip("The Y position of the Stealth Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float StealthMeterPosY { get; set; } + + [Header("General Gameplay Changes")] + + [Label("Lethal Lava")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Makes lava significantly more deadly by adding a new debuff.\nPermanent lava immunity does not provide immunity to this debuff.\nThis setting is ignored in Death Mode, which always has Lethal Lava.")] + public bool LethalLava { get; set; } + + [Label("Proficiency")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables the Proficiency system which allows the player to gain slight stat bonuses by persistently using one damage class.\nDisabling the system does not remove levels players already have, but disables their stat bonuses and prevents experience gain.")] + public bool Proficiency { get; set; } + + [Label("Sell Vanilla Boss Summons")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Adds vanilla boss summons to NPC shops after the corresponding boss is defeated.\nThis does not affect Calamity's boss summons, which are always sold.\nTo apply changes, close and reopen the shop.")] + public bool SellVanillaSummons { get; set; } + + [Label("Boost Mining Speed")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Increases the player's mining speed by 75%.\nThis does not affect drills.")] + public bool MiningSpeedBoost { get; set; } + + [Label("Never Weaken Reactive Boss DR")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Sets Reactive Boss DR to always be full strength, even if the boss has already been defeated.\nIf disabled, the effect is only 66% as powerful after the boss has been defeated.\n\nReactive Boss DR makes bosses smoothly take less damage if they are being killed very quickly.\nIn most cases, the system has no noticeable effect.")] + public bool FullPowerReactiveBossDR { get; set; } + + private const float MinBossHealthBoost = 0f; + private const float MaxBossHealthBoost = 900f; + + [Label("Boss Health Percentage Boost")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(MinBossHealthBoost, MaxBossHealthBoost)] + [Increment(50f)] + [DrawTicks] + [DefaultValue(MinBossHealthBoost)] + [Tooltip("Globally boosts the health of all bosses.\nDoes not affect bosses that are already spawned.")] + public float BossHealthBoost { get; set; } + + [Header("Expert Mode Changes")] + + [Label("Reduce Expert Debuff Durations")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Disables Expert Mode doubling the duration of all debuffs inflicted on the player.\nCalamity is balanced with the assumption that this setting is enabled.")] + public bool NerfExpertDebuffs { get; set; } + + [Label("Rework Chilled Water")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("When enabled, water in the Snow and Ice biomes will rapidly drain the player's breath instead of inflicting Chilled.")] + public bool ReworkChilledWater { get; set; } + + [Label("Reduce Celestial Pillar Kill Count")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Reduces the kills required to destroy a Celestial Pillar shield in Expert Mode from 150 to 100.\nThis makes the value equivalent to Normal Mode.")] + public bool NerfExpertPillars { get; set; } + + [Label("Disable Expert Enemy Spawns in Towns")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Counteracts Expert Mode allowing enemies to spawn near towns by vastly decreasing spawn rates.\nThis can have unintended side effects such as making critters difficult to find.")] + public bool DisableExpertTownSpawns { get; set; } + + [Header("Revengeance Mode Changes")] + + [Label("Buff Thorium Bosses")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Buffs Thorium bosses if Revengeance Mode or Death Mode is active.\nThe buff gives them extra health and DR, but has no other changes.")] + public bool BuffThoriumBosses { get; set; } + + [Label("Rage and Adrenaline")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(true)] + [Tooltip("Enables Rage and Adrenaline, the two Revengeance Mode mechanics.")] + public bool Rippers { get; set; } + + private const float MinMeterShake = 0f; + private const float MaxMeterShake = 4f; + + [Label("Rage and Adrenaline Meter Shake")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(MinMeterShake, MaxMeterShake)] + [Increment(1f)] + [DrawTicks] + [DefaultValue(2f)] + [Tooltip("How much the Rage and Adrenaline Meters shake while in use.\nSet to zero to disable the shaking entirely.")] + public float MeterShake { get; set; } + + [Label("Rage Meter X Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 3840f)] + [DefaultValue(RipperUI.DefaultRagePosX)] + [Tooltip("The X position of the Rage Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float RageMeterPosX { get; set; } + + [Label("Rage Meter Y Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 2160f)] + [DefaultValue(RipperUI.DefaultRagePosY)] + [Tooltip("The Y position of the Rage Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float RageMeterPosY { get; set; } + + [Label("Adrenaline Meter X Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 3840f)] + [DefaultValue(RipperUI.DefaultAdrenPosX)] + [Tooltip("The X position of the Adrenaline Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float AdrenalineMeterPosX { get; set; } + + [Label("Adrenaline Meter Y Position")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0f, 2160f)] + [DefaultValue(RipperUI.DefaultAdrenPosY)] + [Tooltip("The Y position of the Adrenaline Meter.\nThe meter can be dragged with the mouse if Lock Meter Positions is disabled.")] + public float AdrenalineMeterPosY { get; set; } + + [Header("Death Mode Changes")] + + private const float MinWeatherMultiplier = 0.5f; + private const float MaxWeatherMultiplier = 3f; + + [Label("Weather Hazard Delay Multiplier")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(MinWeatherMultiplier, MaxWeatherMultiplier)] + [Increment(0.25f)] + [DrawTicks] + [DefaultValue(1f)] + [Tooltip("Adjusts the delay between Death Mode weather hazards such as lightning.\nDecreasing this value makes hazards more frequent.\nIncreasing this value makes hazards less frequent.")] + public float DeathWeatherMultiplier { get; set; } + + [Header("Boss Rush Curses")] + + [Label("Accessory Curse")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Limits the player to five accessories during the Boss Rush.")] + public bool BossRushAccessoryCurse { get; set; } + + [Label("Health Curse")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Disables all health regeneration during the Boss Rush.")] + public bool BossRushHealthCurse { get; set; } + + [Label("Dash Curse")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Disables all dashes during the Boss Rush.")] + public bool BossRushDashCurse { get; set; } + + [Label("Immunity Frame Curse")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("During the Boss Rush, being hit twice within five seconds will cause instant death.\nThis effect ignores revives.")] + public bool BossRushImmunityFrameCurse { get; set; } + + [Label("Xeroc Curse")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Permanently enrages every boss in the Boss Rush.\nThis enrage is equivalent to that provided by Demonshade armor.")] + public bool BossRushXerocCurse { get; set; } + + public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) => true; + } +} \ No newline at end of file diff --git a/CalamityMod.cs b/CalamityMod.cs index c1f1ddf3fd..b8feefedc3 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; @@ -18,8 +18,8 @@ using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Tools; +using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -63,10 +63,11 @@ using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Tiles.LivingFire; using CalamityMod.Skies; using CalamityMod.UI; using CalamityMod.World; @@ -121,13 +122,22 @@ namespace CalamityMod public static Texture2D AstralSky; public static Effect CustomShader; public static Effect LightShader; + public static Effect TentacleShader; // DR data structure public static SortedDictionary DRValues; + + // Boss Kill Time data structure public static SortedDictionary bossKillTimes; + // Boss velocity scaling data structure + public static SortedDictionary bossVelocityDamageScaleValues; + public const float velocityScaleMin = 0.5f; + public const float bitingEnemeyVelocityScale = 0.8f; + // Lists public static IList donatorList; + public static List trueMeleeProjectileList; // DO NOT, EVER, DELETE THIS LIST, OR I WILL COME FOR YOU :D public static List rangedProjectileExceptionList; public static List projectileDestroyExceptionList; public static List projectileMinionList; @@ -187,6 +197,7 @@ namespace CalamityMod public static List highTestFishList; public static List flamethrowerList; public static List forceItemList; + public static List livingFireBlockList; public static List zombieList; public static List demonEyeList; @@ -201,13 +212,12 @@ namespace CalamityMod internal Mod thorium = null; public bool fargosMutant = false; - internal static Configs CalamityConfig; - internal static CalamityMod instance; + internal static CalamityMod Instance; #region Load public override void Load() { - instance = this; + Instance = this; heartOriginal2 = Main.heartTexture; heartOriginal = Main.heart2Texture; rainOriginal = Main.rainTexture; @@ -240,6 +250,7 @@ namespace CalamityMod SetupLists(); SetupVanillaDR(); SetupBossKillTimes(); + SetupBossVelocityScalingValues(); SetupThoriumBossDR(thorium); CalamityLocalization.AddLocalizations(); @@ -278,6 +289,7 @@ namespace CalamityMod AstralSky = ModContent.GetTexture("CalamityMod/ExtraTextures/AstralSky"); CustomShader = GetEffect("Effects/CustomShader"); LightShader = GetEffect("Effects/LightBurstShader"); + TentacleShader = GetEffect("Effects/TentacleShader"); Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); @@ -312,6 +324,8 @@ namespace CalamityMod Filters.Scene["CalamityMod:LightBurst"] = new Filter(new ScreenShaderData(new Ref(LightShader), "BurstPass"), EffectPriority.VeryHigh); Filters.Scene["CalamityMod:LightBurst"].Load(); + GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); + RipperUI.Reset(); AstralArcanumUI.Load(this); @@ -345,8 +359,11 @@ namespace CalamityMod DRValues = null; bossKillTimes?.Clear(); bossKillTimes = null; + bossVelocityDamageScaleValues?.Clear(); + bossVelocityDamageScaleValues = null; donatorList = null; + trueMeleeProjectileList = null; rangedProjectileExceptionList = null; projectileDestroyExceptionList = null; projectileMinionList = null; @@ -405,6 +422,7 @@ namespace CalamityMod highTestFishList = null; flamethrowerList = null; forceItemList = null; + livingFireBlockList = null; zombieList = null; demonEyeList = null; @@ -418,8 +436,7 @@ namespace CalamityMod thorium = null; fargosMutant = false; - CalamityConfig = null; - instance = null; + Instance = null; BossHealthBarManager.Unload(); base.Unload(); @@ -456,15 +473,15 @@ namespace CalamityMod #endregion #region ConfigCrap - internal static void SaveConfig(Configs CalamityConfig) + internal static void SaveConfig(CalamityConfig cfg) { // in-game ModConfig saving from mod code is not supported yet in tmodloader, and subject to change, so we need to be extra careful. // This code only supports client configs, and doesn't call onchanged. It also doesn't support ReloadRequired or anything else. MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); if (saveMethodInfo != null) - saveMethodInfo.Invoke(null, new object[] { CalamityConfig }); + saveMethodInfo.Invoke(null, new object[] { cfg }); else - instance.Logger.Warn("In-game SaveConfig failed, code update required"); + Instance.Logger.Warn("In-game SaveConfig failed, code update required"); } #endregion @@ -601,7 +618,87 @@ namespace CalamityMod "RKMoon" }; - rangedProjectileExceptionList = new List() + trueMeleeProjectileList = new List() + { + // Vanilla shit + ProjectileID.Spear, + ProjectileID.Trident, + ProjectileID.TheRottedFork, + ProjectileID.Swordfish, + ProjectileID.Arkhalis, + ProjectileID.DarkLance, + ProjectileID.CobaltNaginata, + ProjectileID.PalladiumPike, + ProjectileID.MythrilHalberd, + ProjectileID.OrichalcumHalberd, + ProjectileID.AdamantiteGlaive, + ProjectileID.TitaniumTrident, + ProjectileID.MushroomSpear, + ProjectileID.Gungnir, + ProjectileID.ObsidianSwordfish, + ProjectileID.ChlorophytePartisan, + ProjectileID.MonkStaffT1, + ProjectileID.MonkStaffT2, + ProjectileID.MonkStaffT3, + ProjectileID.NorthPoleWeapon, + + // Tools + ProjectileID.CobaltDrill, + ProjectileID.MythrilDrill, + ProjectileID.AdamantiteDrill, + ProjectileID.PalladiumDrill, + ProjectileID.OrichalcumDrill, + ProjectileID.TitaniumDrill, + ProjectileID.ChlorophyteDrill, + ProjectileID.CobaltChainsaw, + ProjectileID.MythrilChainsaw, + ProjectileID.AdamantiteChainsaw, + ProjectileID.PalladiumChainsaw, + ProjectileID.OrichalcumChainsaw, + ProjectileID.TitaniumChainsaw, + ProjectileID.ChlorophyteChainsaw, + ProjectileID.VortexDrill, + ProjectileID.VortexChainsaw, + ProjectileID.NebulaDrill, + ProjectileID.NebulaChainsaw, + ProjectileID.SolarFlareDrill, + ProjectileID.SolarFlareChainsaw, + ProjectileID.StardustDrill, + ProjectileID.StardustChainsaw, + ProjectileID.Hamdrax, + ProjectileID.ChlorophyteJackhammer, + ProjectileID.SawtoothShark, + ProjectileID.ButchersChainsaw, + + // Calamity shit + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }; + + rangedProjectileExceptionList = new List() { ProjectileID.Phantasm, ProjectileID.VortexBeater, @@ -628,7 +725,9 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; projectileDestroyExceptionList = new List() @@ -1287,7 +1386,9 @@ namespace CalamityMod ItemID.WaspGun, ItemID.Keybrand, ItemID.PulseBow, - ItemID.PaladinsHammer + ItemID.PaladinsHammer, + ItemID.SolarEruption, + ItemID.DayBreak }; thirtyThreeDamageBuffList = new List() @@ -1366,7 +1467,8 @@ namespace CalamityMod ItemID.DD2BetsyBow, ItemID.InfluxWaver, ItemID.Xenopopper, - ItemID.ElectrosphereLauncher + ItemID.ElectrosphereLauncher, + ItemID.OpticStaff //Note: got local i frames so it should be better }; pumpkinMoonBuffList = new List() @@ -1635,7 +1737,6 @@ namespace CalamityMod { NPCID.TheDestroyer, NPCID.SolarCrawltipedeHead, - ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), @@ -2331,6 +2432,19 @@ namespace CalamityMod ItemID.SuperHealingPotion }; + livingFireBlockList = new List() + { + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), + TileID.LivingFire, + TileID.LivingCursedFire, + TileID.LivingDemonFire, + TileID.LivingFrostFire, + TileID.LivingIchor, + TileID.LivingUltrabrightFire + }; + zombieList = new List() { NPCID.Zombie, @@ -2392,7 +2506,19 @@ namespace CalamityMod hornetList = new List() { - NPCID.Hornet, + NPCID.BigHornetStingy, + NPCID.LittleHornetStingy, + NPCID.BigHornetSpikey, + NPCID.LittleHornetSpikey, + NPCID.BigHornetLeafy, + NPCID.LittleHornetLeafy, + NPCID.BigHornetHoney, + NPCID.LittleHornetHoney, + NPCID.BigHornetFatty, + NPCID.LittleHornetFatty, + NPCID.BigStinger, + NPCID.LittleStinger, + NPCID.Hornet, NPCID.HornetFatty, NPCID.HornetHoney, NPCID.HornetLeafy, @@ -2410,7 +2536,7 @@ namespace CalamityMod }; Mod thorium = ModLoader.GetMod("ThoriumMod"); - if (CalamityMod.CalamityConfig.RevengeanceAndDeathThoriumBossBuff && thorium != null) + if (CalamityConfig.Instance.BuffThoriumBosses && thorium != null) { enemyImmunityList.Add(thorium.NPCType("TheGrandThunderBirdv2")); enemyImmunityList.Add(thorium.NPCType("QueenJelly")); @@ -2530,10 +2656,10 @@ namespace CalamityMod legOverrideList = new List() { - instance.GetEquipSlot("ProviLegs", EquipType.Legs), - instance.GetEquipSlot("SirenLegAlt", EquipType.Legs), - instance.GetEquipSlot("SirenLeg", EquipType.Legs), - instance.GetEquipSlot("PopoLeg", EquipType.Legs) + Instance.GetEquipSlot("ProviLegs", EquipType.Legs), + Instance.GetEquipSlot("SirenLegAlt", EquipType.Legs), + Instance.GetEquipSlot("SirenLeg", EquipType.Legs), + Instance.GetEquipSlot("PopoLeg", EquipType.Legs) }; } #endregion @@ -2657,7 +2783,7 @@ namespace CalamityMod #region Thorium Boss DR private void SetupThoriumBossDR(Mod thorium) { - if (thorium is null || !CalamityConfig.RevengeanceAndDeathThoriumBossBuff) + if (thorium is null || !CalamityConfig.Instance.BuffThoriumBosses) return; void ThoriumDR(string npcName, float dr) { @@ -2695,6 +2821,8 @@ namespace CalamityMod #region Boss Kill Times private void SetupBossKillTimes() { + // 3600 = 1 minute + bossKillTimes = new SortedDictionary { { NPCID.KingSlime, 3600 }, { NPCID.EyeofCthulhu, 5400 }, @@ -2702,10 +2830,11 @@ namespace CalamityMod { NPCID.EaterofWorldsBody, 7200 }, { NPCID.EaterofWorldsTail, 7200 }, { NPCID.BrainofCthulhu, 5400 }, + { NPCID.Creeper, 1800 }, { NPCID.QueenBee, 7200 }, { NPCID.SkeletronHead, 9000 }, - { NPCID.WallofFlesh, 10800 }, - { NPCID.WallofFleshEye, 10800 }, + { NPCID.WallofFlesh, 7200 }, + { NPCID.WallofFleshEye, 7200 }, { NPCID.Spazmatism, 10800 }, { NPCID.Retinazer, 10800 }, { NPCID.TheDestroyer, 10800 }, @@ -2713,7 +2842,7 @@ namespace CalamityMod { NPCID.TheDestroyerTail, 10800 }, { NPCID.SkeletronPrime, 10800 }, { NPCID.Plantera, 10800 }, - { NPCID.Golem, 10800 }, + { NPCID.Golem, 9000 }, { NPCID.GolemHead, 3600 }, { NPCID.DukeFishron, 9000 }, { NPCID.CultistBoss, 9000 }, @@ -2740,15 +2869,12 @@ namespace CalamityMod { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 1200 }, { ModContent.NPCType(), 11400 }, - { ModContent.NPCType(), 9000 }, - { ModContent.NPCType(), 9000 }, + { ModContent.NPCType(), 10800 }, + { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 7200 }, + { ModContent.NPCType(), 7200 }, + { ModContent.NPCType(), 7200 }, + { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 5400 }, @@ -2763,14 +2889,141 @@ namespace CalamityMod { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 7200 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 10800 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 9000 }, + { ModContent.NPCType(), 9000 }, + { ModContent.NPCType(), 9000 }, { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 14400 } + { ModContent.NPCType(), 18000 } + }; + } + #endregion + + #region Boss Velocity Contact Damage Scale Values + private void SetupBossVelocityScalingValues() + { + bossVelocityDamageScaleValues = new SortedDictionary { + { NPCID.KingSlime, velocityScaleMin }, + { NPCID.EyeofCthulhu, velocityScaleMin }, // Increases in phase 2 + { NPCID.EaterofWorldsHead, bitingEnemeyVelocityScale }, + { NPCID.EaterofWorldsBody, velocityScaleMin }, + { NPCID.EaterofWorldsTail, velocityScaleMin }, + { NPCID.Creeper, velocityScaleMin }, + { NPCID.BrainofCthulhu, velocityScaleMin }, + { NPCID.QueenBee, velocityScaleMin }, + { NPCID.SkeletronHead, velocityScaleMin }, + { NPCID.SkeletronHand, velocityScaleMin }, + { NPCID.TheHungry, bitingEnemeyVelocityScale }, + { NPCID.TheHungryII, bitingEnemeyVelocityScale }, + { NPCID.LeechHead, bitingEnemeyVelocityScale }, + { NPCID.LeechBody, velocityScaleMin }, + { NPCID.LeechTail, velocityScaleMin }, + { NPCID.Spazmatism, velocityScaleMin }, // Increases in phase 2 + { NPCID.Retinazer, velocityScaleMin }, + { NPCID.TheDestroyer, bitingEnemeyVelocityScale }, + { NPCID.TheDestroyerBody, velocityScaleMin }, + { NPCID.TheDestroyerTail, velocityScaleMin }, + { NPCID.Probe, velocityScaleMin }, + { NPCID.SkeletronPrime, velocityScaleMin }, + { NPCID.PrimeCannon, velocityScaleMin }, + { NPCID.PrimeLaser, velocityScaleMin }, + { NPCID.PrimeSaw, velocityScaleMin }, + { NPCID.PrimeVice, velocityScaleMin }, + { NPCID.Plantera, velocityScaleMin }, // Increases in phase 2 + { NPCID.PlanterasTentacle, bitingEnemeyVelocityScale }, + { NPCID.Golem, velocityScaleMin }, + { NPCID.GolemFistLeft, velocityScaleMin }, + { NPCID.GolemFistRight, velocityScaleMin }, + { NPCID.GolemHead, velocityScaleMin }, + { NPCID.DukeFishron, velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), bitingEnemeyVelocityScale }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin }, + { ModContent.NPCType(), velocityScaleMin } }; } #endregion @@ -3590,6 +3843,7 @@ namespace CalamityMod case CalamityModMessageType.AcidRainSync: CalamityWorld.rainingAcid = reader.ReadBoolean(); CalamityWorld.acidRainPoints = reader.ReadInt32(); + CalamityWorld.timeSinceAcidRainKill = reader.ReadInt32(); break; case CalamityModMessageType.AcidRainUIDrawFadeSync: CalamityWorld.acidRainExtraDrawTime = reader.ReadInt32(); @@ -3642,7 +3896,7 @@ namespace CalamityMod { if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.WorldData, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } #endregion diff --git a/Configs.cs b/Configs.cs deleted file mode 100644 index d45ffccf1e..0000000000 --- a/Configs.cs +++ /dev/null @@ -1,206 +0,0 @@ -using CalamityMod.UI; -using Microsoft.Xna.Framework; -using System.Collections.Generic; -using System.ComponentModel; -using Terraria; -using Terraria.Localization; -using Terraria.ModLoader.Config; - -namespace CalamityMod -{ - [Label("Configs")] - public class Configs : ModConfig - { - public override ConfigScope Mode => ConfigScope.ClientSide; - public override void OnLoaded() => CalamityMod.CalamityConfig = this; - - [Header("General Changes")] - - [DefaultValue(true)] - [Label("Afterimages")] - [Tooltip("Enables afterimages for Calamity NPCs, projectiles, etc.")] - public bool Afterimages { get; set; } - - [DefaultValue(true)] - [Label("Town NPC New Shop Inventory Alert Display")] - [Tooltip("Enables an icon that appears above town NPC heads whenever they have new items in their shops")] - public bool TownNPCNewShopInventoryAlertDisplay { get; set; } - - [DefaultValue(true)] - [Label("Boss and Miniboss Debuff Display")] - [Tooltip("Enables a debuff display that shows all debuffs a boss or miniboss is currently afflicted with\nDebuffs are displayed above the hitbox")] - public bool EnemyDebuffDisplay { get; set; } - - [DefaultValue(true)] - [Label("Proficiency")] - [Tooltip("Enables the Proficiency stat that rewards the player based on the attack type they use")] - public bool ProficiencyEnabled { get; set; } - - [DefaultValue(true)] - [Label("Lethal Lava")] - [Tooltip("Increases the severity of lava with a new debuff to punish those who stay in lava for too long\nEnabled in Death Mode regardless of this configuration setting")] - public bool LethalLava { get; set; } - - [DefaultValue(true)] - [Label("Boss Health Bar")] - [Tooltip("Enables the Boss Health Bar to show while a boss or miniboss is alive")] - public bool DrawBossBar { get; set; } - - [DefaultValue(true)] - [Label("Stealth Invisibility")] - [Tooltip("Enables the fading of the player as stealth goes up")] - public bool StealthInvisbility { get; set; } - - [DefaultValue(true)] - [Label("Stealth Bar")] - [Tooltip("Enables the visibility of the stealth bar")] - public bool StealthBar { get; set; } - - [Label("Stealth Meter Position X")] - [Tooltip("Changes the X position of the Stealth Meter")] - [Range(0f, 1660f)] - [DefaultValue(820f)] - public float StealthMeterPosX { get; set; } - - [Label("Stealth Meter Position Y")] - [Tooltip("Changes the Y position of the Stealth Meter")] - [Range(0f, 1100f)] - [DefaultValue(43f)] - public float StealthMeterPosY { get; set; } - - [DefaultValue(false)] - [Label("Meter Position Lock")] - [Tooltip("Prevents the movement of the Adrenaline, Rage and Stealth bars with the Mouse")] - public bool MeterPosLock { get; set; } - - [DefaultValue(true)] - [Label("Boss Health Bar Small Text")] - [Tooltip("Enables the small text below the health bar\nThis displays the exact health amount or remaining boss parts")] - public bool DrawSmallText { get; set; } - - [DefaultValue(true)] - [Label("Selling Vanilla Boss Summons")] - [Tooltip("Enables certain town NPCs to sell boss summoning items after the defeat of their respective boss\nThis does not affect Calamity's boss summoning items, which are always sold\nThe shop will need to be refreshed if the config is adjusted while the shop is open")] - public bool SellBossSummons { get; set; } - - [DefaultValue(false)] - [Label("Mining Speed Boost")] - [Tooltip("Boosts the player's mining speed by 75%")] - public bool MiningSpeedBoost { get; set; } - - [DefaultValue(false)] - [Label("Extra Damage Reduction for Bosses")] - [Tooltip("Grants extra damage reduction for bosses for every boss encounter, regardless if you've defeated the boss already or not")] - public bool ExtraBossDR { get; set; } - - [Label("Boss Health Percentage Boost")] - [Tooltip("Boosts the health of bosses to a maximum of +900% health")] - [Range(0f, 900f)] - [DefaultValue(0f)] - public float BossHealthPercentageBoost { get; set; } - - [Header("Expert Changes")] - - [DefaultValue(true)] - [Label("Expert Debuff Duration Reduction")] - [Tooltip("Debuffs in Expert Mode are no longer doubled")] - public bool ExpertDebuffDurationReduction { get; set; } - - [DefaultValue(true)] - [Label("Expert Chilled Water Removal")] - [Tooltip("Water in the Ice and Snow biome in Expert Mode rapidly drain your breath rather than slowing your movement")] - public bool ExpertChilledWaterRemoval { get; set; } - - [DefaultValue(true)] - [Label("Expert Pillar Enemy Kill Count Reduction")] - [Tooltip("Only 100 enemies are required to destroy the shields of the Celestial Pillars in Expert Mode")] - public bool ExpertPillarEnemyKillCountReduction { get; set; } - - [DefaultValue(false)] - [Label("Expert Enemy Spawns in Villages Reduction")] - [Tooltip("Enemy spawns are drastically reduced in the presence of town NPCs in Expert Mode")] - public bool DisableExpertEnemySpawnsNearHouse { get; set; } - - [Header("Revengeance Changes")] - - [DefaultValue(true)] - [Label("Adrenaline and Rage")] - [Tooltip("Enables the Adrenaline and Rage mechanics")] - public bool AdrenalineAndRage { get; set; } - - [Label("Rage Meter Position X")] - [Tooltip("Changes the X position of the Rage Meter")] - [Range(0f, 1660f)] - [DefaultValue(RipperUI.DefaultRagePosX)] - public float RageMeterPosX { get; set; } - - [Label("Rage Meter Position Y")] - [Tooltip("Changes the Y position of the Rage Meter")] - [Range(0f, 1100f)] - [DefaultValue(RipperUI.DefaultRagePosY)] - public float RageMeterPosY { get; set; } - - [Label("Adrenaline Meter Position X")] - [Tooltip("Changes the X position of the Adrenaline Meter")] - [Range(0f, 1660f)] - [DefaultValue(RipperUI.DefaultAdrenPosX)] - public float AdrenalineMeterPosX { get; set; } - - [Label("Adrenaline Meter Position Y")] - [Tooltip("Changes the Y position of the Adrenaline Meter")] - [Range(0f, 1100f)] - [DefaultValue(RipperUI.DefaultAdrenPosY)] - public float AdrenalineMeterPosY { get; set; } - - [DefaultValue(2f)] - [Range(0f, 4f)] - [Label("Adrenaline and Rage Meter Shake")] - [Tooltip("How much the Adrenaline and Rage Meter shake while in use. Set to 0 to disable.")] - public float MeterShake { get; set; } - - [DefaultValue(false)] - [Label("Revengeance and Death Thorium Boss buff")] - [Tooltip("Buffs the health of Thorium bosses if Revengeance or Death is enabled")] - public bool RevengeanceAndDeathThoriumBossBuff { get; set; } - - [Header("Death Mode Changes")] - - [DefaultValue(1f)] - [Range(0.5f, 3f)] - [Label("Weather Effect Rate Multiplier")] - [Tooltip("Affects all Death Mode weather projectiles, increase to decrease the amount of projectiles, decrease to increase the amount of projectiles")] - public float WeatherEffectRateMultiplier { get; set; } - - [Header("Boss Rush Curses")] - - [DefaultValue(false)] - [Label("Boss Rush Accessory Curse")] - [Tooltip("Accessories are limited to a maximum of five while the Boss Rush is active")] - public bool BossRushAccessoryCurse { get; set; } - - [DefaultValue(false)] - [Label("Boss Rush Health Curse")] - [Tooltip("Life regeneration is disabled while the Boss Rush is active")] - public bool BossRushHealthCurse { get; set; } - - [DefaultValue(false)] - [Label("Boss Rush Dash Curse")] - [Tooltip("Dashes are disabled while the Boss Rush is active")] - public bool BossRushDashCurse { get; set; } - - [DefaultValue(false)] - [Label("Boss Rush Xeroc Curse")] - [Tooltip("All bosses are permanently enraged while the Boss Rush is active")] - public bool BossRushXerocCurse { get; set; } - - [DefaultValue(false)] - [Label("Boss Rush Immunity Frame Curse")] - [Tooltip("Getting hit more than once in the span of five seconds will instantly kill you if the Boss Rush is active")] - public bool BossRushImmunityFrameCurse { get; set; } - - public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) - { - return true; - } - } -} \ No newline at end of file diff --git a/Dusts/AstralBasic.cs b/Dusts/AstralBasic.cs index 27ad7c3bf9..f771e84cdb 100644 --- a/Dusts/AstralBasic.cs +++ b/Dusts/AstralBasic.cs @@ -1,4 +1,4 @@ - + using Terraria; using Terraria.ModLoader; diff --git a/Dusts/AstralBlue.cs b/Dusts/AstralBlue.cs index 2493200de1..6959c9022b 100644 --- a/Dusts/AstralBlue.cs +++ b/Dusts/AstralBlue.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Dusts/AstralChunkDust.cs b/Dusts/AstralChunkDust.cs index db8227a4d6..f99c7069cf 100644 --- a/Dusts/AstralChunkDust.cs +++ b/Dusts/AstralChunkDust.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Dusts diff --git a/Dusts/AstralEnemy.cs b/Dusts/AstralEnemy.cs index 797f8c44de..e1db77d6c1 100644 --- a/Dusts/AstralEnemy.cs +++ b/Dusts/AstralEnemy.cs @@ -1,4 +1,4 @@ - + using Terraria; using Terraria.ModLoader; diff --git a/Dusts/AstralOrange.cs b/Dusts/AstralOrange.cs index 65b0917591..30ef63ef02 100644 --- a/Dusts/AstralOrange.cs +++ b/Dusts/AstralOrange.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Dusts/BrimstoneFlame.cs b/Dusts/BrimstoneFlame.cs index 1c48e1fb01..803ec53dfa 100644 --- a/Dusts/BrimstoneFlame.cs +++ b/Dusts/BrimstoneFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Dusts/CalamityDusts.cs b/Dusts/CalamityDusts.cs index ae879445dd..7c4c028027 100644 --- a/Dusts/CalamityDusts.cs +++ b/Dusts/CalamityDusts.cs @@ -1,4 +1,4 @@ -namespace CalamityMod.Dusts +namespace CalamityMod.Dusts { public enum CalamityDusts : int { @@ -12,6 +12,7 @@ Phantoplasm = 60, Plague = 46, ProfanedFire = 244, + Nightwither = 185, PurpleCosmolite = 173 } } \ No newline at end of file diff --git a/Dusts/HBSparkle.cs b/Dusts/HBSparkle.cs index 9c4b5071cb..78a86c1b35 100644 --- a/Dusts/HBSparkle.cs +++ b/Dusts/HBSparkle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Dusts diff --git a/Dusts/HolyFireDust.cs b/Dusts/HolyFireDust.cs index cfa57c182e..2f8cf021b4 100644 --- a/Dusts/HolyFireDust.cs +++ b/Dusts/HolyFireDust.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Dusts/OMGWTHSparkle.cs b/Dusts/OMGWTHSparkle.cs index c4c7a4519a..fe847ae16d 100644 --- a/Dusts/OMGWTHSparkle.cs +++ b/Dusts/OMGWTHSparkle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Dusts diff --git a/Effects/TentacleShader.xnb b/Effects/TentacleShader.xnb new file mode 100644 index 0000000000..02171ce264 Binary files /dev/null and b/Effects/TentacleShader.xnb differ diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 287a2f66f5..4d72473cef 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -1,4 +1,3 @@ -using CalamityMod.ILEditing; using CalamityMod.NPCs.AcidRain; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -12,7 +11,7 @@ using Terraria.Localization; namespace CalamityMod.Events { - public enum AcidRainSpawnRequirement + public enum AcidRainSpawnRequirement { Water, Land, @@ -35,6 +34,8 @@ namespace CalamityMod.Events // A partially bright pale-ish cyan with a hint of yellow. public static readonly Color TextColor = new Color(115, 194, 147); + public const int InvasionNoKillPersistTime = 14400; // How long the invasion persists, in frames, if nothing is killed. + public const float BloodwormSpawnRate = 0.1f; // Not a readonly collection so that if anyone else wants to add stuff in here with their own mod, they can. @@ -58,7 +59,7 @@ namespace CalamityMod.Events { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, - { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) } + { ModContent.NPCType(), new AcidRainSpawnData(1, 0.4f, AcidRainSpawnRequirement.Anywhere) } }; public static Dictionary PossibleEnemiesPolter = new Dictionary() @@ -71,7 +72,7 @@ namespace CalamityMod.Events { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, - { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) }, + { ModContent.NPCType(), new AcidRainSpawnData(1, 0.4f, AcidRainSpawnRequirement.Anywhere) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) } }; @@ -132,9 +133,9 @@ namespace CalamityMod.Events } } if (CalamityWorld.downedPolterghast) - return (int)(180 * Math.Log(playerCount + Math.E - 1)); + return (int)(140 * Math.Log(playerCount + Math.E - 1)); else if (CalamityWorld.downedAquaticScourge) - return (int)(125 * Math.Log(playerCount + Math.E - 1)); + return (int)(115 * Math.Log(playerCount + Math.E - 1)); else return (int)(90 * Math.Log(playerCount + Math.E - 1)); } @@ -168,17 +169,16 @@ namespace CalamityMod.Events Main.numClouds = Main.numCloudsTemp; Main.windSpeedTemp = 0.72f; Main.windSpeedSet = Main.windSpeedTemp; - Main.weatherCounter = 600; + Main.weatherCounter = 60 * 60 * 10; // 10 minutes of rain. Remember, once the rain goes away, so does the invasion. + Main.rainTime = Main.weatherCounter; Main.maxRaining = 0.89f; CalamityWorld.forcedDownpourWithTear = true; CalamityMod.UpdateServerBoolean(); } - if (CalamityWorld.startAcidicDownpour) - { - Main.raining = true; - } CalamityWorld.triedToSummonOldDuke = false; + CalamityWorld.timeSinceAcidRainKill = 0; // Reset the kill cooldown, just in case. } + UpdateInvasion(); BroadcastEventText("Mods.CalamityMod.AcidRainStart"); // A toxic downpour falls over the wasteland seas! } @@ -219,22 +219,23 @@ namespace CalamityMod.Events // In short, leave this alone. if (Main.netMode == NetmodeID.Server) { - var netMessage = CalamityMod.instance.GetPacket(); + var netMessage = CalamityMod.Instance.GetPacket(); netMessage.Write((byte)CalamityModMessageType.AcidRainSync); netMessage.Write(CalamityWorld.rainingAcid); netMessage.Write(CalamityWorld.acidRainPoints); + netMessage.Write(CalamityWorld.timeSinceAcidRainKill); netMessage.Send(); } if (Main.netMode == NetmodeID.Server) { - var netMessage = CalamityMod.instance.GetPacket(); + var netMessage = CalamityMod.Instance.GetPacket(); netMessage.Write((byte)CalamityModMessageType.AcidRainUIDrawFadeSync); netMessage.Write(CalamityWorld.acidRainExtraDrawTime); netMessage.Send(); } if (Main.netMode == NetmodeID.Server) { - var netMessage = CalamityMod.instance.GetPacket(); + var netMessage = CalamityMod.Instance.GetPacket(); netMessage.Write((byte)CalamityModMessageType.AcidRainOldDukeSummonSync); netMessage.Write(CalamityWorld.triedToSummonOldDuke); netMessage.Send(); diff --git a/ExtraTextures/Lasers/ProvidenceHolyRayEndNight.png b/ExtraTextures/Lasers/ProvidenceHolyRayEndNight.png new file mode 100644 index 0000000000..8b3548582f Binary files /dev/null and b/ExtraTextures/Lasers/ProvidenceHolyRayEndNight.png differ diff --git a/ExtraTextures/Lasers/ProvidenceHolyRayMidNight.png b/ExtraTextures/Lasers/ProvidenceHolyRayMidNight.png new file mode 100644 index 0000000000..1640082930 Binary files /dev/null and b/ExtraTextures/Lasers/ProvidenceHolyRayMidNight.png differ diff --git a/ExtraTextures/PhotovisceratorLight.png b/ExtraTextures/PhotovisceratorLight.png new file mode 100644 index 0000000000..8e2d2a871c Binary files /dev/null and b/ExtraTextures/PhotovisceratorLight.png differ diff --git a/Gores/AstralWaterDroplet.cs b/Gores/AstralWaterDroplet.cs index 7f138a3749..dcaf96b671 100644 --- a/Gores/AstralWaterDroplet.cs +++ b/Gores/AstralWaterDroplet.cs @@ -1,10 +1,11 @@ - + using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent.Shaders; using Terraria.Graphics.Effects; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Gores { @@ -146,7 +147,7 @@ namespace CalamityMod.Gores gore.frameCounter = 0; if (gore.type != 716 && gore.type != 717 && gore.type != 943) { - Main.PlaySound(39, (int)gore.position.X + 8, (int)gore.position.Y + 8, Main.rand.Next(2), 1f, 0f); + Main.PlaySound(SoundID.Drip, (int)gore.position.X + 8, (int)gore.position.Y + 8, Main.rand.Next(2), 1f, 0f); } } } @@ -158,7 +159,7 @@ namespace CalamityMod.Gores gore.frameCounter = 0; if (gore.type != 716 && gore.type != 717 && gore.type != 943) { - Main.PlaySound(39, (int)gore.position.X + 8, (int)gore.position.Y + 8, 2, 1f, 0f); + Main.PlaySound(SoundID.Drip, (int)gore.position.X + 8, (int)gore.position.Y + 8, 2, 1f, 0f); } ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(gore.position + new Vector2(8f, 8f), 1f, RippleShape.Square, 0f); } diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 7be1dd64fb..67e56ecc37 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -1,4 +1,4 @@ -using MonoMod.Cil; +using MonoMod.Cil; using System; using Terraria; @@ -16,7 +16,7 @@ namespace CalamityMod.ILEditing var cursor = new ILCursor(il); if (!cursor.TryGotoNext(i => i.MatchStsfld("Terraria.WorldGen", "dMaxY"))) { - CalamityMod.instance.Logger.Warn("Dungeon movement editing code failed."); + CalamityMod.Instance.Logger.Warn("Dungeon movement editing code failed."); return; } cursor.Index++; diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 3ce537fc31..8e34d287bd 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -1,5 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.rare = ItemRarityID.Lime; item.accessory = true; } diff --git a/Items/Accessories/AbyssalAmulet.cs b/Items/Accessories/AbyssalAmulet.cs index 318d0670f1..89ae80a10a 100644 --- a/Items/Accessories/AbyssalAmulet.cs +++ b/Items/Accessories/AbyssalAmulet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index 3efcd05701..2eeb853a28 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index bce7e75859..7286bbb8cc 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; diff --git a/Items/Accessories/AbyssalDivingSuit.png b/Items/Accessories/AbyssalDivingSuit.png index 2a59ff2b3e..9123d3b4b9 100644 Binary files a/Items/Accessories/AbyssalDivingSuit.png and b/Items/Accessories/AbyssalDivingSuit.png differ diff --git a/Items/Accessories/AbyssalDivingSuit_Arms.png b/Items/Accessories/AbyssalDivingSuit_Arms.png index 917426661f..5ec540fccc 100644 Binary files a/Items/Accessories/AbyssalDivingSuit_Arms.png and b/Items/Accessories/AbyssalDivingSuit_Arms.png differ diff --git a/Items/Accessories/AbyssalDivingSuit_Body.png b/Items/Accessories/AbyssalDivingSuit_Body.png index 55d3b2a786..3d70da65e3 100644 Binary files a/Items/Accessories/AbyssalDivingSuit_Body.png and b/Items/Accessories/AbyssalDivingSuit_Body.png differ diff --git a/Items/Accessories/AbyssalDivingSuit_Head.png b/Items/Accessories/AbyssalDivingSuit_Head.png index 0318c9c127..dd99d8fb29 100644 Binary files a/Items/Accessories/AbyssalDivingSuit_Head.png and b/Items/Accessories/AbyssalDivingSuit_Head.png differ diff --git a/Items/Accessories/AbyssalDivingSuit_Legs.png b/Items/Accessories/AbyssalDivingSuit_Legs.png index 6bc7fde9b5..4d21b6118f 100644 Binary files a/Items/Accessories/AbyssalDivingSuit_Legs.png and b/Items/Accessories/AbyssalDivingSuit_Legs.png differ diff --git a/Items/Accessories/AbyssalMirror.cs b/Items/Accessories/AbyssalMirror.cs index e1f68da264..a77614f9b0 100644 --- a/Items/Accessories/AbyssalMirror.cs +++ b/Items/Accessories/AbyssalMirror.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 1d76da3372..642e4fab63 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 40; + item.height = 50; item.value = Item.buyPrice(0, 15, 0, 0); item.rare = 5; item.accessory = true; diff --git a/Items/Accessories/AeroStone.png b/Items/Accessories/AeroStone.png index 90940f54ed..8ea1e54f88 100644 Binary files a/Items/Accessories/AeroStone.png and b/Items/Accessories/AeroStone.png differ diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index 6648787451..9da265f7e3 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Items/Accessories/AlchemicalFlask.cs b/Items/Accessories/AlchemicalFlask.cs index 5c504fecb5..e5ad4cacb6 100644 --- a/Items/Accessories/AlchemicalFlask.cs +++ b/Items/Accessories/AlchemicalFlask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; diff --git a/Items/Accessories/AlluringBait.cs b/Items/Accessories/AlluringBait.cs index 7bd0db0207..e985fa4d3b 100644 --- a/Items/Accessories/AlluringBait.cs +++ b/Items/Accessories/AlluringBait.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 4e061201f9..9f2d57bcee 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index bf85d5e999..b64ab83459 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/AmidiasPendant.cs b/Items/Accessories/AmidiasPendant.cs index 804543be9c..b49b033189 100644 --- a/Items/Accessories/AmidiasPendant.cs +++ b/Items/Accessories/AmidiasPendant.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/AmidiasSpark.cs b/Items/Accessories/AmidiasSpark.cs index d10e6ecd2b..3c22b43486 100644 --- a/Items/Accessories/AmidiasSpark.cs +++ b/Items/Accessories/AmidiasSpark.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/AncientFossil.cs b/Items/Accessories/AncientFossil.cs index 6a823e4095..a362702b5f 100644 --- a/Items/Accessories/AncientFossil.cs +++ b/Items/Accessories/AncientFossil.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/AnechoicPlating.cs b/Items/Accessories/AnechoicPlating.cs index 9915b7fffb..04145e4c27 100644 --- a/Items/Accessories/AnechoicPlating.cs +++ b/Items/Accessories/AnechoicPlating.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index c8b2b00844..395224d5d1 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index b8c8c836e4..0ef1cd7087 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ArcanumoftheVoid.cs b/Items/Accessories/ArcanumoftheVoid.cs index 37606d7116..20668e48c7 100644 --- a/Items/Accessories/ArcanumoftheVoid.cs +++ b/Items/Accessories/ArcanumoftheVoid.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index d5c501879e..05235d40a9 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 281db90beb..796adf6e9b 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Tiles.Furniture.CraftingStations; using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - [AutoloadEquip(EquipType.Shield)] + [AutoloadEquip(EquipType.Shield)] public class AsgardianAegis : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index c00b5ede3c..9f09c33d86 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Asgard's Valor"); Tooltip.SetDefault("Grants immunity to fire blocks and knockback\n" + - "Immune to most debuffs including Brimstone Flames, Holy Flames, and Glacial State\n" + + "Immune to most debuffs including Brimstone Flames, and Glacial State\n" + "10% damage reduction while submerged in liquid\n" + "+20 max life\n" + "Grants a holy dash which can be used to ram enemies\n" + @@ -51,7 +51,6 @@ namespace CalamityMod.Items.Accessories player.buffImmune[BuffID.Cursed] = true; player.buffImmune[BuffID.Darkness] = true; player.buffImmune[ModContent.BuffType()] = true; - player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[ModContent.BuffType()] = true; player.statLifeMax2 += 20; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs index e73a1929ad..aff0160b81 100644 --- a/Items/Accessories/AstralArcanum.cs +++ b/Items/Accessories/AstralArcanum.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; diff --git a/Items/Accessories/AstralBulwark.cs b/Items/Accessories/AstralBulwark.cs index 99aefdbf03..f40da571ca 100644 --- a/Items/Accessories/AstralBulwark.cs +++ b/Items/Accessories/AstralBulwark.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index fd69344781..4a393de88f 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 0e9da8d3ff..81c6160db0 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/BloodPact.cs b/Items/Accessories/BloodPact.cs index 832c5aa45b..3df409447a 100644 --- a/Items/Accessories/BloodPact.cs +++ b/Items/Accessories/BloodPact.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/BloodflareCore.cs b/Items/Accessories/BloodflareCore.cs index a9cd27593e..5e42871eae 100644 --- a/Items/Accessories/BloodflareCore.cs +++ b/Items/Accessories/BloodflareCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index a36ef22dce..a0869e6d28 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index d4fce85355..c9e7bc1aa2 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/BloomStone.cs b/Items/Accessories/BloomStone.cs index 06f114da1c..d7f0c8a2ed 100644 --- a/Items/Accessories/BloomStone.cs +++ b/Items/Accessories/BloomStone.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index dadf931fe4..945a4b7476 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -1,4 +1,3 @@ -using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using System.Collections.Generic; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class BlunderBooster : ModItem + public class BlunderBooster : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/BrokenWaterFilter.cs b/Items/Accessories/BrokenWaterFilter.cs index 83401f1c0f..6778deaeec 100644 --- a/Items/Accessories/BrokenWaterFilter.cs +++ b/Items/Accessories/BrokenWaterFilter.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 1); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddRecipeGroup("IronBar", 10); recipe.AddTile(TileID.Anvils); diff --git a/Items/Accessories/BurdenBreaker.cs b/Items/Accessories/BurdenBreaker.cs index 8984dc3fb8..7eaee8d0e4 100644 --- a/Items/Accessories/BurdenBreaker.cs +++ b/Items/Accessories/BurdenBreaker.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/CalamityRing.cs b/Items/Accessories/CalamityRing.cs index d3432a6760..d5992874e9 100644 --- a/Items/Accessories/CalamityRing.cs +++ b/Items/Accessories/CalamityRing.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; diff --git a/Items/Accessories/CelestialJewel.cs b/Items/Accessories/CelestialJewel.cs index 4c4b1a54f2..6fabf5503c 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/CelestialJewel.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Potions; using System.Collections.Generic; using Terraria; diff --git a/Items/Accessories/ChaosAmulet.cs b/Items/Accessories/ChaosAmulet.cs index e41780e326..3e55947eb8 100644 --- a/Items/Accessories/ChaosAmulet.cs +++ b/Items/Accessories/ChaosAmulet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index eb1eefbf7d..04277b032a 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/CheatTestThing.cs b/Items/Accessories/CheatTestThing.cs index d04ccd30a4..a37be3c5f1 100644 --- a/Items/Accessories/CheatTestThing.cs +++ b/Items/Accessories/CheatTestThing.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index a3fdd5614b..c6b3b65af3 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index d4ed8a417a..42159dadd8 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/CorruptFlask.cs b/Items/Accessories/CorruptFlask.cs index 182619c9cd..7f8ec3029d 100644 --- a/Items/Accessories/CorruptFlask.cs +++ b/Items/Accessories/CorruptFlask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 569a249447..df0ca83a33 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/CrawCarapace.cs b/Items/Accessories/CrawCarapace.cs index 8139737171..8cb1b4f854 100644 --- a/Items/Accessories/CrawCarapace.cs +++ b/Items/Accessories/CrawCarapace.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories diff --git a/Items/Accessories/CrimsonFlask.cs b/Items/Accessories/CrimsonFlask.cs index e9d0ec41b5..4884087736 100644 --- a/Items/Accessories/CrimsonFlask.cs +++ b/Items/Accessories/CrimsonFlask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 763b17910f..e14f3e24c1 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index 15eb77fb3c..00da5e3408 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/DaedalusEmblem.cs b/Items/Accessories/DaedalusEmblem.cs index 9c9e70b24f..4dee335e7c 100644 --- a/Items/Accessories/DaedalusEmblem.cs +++ b/Items/Accessories/DaedalusEmblem.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/DarkGodsSheath.cs b/Items/Accessories/DarkGodsSheath.cs index 4b3986bad0..8d0492ed21 100644 --- a/Items/Accessories/DarkGodsSheath.cs +++ b/Items/Accessories/DarkGodsSheath.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index e1b6c88331..964a8acf04 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.DataStructures; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Tiles.Furniture.CraftingStations; namespace CalamityMod.Items.Accessories { - public class DarkSunRing : ModItem + public class DarkSunRing : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/DeepDiver.cs b/Items/Accessories/DeepDiver.cs index 9ab6e96179..fc72e63709 100644 --- a/Items/Accessories/DeepDiver.cs +++ b/Items/Accessories/DeepDiver.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index 884422778b..817a2ef703 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/DepthCharm.cs b/Items/Accessories/DepthCharm.cs index 8ed09a6e56..c728b6e8a9 100644 --- a/Items/Accessories/DepthCharm.cs +++ b/Items/Accessories/DepthCharm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/DimensionalSoulArtifact.cs b/Items/Accessories/DimensionalSoulArtifact.cs index 17ce7a5e50..914f1cc56a 100644 --- a/Items/Accessories/DimensionalSoulArtifact.cs +++ b/Items/Accessories/DimensionalSoulArtifact.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 1444ad5586..78cd45dc35 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class DraedonsHeart : ModItem + public class DraedonsHeart : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/DragonScales.cs b/Items/Accessories/DragonScales.cs index 93ea711fa1..f421cd630d 100644 --- a/Items/Accessories/DragonScales.cs +++ b/Items/Accessories/DragonScales.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index 9e3d27e760..551123bb6c 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -1,11 +1,10 @@ using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; -using CalamityMod.CalPlayer; namespace CalamityMod.Items.Accessories { - public class DynamoStemCells : ModItem + public class DynamoStemCells : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/EclipseMirror.cs b/Items/Accessories/EclipseMirror.cs index 9faf8fb409..e62c6a0edf 100644 --- a/Items/Accessories/EclipseMirror.cs +++ b/Items/Accessories/EclipseMirror.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Accessories/EldritchSoulArtifact.cs b/Items/Accessories/EldritchSoulArtifact.cs index a9302d4b85..abc1eb938e 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/EldritchSoulArtifact.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index 695804b640..d42ed72689 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Elemental Gauntlet"); Tooltip.SetDefault("Melee attacks and projectiles inflict most debuffs\n" + "15% increased melee speed, damage, and 5% increased melee critical strike chance\n" + + "35% increased true melee damage\n" + "Increased invincibility after taking damage\n" + "Temporary immunity to lava\n" + "Increased melee knockback\n" + diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index f1a4cff40a..0768cc01b8 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 6f29a6674e..18dffeb0f3 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Buffs.DamageOverTime; using System.Collections.Generic; using Terraria; diff --git a/Items/Accessories/EnchantedPearl.cs b/Items/Accessories/EnchantedPearl.cs index 554ccc2f0f..a442616cf2 100644 --- a/Items/Accessories/EnchantedPearl.cs +++ b/Items/Accessories/EnchantedPearl.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Materials; diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index e97f68e4d6..4195c10187 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Accessories/FabledTortoiseShell.cs b/Items/Accessories/FabledTortoiseShell.cs index c659c1a4d7..f823e69be8 100644 --- a/Items/Accessories/FabledTortoiseShell.cs +++ b/Items/Accessories/FabledTortoiseShell.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index 378fff20a4..a81b82e21a 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/FleshTotem.cs b/Items/Accessories/FleshTotem.cs index 5f217040f2..b4ae75b762 100644 --- a/Items/Accessories/FleshTotem.cs +++ b/Items/Accessories/FleshTotem.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index c1caa2ffaa..ae11e4f707 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/FrostBarrier.cs b/Items/Accessories/FrostBarrier.cs index c837bc76fc..63c0da9caf 100644 --- a/Items/Accessories/FrostBarrier.cs +++ b/Items/Accessories/FrostBarrier.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index 941cf1dcc7..f66a8c5566 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/FungalCarapace.cs b/Items/Accessories/FungalCarapace.cs index 4f9ee01b98..d7beaa3eee 100644 --- a/Items/Accessories/FungalCarapace.cs +++ b/Items/Accessories/FungalCarapace.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/FungalSymbiote.cs b/Items/Accessories/FungalSymbiote.cs index 84e7985c9d..836fdadad8 100644 --- a/Items/Accessories/FungalSymbiote.cs +++ b/Items/Accessories/FungalSymbiote.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/Gehenna.cs b/Items/Accessories/Gehenna.cs index 6d1362905e..71e1f63069 100644 --- a/Items/Accessories/Gehenna.cs +++ b/Items/Accessories/Gehenna.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GiantPearl.cs b/Items/Accessories/GiantPearl.cs index c0fb3b84bb..0c82ffe5c3 100644 --- a/Items/Accessories/GiantPearl.cs +++ b/Items/Accessories/GiantPearl.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index 5be9f7d194..d298b0c214 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GiantTortoiseShell.cs b/Items/Accessories/GiantTortoiseShell.cs index ef667fd30d..797b62bd62 100644 --- a/Items/Accessories/GiantTortoiseShell.cs +++ b/Items/Accessories/GiantTortoiseShell.cs @@ -1,10 +1,9 @@ -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class GiantTortoiseShell : ModItem + public class GiantTortoiseShell : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/GloveOfRecklessness.cs b/Items/Accessories/GloveOfRecklessness.cs index d89ee3056e..8ccd8226ee 100644 --- a/Items/Accessories/GloveOfRecklessness.cs +++ b/Items/Accessories/GloveOfRecklessness.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index ea5bfa6771..afd6a5a729 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GodlySoulArtifact.cs b/Items/Accessories/GodlySoulArtifact.cs index cae592c6ea..b3afb40c51 100644 --- a/Items/Accessories/GodlySoulArtifact.cs +++ b/Items/Accessories/GodlySoulArtifact.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; diff --git a/Items/Accessories/GoldBurdenBreaker.cs b/Items/Accessories/GoldBurdenBreaker.cs index 7d5283172f..b4fae34092 100644 --- a/Items/Accessories/GoldBurdenBreaker.cs +++ b/Items/Accessories/GoldBurdenBreaker.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/GrandGelatin.cs b/Items/Accessories/GrandGelatin.cs index c2ae63d6aa..c25916bf5c 100644 --- a/Items/Accessories/GrandGelatin.cs +++ b/Items/Accessories/GrandGelatin.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index 90b1b77a11..20d5a68d72 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -1,12 +1,9 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class GravistarSabaton : ModItem + public class GravistarSabaton : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 26288e8743..34732b8707 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -1,11 +1,10 @@ -using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class HallowedRune : ModItem + public class HallowedRune : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/HarpyRing.cs b/Items/Accessories/HarpyRing.cs index d577416d61..bd7e8fea56 100644 --- a/Items/Accessories/HarpyRing.cs +++ b/Items/Accessories/HarpyRing.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/HeartofDarkness.cs b/Items/Accessories/HeartofDarkness.cs index 84f70f6e2f..81e7c7d448 100644 --- a/Items/Accessories/HeartofDarkness.cs +++ b/Items/Accessories/HeartofDarkness.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index ff56822c8e..c8a91869d6 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using CalamityMod.World; diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index 0cacfad449..15c2f0e62f 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Hide of Astrum Deus"); - Tooltip.SetDefault("Taking damage drops an immense amount of astral stars from the sky and boosts true melee damage by 200% for a time\n" + + Tooltip.SetDefault("Taking damage drops an immense amount of astral stars from the sky and boosts true melee damage by 100% for a time\n" + "Boost duration is based on the amount of damage you took, the higher the damage the longer the boost\n" + "Provides immunity to the astral infection, cursed inferno, on fire, and frostburn debuffs\n" + "Enemies take damage when they hit you and are inflicted with the astral infection debuff"); diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 7eab4d144b..1272f5c886 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index 62234a3e5b..ef5c92d3de 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ProjectileType(), (int)(HowlDamage * player.MinionDamage()), 1f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ProjectileType(), (int)(HowlDamage * player.MinionDamage()), 1f, player.whoAmI, 0f, 1f); } if (player.ownedProjectileCounts[ProjectileType()] < 1) { diff --git a/Items/Accessories/InkBomb.cs b/Items/Accessories/InkBomb.cs index 69ce4210df..ba91beb059 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/IronBoots.cs b/Items/Accessories/IronBoots.cs index 5f71a9b2ce..17ee004f75 100644 --- a/Items/Accessories/IronBoots.cs +++ b/Items/Accessories/IronBoots.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/Laudanum.cs b/Items/Accessories/Laudanum.cs index a40343f11b..9cef7a4e86 100644 --- a/Items/Accessories/Laudanum.cs +++ b/Items/Accessories/Laudanum.cs @@ -1,10 +1,9 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class Laudanum : ModItem + public class Laudanum : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/LeadCore.cs b/Items/Accessories/LeadCore.cs index ef8f5dc878..52fc9a0b46 100644 --- a/Items/Accessories/LeadCore.cs +++ b/Items/Accessories/LeadCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories diff --git a/Items/Accessories/LeviathanAmbergris.cs b/Items/Accessories/LeviathanAmbergris.cs index 697706684e..010f303042 100644 --- a/Items/Accessories/LeviathanAmbergris.cs +++ b/Items/Accessories/LeviathanAmbergris.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/LifeJelly.cs b/Items/Accessories/LifeJelly.cs index 05c0e60ad8..c7c79a17bf 100644 --- a/Items/Accessories/LifeJelly.cs +++ b/Items/Accessories/LifeJelly.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index 703d64ad37..1840c1cd34 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/LumenousAmulet.cs b/Items/Accessories/LumenousAmulet.cs index 341201779c..0247f2cfd0 100644 --- a/Items/Accessories/LumenousAmulet.cs +++ b/Items/Accessories/LumenousAmulet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; diff --git a/Items/Accessories/LureofEnthrallment.cs b/Items/Accessories/LureofEnthrallment.cs index 1b28b09643..458d27f756 100644 --- a/Items/Accessories/LureofEnthrallment.cs +++ b/Items/Accessories/LureofEnthrallment.cs @@ -1,14 +1,12 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class LureofEnthrallment : ModItem + public class LureofEnthrallment : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/LuxorsGift.cs b/Items/Accessories/LuxorsGift.cs index 091407c0e4..8909f72368 100644 --- a/Items/Accessories/LuxorsGift.cs +++ b/Items/Accessories/LuxorsGift.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/MagicLevelMeter.cs b/Items/Accessories/MagicLevelMeter.cs index 51d1f64228..ffe71460e0 100644 --- a/Items/Accessories/MagicLevelMeter.cs +++ b/Items/Accessories/MagicLevelMeter.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ManaJelly.cs b/Items/Accessories/ManaJelly.cs index 4beb850e8c..28ad8ae3ce 100644 --- a/Items/Accessories/ManaJelly.cs +++ b/Items/Accessories/ManaJelly.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ManaOverloader.cs b/Items/Accessories/ManaOverloader.cs index 36950b8cc8..5d4d6691e3 100644 --- a/Items/Accessories/ManaOverloader.cs +++ b/Items/Accessories/ManaOverloader.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/MeleeLevelMeter.cs b/Items/Accessories/MeleeLevelMeter.cs index c898e93344..2ce168d7ee 100644 --- a/Items/Accessories/MeleeLevelMeter.cs +++ b/Items/Accessories/MeleeLevelMeter.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/MirageMirror.cs b/Items/Accessories/MirageMirror.cs index b7a4b1a871..5877e21aa2 100644 --- a/Items/Accessories/MirageMirror.cs +++ b/Items/Accessories/MirageMirror.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/MomentumCapacitor.cs b/Items/Accessories/MomentumCapacitor.cs index f688b56b2c..30431528d9 100644 --- a/Items/Accessories/MomentumCapacitor.cs +++ b/Items/Accessories/MomentumCapacitor.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index e049ffebc8..18a590a446 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index 09185b29c8..e0c77bf200 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using System.Collections.Generic; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class Nanotech : ModItem + public class Nanotech : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 9ab9bf429f..3063cedc7e 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Accessories/NecklaceofVexation.cs b/Items/Accessories/NecklaceofVexation.cs index fa64a07297..78832ad83c 100644 --- a/Items/Accessories/NecklaceofVexation.cs +++ b/Items/Accessories/NecklaceofVexation.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/NuclearRod.cs b/Items/Accessories/NuclearRod.cs index 9686a101a4..108be9407b 100644 --- a/Items/Accessories/NuclearRod.cs +++ b/Items/Accessories/NuclearRod.cs @@ -1,13 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class NuclearRod : ModItem + public class NuclearRod : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/OceanCrest.cs b/Items/Accessories/OceanCrest.cs index a254f2d29c..300b61afed 100644 --- a/Items/Accessories/OceanCrest.cs +++ b/Items/Accessories/OceanCrest.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories diff --git a/Items/Accessories/OldDie.cs b/Items/Accessories/OldDie.cs index 184416774d..9862cd5c82 100644 --- a/Items/Accessories/OldDie.cs +++ b/Items/Accessories/OldDie.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index 62eac13dc4..bc6ac8bb02 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Armor; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index c15e1c0389..9684774f91 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 70ed160be3..4af0f75c0e 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -1,12 +1,10 @@ -using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class PlaguedFuelPack : ModItem + public class PlaguedFuelPack : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 2256b16f90..98f96a7413 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 7cedbc6546..6f059f0239 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.World; @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Accessories } - tooltips.Insert(index+1, new TooltipLine(CalamityMod.instance, "Tooltip1", "[c/f05a5a:The soul within this crystal has been defiled by the powerful magic of a supreme witch]\nMerchants will reject a defiled soul such as this.")); + tooltips.Insert(index+1, new TooltipLine(CalamityMod.Instance, "Tooltip1", "[c/f05a5a:The soul within this crystal has been defiled by the powerful magic of a supreme witch]\nMerchants will reject a defiled soul such as this.")); } else if (Main.player[Main.myPlayer].Calamity().profanedCrystalBuffs) { diff --git a/Items/Accessories/PsychoticAmulet.cs b/Items/Accessories/PsychoticAmulet.cs index 7aa25d41e2..6e08ca679d 100644 --- a/Items/Accessories/PsychoticAmulet.cs +++ b/Items/Accessories/PsychoticAmulet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 4e1a88ee0a..2a3e432b2c 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/RaidersTalisman.cs b/Items/Accessories/RaidersTalisman.cs index c3959a7c18..4654ecc26d 100644 --- a/Items/Accessories/RaidersTalisman.cs +++ b/Items/Accessories/RaidersTalisman.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index b7a2b1ab91..bd38defdc1 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Accessories/RangedLevelMeter.cs b/Items/Accessories/RangedLevelMeter.cs index 87440ad6f1..c3cfcf53bc 100644 --- a/Items/Accessories/RangedLevelMeter.cs +++ b/Items/Accessories/RangedLevelMeter.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ReaperToothNecklace.cs b/Items/Accessories/ReaperToothNecklace.cs index b5108a2740..0053e0b13f 100644 --- a/Items/Accessories/ReaperToothNecklace.cs +++ b/Items/Accessories/ReaperToothNecklace.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenator.cs index e651a4ca1d..2656f6241c 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenator.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/RogueEmblem.cs b/Items/Accessories/RogueEmblem.cs index 1fcb7173b5..b6887e989e 100644 --- a/Items/Accessories/RogueEmblem.cs +++ b/Items/Accessories/RogueEmblem.cs @@ -1,10 +1,9 @@ -using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class RogueEmblem : ModItem + public class RogueEmblem : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/RogueLevelMeter.cs b/Items/Accessories/RogueLevelMeter.cs index 3997c2a52c..21e7acd1b5 100644 --- a/Items/Accessories/RogueLevelMeter.cs +++ b/Items/Accessories/RogueLevelMeter.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index e1b2743f71..a4059168c3 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Summon; using Terraria; diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 6bbd8a2e6d..83cbd5ed35 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; diff --git a/Items/Accessories/RuinMedallion.cs b/Items/Accessories/RuinMedallion.cs index 8a982bed56..b55ec290eb 100644 --- a/Items/Accessories/RuinMedallion.cs +++ b/Items/Accessories/RuinMedallion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/RustyMedallion.cs b/Items/Accessories/RustyMedallion.cs index 9d29b47034..e77b0415f5 100644 --- a/Items/Accessories/RustyMedallion.cs +++ b/Items/Accessories/RustyMedallion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 1); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddRecipeGroup("IronBar", 10); recipe.AddTile(TileID.Anvils); diff --git a/Items/Accessories/SamuraiBadge.cs b/Items/Accessories/SamuraiBadge.cs index e695637546..b1586154e7 100644 --- a/Items/Accessories/SamuraiBadge.cs +++ b/Items/Accessories/SamuraiBadge.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; @@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Samurai Badge"); - Tooltip.SetDefault("20% increased melee damage and speed\n" + - "Reduces max life by 25%"); + Tooltip.SetDefault("20% increased melee and true melee damage and speed\n" + + "Reduces max life by 25%"); } public override void SetDefaults() diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index 03d49f872d..3ae66ca741 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -1,12 +1,10 @@ -using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class SandCloak : ModItem + public class SandCloak : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/SeaShell.cs b/Items/Accessories/SeaShell.cs index 453437ac17..a3ca77070a 100644 --- a/Items/Accessories/SeaShell.cs +++ b/Items/Accessories/SeaShell.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index 534b6ef4ae..909b9d3835 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Armor; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index df519ff0f8..2a26337511 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.DataStructures; using Terraria.ID; diff --git a/Items/Accessories/SilencingSheath.cs b/Items/Accessories/SilencingSheath.cs index 66e6969e5a..9bd46f5e43 100644 --- a/Items/Accessories/SilencingSheath.cs +++ b/Items/Accessories/SilencingSheath.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/SirensHeart.cs b/Items/Accessories/SirensHeart.cs index 3518463d4c..5a6ff51139 100644 --- a/Items/Accessories/SirensHeart.cs +++ b/Items/Accessories/SirensHeart.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/SirensHeartAlt.cs b/Items/Accessories/SirensHeartAlt.cs index f8f9ebfa24..1d4a2d36a1 100644 --- a/Items/Accessories/SirensHeartAlt.cs +++ b/Items/Accessories/SirensHeartAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index a02628b9a1..36cc32ba5e 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -1,12 +1,10 @@ -using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class SpectralVeil : ModItem + public class SpectralVeil : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/SpiritGenerator.cs b/Items/Accessories/SpiritGenerator.cs index 1bd9b8c7af..bcb286e074 100644 --- a/Items/Accessories/SpiritGenerator.cs +++ b/Items/Accessories/SpiritGenerator.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index a40129a4bf..316eb68d3a 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Accessories/StarbusterCore.cs b/Items/Accessories/StarbusterCore.cs index 2b6f9b9d7f..e7c728a60c 100644 --- a/Items/Accessories/StarbusterCore.cs +++ b/Items/Accessories/StarbusterCore.cs @@ -1,13 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class StarbusterCore : ModItem + public class StarbusterCore : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index 4256880aa8..11954e4a3f 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -1,6 +1,5 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; -using System; using System.Collections.Generic; using System.Text; using Terraria; @@ -75,7 +74,7 @@ namespace CalamityMod.Items.Accessories StringBuilder sb = new StringBuilder("Displays almost all player stats\nOffensive stats displayed vary with held item\n\n", 1024); // Only append rippers stats in Rev+, if rippers are enabled. - if (CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage) + if (CalamityWorld.revenge && CalamityConfig.Instance.Rippers) { sb.Append("Adrenaline Charge Time: ").Append(modPlayer.adrenalineChargeStat) .Append(" seconds | Rage Damage Boost: ").Append(modPlayer.rageDamageStat) @@ -88,6 +87,7 @@ namespace CalamityMod.Items.Accessories if (heldItem.melee) { sb.Append("Melee Damage: ").Append(modPlayer.damageStats[0]) + .Append("% | True Melee Damage: ").Append(modPlayer.damageStats[5]) .Append("% | Melee Crit Chance: ").Append(modPlayer.critStats[0]) .Append("%\nMelee Speed Boost: ").Append(meleeSpeed).Append("%\n\n"); } diff --git a/Items/Accessories/StatisBeltOfCurses.cs b/Items/Accessories/StatisBeltOfCurses.cs index 6d31a41f8c..cf21088fb7 100644 --- a/Items/Accessories/StatisBeltOfCurses.cs +++ b/Items/Accessories/StatisBeltOfCurses.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.DataStructures; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class StatisBeltOfCurses : ModItem + public class StatisBeltOfCurses : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index 927a17530c..a4256bea5d 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 1691c8e935..9ed5b61071 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -1,5 +1,6 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -15,6 +16,7 @@ namespace CalamityMod.Items.Accessories "Increased minion knockback\n" + "Grants shadowflame powers to all minions\n" + "Minions make enemies cry on hit"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); } public override void SetDefaults() diff --git a/Items/Accessories/StatisCurse.png b/Items/Accessories/StatisCurse.png index 15879085f6..51e578ec26 100644 Binary files a/Items/Accessories/StatisCurse.png and b/Items/Accessories/StatisCurse.png differ diff --git a/Items/Accessories/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index e9d8bc1c46..3225f87f6b 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index 31528b952d..c7d3180783 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/SummonLevelMeter.cs b/Items/Accessories/SummonLevelMeter.cs index a72c6d532f..7cfc2ce16e 100644 --- a/Items/Accessories/SummonLevelMeter.cs +++ b/Items/Accessories/SummonLevelMeter.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs index 0815197ba2..8f6d44be6e 100644 --- a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs +++ b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 5f3450fd6b..21f68cc4ab 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 7338190ab6..370ef77780 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; @@ -6,7 +6,6 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -15,7 +14,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Accessories { - public class TheAmalgam : ModItem + public class TheAmalgam : ModItem { public const int FireProjectiles = 2; public const float FireAngleSpread = 120; @@ -97,6 +96,10 @@ namespace CalamityMod.Items.Accessories { WaterBonuses = true; } + else if (!player.IsUnderwater()) + { + WaterBonuses = false; + } } } if (WaterBonuses || player.IsUnderwater()) diff --git a/Items/Accessories/TheBee.cs b/Items/Accessories/TheBee.cs index e0194468d0..f8e516400a 100644 --- a/Items/Accessories/TheBee.cs +++ b/Items/Accessories/TheBee.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 0b4fac1ec4..9aa882e694 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index f3575b1da4..e45b03735f 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index fcd2d5d966..94eee504f0 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/TheFirstShadowflame.cs b/Items/Accessories/TheFirstShadowflame.cs index 982bd94cdd..b91765e2f7 100644 --- a/Items/Accessories/TheFirstShadowflame.cs +++ b/Items/Accessories/TheFirstShadowflame.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index 95b7e61d88..f395f0592a 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index 43f5fa212a..6a076cb67c 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class ToxicHeart : ModItem + public class ToxicHeart : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index 6b3e212cf5..ac8857c96c 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/UnstablePrism.cs b/Items/Accessories/UnstablePrism.cs index 4e23b15ba4..94a6ceb7d0 100644 --- a/Items/Accessories/UnstablePrism.cs +++ b/Items/Accessories/UnstablePrism.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index c7b610a58f..d01f998f21 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/VeneratedLocket.cs b/Items/Accessories/VeneratedLocket.cs index ac2db5fa4b..91160edff1 100644 --- a/Items/Accessories/VeneratedLocket.cs +++ b/Items/Accessories/VeneratedLocket.cs @@ -1,4 +1,4 @@ - + using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/VitalJelly.cs b/Items/Accessories/VitalJelly.cs index 35dcd9f7d0..a532c509c6 100644 --- a/Items/Accessories/VitalJelly.cs +++ b/Items/Accessories/VitalJelly.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index b19ff08fb0..a0c53e5fe5 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; diff --git a/Items/Accessories/VoltaicJelly.cs b/Items/Accessories/VoltaicJelly.cs index 6d2d9aa06a..1143fe5b52 100644 --- a/Items/Accessories/VoltaicJelly.cs +++ b/Items/Accessories/VoltaicJelly.cs @@ -1,10 +1,9 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class VoltaicJelly : ModItem + public class VoltaicJelly : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 2c44b2f125..985b528f50 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -1,6 +1,5 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Wings { - [AutoloadEquip(EquipType.Wings)] + [AutoloadEquip(EquipType.Wings)] public class CelestialTracers : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index 5813321aa9..db1c2f31b3 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 1de428e6b6..00fa3b003a 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index ade0756057..dc035315e3 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Accessories/Wings/MOAB.cs b/Items/Accessories/Wings/MOAB.cs index d0b81f25bd..7bb6e3b45d 100644 --- a/Items/Accessories/Wings/MOAB.cs +++ b/Items/Accessories/Wings/MOAB.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Graphics.Shaders; using Terraria.ID; diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index cb307a1303..615bf881f3 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -1,13 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Wings { - [AutoloadEquip(EquipType.Wings)] + [AutoloadEquip(EquipType.Wings)] public class SoulofCryogen : ModItem { public override void SetStaticDefaults() @@ -68,7 +67,7 @@ namespace CalamityMod.Items.Accessories.Wings { if (player.controlJump && !player.jumpAgainCloud && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) { - int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI); + int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI, 1f); Main.projectile[p].Calamity().forceTypeless = true; Main.projectile[p].frame = Main.rand.Next(5); modPlayer.icicleCooldown = 10; diff --git a/Items/Accessories/WulfrumBattery.cs b/Items/Accessories/WulfrumBattery.cs index cb3c294c11..7f14697916 100644 --- a/Items/Accessories/WulfrumBattery.cs +++ b/Items/Accessories/WulfrumBattery.cs @@ -1,10 +1,9 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class WulfrumBattery : ModItem + public class WulfrumBattery : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index bd898b736a..fabd3084d7 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index bdfd75b9c4..4965203c9f 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Yharim's Insignia"); Tooltip.SetDefault("10% increased damage when under 50% life\n" + "10% increased melee speed\n" + - "5% increased melee damage\n" + + "5% increased melee damage and 10% increased true melee damage\n" + "Melee attacks and melee projectiles inflict holy fire\n" + "Increased invincibility after taking damage\n" + "Temporary immunity to lava\n" + diff --git a/Items/Ammo/AstralSolution.cs b/Items/Ammo/AstralSolution.cs index eb11992048..449e3c27d3 100644 --- a/Items/Ammo/AstralSolution.cs +++ b/Items/Ammo/AstralSolution.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Ammo/BloodRune.cs b/Items/Ammo/BloodRune.cs index 46f31b5047..2d90865bd1 100644 --- a/Items/Ammo/BloodRune.cs +++ b/Items/Ammo/BloodRune.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ModLoader; diff --git a/Items/Armor/AerospecBreastplate.cs b/Items/Armor/AerospecBreastplate.cs index aa92807704..ce0533b5c2 100644 --- a/Items/Armor/AerospecBreastplate.cs +++ b/Items/Armor/AerospecBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AerospecHat.cs b/Items/Armor/AerospecHat.cs index 569427855b..281540bc79 100644 --- a/Items/Armor/AerospecHat.cs +++ b/Items/Armor/AerospecHat.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AerospecHeadgear.cs b/Items/Armor/AerospecHeadgear.cs index d344d14dd4..f1ff8dfeb5 100644 --- a/Items/Armor/AerospecHeadgear.cs +++ b/Items/Armor/AerospecHeadgear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AerospecHelm.cs b/Items/Armor/AerospecHelm.cs index 683d65aad7..f150ad2d28 100644 --- a/Items/Armor/AerospecHelm.cs +++ b/Items/Armor/AerospecHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index 495d23c962..79efe6f96b 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; diff --git a/Items/Armor/AerospecHood.cs b/Items/Armor/AerospecHood.cs index 5bbf3b42dc..1bf782278c 100644 --- a/Items/Armor/AerospecHood.cs +++ b/Items/Armor/AerospecHood.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AerospecLeggings.cs b/Items/Armor/AerospecLeggings.cs index 7f6de46848..6f76639062 100644 --- a/Items/Armor/AerospecLeggings.cs +++ b/Items/Armor/AerospecLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AstralBreastplate.cs b/Items/Armor/AstralBreastplate.cs index 6ebe8b4b0a..8c1ee94320 100644 --- a/Items/Armor/AstralBreastplate.cs +++ b/Items/Armor/AstralBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AstralHelm.cs b/Items/Armor/AstralHelm.cs index b15aa82cbd..01855583cd 100644 --- a/Items/Armor/AstralHelm.cs +++ b/Items/Armor/AstralHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AstralLeggings.cs b/Items/Armor/AstralLeggings.cs index c410fb56bf..e73d0d934a 100644 --- a/Items/Armor/AstralLeggings.cs +++ b/Items/Armor/AstralLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AtaxiaArmor.cs b/Items/Armor/AtaxiaArmor.cs index abd671df04..cbdbe7177a 100644 --- a/Items/Armor/AtaxiaArmor.cs +++ b/Items/Armor/AtaxiaArmor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index 413f44b1bb..fbba6b04f1 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/AtaxiaHelm.cs index 6ec0e6dbe4..40fcb0cd07 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/AtaxiaHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index e91deb96a3..d29355e319 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; diff --git a/Items/Armor/AtaxiaHood.cs b/Items/Armor/AtaxiaHood.cs index 6b71af1b1a..23330ec8cd 100644 --- a/Items/Armor/AtaxiaHood.cs +++ b/Items/Armor/AtaxiaHood.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/AtaxiaMask.cs index ebee740c94..4299c241c8 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/AtaxiaMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/AtaxiaSubligar.cs b/Items/Armor/AtaxiaSubligar.cs index d3329c6e16..182ce86fee 100644 --- a/Items/Armor/AtaxiaSubligar.cs +++ b/Items/Armor/AtaxiaSubligar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/AuricTeslaBodyArmor.cs b/Items/Armor/AuricTeslaBodyArmor.cs index c67b257148..308688ea12 100644 --- a/Items/Armor/AuricTeslaBodyArmor.cs +++ b/Items/Armor/AuricTeslaBodyArmor.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body)] + [AutoloadEquip(EquipType.Body)] public class AuricTeslaBodyArmor : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaCuisses.cs b/Items/Armor/AuricTeslaCuisses.cs index cefc53a321..990fbb1733 100644 --- a/Items/Armor/AuricTeslaCuisses.cs +++ b/Items/Armor/AuricTeslaCuisses.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Legs)] + [AutoloadEquip(EquipType.Legs)] public class AuricTeslaCuisses : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaHelm.cs index 6e320210be..891f53bdca 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaHelm.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class AuricTeslaHelm : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaHoodedFacemask.cs b/Items/Armor/AuricTeslaHoodedFacemask.cs index 19e573aa62..062117a186 100644 --- a/Items/Armor/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/AuricTeslaHoodedFacemask.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class AuricTeslaHoodedFacemask : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaPlumedHelm.cs b/Items/Armor/AuricTeslaPlumedHelm.cs index 3005be8296..0d49bb4349 100644 --- a/Items/Armor/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/AuricTeslaPlumedHelm.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class AuricTeslaPlumedHelm : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 296e19fd3a..879440e7b5 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -1,8 +1,7 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -12,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class AuricTeslaSpaceHelmet : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaWireHemmedVisage.cs b/Items/Armor/AuricTeslaWireHemmedVisage.cs index 87dc2fa2e6..2219f9c286 100644 --- a/Items/Armor/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/AuricTeslaWireHemmedVisage.cs @@ -1,14 +1,13 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class AuricTeslaWireHemmedVisage : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/BloodflareBodyArmor.cs b/Items/Armor/BloodflareBodyArmor.cs index e714271439..231f65334a 100644 --- a/Items/Armor/BloodflareBodyArmor.cs +++ b/Items/Armor/BloodflareBodyArmor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/BloodflareCuisses.cs b/Items/Armor/BloodflareCuisses.cs index 003c7e6a4f..423382683e 100644 --- a/Items/Armor/BloodflareCuisses.cs +++ b/Items/Armor/BloodflareCuisses.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/BloodflareHelm.cs b/Items/Armor/BloodflareHelm.cs index 22cba89c92..5cb35e9c2f 100644 --- a/Items/Armor/BloodflareHelm.cs +++ b/Items/Armor/BloodflareHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/BloodflareHelmet.cs b/Items/Armor/BloodflareHelmet.cs index ec7066ec40..eced0d7cce 100644 --- a/Items/Armor/BloodflareHelmet.cs +++ b/Items/Armor/BloodflareHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/BloodflareHornedHelm.cs b/Items/Armor/BloodflareHornedHelm.cs index 8762114229..2169c9027f 100644 --- a/Items/Armor/BloodflareHornedHelm.cs +++ b/Items/Armor/BloodflareHornedHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/BloodflareHornedMask.cs b/Items/Armor/BloodflareHornedMask.cs index a778d484ae..0b9fcc6490 100644 --- a/Items/Armor/BloodflareHornedMask.cs +++ b/Items/Armor/BloodflareHornedMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/BloodflareMask.cs b/Items/Armor/BloodflareMask.cs index 67839aeb58..6754860b83 100644 --- a/Items/Armor/BloodflareMask.cs +++ b/Items/Armor/BloodflareMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/BrimflameBoots.cs b/Items/Armor/BrimflameBoots.cs index 59929a06f5..505b4f5002 100644 --- a/Items/Armor/BrimflameBoots.cs +++ b/Items/Armor/BrimflameBoots.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/BrimflameRobes.cs b/Items/Armor/BrimflameRobes.cs index f1ab7b1ac2..7019f705a3 100644 --- a/Items/Armor/BrimflameRobes.cs +++ b/Items/Armor/BrimflameRobes.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/BrimflameScowl.cs b/Items/Armor/BrimflameScowl.cs index 3fc8cc75af..68b81c9435 100644 --- a/Items/Armor/BrimflameScowl.cs +++ b/Items/Armor/BrimflameScowl.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Cooldowns; +using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; diff --git a/Items/Armor/DaedalusBreastplate.cs b/Items/Armor/DaedalusBreastplate.cs index 35a2b3f84d..a9ab945f1a 100644 --- a/Items/Armor/DaedalusBreastplate.cs +++ b/Items/Armor/DaedalusBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(0, 20, 0, 0); item.rare = 5; - item.defense = 17; //41 + item.defense = 19; //41 } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DaedalusHat.cs b/Items/Armor/DaedalusHat.cs index 7218d53da5..38a890005f 100644 --- a/Items/Armor/DaedalusHat.cs +++ b/Items/Armor/DaedalusHat.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index 644fd96189..7de730e8fd 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; diff --git a/Items/Armor/DaedalusHelm.cs b/Items/Armor/DaedalusHelm.cs index 8e7933371b..466ef8b65d 100644 --- a/Items/Armor/DaedalusHelm.cs +++ b/Items/Armor/DaedalusHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/DaedalusHelmet.cs b/Items/Armor/DaedalusHelmet.cs index c2195bd97e..e4d25a333b 100644 --- a/Items/Armor/DaedalusHelmet.cs +++ b/Items/Armor/DaedalusHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/DaedalusLeggings.cs b/Items/Armor/DaedalusLeggings.cs index 1a520cb2ef..e29ed2603a 100644 --- a/Items/Armor/DaedalusLeggings.cs +++ b/Items/Armor/DaedalusLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(0, 15, 0, 0); item.rare = 5; - item.defense = 13; //41 + item.defense = 15; //41 } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DaedalusVisor.cs b/Items/Armor/DaedalusVisor.cs index 8f745ff2be..1fee11c457 100644 --- a/Items/Armor/DaedalusVisor.cs +++ b/Items/Armor/DaedalusVisor.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index 6793f8828c..1614e94852 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/DemonshadeGreaves.cs b/Items/Armor/DemonshadeGreaves.cs index 946fe42d19..246b10d6b0 100644 --- a/Items/Armor/DemonshadeGreaves.cs +++ b/Items/Armor/DemonshadeGreaves.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index 15ca18f95d..3b0de642b0 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Typeless; diff --git a/Items/Armor/DesertProwlerHat.cs b/Items/Armor/DesertProwlerHat.cs index 69a9033f3f..ac416c74c4 100644 --- a/Items/Armor/DesertProwlerHat.cs +++ b/Items/Armor/DesertProwlerHat.cs @@ -1,16 +1,12 @@ -using CalamityMod.Buffs.Cooldowns; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class DesertProwlerHat : ModItem { public override void SetStaticDefaults() @@ -35,7 +31,7 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { - player.setBonus = "Ranged attacks deal an extra 2 flat damage\n" + + player.setBonus = "Ranged attacks deal an extra 1 flat damage\n" + "Ranged crits can rarely whip up a sandstorm"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.desertProwler = true; diff --git a/Items/Armor/DesertProwlerShirt.cs b/Items/Armor/DesertProwlerShirt.cs index bb6748f94d..a4cb8035d4 100644 --- a/Items/Armor/DesertProwlerShirt.cs +++ b/Items/Armor/DesertProwlerShirt.cs @@ -1,12 +1,11 @@ using CalamityMod.Items.Materials; -using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body)] + [AutoloadEquip(EquipType.Body)] public class DesertProwlerShirt : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmerBoots.cs index 71e9c18230..9fd55c2784 100644 --- a/Items/Armor/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmerBoots.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; diff --git a/Items/Armor/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmerBreastplate.cs index 19963235bd..c40488a041 100644 --- a/Items/Armor/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmerBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; diff --git a/Items/Armor/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmerVisage.cs index 79848c149e..4c32ddabd7 100644 --- a/Items/Armor/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmerVisage.cs @@ -1,15 +1,13 @@ -using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class FathomSwarmerVisage : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/FearmongerPlateMail.cs b/Items/Armor/FearmongerPlateMail.cs index 5d91d74ac2..0545185bcc 100644 --- a/Items/Armor/FearmongerPlateMail.cs +++ b/Items/Armor/FearmongerPlateMail.cs @@ -1,4 +1,3 @@ -using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body)] + [AutoloadEquip(EquipType.Body)] public class FearmongerPlateMail : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/GodSlayerChestplate.cs b/Items/Armor/GodSlayerChestplate.cs index c6056bf119..8bb99cf580 100644 --- a/Items/Armor/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayerChestplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/GodSlayerHelm.cs b/Items/Armor/GodSlayerHelm.cs index 48eee14bbe..081ac52b0c 100644 --- a/Items/Armor/GodSlayerHelm.cs +++ b/Items/Armor/GodSlayerHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor modPlayer.godSlayerDamage = true; player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + - "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + + "While the cooldown for this effect is active all life regen is disabled\n" + "Taking over 80 damage in one hit will cause you to release a swarm of high-damage god killer darts\n" + "Enemies take a lot of damage when they hit you\n" + "An attack that would deal 80 damage or less will have its damage reduced to 1"; diff --git a/Items/Armor/GodSlayerHelmet.cs b/Items/Armor/GodSlayerHelmet.cs index 9c5e10f08c..17743bb8cf 100644 --- a/Items/Armor/GodSlayerHelmet.cs +++ b/Items/Armor/GodSlayerHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -41,8 +41,8 @@ namespace CalamityMod.Items.Armor modPlayer.godSlayerRanged = true; player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + - "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + - "Your ranged critical hits have a chance to critically hit, causing 4 times the damage\n" + + "While the cooldown for this effect is active all life regen is disabled\n" + + "Your ranged critical hits have a chance to critically hit, causing 4 times the damage\n" + "You have a chance to fire a god killer shrapnel round while firing ranged weapons"; } diff --git a/Items/Armor/GodSlayerHornedHelm.cs b/Items/Armor/GodSlayerHornedHelm.cs index 279998cda0..554ab92943 100644 --- a/Items/Armor/GodSlayerHornedHelm.cs +++ b/Items/Armor/GodSlayerHornedHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; @@ -169,8 +169,8 @@ namespace CalamityMod.Items.Armor player.setBonus = "65% increased minion damage\n" + "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + - "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + - "Hitting enemies will summon god slayer phantoms\n" + + "While the cooldown for this effect is active all life regen is disabled\n" + + "Hitting enemies will summon god slayer phantoms\n" + "Summons a god-eating mechworm to fight for you"; player.minionDamage += 0.65f; } diff --git a/Items/Armor/GodSlayerLeggings.cs b/Items/Armor/GodSlayerLeggings.cs index c7f5a9546b..46c8add575 100644 --- a/Items/Armor/GodSlayerLeggings.cs +++ b/Items/Armor/GodSlayerLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; diff --git a/Items/Armor/GodSlayerMask.cs b/Items/Armor/GodSlayerMask.cs index cf8f6ff59d..9fc064b626 100644 --- a/Items/Armor/GodSlayerMask.cs +++ b/Items/Armor/GodSlayerMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -43,8 +43,8 @@ namespace CalamityMod.Items.Armor modPlayer.wearingRogueArmor = true; player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + - "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + - "While at full HP all of your rogue stats are boosted by 10%\n" + + "While the cooldown for this effect is active all life regen is disabled\n" + + "While at full HP all of your rogue stats are boosted by 10%\n" + "If you take over 80 damage in one hit you will be given extra immunity frames\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 120\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + diff --git a/Items/Armor/GodSlayerVisage.cs b/Items/Armor/GodSlayerVisage.cs index 82599bd18a..1e2ce44e8e 100644 --- a/Items/Armor/GodSlayerVisage.cs +++ b/Items/Armor/GodSlayerVisage.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -42,8 +42,8 @@ namespace CalamityMod.Items.Armor modPlayer.godSlayerMage = true; player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" + "This effect can only occur once every 45 seconds\n" + - "While the cooldown for this effect is active you gain a 10% increase to all damage\n" + - "Enemies will release god slayer flames and healing flames when hit with magic attacks\n" + + "While the cooldown for this effect is active all life regen is disabled\n" + + "Enemies will release god slayer flames and healing flames when hit with magic attacks\n" + "Taking damage will cause you to release a magical god slayer explosion"; } diff --git a/Items/Armor/PlaguebringerCarapace.cs b/Items/Armor/PlaguebringerCarapace.cs index 3287ca0148..066a4dafbb 100644 --- a/Items/Armor/PlaguebringerCarapace.cs +++ b/Items/Armor/PlaguebringerCarapace.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using Terraria; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body)] + [AutoloadEquip(EquipType.Body)] public class PlaguebringerCarapace : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/PlaguebringerPistons.cs b/Items/Armor/PlaguebringerPistons.cs index f1383b7288..6cb56583b8 100644 --- a/Items/Armor/PlaguebringerPistons.cs +++ b/Items/Armor/PlaguebringerPistons.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Legs)] + [AutoloadEquip(EquipType.Legs)] public class PlaguebringerPistons : ModItem { public int counter = 0; diff --git a/Items/Armor/PlaguebringerVisor.cs b/Items/Armor/PlaguebringerVisor.cs index b5b866f3e5..e69ae4cde6 100644 --- a/Items/Armor/PlaguebringerVisor.cs +++ b/Items/Armor/PlaguebringerVisor.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; -using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class PlaguebringerVisor : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/ReaverCap.cs b/Items/Armor/ReaverCap.cs index 546adfb0c3..a090524d3c 100644 --- a/Items/Armor/ReaverCap.cs +++ b/Items/Armor/ReaverCap.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/ReaverCuisses.cs b/Items/Armor/ReaverCuisses.cs index e015a2f62c..d9d5a2e317 100644 --- a/Items/Armor/ReaverCuisses.cs +++ b/Items/Armor/ReaverCuisses.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/ReaverHelm.cs b/Items/Armor/ReaverHelm.cs index 8599ad0dab..2cfc20f457 100644 --- a/Items/Armor/ReaverHelm.cs +++ b/Items/Armor/ReaverHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/ReaverHelmet.cs b/Items/Armor/ReaverHelmet.cs index 4030bf53d2..b85b0044f8 100644 --- a/Items/Armor/ReaverHelmet.cs +++ b/Items/Armor/ReaverHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; diff --git a/Items/Armor/ReaverMask.cs b/Items/Armor/ReaverMask.cs index ec0d2fda32..2c17859d9b 100644 --- a/Items/Armor/ReaverMask.cs +++ b/Items/Armor/ReaverMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/ReaverScaleMail.cs b/Items/Armor/ReaverScaleMail.cs index 241ee046f5..58a6026beb 100644 --- a/Items/Armor/ReaverScaleMail.cs +++ b/Items/Armor/ReaverScaleMail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/ReaverVisage.cs b/Items/Armor/ReaverVisage.cs index 479a3bdec3..e9beadc749 100644 --- a/Items/Armor/ReaverVisage.cs +++ b/Items/Armor/ReaverVisage.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/ShroomiteVisage.cs b/Items/Armor/ShroomiteVisage.cs index ec64249583..acda527210 100644 --- a/Items/Armor/ShroomiteVisage.cs +++ b/Items/Armor/ShroomiteVisage.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/SilvaArmor.cs b/Items/Armor/SilvaArmor.cs index 04afe120b1..1e18325658 100644 --- a/Items/Armor/SilvaArmor.cs +++ b/Items/Armor/SilvaArmor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Armor/SilvaHelm.cs b/Items/Armor/SilvaHelm.cs index 3e3c7331a9..71c350f7b3 100644 --- a/Items/Armor/SilvaHelm.cs +++ b/Items/Armor/SilvaHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 57f5e2eccf..44a7107719 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; diff --git a/Items/Armor/SilvaHornedHelm.cs b/Items/Armor/SilvaHornedHelm.cs index b6b75bdc0d..5b292d01ac 100644 --- a/Items/Armor/SilvaHornedHelm.cs +++ b/Items/Armor/SilvaHornedHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Armor/SilvaLeggings.cs b/Items/Armor/SilvaLeggings.cs index f5fb48f192..ce4cddd912 100644 --- a/Items/Armor/SilvaLeggings.cs +++ b/Items/Armor/SilvaLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; diff --git a/Items/Armor/SilvaMask.cs b/Items/Armor/SilvaMask.cs index a937ccc73f..07cc847b99 100644 --- a/Items/Armor/SilvaMask.cs +++ b/Items/Armor/SilvaMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index 9e1814096b..b36548d93a 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Armor/SnowRuffianChestplate.cs b/Items/Armor/SnowRuffianChestplate.cs index fa20deb3a9..4cd2ad961f 100644 --- a/Items/Armor/SnowRuffianChestplate.cs +++ b/Items/Armor/SnowRuffianChestplate.cs @@ -1,12 +1,10 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body)] + [AutoloadEquip(EquipType.Body)] public class SnowRuffianChestplate : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/SnowRuffianGreaves.cs b/Items/Armor/SnowRuffianGreaves.cs index 28c264575c..ce365b7f4e 100644 --- a/Items/Armor/SnowRuffianGreaves.cs +++ b/Items/Armor/SnowRuffianGreaves.cs @@ -1,12 +1,10 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Legs)] + [AutoloadEquip(EquipType.Legs)] public class SnowRuffianGreaves : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/SnowRuffianMask.cs b/Items/Armor/SnowRuffianMask.cs index ed0e186674..f13475ab7e 100644 --- a/Items/Armor/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffianMask.cs @@ -1,12 +1,11 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class SnowRuffianMask : ModItem { private bool shouldBoost = false; diff --git a/Items/Armor/StatigelArmor.cs b/Items/Armor/StatigelArmor.cs index 8179ae6847..8e5cd4fac1 100644 --- a/Items/Armor/StatigelArmor.cs +++ b/Items/Armor/StatigelArmor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/StatigelCap.cs b/Items/Armor/StatigelCap.cs index f60ec36077..d7f0aa1201 100644 --- a/Items/Armor/StatigelCap.cs +++ b/Items/Armor/StatigelCap.cs @@ -1,13 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.Player; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class StatigelCap : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/StatigelGreaves.cs b/Items/Armor/StatigelGreaves.cs index c3fcc0f3dc..4391101bd5 100644 --- a/Items/Armor/StatigelGreaves.cs +++ b/Items/Armor/StatigelGreaves.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/StatigelHeadgear.cs b/Items/Armor/StatigelHeadgear.cs index b9ac4e47e4..02c79d77f4 100644 --- a/Items/Armor/StatigelHeadgear.cs +++ b/Items/Armor/StatigelHeadgear.cs @@ -1,13 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.Player; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class StatigelHeadgear : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/StatigelHelm.cs b/Items/Armor/StatigelHelm.cs index 9d16912b4b..923b2340a0 100644 --- a/Items/Armor/StatigelHelm.cs +++ b/Items/Armor/StatigelHelm.cs @@ -1,13 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.Player; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class StatigelHelm : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index aa52185569..7fc6b4d38b 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.Player; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class StatigelHood : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/StatigelMask.cs b/Items/Armor/StatigelMask.cs index 1d61ce5748..fa6aa180ce 100644 --- a/Items/Armor/StatigelMask.cs +++ b/Items/Armor/StatigelMask.cs @@ -1,13 +1,12 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.Player; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class StatigelMask : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/SulfurBreastplate.cs b/Items/Armor/SulfurBreastplate.cs index 023a39e54d..05e63bca52 100644 --- a/Items/Armor/SulfurBreastplate.cs +++ b/Items/Armor/SulfurBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Weapons.Rogue; using Terraria; diff --git a/Items/Armor/SulfurHelmet.cs b/Items/Armor/SulfurHelmet.cs index 4ffe68f177..b4882a1266 100644 --- a/Items/Armor/SulfurHelmet.cs +++ b/Items/Armor/SulfurHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Weapons.Rogue; diff --git a/Items/Armor/SulfurLeggings.cs b/Items/Armor/SulfurLeggings.cs index 94fd70f7ab..e67f26394c 100644 --- a/Items/Armor/SulfurLeggings.cs +++ b/Items/Armor/SulfurLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Weapons.Rogue; using Terraria; diff --git a/Items/Armor/TarragonBreastplate.cs b/Items/Armor/TarragonBreastplate.cs index c6bebaa258..209474037e 100644 --- a/Items/Armor/TarragonBreastplate.cs +++ b/Items/Armor/TarragonBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/TarragonHelm.cs b/Items/Armor/TarragonHelm.cs index 24b488fc9c..f9f079167f 100644 --- a/Items/Armor/TarragonHelm.cs +++ b/Items/Armor/TarragonHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/TarragonHelmet.cs b/Items/Armor/TarragonHelmet.cs index eb1d9f64e0..d3a76200bf 100644 --- a/Items/Armor/TarragonHelmet.cs +++ b/Items/Armor/TarragonHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/TarragonHornedHelm.cs b/Items/Armor/TarragonHornedHelm.cs index 351ff9f4dc..ff43b9c950 100644 --- a/Items/Armor/TarragonHornedHelm.cs +++ b/Items/Armor/TarragonHornedHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/TarragonLeggings.cs b/Items/Armor/TarragonLeggings.cs index 4c2bdeed83..486fdeee85 100644 --- a/Items/Armor/TarragonLeggings.cs +++ b/Items/Armor/TarragonLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/TarragonMask.cs b/Items/Armor/TarragonMask.cs index 4d162d5f89..a73d7c459e 100644 --- a/Items/Armor/TarragonMask.cs +++ b/Items/Armor/TarragonMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index 412caff2ad..52835aa915 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/Vanity/ApronOfAffection.cs b/Items/Armor/Vanity/ApronOfAffection.cs index e22f05af4b..ae2fb745c8 100644 --- a/Items/Armor/Vanity/ApronOfAffection.cs +++ b/Items/Armor/Vanity/ApronOfAffection.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/Vanity/CeaselessVoidMask.cs b/Items/Armor/Vanity/CeaselessVoidMask.cs index 1b063be6a7..6dbd98e9c5 100644 --- a/Items/Armor/Vanity/CeaselessVoidMask.cs +++ b/Items/Armor/Vanity/CeaselessVoidMask.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity { diff --git a/Items/Armor/Vanity/RavagerMask.cs b/Items/Armor/Vanity/RavagerMask.cs index fe021ea79f..9d007ff5c8 100644 --- a/Items/Armor/Vanity/RavagerMask.cs +++ b/Items/Armor/Vanity/RavagerMask.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity { diff --git a/Items/Armor/Vanity/SignusMask.cs b/Items/Armor/Vanity/SignusMask.cs index 785769f7a3..7705bfa90e 100644 --- a/Items/Armor/Vanity/SignusMask.cs +++ b/Items/Armor/Vanity/SignusMask.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity { diff --git a/Items/Armor/Vanity/StormWeaverMask.cs b/Items/Armor/Vanity/StormWeaverMask.cs index e77cac7f78..229a902909 100644 --- a/Items/Armor/Vanity/StormWeaverMask.cs +++ b/Items/Armor/Vanity/StormWeaverMask.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Vanity { diff --git a/Items/Armor/VictideBreastplate.cs b/Items/Armor/VictideBreastplate.cs index ced886f11d..00312c7750 100644 --- a/Items/Armor/VictideBreastplate.cs +++ b/Items/Armor/VictideBreastplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/VictideHeadgear.cs b/Items/Armor/VictideHeadgear.cs index b71e5a1622..6cf8618ca4 100644 --- a/Items/Armor/VictideHeadgear.cs +++ b/Items/Armor/VictideHeadgear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/VictideHelm.cs b/Items/Armor/VictideHelm.cs index 7d719dc2bb..7d1d7582b0 100644 --- a/Items/Armor/VictideHelm.cs +++ b/Items/Armor/VictideHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/VictideHelmet.cs b/Items/Armor/VictideHelmet.cs index 27dc554057..8f8c1a1996 100644 --- a/Items/Armor/VictideHelmet.cs +++ b/Items/Armor/VictideHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; diff --git a/Items/Armor/VictideLeggings.cs b/Items/Armor/VictideLeggings.cs index a4a0d24fef..6a9b2fc296 100644 --- a/Items/Armor/VictideLeggings.cs +++ b/Items/Armor/VictideLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/VictideMask.cs b/Items/Armor/VictideMask.cs index 8f38e533f4..8cd1e26784 100644 --- a/Items/Armor/VictideMask.cs +++ b/Items/Armor/VictideMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/VictideVisage.cs b/Items/Armor/VictideVisage.cs index c055636b93..86641b1a04 100644 --- a/Items/Armor/VictideVisage.cs +++ b/Items/Armor/VictideVisage.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/WulfrumArmor.cs b/Items/Armor/WulfrumArmor.cs index c5a633b03d..184f6f3e39 100644 --- a/Items/Armor/WulfrumArmor.cs +++ b/Items/Armor/WulfrumArmor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumHeadgear.cs b/Items/Armor/WulfrumHeadgear.cs index 5b795e227a..6cdfc216f8 100644 --- a/Items/Armor/WulfrumHeadgear.cs +++ b/Items/Armor/WulfrumHeadgear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumHelm.cs b/Items/Armor/WulfrumHelm.cs index ca3324a6b6..6282432f34 100644 --- a/Items/Armor/WulfrumHelm.cs +++ b/Items/Armor/WulfrumHelm.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumHelmet.cs b/Items/Armor/WulfrumHelmet.cs index fb1924bdc5..b5491ec39c 100644 --- a/Items/Armor/WulfrumHelmet.cs +++ b/Items/Armor/WulfrumHelmet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumHood.cs b/Items/Armor/WulfrumHood.cs index eb45a6550b..ae10a22c7e 100644 --- a/Items/Armor/WulfrumHood.cs +++ b/Items/Armor/WulfrumHood.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumLeggings.cs b/Items/Armor/WulfrumLeggings.cs index 7616a914df..b769ea91a3 100644 --- a/Items/Armor/WulfrumLeggings.cs +++ b/Items/Armor/WulfrumLeggings.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/WulfrumMask.cs b/Items/Armor/WulfrumMask.cs index c87bb01370..75e87db6d0 100644 --- a/Items/Armor/WulfrumMask.cs +++ b/Items/Armor/WulfrumMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/XerocCuisses.cs b/Items/Armor/XerocCuisses.cs index 78a8171871..7d20d317bd 100644 --- a/Items/Armor/XerocCuisses.cs +++ b/Items/Armor/XerocCuisses.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index 8cff77074b..679aa57301 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Armor/XerocPlateMail.cs b/Items/Armor/XerocPlateMail.cs index 98fc0c6407..3d439a6533 100644 --- a/Items/Armor/XerocPlateMail.cs +++ b/Items/Armor/XerocPlateMail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 02269482a1..f9f9e257c4 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -27,15 +27,15 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; namespace CalamityMod.Items { - public class CalamityGlobalItem : GlobalItem + public class CalamityGlobalItem : GlobalItem { #region Instances public override bool InstancePerEntity @@ -55,17 +55,39 @@ namespace CalamityMod.Items } #endregion - public bool rogue = false; + public bool rogue = false; + public float StealthGenBonus; - public int timesUsed = 0; + public int timesUsed = 0; - // Rarity is provided both as the classic int and the new enum. - public CalamityRarity customRarity = CalamityRarity.NoEffect; - public int postMoonLordRarity - { - get => (int)customRarity; - set => customRarity = (CalamityRarity)value; - } + // Rarity is provided both as the classic int and the new enum. + public CalamityRarity customRarity = CalamityRarity.NoEffect; + public int postMoonLordRarity + { + get => (int)customRarity; + set => customRarity = (CalamityRarity)value; + } + + ///See RogueWeapon.cs for rogue modifier shit + #region Modifiers + public CalamityGlobalItem() + { + StealthGenBonus = 1f; + } + + public override GlobalItem Clone(Item item, Item itemClone) + { + CalamityGlobalItem myClone = (CalamityGlobalItem)base.Clone(item, itemClone); + myClone.StealthGenBonus = StealthGenBonus; + return myClone; + } + + public override bool NewPreReforge(Item item) + { + StealthGenBonus = 1f; + return true; + } + #endregion #region SetDefaults public override void SetDefaults(Item item) @@ -113,7 +135,7 @@ namespace CalamityMod.Items 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.6); + item.damage = (int)(item.damage * 0.65); else if (item.type == ItemID.StardustDragonStaff) item.damage = (int)(item.damage * 0.5); @@ -300,7 +322,7 @@ namespace CalamityMod.Items { if (player.whoAmI == Main.myPlayer) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)player.position.X, (int)player.position.Y); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(player.velocity.X, player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -949,12 +971,14 @@ namespace CalamityMod.Items { if (!Collision.SolidCollision(teleportLocation, player.width, player.height)) { + int duration = CalamityPlayer.chaosStateDuration; + if (CalamityPlayer.areThereAnyDamnBosses || CalamityPlayer.areThereAnyDamnEvents) + duration = CalamityPlayer.chaosStateDurationBoss; if (modPlayer.eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(CalamityPlayer.chaosStateDuration * 1.5), true); + duration = (int)(CalamityPlayer.chaosStateDuration * 1.5); else if (modPlayer.scarfCooldown) - player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration, true); + duration = CalamityPlayer.chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); } } } @@ -965,6 +989,7 @@ namespace CalamityMod.Items #region Modify Tooltips public override void ModifyTooltips(Item item, List tooltips) { + #region Custom Rarities# TooltipLine tt2 = tooltips.FirstOrDefault(x => x.Name == "ItemName" && x.mod == "Terraria"); if (tt2 != null) { @@ -1086,6 +1111,25 @@ namespace CalamityMod.Items break; } } + #endregion + + #region Accessory Modifier Display + if (item.accessory) + { + if (!item.social && item.prefix > 0) + { + float stealthGenBoost = item.Calamity().StealthGenBonus - 1f; + if (stealthGenBoost > 0) + { + TooltipLine StealthGen = new TooltipLine(mod, "PrefixStealthGenBoost", "+" + Math.Round(stealthGenBoost * 100f) + "% stealth generation") + { + isModifier = true + }; + tooltips.Add(StealthGen); + } + } + } + #endregion /*if (item.ammo == 97) { @@ -1105,8 +1149,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Teleports you to the position of the mouse\n" + - "Teleportation is disabled while Chaos State is active"; + line2.text += "\nTeleportation is disabled while Chaos State is active"; } } } @@ -1116,8 +1159,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Capable of soaking up an endless amount of water\n" + - "Cannot be used in the Abyss"; + line2.text += "\nCannot be used in the Abyss"; } } } @@ -1127,8 +1169,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Defense") { - line2.text = "1 defense\n" + - "Cannot be used in the Abyss"; + line2.text += "\nCannot be used in the Abyss"; } } } @@ -1138,8 +1179,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Summons a heart to provide light\n" + - "Provides a small amount of light in the abyss"; + line2.text += "\nProvides a small amount of light in the abyss"; } } } @@ -1149,8 +1189,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Creates a magical shadow orb\n" + - "Provides a small amount of light in the abyss"; + line2.text += "\nProvides a small amount of light in the abyss"; } } } @@ -1160,8 +1199,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Summons a magic lantern that exposes nearby treasure\n" + - "Provides a small amount of light in the abyss"; + line2.text += "\nProvides a small amount of light in the abyss"; } } } @@ -1171,8 +1209,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { - line2.text = "Provides light under water and extra mobility on ice\n" + - "Provides a small amount of light in the abyss\n" + + line2.text += "\nProvides a small amount of light in the abyss\n" + "Moderately reduces breath loss in the abyss"; } } @@ -1183,8 +1220,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Provides light under water\n" + - "Provides a small amount of light in the abyss"; + line2.text += "\nProvides a small amount of light in the abyss"; } } } @@ -1194,8 +1230,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { - line2.text = "Provides light under water\n" + - "Provides a small amount of light in the abyss"; + line2.text += "\nProvides a small amount of light in the abyss"; } } } @@ -1205,8 +1240,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Summons a magical fairy\n" + - "Provides a moderate amount of light in the abyss"; + line2.text += "\nProvides a moderate amount of light in the abyss"; } } } @@ -1216,8 +1250,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Summons a pet flickerwick to provide light\n" + - "Provides a moderate amount of light in the abyss"; + line2.text += "\nProvides a moderate amount of light in the abyss"; } } } @@ -1227,8 +1260,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "BuffTime") { - line2.text = "5 minute duration\n" + - "Provides a moderate amount of light in the abyss"; + line2.text += "\nProvides a moderate amount of light in the abyss"; } } } @@ -1238,8 +1270,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Summons a Wisp to provide light\n" + - "Provides a large amount of light in the abyss"; + line2.text += "\nProvides a large amount of light in the abyss"; } } } @@ -1249,8 +1280,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { - line2.text = "'I know what you're thinking...'\n" + - "Provides a large amount of light in the abyss"; + line2.text += "\nProvides a large amount of light in the abyss"; } } } @@ -1260,8 +1290,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "BuffTime") { - line2.text = "2 minute duration\n" + - "Greatly reduces breath loss in the abyss"; + line2.text += "\nGreatly reduces breath loss in the abyss"; } } } @@ -1271,30 +1300,17 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Greatly extends underwater breathing\n" + - "Moderately reduces breath loss in the abyss"; + line2.text += "\nModerately reduces breath loss in the abyss"; } } } - if (item.type == ItemID.NeptunesShell) + if (item.type == ItemID.NeptunesShell || item.type == ItemID.MoonShell) { foreach (TooltipLine line2 in tooltips) { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Transforms the holder into merfolk when entering water\n" + - "Greatly reduces breath loss in the abyss"; - } - } - } - if (item.type == ItemID.MoonShell) - { - foreach (TooltipLine line2 in tooltips) - { - if (line2.mod == "Terraria" && line2.Name == "Tooltip0") - { - line2.text = "Turns the holder into a werewolf at night and a merfolk when entering water\n" + - "Greatly reduces breath loss in the abyss"; + line2.text += "\nGreatly reduces breath loss in the abyss"; } } } @@ -1304,8 +1320,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { - line2.text = "Minor increases to all stats\n" + - "Greatly reduces breath loss in the abyss"; + line2.text += "\nGreatly reduces breath loss in the abyss"; } } } @@ -1315,8 +1330,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Reduces damage from cold sources\n" + - "Makes you immune to the Chilled, Frozen, and Glacial State debuffs\n" + + line2.text += "\nMakes you immune to the Chilled, Frozen, and Glacial State debuffs\n" + "Provides cold protection in Death Mode"; } } @@ -1411,13 +1425,44 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.FireGauntlet) + if (item.type == ItemID.TitanGlove) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip0") + { + line2.text += "\n25% increased true melee damage"; + } + } + } + if (item.type == ItemID.PowerGlove) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text += "\n25% increased true melee damage"; + } + } + } + if (item.type == ItemID.MechanicalGlove) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Tooltip1") + { + line2.text += "\n25% increased true melee damage"; + } + } + } + if (item.type == ItemID.FireGauntlet) { foreach (TooltipLine line2 in tooltips) { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { line2.text = "14% increased melee damage and speed\n" + + "25% increased true melee damage\n" + "Provides heat and cold protection in Death Mode"; } } @@ -1474,8 +1519,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Provides 7 seconds of immunity to lava\n" + - "Provides heat protection in Death Mode"; + line2.text += "\nProvides heat protection in Death Mode"; } } } @@ -1485,8 +1529,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip1") { - line2.text = "Grants immunity to fire blocks and 7 seconds of immunity to lava\n" + - "Provides heat protection in Death Mode"; + line2.text += "\nProvides heat protection in Death Mode"; } } } @@ -1496,8 +1539,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Grants invisibility\n" + - "Boosts certain stats when holding certain types of rogue weapons"; + line2.text += "\nBoosts certain stats when holding certain types of rogue weapons"; } } } @@ -1518,8 +1560,8 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { - line2.text = "Capable of mining Lihzahrd Bricks\n" + - "Also capable of mining Scoria Ore found in the Abyss"; + // I'm leaving this intentionally ambiguous so that people have to search for Scoria Ore + line2.text = "Capable of mining Lihzahrd Bricks and Scoria Ore"; } } } @@ -1567,7 +1609,23 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings) + + if (Main.player[Main.myPlayer].Calamity().trueMeleeDamage > 0D) + { + if (item.melee && item.damage > 0) + { + foreach (TooltipLine line2 in tooltips) + { + if (line2.mod == "Terraria" && line2.Name == "Damage") + { + line2.text += " : " + string.Concat((int)(Main.player[Main.myPlayer].Calamity().actualMeleeDamageStat * item.damage * + (1D + Main.player[Main.myPlayer].Calamity().trueMeleeDamage) + 5E-06f)) + " true melee damage"; + } + } + } + } + + if (item.type == ItemID.MeteorHelmet || item.type == ItemID.MeteorSuit || item.type == ItemID.MeteorLeggings) { foreach (TooltipLine line2 in tooltips) { @@ -1657,7 +1715,7 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) + if (item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) { if (!Main.player[Main.myPlayer].Calamity().forbiddenCirclet) { @@ -1665,8 +1723,7 @@ namespace CalamityMod.Items { if (line2.mod == "Terraria" && line2.Name == "SetBonus") { - line2.text = "Set Bonus: Double tap " + (Main.ReversedUpDownArmorSetBonuses ? "UP" : "DOWN") + " to call an ancient storm to the cursor location\n" + - "Minions deal full damage while wielding magic weapons"; + line2.text += "\nMinions deal full damage while wielding magic weapons"; } } } @@ -1737,13 +1794,14 @@ namespace CalamityMod.Items } } } - if (item.type == ItemID.MoltenHelmet || item.type == ItemID.MoltenBreastplate || item.type == ItemID.MoltenGreaves) + if (item.type == ItemID.MoltenHelmet || item.type == ItemID.MoltenBreastplate || item.type == ItemID.MoltenGreaves) { foreach (TooltipLine line2 in tooltips) { if (line2.mod == "Terraria" && line2.Name == "SetBonus") { line2.text = @"Set Bonus: 17% extra melee damage +30% extra true melee damage Grants immunity to fire blocks, and temporary immunity to lava Provides heat and cold protection in Death Mode"; } @@ -2671,11 +2729,11 @@ Provides heat and cold protection in Death Mode"; } } } - #endregion + #endregion - // NOTE: this function applies to all treasure bags, even modded ones (despite the name). - #region Boss Bag Changes - public override void OpenVanillaBag(string context, Player player, int arg) + // NOTE: this function applies to all treasure bags, even modded ones (despite the name). + #region Boss Bag Changes + public override void OpenVanillaBag(string context, Player player, int arg) { if (context == "crate") { @@ -2767,7 +2825,7 @@ Provides heat and cold protection in Death Mode"; DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 4); - DropHelper.DropItemFromSetChance(player, 5, ItemID.CorruptionKey, ItemID.CrimsonKey); + DropHelper.DropItemFromSetChance(player, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey); DropHelper.DropItemCondition(player, ModContent.ItemType(), !CalamityWorld.demonMode); // Demon Trophy break; @@ -2779,7 +2837,7 @@ Provides heat and cold protection in Death Mode"; // Plantera case ItemID.PlanteraBossBag: - DropHelper.DropItem(player, ModContent.ItemType(), 8, 11); + DropHelper.DropItem(player, ModContent.ItemType(), 16, 22); float bFluxChance = DropHelper.LegendaryDropRateFloat; DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge, bFluxChance); DropHelper.DropItemChance(player, ItemID.JungleKey, 5); @@ -2955,6 +3013,15 @@ Provides heat and cold protection in Death Mode"; { CalamityPlayer modPlayer = player.Calamity(); + if (item.prefix > 0) + { + float stealthGenBoost = item.Calamity().StealthGenBonus - 1f; + if (stealthGenBoost > 0) + { + modPlayer.accStealthGenBoost += stealthGenBoost; + } + } + if (item.type == ItemID.FireGauntlet) { player.meleeDamage += 0.04f; diff --git a/Items/Critters/BabyFlakHermit.cs b/Items/Critters/BabyFlakHermit.cs index a7a586fbca..fd00124e2a 100644 --- a/Items/Critters/BabyFlakHermit.cs +++ b/Items/Critters/BabyFlakHermit.cs @@ -1,6 +1,7 @@ using CalamityMod.NPCs.AcidRain; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Critters { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/Critters/BabyGhostBellItem.cs b/Items/Critters/BabyGhostBellItem.cs index e1a4250d1d..f55443fb8c 100644 --- a/Items/Critters/BabyGhostBellItem.cs +++ b/Items/Critters/BabyGhostBellItem.cs @@ -1,6 +1,7 @@ using CalamityMod.NPCs.SunkenSea; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Critters { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/Critters/PiggyItem.cs b/Items/Critters/PiggyItem.cs index 9cb6f11ef1..a323645466 100644 --- a/Items/Critters/PiggyItem.cs +++ b/Items/Critters/PiggyItem.cs @@ -1,5 +1,6 @@ using CalamityMod.NPCs.NormalNPCs; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Critters @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/Critters/SeaMinnowItem.cs b/Items/Critters/SeaMinnowItem.cs index 11565c06cb..8ac32c7b8c 100644 --- a/Items/Critters/SeaMinnowItem.cs +++ b/Items/Critters/SeaMinnowItem.cs @@ -1,5 +1,6 @@ using CalamityMod.NPCs.SunkenSea; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Critters @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/Critters/TwinklerItem.cs b/Items/Critters/TwinklerItem.cs index db7cc03a0b..8539221ec8 100644 --- a/Items/Critters/TwinklerItem.cs +++ b/Items/Critters/TwinklerItem.cs @@ -1,5 +1,6 @@ -using CalamityMod.NPCs.Astral; +using CalamityMod.NPCs.Astral; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Critters @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Critters public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/DifficultyItems/Armageddon.cs b/Items/DifficultyItems/Armageddon.cs index f022838ebf..c452c64f25 100644 --- a/Items/DifficultyItems/Armageddon.cs +++ b/Items/DifficultyItems/Armageddon.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.DifficultyItems item.height = 28; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item123; item.consumable = false; } diff --git a/Items/DifficultyItems/Death.cs b/Items/DifficultyItems/Death.cs index 41cc8234d4..406156cfad 100644 --- a/Items/DifficultyItems/Death.cs +++ b/Items/DifficultyItems/Death.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -35,7 +35,7 @@ namespace CalamityMod.Items.DifficultyItems item.height = 28; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item119; item.consumable = false; } diff --git a/Items/DifficultyItems/DefiledRune.cs b/Items/DifficultyItems/DefiledRune.cs index 0edea71292..da9bc37a5c 100644 --- a/Items/DifficultyItems/DefiledRune.cs +++ b/Items/DifficultyItems/DefiledRune.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.DifficultyItems item.height = 28; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item100; item.consumable = false; } diff --git a/Items/DifficultyItems/IronHeart.cs b/Items/DifficultyItems/IronHeart.cs index af185ba0a3..eb3d38a3c2 100644 --- a/Items/DifficultyItems/IronHeart.cs +++ b/Items/DifficultyItems/IronHeart.cs @@ -1,15 +1,14 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.DifficultyItems { - public class IronHeart : ModItem + public class IronHeart : ModItem { public override void SetStaticDefaults() { @@ -28,7 +27,7 @@ namespace CalamityMod.Items.DifficultyItems item.rare = 9; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item119; item.consumable = false; } diff --git a/Items/DifficultyItems/MLGRune.cs b/Items/DifficultyItems/MLGRune.cs index 6c5caf05ec..2903b8fa98 100644 --- a/Items/DifficultyItems/MLGRune.cs +++ b/Items/DifficultyItems/MLGRune.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.DifficultyItems item.rare = 1; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item119; item.consumable = true; } diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index 536cf77c49..a681d76e41 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -19,8 +19,6 @@ namespace CalamityMod.Items.DifficultyItems "Activates adrenaline. When adrenaline is maxed press B to activate adrenaline mode.\n" + "You gain adrenaline whenever a boss is alive. Getting hit drops adrenaline back to 0.\n" + "All enemies drop 50% more cash.\n" + - "All enemies gain a new damage reduction stat, which can be reduced by applying various debuffs to them.\n" + - "The amount of this damage reduction stat varies based on enemy type.\n" + "Makes certain enemies immune to life steal and nerfs the effectiveness of life steal.\n" + "Increases enemy damage by 25% and spawn rates by 15%.\n" + "Nerfs the effectiveness of the Titanium Armor set bonus.\n" + @@ -40,7 +38,7 @@ namespace CalamityMod.Items.DifficultyItems item.height = 28; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 11; item.UseSound = SoundID.Item119; item.consumable = false; diff --git a/Items/Dyes/DragonSoulDye.cs b/Items/Dyes/DragonSoulDye.cs index e5ff29b85c..7e6f265b0c 100644 --- a/Items/Dyes/DragonSoulDye.cs +++ b/Items/Dyes/DragonSoulDye.cs @@ -4,11 +4,10 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Graphics.Shaders; -using Microsoft.Xna.Framework; namespace CalamityMod.Items.Dyes { - public class DragonSoulDye : BaseDye + public class DragonSoulDye : BaseDye { public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref(mod.GetEffect("Effects/Dyes/DragonSoulDyeShader")), "DyePass"); public override void SafeSetStaticDefaults() diff --git a/Items/Dyes/HairDye/AdrenalineHairDye.cs b/Items/Dyes/HairDye/AdrenalineHairDye.cs index 6d07db5548..da4103197d 100644 --- a/Items/Dyes/HairDye/AdrenalineHairDye.cs +++ b/Items/Dyes/HairDye/AdrenalineHairDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes.HairDye item.value = Item.buyPrice(gold: 7, silver: 50); item.rare = 2; item.UseSound = SoundID.Item3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.useTurn = true; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Dyes/HairDye/RageHairDye.cs b/Items/Dyes/HairDye/RageHairDye.cs index 373d925b3c..d9da0f6f72 100644 --- a/Items/Dyes/HairDye/RageHairDye.cs +++ b/Items/Dyes/HairDye/RageHairDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes.HairDye item.value = Item.buyPrice(gold: 7, silver: 50); item.rare = 2; item.UseSound = SoundID.Item3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.useTurn = true; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Dyes/HairDye/StealthHairDye.cs b/Items/Dyes/HairDye/StealthHairDye.cs index ef877f9d33..bd0da7a33c 100644 --- a/Items/Dyes/HairDye/StealthHairDye.cs +++ b/Items/Dyes/HairDye/StealthHairDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes.HairDye item.value = Item.buyPrice(gold: 5); item.rare = 2; item.UseSound = SoundID.Item3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.useTurn = true; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Dyes/HairDye/WingTimeHairDye.cs b/Items/Dyes/HairDye/WingTimeHairDye.cs index 7f77cefa55..74baadd340 100644 --- a/Items/Dyes/HairDye/WingTimeHairDye.cs +++ b/Items/Dyes/HairDye/WingTimeHairDye.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Dyes.HairDye item.value = Item.buyPrice(gold: 7, silver: 50); item.rare = 2; item.UseSound = SoundID.Item3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.useTurn = true; item.useAnimation = 17; item.useTime = 17; diff --git a/Items/Dyes/ReaverDye.cs b/Items/Dyes/ReaverDye.cs index 80379e10db..6c297af31c 100644 --- a/Items/Dyes/ReaverDye.cs +++ b/Items/Dyes/ReaverDye.cs @@ -2,14 +2,13 @@ using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent.Dyes; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Dyes { - public class ReaverDye : BaseDye + public class ReaverDye : BaseDye { public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref(mod.GetEffect("Effects/Dyes/ReaverDyeShader")), "DyePass"). UseColor(new Color(54, 164, 66)).UseSecondaryColor(new Color(224, 115, 65)); diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 4688312ba9..1011abd771 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -38,13 +38,10 @@ namespace CalamityMod.Items.Fishing.AstralCatches item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { diff --git a/Items/Fishing/AstralCatches/GacruxianMollusk.cs b/Items/Fishing/AstralCatches/GacruxianMollusk.cs index dbc94665e7..f8d29162a1 100644 --- a/Items/Fishing/AstralCatches/GacruxianMollusk.cs +++ b/Items/Fishing/AstralCatches/GacruxianMollusk.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches item.autoReuse = true; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 24; item.height = 22; item.UseSound = SoundID.Item1; diff --git a/Items/Fishing/AstralCatches/PolarisParrotfish.cs b/Items/Fishing/AstralCatches/PolarisParrotfish.cs index 01c7dea67c..47c23f02f7 100644 --- a/Items/Fishing/AstralCatches/PolarisParrotfish.cs +++ b/Items/Fishing/AstralCatches/PolarisParrotfish.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.AstralCatches @@ -19,13 +20,13 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetDefaults() { - item.damage = 60; + item.damage = 50; item.ranged = true; item.width = 38; item.height = 34; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 36, 0, 0); @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches } else if (modPlayer.polarisBoostTwo) //Splits on enemy or tile hits { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)damage * 1.25), knockBack, player.whoAmI, 0f, 1f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * 1.25), knockBack, player.whoAmI, 0f, 1f); return false; } return true; diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index e4d965dc09..4ea4280573 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -27,7 +27,7 @@ The life regen boost is stronger if below 75% health"); item.Calamity().customRarity = CalamityRarity.PureGreen; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.healLife = 240; diff --git a/Items/Fishing/BrimstoneCragCatches/Brimlish.cs b/Items/Fishing/BrimstoneCragCatches/Brimlish.cs index 8f53a2f973..0c9d4919f3 100644 --- a/Items/Fishing/BrimstoneCragCatches/Brimlish.cs +++ b/Items/Fishing/BrimstoneCragCatches/Brimlish.cs @@ -1,4 +1,3 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.World; diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index 44cf91737b..0d0297c164 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -28,13 +28,10 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { diff --git a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs index 7bbc9dc760..f46acb0f1b 100644 --- a/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs +++ b/Items/Fishing/BrimstoneCragCatches/DragoonDrizzlefish.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.BrimstoneCragCatches { - public class DragoonDrizzlefish : ModItem + public class DragoonDrizzlefish : ModItem { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ Revenge is a dish best served flaming hot"); item.height = 30; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Fishing/EnchantedStarfish.cs b/Items/Fishing/EnchantedStarfish.cs index 908c661ced..a03b216588 100644 --- a/Items/Fishing/EnchantedStarfish.cs +++ b/Items/Fishing/EnchantedStarfish.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using Terraria.GameContent.Achievements; namespace CalamityMod.Items.Fishing { - public class EnchantedStarfish : ModItem + public class EnchantedStarfish : ModItem { public override void SetStaticDefaults() { @@ -22,7 +19,7 @@ namespace CalamityMod.Items.Fishing item.height = 26; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item29; item.consumable = true; item.maxStack = 999; diff --git a/Items/Fishing/FishingRods/ChaoticSpreadRod.cs b/Items/Fishing/FishingRods/ChaoticSpreadRod.cs index 8aa6ced860..03e7544814 100644 --- a/Items/Fishing/FishingRods/ChaoticSpreadRod.cs +++ b/Items/Fishing/FishingRods/ChaoticSpreadRod.cs @@ -1,14 +1,12 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class ChaoticSpreadRod : ModItem + public class ChaoticSpreadRod : ModItem { public override void SetStaticDefaults() { @@ -25,7 +23,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 45; item.shootSpeed = 17f; diff --git a/Items/Fishing/FishingRods/EarlyBloomRod.cs b/Items/Fishing/FishingRods/EarlyBloomRod.cs index d174f6aa54..a7078b63f2 100644 --- a/Items/Fishing/FishingRods/EarlyBloomRod.cs +++ b/Items/Fishing/FishingRods/EarlyBloomRod.cs @@ -1,14 +1,12 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class EarlyBloomRod : ModItem + public class EarlyBloomRod : ModItem { public override void SetStaticDefaults() { @@ -24,7 +22,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 60; item.shootSpeed = 18f; diff --git a/Items/Fishing/FishingRods/FeralDoubleRod.cs b/Items/Fishing/FishingRods/FeralDoubleRod.cs index d638eec2cc..b9bdacfe92 100644 --- a/Items/Fishing/FishingRods/FeralDoubleRod.cs +++ b/Items/Fishing/FishingRods/FeralDoubleRod.cs @@ -1,14 +1,12 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class FeralDoubleRod : ModItem + public class FeralDoubleRod : ModItem { public override void SetStaticDefaults() { @@ -24,8 +22,8 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; - item.UseSound = SoundID.Item1; + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; item.fishingPole = 40; item.shootSpeed = 16f; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Fishing/FishingRods/HeronRod.cs b/Items/Fishing/FishingRods/HeronRod.cs index cad4f62081..ae62ac9f15 100644 --- a/Items/Fishing/FishingRods/HeronRod.cs +++ b/Items/Fishing/FishingRods/HeronRod.cs @@ -1,14 +1,11 @@ using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class HeronRod : ModItem + public class HeronRod : ModItem { public override void SetStaticDefaults() { @@ -25,7 +22,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 25; item.shootSpeed = 14.5f; diff --git a/Items/Fishing/FishingRods/NavyFishingRod.cs b/Items/Fishing/FishingRods/NavyFishingRod.cs index 31a6df3557..7537f507ae 100644 --- a/Items/Fishing/FishingRods/NavyFishingRod.cs +++ b/Items/Fishing/FishingRods/NavyFishingRod.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 20; item.shootSpeed = 13f; diff --git a/Items/Fishing/FishingRods/SlurperPole.cs b/Items/Fishing/FishingRods/SlurperPole.cs index 289ab66039..006e401ef5 100644 --- a/Items/Fishing/FishingRods/SlurperPole.cs +++ b/Items/Fishing/FishingRods/SlurperPole.cs @@ -1,14 +1,10 @@ using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class SlurperPole : ModItem + public class SlurperPole : ModItem { public override void SetStaticDefaults() { @@ -24,7 +20,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 25; item.shootSpeed = 14f; diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 6390c1e957..c10b6d1942 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -1,14 +1,12 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class TheDevourerofCods : ModItem + public class TheDevourerofCods : ModItem { public override void SetStaticDefaults() { @@ -24,7 +22,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 75; item.shootSpeed = 20f; diff --git a/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs b/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs index 21ac4728a0..68ecff6c5e 100644 --- a/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs +++ b/Items/Fishing/FishingRods/VerstaltiteFishingRod.cs @@ -1,14 +1,11 @@ using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class VerstaltiteFishingRod : ModItem + public class VerstaltiteFishingRod : ModItem { public override void SetStaticDefaults() { @@ -24,7 +21,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.fishingPole = 35; item.shootSpeed = 15f; diff --git a/Items/Fishing/FishingRods/WulfrumRod.cs b/Items/Fishing/FishingRods/WulfrumRod.cs index bad16d5d96..1558f8f1ac 100644 --- a/Items/Fishing/FishingRods/WulfrumRod.cs +++ b/Items/Fishing/FishingRods/WulfrumRod.cs @@ -1,14 +1,11 @@ using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Materials; namespace CalamityMod.Items.Fishing.FishingRods { - public class WulfrumRod : ModItem + public class WulfrumRod : ModItem { public override void SetStaticDefaults() { @@ -23,7 +20,7 @@ namespace CalamityMod.Items.Fishing.FishingRods item.height = 28; item.useAnimation = 8; item.useTime = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 1; item.fishingPole = 10; diff --git a/Items/Fishing/Spadefish.cs b/Items/Fishing/Spadefish.cs index c7243ea999..08233aa541 100644 --- a/Items/Fishing/Spadefish.cs +++ b/Items/Fishing/Spadefish.cs @@ -1,11 +1,10 @@ -using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Fishing { - public class Spadefish : ModItem + public class Spadefish : ModItem { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Fishing item.useAnimation = 20; item.useTurn = true; item.pick = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index ee7d0da02a..feee04676e 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -1,9 +1,12 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Accessories; using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; -using CalamityMod.Items.SummonItems.Invasion; using CalamityMod.Items.Potions; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Abyss; using CalamityMod.World; using Terraria; @@ -12,7 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.SulphurCatches { - public class AbyssalCrate : ModItem + public class AbyssalCrate : ModItem { public override void SetStaticDefaults() { @@ -33,13 +36,10 @@ namespace CalamityMod.Items.Fishing.SulphurCatches item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { @@ -76,8 +76,25 @@ namespace CalamityMod.Items.Fishing.SulphurCatches DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); } + // Weapons + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.2f, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType()); + + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain, 0.2f, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType()); + // Equipment - DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.25f, + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.4f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicSandfish.cs b/Items/Fishing/SunkenSeaCatches/EutrophicSandfish.cs index 9b1da30bc0..b81ec1af9e 100644 --- a/Items/Fishing/SunkenSeaCatches/EutrophicSandfish.cs +++ b/Items/Fishing/SunkenSeaCatches/EutrophicSandfish.cs @@ -1,4 +1,3 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.World; diff --git a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs index debc71e67d..f22ab9ecdb 100644 --- a/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs +++ b/Items/Fishing/SunkenSeaCatches/SerpentsBite.cs @@ -1,5 +1,3 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs index b11ceb83a6..dcd99fb03c 100644 --- a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs +++ b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs @@ -3,7 +3,6 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Fishing.SunkenSeaCatches { @@ -32,7 +31,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches item.useTime = 20; item.useAnimation = 20; item.UseSound = SoundID.Item13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.shootSpeed = 14f; item.shoot = ModContent.ProjectileType(); item.value = Item.sellPrice(silver: 40); diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index 027f00b0db..ca9397f4e0 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -1,12 +1,9 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Critters; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Ores; -using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.SunkenSea; using CalamityMod.World; @@ -16,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Fishing.SunkenSeaCatches { - public class SunkenCrate : ModItem + public class SunkenCrate : ModItem { public override void SetStaticDefaults() { @@ -37,13 +34,10 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { diff --git a/Items/Fishing/SunkenSeaCatches/SurfClam.cs b/Items/Fishing/SunkenSeaCatches/SurfClam.cs index 8cbde92510..79010ed121 100644 --- a/Items/Fishing/SunkenSeaCatches/SurfClam.cs +++ b/Items/Fishing/SunkenSeaCatches/SurfClam.cs @@ -1,4 +1,3 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.World; diff --git a/Items/Fishing/Xerocodile.cs b/Items/Fishing/Xerocodile.cs index 9dea592038..7744739e0b 100644 --- a/Items/Fishing/Xerocodile.cs +++ b/Items/Fishing/Xerocodile.cs @@ -1,11 +1,10 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.Items.Materials; -using CalamityMod.Items.Accessories; namespace CalamityMod.Items.Fishing { - public class Xerocodile : ModItem + public class Xerocodile : ModItem { public override void SetStaticDefaults() { diff --git a/Items/LoreItems/KnowledgeAquaticScourge.cs b/Items/LoreItems/KnowledgeAquaticScourge.cs index aed2022fa1..725d3ce13d 100644 --- a/Items/LoreItems/KnowledgeAquaticScourge.cs +++ b/Items/LoreItems/KnowledgeAquaticScourge.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeAstralInfection.cs b/Items/LoreItems/KnowledgeAstralInfection.cs index 934ca387cb..f9658bb9d2 100644 --- a/Items/LoreItems/KnowledgeAstralInfection.cs +++ b/Items/LoreItems/KnowledgeAstralInfection.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeAstrumAureus.cs b/Items/LoreItems/KnowledgeAstrumAureus.cs index 21f587688c..7b1d99ae7d 100644 --- a/Items/LoreItems/KnowledgeAstrumAureus.cs +++ b/Items/LoreItems/KnowledgeAstrumAureus.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeAstrumDeus.cs b/Items/LoreItems/KnowledgeAstrumDeus.cs index 7cf9d588fd..e892c5c7e8 100644 --- a/Items/LoreItems/KnowledgeAstrumDeus.cs +++ b/Items/LoreItems/KnowledgeAstrumDeus.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeBloodMoon.cs b/Items/LoreItems/KnowledgeBloodMoon.cs index 86a131d90d..cca166340f 100644 --- a/Items/LoreItems/KnowledgeBloodMoon.cs +++ b/Items/LoreItems/KnowledgeBloodMoon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index e52ed1af9e..4e6a899dbb 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.LoreItems item.height = 20; item.rare = 2; item.autoReuse = false; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.UseSound = SoundID.Item8; @@ -61,7 +61,7 @@ namespace CalamityMod.Items.LoreItems if ((Main.tile[num275, num276].wall != 87 || (double)num276 <= Main.worldSurface || NPC.downedPlantBoss) && !Collision.SolidCollision(vector31, player.width, player.height)) { player.Teleport(vector31, 1, 0); - NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, vector31.X, vector31.Y, 1, 0, 0); + NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, (float)player.whoAmI, vector31.X, vector31.Y, 1, 0, 0); player.AddBuff(BuffID.ChaosState, 480, true); player.AddBuff(BuffID.Confused, 150, true); } diff --git a/Items/LoreItems/KnowledgeBrimstoneCrag.cs b/Items/LoreItems/KnowledgeBrimstoneCrag.cs index c953bdf3f0..63cd439712 100644 --- a/Items/LoreItems/KnowledgeBrimstoneCrag.cs +++ b/Items/LoreItems/KnowledgeBrimstoneCrag.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.cs b/Items/LoreItems/KnowledgeBrimstoneElemental.cs index fbb16afa8e..336c1e75a2 100644 --- a/Items/LoreItems/KnowledgeBrimstoneElemental.cs +++ b/Items/LoreItems/KnowledgeBrimstoneElemental.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeBumblebirb.cs b/Items/LoreItems/KnowledgeBumblebirb.cs index 21bbc9ae27..248f5dcd0d 100644 --- a/Items/LoreItems/KnowledgeBumblebirb.cs +++ b/Items/LoreItems/KnowledgeBumblebirb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeCalamitas.cs b/Items/LoreItems/KnowledgeCalamitas.cs index 233470f8e3..a4f20b294d 100644 --- a/Items/LoreItems/KnowledgeCalamitas.cs +++ b/Items/LoreItems/KnowledgeCalamitas.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeCalamitasClone.cs b/Items/LoreItems/KnowledgeCalamitasClone.cs index c99fe61db5..d7fc3ef186 100644 --- a/Items/LoreItems/KnowledgeCalamitasClone.cs +++ b/Items/LoreItems/KnowledgeCalamitasClone.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeCorruption.cs b/Items/LoreItems/KnowledgeCorruption.cs index 74fb38a005..ca722fac4e 100644 --- a/Items/LoreItems/KnowledgeCorruption.cs +++ b/Items/LoreItems/KnowledgeCorruption.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeCrabulon.cs b/Items/LoreItems/KnowledgeCrabulon.cs index 39c11b4e9b..57bf38da6e 100644 --- a/Items/LoreItems/KnowledgeCrabulon.cs +++ b/Items/LoreItems/KnowledgeCrabulon.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeCrimson.cs b/Items/LoreItems/KnowledgeCrimson.cs index 0a60cb40c7..6cdf1c5d07 100644 --- a/Items/LoreItems/KnowledgeCrimson.cs +++ b/Items/LoreItems/KnowledgeCrimson.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeCryogen.cs b/Items/LoreItems/KnowledgeCryogen.cs index d1833e62c3..184c4b9776 100644 --- a/Items/LoreItems/KnowledgeCryogen.cs +++ b/Items/LoreItems/KnowledgeCryogen.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.LoreItems { CalamityPlayer modPlayer = player.Calamity(); modPlayer.dashMod = 6; - player.statDefense -= 10; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDesertScourge.cs b/Items/LoreItems/KnowledgeDesertScourge.cs index 0eb3750562..082f206049 100644 --- a/Items/LoreItems/KnowledgeDesertScourge.cs +++ b/Items/LoreItems/KnowledgeDesertScourge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeDestroyer.cs b/Items/LoreItems/KnowledgeDestroyer.cs index 8f59fc1c40..55303b8bff 100644 --- a/Items/LoreItems/KnowledgeDestroyer.cs +++ b/Items/LoreItems/KnowledgeDestroyer.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeDevourerofGods.cs b/Items/LoreItems/KnowledgeDevourerofGods.cs index ed5c55bec6..f4f40aee8b 100644 --- a/Items/LoreItems/KnowledgeDevourerofGods.cs +++ b/Items/LoreItems/KnowledgeDevourerofGods.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeDukeFishron.cs b/Items/LoreItems/KnowledgeDukeFishron.cs index 99600c9845..516bd28ad7 100644 --- a/Items/LoreItems/KnowledgeDukeFishron.cs +++ b/Items/LoreItems/KnowledgeDukeFishron.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.cs b/Items/LoreItems/KnowledgeEaterofWorlds.cs index 738a877734..40a7adf76f 100644 --- a/Items/LoreItems/KnowledgeEaterofWorlds.cs +++ b/Items/LoreItems/KnowledgeEaterofWorlds.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.cs b/Items/LoreItems/KnowledgeEyeofCthulhu.cs index 5e80ef3b08..61a1a60a44 100644 --- a/Items/LoreItems/KnowledgeEyeofCthulhu.cs +++ b/Items/LoreItems/KnowledgeEyeofCthulhu.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/LoreItems/KnowledgeGolem.cs b/Items/LoreItems/KnowledgeGolem.cs index 7a8e4436e7..4fc871658b 100644 --- a/Items/LoreItems/KnowledgeGolem.cs +++ b/Items/LoreItems/KnowledgeGolem.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeHiveMind.cs b/Items/LoreItems/KnowledgeHiveMind.cs index da08e5f966..2d7b59c989 100644 --- a/Items/LoreItems/KnowledgeHiveMind.cs +++ b/Items/LoreItems/KnowledgeHiveMind.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeKingSlime.cs b/Items/LoreItems/KnowledgeKingSlime.cs index 7ce6eed7b9..9b7704180f 100644 --- a/Items/LoreItems/KnowledgeKingSlime.cs +++ b/Items/LoreItems/KnowledgeKingSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.cs b/Items/LoreItems/KnowledgeLeviathanandSiren.cs index 5cf25a5218..b0207cd611 100644 --- a/Items/LoreItems/KnowledgeLeviathanandSiren.cs +++ b/Items/LoreItems/KnowledgeLeviathanandSiren.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeLunaticCultist.cs b/Items/LoreItems/KnowledgeLunaticCultist.cs index 9a0fe2676e..85eefb0946 100644 --- a/Items/LoreItems/KnowledgeLunaticCultist.cs +++ b/Items/LoreItems/KnowledgeLunaticCultist.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeMechs.cs b/Items/LoreItems/KnowledgeMechs.cs index 43e62ba583..2e81bc04d7 100644 --- a/Items/LoreItems/KnowledgeMechs.cs +++ b/Items/LoreItems/KnowledgeMechs.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/LoreItems/KnowledgeMoonLord.cs b/Items/LoreItems/KnowledgeMoonLord.cs index 2ec7674af6..de993228b6 100644 --- a/Items/LoreItems/KnowledgeMoonLord.cs +++ b/Items/LoreItems/KnowledgeMoonLord.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeOcean.cs b/Items/LoreItems/KnowledgeOcean.cs index 32f81b0c5e..3928714138 100644 --- a/Items/LoreItems/KnowledgeOcean.cs +++ b/Items/LoreItems/KnowledgeOcean.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index 978ec20724..aed58f7645 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs index eb373e70ea..54bc9ee369 100644 --- a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs +++ b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgePlantera.cs b/Items/LoreItems/KnowledgePlantera.cs index 65a907ac59..b5a07a9743 100644 --- a/Items/LoreItems/KnowledgePlantera.cs +++ b/Items/LoreItems/KnowledgePlantera.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgePolterghast.cs b/Items/LoreItems/KnowledgePolterghast.cs index f2a79c661e..80488cdddb 100644 --- a/Items/LoreItems/KnowledgePolterghast.cs +++ b/Items/LoreItems/KnowledgePolterghast.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeProfanedGuardians.cs b/Items/LoreItems/KnowledgeProfanedGuardians.cs index e0e9d83f25..ac15107a97 100644 --- a/Items/LoreItems/KnowledgeProfanedGuardians.cs +++ b/Items/LoreItems/KnowledgeProfanedGuardians.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeProvidence.cs b/Items/LoreItems/KnowledgeProvidence.cs index adff21ac24..4c6d5cb9e0 100644 --- a/Items/LoreItems/KnowledgeProvidence.cs +++ b/Items/LoreItems/KnowledgeProvidence.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeQueenBee.cs b/Items/LoreItems/KnowledgeQueenBee.cs index 9f9de92d1d..f4ed7c5ed5 100644 --- a/Items/LoreItems/KnowledgeQueenBee.cs +++ b/Items/LoreItems/KnowledgeQueenBee.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeRavager.cs b/Items/LoreItems/KnowledgeRavager.cs index 6452498e1f..8a2b2fc156 100644 --- a/Items/LoreItems/KnowledgeRavager.cs +++ b/Items/LoreItems/KnowledgeRavager.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/KnowledgeSentinels.cs b/Items/LoreItems/KnowledgeSentinels.cs index f2734e0176..6c36253e5f 100644 --- a/Items/LoreItems/KnowledgeSentinels.cs +++ b/Items/LoreItems/KnowledgeSentinels.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeSkeletron.cs b/Items/LoreItems/KnowledgeSkeletron.cs index 117982d8cc..81a3cf3fdc 100644 --- a/Items/LoreItems/KnowledgeSkeletron.cs +++ b/Items/LoreItems/KnowledgeSkeletron.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.cs b/Items/LoreItems/KnowledgeSkeletronPrime.cs index 03fe2f047f..bbb95cff60 100644 --- a/Items/LoreItems/KnowledgeSkeletronPrime.cs +++ b/Items/LoreItems/KnowledgeSkeletronPrime.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index 39f3868d9d..e980523588 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeSulphurSea.cs b/Items/LoreItems/KnowledgeSulphurSea.cs index 1e88fa0eb6..22aad07afc 100644 --- a/Items/LoreItems/KnowledgeSulphurSea.cs +++ b/Items/LoreItems/KnowledgeSulphurSea.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeTwins.cs b/Items/LoreItems/KnowledgeTwins.cs index e1ff4210df..7314c7f2ba 100644 --- a/Items/LoreItems/KnowledgeTwins.cs +++ b/Items/LoreItems/KnowledgeTwins.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeUnderworld.cs b/Items/LoreItems/KnowledgeUnderworld.cs index 8912467c56..4d86b79d3d 100644 --- a/Items/LoreItems/KnowledgeUnderworld.cs +++ b/Items/LoreItems/KnowledgeUnderworld.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeWallofFlesh.cs b/Items/LoreItems/KnowledgeWallofFlesh.cs index 3bb8bd41e7..7f485be3dc 100644 --- a/Items/LoreItems/KnowledgeWallofFlesh.cs +++ b/Items/LoreItems/KnowledgeWallofFlesh.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/LoreItems/KnowledgeYharon.cs b/Items/LoreItems/KnowledgeYharon.cs index 73c30d1dbf..535ff8a48d 100644 --- a/Items/LoreItems/KnowledgeYharon.cs +++ b/Items/LoreItems/KnowledgeYharon.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using Terraria; diff --git a/Items/LoreItems/LoreItem.cs b/Items/LoreItems/LoreItem.cs index 584f64edcf..b4e35ac7e6 100644 --- a/Items/LoreItems/LoreItem.cs +++ b/Items/LoreItems/LoreItem.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace CalamityMod.Items.LoreItems diff --git a/Items/Materials/Acidwood.cs b/Items/Materials/Acidwood.cs index 4ca317c2bc..a897376db9 100644 --- a/Items/Materials/Acidwood.cs +++ b/Items/Materials/Acidwood.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Items.Materials { diff --git a/Items/Materials/AerialiteBar.cs b/Items/Materials/AerialiteBar.cs index c2c408d183..8e24453e9c 100644 --- a/Items/Materials/AerialiteBar.cs +++ b/Items/Materials/AerialiteBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/AncientBoneDust.cs b/Items/Materials/AncientBoneDust.cs index 25b75d6ca3..f290079594 100644 --- a/Items/Materials/AncientBoneDust.cs +++ b/Items/Materials/AncientBoneDust.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/ArmoredShell.cs b/Items/Materials/ArmoredShell.cs index 6b08a43f6a..16f06d7064 100644 --- a/Items/Materials/ArmoredShell.cs +++ b/Items/Materials/ArmoredShell.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index 1720c6f3cc..824a5195dc 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Items/Materials/BarofLife.cs b/Items/Materials/BarofLife.cs index 1ac138afbc..828fd7e2d5 100644 --- a/Items/Materials/BarofLife.cs +++ b/Items/Materials/BarofLife.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/BeetleJuice.cs b/Items/Materials/BeetleJuice.cs index 8e66dd710a..a111baca3e 100644 --- a/Items/Materials/BeetleJuice.cs +++ b/Items/Materials/BeetleJuice.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/BlightedLens.cs b/Items/Materials/BlightedLens.cs index dd940f14b8..1443b4805d 100644 --- a/Items/Materials/BlightedLens.cs +++ b/Items/Materials/BlightedLens.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/BloodOrb.cs b/Items/Materials/BloodOrb.cs index 7bdcaee455..781a4ae398 100644 --- a/Items/Materials/BloodOrb.cs +++ b/Items/Materials/BloodOrb.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/BloodSample.cs b/Items/Materials/BloodSample.cs index 0772fb2855..b94604d9a6 100644 --- a/Items/Materials/BloodSample.cs +++ b/Items/Materials/BloodSample.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/BloodlettingEssence.cs b/Items/Materials/BloodlettingEssence.cs index 39efc7c864..f7baa533cd 100644 --- a/Items/Materials/BloodlettingEssence.cs +++ b/Items/Materials/BloodlettingEssence.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/Bloodstone.cs b/Items/Materials/Bloodstone.cs index e072b3af93..b0e9c62e69 100644 --- a/Items/Materials/Bloodstone.cs +++ b/Items/Materials/Bloodstone.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/BloodstoneCore.cs b/Items/Materials/BloodstoneCore.cs index 2069eb2dea..227e00b6b4 100644 --- a/Items/Materials/BloodstoneCore.cs +++ b/Items/Materials/BloodstoneCore.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/CalamitousEssence.cs b/Items/Materials/CalamitousEssence.cs index 9861cbf206..9cbef4c001 100644 --- a/Items/Materials/CalamitousEssence.cs +++ b/Items/Materials/CalamitousEssence.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/CalamityDust.cs b/Items/Materials/CalamityDust.cs index bee54dff70..3d17ae3735 100644 --- a/Items/Materials/CalamityDust.cs +++ b/Items/Materials/CalamityDust.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/CloakingGland.cs b/Items/Materials/CloakingGland.cs index e5392dff71..35db052a0c 100644 --- a/Items/Materials/CloakingGland.cs +++ b/Items/Materials/CloakingGland.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index d93b495920..4f5ed57674 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/CoreofChaos.cs b/Items/Materials/CoreofChaos.cs index b5bc3ae33f..4d6b7d5d24 100644 --- a/Items/Materials/CoreofChaos.cs +++ b/Items/Materials/CoreofChaos.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/CoreofCinder.cs b/Items/Materials/CoreofCinder.cs index dbd726f1f2..e8457a9fd1 100644 --- a/Items/Materials/CoreofCinder.cs +++ b/Items/Materials/CoreofCinder.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/CoreofEleum.cs b/Items/Materials/CoreofEleum.cs index ceb7911439..a88bb59529 100644 --- a/Items/Materials/CoreofEleum.cs +++ b/Items/Materials/CoreofEleum.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/CorrodedFossil.cs b/Items/Materials/CorrodedFossil.cs index 7319999c79..6b49e7e0e6 100644 --- a/Items/Materials/CorrodedFossil.cs +++ b/Items/Materials/CorrodedFossil.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/CosmiliteBar.cs b/Items/Materials/CosmiliteBar.cs index bbadbc1d27..e955418d61 100644 --- a/Items/Materials/CosmiliteBar.cs +++ b/Items/Materials/CosmiliteBar.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/CruptixBar.cs b/Items/Materials/CruptixBar.cs index 982e92d214..5ab4c43ff1 100644 --- a/Items/Materials/CruptixBar.cs +++ b/Items/Materials/CruptixBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Materials { item.createTile = ModContent.TileType(); item.noUseGraphic = true; //no use graphic because animated things swing their entire sheet - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Materials/CryoBar.cs b/Items/Materials/CryoBar.cs index f26cbd88fd..9a10253222 100644 --- a/Items/Materials/CryoBar.cs +++ b/Items/Materials/CryoBar.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/DarkPlasma.cs b/Items/Materials/DarkPlasma.cs index 4e78240d05..e3197be99c 100644 --- a/Items/Materials/DarkPlasma.cs +++ b/Items/Materials/DarkPlasma.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index 2760cb7caa..dae75292f2 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/DemonicBoneAsh.cs b/Items/Materials/DemonicBoneAsh.cs index 4cfc97b397..c7b19fd16c 100644 --- a/Items/Materials/DemonicBoneAsh.cs +++ b/Items/Materials/DemonicBoneAsh.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/DepthCells.cs b/Items/Materials/DepthCells.cs index 99883c849a..e32d21e80a 100644 --- a/Items/Materials/DepthCells.cs +++ b/Items/Materials/DepthCells.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/DesertFeather.cs b/Items/Materials/DesertFeather.cs index 504cbcc9f4..6033673acf 100644 --- a/Items/Materials/DesertFeather.cs +++ b/Items/Materials/DesertFeather.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/DivineGeode.cs b/Items/Materials/DivineGeode.cs index ad96f4cc67..872606f369 100644 --- a/Items/Materials/DivineGeode.cs +++ b/Items/Materials/DivineGeode.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/DraedonBar.cs b/Items/Materials/DraedonBar.cs index 80a2b28f18..b77c2df485 100644 --- a/Items/Materials/DraedonBar.cs +++ b/Items/Materials/DraedonBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles; using Terraria; using Terraria.ID; @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Materials/EbonianGel.cs b/Items/Materials/EbonianGel.cs index 0c8676a2f5..758d825253 100644 --- a/Items/Materials/EbonianGel.cs +++ b/Items/Materials/EbonianGel.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/Ectoblood.cs b/Items/Materials/Ectoblood.cs index b97a4eeb68..f0933316ba 100644 --- a/Items/Materials/Ectoblood.cs +++ b/Items/Materials/Ectoblood.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/EffulgentFeather.cs b/Items/Materials/EffulgentFeather.cs index 4ef9391a84..d8c23f3386 100644 --- a/Items/Materials/EffulgentFeather.cs +++ b/Items/Materials/EffulgentFeather.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/EndothermicEnergy.cs b/Items/Materials/EndothermicEnergy.cs index 08255e51e2..d8ea5126e7 100644 --- a/Items/Materials/EndothermicEnergy.cs +++ b/Items/Materials/EndothermicEnergy.cs @@ -1,11 +1,10 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; using Terraria.DataStructures; namespace CalamityMod.Items.Materials { - public class EndothermicEnergy : ModItem + public class EndothermicEnergy : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Materials/EssenceofChaos.cs b/Items/Materials/EssenceofChaos.cs index a0951de003..2678e468b5 100644 --- a/Items/Materials/EssenceofChaos.cs +++ b/Items/Materials/EssenceofChaos.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/EssenceofCinder.cs b/Items/Materials/EssenceofCinder.cs index 0b3130da50..f878f49954 100644 --- a/Items/Materials/EssenceofCinder.cs +++ b/Items/Materials/EssenceofCinder.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/EssenceofEleum.cs b/Items/Materials/EssenceofEleum.cs index 601f618259..c4f0618a79 100644 --- a/Items/Materials/EssenceofEleum.cs +++ b/Items/Materials/EssenceofEleum.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/FetidEssence.cs b/Items/Materials/FetidEssence.cs index a589911a05..29e9eecf55 100644 --- a/Items/Materials/FetidEssence.cs +++ b/Items/Materials/FetidEssence.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/GalacticaSingularity.cs b/Items/Materials/GalacticaSingularity.cs index 2ff6ec4d30..4111002d92 100644 --- a/Items/Materials/GalacticaSingularity.cs +++ b/Items/Materials/GalacticaSingularity.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/GrandScale.cs b/Items/Materials/GrandScale.cs index a1b43b16be..99407eee49 100644 --- a/Items/Materials/GrandScale.cs +++ b/Items/Materials/GrandScale.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/GypsyPowder.cs b/Items/Materials/GypsyPowder.cs index 8163113127..fbaa547206 100644 --- a/Items/Materials/GypsyPowder.cs +++ b/Items/Materials/GypsyPowder.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/HadarianMembrane.cs b/Items/Materials/HadarianMembrane.cs index cda17a6504..afaa6c671a 100644 --- a/Items/Materials/HadarianMembrane.cs +++ b/Items/Materials/HadarianMembrane.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/HellcasterFragment.cs b/Items/Materials/HellcasterFragment.cs index e59b8c5f58..3b153a6f6e 100644 --- a/Items/Materials/HellcasterFragment.cs +++ b/Items/Materials/HellcasterFragment.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/LivingShard.cs b/Items/Materials/LivingShard.cs index cb951d8ed8..b4a27a5290 100644 --- a/Items/Materials/LivingShard.cs +++ b/Items/Materials/LivingShard.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/Lumenite.cs b/Items/Materials/Lumenite.cs index f2d646d97b..6ae7ab931f 100644 --- a/Items/Materials/Lumenite.cs +++ b/Items/Materials/Lumenite.cs @@ -1,5 +1,6 @@ -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Materials/ManeaterBulb.cs b/Items/Materials/ManeaterBulb.cs index eed1f7ade4..b00136df6a 100644 --- a/Items/Materials/ManeaterBulb.cs +++ b/Items/Materials/ManeaterBulb.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/MeldBlob.cs b/Items/Materials/MeldBlob.cs index 678c68f4bd..547cf9992e 100644 --- a/Items/Materials/MeldBlob.cs +++ b/Items/Materials/MeldBlob.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/MeldiateBar.cs b/Items/Materials/MeldiateBar.cs index dfe8ef5e04..570ff475ff 100644 --- a/Items/Materials/MeldiateBar.cs +++ b/Items/Materials/MeldiateBar.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/MolluskHusk.cs b/Items/Materials/MolluskHusk.cs index 84af9f19ca..d4a9a46b00 100644 --- a/Items/Materials/MolluskHusk.cs +++ b/Items/Materials/MolluskHusk.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/MurkyPaste.cs b/Items/Materials/MurkyPaste.cs index 314eba74eb..7fff83c8a9 100644 --- a/Items/Materials/MurkyPaste.cs +++ b/Items/Materials/MurkyPaste.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/MurkySludge.cs b/Items/Materials/MurkySludge.cs index e9a67e2ce7..7e12344641 100644 --- a/Items/Materials/MurkySludge.cs +++ b/Items/Materials/MurkySludge.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index f0111964ef..9859fd606f 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -1,11 +1,10 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; using Terraria.DataStructures; namespace CalamityMod.Items.Materials { - public class NightmareFuel : ModItem + public class NightmareFuel : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Materials/Phantoplasm.cs b/Items/Materials/Phantoplasm.cs index 8b38af5d3e..9acab4a131 100644 --- a/Items/Materials/Phantoplasm.cs +++ b/Items/Materials/Phantoplasm.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/PlagueCellCluster.cs b/Items/Materials/PlagueCellCluster.cs index 7281a8db48..39bbc8188b 100644 --- a/Items/Materials/PlagueCellCluster.cs +++ b/Items/Materials/PlagueCellCluster.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/PlagueCellCluster.png b/Items/Materials/PlagueCellCluster.png index f0314d31d7..2f63b08e28 100644 Binary files a/Items/Materials/PlagueCellCluster.png and b/Items/Materials/PlagueCellCluster.png differ diff --git a/Items/Materials/PurifiedGel.cs b/Items/Materials/PurifiedGel.cs index c80d0f30f9..7b7879b9f2 100644 --- a/Items/Materials/PurifiedGel.cs +++ b/Items/Materials/PurifiedGel.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/ReaperTooth.cs b/Items/Materials/ReaperTooth.cs index 8cc54ed18d..44eae426a9 100644 --- a/Items/Materials/ReaperTooth.cs +++ b/Items/Materials/ReaperTooth.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/RuinousSoul.cs b/Items/Materials/RuinousSoul.cs index 218ff81623..2f7606bafe 100644 --- a/Items/Materials/RuinousSoul.cs +++ b/Items/Materials/RuinousSoul.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/ShadowspecBar.cs b/Items/Materials/ShadowspecBar.cs index b844b6bfda..448a841d1c 100644 --- a/Items/Materials/ShadowspecBar.cs +++ b/Items/Materials/ShadowspecBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/Stardust.cs b/Items/Materials/Stardust.cs index 88b9a1cec7..e46065e5e3 100644 --- a/Items/Materials/Stardust.cs +++ b/Items/Materials/Stardust.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/StormlionMandible.cs b/Items/Materials/StormlionMandible.cs index f310a98d56..8cad617f47 100644 --- a/Items/Materials/StormlionMandible.cs +++ b/Items/Materials/StormlionMandible.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/SulfuricScale.cs b/Items/Materials/SulfuricScale.cs index 4d47575525..230dc60d55 100644 --- a/Items/Materials/SulfuricScale.cs +++ b/Items/Materials/SulfuricScale.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/TrapperBulb.cs b/Items/Materials/TrapperBulb.cs index 9cb6a69b38..584b24e164 100644 --- a/Items/Materials/TrapperBulb.cs +++ b/Items/Materials/TrapperBulb.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/TrueShadowScale.cs b/Items/Materials/TrueShadowScale.cs index 27741f6d3b..4d4deac5eb 100644 --- a/Items/Materials/TrueShadowScale.cs +++ b/Items/Materials/TrueShadowScale.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/TwistingNether.cs b/Items/Materials/TwistingNether.cs index fe3b6d2032..bde14c1f38 100644 --- a/Items/Materials/TwistingNether.cs +++ b/Items/Materials/TwistingNether.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/UeliaceBar.cs b/Items/Materials/UeliaceBar.cs index 13216161bd..81d8871dd6 100644 --- a/Items/Materials/UeliaceBar.cs +++ b/Items/Materials/UeliaceBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/UnholyCore.cs b/Items/Materials/UnholyCore.cs index ab0fd64e33..2da4e4d103 100644 --- a/Items/Materials/UnholyCore.cs +++ b/Items/Materials/UnholyCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/UnholyEssence.cs b/Items/Materials/UnholyEssence.cs index b5c93906b0..021cb43364 100644 --- a/Items/Materials/UnholyEssence.cs +++ b/Items/Materials/UnholyEssence.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; diff --git a/Items/Materials/VerstaltiteBar.cs b/Items/Materials/VerstaltiteBar.cs index 158060c35e..a9d30a0443 100644 --- a/Items/Materials/VerstaltiteBar.cs +++ b/Items/Materials/VerstaltiteBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles; using Terraria; using Terraria.ID; @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Materials/VictideBar.cs b/Items/Materials/VictideBar.cs index f6cf97973c..c14e5ff250 100644 --- a/Items/Materials/VictideBar.cs +++ b/Items/Materials/VictideBar.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Materials/VictoryShard.cs b/Items/Materials/VictoryShard.cs index 9ed0b2932d..b75ea9b02f 100644 --- a/Items/Materials/VictoryShard.cs +++ b/Items/Materials/VictoryShard.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Materials/WulfrumShard.cs b/Items/Materials/WulfrumShard.cs index 112239b7d8..e7975c53b3 100644 --- a/Items/Materials/WulfrumShard.cs +++ b/Items/Materials/WulfrumShard.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Materials diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index e002f94005..5669c11af0 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; diff --git a/Items/Mounts/AngryDogMount.cs b/Items/Mounts/AngryDogMount.cs index 056bdbce2e..f64b5124fe 100644 --- a/Items/Mounts/AngryDogMount.cs +++ b/Items/Mounts/AngryDogMount.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Items/Mounts/BUMBLEDOGE.cs b/Items/Mounts/BUMBLEDOGE.cs index 9cdc2a3399..78285bdfda 100644 --- a/Items/Mounts/BUMBLEDOGE.cs +++ b/Items/Mounts/BUMBLEDOGE.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.Mounts; using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Mounts { - public class BUMBLEDOGE : ModMountData + public class BUMBLEDOGE : ModMountData { public override void SetDefaults() { @@ -18,7 +17,6 @@ namespace CalamityMod.Items.Mounts mountData.fatigueMax = 0; mountData.fallDamage = 0f; mountData.runSpeed = 12f; - mountData.dashSpeed = 12f; mountData.heightBoost = 44; mountData.acceleration = 0.2f; mountData.jumpHeight = 10; @@ -56,7 +54,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - mountData.dashSpeed = 25f; + mountData.dashSpeed = 18.5f; mountData.dashingFrameCount = mountData.flyingFrameCount; mountData.dashingFrameDelay = 5; mountData.dashingFrameStart = mountData.flyingFrameStart; diff --git a/Items/Mounts/BirdSeed.cs b/Items/Mounts/BirdSeed.cs index c2e8e1957d..190403f60f 100644 --- a/Items/Mounts/BirdSeed.cs +++ b/Items/Mounts/BirdSeed.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Mounts { public override void SetStaticDefaults() { - DisplayName.SetDefault("Bird Seed"); + DisplayName.SetDefault("Folly Feed"); Tooltip.SetDefault("Summons a monstrosity"); } diff --git a/Items/Mounts/Brimrose.cs b/Items/Mounts/Brimrose.cs index e57cc6e0af..e01b505126 100644 --- a/Items/Mounts/Brimrose.cs +++ b/Items/Mounts/Brimrose.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Mounts item.height = 64; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = Item.buyPrice(1, 50, 0, 0); item.rare = 9; item.expert = true; diff --git a/Items/Mounts/Crysthamyr.cs b/Items/Mounts/Crysthamyr.cs index 254a49b065..9a930dde93 100644 --- a/Items/Mounts/Crysthamyr.cs +++ b/Items/Mounts/Crysthamyr.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Items/Mounts/Fabsol.cs b/Items/Mounts/Fabsol.cs index 35f7d33e32..17a060ce44 100644 --- a/Items/Mounts/Fabsol.cs +++ b/Items/Mounts/Fabsol.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Mounts item.height = 16; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 9; item.value = Item.buyPrice(3, 0, 0, 0); item.expert = true; diff --git a/Items/Mounts/GazeOfCrysthamyr.cs b/Items/Mounts/GazeOfCrysthamyr.cs index 91c6236f3f..236e8c6d3c 100644 --- a/Items/Mounts/GazeOfCrysthamyr.cs +++ b/Items/Mounts/GazeOfCrysthamyr.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Mounts item.height = 16; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 10; item.value = Item.buyPrice(3, 0, 0, 0); item.UseSound = SoundID.NPCHit56; diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 8e86941bba..aa25965753 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Ores; @@ -191,7 +191,7 @@ namespace CalamityMod.Items.Mounts WorldGen.KillTile(num824, num825, false, false, false); if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } } } diff --git a/Items/Mounts/OnyxExcavatorKey.cs b/Items/Mounts/OnyxExcavatorKey.cs index 8be8feb655..94271a3d6c 100644 --- a/Items/Mounts/OnyxExcavatorKey.cs +++ b/Items/Mounts/OnyxExcavatorKey.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Mounts item.height = 16; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 3; item.value = Item.buyPrice(0, 9, 0, 0); item.UseSound = SoundID.Item23; diff --git a/Items/Mounts/PhuppersChair.cs b/Items/Mounts/PhuppersChair.cs index 96c3dd4131..b0d3c72d87 100644 --- a/Items/Mounts/PhuppersChair.cs +++ b/Items/Mounts/PhuppersChair.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.Mounts; using Terraria; using Terraria.ID; diff --git a/Items/Mounts/SquishyBean.cs b/Items/Mounts/SquishyBean.cs index e9800e4871..42816aa49f 100644 --- a/Items/Mounts/SquishyBean.cs +++ b/Items/Mounts/SquishyBean.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Mounts; +using CalamityMod.Buffs.Mounts; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Mounts/SquishyBeanMount.cs b/Items/Mounts/SquishyBeanMount.cs index 175e365cff..99d173db2e 100644 --- a/Items/Mounts/SquishyBeanMount.cs +++ b/Items/Mounts/SquishyBeanMount.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Mounts item.height = 20; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 9; item.value = Item.buyPrice(1, 0, 0, 0); item.expert = true; diff --git a/Items/Mounts/TundraLeash.cs b/Items/Mounts/TundraLeash.cs index 7607c72562..12d0b80ef8 100644 --- a/Items/Mounts/TundraLeash.cs +++ b/Items/Mounts/TundraLeash.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Mounts item.height = 16; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 3; item.value = Item.buyPrice(0, 9, 0, 0); item.UseSound = SoundID.NPCHit56; diff --git a/Items/NormalityRelocator.cs b/Items/NormalityRelocator.cs index ed2b2dfe70..f45b610a90 100644 --- a/Items/NormalityRelocator.cs +++ b/Items/NormalityRelocator.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Ores; using System.Collections.Generic; diff --git a/Items/PermanentBoosters/BloodOrange.cs b/Items/PermanentBoosters/BloodOrange.cs index 2f70e1a28e..66069735ac 100644 --- a/Items/PermanentBoosters/BloodOrange.cs +++ b/Items/PermanentBoosters/BloodOrange.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 5; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; } diff --git a/Items/PermanentBoosters/CometShard.cs b/Items/PermanentBoosters/CometShard.cs index ff58f26f4d..14dfa0ac12 100644 --- a/Items/PermanentBoosters/CometShard.cs +++ b/Items/PermanentBoosters/CometShard.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 5; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item29; item.consumable = true; } diff --git a/Items/PermanentBoosters/Dragonfruit.cs b/Items/PermanentBoosters/Dragonfruit.cs index a1986c5752..7b73d56c32 100644 --- a/Items/PermanentBoosters/Dragonfruit.cs +++ b/Items/PermanentBoosters/Dragonfruit.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.PermanentBoosters item.height = 20; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; item.rare = 10; diff --git a/Items/PermanentBoosters/Ectoheart.cs b/Items/PermanentBoosters/Ectoheart.cs index a59a069083..e187a6d4b0 100644 --- a/Items/PermanentBoosters/Ectoheart.cs +++ b/Items/PermanentBoosters/Ectoheart.cs @@ -1,4 +1,3 @@ -using CalamityMod; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.PermanentBoosters { - public class Ectoheart : ModItem + public class Ectoheart : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.PermanentBoosters item.height = 44; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; item.rare = 10; diff --git a/Items/PermanentBoosters/Elderberry.cs b/Items/PermanentBoosters/Elderberry.cs index 2e84fa8ee3..7f5293d1f0 100644 --- a/Items/PermanentBoosters/Elderberry.cs +++ b/Items/PermanentBoosters/Elderberry.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 10; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; } diff --git a/Items/PermanentBoosters/ElectrolyteGelPack.cs b/Items/PermanentBoosters/ElectrolyteGelPack.cs index dd0ca7caa1..3a93a85afa 100644 --- a/Items/PermanentBoosters/ElectrolyteGelPack.cs +++ b/Items/PermanentBoosters/ElectrolyteGelPack.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 4; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; } diff --git a/Items/PermanentBoosters/EtherealCore.cs b/Items/PermanentBoosters/EtherealCore.cs index cc2b4f57dd..f44559cfcf 100644 --- a/Items/PermanentBoosters/EtherealCore.cs +++ b/Items/PermanentBoosters/EtherealCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Placeables; using Terraria; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 10; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item29; item.consumable = true; } diff --git a/Items/PermanentBoosters/InfernalBlood.cs b/Items/PermanentBoosters/InfernalBlood.cs index e94a8f5330..46ef2a7e5f 100644 --- a/Items/PermanentBoosters/InfernalBlood.cs +++ b/Items/PermanentBoosters/InfernalBlood.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 8; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; } diff --git a/Items/PermanentBoosters/MLGRune2.cs b/Items/PermanentBoosters/MLGRune2.cs index 3a6e1c39e7..683a1faa92 100644 --- a/Items/PermanentBoosters/MLGRune2.cs +++ b/Items/PermanentBoosters/MLGRune2.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ Consuming it does something that cannot be reversed"); item.maxStack = 99; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; } diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 9672cd5480..8db3c03a1e 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Potions; using Terraria; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 7; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; } diff --git a/Items/PermanentBoosters/MushroomPlasmaRoot.cs b/Items/PermanentBoosters/MushroomPlasmaRoot.cs index 1384f375bf..93517d7e0c 100644 --- a/Items/PermanentBoosters/MushroomPlasmaRoot.cs +++ b/Items/PermanentBoosters/MushroomPlasmaRoot.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 2; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; } diff --git a/Items/PermanentBoosters/PhantomHeart.cs b/Items/PermanentBoosters/PhantomHeart.cs index c9cc9c6a88..62de96f9f1 100644 --- a/Items/PermanentBoosters/PhantomHeart.cs +++ b/Items/PermanentBoosters/PhantomHeart.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.PermanentBoosters item.height = 20; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item29; item.consumable = true; item.rare = 10; diff --git a/Items/PermanentBoosters/RedLightningContainer.cs b/Items/PermanentBoosters/RedLightningContainer.cs index 3e74a1418f..eaf3a9e1a9 100644 --- a/Items/PermanentBoosters/RedLightningContainer.cs +++ b/Items/PermanentBoosters/RedLightningContainer.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.PermanentBoosters item.height = 20; item.useAnimation = 30; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; item.rare = 10; diff --git a/Items/PermanentBoosters/StarlightFuelCell.cs b/Items/PermanentBoosters/StarlightFuelCell.cs index db4149db7c..9032b6f0ad 100644 --- a/Items/PermanentBoosters/StarlightFuelCell.cs +++ b/Items/PermanentBoosters/StarlightFuelCell.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useAnimation = 30; item.rare = 7; item.useTime = 30; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item122; item.consumable = true; } diff --git a/Items/Pets/BearEye.cs b/Items/Pets/BearEye.cs index 330a372ad8..a6a42af5ed 100644 --- a/Items/Pets/BearEye.cs +++ b/Items/Pets/BearEye.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Pets/BloodyVein.cs b/Items/Pets/BloodyVein.cs index 77052bf7de..6bcc74e3ef 100644 --- a/Items/Pets/BloodyVein.cs +++ b/Items/Pets/BloodyVein.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ID; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Pets item.damage = 0; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.width = 24; item.height = 48; diff --git a/Items/Pets/CosmicPlushie.cs b/Items/Pets/CosmicPlushie.cs index 7237d467e8..9e21f52e19 100644 --- a/Items/Pets/CosmicPlushie.cs +++ b/Items/Pets/CosmicPlushie.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Pets/ForgottenDragonEgg.cs b/Items/Pets/ForgottenDragonEgg.cs index 18b569c4e2..e79a792404 100644 --- a/Items/Pets/ForgottenDragonEgg.cs +++ b/Items/Pets/ForgottenDragonEgg.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ID; diff --git a/Items/Pets/FoxDrive.cs b/Items/Pets/FoxDrive.cs index 4487d9e187..c2b9bdb9b3 100644 --- a/Items/Pets/FoxDrive.cs +++ b/Items/Pets/FoxDrive.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ID; diff --git a/Items/Pets/GeyserShell.cs b/Items/Pets/GeyserShell.cs index 7bdded2aec..db0b010496 100644 --- a/Items/Pets/GeyserShell.cs +++ b/Items/Pets/GeyserShell.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Pets/IbarakiBox.cs b/Items/Pets/IbarakiBox.cs index 281f8852de..85889814d6 100644 --- a/Items/Pets/IbarakiBox.cs +++ b/Items/Pets/IbarakiBox.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Microsoft.Xna.Framework; using Terraria; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Pets item.damage = 0; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.width = 36; item.height = 30; diff --git a/Items/Pets/JoyfulHeart.cs b/Items/Pets/JoyfulHeart.cs index 72c7b785b3..ccd6138bbb 100644 --- a/Items/Pets/JoyfulHeart.cs +++ b/Items/Pets/JoyfulHeart.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Pets/Levi.cs b/Items/Pets/Levi.cs index 0d0fe68621..63e254f764 100644 --- a/Items/Pets/Levi.cs +++ b/Items/Pets/Levi.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ID; diff --git a/Items/Pets/PrimroseKeepsake.cs b/Items/Pets/PrimroseKeepsake.cs index 32383c7959..e36f2c2df0 100644 --- a/Items/Pets/PrimroseKeepsake.cs +++ b/Items/Pets/PrimroseKeepsake.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Microsoft.Xna.Framework; using System.Collections.Generic; @@ -19,14 +19,14 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; item.width = 30; item.height = 30; item.value = Item.sellPrice(1, 0, 0, 0); - item.shoot = 0; // neither kendra nor bear is the direct "shoot" + item.shoot = ProjectileID.None; // neither kendra nor bear is the direct "shoot" item.buffType = ModContent.BuffType(); item.rare = 6; item.UseSound = SoundID.Item44; diff --git a/Items/Pets/RomajedaOrchid.cs b/Items/Pets/RomajedaOrchid.cs index c2ead075a6..fa161f44cc 100644 --- a/Items/Pets/RomajedaOrchid.cs +++ b/Items/Pets/RomajedaOrchid.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Pets/RotomRemote.cs b/Items/Pets/RotomRemote.cs index 52bcce68aa..a1c7771531 100644 --- a/Items/Pets/RotomRemote.cs +++ b/Items/Pets/RotomRemote.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Pets item.damage = 0; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.width = 30; item.height = 34; diff --git a/Items/Pets/StrangeOrb.cs b/Items/Pets/StrangeOrb.cs index ac16485d74..8dfb85d620 100644 --- a/Items/Pets/StrangeOrb.cs +++ b/Items/Pets/StrangeOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.Projectiles.Pets; using Terraria; using Terraria.ID; diff --git a/Items/Pets/TrashmanTrashcan.cs b/Items/Pets/TrashmanTrashcan.cs index 65208e848e..b4c105789e 100644 --- a/Items/Pets/TrashmanTrashcan.cs +++ b/Items/Pets/TrashmanTrashcan.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Pets public override void SetDefaults() { item.damage = 0; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 20; item.useTime = 20; item.noMelee = true; diff --git a/Items/Placeables/AbyssGravel.cs b/Items/Placeables/AbyssGravel.cs index eb57d13e4c..e215445966 100644 --- a/Items/Placeables/AbyssGravel.cs +++ b/Items/Placeables/AbyssGravel.cs @@ -1,4 +1,6 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AbyssGravel : ModItem @@ -11,7 +13,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/AerialiteBrick.cs b/Items/Placeables/AerialiteBrick.cs index e0e3742aab..ef28e8ac45 100644 --- a/Items/Placeables/AerialiteBrick.cs +++ b/Items/Placeables/AerialiteBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/AstralBar.cs b/Items/Placeables/AstralBar.cs index 1aebc40f87..470ea06d99 100644 --- a/Items/Placeables/AstralBar.cs +++ b/Items/Placeables/AstralBar.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using Terraria; @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/AstralBrick.cs b/Items/Placeables/AstralBrick.cs index 65b317a1db..52a12147ec 100644 --- a/Items/Placeables/AstralBrick.cs +++ b/Items/Placeables/AstralBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/AstralClay.cs b/Items/Placeables/AstralClay.cs index e29e5c0e77..53862c73bc 100644 --- a/Items/Placeables/AstralClay.cs +++ b/Items/Placeables/AstralClay.cs @@ -1,6 +1,6 @@ -using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables { public class AstralClay : ModItem @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/AstralDirt.cs b/Items/Placeables/AstralDirt.cs index 05668566bf..5d68b538a3 100644 --- a/Items/Placeables/AstralDirt.cs +++ b/Items/Placeables/AstralDirt.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AstralDirt : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/AstralFossil.cs b/Items/Placeables/AstralFossil.cs index b774b093f0..138686b704 100644 --- a/Items/Placeables/AstralFossil.cs +++ b/Items/Placeables/AstralFossil.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Items.Materials; using Terraria.ID; using Terraria; @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables { ItemID.Sets.ExtractinatorMode[item.type] = item.type; item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/AstralIce.cs b/Items/Placeables/AstralIce.cs index f82580bed0..cc5fc01379 100644 --- a/Items/Placeables/AstralIce.cs +++ b/Items/Placeables/AstralIce.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AstralIce : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/AstralMonolith.cs b/Items/Placeables/AstralMonolith.cs index 37391ada23..57742858f4 100644 --- a/Items/Placeables/AstralMonolith.cs +++ b/Items/Placeables/AstralMonolith.cs @@ -1,8 +1,8 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; -using CalamityMod.Items.Placeables.Walls; using CalamityMod.Items.Placeables.FurnitureAstral; +using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; -using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" +using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/AstralSand.cs b/Items/Placeables/AstralSand.cs index 15ef6d1f59..c7cea90d4f 100644 --- a/Items/Placeables/AstralSand.cs +++ b/Items/Placeables/AstralSand.cs @@ -1,6 +1,6 @@ -using CalamityMod.Projectiles.Ranged; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables { public class AstralSand : ModItem @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Placeables item.width = 16; item.height = 16; item.maxStack = 999; - //item.ammo = AmmoID.Sand; - //item.shoot = ModContent.ProjectileType(); - //item.notAmmo = true; - //item.shootSpeed = 15f; - item.useStyle = 1; + // item.ammo = AmmoID.Sand; + // item.shoot = ModContent.ProjectileType(); + // item.notAmmo = true; + // item.shootSpeed = 15f; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/AstralSandstone.cs b/Items/Placeables/AstralSandstone.cs index 8ce77fd978..f0dc57708e 100644 --- a/Items/Placeables/AstralSandstone.cs +++ b/Items/Placeables/AstralSandstone.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AstralSandstone : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/AstralSilt.cs b/Items/Placeables/AstralSilt.cs index 2463aaf63c..a79456eaa1 100644 --- a/Items/Placeables/AstralSilt.cs +++ b/Items/Placeables/AstralSilt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria.ID; using Terraria; using Terraria.ModLoader; @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables { ItemID.Sets.ExtractinatorMode[item.type] = item.type; item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/AstralSnow.cs b/Items/Placeables/AstralSnow.cs index cf166004ae..a127680e18 100644 --- a/Items/Placeables/AstralSnow.cs +++ b/Items/Placeables/AstralSnow.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AstralSnow : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/AstralStone.cs b/Items/Placeables/AstralStone.cs index d947f8d01b..c57d7de5c3 100644 --- a/Items/Placeables/AstralStone.cs +++ b/Items/Placeables/AstralStone.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class AstralStone : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/Banners/AcidEelBanner.cs b/Items/Placeables/Banners/AcidEelBanner.cs index 8f54541f54..51e4615af6 100644 --- a/Items/Placeables/Banners/AcidEelBanner.cs +++ b/Items/Placeables/Banners/AcidEelBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AcidEelBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AeroSlimeBanner.cs b/Items/Placeables/Banners/AeroSlimeBanner.cs index 83faacc0e2..8bb217d051 100644 --- a/Items/Placeables/Banners/AeroSlimeBanner.cs +++ b/Items/Placeables/Banners/AeroSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AeroSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AmberCrawlerBanner.cs b/Items/Placeables/Banners/AmberCrawlerBanner.cs index f16d43c2d0..71eeb51efb 100644 --- a/Items/Placeables/Banners/AmberCrawlerBanner.cs +++ b/Items/Placeables/Banners/AmberCrawlerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AmberCrawlerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AmethystCrawlerBanner.cs b/Items/Placeables/Banners/AmethystCrawlerBanner.cs index d8433990bf..53aa13580e 100644 --- a/Items/Placeables/Banners/AmethystCrawlerBanner.cs +++ b/Items/Placeables/Banners/AmethystCrawlerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AmethystCrawlerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AngryDogBanner.cs b/Items/Placeables/Banners/AngryDogBanner.cs index 962d2881b6..e998eff04d 100644 --- a/Items/Placeables/Banners/AngryDogBanner.cs +++ b/Items/Placeables/Banners/AngryDogBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AngryDogBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AnthozoanCrabBanner.cs b/Items/Placeables/Banners/AnthozoanCrabBanner.cs index 3383565c03..025835ac0d 100644 --- a/Items/Placeables/Banners/AnthozoanCrabBanner.cs +++ b/Items/Placeables/Banners/AnthozoanCrabBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AnthozoanCrabBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AquaticAberrationBanner.cs b/Items/Placeables/Banners/AquaticAberrationBanner.cs index 833e35b964..e469fcdc4f 100644 --- a/Items/Placeables/Banners/AquaticAberrationBanner.cs +++ b/Items/Placeables/Banners/AquaticAberrationBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AquaticAberrationBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AquaticParasiteBanner.cs b/Items/Placeables/Banners/AquaticParasiteBanner.cs index d22add94fe..5cc7b79bf9 100644 --- a/Items/Placeables/Banners/AquaticParasiteBanner.cs +++ b/Items/Placeables/Banners/AquaticParasiteBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AquaticParasiteBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AquaticSeekerBanner.cs b/Items/Placeables/Banners/AquaticSeekerBanner.cs index 9f848e7479..6bc5b5c221 100644 --- a/Items/Placeables/Banners/AquaticSeekerBanner.cs +++ b/Items/Placeables/Banners/AquaticSeekerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AquaticSeekerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AquaticUrchinBanner.cs b/Items/Placeables/Banners/AquaticUrchinBanner.cs index a428be8121..5f15874e3f 100644 --- a/Items/Placeables/Banners/AquaticUrchinBanner.cs +++ b/Items/Placeables/Banners/AquaticUrchinBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AquaticUrchinBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AriesBanner.cs b/Items/Placeables/Banners/AriesBanner.cs index 468268d1c4..2196cb2731 100644 --- a/Items/Placeables/Banners/AriesBanner.cs +++ b/Items/Placeables/Banners/AriesBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AriesBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ArmoredDiggerBanner.cs b/Items/Placeables/Banners/ArmoredDiggerBanner.cs index b683935afa..59f6590738 100644 --- a/Items/Placeables/Banners/ArmoredDiggerBanner.cs +++ b/Items/Placeables/Banners/ArmoredDiggerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class ArmoredDiggerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AstralProbeBanner.cs b/Items/Placeables/Banners/AstralProbeBanner.cs index d08a0df4c7..46a941bdab 100644 --- a/Items/Placeables/Banners/AstralProbeBanner.cs +++ b/Items/Placeables/Banners/AstralProbeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AstralProbeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AstralSlimeBanner.cs b/Items/Placeables/Banners/AstralSlimeBanner.cs index ec61cdf249..3a9dfc5ae1 100644 --- a/Items/Placeables/Banners/AstralSlimeBanner.cs +++ b/Items/Placeables/Banners/AstralSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AstralSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AstralachneaBanner.cs b/Items/Placeables/Banners/AstralachneaBanner.cs index 4c4f99bcb7..8e880025e4 100644 --- a/Items/Placeables/Banners/AstralachneaBanner.cs +++ b/Items/Placeables/Banners/AstralachneaBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AstralachneaBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/AtlasBanner.cs b/Items/Placeables/Banners/AtlasBanner.cs index 2d7d35bf2d..8330eb4a9f 100644 --- a/Items/Placeables/Banners/AtlasBanner.cs +++ b/Items/Placeables/Banners/AtlasBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class AtlasBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BOHLDOHRBanner.cs b/Items/Placeables/Banners/BOHLDOHRBanner.cs index ac173eb9cb..45673df81f 100644 --- a/Items/Placeables/Banners/BOHLDOHRBanner.cs +++ b/Items/Placeables/Banners/BOHLDOHRBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BOHLDOHRBanner : ModItem @@ -19,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BelchingCoralBanner.cs b/Items/Placeables/Banners/BelchingCoralBanner.cs index b0b7ebacb2..27309b958c 100644 --- a/Items/Placeables/Banners/BelchingCoralBanner.cs +++ b/Items/Placeables/Banners/BelchingCoralBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BelchingCoralBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BigSightseerBanner.cs b/Items/Placeables/Banners/BigSightseerBanner.cs index cb419504d3..6b1ceb6c3d 100644 --- a/Items/Placeables/Banners/BigSightseerBanner.cs +++ b/Items/Placeables/Banners/BigSightseerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BigSightseerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BlightedEyeBanner.cs b/Items/Placeables/Banners/BlightedEyeBanner.cs index ae07f36a7d..48f0de0cc9 100644 --- a/Items/Placeables/Banners/BlightedEyeBanner.cs +++ b/Items/Placeables/Banners/BlightedEyeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BlightedEyeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BlindedAnglerBanner.cs b/Items/Placeables/Banners/BlindedAnglerBanner.cs index 070f8e1c6f..bbf79bfb9f 100644 --- a/Items/Placeables/Banners/BlindedAnglerBanner.cs +++ b/Items/Placeables/Banners/BlindedAnglerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BlindedAnglerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BloatfishBanner.cs b/Items/Placeables/Banners/BloatfishBanner.cs index c6a4823fb3..02ec821518 100644 --- a/Items/Placeables/Banners/BloatfishBanner.cs +++ b/Items/Placeables/Banners/BloatfishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BloatfishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BloomSlimeBanner.cs b/Items/Placeables/Banners/BloomSlimeBanner.cs index 4fb161e5ed..85361bdaed 100644 --- a/Items/Placeables/Banners/BloomSlimeBanner.cs +++ b/Items/Placeables/Banners/BloomSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BloomSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BobbitWormBanner.cs b/Items/Placeables/Banners/BobbitWormBanner.cs index 4233e350ee..7b8222ed25 100644 --- a/Items/Placeables/Banners/BobbitWormBanner.cs +++ b/Items/Placeables/Banners/BobbitWormBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BobbitWormBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/BoxJellyfishBanner.cs b/Items/Placeables/Banners/BoxJellyfishBanner.cs index 9bac884dff..c40e47ede1 100644 --- a/Items/Placeables/Banners/BoxJellyfishBanner.cs +++ b/Items/Placeables/Banners/BoxJellyfishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class BoxJellyfishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CalamityEyeBanner.cs b/Items/Placeables/Banners/CalamityEyeBanner.cs index 2277376047..346262bae4 100644 --- a/Items/Placeables/Banners/CalamityEyeBanner.cs +++ b/Items/Placeables/Banners/CalamityEyeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CalamityEyeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CatfishBanner.cs b/Items/Placeables/Banners/CatfishBanner.cs index a8bbd2c4d4..5d6273c753 100644 --- a/Items/Placeables/Banners/CatfishBanner.cs +++ b/Items/Placeables/Banners/CatfishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CatfishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ChaoticPufferBanner.cs b/Items/Placeables/Banners/ChaoticPufferBanner.cs index b323eeea91..a80af3f84a 100644 --- a/Items/Placeables/Banners/ChaoticPufferBanner.cs +++ b/Items/Placeables/Banners/ChaoticPufferBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class ChaoticPufferBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CharredSlimeBanner.cs b/Items/Placeables/Banners/CharredSlimeBanner.cs index 99c5c70d89..0681c17b24 100644 --- a/Items/Placeables/Banners/CharredSlimeBanner.cs +++ b/Items/Placeables/Banners/CharredSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CharredSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ClamBanner.cs b/Items/Placeables/Banners/ClamBanner.cs index f3b7ad5e2d..4e0418cc7e 100644 --- a/Items/Placeables/Banners/ClamBanner.cs +++ b/Items/Placeables/Banners/ClamBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class ClamBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CloudElementalBanner.cs b/Items/Placeables/Banners/CloudElementalBanner.cs index 3afccf66bb..21962c1dea 100644 --- a/Items/Placeables/Banners/CloudElementalBanner.cs +++ b/Items/Placeables/Banners/CloudElementalBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CloudElementalBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CnidrionBanner.cs b/Items/Placeables/Banners/CnidrionBanner.cs index 0a67bb2dd7..c309e6329a 100644 --- a/Items/Placeables/Banners/CnidrionBanner.cs +++ b/Items/Placeables/Banners/CnidrionBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CnidrionBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ColossalSquidBanner.cs b/Items/Placeables/Banners/ColossalSquidBanner.cs index ae0b8fe331..fa91f8b31b 100644 --- a/Items/Placeables/Banners/ColossalSquidBanner.cs +++ b/Items/Placeables/Banners/ColossalSquidBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class ColossalSquidBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CosmicElementalBanner.cs b/Items/Placeables/Banners/CosmicElementalBanner.cs index c4cae536eb..0ed480f326 100644 --- a/Items/Placeables/Banners/CosmicElementalBanner.cs +++ b/Items/Placeables/Banners/CosmicElementalBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CosmicElementalBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs index c63684e5f1..990ef90a8e 100644 --- a/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs +++ b/Items/Placeables/Banners/CrimulanBlightSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CrimulanBlightSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CryoSlimeBanner.cs b/Items/Placeables/Banners/CryoSlimeBanner.cs index 9b5de6242c..381697930a 100644 --- a/Items/Placeables/Banners/CryoSlimeBanner.cs +++ b/Items/Placeables/Banners/CryoSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CryoSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CryonBanner.cs b/Items/Placeables/Banners/CryonBanner.cs index c24cbac2d9..aad771be2e 100644 --- a/Items/Placeables/Banners/CryonBanner.cs +++ b/Items/Placeables/Banners/CryonBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CryonBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CrystalCrawlerBanner.cs b/Items/Placeables/Banners/CrystalCrawlerBanner.cs index 2746679129..e3a19dfd06 100644 --- a/Items/Placeables/Banners/CrystalCrawlerBanner.cs +++ b/Items/Placeables/Banners/CrystalCrawlerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CrystalCrawlerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CultistAssassinBanner.cs b/Items/Placeables/Banners/CultistAssassinBanner.cs index caab76dc4c..a185a08226 100644 --- a/Items/Placeables/Banners/CultistAssassinBanner.cs +++ b/Items/Placeables/Banners/CultistAssassinBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CultistAssassinBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/CuttlefishBanner.cs b/Items/Placeables/Banners/CuttlefishBanner.cs index e056737c7d..cfecdc73e0 100644 --- a/Items/Placeables/Banners/CuttlefishBanner.cs +++ b/Items/Placeables/Banners/CuttlefishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class CuttlefishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/DespairStoneBanner.cs b/Items/Placeables/Banners/DespairStoneBanner.cs index 4b1622a0a0..1c9ca52553 100644 --- a/Items/Placeables/Banners/DespairStoneBanner.cs +++ b/Items/Placeables/Banners/DespairStoneBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class DespairStoneBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/DevilFishBanner.cs b/Items/Placeables/Banners/DevilFishBanner.cs index 8c6d29ee18..5ffddb2283 100644 --- a/Items/Placeables/Banners/DevilFishBanner.cs +++ b/Items/Placeables/Banners/DevilFishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class DevilFishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/DiamondCrawlerBanner.cs b/Items/Placeables/Banners/DiamondCrawlerBanner.cs index 2497ea8f80..c7474cf1dc 100644 --- a/Items/Placeables/Banners/DiamondCrawlerBanner.cs +++ b/Items/Placeables/Banners/DiamondCrawlerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class DiamondCrawlerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EarthElementalBanner.cs b/Items/Placeables/Banners/EarthElementalBanner.cs index d44dd99d8a..8576860689 100644 --- a/Items/Placeables/Banners/EarthElementalBanner.cs +++ b/Items/Placeables/Banners/EarthElementalBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EarthElementalBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs b/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs index fc46abc8bc..7f46434e39 100644 --- a/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs +++ b/Items/Placeables/Banners/EbonianBlightSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EbonianBlightSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EidolistBanner.cs b/Items/Placeables/Banners/EidolistBanner.cs index ffab3e2aa9..7607c1c55e 100644 --- a/Items/Placeables/Banners/EidolistBanner.cs +++ b/Items/Placeables/Banners/EidolistBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EidolistBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs index 39c44b1bcf..73a1614d21 100644 --- a/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs +++ b/Items/Placeables/Banners/EidolonWyrmJuvenileBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EidolonWyrmJuvenileBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EmeraldCrawlerBanner.cs b/Items/Placeables/Banners/EmeraldCrawlerBanner.cs index 80059761c3..df9dce31bd 100644 --- a/Items/Placeables/Banners/EmeraldCrawlerBanner.cs +++ b/Items/Placeables/Banners/EmeraldCrawlerBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EmeraldCrawlerBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/EutrophicRayBanner.cs b/Items/Placeables/Banners/EutrophicRayBanner.cs index 1b3a31115b..b7945b7245 100644 --- a/Items/Placeables/Banners/EutrophicRayBanner.cs +++ b/Items/Placeables/Banners/EutrophicRayBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class EutrophicRayBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/FearlessGoldfishWarriorBanner.cs b/Items/Placeables/Banners/FearlessGoldfishWarriorBanner.cs index d4cebdd680..69e015be8c 100644 --- a/Items/Placeables/Banners/FearlessGoldfishWarriorBanner.cs +++ b/Items/Placeables/Banners/FearlessGoldfishWarriorBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FearlessGoldfishWarriorBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.Calamity().customRarity = CalamityRarity.Dedicated; diff --git a/Items/Placeables/Banners/FlakBabyBanner.cs b/Items/Placeables/Banners/FlakBabyBanner.cs index 29b0b236b0..dfca97b3be 100644 --- a/Items/Placeables/Banners/FlakBabyBanner.cs +++ b/Items/Placeables/Banners/FlakBabyBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FlakBabyBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/FlakCrabBanner.cs b/Items/Placeables/Banners/FlakCrabBanner.cs index 4bb2c9e879..d9f3f718ad 100644 --- a/Items/Placeables/Banners/FlakCrabBanner.cs +++ b/Items/Placeables/Banners/FlakCrabBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FlakCrabBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/FlounderBanner.cs b/Items/Placeables/Banners/FlounderBanner.cs index 61f71a5e5d..6b133df1bc 100644 --- a/Items/Placeables/Banners/FlounderBanner.cs +++ b/Items/Placeables/Banners/FlounderBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FlounderBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/FrogfishBanner.cs b/Items/Placeables/Banners/FrogfishBanner.cs index d7278c1157..3317f42898 100644 --- a/Items/Placeables/Banners/FrogfishBanner.cs +++ b/Items/Placeables/Banners/FrogfishBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FrogfishBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/FusionFeederBanner.cs b/Items/Placeables/Banners/FusionFeederBanner.cs index 66082de9ed..12c8d1b076 100644 --- a/Items/Placeables/Banners/FusionFeederBanner.cs +++ b/Items/Placeables/Banners/FusionFeederBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class FusionFeederBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GammaSlimeBanner.cs b/Items/Placeables/Banners/GammaSlimeBanner.cs index 5e2e674225..9f30e295cb 100644 --- a/Items/Placeables/Banners/GammaSlimeBanner.cs +++ b/Items/Placeables/Banners/GammaSlimeBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GammaSlimeBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GhostBellBanner.cs b/Items/Placeables/Banners/GhostBellBanner.cs index 16549d78f6..0b9315c080 100644 --- a/Items/Placeables/Banners/GhostBellBanner.cs +++ b/Items/Placeables/Banners/GhostBellBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GhostBellBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GhostBellSmallBanner.cs b/Items/Placeables/Banners/GhostBellSmallBanner.cs index dc9294b644..537550e25c 100644 --- a/Items/Placeables/Banners/GhostBellSmallBanner.cs +++ b/Items/Placeables/Banners/GhostBellSmallBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GhostBellSmallBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GiantClamBanner.cs b/Items/Placeables/Banners/GiantClamBanner.cs index b851a0bd40..1846e58205 100644 --- a/Items/Placeables/Banners/GiantClamBanner.cs +++ b/Items/Placeables/Banners/GiantClamBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GiantClamBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GiantSquidBanner.cs b/Items/Placeables/Banners/GiantSquidBanner.cs index 158b183bee..0e09f1d07d 100644 --- a/Items/Placeables/Banners/GiantSquidBanner.cs +++ b/Items/Placeables/Banners/GiantSquidBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GiantSquidBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GnasherBanner.cs b/Items/Placeables/Banners/GnasherBanner.cs index 5d3a9a149c..6ecf709e5e 100644 --- a/Items/Placeables/Banners/GnasherBanner.cs +++ b/Items/Placeables/Banners/GnasherBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GnasherBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GreatSandSharkBanner.cs b/Items/Placeables/Banners/GreatSandSharkBanner.cs index cc853eed01..b02e134f52 100644 --- a/Items/Placeables/Banners/GreatSandSharkBanner.cs +++ b/Items/Placeables/Banners/GreatSandSharkBanner.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Banners { public class GreatSandSharkBanner : ModItem @@ -14,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/GulperEelBanner.cs b/Items/Placeables/Banners/GulperEelBanner.cs index fd08483679..ba896d6188 100644 --- a/Items/Placeables/Banners/GulperEelBanner.cs +++ b/Items/Placeables/Banners/GulperEelBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/HadarianBanner.cs b/Items/Placeables/Banners/HadarianBanner.cs index c633bcb3d1..32f21d7c5c 100644 --- a/Items/Placeables/Banners/HadarianBanner.cs +++ b/Items/Placeables/Banners/HadarianBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/HeatSpiritBanner.cs b/Items/Placeables/Banners/HeatSpiritBanner.cs index d32c96f78a..b3d837b5b4 100644 --- a/Items/Placeables/Banners/HeatSpiritBanner.cs +++ b/Items/Placeables/Banners/HeatSpiritBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/HiveBanner.cs b/Items/Placeables/Banners/HiveBanner.cs index fed64a63df..63a93d2073 100644 --- a/Items/Placeables/Banners/HiveBanner.cs +++ b/Items/Placeables/Banners/HiveBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/IceClasperBanner.cs b/Items/Placeables/Banners/IceClasperBanner.cs index 8f54d7e49d..497ce6b2b3 100644 --- a/Items/Placeables/Banners/IceClasperBanner.cs +++ b/Items/Placeables/Banners/IceClasperBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ImpiousImmolatorBanner.cs b/Items/Placeables/Banners/ImpiousImmolatorBanner.cs index 1b9140e3ed..0f1d1dfd39 100644 --- a/Items/Placeables/Banners/ImpiousImmolatorBanner.cs +++ b/Items/Placeables/Banners/ImpiousImmolatorBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/IrradiatedSlimeBanner.cs b/Items/Placeables/Banners/IrradiatedSlimeBanner.cs index 20b88a97cc..d7682a21e6 100644 --- a/Items/Placeables/Banners/IrradiatedSlimeBanner.cs +++ b/Items/Placeables/Banners/IrradiatedSlimeBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/LaserfishBanner.cs b/Items/Placeables/Banners/LaserfishBanner.cs index 75f5c7d19c..76b9874ed6 100644 --- a/Items/Placeables/Banners/LaserfishBanner.cs +++ b/Items/Placeables/Banners/LaserfishBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/LuminousCorvinaBanner.cs b/Items/Placeables/Banners/LuminousCorvinaBanner.cs index 790d4548d9..8fe351a899 100644 --- a/Items/Placeables/Banners/LuminousCorvinaBanner.cs +++ b/Items/Placeables/Banners/LuminousCorvinaBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MantisBanner.cs b/Items/Placeables/Banners/MantisBanner.cs index bb7526f9d3..4b1199c86e 100644 --- a/Items/Placeables/Banners/MantisBanner.cs +++ b/Items/Placeables/Banners/MantisBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MantisShrimpBanner.cs b/Items/Placeables/Banners/MantisShrimpBanner.cs index d43a5957bc..997a6d30b3 100644 --- a/Items/Placeables/Banners/MantisShrimpBanner.cs +++ b/Items/Placeables/Banners/MantisShrimpBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MaulerBanner.cs b/Items/Placeables/Banners/MaulerBanner.cs index 45595f8948..eb0ca8ab57 100644 --- a/Items/Placeables/Banners/MaulerBanner.cs +++ b/Items/Placeables/Banners/MaulerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MelterBanner.cs b/Items/Placeables/Banners/MelterBanner.cs index 24bcf8c5a8..0b8766b536 100644 --- a/Items/Placeables/Banners/MelterBanner.cs +++ b/Items/Placeables/Banners/MelterBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MirageJellyBanner.cs b/Items/Placeables/Banners/MirageJellyBanner.cs index afe0883655..21a417cd45 100644 --- a/Items/Placeables/Banners/MirageJellyBanner.cs +++ b/Items/Placeables/Banners/MirageJellyBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/MorayEelBanner.cs b/Items/Placeables/Banners/MorayEelBanner.cs index a266569976..7d0d65524a 100644 --- a/Items/Placeables/Banners/MorayEelBanner.cs +++ b/Items/Placeables/Banners/MorayEelBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/NovaBanner.cs b/Items/Placeables/Banners/NovaBanner.cs index c9ef071793..9931312d93 100644 --- a/Items/Placeables/Banners/NovaBanner.cs +++ b/Items/Placeables/Banners/NovaBanner.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Banners { public class NovaBanner : ModItem @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/NuclearToadBanner.cs b/Items/Placeables/Banners/NuclearToadBanner.cs index ef770b8866..7e56b4d694 100644 --- a/Items/Placeables/Banners/NuclearToadBanner.cs +++ b/Items/Placeables/Banners/NuclearToadBanner.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Banners { public class NuclearToadBanner : ModItem @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/OarfishBanner.cs b/Items/Placeables/Banners/OarfishBanner.cs index 56b36f6e78..16022eb63b 100644 --- a/Items/Placeables/Banners/OarfishBanner.cs +++ b/Items/Placeables/Banners/OarfishBanner.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Banners { public class OarfishBanner : ModItem @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/OrthoceraBanner.cs b/Items/Placeables/Banners/OrthoceraBanner.cs index 565ae130ee..85310742c6 100644 --- a/Items/Placeables/Banners/OrthoceraBanner.cs +++ b/Items/Placeables/Banners/OrthoceraBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/OverloadedSoldierBanner.cs b/Items/Placeables/Banners/OverloadedSoldierBanner.cs index 6a18b20edb..a1766a486d 100644 --- a/Items/Placeables/Banners/OverloadedSoldierBanner.cs +++ b/Items/Placeables/Banners/OverloadedSoldierBanner.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Banners { public class OverloadedSoldierBanner : ModItem @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ParaseaBanner.cs b/Items/Placeables/Banners/ParaseaBanner.cs index 8e30599c52..b0f09b0d37 100644 --- a/Items/Placeables/Banners/ParaseaBanner.cs +++ b/Items/Placeables/Banners/ParaseaBanner.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Banners { public class ParaseaBanner : ModItem @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PerennialSlimeBanner.cs b/Items/Placeables/Banners/PerennialSlimeBanner.cs index 22e645564a..98ad464b70 100644 --- a/Items/Placeables/Banners/PerennialSlimeBanner.cs +++ b/Items/Placeables/Banners/PerennialSlimeBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PestilentSlimeBanner.cs b/Items/Placeables/Banners/PestilentSlimeBanner.cs index f1dda5d542..7f3a0547d8 100644 --- a/Items/Placeables/Banners/PestilentSlimeBanner.cs +++ b/Items/Placeables/Banners/PestilentSlimeBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PhantomDebrisBanner.cs b/Items/Placeables/Banners/PhantomDebrisBanner.cs index 73cb25a259..b6b5bc6e97 100644 --- a/Items/Placeables/Banners/PhantomDebrisBanner.cs +++ b/Items/Placeables/Banners/PhantomDebrisBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PhantomSpiritBanner.cs b/Items/Placeables/Banners/PhantomSpiritBanner.cs index fb7486aa62..7cdf7b3bc1 100644 --- a/Items/Placeables/Banners/PhantomSpiritBanner.cs +++ b/Items/Placeables/Banners/PhantomSpiritBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PiggyBanner.cs b/Items/Placeables/Banners/PiggyBanner.cs index d54624180e..5ef0b3fae4 100644 --- a/Items/Placeables/Banners/PiggyBanner.cs +++ b/Items/Placeables/Banners/PiggyBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.Calamity().customRarity = CalamityRarity.Dedicated; diff --git a/Items/Placeables/Banners/PitbullBanner.cs b/Items/Placeables/Banners/PitbullBanner.cs index e3702fd7d0..ab5484f0bc 100644 --- a/Items/Placeables/Banners/PitbullBanner.cs +++ b/Items/Placeables/Banners/PitbullBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PlagueChargerBanner.cs b/Items/Placeables/Banners/PlagueChargerBanner.cs index aefc041a76..9e5d52ce37 100644 --- a/Items/Placeables/Banners/PlagueChargerBanner.cs +++ b/Items/Placeables/Banners/PlagueChargerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PlaguebringerBanner.cs b/Items/Placeables/Banners/PlaguebringerBanner.cs index 612fc00d31..506f625262 100644 --- a/Items/Placeables/Banners/PlaguebringerBanner.cs +++ b/Items/Placeables/Banners/PlaguebringerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PlagueshellBanner.cs b/Items/Placeables/Banners/PlagueshellBanner.cs index d2f7d506f5..3d3d9976ea 100644 --- a/Items/Placeables/Banners/PlagueshellBanner.cs +++ b/Items/Placeables/Banners/PlagueshellBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/PrismTurtleBanner.cs b/Items/Placeables/Banners/PrismTurtleBanner.cs index 0fec0e60cd..16a5070d8f 100644 --- a/Items/Placeables/Banners/PrismTurtleBanner.cs +++ b/Items/Placeables/Banners/PrismTurtleBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ProfanedEnergyBanner.cs b/Items/Placeables/Banners/ProfanedEnergyBanner.cs index b39234997f..8bbcdc7c88 100644 --- a/Items/Placeables/Banners/ProfanedEnergyBanner.cs +++ b/Items/Placeables/Banners/ProfanedEnergyBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/RadiatorBanner.cs b/Items/Placeables/Banners/RadiatorBanner.cs index aad7677f23..74e16b83ef 100644 --- a/Items/Placeables/Banners/RadiatorBanner.cs +++ b/Items/Placeables/Banners/RadiatorBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ReaperSharkBanner.cs b/Items/Placeables/Banners/ReaperSharkBanner.cs index 469cb23411..930dc1d033 100644 --- a/Items/Placeables/Banners/ReaperSharkBanner.cs +++ b/Items/Placeables/Banners/ReaperSharkBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/RubyCrawlerBanner.cs b/Items/Placeables/Banners/RubyCrawlerBanner.cs index 950f47aad0..cb787e3e07 100644 --- a/Items/Placeables/Banners/RubyCrawlerBanner.cs +++ b/Items/Placeables/Banners/RubyCrawlerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SandTortoiseBanner.cs b/Items/Placeables/Banners/SandTortoiseBanner.cs index 9ddc190f8d..5eeb70405a 100644 --- a/Items/Placeables/Banners/SandTortoiseBanner.cs +++ b/Items/Placeables/Banners/SandTortoiseBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SapphireCrawlerBanner.cs b/Items/Placeables/Banners/SapphireCrawlerBanner.cs index adec5a0cef..f1b163d6a5 100644 --- a/Items/Placeables/Banners/SapphireCrawlerBanner.cs +++ b/Items/Placeables/Banners/SapphireCrawlerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ScornEaterBanner.cs b/Items/Placeables/Banners/ScornEaterBanner.cs index 0502bb7195..ae78629bdb 100644 --- a/Items/Placeables/Banners/ScornEaterBanner.cs +++ b/Items/Placeables/Banners/ScornEaterBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ScryllarBanner.cs b/Items/Placeables/Banners/ScryllarBanner.cs index 1f1522365e..f89f306d60 100644 --- a/Items/Placeables/Banners/ScryllarBanner.cs +++ b/Items/Placeables/Banners/ScryllarBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SeaFloatyBanner.cs b/Items/Placeables/Banners/SeaFloatyBanner.cs index d73a1351dd..50b090c5b3 100644 --- a/Items/Placeables/Banners/SeaFloatyBanner.cs +++ b/Items/Placeables/Banners/SeaFloatyBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SeaMinnowBanner.cs b/Items/Placeables/Banners/SeaMinnowBanner.cs index a13566e49c..9f7f15414a 100644 --- a/Items/Placeables/Banners/SeaMinnowBanner.cs +++ b/Items/Placeables/Banners/SeaMinnowBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SeaSerpentBanner.cs b/Items/Placeables/Banners/SeaSerpentBanner.cs index c7563349bb..e8be035af1 100644 --- a/Items/Placeables/Banners/SeaSerpentBanner.cs +++ b/Items/Placeables/Banners/SeaSerpentBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SeaUrchinBanner.cs b/Items/Placeables/Banners/SeaUrchinBanner.cs index c90d6223e9..87446a7eaa 100644 --- a/Items/Placeables/Banners/SeaUrchinBanner.cs +++ b/Items/Placeables/Banners/SeaUrchinBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ShockstormShuttleBanner.cs b/Items/Placeables/Banners/ShockstormShuttleBanner.cs index e947dacbef..a55f0f2073 100644 --- a/Items/Placeables/Banners/ShockstormShuttleBanner.cs +++ b/Items/Placeables/Banners/ShockstormShuttleBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SkyfinBanner.cs b/Items/Placeables/Banners/SkyfinBanner.cs index 94408ffd0c..9a74793882 100644 --- a/Items/Placeables/Banners/SkyfinBanner.cs +++ b/Items/Placeables/Banners/SkyfinBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SmallSightseerBanner.cs b/Items/Placeables/Banners/SmallSightseerBanner.cs index 0301cd78a6..4f0cacc1a5 100644 --- a/Items/Placeables/Banners/SmallSightseerBanner.cs +++ b/Items/Placeables/Banners/SmallSightseerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SoulSluperBanner.cs b/Items/Placeables/Banners/SoulSluperBanner.cs index c4f5d9fa74..559fed4cac 100644 --- a/Items/Placeables/Banners/SoulSluperBanner.cs +++ b/Items/Placeables/Banners/SoulSluperBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/StellarCulexBanner.cs b/Items/Placeables/Banners/StellarCulexBanner.cs index 7fbd7b9425..167451763e 100644 --- a/Items/Placeables/Banners/StellarCulexBanner.cs +++ b/Items/Placeables/Banners/StellarCulexBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/StormlionBanner.cs b/Items/Placeables/Banners/StormlionBanner.cs index 262f0eab35..607edb3c09 100644 --- a/Items/Placeables/Banners/StormlionBanner.cs +++ b/Items/Placeables/Banners/StormlionBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SulfurousSkaterBanner.cs b/Items/Placeables/Banners/SulfurousSkaterBanner.cs index 15d32c0314..78f2010fbc 100644 --- a/Items/Placeables/Banners/SulfurousSkaterBanner.cs +++ b/Items/Placeables/Banners/SulfurousSkaterBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SunBatBanner.cs b/Items/Placeables/Banners/SunBatBanner.cs index 6c45c2fd15..1dd92c983e 100644 --- a/Items/Placeables/Banners/SunBatBanner.cs +++ b/Items/Placeables/Banners/SunBatBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/SunskaterBanner.cs b/Items/Placeables/Banners/SunskaterBanner.cs index 1c432a9838..7218e83b9a 100644 --- a/Items/Placeables/Banners/SunskaterBanner.cs +++ b/Items/Placeables/Banners/SunskaterBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/TopazCrawlerBanner.cs b/Items/Placeables/Banners/TopazCrawlerBanner.cs index 44756ed8a8..2f8c6408a3 100644 --- a/Items/Placeables/Banners/TopazCrawlerBanner.cs +++ b/Items/Placeables/Banners/TopazCrawlerBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ToxicMinnowBanner.cs b/Items/Placeables/Banners/ToxicMinnowBanner.cs index ddf2fe041d..6a7b032f05 100644 --- a/Items/Placeables/Banners/ToxicMinnowBanner.cs +++ b/Items/Placeables/Banners/ToxicMinnowBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/TrasherBanner.cs b/Items/Placeables/Banners/TrasherBanner.cs index 6cba060dd2..8ce4e2c091 100644 --- a/Items/Placeables/Banners/TrasherBanner.cs +++ b/Items/Placeables/Banners/TrasherBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/TrilobiteBanner.cs b/Items/Placeables/Banners/TrilobiteBanner.cs index d730d9c795..ec137ee2fa 100644 --- a/Items/Placeables/Banners/TrilobiteBanner.cs +++ b/Items/Placeables/Banners/TrilobiteBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/ViperfishBanner.cs b/Items/Placeables/Banners/ViperfishBanner.cs index a8517af5c2..f8adb6039c 100644 --- a/Items/Placeables/Banners/ViperfishBanner.cs +++ b/Items/Placeables/Banners/ViperfishBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/VirulingBanner.cs b/Items/Placeables/Banners/VirulingBanner.cs index 71c9d0d7ae..a752842fb5 100644 --- a/Items/Placeables/Banners/VirulingBanner.cs +++ b/Items/Placeables/Banners/VirulingBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/WaterLeechBanner.cs b/Items/Placeables/Banners/WaterLeechBanner.cs index bea85e2872..b204dbe622 100644 --- a/Items/Placeables/Banners/WaterLeechBanner.cs +++ b/Items/Placeables/Banners/WaterLeechBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/WulfrumDroneBanner.cs b/Items/Placeables/Banners/WulfrumDroneBanner.cs index ebcac4d817..ff900a9127 100644 --- a/Items/Placeables/Banners/WulfrumDroneBanner.cs +++ b/Items/Placeables/Banners/WulfrumDroneBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/Banners/WulfrumSlimeBanner.cs b/Items/Placeables/Banners/WulfrumSlimeBanner.cs index bb186aeaa3..f3b561b2d6 100644 --- a/Items/Placeables/Banners/WulfrumSlimeBanner.cs +++ b/Items/Placeables/Banners/WulfrumSlimeBanner.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Banners item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.rare = 1; item.value = Item.buyPrice(0, 0, 10, 0); diff --git a/Items/Placeables/BrimstoneSlag.cs b/Items/Placeables/BrimstoneSlag.cs index 70cdcab8de..772a990283 100644 --- a/Items/Placeables/BrimstoneSlag.cs +++ b/Items/Placeables/BrimstoneSlag.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/ChaoticBrick.cs b/Items/Placeables/ChaoticBrick.cs index b4a83669c8..c43f026b1e 100644 --- a/Items/Placeables/ChaoticBrick.cs +++ b/Items/Placeables/ChaoticBrick.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -27,13 +27,13 @@ namespace CalamityMod.Items.Placeables ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.StoneBlock, 1); recipe.AddIngredient(ModContent.ItemType(), 1); - recipe.AddTile(17); + recipe.AddTile(TileID.Furnaces); recipe.SetResult(this, 1); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 1); recipe.AddRecipe(); } diff --git a/Items/Placeables/Cinderplate.cs b/Items/Placeables/Cinderplate.cs index df66db992d..0f5ebf5a9f 100644 --- a/Items/Placeables/Cinderplate.cs +++ b/Items/Placeables/Cinderplate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/CryonicBrick.cs b/Items/Placeables/CryonicBrick.cs index 9da2176c45..502aebbd95 100644 --- a/Items/Placeables/CryonicBrick.cs +++ b/Items/Placeables/CryonicBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/EutrophicSand.cs b/Items/Placeables/EutrophicSand.cs index 5a520eac8a..2e33dc490d 100644 --- a/Items/Placeables/EutrophicSand.cs +++ b/Items/Placeables/EutrophicSand.cs @@ -1,5 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables { public class EutrophicSand : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -27,7 +29,7 @@ namespace CalamityMod.Items.Placeables { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Placeables/Furniture/AstralChest.cs b/Items/Placeables/Furniture/AstralChest.cs index 93c7a932b5..00cc6bf3b8 100644 --- a/Items/Placeables/Furniture/AstralChest.cs +++ b/Items/Placeables/Furniture/AstralChest.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Astral; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture { public class AstralChest : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 500; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/Furniture/BabyFlakHermitCage.cs b/Items/Placeables/Furniture/BabyFlakHermitCage.cs index 670855cfdd..c2d3a2e74f 100644 --- a/Items/Placeables/Furniture/BabyFlakHermitCage.cs +++ b/Items/Placeables/Furniture/BabyFlakHermitCage.cs @@ -1,12 +1,11 @@ using CalamityMod.Tiles.Furniture; using CalamityMod.Items.Critters; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { - public class BabyFlakHermitCage : ModItem + public class BabyFlakHermitCage : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/BabyGhostBellJar.cs b/Items/Placeables/Furniture/BabyGhostBellJar.cs index d20c7c590f..bc1c7e26f8 100644 --- a/Items/Placeables/Furniture/BabyGhostBellJar.cs +++ b/Items/Placeables/Furniture/BabyGhostBellJar.cs @@ -1,12 +1,11 @@ using CalamityMod.Tiles.Furniture; using CalamityMod.Items.Critters; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { - public class BabyGhostBellJar : ModItem + public class BabyGhostBellJar : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/BlueCandle.cs b/Items/Placeables/Furniture/BlueCandle.cs index 5153f4ca6d..b7d85d8553 100644 --- a/Items/Placeables/Furniture/BlueCandle.cs +++ b/Items/Placeables/Furniture/BlueCandle.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 50, 0, 0); item.rare = 6; diff --git a/Items/Placeables/Furniture/ChaosCandle.cs b/Items/Placeables/Furniture/ChaosCandle.cs index b2a12ace09..09e7e6fb1f 100644 --- a/Items/Placeables/Furniture/ChaosCandle.cs +++ b/Items/Placeables/Furniture/ChaosCandle.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 500; item.createTile = ModContent.TileType(); @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Placeables.Furniture recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Furniture/CorruptionEffigy.cs b/Items/Placeables/Furniture/CorruptionEffigy.cs index 33dff32e42..8fa2c09af0 100644 --- a/Items/Placeables/Furniture/CorruptionEffigy.cs +++ b/Items/Placeables/Furniture/CorruptionEffigy.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 9, 0, 0); item.rare = 3; diff --git a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs b/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs index f4701f2c16..fc6bddd353 100644 --- a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs +++ b/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs b/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs index 7c75e3a471..aae043ab5d 100644 --- a/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs +++ b/Items/Placeables/Furniture/CraftingStations/AshenAltar.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.value = 0; item.consumable = true; diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs index 8698fb8470..512c19c5fd 100644 --- a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ItemID.JungleSpores, 5); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs index 411692b680..ea2510ae06 100644 --- a/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs +++ b/Items/Placeables/Furniture/CraftingStations/DraedonsForge.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 5000000; item.rare = 10; diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicCrafting.cs b/Items/Placeables/Furniture/CraftingStations/EutrophicCrafting.cs index 25425be023..1070f682b0 100644 --- a/Items/Placeables/Furniture/CraftingStations/EutrophicCrafting.cs +++ b/Items/Placeables/Furniture/CraftingStations/EutrophicCrafting.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs index 67bcd25083..6c80fb13f3 100644 --- a/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs +++ b/Items/Placeables/Furniture/CraftingStations/MonolithCrafting.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/PlagueInfuser.cs b/Items/Placeables/Furniture/CraftingStations/PlagueInfuser.cs index 28c00dd152..c87cb398df 100644 --- a/Items/Placeables/Furniture/CraftingStations/PlagueInfuser.cs +++ b/Items/Placeables/Furniture/CraftingStations/PlagueInfuser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/ProfanedBasin.cs b/Items/Placeables/Furniture/CraftingStations/ProfanedBasin.cs index b57b64fb73..a502089377 100644 --- a/Items/Placeables/Furniture/CraftingStations/ProfanedBasin.cs +++ b/Items/Placeables/Furniture/CraftingStations/ProfanedBasin.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs index 8960cb33af..c4f6d12f5c 100644 --- a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs +++ b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureSilva; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { public class SilvaBasin : ModItem @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs index d99275ad05..f955dca894 100644 --- a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs +++ b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CraftingStations/VoidCondenser.cs b/Items/Placeables/Furniture/CraftingStations/VoidCondenser.cs index d645cd057a..6e87338026 100644 --- a/Items/Placeables/Furniture/CraftingStations/VoidCondenser.cs +++ b/Items/Placeables/Furniture/CraftingStations/VoidCondenser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/CrimsonEffigy.cs b/Items/Placeables/Furniture/CrimsonEffigy.cs index 42c2395e01..33f172db0d 100644 --- a/Items/Placeables/Furniture/CrimsonEffigy.cs +++ b/Items/Placeables/Furniture/CrimsonEffigy.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 9, 0, 0); item.rare = 3; diff --git a/Items/Placeables/Furniture/EffigyOfDecay.cs b/Items/Placeables/Furniture/EffigyOfDecay.cs index 50eb4a6b11..5f3a3c6292 100644 --- a/Items/Placeables/Furniture/EffigyOfDecay.cs +++ b/Items/Placeables/Furniture/EffigyOfDecay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 9, 0, 0); item.rare = 3; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Placeables.Furniture public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 1); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddRecipeGroup("IronBar", 10); recipe.AddTile(TileID.Anvils); diff --git a/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs b/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs index f1f018affe..8fd17add27 100644 --- a/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/AbyssFountainItem.cs @@ -1,6 +1,7 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.Tiles.Furniture.Fountains; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture.Fountains { @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 0; diff --git a/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs b/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs index 7891da5667..518ca1e943 100644 --- a/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/AstralFountainItem.cs @@ -1,6 +1,7 @@ using Terraria; using Terraria.ModLoader; using CalamityMod.Tiles.Furniture.Fountains; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture.Fountains { @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 0; diff --git a/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs b/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs index 78316ac7b4..9b76db1934 100644 --- a/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs +++ b/Items/Placeables/Furniture/Fountains/SulphurousFountainItem.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Tiles.Furniture.Fountains; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 0; diff --git a/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs b/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs index 82099e5799..d796c97787 100644 --- a/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs +++ b/Items/Placeables/Furniture/Fountains/SunkenSeaFountain.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Tiles.Furniture.Fountains; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Fountains item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 0; diff --git a/Items/Placeables/Furniture/PiggyCage.cs b/Items/Placeables/Furniture/PiggyCage.cs index 869ccface4..93352b20b9 100644 --- a/Items/Placeables/Furniture/PiggyCage.cs +++ b/Items/Placeables/Furniture/PiggyCage.cs @@ -1,12 +1,11 @@ using CalamityMod.Tiles.Furniture; using CalamityMod.Items.Critters; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { - public class PiggyCage : ModItem + public class PiggyCage : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); item.Calamity().customRarity = CalamityRarity.Dedicated; diff --git a/Items/Placeables/Furniture/PinkCandle.cs b/Items/Placeables/Furniture/PinkCandle.cs index 4c28c62fb1..25300ade45 100644 --- a/Items/Placeables/Furniture/PinkCandle.cs +++ b/Items/Placeables/Furniture/PinkCandle.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 50, 0, 0); item.rare = 6; diff --git a/Items/Placeables/Furniture/PurpleCandle.cs b/Items/Placeables/Furniture/PurpleCandle.cs index 149a3c618c..b927ded18d 100644 --- a/Items/Placeables/Furniture/PurpleCandle.cs +++ b/Items/Placeables/Furniture/PurpleCandle.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 50, 0, 0); item.rare = 6; diff --git a/Items/Placeables/Furniture/RustyChest.cs b/Items/Placeables/Furniture/RustyChest.cs index 0230fb4cbc..768833221d 100644 --- a/Items/Placeables/Furniture/RustyChest.cs +++ b/Items/Placeables/Furniture/RustyChest.cs @@ -19,10 +19,10 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 500; - item.createTile = ModContent.TileType(); + item.createTile = ModContent.TileType(); } public override void AddRecipes() { diff --git a/Items/Placeables/Furniture/SeaMinnowJar.cs b/Items/Placeables/Furniture/SeaMinnowJar.cs index 11fdd0a76a..75c7243f49 100644 --- a/Items/Placeables/Furniture/SeaMinnowJar.cs +++ b/Items/Placeables/Furniture/SeaMinnowJar.cs @@ -1,12 +1,11 @@ using CalamityMod.Tiles.Furniture; using CalamityMod.Items.Critters; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { - public class SeaMinnowJar : ModItem + public class SeaMinnowJar : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/TranquilityCandle.cs b/Items/Placeables/Furniture/TranquilityCandle.cs index b72f6ec8a0..ead77f5fc0 100644 --- a/Items/Placeables/Furniture/TranquilityCandle.cs +++ b/Items/Placeables/Furniture/TranquilityCandle.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 500; item.createTile = ModContent.TileType(); @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Placeables.Furniture recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Furniture/Trophies/AquaticScourgeTrophy.cs b/Items/Placeables/Furniture/Trophies/AquaticScourgeTrophy.cs index ca6ee44061..3b8118122e 100644 --- a/Items/Placeables/Furniture/Trophies/AquaticScourgeTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/AquaticScourgeTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class AquaticScourgeTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/AstrageldonTrophy.cs b/Items/Placeables/Furniture/Trophies/AstrageldonTrophy.cs index ed0fb1f97a..0ee7ab393d 100644 --- a/Items/Placeables/Furniture/Trophies/AstrageldonTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/AstrageldonTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class AstrageldonTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/AstrumDeusTrophy.cs b/Items/Placeables/Furniture/Trophies/AstrumDeusTrophy.cs index db5e37636e..6bc3824e5e 100644 --- a/Items/Placeables/Furniture/Trophies/AstrumDeusTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/AstrumDeusTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class AstrumDeusTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/BrimstoneElementalTrophy.cs b/Items/Placeables/Furniture/Trophies/BrimstoneElementalTrophy.cs index 30fadd1a2a..635e64b756 100644 --- a/Items/Placeables/Furniture/Trophies/BrimstoneElementalTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/BrimstoneElementalTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class BrimstoneElementalTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/BumblebirbTrophy.cs b/Items/Placeables/Furniture/Trophies/BumblebirbTrophy.cs index e7cb9eef03..b54347c801 100644 --- a/Items/Placeables/Furniture/Trophies/BumblebirbTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/BumblebirbTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class BumblebirbTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs b/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs index 6eb6c24596..3531e9ffb9 100644 --- a/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CalamitasTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CalamitasTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CataclysmTrophy.cs b/Items/Placeables/Furniture/Trophies/CataclysmTrophy.cs index f5f8a242e2..050e5e5dcd 100644 --- a/Items/Placeables/Furniture/Trophies/CataclysmTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CataclysmTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CataclysmTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CatastropheTrophy.cs b/Items/Placeables/Furniture/Trophies/CatastropheTrophy.cs index 94df5c93a1..83ce3dc1ee 100644 --- a/Items/Placeables/Furniture/Trophies/CatastropheTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CatastropheTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CatastropheTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CeaselessVoidTrophy.cs b/Items/Placeables/Furniture/Trophies/CeaselessVoidTrophy.cs index f3d8c20422..cafd13e2a6 100644 --- a/Items/Placeables/Furniture/Trophies/CeaselessVoidTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CeaselessVoidTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CeaselessVoidTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CrabulonTrophy.cs b/Items/Placeables/Furniture/Trophies/CrabulonTrophy.cs index 0c236d19bb..4fb039f75e 100644 --- a/Items/Placeables/Furniture/Trophies/CrabulonTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CrabulonTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CrabulonTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/CryogenTrophy.cs b/Items/Placeables/Furniture/Trophies/CryogenTrophy.cs index 51a8ef30fd..7f388ab42c 100644 --- a/Items/Placeables/Furniture/Trophies/CryogenTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/CryogenTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class CryogenTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/DesertScourgeTrophy.cs b/Items/Placeables/Furniture/Trophies/DesertScourgeTrophy.cs index 9efc25a6f6..9becaa9747 100644 --- a/Items/Placeables/Furniture/Trophies/DesertScourgeTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/DesertScourgeTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class DesertScourgeTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/DevourerofGodsTrophy.cs b/Items/Placeables/Furniture/Trophies/DevourerofGodsTrophy.cs index 24d81caa65..b94f93296b 100644 --- a/Items/Placeables/Furniture/Trophies/DevourerofGodsTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/DevourerofGodsTrophy.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class DevourerofGodsTrophy : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/HiveMindTrophy.cs b/Items/Placeables/Furniture/Trophies/HiveMindTrophy.cs index 818e004fb3..340b2d13a1 100644 --- a/Items/Placeables/Furniture/Trophies/HiveMindTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/HiveMindTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/LeviathanTrophy.cs b/Items/Placeables/Furniture/Trophies/LeviathanTrophy.cs index 98eb9b77f9..1f21b2cf7f 100644 --- a/Items/Placeables/Furniture/Trophies/LeviathanTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/LeviathanTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/OldDukeTrophy.cs b/Items/Placeables/Furniture/Trophies/OldDukeTrophy.cs index 1c1016f360..c835466e09 100644 --- a/Items/Placeables/Furniture/Trophies/OldDukeTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/OldDukeTrophy.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Furniture.Trophies { public class OldDukeTrophy : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/PerforatorTrophy.cs b/Items/Placeables/Furniture/Trophies/PerforatorTrophy.cs index e82b31a827..6311f7cd6a 100644 --- a/Items/Placeables/Furniture/Trophies/PerforatorTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/PerforatorTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/PlaguebringerGoliathTrophy.cs b/Items/Placeables/Furniture/Trophies/PlaguebringerGoliathTrophy.cs index b239b1a48c..a14ee9ebeb 100644 --- a/Items/Placeables/Furniture/Trophies/PlaguebringerGoliathTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/PlaguebringerGoliathTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/PolterghastTrophy.cs b/Items/Placeables/Furniture/Trophies/PolterghastTrophy.cs index 8240ffe886..da56d6861e 100644 --- a/Items/Placeables/Furniture/Trophies/PolterghastTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/PolterghastTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/ProfanedGuardianTrophy.cs b/Items/Placeables/Furniture/Trophies/ProfanedGuardianTrophy.cs index d3edb826df..277a403418 100644 --- a/Items/Placeables/Furniture/Trophies/ProfanedGuardianTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/ProfanedGuardianTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/ProvidenceTrophy.cs b/Items/Placeables/Furniture/Trophies/ProvidenceTrophy.cs index feaaf5a724..e7ffbcdf24 100644 --- a/Items/Placeables/Furniture/Trophies/ProvidenceTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/ProvidenceTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/RavagerTrophy.cs b/Items/Placeables/Furniture/Trophies/RavagerTrophy.cs index 33e4eff343..1c968db2a4 100644 --- a/Items/Placeables/Furniture/Trophies/RavagerTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/RavagerTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/SignusTrophy.cs b/Items/Placeables/Furniture/Trophies/SignusTrophy.cs index 8058b75b21..2421e2707d 100644 --- a/Items/Placeables/Furniture/Trophies/SignusTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/SignusTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/SlimeGodTrophy.cs b/Items/Placeables/Furniture/Trophies/SlimeGodTrophy.cs index 39caeb0aea..799aebdaa9 100644 --- a/Items/Placeables/Furniture/Trophies/SlimeGodTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/SlimeGodTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs b/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs index 6601314ed5..e99c6bcbe1 100644 --- a/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/SupremeCalamitasTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs b/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs index bce48774bf..574644403f 100644 --- a/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/Trophies/YharonTrophy.cs b/Items/Placeables/Furniture/Trophies/YharonTrophy.cs index 0682c54246..d53a9068e6 100644 --- a/Items/Placeables/Furniture/Trophies/YharonTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/YharonTrophy.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.Trophies { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 50000; item.rare = 1; diff --git a/Items/Placeables/Furniture/TwinklerInABottle.cs b/Items/Placeables/Furniture/TwinklerInABottle.cs index 203ab8a369..0e87a4155e 100644 --- a/Items/Placeables/Furniture/TwinklerInABottle.cs +++ b/Items/Placeables/Furniture/TwinklerInABottle.cs @@ -1,12 +1,11 @@ using CalamityMod.Tiles.Furniture; using CalamityMod.Items.Critters; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { - public class TwinklerInABottle : ModItem + public class TwinklerInABottle : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Furniture/YellowCandle.cs b/Items/Placeables/Furniture/YellowCandle.cs index deb37c4456..476942ce18 100644 --- a/Items/Placeables/Furniture/YellowCandle.cs +++ b/Items/Placeables/Furniture/YellowCandle.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Furniture item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = Item.buyPrice(0, 50, 0, 0); item.rare = 6; diff --git a/Items/Placeables/FurnitureAbyss/AbyssBath.cs b/Items/Placeables/FurnitureAbyss/AbyssBath.cs index e24ba3f5d5..d446fa928c 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssBath.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssBath.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssBath : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssBed.cs b/Items/Placeables/FurnitureAbyss/AbyssBed.cs index e5e8c7b6c5..b584bdcea9 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssBed.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssBookcase.cs b/Items/Placeables/FurnitureAbyss/AbyssBookcase.cs index 83ddfca98d..dca2ce4fb2 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssBookcase.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssCandelabra.cs b/Items/Placeables/FurnitureAbyss/AbyssCandelabra.cs index 9ad6557133..7779ba0e0a 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssCandelabra.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssCandelabra.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssCandelabra : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssCandle.cs b/Items/Placeables/FurnitureAbyss/AbyssCandle.cs index a6a758c10e..eea6d78edb 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssCandle.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssCandle.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssCandle : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssChair.cs b/Items/Placeables/FurnitureAbyss/AbyssChair.cs index 6d5dcc3318..5676c78157 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssChair.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssChair.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssChair : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssChandelier.cs b/Items/Placeables/FurnitureAbyss/AbyssChandelier.cs index 5647dd6f1a..27f096ca41 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssChandelier.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssChest.cs b/Items/Placeables/FurnitureAbyss/AbyssChest.cs index 6c5343c69c..c8d3f0fa23 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssChest.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssClock.cs b/Items/Placeables/FurnitureAbyss/AbyssClock.cs index f06d340ff2..21b2f3adfe 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssClock.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssDoor.cs b/Items/Placeables/FurnitureAbyss/AbyssDoor.cs index 9ab51bc3e7..c76174dcb0 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssDoor.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureAbyss; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssDresser.cs b/Items/Placeables/FurnitureAbyss/AbyssDresser.cs index f1036b7545..27212b3a30 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssDresser.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssLamp.cs b/Items/Placeables/FurnitureAbyss/AbyssLamp.cs index 614cf72686..26df1a487d 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssLamp.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssLamp.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssLamp : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssLantern.cs b/Items/Placeables/FurnitureAbyss/AbyssLantern.cs index 2123319b88..d52c918963 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssLantern.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssLantern.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssLantern : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssPiano.cs b/Items/Placeables/FurnitureAbyss/AbyssPiano.cs index df3b033dc6..e05e1d20dd 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssPiano.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssSink.cs b/Items/Placeables/FurnitureAbyss/AbyssSink.cs index 77d07713db..d8c2e690d5 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssSink.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssSofa.cs b/Items/Placeables/FurnitureAbyss/AbyssSofa.cs index 9ae798f09e..972e7d9a7c 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssSofa.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssTable.cs b/Items/Placeables/FurnitureAbyss/AbyssTable.cs index 1d93d4dd66..f7304e950a 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssTable.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssTable.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssTable : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/AbyssTorch.cs b/Items/Placeables/FurnitureAbyss/AbyssTorch.cs index b85cf6d7e4..bbe515f6e7 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssTorch.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssTorch.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); item.flame = true; diff --git a/Items/Placeables/FurnitureAbyss/AbyssWorkbench.cs b/Items/Placeables/FurnitureAbyss/AbyssWorkbench.cs index 14229683ef..0fc323094f 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssWorkbench.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssWorkbench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAbyss { public class AbyssWorkbench : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs index e1bf55c9f2..a8b13ce7b0 100644 --- a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs +++ b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravel.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravelPlatform.cs b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravelPlatform.cs index c6ebe6b55b..4b6c7ac9ba 100644 --- a/Items/Placeables/FurnitureAbyss/SmoothAbyssGravelPlatform.cs +++ b/Items/Placeables/FurnitureAbyss/SmoothAbyssGravelPlatform.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAbyss { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAbyss item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAncient/AncientBasin.cs b/Items/Placeables/FurnitureAncient/AncientBasin.cs index c17f00b50e..d914d7e460 100644 --- a/Items/Placeables/FurnitureAncient/AncientBasin.cs +++ b/Items/Placeables/FurnitureAncient/AncientBasin.cs @@ -2,6 +2,8 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientBasin : ModItem @@ -19,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientBath.cs b/Items/Placeables/FurnitureAncient/AncientBath.cs index 040a6feeaa..4338212a38 100644 --- a/Items/Placeables/FurnitureAncient/AncientBath.cs +++ b/Items/Placeables/FurnitureAncient/AncientBath.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientBath : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientBed.cs b/Items/Placeables/FurnitureAncient/AncientBed.cs index 46a86667c8..b38529aac4 100644 --- a/Items/Placeables/FurnitureAncient/AncientBed.cs +++ b/Items/Placeables/FurnitureAncient/AncientBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientBookcase.cs b/Items/Placeables/FurnitureAncient/AncientBookcase.cs index 384e5601a2..89f36a00eb 100644 --- a/Items/Placeables/FurnitureAncient/AncientBookcase.cs +++ b/Items/Placeables/FurnitureAncient/AncientBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.value = 0; item.consumable = true; diff --git a/Items/Placeables/FurnitureAncient/AncientChair.cs b/Items/Placeables/FurnitureAncient/AncientChair.cs index 6d5431a695..e8947763a8 100644 --- a/Items/Placeables/FurnitureAncient/AncientChair.cs +++ b/Items/Placeables/FurnitureAncient/AncientChair.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientChair : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientChandelier.cs b/Items/Placeables/FurnitureAncient/AncientChandelier.cs index 2870180960..72ad41722f 100644 --- a/Items/Placeables/FurnitureAncient/AncientChandelier.cs +++ b/Items/Placeables/FurnitureAncient/AncientChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientDoor.cs b/Items/Placeables/FurnitureAncient/AncientDoor.cs index aa0df69f2e..d20d621654 100644 --- a/Items/Placeables/FurnitureAncient/AncientDoor.cs +++ b/Items/Placeables/FurnitureAncient/AncientDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureAncient; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientDresser.cs b/Items/Placeables/FurnitureAncient/AncientDresser.cs index 0234a486d0..d6468e2dca 100644 --- a/Items/Placeables/FurnitureAncient/AncientDresser.cs +++ b/Items/Placeables/FurnitureAncient/AncientDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientLamp.cs b/Items/Placeables/FurnitureAncient/AncientLamp.cs index 41bf1aab5b..f01f15b2a9 100644 --- a/Items/Placeables/FurnitureAncient/AncientLamp.cs +++ b/Items/Placeables/FurnitureAncient/AncientLamp.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientLamp : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientLantern.cs b/Items/Placeables/FurnitureAncient/AncientLantern.cs index bb72b07afd..222c81bd81 100644 --- a/Items/Placeables/FurnitureAncient/AncientLantern.cs +++ b/Items/Placeables/FurnitureAncient/AncientLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientMonolith.cs b/Items/Placeables/FurnitureAncient/AncientMonolith.cs index 1b6183accf..1ee3f5fc63 100644 --- a/Items/Placeables/FurnitureAncient/AncientMonolith.cs +++ b/Items/Placeables/FurnitureAncient/AncientMonolith.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientMonolith : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientPiano.cs b/Items/Placeables/FurnitureAncient/AncientPiano.cs index 9b0acb272c..adfcc88daa 100644 --- a/Items/Placeables/FurnitureAncient/AncientPiano.cs +++ b/Items/Placeables/FurnitureAncient/AncientPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientSink.cs b/Items/Placeables/FurnitureAncient/AncientSink.cs index 3574b87717..dff549f129 100644 --- a/Items/Placeables/FurnitureAncient/AncientSink.cs +++ b/Items/Placeables/FurnitureAncient/AncientSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientSofa.cs b/Items/Placeables/FurnitureAncient/AncientSofa.cs index bc60b0ba21..2b519310cc 100644 --- a/Items/Placeables/FurnitureAncient/AncientSofa.cs +++ b/Items/Placeables/FurnitureAncient/AncientSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientTable.cs b/Items/Placeables/FurnitureAncient/AncientTable.cs index fb70d53339..75d1c64f0c 100644 --- a/Items/Placeables/FurnitureAncient/AncientTable.cs +++ b/Items/Placeables/FurnitureAncient/AncientTable.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientTable : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAncient/AncientWorkbench.cs b/Items/Placeables/FurnitureAncient/AncientWorkbench.cs index eeda5304dc..bac946d479 100644 --- a/Items/Placeables/FurnitureAncient/AncientWorkbench.cs +++ b/Items/Placeables/FurnitureAncient/AncientWorkbench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientWorkbench : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenBasin.cs b/Items/Placeables/FurnitureAshen/AshenBasin.cs index 3be38dd39c..e5dcfc817b 100644 --- a/Items/Placeables/FurnitureAshen/AshenBasin.cs +++ b/Items/Placeables/FurnitureAshen/AshenBasin.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenBasin : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.value = 0; item.consumable = true; diff --git a/Items/Placeables/FurnitureAshen/AshenBath.cs b/Items/Placeables/FurnitureAshen/AshenBath.cs index cca17e7715..ae79bc1306 100644 --- a/Items/Placeables/FurnitureAshen/AshenBath.cs +++ b/Items/Placeables/FurnitureAshen/AshenBath.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenBath : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.value = 0; item.consumable = true; diff --git a/Items/Placeables/FurnitureAshen/AshenBed.cs b/Items/Placeables/FurnitureAshen/AshenBed.cs index 76aa19d29d..d9d1d667dd 100644 --- a/Items/Placeables/FurnitureAshen/AshenBed.cs +++ b/Items/Placeables/FurnitureAshen/AshenBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenBookcase.cs b/Items/Placeables/FurnitureAshen/AshenBookcase.cs index 4a7aa65af4..65b9f1beff 100644 --- a/Items/Placeables/FurnitureAshen/AshenBookcase.cs +++ b/Items/Placeables/FurnitureAshen/AshenBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenCandelabra.cs b/Items/Placeables/FurnitureAshen/AshenCandelabra.cs index 9fcbe18d15..30bed14326 100644 --- a/Items/Placeables/FurnitureAshen/AshenCandelabra.cs +++ b/Items/Placeables/FurnitureAshen/AshenCandelabra.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenCandelabra : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenCandle.cs b/Items/Placeables/FurnitureAshen/AshenCandle.cs index b1d45176b4..eec0e44e53 100644 --- a/Items/Placeables/FurnitureAshen/AshenCandle.cs +++ b/Items/Placeables/FurnitureAshen/AshenCandle.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenCandle : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenChair.cs b/Items/Placeables/FurnitureAshen/AshenChair.cs index 6f1789660b..235e683615 100644 --- a/Items/Placeables/FurnitureAshen/AshenChair.cs +++ b/Items/Placeables/FurnitureAshen/AshenChair.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenChair : ModItem @@ -19,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.useAnimation = 15; item.useTime = 10; item.rare = 3; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.value = 0; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAshen/AshenChandelier.cs b/Items/Placeables/FurnitureAshen/AshenChandelier.cs index 29cecbe994..9a64236795 100644 --- a/Items/Placeables/FurnitureAshen/AshenChandelier.cs +++ b/Items/Placeables/FurnitureAshen/AshenChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenChest.cs b/Items/Placeables/FurnitureAshen/AshenChest.cs index 27146775b6..96d7609ba8 100644 --- a/Items/Placeables/FurnitureAshen/AshenChest.cs +++ b/Items/Placeables/FurnitureAshen/AshenChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenDoor.cs b/Items/Placeables/FurnitureAshen/AshenDoor.cs index 222ade62ef..bf09508d75 100644 --- a/Items/Placeables/FurnitureAshen/AshenDoor.cs +++ b/Items/Placeables/FurnitureAshen/AshenDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureAshen; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenDresser.cs b/Items/Placeables/FurnitureAshen/AshenDresser.cs index 647196054a..a8b453fce2 100644 --- a/Items/Placeables/FurnitureAshen/AshenDresser.cs +++ b/Items/Placeables/FurnitureAshen/AshenDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenLamp.cs b/Items/Placeables/FurnitureAshen/AshenLamp.cs index 20e29fbaeb..7cb84aec92 100644 --- a/Items/Placeables/FurnitureAshen/AshenLamp.cs +++ b/Items/Placeables/FurnitureAshen/AshenLamp.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenLamp : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenLantern.cs b/Items/Placeables/FurnitureAshen/AshenLantern.cs index 37d6234b8d..16f65d9d77 100644 --- a/Items/Placeables/FurnitureAshen/AshenLantern.cs +++ b/Items/Placeables/FurnitureAshen/AshenLantern.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenLantern : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenMonolith.cs b/Items/Placeables/FurnitureAshen/AshenMonolith.cs index 2f2c097552..7d93012023 100644 --- a/Items/Placeables/FurnitureAshen/AshenMonolith.cs +++ b/Items/Placeables/FurnitureAshen/AshenMonolith.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenMonolith : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenPiano.cs b/Items/Placeables/FurnitureAshen/AshenPiano.cs index fb25b53be2..7159bff7a2 100644 --- a/Items/Placeables/FurnitureAshen/AshenPiano.cs +++ b/Items/Placeables/FurnitureAshen/AshenPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenPlatform.cs b/Items/Placeables/FurnitureAshen/AshenPlatform.cs index 07d69b0b3f..73f9ccaf64 100644 --- a/Items/Placeables/FurnitureAshen/AshenPlatform.cs +++ b/Items/Placeables/FurnitureAshen/AshenPlatform.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenPlatform : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAshen/AshenSink.cs b/Items/Placeables/FurnitureAshen/AshenSink.cs index f55552f1d7..835b4bdd9c 100644 --- a/Items/Placeables/FurnitureAshen/AshenSink.cs +++ b/Items/Placeables/FurnitureAshen/AshenSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenSlab.cs b/Items/Placeables/FurnitureAshen/AshenSlab.cs index a2eaed0395..6543245d06 100644 --- a/Items/Placeables/FurnitureAshen/AshenSlab.cs +++ b/Items/Placeables/FurnitureAshen/AshenSlab.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAshen/AshenSofa.cs b/Items/Placeables/FurnitureAshen/AshenSofa.cs index 382afff286..b135f8376f 100644 --- a/Items/Placeables/FurnitureAshen/AshenSofa.cs +++ b/Items/Placeables/FurnitureAshen/AshenSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenTable.cs b/Items/Placeables/FurnitureAshen/AshenTable.cs index ac65639087..644e5c0a81 100644 --- a/Items/Placeables/FurnitureAshen/AshenTable.cs +++ b/Items/Placeables/FurnitureAshen/AshenTable.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenTable : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/AshenWorkbench.cs b/Items/Placeables/FurnitureAshen/AshenWorkbench.cs index e1c1daca2d..89672ff7b9 100644 --- a/Items/Placeables/FurnitureAshen/AshenWorkbench.cs +++ b/Items/Placeables/FurnitureAshen/AshenWorkbench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureAshen { public class AshenWorkbench : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.value = 0; diff --git a/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs b/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs index 158dd102e9..2d8b746f70 100644 --- a/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs +++ b/Items/Placeables/FurnitureAshen/SmoothBrimstoneSlag.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAshen item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureAstral/MonolithBathtub.cs b/Items/Placeables/FurnitureAstral/MonolithBathtub.cs index e916e7378a..f205e2672d 100644 --- a/Items/Placeables/FurnitureAstral/MonolithBathtub.cs +++ b/Items/Placeables/FurnitureAstral/MonolithBathtub.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithBed.cs b/Items/Placeables/FurnitureAstral/MonolithBed.cs index e69224b23c..fb9ece751c 100644 --- a/Items/Placeables/FurnitureAstral/MonolithBed.cs +++ b/Items/Placeables/FurnitureAstral/MonolithBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithBench.cs b/Items/Placeables/FurnitureAstral/MonolithBench.cs index 0f00d8d229..5b955bdcbb 100644 --- a/Items/Placeables/FurnitureAstral/MonolithBench.cs +++ b/Items/Placeables/FurnitureAstral/MonolithBench.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithBookcase.cs b/Items/Placeables/FurnitureAstral/MonolithBookcase.cs index 495b50f999..e16c24294b 100644 --- a/Items/Placeables/FurnitureAstral/MonolithBookcase.cs +++ b/Items/Placeables/FurnitureAstral/MonolithBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs b/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs index 12cd6e5f91..5e020735b1 100644 --- a/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs +++ b/Items/Placeables/FurnitureAstral/MonolithCandelabra.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithCandle.cs b/Items/Placeables/FurnitureAstral/MonolithCandle.cs index 81754d7a3c..76cc41ca9f 100644 --- a/Items/Placeables/FurnitureAstral/MonolithCandle.cs +++ b/Items/Placeables/FurnitureAstral/MonolithCandle.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithChair.cs b/Items/Placeables/FurnitureAstral/MonolithChair.cs index 4ac35d7c1a..e31227c30d 100644 --- a/Items/Placeables/FurnitureAstral/MonolithChair.cs +++ b/Items/Placeables/FurnitureAstral/MonolithChair.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithChandelier.cs b/Items/Placeables/FurnitureAstral/MonolithChandelier.cs index d547d50deb..5069aed9b1 100644 --- a/Items/Placeables/FurnitureAstral/MonolithChandelier.cs +++ b/Items/Placeables/FurnitureAstral/MonolithChandelier.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithChest.cs b/Items/Placeables/FurnitureAstral/MonolithChest.cs index dce7c35bbf..3933f5e17c 100644 --- a/Items/Placeables/FurnitureAstral/MonolithChest.cs +++ b/Items/Placeables/FurnitureAstral/MonolithChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithClock.cs b/Items/Placeables/FurnitureAstral/MonolithClock.cs index f6008200ce..1b59c74b54 100644 --- a/Items/Placeables/FurnitureAstral/MonolithClock.cs +++ b/Items/Placeables/FurnitureAstral/MonolithClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithDoor.cs b/Items/Placeables/FurnitureAstral/MonolithDoor.cs index e2b82a59b0..6f71c58e3c 100644 --- a/Items/Placeables/FurnitureAstral/MonolithDoor.cs +++ b/Items/Placeables/FurnitureAstral/MonolithDoor.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithDresser.cs b/Items/Placeables/FurnitureAstral/MonolithDresser.cs index 3659f98789..aae5bf9fa3 100644 --- a/Items/Placeables/FurnitureAstral/MonolithDresser.cs +++ b/Items/Placeables/FurnitureAstral/MonolithDresser.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithLamp.cs b/Items/Placeables/FurnitureAstral/MonolithLamp.cs index 95cf03c958..1592b86f07 100644 --- a/Items/Placeables/FurnitureAstral/MonolithLamp.cs +++ b/Items/Placeables/FurnitureAstral/MonolithLamp.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithLantern.cs b/Items/Placeables/FurnitureAstral/MonolithLantern.cs index 70f1a8ddf1..ffcb0023b3 100644 --- a/Items/Placeables/FurnitureAstral/MonolithLantern.cs +++ b/Items/Placeables/FurnitureAstral/MonolithLantern.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithPiano.cs b/Items/Placeables/FurnitureAstral/MonolithPiano.cs index b26724d4eb..a6db0470a0 100644 --- a/Items/Placeables/FurnitureAstral/MonolithPiano.cs +++ b/Items/Placeables/FurnitureAstral/MonolithPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithPlatform.cs b/Items/Placeables/FurnitureAstral/MonolithPlatform.cs index 9d6a007785..97ab9ad12e 100644 --- a/Items/Placeables/FurnitureAstral/MonolithPlatform.cs +++ b/Items/Placeables/FurnitureAstral/MonolithPlatform.cs @@ -1,4 +1,5 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithSink.cs b/Items/Placeables/FurnitureAstral/MonolithSink.cs index 8b733ac0e3..6d8bc9f389 100644 --- a/Items/Placeables/FurnitureAstral/MonolithSink.cs +++ b/Items/Placeables/FurnitureAstral/MonolithSink.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithTable.cs b/Items/Placeables/FurnitureAstral/MonolithTable.cs index 1c9897a822..d2f0e2900c 100644 --- a/Items/Placeables/FurnitureAstral/MonolithTable.cs +++ b/Items/Placeables/FurnitureAstral/MonolithTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs b/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs index 568f7b6570..320ea87981 100644 --- a/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs +++ b/Items/Placeables/FurnitureAstral/MonolithWorkBench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAstral { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAstral item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs index 24394cb2c7..a260eb0b6f 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicBathtub : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicBed.cs b/Items/Placeables/FurnitureBotanic/BotanicBed.cs index de7ab09717..50a3517ed9 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBed.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicBench.cs b/Items/Placeables/FurnitureBotanic/BotanicBench.cs index ba0c9916da..491a96af76 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs index 6cb02a9957..42e5d9a754 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs index f261b0e9e4..f96490b5a5 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs index bc3fddb7e9..3e68f8d0d6 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicChair.cs b/Items/Placeables/FurnitureBotanic/BotanicChair.cs index ec4cd00d2c..4c5ac4f8b7 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChair.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChair.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicChair : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs index 530a6aea32..28490b2974 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicChest.cs b/Items/Placeables/FurnitureBotanic/BotanicChest.cs index 9c674b121c..af4aeae5b7 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChest.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicClock.cs b/Items/Placeables/FurnitureBotanic/BotanicClock.cs index 672b9262e4..aaf6d04614 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicClock.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs index 85601c0519..323366a583 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureBotanic; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs index 07690e1c3c..ea02d06016 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs index a7545d2139..dc25fea0dd 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs index 29a20c3e06..b3256358d0 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs index 4837caa34b..14f94528e7 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicPlatform.cs b/Items/Placeables/FurnitureBotanic/BotanicPlatform.cs index b8e0dd8ec7..f2fb3d05aa 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicPlatform.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPlatform.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicPlatform : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureBotanic/BotanicSink.cs b/Items/Placeables/FurnitureBotanic/BotanicSink.cs index f9adbe2064..cabf3c0272 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicSink.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicTable.cs b/Items/Placeables/FurnitureBotanic/BotanicTable.cs index 2b8b6940f5..6a69e6bea7 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicTable.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicTable.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicTable : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs index 08cd05ad1f..8f3ca3975c 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicWorkBench : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = 0; item.consumable = true; item.createTile = ModContent.TileType(); diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs index 3d126504ff..d15abcae4c 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBasin.cs @@ -1,4 +1,3 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Tiles.FurnitureCosmilite; @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBath.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBath.cs index 1d5365e6e5..f6fcf74f03 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteBath.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBath.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmiliteBath : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBed.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBed.cs index 35a9c698f7..0c51fa3b94 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteBed.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBookcase.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBookcase.cs index c95ad400a4..acdb1974d2 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteBookcase.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteBrick.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteBrick.cs index 275bc629a5..3338a5158b 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteBrick.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteCandelabra.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteCandelabra.cs index e0b05735eb..e9a05a0b51 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteCandelabra.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteCandle.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteCandle.cs index c27b9eebea..cf3a11b1ce 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteCandle.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteChair.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteChair.cs index 9e3ed67b55..d90e8b8ee9 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteChair.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteChair.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmiliteChair : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteChandelier.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteChandelier.cs index 2f4eb5d255..531966bd94 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteChandelier.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteChest.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteChest.cs index d0be0b22c7..bbdf50d9c2 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteChest.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteClock.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteClock.cs index 739cd8aa8b..22877525c1 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteClock.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteDoor.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteDoor.cs index 2452547901..e314fb019a 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteDoor.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureCosmilite; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmiliteDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteDresser.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteDresser.cs index bfd62c0291..106efab27d 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteDresser.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmiliteDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteLamp.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteLamp.cs index a3b2136573..608c5930f5 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteLamp.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteLantern.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteLantern.cs index 138678d887..956f037c86 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteLantern.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmilitePiano.cs b/Items/Placeables/FurnitureCosmilite/CosmilitePiano.cs index a85678f6e7..2a086cbc71 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmilitePiano.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmilitePiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmilitePlatform.cs b/Items/Placeables/FurnitureCosmilite/CosmilitePlatform.cs index 16512a7608..ef66ca2f28 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmilitePlatform.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmilitePlatform.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmilitePlatform : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteSconce.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteSconce.cs index 9fe4014bd8..48f38948c2 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteSconce.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteSconce.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteSink.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteSink.cs index c671e5359e..52f8cf9f0e 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteSink.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteSofa.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteSofa.cs index a00ad351ba..d103cb02c2 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteSofa.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteTable.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteTable.cs index 8eb24ef345..742f932f5c 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteTable.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureCosmilite { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteWorkbench.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteWorkbench.cs index e77571e538..91ccd1a845 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteWorkbench.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteWorkbench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureCosmilite { public class CosmiliteWorkbench : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureCosmilite item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs index 2e7eaf532a..be4945bdc5 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicBathtub : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs index 831c00a152..c5326d5690 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs index bac22e824f..6ca0c2309b 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicBench : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs b/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs index 67bf933b1e..16c32e3d5e 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs b/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs index 406715473e..0ad861e738 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicCandelabra : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs b/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs index 94c6abd472..cfc3e1ff86 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicCandle : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs index 286a0a21c9..00c21452d1 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicChair : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs index 0435088c36..093d4f3258 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicChandelier : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs b/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs index 894c57f15d..2e0ead968c 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicChest : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs b/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs index f271cea3a7..9447bf2412 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicClock : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs b/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs index 7c5f4b266a..9f3f63e5b5 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs @@ -1,6 +1,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureEutrophic; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicDoor : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs b/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs index 2609eacbeb..f2c96961c8 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicDresser : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs b/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs index cdce5e5985..812426332f 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicLamp : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs b/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs index e6910a7e29..6a6026567f 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicLantern : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs b/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs index 4fc4e44ad3..e91d8ac3e6 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs b/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs index 1c561307f1..50c59b288b 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicPlatform : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs b/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs index 92a502e5fb..7ffc8fbd7d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs b/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs index b2c7adf686..43b61bb2da 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicTable : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs b/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs index cc0b636f9b..3a34ae6bff 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs @@ -1,5 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.FurnitureEutrophic { public class EutrophicWorkBench : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs b/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs index 1d7fce847a..4fe2d30933 100644 --- a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs +++ b/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultBathtub.cs b/Items/Placeables/FurnitureOccult/OccultBathtub.cs index f5adcf6e8c..1f1077948f 100644 --- a/Items/Placeables/FurnitureOccult/OccultBathtub.cs +++ b/Items/Placeables/FurnitureOccult/OccultBathtub.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultBathtub : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultBed.cs b/Items/Placeables/FurnitureOccult/OccultBed.cs index 640dd63f30..eddf26cdfb 100644 --- a/Items/Placeables/FurnitureOccult/OccultBed.cs +++ b/Items/Placeables/FurnitureOccult/OccultBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultBookcase.cs b/Items/Placeables/FurnitureOccult/OccultBookcase.cs index 37622bfea3..c401cbf489 100644 --- a/Items/Placeables/FurnitureOccult/OccultBookcase.cs +++ b/Items/Placeables/FurnitureOccult/OccultBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultCandelabra.cs b/Items/Placeables/FurnitureOccult/OccultCandelabra.cs index 635dae3303..85929b0a10 100644 --- a/Items/Placeables/FurnitureOccult/OccultCandelabra.cs +++ b/Items/Placeables/FurnitureOccult/OccultCandelabra.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultCandelabra : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultCandle.cs b/Items/Placeables/FurnitureOccult/OccultCandle.cs index 3cb25d124f..eec64d7e12 100644 --- a/Items/Placeables/FurnitureOccult/OccultCandle.cs +++ b/Items/Placeables/FurnitureOccult/OccultCandle.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultCandle : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultChair.cs b/Items/Placeables/FurnitureOccult/OccultChair.cs index 5b545a6c6e..773ca0739e 100644 --- a/Items/Placeables/FurnitureOccult/OccultChair.cs +++ b/Items/Placeables/FurnitureOccult/OccultChair.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultChair : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultChandelier.cs b/Items/Placeables/FurnitureOccult/OccultChandelier.cs index 2911e25f7a..503e12ecf4 100644 --- a/Items/Placeables/FurnitureOccult/OccultChandelier.cs +++ b/Items/Placeables/FurnitureOccult/OccultChandelier.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultChandelier : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultChest.cs b/Items/Placeables/FurnitureOccult/OccultChest.cs index cf7f87f0c4..ef9e74d45c 100644 --- a/Items/Placeables/FurnitureOccult/OccultChest.cs +++ b/Items/Placeables/FurnitureOccult/OccultChest.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultChest : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultClock.cs b/Items/Placeables/FurnitureOccult/OccultClock.cs index 2cf0e11872..805a9adaf5 100644 --- a/Items/Placeables/FurnitureOccult/OccultClock.cs +++ b/Items/Placeables/FurnitureOccult/OccultClock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultDoor.cs b/Items/Placeables/FurnitureOccult/OccultDoor.cs index d531ea8e49..d0f06f7677 100644 --- a/Items/Placeables/FurnitureOccult/OccultDoor.cs +++ b/Items/Placeables/FurnitureOccult/OccultDoor.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureOccult; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultDoor : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultDresser.cs b/Items/Placeables/FurnitureOccult/OccultDresser.cs index 8714ce3b8d..adc24ce45e 100644 --- a/Items/Placeables/FurnitureOccult/OccultDresser.cs +++ b/Items/Placeables/FurnitureOccult/OccultDresser.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultDresser : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultLamp.cs b/Items/Placeables/FurnitureOccult/OccultLamp.cs index 63ce5dff94..a17729a202 100644 --- a/Items/Placeables/FurnitureOccult/OccultLamp.cs +++ b/Items/Placeables/FurnitureOccult/OccultLamp.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultLamp : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultLantern.cs b/Items/Placeables/FurnitureOccult/OccultLantern.cs index 233e23ee0a..be9214247c 100644 --- a/Items/Placeables/FurnitureOccult/OccultLantern.cs +++ b/Items/Placeables/FurnitureOccult/OccultLantern.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultLantern : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultPiano.cs b/Items/Placeables/FurnitureOccult/OccultPiano.cs index 551d7193ea..457ad4ce2a 100644 --- a/Items/Placeables/FurnitureOccult/OccultPiano.cs +++ b/Items/Placeables/FurnitureOccult/OccultPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultPlatform.cs b/Items/Placeables/FurnitureOccult/OccultPlatform.cs index 1e18dca615..843f2a1386 100644 --- a/Items/Placeables/FurnitureOccult/OccultPlatform.cs +++ b/Items/Placeables/FurnitureOccult/OccultPlatform.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOccult { public class OccultPlatform : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultSink.cs b/Items/Placeables/FurnitureOccult/OccultSink.cs index 35fe77b7c5..7945dfa7ce 100644 --- a/Items/Placeables/FurnitureOccult/OccultSink.cs +++ b/Items/Placeables/FurnitureOccult/OccultSink.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultSofa.cs b/Items/Placeables/FurnitureOccult/OccultSofa.cs index 6043761083..d8f93887d7 100644 --- a/Items/Placeables/FurnitureOccult/OccultSofa.cs +++ b/Items/Placeables/FurnitureOccult/OccultSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultStone.cs b/Items/Placeables/FurnitureOccult/OccultStone.cs index 9888bbdb94..e0854bc917 100644 --- a/Items/Placeables/FurnitureOccult/OccultStone.cs +++ b/Items/Placeables/FurnitureOccult/OccultStone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 2); diff --git a/Items/Placeables/FurnitureOccult/OccultTable.cs b/Items/Placeables/FurnitureOccult/OccultTable.cs index 46abfb9418..2956927cca 100644 --- a/Items/Placeables/FurnitureOccult/OccultTable.cs +++ b/Items/Placeables/FurnitureOccult/OccultTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOccult { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureOccult/OccultWorkBench.cs b/Items/Placeables/FurnitureOccult/OccultWorkBench.cs index 850b132f66..90f58e5c73 100644 --- a/Items/Placeables/FurnitureOccult/OccultWorkBench.cs +++ b/Items/Placeables/FurnitureOccult/OccultWorkBench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOccult { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureOccult item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlate.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlate.cs index 0e5f5b3684..3fa832fe50 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlate.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBasin.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBasin.cs index 9711b27bee..d738005724 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBasin.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBasin.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBathtub.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBathtub.cs index ede7820449..6fb05766d3 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBathtub.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBathtub.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBed.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBed.cs index 30accece05..baefc81006 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBed.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBed.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBookcase.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBookcase.cs index 9353d81bd2..b44dea4c60 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBookcase.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs index 19c0cc9854..92c34b5d57 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandelabra.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandle.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandle.cs index 19d2316bdd..90d3ef179b 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandle.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateCandle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChair.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChair.cs index c693cfc7e1..13b30935b0 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChair.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChair.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChandelier.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChandelier.cs index 52c5c2c4bd..1f3841292e 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChandelier.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChest.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChest.cs index 38d66ee1a5..1c85ac501c 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChest.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateClock.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateClock.cs index 00fc76a269..e31efda4ca 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateClock.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDoor.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDoor.cs index a22c587a97..16fd16674a 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDoor.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDoor.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurniturePlaguedPlate; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDresser.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDresser.cs index ae941746aa..55576a2823 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDresser.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateDresser.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLamp.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLamp.cs index 685f96b793..40be02e85a 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLamp.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLamp.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLantern.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLantern.cs index ee7805a838..20ef9cd14a 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLantern.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateLantern.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePiano.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePiano.cs index 580d175727..df9bb67e8b 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePiano.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePlatform.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePlatform.cs index 9faa059752..bbb6bbbd1a 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePlatform.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlatePlatform.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSink.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSink.cs index de43cb45e0..88953f4751 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSink.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSink.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSofa.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSofa.cs index 892c562e47..f4e30f2702 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSofa.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateTable.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateTable.cs index 74d50bcaef..5da9b7803f 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateTable.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateTable.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs index 07ec419225..6d172e2e94 100644 --- a/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs +++ b/Items/Placeables/FurniturePlaguedPlate/PlaguedPlateWorkbench.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate { @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurniturePlaguedPlate item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedBath.cs b/Items/Placeables/FurnitureProfaned/ProfanedBath.cs index 4f8676afe5..f07acdd0d2 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedBath.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedBath.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedBed.cs b/Items/Placeables/FurnitureProfaned/ProfanedBed.cs index bb4e083072..70e9f683b4 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedBed.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedBench.cs b/Items/Placeables/FurnitureProfaned/ProfanedBench.cs index 7cbb94b036..59b1b4920b 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedBench.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedBookcase.cs b/Items/Placeables/FurnitureProfaned/ProfanedBookcase.cs index cf2c1bffc1..6419359076 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedBookcase.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedCandelabra.cs b/Items/Placeables/FurnitureProfaned/ProfanedCandelabra.cs index 56363a9bae..6538873a55 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedCandelabra.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedCandle.cs b/Items/Placeables/FurnitureProfaned/ProfanedCandle.cs index 6577ef6080..dfa6f7b398 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedCandle.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedChair.cs b/Items/Placeables/FurnitureProfaned/ProfanedChair.cs index 9d056fd814..cec01ba444 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedChair.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedChair.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedChandelier.cs b/Items/Placeables/FurnitureProfaned/ProfanedChandelier.cs index 81d5843f63..de1db867b7 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedChandelier.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedChest.cs b/Items/Placeables/FurnitureProfaned/ProfanedChest.cs index 201f120e81..55de5c3317 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedChest.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedClock.cs b/Items/Placeables/FurnitureProfaned/ProfanedClock.cs index 2fe51947cb..fec8da5c6a 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedClock.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs b/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs index 32b34c2eae..fc32d06f9c 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Glass, 20); recipe.SetResult(this, 20); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Placeables/FurnitureProfaned/ProfanedDoor.cs b/Items/Placeables/FurnitureProfaned/ProfanedDoor.cs index 23448631f6..8e1099bf2b 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedDoor.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedDoor.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedDresser.cs b/Items/Placeables/FurnitureProfaned/ProfanedDresser.cs index 28429ecce8..cf8bdd5e5c 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedDresser.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedDresser.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedLamp.cs b/Items/Placeables/FurnitureProfaned/ProfanedLamp.cs index 60db826f0a..db6cfe1686 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedLamp.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedLantern.cs b/Items/Placeables/FurnitureProfaned/ProfanedLantern.cs index 442d22fd2e..560e15d6e7 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedLantern.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedPiano.cs b/Items/Placeables/FurnitureProfaned/ProfanedPiano.cs index 4cfcc27bb9..ca608417e4 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedPiano.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedPlatform.cs b/Items/Placeables/FurnitureProfaned/ProfanedPlatform.cs index 8e078fb991..13c0112efa 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedPlatform.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedPlatform.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 2); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedRock.cs b/Items/Placeables/FurnitureProfaned/ProfanedRock.cs index ba5716d96a..564cf65003 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedRock.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedRock.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -29,18 +29,18 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.StoneBlock, 20); recipe.SetResult(this, 20); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.SetResult(this); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedSink.cs b/Items/Placeables/FurnitureProfaned/ProfanedSink.cs index c8ed7db818..a7b2a7f625 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedSink.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs b/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs index 704c205dae..48d91afc89 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedSlab.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.SetResult(this, 5); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Placeables/FurnitureProfaned/ProfanedTable.cs b/Items/Placeables/FurnitureProfaned/ProfanedTable.cs index 9ecd4b63c2..0df753bff7 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedTable.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/ProfanedWorkbench.cs b/Items/Placeables/FurnitureProfaned/ProfanedWorkbench.cs index 46fdf8f46b..2eb36ea337 100644 --- a/Items/Placeables/FurnitureProfaned/ProfanedWorkbench.cs +++ b/Items/Placeables/FurnitureProfaned/ProfanedWorkbench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureProfaned { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs b/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs index 68545d7460..e9ded18620 100644 --- a/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs +++ b/Items/Placeables/FurnitureProfaned/RunicProfanedBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.FurnitureProfaned recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.SetResult(this, 5); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs index d595bff7ed..f2c69fbdaf 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaBed.cs b/Items/Placeables/FurnitureSilva/SilvaBed.cs index 7559964a8f..00e1f0ba74 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBed.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaBench.cs b/Items/Placeables/FurnitureSilva/SilvaBench.cs index 45364c19a7..444e75d74c 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs index 6aea67b8b3..c1399436b8 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs index 5df6ab8d8a..8ef27911f3 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandle.cs b/Items/Placeables/FurnitureSilva/SilvaCandle.cs index ab885cf5c9..119316a107 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandle.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandle.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaChair.cs b/Items/Placeables/FurnitureSilva/SilvaChair.cs index 35bc0ca6fd..172ef47636 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChair.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChair.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs index ad183ce0d3..7bbac0f482 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables.FurnitureSilva { public class SilvaChandelier : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaChest.cs b/Items/Placeables/FurnitureSilva/SilvaChest.cs index 61ca4a0ef5..8a36ee6eeb 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChest.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChest.cs @@ -1,6 +1,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables.FurnitureSilva { public class SilvaChest : ModItem @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaClock.cs b/Items/Placeables/FurnitureSilva/SilvaClock.cs index 3999459299..d3640d9bf1 100644 --- a/Items/Placeables/FurnitureSilva/SilvaClock.cs +++ b/Items/Placeables/FurnitureSilva/SilvaClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs index 06cc84fe58..767e8832fc 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaDoor.cs b/Items/Placeables/FurnitureSilva/SilvaDoor.cs index 6a7bd19a3b..7e53b496e3 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDoor.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDoor.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureSilva; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaDresser.cs b/Items/Placeables/FurnitureSilva/SilvaDresser.cs index e66691f426..39d2b02cde 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDresser.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDresser.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaLamp.cs b/Items/Placeables/FurnitureSilva/SilvaLamp.cs index 8659a864c8..df9109ffe7 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLamp.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLamp.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaLantern.cs b/Items/Placeables/FurnitureSilva/SilvaLantern.cs index e76e77d220..77cbfcdfc2 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLantern.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLantern.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaPiano.cs b/Items/Placeables/FurnitureSilva/SilvaPiano.cs index 4c624762b6..e2c5fef227 100644 --- a/Items/Placeables/FurnitureSilva/SilvaPiano.cs +++ b/Items/Placeables/FurnitureSilva/SilvaPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaPlatform.cs b/Items/Placeables/FurnitureSilva/SilvaPlatform.cs index d16bbd1ae0..0962b6ecf4 100644 --- a/Items/Placeables/FurnitureSilva/SilvaPlatform.cs +++ b/Items/Placeables/FurnitureSilva/SilvaPlatform.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaSink.cs b/Items/Placeables/FurnitureSilva/SilvaSink.cs index 37f2aa1853..1fd97c15a8 100644 --- a/Items/Placeables/FurnitureSilva/SilvaSink.cs +++ b/Items/Placeables/FurnitureSilva/SilvaSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaTable.cs b/Items/Placeables/FurnitureSilva/SilvaTable.cs index b15dc4ba8e..c2cf2950ce 100644 --- a/Items/Placeables/FurnitureSilva/SilvaTable.cs +++ b/Items/Placeables/FurnitureSilva/SilvaTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs index 6450e45095..bd60f93d00 100644 --- a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureSilva { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBath.cs b/Items/Placeables/FurnitureStatigel/StatigelBath.cs index d24327e737..fa790183e4 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBath.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBath.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBed.cs b/Items/Placeables/FurnitureStatigel/StatigelBed.cs index f35fd9e689..aff3b833ad 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBed.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs index da0eb968d8..320200c996 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables.FurnitureStatigel { public class StatigelBlock : ModItem @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs index 58ab27537d..fc508cfd11 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs index 48cb355021..4bcade6253 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs index 0c83ccaabe..308f3deecc 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChair.cs b/Items/Placeables/FurnitureStatigel/StatigelChair.cs index 80a69bf03c..70a7324427 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChair.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChair.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs index 682bac858e..6102484361 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChest.cs b/Items/Placeables/FurnitureStatigel/StatigelChest.cs index fa3d55659c..79bdadbda8 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChest.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelClock.cs b/Items/Placeables/FurnitureStatigel/StatigelClock.cs index b4ffc54492..5f989b5f7c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelClock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs index 48ad4a89a0..fa381319b9 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureStatigel; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs index 2e1290cc1c..0a2b1c2279 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs index cbee15def8..59029dde11 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs index 722087968e..3adae2902a 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs index a2cc7c48d3..312716c25f 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelPlatform.cs b/Items/Placeables/FurnitureStatigel/StatigelPlatform.cs index 72fc8de3a2..9ae59c1247 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelPlatform.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelPlatform.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSink.cs b/Items/Placeables/FurnitureStatigel/StatigelSink.cs index cccfa7ddef..c738bf1f5c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSink.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs index 6f54abba06..15d696c8d6 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelTable.cs b/Items/Placeables/FurnitureStatigel/StatigelTable.cs index 8406330083..3f1a96de16 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelTable.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStatigel/StatigelWorkbench.cs b/Items/Placeables/FurnitureStatigel/StatigelWorkbench.cs index de66734790..803c5e57b0 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelWorkbench.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelWorkbench.cs @@ -1,5 +1,5 @@ - using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStatigel { @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureStratus/StratusBathtub.cs b/Items/Placeables/FurnitureStratus/StratusBathtub.cs index c752f7e770..e224a99058 100644 --- a/Items/Placeables/FurnitureStratus/StratusBathtub.cs +++ b/Items/Placeables/FurnitureStratus/StratusBathtub.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 14); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBed.cs b/Items/Placeables/FurnitureStratus/StratusBed.cs index 9006861aeb..714e66524d 100644 --- a/Items/Placeables/FurnitureStratus/StratusBed.cs +++ b/Items/Placeables/FurnitureStratus/StratusBed.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ItemID.Silk, 5); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBookcase.cs b/Items/Placeables/FurnitureStratus/StratusBookcase.cs index cdd6fada0d..9fa963130a 100644 --- a/Items/Placeables/FurnitureStratus/StratusBookcase.cs +++ b/Items/Placeables/FurnitureStratus/StratusBookcase.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ItemID.Book, 10); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBricks.cs b/Items/Placeables/FurnitureStratus/StratusBricks.cs index 10d49c78d4..0e2b64d885 100644 --- a/Items/Placeables/FurnitureStratus/StratusBricks.cs +++ b/Items/Placeables/FurnitureStratus/StratusBricks.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 1); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.SetResult(this, 50); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.SetResult(this); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs index ce5d9435fc..f310ee57fd 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusCandle.cs b/Items/Placeables/FurnitureStratus/StratusCandle.cs index 93510d0740..4eec66e6d7 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandle.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandle.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChair.cs b/Items/Placeables/FurnitureStratus/StratusChair.cs index 103c714918..03f57528a5 100644 --- a/Items/Placeables/FurnitureStratus/StratusChair.cs +++ b/Items/Placeables/FurnitureStratus/StratusChair.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChandelier.cs b/Items/Placeables/FurnitureStratus/StratusChandelier.cs index e968dd7938..cec16a72fd 100644 --- a/Items/Placeables/FurnitureStratus/StratusChandelier.cs +++ b/Items/Placeables/FurnitureStratus/StratusChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ItemID.Chain); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChest.cs b/Items/Placeables/FurnitureStratus/StratusChest.cs index e79858c90e..e9da768598 100644 --- a/Items/Placeables/FurnitureStratus/StratusChest.cs +++ b/Items/Placeables/FurnitureStratus/StratusChest.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ItemID.IronBar, 2); recipe.anyIronBar = true; recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusClock.cs b/Items/Placeables/FurnitureStratus/StratusClock.cs index d822ac65ce..1921261425 100644 --- a/Items/Placeables/FurnitureStratus/StratusClock.cs +++ b/Items/Placeables/FurnitureStratus/StratusClock.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.anyIronBar = true; recipe.AddIngredient(ItemID.Glass, 6); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDoor.cs b/Items/Placeables/FurnitureStratus/StratusDoor.cs index 5cf097bd10..bb2bfbdf47 100644 --- a/Items/Placeables/FurnitureStratus/StratusDoor.cs +++ b/Items/Placeables/FurnitureStratus/StratusDoor.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.FurnitureStratus; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -27,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDresser.cs b/Items/Placeables/FurnitureStratus/StratusDresser.cs index c59e82958e..565f61a957 100644 --- a/Items/Placeables/FurnitureStratus/StratusDresser.cs +++ b/Items/Placeables/FurnitureStratus/StratusDresser.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 16); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLamp.cs b/Items/Placeables/FurnitureStratus/StratusLamp.cs index ab193e11af..f5ee7e3b66 100644 --- a/Items/Placeables/FurnitureStratus/StratusLamp.cs +++ b/Items/Placeables/FurnitureStratus/StratusLamp.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLantern.cs b/Items/Placeables/FurnitureStratus/StratusLantern.cs index ccd3421137..88d3542dc6 100644 --- a/Items/Placeables/FurnitureStratus/StratusLantern.cs +++ b/Items/Placeables/FurnitureStratus/StratusLantern.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusPiano.cs b/Items/Placeables/FurnitureStratus/StratusPiano.cs index af5891918b..0602e8a58c 100644 --- a/Items/Placeables/FurnitureStratus/StratusPiano.cs +++ b/Items/Placeables/FurnitureStratus/StratusPiano.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ItemID.Bone, 4); recipe.AddIngredient(ItemID.Book, 1); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusPlatform.cs b/Items/Placeables/FurnitureStratus/StratusPlatform.cs index 249b761395..b74ec035e6 100644 --- a/Items/Placeables/FurnitureStratus/StratusPlatform.cs +++ b/Items/Placeables/FurnitureStratus/StratusPlatform.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.SetResult(this, 2); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSink.cs b/Items/Placeables/FurnitureStratus/StratusSink.cs index 903de044b2..4d88f2eae6 100644 --- a/Items/Placeables/FurnitureStratus/StratusSink.cs +++ b/Items/Placeables/FurnitureStratus/StratusSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ItemID.WaterBucket); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSofa.cs b/Items/Placeables/FurnitureStratus/StratusSofa.cs index ab53136008..6dd93a1b10 100644 --- a/Items/Placeables/FurnitureStratus/StratusSofa.cs +++ b/Items/Placeables/FurnitureStratus/StratusSofa.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.Silk, 2); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusTable.cs b/Items/Placeables/FurnitureStratus/StratusTable.cs index afc9ddf685..a2b12a9c24 100644 --- a/Items/Placeables/FurnitureStratus/StratusTable.cs +++ b/Items/Placeables/FurnitureStratus/StratusTable.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -16,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusWorkbench.cs b/Items/Placeables/FurnitureStratus/StratusWorkbench.cs index 06f79a283d..30ebb1cad4 100644 --- a/Items/Placeables/FurnitureStratus/StratusWorkbench.cs +++ b/Items/Placeables/FurnitureStratus/StratusWorkbench.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureStratus { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } @@ -27,7 +28,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.SetResult(this, 1); - recipe.AddTile(412); + recipe.AddTile(TileID.LunarCraftingStation); recipe.AddRecipe(); } } diff --git a/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs b/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs index c20111210c..369d7b9093 100644 --- a/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs +++ b/Items/Placeables/FurnitureVoid/SmoothVoidstone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/SmoothVoidstonePlatform.cs b/Items/Placeables/FurnitureVoid/SmoothVoidstonePlatform.cs index 449d47941b..ce8e8189d6 100644 --- a/Items/Placeables/FurnitureVoid/SmoothVoidstonePlatform.cs +++ b/Items/Placeables/FurnitureVoid/SmoothVoidstonePlatform.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidBath.cs b/Items/Placeables/FurnitureVoid/VoidBath.cs index 21c1ed5aa3..3be827d990 100644 --- a/Items/Placeables/FurnitureVoid/VoidBath.cs +++ b/Items/Placeables/FurnitureVoid/VoidBath.cs @@ -1,5 +1,5 @@ - using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidBed.cs b/Items/Placeables/FurnitureVoid/VoidBed.cs index c30c07cbd9..1045ed8c01 100644 --- a/Items/Placeables/FurnitureVoid/VoidBed.cs +++ b/Items/Placeables/FurnitureVoid/VoidBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidBookcase.cs b/Items/Placeables/FurnitureVoid/VoidBookcase.cs index 9039436fa9..65ac40cdef 100644 --- a/Items/Placeables/FurnitureVoid/VoidBookcase.cs +++ b/Items/Placeables/FurnitureVoid/VoidBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidCandelabra.cs b/Items/Placeables/FurnitureVoid/VoidCandelabra.cs index 42c3c15066..5b043ce49f 100644 --- a/Items/Placeables/FurnitureVoid/VoidCandelabra.cs +++ b/Items/Placeables/FurnitureVoid/VoidCandelabra.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidCandle.cs b/Items/Placeables/FurnitureVoid/VoidCandle.cs index ac8fc9f8f0..5cca74e980 100644 --- a/Items/Placeables/FurnitureVoid/VoidCandle.cs +++ b/Items/Placeables/FurnitureVoid/VoidCandle.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidChair.cs b/Items/Placeables/FurnitureVoid/VoidChair.cs index 39668a3a77..f86f544367 100644 --- a/Items/Placeables/FurnitureVoid/VoidChair.cs +++ b/Items/Placeables/FurnitureVoid/VoidChair.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidChandelier.cs b/Items/Placeables/FurnitureVoid/VoidChandelier.cs index d52e4b2939..0a3beac57f 100644 --- a/Items/Placeables/FurnitureVoid/VoidChandelier.cs +++ b/Items/Placeables/FurnitureVoid/VoidChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidChest.cs b/Items/Placeables/FurnitureVoid/VoidChest.cs index 806985f1a2..a611920294 100644 --- a/Items/Placeables/FurnitureVoid/VoidChest.cs +++ b/Items/Placeables/FurnitureVoid/VoidChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidClock.cs b/Items/Placeables/FurnitureVoid/VoidClock.cs index d721d180ed..679d52d147 100644 --- a/Items/Placeables/FurnitureVoid/VoidClock.cs +++ b/Items/Placeables/FurnitureVoid/VoidClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidDoor.cs b/Items/Placeables/FurnitureVoid/VoidDoor.cs index a07e1020d2..e3aa493874 100644 --- a/Items/Placeables/FurnitureVoid/VoidDoor.cs +++ b/Items/Placeables/FurnitureVoid/VoidDoor.cs @@ -1,5 +1,6 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.FurnitureVoid; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidDresser.cs b/Items/Placeables/FurnitureVoid/VoidDresser.cs index 30dc30c36d..19cefccc9f 100644 --- a/Items/Placeables/FurnitureVoid/VoidDresser.cs +++ b/Items/Placeables/FurnitureVoid/VoidDresser.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidLamp.cs b/Items/Placeables/FurnitureVoid/VoidLamp.cs index a4c67f0d7d..05b797734e 100644 --- a/Items/Placeables/FurnitureVoid/VoidLamp.cs +++ b/Items/Placeables/FurnitureVoid/VoidLamp.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidLantern.cs b/Items/Placeables/FurnitureVoid/VoidLantern.cs index 389f704e44..165bfa5d15 100644 --- a/Items/Placeables/FurnitureVoid/VoidLantern.cs +++ b/Items/Placeables/FurnitureVoid/VoidLantern.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidPiano.cs b/Items/Placeables/FurnitureVoid/VoidPiano.cs index 06297179e1..f5b8ed450b 100644 --- a/Items/Placeables/FurnitureVoid/VoidPiano.cs +++ b/Items/Placeables/FurnitureVoid/VoidPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidSink.cs b/Items/Placeables/FurnitureVoid/VoidSink.cs index 6ddc710bf5..621a0e86dc 100644 --- a/Items/Placeables/FurnitureVoid/VoidSink.cs +++ b/Items/Placeables/FurnitureVoid/VoidSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidSofa.cs b/Items/Placeables/FurnitureVoid/VoidSofa.cs index d176d3b1db..3cb55dc521 100644 --- a/Items/Placeables/FurnitureVoid/VoidSofa.cs +++ b/Items/Placeables/FurnitureVoid/VoidSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidTable.cs b/Items/Placeables/FurnitureVoid/VoidTable.cs index 43c66aa2e1..d2d2c94f41 100644 --- a/Items/Placeables/FurnitureVoid/VoidTable.cs +++ b/Items/Placeables/FurnitureVoid/VoidTable.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidWorkbench.cs b/Items/Placeables/FurnitureVoid/VoidWorkbench.cs index 49ff732a8a..635049c9f6 100644 --- a/Items/Placeables/FurnitureVoid/VoidWorkbench.cs +++ b/Items/Placeables/FurnitureVoid/VoidWorkbench.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureVoid { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/FurnitureVoid/VoidstoneSlab.cs b/Items/Placeables/FurnitureVoid/VoidstoneSlab.cs index 40d4786d11..6f3c743e0b 100644 --- a/Items/Placeables/FurnitureVoid/VoidstoneSlab.cs +++ b/Items/Placeables/FurnitureVoid/VoidstoneSlab.cs @@ -1,7 +1,8 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Placeables.FurnitureVoid { public class VoidstoneSlab : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureVoid item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/HardenedAstralSand.cs b/Items/Placeables/HardenedAstralSand.cs index 1bddfd6910..7860ece387 100644 --- a/Items/Placeables/HardenedAstralSand.cs +++ b/Items/Placeables/HardenedAstralSand.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this, 1); recipe.AddRecipe(); diff --git a/Items/Placeables/HardenedSulphurousSandstone.cs b/Items/Placeables/HardenedSulphurousSandstone.cs index 68f6cdd0d4..ce46f8634b 100644 --- a/Items/Placeables/HardenedSulphurousSandstone.cs +++ b/Items/Placeables/HardenedSulphurousSandstone.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs b/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs index 61e6cfb425..74de282172 100644 --- a/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs +++ b/Items/Placeables/LivingFire/LivingBrimstoneFireBlock.cs @@ -1,13 +1,11 @@ -using CalamityMod.Items.Placeables; using CalamityMod.Tiles.LivingFire; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.LivingFire { - public class LivingBrimstoneFireBlock : ModItem + public class LivingBrimstoneFireBlock : ModItem { public override void SetStaticDefaults() { @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Placeables.LivingFire item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/LivingFire/LivingGodSlayerFireBlock.cs b/Items/Placeables/LivingFire/LivingGodSlayerFireBlock.cs index 09cd09e454..7d726351e8 100644 --- a/Items/Placeables/LivingFire/LivingGodSlayerFireBlock.cs +++ b/Items/Placeables/LivingFire/LivingGodSlayerFireBlock.cs @@ -1,13 +1,12 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.LivingFire; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.LivingFire { - public class LivingGodSlayerFireBlock : ModItem + public class LivingGodSlayerFireBlock : ModItem { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Placeables.LivingFire item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/LivingFire/LivingHolyFireBlock.cs b/Items/Placeables/LivingFire/LivingHolyFireBlock.cs index 39485fa6c2..09a9064b41 100644 --- a/Items/Placeables/LivingFire/LivingHolyFireBlock.cs +++ b/Items/Placeables/LivingFire/LivingHolyFireBlock.cs @@ -1,13 +1,12 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.LivingFire; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.LivingFire { - public class LivingHolyFireBlock : ModItem + public class LivingHolyFireBlock : ModItem { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Placeables.LivingFire item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Navystone.cs b/Items/Placeables/Navystone.cs index f2d5dd1a3d..abb570b5c9 100644 --- a/Items/Placeables/Navystone.cs +++ b/Items/Placeables/Navystone.cs @@ -1,6 +1,7 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureEutrophic; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Placeables { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this); recipe.AddRecipe(); recipe = new ModRecipe(mod); diff --git a/Items/Placeables/Ores/AerialiteOre.cs b/Items/Placeables/Ores/AerialiteOre.cs index 73f1ac68f1..5a9a448138 100644 --- a/Items/Placeables/Ores/AerialiteOre.cs +++ b/Items/Placeables/Ores/AerialiteOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/AstralOre.cs b/Items/Placeables/Ores/AstralOre.cs index ce620f1b39..69bc1a7864 100644 --- a/Items/Placeables/Ores/AstralOre.cs +++ b/Items/Placeables/Ores/AstralOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/AuricOre.cs b/Items/Placeables/Ores/AuricOre.cs index 49930ebde1..ab00f8060a 100644 --- a/Items/Placeables/Ores/AuricOre.cs +++ b/Items/Placeables/Ores/AuricOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/ChaoticOre.cs b/Items/Placeables/Ores/ChaoticOre.cs index c4caff39ed..462f52744c 100644 --- a/Items/Placeables/Ores/ChaoticOre.cs +++ b/Items/Placeables/Ores/ChaoticOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/CharredOre.cs b/Items/Placeables/Ores/CharredOre.cs index 5d772c198e..bf4d6c81d3 100644 --- a/Items/Placeables/Ores/CharredOre.cs +++ b/Items/Placeables/Ores/CharredOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/CryonicOre.cs b/Items/Placeables/Ores/CryonicOre.cs index 609e77563f..827a46f994 100644 --- a/Items/Placeables/Ores/CryonicOre.cs +++ b/Items/Placeables/Ores/CryonicOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/ExodiumClusterOre.cs b/Items/Placeables/Ores/ExodiumClusterOre.cs index 268ec2aa3f..7bb3081407 100644 --- a/Items/Placeables/Ores/ExodiumClusterOre.cs +++ b/Items/Placeables/Ores/ExodiumClusterOre.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Ores; +using CalamityMod.Tiles.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/PerennialOre.cs b/Items/Placeables/Ores/PerennialOre.cs index aecabea730..2f3981d1f7 100644 --- a/Items/Placeables/Ores/PerennialOre.cs +++ b/Items/Placeables/Ores/PerennialOre.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Ores { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Ores/UelibloomOre.cs b/Items/Placeables/Ores/UelibloomOre.cs index 93c7ba6603..fe9d27737d 100644 --- a/Items/Placeables/Ores/UelibloomOre.cs +++ b/Items/Placeables/Ores/UelibloomOre.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Ores @@ -15,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Ores public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/PerennialBrick.cs b/Items/Placeables/PerennialBrick.cs index 50ae25086e..b93e5b270d 100644 --- a/Items/Placeables/PerennialBrick.cs +++ b/Items/Placeables/PerennialBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/PlantyMush.cs b/Items/Placeables/PlantyMush.cs index 27486f66ca..bcb1df91d4 100644 --- a/Items/Placeables/PlantyMush.cs +++ b/Items/Placeables/PlantyMush.cs @@ -1,4 +1,5 @@ -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/PrismShard.cs b/Items/Placeables/PrismShard.cs index befbdeedfc..517835f1bf 100644 --- a/Items/Placeables/PrismShard.cs +++ b/Items/Placeables/PrismShard.cs @@ -1,5 +1,6 @@ -using CalamityMod.Tiles.SunkenSea; +using CalamityMod.Tiles.SunkenSea; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/SeaPrism.cs b/Items/Placeables/SeaPrism.cs index 6f81baa6c7..9166f710dc 100644 --- a/Items/Placeables/SeaPrism.cs +++ b/Items/Placeables/SeaPrism.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/SulphurousSand.cs b/Items/Placeables/SulphurousSand.cs index 19e3dc5f45..7ac38dbc76 100644 --- a/Items/Placeables/SulphurousSand.cs +++ b/Items/Placeables/SulphurousSand.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { public class SulphurousSand : ModItem @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Placeables/SulphurousSandstone.cs b/Items/Placeables/SulphurousSandstone.cs index 854db54095..bb6ee05063 100644 --- a/Items/Placeables/SulphurousSandstone.cs +++ b/Items/Placeables/SulphurousSandstone.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Placeables { public class SulphurousSandstone : ModItem @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Placeables public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Placeables/Tenebris.cs b/Items/Placeables/Tenebris.cs index 41b3e81813..f320acc050 100644 --- a/Items/Placeables/Tenebris.cs +++ b/Items/Placeables/Tenebris.cs @@ -1,4 +1,5 @@ -using Terraria; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables public override void SetDefaults() { item.createTile = ModContent.TileType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/UelibloomBrick.cs b/Items/Placeables/UelibloomBrick.cs index cd344ba449..2e8c44954e 100644 --- a/Items/Placeables/UelibloomBrick.cs +++ b/Items/Placeables/UelibloomBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Items.Placeables.FurnitureBotanic; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Voidstone.cs b/Items/Placeables/Voidstone.cs index 1e388b2fe4..db6a9ef38c 100644 --- a/Items/Placeables/Voidstone.cs +++ b/Items/Placeables/Voidstone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); } diff --git a/Items/Placeables/Walls/AbyssGravelWallItem.cs b/Items/Placeables/Walls/AbyssGravelWallItem.cs index 4a71b1aa1b..37dbd3a637 100644 --- a/Items/Placeables/Walls/AbyssGravelWallItem.cs +++ b/Items/Placeables/Walls/AbyssGravelWallItem.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/AerialiteBrickWall.cs b/Items/Placeables/Walls/AerialiteBrickWall.cs index bda0fc4f7b..38d0778f73 100644 --- a/Items/Placeables/Walls/AerialiteBrickWall.cs +++ b/Items/Placeables/Walls/AerialiteBrickWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AerialiteBrickWall : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -27,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/AshenSlabWall.cs b/Items/Placeables/Walls/AshenSlabWall.cs index d0b91ce173..e507ded4b0 100644 --- a/Items/Placeables/Walls/AshenSlabWall.cs +++ b/Items/Placeables/Walls/AshenSlabWall.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Placeables.FurnitureAshen; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AshenSlabWall : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.createWall = ModContent.WallType(); @@ -29,7 +31,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/AstralBrickWall.cs b/Items/Placeables/Walls/AstralBrickWall.cs index fcf25f34b6..97093d3a49 100644 --- a/Items/Placeables/Walls/AstralBrickWall.cs +++ b/Items/Placeables/Walls/AstralBrickWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralBrickWall : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -27,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/AstralDirtWall.cs b/Items/Placeables/Walls/AstralDirtWall.cs index a3b4b4b58b..13b732276d 100644 --- a/Items/Placeables/Walls/AstralDirtWall.cs +++ b/Items/Placeables/Walls/AstralDirtWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralDirtWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 7; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/AstralFossilWall.cs b/Items/Placeables/Walls/AstralFossilWall.cs index bb14713258..ac98d407a9 100644 --- a/Items/Placeables/Walls/AstralFossilWall.cs +++ b/Items/Placeables/Walls/AstralFossilWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralFossilWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/AstralGrassWall.cs b/Items/Placeables/Walls/AstralGrassWall.cs index 6beb85065a..02a358b4ad 100644 --- a/Items/Placeables/Walls/AstralGrassWall.cs +++ b/Items/Placeables/Walls/AstralGrassWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralGrassWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Walls/AstralIceWall.cs b/Items/Placeables/Walls/AstralIceWall.cs index d30712a3f1..dea131be4e 100644 --- a/Items/Placeables/Walls/AstralIceWall.cs +++ b/Items/Placeables/Walls/AstralIceWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralIceWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/AstralMonolithWall.cs b/Items/Placeables/Walls/AstralMonolithWall.cs index 4e47831f72..36f9c4a6ce 100644 --- a/Items/Placeables/Walls/AstralMonolithWall.cs +++ b/Items/Placeables/Walls/AstralMonolithWall.cs @@ -1,7 +1,7 @@ -using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; -using WallTiles = CalamityMod.Walls; // If you are using c# 6, you can use: "using static Terraria.Localization.GameCulture;" which would mean you could just write "DisplayName.AddTranslation(German, "");" +using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/AstralSandstoneWall.cs b/Items/Placeables/Walls/AstralSandstoneWall.cs index d117622196..8f13f3330e 100644 --- a/Items/Placeables/Walls/AstralSandstoneWall.cs +++ b/Items/Placeables/Walls/AstralSandstoneWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralSandstoneWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/AstralSnowWall.cs b/Items/Placeables/Walls/AstralSnowWall.cs index a6db11bd6b..46755c10cb 100644 --- a/Items/Placeables/Walls/AstralSnowWall.cs +++ b/Items/Placeables/Walls/AstralSnowWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralSnowWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/AstralStoneWall.cs b/Items/Placeables/Walls/AstralStoneWall.cs index 795038b0eb..04bc91380a 100644 --- a/Items/Placeables/Walls/AstralStoneWall.cs +++ b/Items/Placeables/Walls/AstralStoneWall.cs @@ -1,5 +1,7 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class AstralStoneWall : ModItem @@ -12,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/BlueBrickWallUnsafe.cs b/Items/Placeables/Walls/BlueBrickWallUnsafe.cs index 61e21a0478..cc1486a84a 100644 --- a/Items/Placeables/Walls/BlueBrickWallUnsafe.cs +++ b/Items/Placeables/Walls/BlueBrickWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.BlueDungeonUnsafe; } diff --git a/Items/Placeables/Walls/BlueSlabWallUnsafe.cs b/Items/Placeables/Walls/BlueSlabWallUnsafe.cs index 2198cc8828..3e96fc21d9 100644 --- a/Items/Placeables/Walls/BlueSlabWallUnsafe.cs +++ b/Items/Placeables/Walls/BlueSlabWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.BlueDungeonSlabUnsafe; } diff --git a/Items/Placeables/Walls/BlueTiledWallUnsafe.cs b/Items/Placeables/Walls/BlueTiledWallUnsafe.cs index 366b0deb4a..a67f1d2f53 100644 --- a/Items/Placeables/Walls/BlueTiledWallUnsafe.cs +++ b/Items/Placeables/Walls/BlueTiledWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.BlueDungeonTileUnsafe; } diff --git a/Items/Placeables/Walls/BrimstoneSlagWall.cs b/Items/Placeables/Walls/BrimstoneSlagWall.cs index 1cd00f6d8a..af2e428daa 100644 --- a/Items/Placeables/Walls/BrimstoneSlagWall.cs +++ b/Items/Placeables/Walls/BrimstoneSlagWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class BrimstoneSlagWall : ModItem @@ -13,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -22,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Walls { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 4); recipe.AddRecipe(); } diff --git a/Items/Placeables/Walls/ChaoticBrickWall.cs b/Items/Placeables/Walls/ChaoticBrickWall.cs index 50b827e0b2..b95d9a77c5 100644 --- a/Items/Placeables/Walls/ChaoticBrickWall.cs +++ b/Items/Placeables/Walls/ChaoticBrickWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class ChaoticBrickWall : ModItem @@ -13,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -22,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Walls { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 1); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 4); recipe.AddRecipe(); } diff --git a/Items/Placeables/Walls/CinderplateWall.cs b/Items/Placeables/Walls/CinderplateWall.cs index 9df72de716..33781b2a04 100644 --- a/Items/Placeables/Walls/CinderplateWall.cs +++ b/Items/Placeables/Walls/CinderplateWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class CinderplateWall : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/CosmiliteBrickWall.cs b/Items/Placeables/Walls/CosmiliteBrickWall.cs index 29553b7bdf..b482d874fa 100644 --- a/Items/Placeables/Walls/CosmiliteBrickWall.cs +++ b/Items/Placeables/Walls/CosmiliteBrickWall.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class CosmiliteBrickWall : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +30,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/CryonicBrickWall.cs b/Items/Placeables/Walls/CryonicBrickWall.cs index 5eb8b7337b..f6b0d9a336 100644 --- a/Items/Placeables/Walls/CryonicBrickWall.cs +++ b/Items/Placeables/Walls/CryonicBrickWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class CryonicBrickWall : ModItem @@ -17,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -27,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/EutrophicSandWall.cs b/Items/Placeables/Walls/EutrophicSandWall.cs index 2f62148f1f..0244df9fb2 100644 --- a/Items/Placeables/Walls/EutrophicSandWall.cs +++ b/Items/Placeables/Walls/EutrophicSandWall.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class EutrophicSandWall : ModItem @@ -13,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/EutrophicSandWallSafe.cs b/Items/Placeables/Walls/EutrophicSandWallSafe.cs index 3e1bf05a31..4d24db55b6 100644 --- a/Items/Placeables/Walls/EutrophicSandWallSafe.cs +++ b/Items/Placeables/Walls/EutrophicSandWallSafe.cs @@ -1,5 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; + namespace CalamityMod.Items.Placeables.Walls { public class EutrophicSandWallSafe : ModItem @@ -13,7 +15,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -22,7 +24,7 @@ namespace CalamityMod.Items.Placeables.Walls { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 4); recipe.AddRecipe(); } diff --git a/Items/Placeables/Walls/GreenBrickWallUnsafe.cs b/Items/Placeables/Walls/GreenBrickWallUnsafe.cs index dfa9154bf5..3a3cf6ceeb 100644 --- a/Items/Placeables/Walls/GreenBrickWallUnsafe.cs +++ b/Items/Placeables/Walls/GreenBrickWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.GreenDungeonUnsafe; } diff --git a/Items/Placeables/Walls/GreenSlabWallUnsafe.cs b/Items/Placeables/Walls/GreenSlabWallUnsafe.cs index 74c598c34e..240b76f75d 100644 --- a/Items/Placeables/Walls/GreenSlabWallUnsafe.cs +++ b/Items/Placeables/Walls/GreenSlabWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.GreenDungeonSlabUnsafe; } diff --git a/Items/Placeables/Walls/GreenTiledWallUnsafe.cs b/Items/Placeables/Walls/GreenTiledWallUnsafe.cs index 5a94140c08..91dc8d687f 100644 --- a/Items/Placeables/Walls/GreenTiledWallUnsafe.cs +++ b/Items/Placeables/Walls/GreenTiledWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.GreenDungeonTileUnsafe; } diff --git a/Items/Placeables/Walls/HardenedAstralSandWall.cs b/Items/Placeables/Walls/HardenedAstralSandWall.cs index 71380c8c14..c6c3f06935 100644 --- a/Items/Placeables/Walls/HardenedAstralSandWall.cs +++ b/Items/Placeables/Walls/HardenedAstralSandWall.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs b/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs index 7fab425008..df4ab65d7d 100644 --- a/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs +++ b/Items/Placeables/Walls/HardenedSulphurousSandstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/NavystoneWall.cs b/Items/Placeables/Walls/NavystoneWall.cs index d4ac3c26c6..2baee58fdf 100644 --- a/Items/Placeables/Walls/NavystoneWall.cs +++ b/Items/Placeables/Walls/NavystoneWall.cs @@ -1,5 +1,6 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Walls { public class NavystoneWall : ModItem @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Walls { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 4); recipe.AddRecipe(); } diff --git a/Items/Placeables/Walls/NavystoneWallSafe.cs b/Items/Placeables/Walls/NavystoneWallSafe.cs index 37face8557..0c899e051b 100644 --- a/Items/Placeables/Walls/NavystoneWallSafe.cs +++ b/Items/Placeables/Walls/NavystoneWallSafe.cs @@ -1,5 +1,6 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Walls { public class NavystoneWallSafe : ModItem @@ -13,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Walls { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this, 4); recipe.AddRecipe(); } diff --git a/Items/Placeables/Walls/OccultStoneWall.cs b/Items/Placeables/Walls/OccultStoneWall.cs index ede61e61ce..fe0c5b2a03 100644 --- a/Items/Placeables/Walls/OccultStoneWall.cs +++ b/Items/Placeables/Walls/OccultStoneWall.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Placeables.FurnitureOccult; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Walls { public class OccultStoneWall : ModItem @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/PerennialBrickWall.cs b/Items/Placeables/Walls/PerennialBrickWall.cs index 5d84ffa3f4..36e36acf55 100644 --- a/Items/Placeables/Walls/PerennialBrickWall.cs +++ b/Items/Placeables/Walls/PerennialBrickWall.cs @@ -1,5 +1,6 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; +using Terraria.ID; namespace CalamityMod.Items.Placeables.Walls { public class PerennialBrickWall : ModItem @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -27,7 +28,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/PinkBrickWallUnsafe.cs b/Items/Placeables/Walls/PinkBrickWallUnsafe.cs index 0efe3f1e6f..1ebd084c02 100644 --- a/Items/Placeables/Walls/PinkBrickWallUnsafe.cs +++ b/Items/Placeables/Walls/PinkBrickWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.PinkDungeonUnsafe; } diff --git a/Items/Placeables/Walls/PinkSlabWallUnsafe.cs b/Items/Placeables/Walls/PinkSlabWallUnsafe.cs index f0852df71f..3d4f6f81f3 100644 --- a/Items/Placeables/Walls/PinkSlabWallUnsafe.cs +++ b/Items/Placeables/Walls/PinkSlabWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.PinkDungeonSlabUnsafe; } diff --git a/Items/Placeables/Walls/PinkTiledWallUnsafe.cs b/Items/Placeables/Walls/PinkTiledWallUnsafe.cs index 29235e60a9..2f73deb5c0 100644 --- a/Items/Placeables/Walls/PinkTiledWallUnsafe.cs +++ b/Items/Placeables/Walls/PinkTiledWallUnsafe.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Walls { @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = WallID.PinkDungeonTileUnsafe; } diff --git a/Items/Placeables/Walls/PlaguedPlateWall.cs b/Items/Placeables/Walls/PlaguedPlateWall.cs index 6dc898930a..69a74e58bc 100644 --- a/Items/Placeables/Walls/PlaguedPlateWall.cs +++ b/Items/Placeables/Walls/PlaguedPlateWall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.FurniturePlaguedPlate; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/ProfanedCrystalWall.cs b/Items/Placeables/Walls/ProfanedCrystalWall.cs index 2252423c5d..aaa21daa4c 100644 --- a/Items/Placeables/Walls/ProfanedCrystalWall.cs +++ b/Items/Placeables/Walls/ProfanedCrystalWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/ProfanedRockWall.cs b/Items/Placeables/Walls/ProfanedRockWall.cs index 61215bcf4d..3cdca800e8 100644 --- a/Items/Placeables/Walls/ProfanedRockWall.cs +++ b/Items/Placeables/Walls/ProfanedRockWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/ProfanedSlabWall.cs b/Items/Placeables/Walls/ProfanedSlabWall.cs index f0d637da96..fd97b87c70 100644 --- a/Items/Placeables/Walls/ProfanedSlabWall.cs +++ b/Items/Placeables/Walls/ProfanedSlabWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/RunicProfanedBrickWall.cs b/Items/Placeables/Walls/RunicProfanedBrickWall.cs index 3224b14b4d..254d803644 100644 --- a/Items/Placeables/Walls/RunicProfanedBrickWall.cs +++ b/Items/Placeables/Walls/RunicProfanedBrickWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureProfaned; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/SilvaWall.cs b/Items/Placeables/Walls/SilvaWall.cs index 5d35348089..d13ef6d3a4 100644 --- a/Items/Placeables/Walls/SilvaWall.cs +++ b/Items/Placeables/Walls/SilvaWall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.FurnitureSilva; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/SmoothAbyssGravelWall.cs b/Items/Placeables/Walls/SmoothAbyssGravelWall.cs index 87f932ffad..c5217f8a42 100644 --- a/Items/Placeables/Walls/SmoothAbyssGravelWall.cs +++ b/Items/Placeables/Walls/SmoothAbyssGravelWall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.FurnitureAbyss; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/SmoothBrimstoneSlagWall.cs b/Items/Placeables/Walls/SmoothBrimstoneSlagWall.cs index b262bf9a9a..1dc311d536 100644 --- a/Items/Placeables/Walls/SmoothBrimstoneSlagWall.cs +++ b/Items/Placeables/Walls/SmoothBrimstoneSlagWall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.FurnitureAshen; using Terraria.ModLoader; +using Terraria.ID; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.rare = 3; item.consumable = true; item.createWall = ModContent.WallType(); @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/SmoothNavystoneWall.cs b/Items/Placeables/Walls/SmoothNavystoneWall.cs index dcdf443b5f..df61a4a81f 100644 --- a/Items/Placeables/Walls/SmoothNavystoneWall.cs +++ b/Items/Placeables/Walls/SmoothNavystoneWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureEutrophic; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/SmoothVoidstoneWall.cs b/Items/Placeables/Walls/SmoothVoidstoneWall.cs index 6206d3be93..4edad0bc01 100644 --- a/Items/Placeables/Walls/SmoothVoidstoneWall.cs +++ b/Items/Placeables/Walls/SmoothVoidstoneWall.cs @@ -3,6 +3,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; + namespace CalamityMod.Items.Placeables.Walls { public class SmoothVoidstoneWall : ModItem @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/StatigelWall.cs b/Items/Placeables/Walls/StatigelWall.cs index 8bbd84f106..b19e8c6fa4 100644 --- a/Items/Placeables/Walls/StatigelWall.cs +++ b/Items/Placeables/Walls/StatigelWall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.FurnitureStatigel; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -19,7 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/StratusWall.cs b/Items/Placeables/Walls/StratusWall.cs index ea73c6389e..1520125c5e 100644 --- a/Items/Placeables/Walls/StratusWall.cs +++ b/Items/Placeables/Walls/StratusWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureStratus; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Placeables.Walls ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); - recipe.AddTile(18); + recipe.AddTile(TileID.WorkBenches); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Walls/SulphurousSandWall.cs b/Items/Placeables/Walls/SulphurousSandWall.cs index 0a29b7bfd0..0335702073 100644 --- a/Items/Placeables/Walls/SulphurousSandWall.cs +++ b/Items/Placeables/Walls/SulphurousSandWall.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; @@ -26,7 +27,8 @@ namespace CalamityMod.Items.Placeables.Walls public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(18); + recipe.AddTile( + 18); recipe.AddIngredient(ModContent.ItemType()); recipe.SetResult(this, 4); recipe.AddRecipe(); diff --git a/Items/Placeables/Walls/SulphurousSandstoneWall.cs b/Items/Placeables/Walls/SulphurousSandstoneWall.cs index a124416ed5..3c260a5e7b 100644 --- a/Items/Placeables/Walls/SulphurousSandstoneWall.cs +++ b/Items/Placeables/Walls/SulphurousSandstoneWall.cs @@ -1,4 +1,5 @@ -using Terraria.ModLoader; +using Terraria.ID; +using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls { @@ -12,7 +13,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { item.createWall = ModContent.WallType(); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.useAnimation = 15; item.useTime = 10; diff --git a/Items/Placeables/Walls/UelibloomBrickWall.cs b/Items/Placeables/Walls/UelibloomBrickWall.cs index cd7d924fea..fd8c45eae1 100644 --- a/Items/Placeables/Walls/UelibloomBrickWall.cs +++ b/Items/Placeables/Walls/UelibloomBrickWall.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; namespace CalamityMod.Items.Placeables.Walls @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/VoidstoneSlabWall.cs b/Items/Placeables/Walls/VoidstoneSlabWall.cs index 2ac830ab2b..50c4307646 100644 --- a/Items/Placeables/Walls/VoidstoneSlabWall.cs +++ b/Items/Placeables/Walls/VoidstoneSlabWall.cs @@ -3,6 +3,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; + namespace CalamityMod.Items.Placeables.Walls { public class VoidstoneSlabWall : ModItem @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Placeables/Walls/VoidstoneWall.cs b/Items/Placeables/Walls/VoidstoneWall.cs index 97e0e86d24..71e6cb8eed 100644 --- a/Items/Placeables/Walls/VoidstoneWall.cs +++ b/Items/Placeables/Walls/VoidstoneWall.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Walls item.autoReuse = true; item.useAnimation = 15; item.useTime = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createWall = ModContent.WallType(); } diff --git a/Items/Potions/Alcohol/BloodyMary.cs b/Items/Potions/Alcohol/BloodyMary.cs index af1098189d..5977d1cb65 100644 --- a/Items/Potions/Alcohol/BloodyMary.cs +++ b/Items/Potions/Alcohol/BloodyMary.cs @@ -24,7 +24,7 @@ Reduces life regen by 2 and defense by 6"); item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/CaribbeanRum.cs b/Items/Potions/Alcohol/CaribbeanRum.cs index 12e3eee559..a111e0d38f 100644 --- a/Items/Potions/Alcohol/CaribbeanRum.cs +++ b/Items/Potions/Alcohol/CaribbeanRum.cs @@ -24,7 +24,7 @@ Makes you floaty and reduces defense by 12"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/CinnamonRoll.cs b/Items/Potions/Alcohol/CinnamonRoll.cs index 995e3cb13a..cde44bd371 100644 --- a/Items/Potions/Alcohol/CinnamonRoll.cs +++ b/Items/Potions/Alcohol/CinnamonRoll.cs @@ -26,7 +26,7 @@ Reduces defense by 12"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Everclear.cs b/Items/Potions/Alcohol/Everclear.cs index b93f36370d..872d2126c5 100644 --- a/Items/Potions/Alcohol/Everclear.cs +++ b/Items/Potions/Alcohol/Everclear.cs @@ -24,7 +24,7 @@ Reduces life regen by 10 and defense by 40"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index a75ee9cdd9..b7b3ca9307 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/FabsolsVodka.cs b/Items/Potions/Alcohol/FabsolsVodka.cs index 81a4cb69a9..812c007e92 100644 --- a/Items/Potions/Alcohol/FabsolsVodka.cs +++ b/Items/Potions/Alcohol/FabsolsVodka.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions.Alcohol item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index 44e9e869ec..4d87fd005e 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -26,7 +26,7 @@ Reduces life regen by 1"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index b14fe3f62c..68c3e97a5e 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -25,7 +25,7 @@ Reduces defense by 2 and movement speed by 5%"); item.rare = 1; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.healLife = 100; item.consumable = true; diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index b5e6b64dce..613329475c 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -26,7 +26,7 @@ Reduces defense by 6 and life regen by 1"); item.rare = 5; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; diff --git a/Items/Potions/Alcohol/Moonshine.cs b/Items/Potions/Alcohol/Moonshine.cs index 9e31dac7b0..d6b4630518 100644 --- a/Items/Potions/Alcohol/Moonshine.cs +++ b/Items/Potions/Alcohol/Moonshine.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/MoscowMule.cs b/Items/Potions/Alcohol/MoscowMule.cs index cdf5648e4d..e2d8c6abe0 100644 --- a/Items/Potions/Alcohol/MoscowMule.cs +++ b/Items/Potions/Alcohol/MoscowMule.cs @@ -24,7 +24,7 @@ Reduces life regen by 2"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/OddMushroom.cs b/Items/Potions/Alcohol/OddMushroom.cs index c0551a6dc2..c8f34dfd96 100644 --- a/Items/Potions/Alcohol/OddMushroom.cs +++ b/Items/Potions/Alcohol/OddMushroom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions.Alcohol item.useAnimation = 17; item.useTime = 17; item.rare = 3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item2; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index a1fb141b12..48facc24f6 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 1; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.healLife = 200; item.consumable = true; diff --git a/Items/Potions/Alcohol/Rum.cs b/Items/Potions/Alcohol/Rum.cs index 6e2842c8bd..ad5efb2135 100644 --- a/Items/Potions/Alcohol/Rum.cs +++ b/Items/Potions/Alcohol/Rum.cs @@ -24,7 +24,7 @@ Reduces defense by 8"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Screwdriver.cs b/Items/Potions/Alcohol/Screwdriver.cs index bb86f77f5d..b70b8f0eb6 100644 --- a/Items/Potions/Alcohol/Screwdriver.cs +++ b/Items/Potions/Alcohol/Screwdriver.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/StarBeamRye.cs b/Items/Potions/Alcohol/StarBeamRye.cs index f21d5a50f0..7d3a010bce 100644 --- a/Items/Potions/Alcohol/StarBeamRye.cs +++ b/Items/Potions/Alcohol/StarBeamRye.cs @@ -25,7 +25,7 @@ Reduces defense by 6 and life regen by 1"); item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Tequila.cs b/Items/Potions/Alcohol/Tequila.cs index a87c972841..09aa8468bf 100644 --- a/Items/Potions/Alcohol/Tequila.cs +++ b/Items/Potions/Alcohol/Tequila.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/TequilaSunrise.cs b/Items/Potions/Alcohol/TequilaSunrise.cs index de0101291f..ccdeb1e250 100644 --- a/Items/Potions/Alcohol/TequilaSunrise.cs +++ b/Items/Potions/Alcohol/TequilaSunrise.cs @@ -24,7 +24,7 @@ Reduces life regen by 1"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Vodka.cs b/Items/Potions/Alcohol/Vodka.cs index 80dee69cb8..1b1647d0e8 100644 --- a/Items/Potions/Alcohol/Vodka.cs +++ b/Items/Potions/Alcohol/Vodka.cs @@ -24,7 +24,7 @@ Reduces life regen by 1 and defense by 4"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/Whiskey.cs b/Items/Potions/Alcohol/Whiskey.cs index 38b303f939..54cc55b724 100644 --- a/Items/Potions/Alcohol/Whiskey.cs +++ b/Items/Potions/Alcohol/Whiskey.cs @@ -24,7 +24,7 @@ Reduces defense by 8"); item.rare = 2; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index 1f3665f36e..1eeffbb613 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -24,7 +24,7 @@ Reduces defense by 6 and life regen by 1"); item.rare = 4; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.healMana = 400; diff --git a/Items/Potions/AnechoicCoating.cs b/Items/Potions/AnechoicCoating.cs index b4ae0b0d45..2ec329c4d4 100644 --- a/Items/Potions/AnechoicCoating.cs +++ b/Items/Potions/AnechoicCoating.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/AstralInjection.cs b/Items/Potions/AstralInjection.cs index 8e9bdb7634..bea213c75b 100644 --- a/Items/Potions/AstralInjection.cs +++ b/Items/Potions/AstralInjection.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.DataStructures; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/AstralJelly.cs b/Items/Potions/AstralJelly.cs index a81d078260..fc9d41d7f2 100644 --- a/Items/Potions/AstralJelly.cs +++ b/Items/Potions/AstralJelly.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.useAnimation = 17; item.useTime = 17; item.rare = 7; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.healMana = 200; item.UseSound = SoundID.Item3; item.consumable = true; diff --git a/Items/Potions/Baguette.cs b/Items/Potions/Baguette.cs index 21e041a251..6c20b1b2b9 100644 --- a/Items/Potions/Baguette.cs +++ b/Items/Potions/Baguette.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.Potions; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.useAnimation = 17; item.useTime = 17; item.rare = 1; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item2; item.consumable = true; item.value = Item.buyPrice(0, 0, 50, 0); diff --git a/Items/Potions/BoundingPotion.cs b/Items/Potions/BoundingPotion.cs index 1c6eac1b71..83c761a909 100644 --- a/Items/Potions/BoundingPotion.cs +++ b/Items/Potions/BoundingPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/CadencePotion.cs b/Items/Potions/CadencePotion.cs index 5374214e7f..c02e28ba72 100644 --- a/Items/Potions/CadencePotion.cs +++ b/Items/Potions/CadencePotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/CalamitasBrew.cs b/Items/Potions/CalamitasBrew.cs index 0c3d0afd56..72c46ae0f2 100644 --- a/Items/Potions/CalamitasBrew.cs +++ b/Items/Potions/CalamitasBrew.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/CalciumPotion.cs b/Items/Potions/CalciumPotion.cs index d1c88894d9..2ae5e02014 100644 --- a/Items/Potions/CalciumPotion.cs +++ b/Items/Potions/CalciumPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/CeaselessHungerPotion.cs b/Items/Potions/CeaselessHungerPotion.cs index c011f98bce..e7f0db58cc 100644 --- a/Items/Potions/CeaselessHungerPotion.cs +++ b/Items/Potions/CeaselessHungerPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/CrumblingPotion.cs b/Items/Potions/CrumblingPotion.cs index fcff6d9521..d8d6b5b14d 100644 --- a/Items/Potions/CrumblingPotion.cs +++ b/Items/Potions/CrumblingPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/DeliciousMeat.cs b/Items/Potions/DeliciousMeat.cs index b16872c69f..05def0868c 100644 --- a/Items/Potions/DeliciousMeat.cs +++ b/Items/Potions/DeliciousMeat.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions item.useAnimation = 17; item.useTime = 17; item.UseSound = SoundID.Item2; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.useTurn = true; item.buffType = BuffID.WellFed; item.buffTime = 108000; diff --git a/Items/Potions/DraconicElixir.cs b/Items/Potions/DraconicElixir.cs index a7a01cd9a3..435e5f5e3c 100644 --- a/Items/Potions/DraconicElixir.cs +++ b/Items/Potions/DraconicElixir.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Potions Tooltip.SetDefault("Greatly increases wing flight time and speed and increases defense by 16\n" + "God slayer revival heals you to half HP instead of 150 HP when triggered\n" + "Silva invincibility heals you to half HP when triggered\n" + - "If you trigger the above heals you cannot drink this potion again for 60 seconds"); + "If you trigger the above heals you cannot drink this potion again for 60 seconds and you gain 30 seconds of potion sickness"); } public override void SetDefaults() @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/GravityNormalizerPotion.cs b/Items/Potions/GravityNormalizerPotion.cs index 47fe871041..7f4fe5fa42 100644 --- a/Items/Potions/GravityNormalizerPotion.cs +++ b/Items/Potions/GravityNormalizerPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.Items.Fishing.AstralCatches; using Terraria; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/HolyWrathPotion.cs b/Items/Potions/HolyWrathPotion.cs index d59c672eec..e9ce32dc5f 100644 --- a/Items/Potions/HolyWrathPotion.cs +++ b/Items/Potions/HolyWrathPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/OmegaHealingPotion.cs b/Items/Potions/OmegaHealingPotion.cs index 6f7c90dc8c..d7e71db6ba 100644 --- a/Items/Potions/OmegaHealingPotion.cs +++ b/Items/Potions/OmegaHealingPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Potions item.healLife = 300; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; diff --git a/Items/Potions/PenumbraPotion.cs b/Items/Potions/PenumbraPotion.cs index 7d001aac12..ef185ed897 100644 --- a/Items/Potions/PenumbraPotion.cs +++ b/Items/Potions/PenumbraPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/PhotosynthesisPotion.cs b/Items/Potions/PhotosynthesisPotion.cs index 45574fe3d2..05c380d3b9 100644 --- a/Items/Potions/PhotosynthesisPotion.cs +++ b/Items/Potions/PhotosynthesisPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/PotionofOmniscience.cs b/Items/Potions/PotionofOmniscience.cs index e80a5ae3ef..3a3cbf39fa 100644 --- a/Items/Potions/PotionofOmniscience.cs +++ b/Items/Potions/PotionofOmniscience.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/ProfanedRagePotion.cs b/Items/Potions/ProfanedRagePotion.cs index f560a6a5bb..d885297232 100644 --- a/Items/Potions/ProfanedRagePotion.cs +++ b/Items/Potions/ProfanedRagePotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/PurifiedJam.cs b/Items/Potions/PurifiedJam.cs index e2922cf4ef..d403e9f29c 100644 --- a/Items/Potions/PurifiedJam.cs +++ b/Items/Potions/PurifiedJam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Potions/RevivifyPotion.cs b/Items/Potions/RevivifyPotion.cs index 3d378d36b7..553f85e8d1 100644 --- a/Items/Potions/RevivifyPotion.cs +++ b/Items/Potions/RevivifyPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.Items.Fishing.SunkenSeaCatches; using Terraria; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/ShadowPotion.cs b/Items/Potions/ShadowPotion.cs index 7171a5d8f5..aec0a954a0 100644 --- a/Items/Potions/ShadowPotion.cs +++ b/Items/Potions/ShadowPotion.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.Potions ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.InvisibilityPotion); - recipe.AddIngredient(ItemID.AlchemyTable); - recipe.AddTile(TileID.Bottles); + recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this, 2); recipe.AddRecipe(); recipe = new ModRecipe(mod); diff --git a/Items/Potions/ShatteringPotion.cs b/Items/Potions/ShatteringPotion.cs index 79309c6c3e..bde143567e 100644 --- a/Items/Potions/ShatteringPotion.cs +++ b/Items/Potions/ShatteringPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index be7bbb0000..f4c764af50 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Materials; using Terraria; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/SulphurskinPotion.cs b/Items/Potions/SulphurskinPotion.cs index 0db7d4313a..27c569846c 100644 --- a/Items/Potions/SulphurskinPotion.cs +++ b/Items/Potions/SulphurskinPotion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index c113ca61fe..2376a0ab90 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using System.Collections.Generic; using Terraria; @@ -26,7 +26,7 @@ Grants Well Fed"); item.useAnimation = 17; item.useTime = 17; item.rare = 3; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; diff --git a/Items/Potions/SupremeHealingPotion.cs b/Items/Potions/SupremeHealingPotion.cs index 26739a6738..f2e4638c9e 100644 --- a/Items/Potions/SupremeHealingPotion.cs +++ b/Items/Potions/SupremeHealingPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.healLife = 250; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.potion = true; diff --git a/Items/Potions/SupremeManaPotion.cs b/Items/Potions/SupremeManaPotion.cs index 91a11973ff..9a4e07e22e 100644 --- a/Items/Potions/SupremeManaPotion.cs +++ b/Items/Potions/SupremeManaPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Potions item.healMana = 400; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.rare = 10; diff --git a/Items/Potions/TeslaPotion.cs b/Items/Potions/TeslaPotion.cs index 880fe3cdc2..db39cb952d 100644 --- a/Items/Potions/TeslaPotion.cs +++ b/Items/Potions/TeslaPotion.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/TitanScalePotion.cs b/Items/Potions/TitanScalePotion.cs index cc8c6cf303..b6361ee788 100644 --- a/Items/Potions/TitanScalePotion.cs +++ b/Items/Potions/TitanScalePotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.Items.Fishing.SunkenSeaCatches; using Terraria; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/TriumphPotion.cs b/Items/Potions/TriumphPotion.cs index 8bb99136b4..6f9861933b 100644 --- a/Items/Potions/TriumphPotion.cs +++ b/Items/Potions/TriumphPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/YharimsStimulants.cs b/Items/Potions/YharimsStimulants.cs index 4869e4de51..226072f55e 100644 --- a/Items/Potions/YharimsStimulants.cs +++ b/Items/Potions/YharimsStimulants.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/ZenPotion.cs b/Items/Potions/ZenPotion.cs index d80965dd28..4b92fa67b1 100644 --- a/Items/Potions/ZenPotion.cs +++ b/Items/Potions/ZenPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Potions/ZergPotion.cs b/Items/Potions/ZergPotion.cs index f6b975b525..0a63d0e0bf 100644 --- a/Items/Potions/ZergPotion.cs +++ b/Items/Potions/ZergPotion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Potions item.rare = 3; item.useAnimation = 17; item.useTime = 17; - item.useStyle = 2; + item.useStyle = ItemUseStyleID.EatingUsing; item.UseSound = SoundID.Item3; item.consumable = true; item.buffType = ModContent.BuffType(); diff --git a/Items/Rock.cs b/Items/Rock.cs index 7c3b07954f..49c2aa5bf0 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items diff --git a/Items/RustyLockpick.cs b/Items/RustyLockpick.cs deleted file mode 100644 index 3598f8959a..0000000000 --- a/Items/RustyLockpick.cs +++ /dev/null @@ -1,30 +0,0 @@ -using CalamityMod.Items.Materials; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Items -{ - public class RustyLockpick : ModItem - { - public override void SetStaticDefaults() - { - Tooltip.SetDefault("Opens locked rusty chests"); - } - - public override void SetDefaults() - { - item.width = 14; - item.height = 28; - item.maxStack = 99; - item.rare = 1; - item.value = CalamityGlobalItem.Rarity1BuyPrice; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/RustyLockpick.png b/Items/RustyLockpick.png deleted file mode 100644 index 4281306709..0000000000 Binary files a/Items/RustyLockpick.png and /dev/null differ diff --git a/Items/SummonItems/Abomination.cs b/Items/SummonItems/Abomination.cs index a5b323bdcc..5a2117782e 100644 --- a/Items/SummonItems/Abomination.cs +++ b/Items/SummonItems/Abomination.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.PlaguebringerGoliath; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 8; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -35,8 +35,12 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - Main.PlaySound(SoundID.Roar, player.position, 0); + Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + return true; } diff --git a/Items/SummonItems/Abomination.png b/Items/SummonItems/Abomination.png index 053279c444..65c9eb05bd 100644 Binary files a/Items/SummonItems/Abomination.png and b/Items/SummonItems/Abomination.png differ diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index 86f98798bb..fc205997b2 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.Ravager; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,8 +8,8 @@ namespace CalamityMod.Items.SummonItems { public override void SetStaticDefaults() { - DisplayName.SetDefault("Ancient Medallion"); - Tooltip.SetDefault("A very old temple medallion\n" + + DisplayName.SetDefault("Death Whistle"); + Tooltip.SetDefault("A very old temple whistle\n" + "Summons the Ravager"); } @@ -21,7 +21,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 8; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -34,10 +34,13 @@ namespace CalamityMod.Items.SummonItems { if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC((int)(player.position.X + (float)Main.rand.Next(-100, 101)), (int)(player.position.Y - 250f), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - Main.PlaySound(SoundID.Roar, player.position, 0); + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; } - return true; + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/AncientMedallion.png b/Items/SummonItems/AncientMedallion.png index 7606218f53..b233f2548e 100644 Binary files a/Items/SummonItems/AncientMedallion.png and b/Items/SummonItems/AncientMedallion.png differ diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index 84ce4c35d3..bbcab930d0 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.AstrumAureus; using Terraria; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 7; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -33,12 +33,16 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - if (Main.netMode != NetmodeID.MultiplayerClient) + Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int num = NPC.NewNPC((int)(player.position.X + (float)Main.rand.Next(-50, 50)), (int)(player.position.Y - 150f), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - Main.PlaySound(SoundID.Roar, player.position, 0); + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-50, 50)), (int)(player.position.Y - 150f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; } - return true; + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/AstralChunk.png b/Items/SummonItems/AstralChunk.png index c4059f8bea..90ee8ec7ce 100644 Binary files a/Items/SummonItems/AstralChunk.png and b/Items/SummonItems/AstralChunk.png differ diff --git a/Items/SummonItems/BirbPheromones.cs b/Items/SummonItems/BirbPheromones.cs index a86ceb5844..1d685c1228 100644 --- a/Items/SummonItems/BirbPheromones.cs +++ b/Items/SummonItems/BirbPheromones.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.Bumblebirb; +using CalamityMod.NPCs.Bumblebirb; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 10; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -31,8 +31,12 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - Main.PlaySound(SoundID.Roar, player.position, 0); + Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + return true; } diff --git a/Items/SummonItems/BlightedEyeball.cs b/Items/SummonItems/BlightedEyeball.cs index 4b792423d8..90f90a7f9c 100644 --- a/Items/SummonItems/BlightedEyeball.cs +++ b/Items/SummonItems/BlightedEyeball.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Calamitas; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 6; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; } @@ -34,9 +34,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/BlightedEyeball.png b/Items/SummonItems/BlightedEyeball.png index 4c9f5f4bd7..2c653dc977 100644 Binary files a/Items/SummonItems/BlightedEyeball.png and b/Items/SummonItems/BlightedEyeball.png differ diff --git a/Items/SummonItems/BloodwormItem.cs b/Items/SummonItems/BloodwormItem.cs index 8ef056acbf..235e9f8bbc 100644 --- a/Items/SummonItems/BloodwormItem.cs +++ b/Items/SummonItems/BloodwormItem.cs @@ -1,10 +1,10 @@ -using Terraria; using Terraria.ModLoader; using CalamityMod.NPCs.AcidRain; +using Terraria.ID; namespace CalamityMod.Items.SummonItems { - public class BloodwormItem : ModItem + public class BloodwormItem : ModItem { public override void SetStaticDefaults() { @@ -19,7 +19,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 10; item.Calamity().customRarity = CalamityRarity.PureGreen; item.bait = 69420; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; item.useTurn = true; item.useAnimation = 15; diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 623cfc7243..a3ba4ac996 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Perforator; using Terraria; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 3; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -33,9 +33,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/BossRush.cs b/Items/SummonItems/BossRush.cs index 21c2f2b616..2866a82b21 100644 --- a/Items/SummonItems/BossRush.cs +++ b/Items/SummonItems/BossRush.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.SummonItems item.height = 28; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item123; item.consumable = false; } diff --git a/Items/SummonItems/BulbofDoom.cs b/Items/SummonItems/BulbofDoom.cs index b1ff819c00..6652a650e7 100644 --- a/Items/SummonItems/BulbofDoom.cs +++ b/Items/SummonItems/BulbofDoom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.SummonItems item.maxStack = 20; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 7; item.consumable = true; } @@ -32,9 +32,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, NPCID.Plantera); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, NPCID.Plantera); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.Plantera); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index ca285a18c9..90157e7442 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.NPCs.BrimstoneElemental; using Terraria; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 6; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -37,9 +37,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/ChickenEgg.cs b/Items/SummonItems/ChickenEgg.cs index fe2cbf5f23..6b69a55354 100644 --- a/Items/SummonItems/ChickenEgg.cs +++ b/Items/SummonItems/ChickenEgg.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Yharon; using CalamityMod.World; using Terraria; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.height = 18; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; item.Calamity().customRarity = CalamityRarity.DarkBlue; } @@ -35,9 +35,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index e20ea1ee81..6703c1a922 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems item.height = 18; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; item.Calamity().customRarity = CalamityRarity.PureGreen; } @@ -39,15 +39,16 @@ namespace CalamityMod.Items.SummonItems string key = "Mods.CalamityMod.EdgyBossText12"; Color messageColor = Color.Cyan; if (Main.netMode == NetmodeID.SinglePlayer) - { Main.NewText(Language.GetTextValue(key), messageColor); - } else if (Main.netMode == NetmodeID.Server) - { NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); - } - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerSpawn"), (int)player.position.X, (int)player.position.Y); + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + return true; } diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index aef427480c..a5912cbbdc 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Cryogen; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 5; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -34,9 +34,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/CryoKey.png b/Items/SummonItems/CryoKey.png index eb924ac4ad..f026899ecf 100644 Binary files a/Items/SummonItems/CryoKey.png and b/Items/SummonItems/CryoKey.png differ diff --git a/Items/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index 47d775cfba..eef52006d3 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.Crabulon; +using CalamityMod.NPCs.Crabulon; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 2; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -31,12 +31,16 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - if (Main.netMode != NetmodeID.MultiplayerClient) + Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.NewNPC((int)(player.position.X + (float)Main.rand.Next(-50, 51)), (int)(player.position.Y - 50f), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - Main.PlaySound(SoundID.Roar, player.position, 0); + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-50, 51)), (int)(player.position.Y - 50f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; } - return true; + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/DecapoditaSprout.png b/Items/SummonItems/DecapoditaSprout.png index 0915fab5fd..e33bcd801b 100644 Binary files a/Items/SummonItems/DecapoditaSprout.png and b/Items/SummonItems/DecapoditaSprout.png differ diff --git a/Items/SummonItems/DraedonsRemote.cs b/Items/SummonItems/DraedonsRemote.cs index e48eb17133..f7a89a685d 100644 --- a/Items/SummonItems/DraedonsRemote.cs +++ b/Items/SummonItems/DraedonsRemote.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.NPCs; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 8; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -34,12 +34,23 @@ namespace CalamityMod.Items.SummonItems { CalamityGlobalNPC.DraedonMayhem = true; CalamityMod.UpdateServerBoolean(); - NPC.SpawnOnPlayer(player.whoAmI, NPCID.TheDestroyer); - NPC.SpawnOnPlayer(player.whoAmI, NPCID.SkeletronPrime); - NPC.SpawnOnPlayer(player.whoAmI, NPCID.Spazmatism); - NPC.SpawnOnPlayer(player.whoAmI, NPCID.Retinazer); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.SpawnOnPlayer(player.whoAmI, NPCID.TheDestroyer); + NPC.SpawnOnPlayer(player.whoAmI, NPCID.SkeletronPrime); + NPC.SpawnOnPlayer(player.whoAmI, NPCID.Spazmatism); + NPC.SpawnOnPlayer(player.whoAmI, NPCID.Retinazer); + } + else + { + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.TheDestroyer); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.SkeletronPrime); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.Spazmatism); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.Retinazer); + } + + return true; } } } diff --git a/Items/SummonItems/DriedSeafood.cs b/Items/SummonItems/DriedSeafood.cs index 2bce193495..4651c1264a 100644 --- a/Items/SummonItems/DriedSeafood.cs +++ b/Items/SummonItems/DriedSeafood.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.DesertScourge; using CalamityMod.World; using Terraria; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 2; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -35,14 +35,26 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - if (CalamityWorld.revenge) - { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - } Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + if (CalamityWorld.revenge) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + } + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/EidolonTablet.cs b/Items/SummonItems/EidolonTablet.cs index 7b9f4aebf6..11a05971d9 100644 --- a/Items/SummonItems/EidolonTablet.cs +++ b/Items/SummonItems/EidolonTablet.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 9; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -33,10 +33,14 @@ namespace CalamityMod.Items.SummonItems { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num1302 = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1302].direction = Main.npc[num1302].spriteDirection = Math.Sign(player.Center.X - (float)player.Center.X - 30f); - } - return true; + int npc = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 1); + Main.npc[npc].direction = Main.npc[npc].spriteDirection = Math.Sign(player.Center.X - player.Center.X - 30f); + Main.npc[npc].timeLeft *= 20; + } + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.CultistBoss); + + return true; } } } diff --git a/Items/SummonItems/EyeofExtinction.cs b/Items/SummonItems/EyeofExtinction.cs index 2c6a3e0910..c17ae2bb50 100644 --- a/Items/SummonItems/EyeofExtinction.cs +++ b/Items/SummonItems/EyeofExtinction.cs @@ -1,5 +1,4 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Tiles; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.SummonItems { - public class EyeofExtinction : ModItem + public class EyeofExtinction : ModItem { public override void SetStaticDefaults() { @@ -29,7 +28,7 @@ namespace CalamityMod.Items.SummonItems item.height = 40; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; item.Calamity().customRarity = CalamityRarity.Violet; } @@ -63,9 +62,14 @@ namespace CalamityMod.Items.SummonItems } } } - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs index 5dd6afd63b..202d462474 100644 --- a/Items/SummonItems/Invasion/CausticTear.cs +++ b/Items/SummonItems/Invasion/CausticTear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.World; using Terraria; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems.Invasion item.rare = 1; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } diff --git a/Items/SummonItems/Invasion/CausticTearNonConsumable.cs b/Items/SummonItems/Invasion/CausticTearNonConsumable.cs index 99a51fd3c8..421bce07dc 100644 --- a/Items/SummonItems/Invasion/CausticTearNonConsumable.cs +++ b/Items/SummonItems/Invasion/CausticTearNonConsumable.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.World; using Terraria; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.SummonItems.Invasion item.rare = 6; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; } diff --git a/Items/SummonItems/NecroplasmicBeacon.cs b/Items/SummonItems/NecroplasmicBeacon.cs index 4d79385faa..aa35fff07c 100644 --- a/Items/SummonItems/NecroplasmicBeacon.cs +++ b/Items/SummonItems/NecroplasmicBeacon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Polterghast; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.SummonItems item.height = 58; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; item.Calamity().customRarity = CalamityRarity.PureGreen; } @@ -43,9 +43,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/OldPowerCell.cs b/Items/SummonItems/OldPowerCell.cs index 48b034c7fa..d17556dbb5 100644 --- a/Items/SummonItems/OldPowerCell.cs +++ b/Items/SummonItems/OldPowerCell.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 7; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -43,9 +43,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, NPCID.Golem); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, NPCID.Golem); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.Golem); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/OverloadedSludge.cs b/Items/SummonItems/OverloadedSludge.cs index 5e73b74abd..2dbad29ffd 100644 --- a/Items/SummonItems/OverloadedSludge.cs +++ b/Items/SummonItems/OverloadedSludge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.SlimeGod; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 4; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -35,11 +35,21 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + } + else + { + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + } + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/OverloadedSludge.png b/Items/SummonItems/OverloadedSludge.png index 387cdac50d..00fc0b0c47 100644 Binary files a/Items/SummonItems/OverloadedSludge.png and b/Items/SummonItems/OverloadedSludge.png differ diff --git a/Items/SummonItems/ProfanedCore.cs b/Items/SummonItems/ProfanedCore.cs index a5c7eff7ba..c71c860b59 100644 --- a/Items/SummonItems/ProfanedCore.cs +++ b/Items/SummonItems/ProfanedCore.cs @@ -1,8 +1,9 @@ -using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Providence; using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.SummonItems { public class ProfanedCore : ModItem @@ -12,7 +13,7 @@ namespace CalamityMod.Items.SummonItems DisplayName.SetDefault("Profaned Core"); Tooltip.SetDefault("The core of the unholy flame\n" + "Summons Providence\n" + - "Can only be used during daytime"); + "Should be used during daytime"); } public override void SetDefaults() @@ -22,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.maxStack = 20; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; @@ -30,13 +31,20 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny; } public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; + } + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + return true; } } diff --git a/Items/SummonItems/ProfanedCoreUnlimited.cs b/Items/SummonItems/ProfanedCoreUnlimited.cs index e9651a26bc..0d668f0cf4 100644 --- a/Items/SummonItems/ProfanedCoreUnlimited.cs +++ b/Items/SummonItems/ProfanedCoreUnlimited.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.Providence; using CalamityMod.World; using Terraria; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems DisplayName.SetDefault("Profaned Core"); Tooltip.SetDefault("The core of the unholy flame\n" + "Summons Providence\n" + - "Can only be used during daytime\n" + + "Should be used during daytime\n" + "Not consumable"); } @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems item.height = 20; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; @@ -32,13 +32,20 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny; } public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; + } + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + return true; } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index 2d097d7d4a..3b8115d4a6 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.ProfanedGuardians; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.SummonItems item.maxStack = 20; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; item.Calamity().customRarity = CalamityRarity.Turquoise; } @@ -35,9 +35,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/RuneofCos.cs b/Items/SummonItems/RuneofCos.cs index 821e4478b5..7eecc6ed51 100644 --- a/Items/SummonItems/RuneofCos.cs +++ b/Items/SummonItems/RuneofCos.cs @@ -1,16 +1,15 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.StormWeaver; using CalamityMod.World; -using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.SummonItems { - public class RuneofCos : ModItem + public class RuneofCos : ModItem { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Items.SummonItems item.height = 20; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.rare = 9; item.UseSound = SoundID.Item44; item.consumable = false; @@ -43,11 +42,12 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - if (player.ZoneDungeon) + Main.PlaySound(SoundID.Roar, player.position, 0); + if (player.ZoneDungeon) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); if (Main.netMode != NetmodeID.MultiplayerClient) { + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); for (int num662 = 0; num662 < 2; num662++) { NPC.NewNPC((int)player.Center.X - 200, (int)player.Center.Y - 200, ModContent.NPCType()); @@ -55,16 +55,24 @@ namespace CalamityMod.Items.SummonItems NPC.NewNPC((int)player.Center.X, (int)player.Center.Y + 200, ModContent.NPCType()); } } + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); } else if (player.ZoneUnderworldHeight) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - } + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + } else if (player.ZoneSkyHeight) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - } - Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + } + return true; } diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index 4d78a34bd0..54f8c4d04f 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.NPCs.GreatSandShark; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 7; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -31,9 +31,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index 0f34ed0dd5..0dd0a1f437 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Placeables; using CalamityMod.NPCs.AquaticScourge; using Terraria; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 5; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -36,9 +36,13 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/Starcore.cs b/Items/SummonItems/Starcore.cs index 426f2b1657..62d7479652 100644 --- a/Items/SummonItems/Starcore.cs +++ b/Items/SummonItems/Starcore.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Potions; using CalamityMod.NPCs.AstrumDeus; @@ -25,24 +25,24 @@ namespace CalamityMod.Items.SummonItems item.rare = 9; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = false; } public override bool CanUseItem(Player player) { - return !Main.dayTime && player.Calamity().ZoneAstral && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()); + return !Main.dayTime && player.Calamity().ZoneAstral && !NPC.AnyNPCs(ModContent.NPCType()); } public override bool UseItem(Player player) { - for (int x = 0; x < 10; x++) - { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); - } - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); Main.PlaySound(SoundID.Roar, player.position, 0); - return true; + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index fbc42a9dda..97c0b66c08 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs.HiveMind; using Terraria; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.SummonItems item.rare = 3; item.useAnimation = 45; item.useTime = 45; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.consumable = true; } @@ -33,12 +33,16 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { - if (Main.netMode != NetmodeID.MultiplayerClient) + Main.PlaySound(SoundID.Roar, player.position, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) { - int num = NPC.NewNPC((int)(player.position.X + (float)Main.rand.Next(-100, 100)), (int)(player.position.Y - 150f), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - Main.PlaySound(SoundID.Roar, player.position, 0); + int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 100)), (int)(player.position.Y - 150f), ModContent.NPCType(), 1); + Main.npc[npc].timeLeft *= 20; } - return true; + else + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType()); + + return true; } public override void AddRecipes() diff --git a/Items/SummonItems/Teratoma.png b/Items/SummonItems/Teratoma.png index 52ed7f6a7b..d56eddbb90 100644 Binary files a/Items/SummonItems/Teratoma.png and b/Items/SummonItems/Teratoma.png differ diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index cbe2a2cda2..b8b41984d0 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items item.height = 30; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.value = 0; item.rare = 1; diff --git a/Items/Tools/AbyssalWarhammer.cs b/Items/Tools/AbyssalWarhammer.cs index d4c1aeaa15..8906c58260 100644 --- a/Items/Tools/AbyssalWarhammer.cs +++ b/Items/Tools/AbyssalWarhammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 38; item.useTurn = true; item.hammer = 110; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; diff --git a/Items/Tools/AerialHamaxe.cs b/Items/Tools/AerialHamaxe.cs index bea7a7c633..2c599525b9 100644 --- a/Items/Tools/AerialHamaxe.cs +++ b/Items/Tools/AerialHamaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools item.useTurn = true; item.axe = 25; item.hammer = 65; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 6a5220743f..c6c9956f40 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Tools item.useTurn = true; item.axe = 30; item.hammer = 150; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index 28ccf6de9f..8769f8337b 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 10; item.useTurn = true; item.pick = 220; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; diff --git a/Items/Tools/BeastialPickaxe.cs b/Items/Tools/BeastialPickaxe.cs index e9a72e87e4..875654a311 100644 --- a/Items/Tools/BeastialPickaxe.cs +++ b/Items/Tools/BeastialPickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools item.useTurn = true; item.pick = 200; item.tileBoost += 1; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; diff --git a/Items/Tools/BerserkerWaraxe.cs b/Items/Tools/BerserkerWaraxe.cs index 7f3fa6aab9..8fe6435948 100644 --- a/Items/Tools/BerserkerWaraxe.cs +++ b/Items/Tools/BerserkerWaraxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 27; item.useTurn = true; item.axe = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; diff --git a/Items/Tools/BlossomPickaxe.cs b/Items/Tools/BlossomPickaxe.cs index 3443ad53ee..2a86a40a82 100644 --- a/Items/Tools/BlossomPickaxe.cs +++ b/Items/Tools/BlossomPickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 10; item.useTurn = true; item.pick = 275; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.5f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index 3ccc2d6b6f..c248d3dad3 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -1,5 +1,3 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/ChaoswarpedSlashaxe.cs b/Items/Tools/ChaoswarpedSlashaxe.cs index cafc172595..6bef3eb8f6 100644 --- a/Items/Tools/ChaoswarpedSlashaxe.cs +++ b/Items/Tools/ChaoswarpedSlashaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 31; item.useTurn = true; item.axe = 40; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 1e43393ae7..5cefe0e1af 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item66; item.consumable = true; } diff --git a/Items/Tools/ClimateChange/BloodIdol.cs b/Items/Tools/ClimateChange/BloodIdol.cs index b191d29a34..b5b4c84743 100644 --- a/Items/Tools/ClimateChange/BloodIdol.cs +++ b/Items/Tools/ClimateChange/BloodIdol.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item66; item.consumable = true; } diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index 42c7fca390..c372575163 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.NPCs; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item60; item.consumable = false; } diff --git a/Items/Tools/ClimateChange/Daylight.cs b/Items/Tools/ClimateChange/Daylight.cs index b963b8a384..1d4e405fde 100644 --- a/Items/Tools/ClimateChange/Daylight.cs +++ b/Items/Tools/ClimateChange/Daylight.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.NPCs; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item60; item.consumable = false; } diff --git a/Items/Tools/ClimateChange/Moonlight.cs b/Items/Tools/ClimateChange/Moonlight.cs index 55d4216c0a..7ed05c712c 100644 --- a/Items/Tools/ClimateChange/Moonlight.cs +++ b/Items/Tools/ClimateChange/Moonlight.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.NPCs; using Terraria; using Terraria.ID; @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item60; item.consumable = false; } diff --git a/Items/Tools/ClimateChange/TorrentialTear.cs b/Items/Tools/ClimateChange/TorrentialTear.cs index 3f664889a9..a23a70fef2 100644 --- a/Items/Tools/ClimateChange/TorrentialTear.cs +++ b/Items/Tools/ClimateChange/TorrentialTear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.World; using Terraria; using Terraria.ID; @@ -25,14 +25,14 @@ namespace CalamityMod.Items.Tools.ClimateChange item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item66; item.consumable = false; } public override bool CanUseItem(Player player) { - return !Main.slimeRain && (Main.rainTime > 3600 || !CalamityWorld.death || !Main.raining); + return !Main.slimeRain && (Main.rainTime > 3600 || !CalamityWorld.death || !Main.raining || CalamityWorld.rainingAcid); } public override bool UseItem(Player player) @@ -48,22 +48,10 @@ namespace CalamityMod.Items.Tools.ClimateChange Main.rainTime = 3600; AdjustRainSeverity(true); } - if (CalamityWorld.rainingAcid) - { - CalamityWorld.acidRainPoints = 0; - CalamityWorld.triedToSummonOldDuke = false; - AcidRainEvent.UpdateInvasion(false); - } } else { Main.raining = false; - if (CalamityWorld.rainingAcid) - { - CalamityWorld.acidRainPoints = 0; - CalamityWorld.triedToSummonOldDuke = false; - AcidRainEvent.UpdateInvasion(false); - } } CalamityMod.UpdateServerBoolean(); diff --git a/Items/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 061966f0cd..44febeec27 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools item.height = 70; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 9f; item.shootSpeed = 14f; item.value = Item.buyPrice(5, 0, 0, 0); @@ -60,11 +60,11 @@ namespace CalamityMod.Items.Tools if (player.altFunctionUse == 2) { item.pick = PickPower; - item.shoot = 0; + item.shoot = ProjectileID.None; item.shootSpeed = 0f; item.tileBoost += 50; item.UseSound = SoundID.Item1; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 2; item.useAnimation = 10; item.useTurn = true; @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Tools item.shootSpeed = LaserSpeed; item.tileBoost = 0; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/CrystylCharge"); - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.useAnimation = 20; item.useTurn = false; diff --git a/Items/Tools/FellerofEvergreens.cs b/Items/Tools/FellerofEvergreens.cs index decfb2160c..06dc0f3161 100644 --- a/Items/Tools/FellerofEvergreens.cs +++ b/Items/Tools/FellerofEvergreens.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 25; item.useTurn = true; item.axe = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; diff --git a/Items/Tools/FlamebeakHampick.cs b/Items/Tools/FlamebeakHampick.cs index cfe91e3a42..379173b172 100644 --- a/Items/Tools/FlamebeakHampick.cs +++ b/Items/Tools/FlamebeakHampick.cs @@ -29,7 +29,7 @@ Right click to use as a hammer"); item.useTurn = true; item.pick = PickPower; item.hammer = HammerPower; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; diff --git a/Items/Tools/GallantPickaxe.cs b/Items/Tools/GallantPickaxe.cs index eb9de146b3..b9d891f4f5 100644 --- a/Items/Tools/GallantPickaxe.cs +++ b/Items/Tools/GallantPickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 12; item.useTurn = true; item.pick = 225; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; @@ -53,10 +53,5 @@ namespace CalamityMod.Items.Tools int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 58); } } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 300); - } } } diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index e4f193d785..c5770c628a 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools item.useTime = 16; item.useAnimation = 20; item.pick = 100; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 12, 0, 0); item.rare = 4; diff --git a/Items/Tools/Grax.cs b/Items/Tools/Grax.cs index 98e60b3058..1bfe946de1 100644 --- a/Items/Tools/Grax.cs +++ b/Items/Tools/Grax.cs @@ -15,11 +15,12 @@ namespace CalamityMod.Items.Tools public override void SetDefaults() { - item.width = 60; + item.width = 62; + item.height = 62; item.damage = 500; item.melee = true; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 4; item.useTurn = true; item.axe = 50; @@ -27,7 +28,6 @@ namespace CalamityMod.Items.Tools item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 60; item.tileBoost += 5; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; diff --git a/Items/Tools/Grax.png b/Items/Tools/Grax.png index 1340de82e1..80f4e4ca6f 100644 Binary files a/Items/Tools/Grax.png and b/Items/Tools/Grax.png differ diff --git a/Items/Tools/GreatbayPickaxe.cs b/Items/Tools/GreatbayPickaxe.cs index 46c85b4142..afcb7dcbc8 100644 --- a/Items/Tools/GreatbayPickaxe.cs +++ b/Items/Tools/GreatbayPickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 16; item.useTurn = true; item.pick = 60; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; diff --git a/Items/Tools/InfernaCutter.cs b/Items/Tools/InfernaCutter.cs index 742b593fcb..f908af4673 100644 --- a/Items/Tools/InfernaCutter.cs +++ b/Items/Tools/InfernaCutter.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 12; item.useTurn = true; item.axe = 27; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index e4947f0e73..380cee11fc 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Tools item.pick = 57; item.axe = 10; item.tileBoost++; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 3; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; diff --git a/Items/Tools/PurityAxe.cs b/Items/Tools/PurityAxe.cs index 54a8d82c3e..c5b156e2cd 100644 --- a/Items/Tools/PurityAxe.cs +++ b/Items/Tools/PurityAxe.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 19; item.useTurn = true; item.axe = AxePower; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Tools else { item.axe = AxePower; - item.shoot = 0; + item.shoot = ProjectileID.None; item.shootSpeed = 0f; } return base.CanUseItem(player); diff --git a/Items/Tools/ReefclawHamaxe.cs b/Items/Tools/ReefclawHamaxe.cs index 3b9b35487e..3dbe02600d 100644 --- a/Items/Tools/ReefclawHamaxe.cs +++ b/Items/Tools/ReefclawHamaxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useTurn = true; item.axe = 13; item.hammer = 50; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; diff --git a/Items/Tools/ShardlightPickaxe.cs b/Items/Tools/ShardlightPickaxe.cs index cbbf0502a1..4849d6b46d 100644 --- a/Items/Tools/ShardlightPickaxe.cs +++ b/Items/Tools/ShardlightPickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 15; item.useTurn = true; item.pick = 190; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; diff --git a/Items/Tools/SkyfringePickaxe.cs b/Items/Tools/SkyfringePickaxe.cs index c25fdeaf57..87d42dbf7e 100644 --- a/Items/Tools/SkyfringePickaxe.cs +++ b/Items/Tools/SkyfringePickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 16; item.useTurn = true; item.pick = 95; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; diff --git a/Items/Tools/WulfrumAxe.cs b/Items/Tools/WulfrumAxe.cs index 435f431a43..457e96fb4f 100644 --- a/Items/Tools/WulfrumAxe.cs +++ b/Items/Tools/WulfrumAxe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 26; item.useTurn = true; item.axe = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; diff --git a/Items/Tools/WulfrumHammer.cs b/Items/Tools/WulfrumHammer.cs index d7dd1364ed..c4643b22ca 100644 --- a/Items/Tools/WulfrumHammer.cs +++ b/Items/Tools/WulfrumHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 29; item.useTurn = true; item.hammer = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; diff --git a/Items/Tools/WulfrumPickaxe.cs b/Items/Tools/WulfrumPickaxe.cs index 083c548e2e..7c5faf290a 100644 --- a/Items/Tools/WulfrumPickaxe.cs +++ b/Items/Tools/WulfrumPickaxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools item.useAnimation = 16; item.useTurn = true; item.pick = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index 745a1cb2b1..35aad82dac 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -10,12 +10,11 @@ using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.World; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - public class BrimstoneWaifuBag : ModItem + public class BrimstoneWaifuBag : ModItem { public override int BossBagNPC => ModContent.NPCType(); diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index d482ca77f6..1dc1bf6a76 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Leviathan; using CalamityMod.World; using Terraria; @@ -52,6 +53,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); // Equipment DropHelper.DropItem(player, ModContent.ItemType()); diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 06f05113fb..56c31a3b01 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -1,7 +1,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; -using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -14,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - public class ProvidenceBag : ModItem + public class ProvidenceBag : ModItem { public override int BossBagNPC => ModContent.NPCType(); @@ -45,7 +44,7 @@ namespace CalamityMod.Items.TreasureBags // Materials DropHelper.DropItem(player, ModContent.ItemType(), 25, 35); - DropHelper.DropItem(player, ModContent.ItemType(), 15, 25); + DropHelper.DropItem(player, ModContent.ItemType(), 20, 30); // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index cb7bff3f73..267bdfc8e2 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -5,7 +5,6 @@ using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.SlimeGod; using CalamityMod.World; @@ -15,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.TreasureBags { - public class SlimeGodBag : ModItem + public class SlimeGodBag : ModItem { public override int BossBagNPC => ModContent.NPCType(); diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index c5ac8b9fe2..d6d911a91a 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.autoReuse = false; item.channel = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GatlingLaserFireStart"); item.noMelee = true; diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index 38bbd2e6b6..85850d92db 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAnimation = 25; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserRifleFire"); item.noMelee = true; diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index e3d9745c97..ba26d956f9 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAnimation = 45; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire"); item.noMelee = true; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index afd41b0476..e9551f42aa 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAnimation = 35; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire"); item.noMelee = true; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 91aec7d77a..2b326a4cae 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAnimation = 90; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"); item.noMelee = true; diff --git a/Items/Weapons/Magic/AbyssShocker.cs b/Items/Weapons/Magic/AbyssShocker.cs index 0d192ab7ec..e038fa78b3 100644 --- a/Items/Weapons/Magic/AbyssShocker.cs +++ b/Items/Weapons/Magic/AbyssShocker.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 19; item.useAnimation = 19; item.UseSound = SoundID.Item13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.mana = 10; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; diff --git a/Items/Weapons/Magic/AbyssalTome.cs b/Items/Weapons/Magic/AbyssalTome.cs index 85a6593382..69d7613d45 100644 --- a/Items/Weapons/Magic/AbyssalTome.cs +++ b/Items/Weapons/Magic/AbyssalTome.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Magic/AlphaRay.cs b/Items/Weapons/Magic/AlphaRay.cs index 2d0190fcad..ff2716da9e 100644 --- a/Items/Weapons/Magic/AlphaRay.cs +++ b/Items/Weapons/Magic/AlphaRay.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 74; item.useTime = 3; item.useAnimation = 3; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index fe5f528c33..572d268e7d 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class AlulaAustralis : ModItem + public class AlulaAustralis : ModItem { public override void SetStaticDefaults() { @@ -18,9 +17,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 60; + item.damage = 99; item.magic = true; - item.mana = 12; + item.mana = 8; item.width = 52; item.height = 52; item.useTime = 17; diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index 12c8980faf..74cd462352 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -19,12 +19,12 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { item.width = 98; - item.damage = 45; + item.damage = 55; item.magic = true; - item.mana = 14; + item.mana = 12; item.useAnimation = 7; item.useTime = 7; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 6.75f; item.UseSound = SoundID.Item91; item.autoReuse = true; diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index a678ec175f..f6c1572b06 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 34; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 6.9f; diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index ffcd12cb7b..9d97e02474 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 38; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/ArchAmaryllis.cs b/Items/Weapons/Magic/ArchAmaryllis.cs index 79d0c8499f..81fc9e2cf6 100644 --- a/Items/Weapons/Magic/ArchAmaryllis.cs +++ b/Items/Weapons/Magic/ArchAmaryllis.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 68; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/ArcticBearPaw.cs b/Items/Weapons/Magic/ArcticBearPaw.cs index ac38bec8ec..241ffa9457 100644 --- a/Items/Weapons/Magic/ArcticBearPaw.cs +++ b/Items/Weapons/Magic/ArcticBearPaw.cs @@ -22,7 +22,7 @@ Fires spiritual claws that ignore walls and confuse enemies"); item.height = 22; item.useTime = 28; item.useAnimation = 28; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 10f; diff --git a/Items/Weapons/Magic/AsteroidStaff.cs b/Items/Weapons/Magic/AsteroidStaff.cs index 0e4360f634..4a2883c6f1 100644 --- a/Items/Weapons/Magic/AsteroidStaff.cs +++ b/Items/Weapons/Magic/AsteroidStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 50; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.75f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/AstralStaff.cs b/Items/Weapons/Magic/AstralStaff.cs index 6545dae501..edc1c104b0 100644 --- a/Items/Weapons/Magic/AstralStaff.cs +++ b/Items/Weapons/Magic/AstralStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 72; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index a73ee76376..06e1de8eb6 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 21; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index b497187c7a..d4e39cb4a9 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Magic { - public class Atlantis : ModItem + public class Atlantis : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/AuguroftheElements.cs b/Items/Weapons/Magic/AuguroftheElements.cs index 84d647227d..51a1db3ee7 100644 --- a/Items/Weapons/Magic/AuguroftheElements.cs +++ b/Items/Weapons/Magic/AuguroftheElements.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 2; item.reuseDelay = 5; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index 787e0e7f77..3477ef02db 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 22; item.useTime = 12; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/BittercoldStaff.cs b/Items/Weapons/Magic/BittercoldStaff.cs index 7d3737829f..6e4f1250e8 100644 --- a/Items/Weapons/Magic/BittercoldStaff.cs +++ b/Items/Weapons/Magic/BittercoldStaff.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class BittercoldStaff : ModItem + public class BittercoldStaff : ModItem { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/BlackAnurian.cs b/Items/Weapons/Magic/BlackAnurian.cs index 12b3a3b0a8..e3fb247d6b 100644 --- a/Items/Weapons/Magic/BlackAnurian.cs +++ b/Items/Weapons/Magic/BlackAnurian.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 38; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.75f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index 6e1e474d76..b332e3186a 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 50; item.useTime = 15; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.75f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/BlushieStaff.cs b/Items/Weapons/Magic/BlushieStaff.cs index 1c2b386333..ce01ef316d 100644 --- a/Items/Weapons/Magic/BlushieStaff.cs +++ b/Items/Weapons/Magic/BlushieStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic { item.width = 38; item.height = 38; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.useAnimation = 30; item.useTime = 30; item.channel = true; diff --git a/Items/Weapons/Magic/BrimroseStaff.cs b/Items/Weapons/Magic/BrimroseStaff.cs index b1a73679a3..0cca124237 100644 --- a/Items/Weapons/Magic/BrimroseStaff.cs +++ b/Items/Weapons/Magic/BrimroseStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 34; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/BurningSea.cs b/Items/Weapons/Magic/BurningSea.cs index baeb9e75de..388f3cf209 100644 --- a/Items/Weapons/Magic/BurningSea.cs +++ b/Items/Weapons/Magic/BurningSea.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/CalamitasInferno.cs b/Items/Weapons/Magic/CalamitasInferno.cs index 3a185591b2..d0646bf721 100644 --- a/Items/Weapons/Magic/CalamitasInferno.cs +++ b/Items/Weapons/Magic/CalamitasInferno.cs @@ -1,6 +1,8 @@ using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Magic { public class CalamitasInferno : ModItem @@ -20,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/CarnageRay.cs b/Items/Weapons/Magic/CarnageRay.cs index ad326cce6e..65e8197023 100644 --- a/Items/Weapons/Magic/CarnageRay.cs +++ b/Items/Weapons/Magic/CarnageRay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 46; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Magic/ClamorNoctus.cs b/Items/Weapons/Magic/ClamorNoctus.cs index 97761b3104..765734ec7c 100644 --- a/Items/Weapons/Magic/ClamorNoctus.cs +++ b/Items/Weapons/Magic/ClamorNoctus.cs @@ -28,7 +28,7 @@ Fires night wyverns and stars from the sky that stick to enemies and tiles and e item.height = 74; item.useTime = 21; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.2f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/Climax.cs b/Items/Weapons/Magic/Climax.cs index 832336811c..50b9d297db 100644 --- a/Items/Weapons/Magic/Climax.cs +++ b/Items/Weapons/Magic/Climax.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 78; item.useTime = 33; item.useAnimation = 33; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Magic/ClothiersWrath.cs b/Items/Weapons/Magic/ClothiersWrath.cs index 41f19227e9..b34f78eb91 100644 --- a/Items/Weapons/Magic/ClothiersWrath.cs +++ b/Items/Weapons/Magic/ClothiersWrath.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/CoralSpout.cs b/Items/Weapons/Magic/CoralSpout.cs index 725265e76c..dfb49f3f8e 100644 --- a/Items/Weapons/Magic/CoralSpout.cs +++ b/Items/Weapons/Magic/CoralSpout.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/CosmicRainbow.cs b/Items/Weapons/Magic/CosmicRainbow.cs index c29abcc638..5889350917 100644 --- a/Items/Weapons/Magic/CosmicRainbow.cs +++ b/Items/Weapons/Magic/CosmicRainbow.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 64; item.useTime = 35; item.useAnimation = 35; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 0f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/Cryophobia.cs b/Items/Weapons/Magic/Cryophobia.cs index 20b7971099..05d624d73b 100644 --- a/Items/Weapons/Magic/Cryophobia.cs +++ b/Items/Weapons/Magic/Cryophobia.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 34; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/CrystalFlareStaff.cs b/Items/Weapons/Magic/CrystalFlareStaff.cs index 443bde8a77..4e8c4f7daa 100644 --- a/Items/Weapons/Magic/CrystalFlareStaff.cs +++ b/Items/Weapons/Magic/CrystalFlareStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 46; item.useTime = 10; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.25f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index 12d3301906..46ef2d7c66 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 10; item.useAnimation = 10; item.reuseDelay = 5; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item13; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/DeathValley.cs b/Items/Weapons/Magic/DeathValley.cs index dc7521f1e3..102be956ef 100644 --- a/Items/Weapons/Magic/DeathValley.cs +++ b/Items/Weapons/Magic/DeathValley.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index 6ba9203013..f65ded93fc 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 84; item.useTime = 6; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/DemonicPitchfork.cs b/Items/Weapons/Magic/DemonicPitchfork.cs index a77ae33eff..6fd6aa0348 100644 --- a/Items/Weapons/Magic/DemonicPitchfork.cs +++ b/Items/Weapons/Magic/DemonicPitchfork.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 56; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/DivineRetribution.cs b/Items/Weapons/Magic/DivineRetribution.cs index 8d72d86381..843c5dd217 100644 --- a/Items/Weapons/Magic/DivineRetribution.cs +++ b/Items/Weapons/Magic/DivineRetribution.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 88; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/Downpour.cs b/Items/Weapons/Magic/Downpour.cs index 4451a7543b..03f3de9ebc 100644 --- a/Items/Weapons/Magic/Downpour.cs +++ b/Items/Weapons/Magic/Downpour.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 42; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 147a521634..cb97f27dda 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -16,14 +16,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 36; + item.damage = 40; item.magic = true; item.mana = 17; item.width = 56; item.height = 26; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.75f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/EidolicWail.cs b/Items/Weapons/Magic/EidolicWail.cs index 1f0b09584b..5e8e12c6f3 100644 --- a/Items/Weapons/Magic/EidolicWail.cs +++ b/Items/Weapons/Magic/EidolicWail.cs @@ -2,6 +2,8 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Magic { public class EidolicWail : ModItem @@ -23,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 12; item.reuseDelay = 30; item.useAnimation = 36; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index c15a6fba63..00755343da 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 7; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Magic/ElementalRay.cs b/Items/Weapons/Magic/ElementalRay.cs index e367e8cbd1..8bc5a8a053 100644 --- a/Items/Weapons/Magic/ElementalRay.cs +++ b/Items/Weapons/Magic/ElementalRay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 62; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index 3886602ec2..cc8c8b10fe 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -1,14 +1,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class EventHorizon : ModItem + public class EventHorizon : ModItem { public override void SetStaticDefaults() { @@ -31,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 28; item.useAnimation = 28; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.autoReuse = true; item.rare = 10; diff --git a/Items/Weapons/Magic/EvergladeSpray.cs b/Items/Weapons/Magic/EvergladeSpray.cs index 988b5e3a00..36108ee45c 100644 --- a/Items/Weapons/Magic/EvergladeSpray.cs +++ b/Items/Weapons/Magic/EvergladeSpray.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 6; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/EyeofMagnus.cs b/Items/Weapons/Magic/EyeofMagnus.cs index e568c0825b..5d67161a96 100644 --- a/Items/Weapons/Magic/EyeofMagnus.cs +++ b/Items/Weapons/Magic/EyeofMagnus.cs @@ -2,6 +2,8 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Magic { public class EyeofMagnus : ModItem @@ -20,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = 5; item.useAnimation = 20; item.useTime = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2f; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); item.magic = true; diff --git a/Items/Weapons/Magic/Fabstaff.cs b/Items/Weapons/Magic/Fabstaff.cs index 2db840dafe..1542e17e2d 100644 --- a/Items/Weapons/Magic/Fabstaff.cs +++ b/Items/Weapons/Magic/Fabstaff.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 84; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(5, 0, 0, 0); diff --git a/Items/Weapons/Magic/FaceMelter.cs b/Items/Weapons/Magic/FaceMelter.cs index 60a21429fc..1a68bc48c9 100644 --- a/Items/Weapons/Magic/FaceMelter.cs +++ b/Items/Weapons/Magic/FaceMelter.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 50; item.useTime = 5; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.rare = 10; diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index 8bd4fc2b5a..33ae94d164 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 86; item.useTime = 16; item.useAnimation = 16; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/FlareBolt.cs b/Items/Weapons/Magic/FlareBolt.cs index 515a9047ed..da9b0c74eb 100644 --- a/Items/Weapons/Magic/FlareBolt.cs +++ b/Items/Weapons/Magic/FlareBolt.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/ForbiddenSun.cs b/Items/Weapons/Magic/ForbiddenSun.cs index b22a42f381..87007c1587 100644 --- a/Items/Weapons/Magic/ForbiddenSun.cs +++ b/Items/Weapons/Magic/ForbiddenSun.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/FrigidflashBolt.cs b/Items/Weapons/Magic/FrigidflashBolt.cs index 1d5425b88e..04e0f7b5be 100644 --- a/Items/Weapons/Magic/FrigidflashBolt.cs +++ b/Items/Weapons/Magic/FrigidflashBolt.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/FrostBolt.cs b/Items/Weapons/Magic/FrostBolt.cs index 3d65397d61..76abfeb0b9 100644 --- a/Items/Weapons/Magic/FrostBolt.cs +++ b/Items/Weapons/Magic/FrostBolt.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 6; item.width = 28; item.height = 30; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 5; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/GammaFusillade.cs b/Items/Weapons/Magic/GammaFusillade.cs index fa37505ae9..a869bd3251 100644 --- a/Items/Weapons/Magic/GammaFusillade.cs +++ b/Items/Weapons/Magic/GammaFusillade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 3; item.useAnimation = 3; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/Genisis.cs b/Items/Weapons/Magic/Genisis.cs index 4e3358bc7b..c0f9fed517 100644 --- a/Items/Weapons/Magic/Genisis.cs +++ b/Items/Weapons/Magic/Genisis.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 28; item.useTime = 4; item.useAnimation = 4; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index 777ab102c0..dd575e3f31 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Weapons.Magic { @@ -25,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 36; item.useTime = 27; item.useAnimation = 27; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/GleamingMagnolia.cs b/Items/Weapons/Magic/GleamingMagnolia.cs index a56585b89e..4a0ba906a5 100644 --- a/Items/Weapons/Magic/GleamingMagnolia.cs +++ b/Items/Weapons/Magic/GleamingMagnolia.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 54; item.useTime = 27; item.useAnimation = 27; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/HadopelagicEcho.cs b/Items/Weapons/Magic/HadopelagicEcho.cs index 94c1c2e386..7c918f6776 100644 --- a/Items/Weapons/Magic/HadopelagicEcho.cs +++ b/Items/Weapons/Magic/HadopelagicEcho.cs @@ -4,6 +4,8 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Magic { public class HadopelagicEcho : ModItem @@ -29,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 8; item.reuseDelay = 20; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Magic/HarvestStaff.cs b/Items/Weapons/Magic/HarvestStaff.cs index 6559c36fae..a5c315414e 100644 --- a/Items/Weapons/Magic/HarvestStaff.cs +++ b/Items/Weapons/Magic/HarvestStaff.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index f543cb77ae..93d52b70f6 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.noMelee = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item73; item.rare = 10; diff --git a/Items/Weapons/Magic/HellBurst.cs b/Items/Weapons/Magic/HellBurst.cs index c361083f8e..41f54b411d 100644 --- a/Items/Weapons/Magic/HellBurst.cs +++ b/Items/Weapons/Magic/HellBurst.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 31; item.useAnimation = 31; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/HellwingStaff.cs b/Items/Weapons/Magic/HellwingStaff.cs index f5d528970d..c114202dfb 100644 --- a/Items/Weapons/Magic/HellwingStaff.cs +++ b/Items/Weapons/Magic/HellwingStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 33; item.useAnimation = 33; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/Hematemesis.cs b/Items/Weapons/Magic/Hematemesis.cs index d9bebc5370..7f12e1787a 100644 --- a/Items/Weapons/Magic/Hematemesis.cs +++ b/Items/Weapons/Magic/Hematemesis.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 90; + item.damage = 75; item.magic = true; item.mana = 14; item.rare = 8; item.width = 48; item.height = 54; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.75f; item.value = Item.buyPrice(0, 80, 0, 0); @@ -35,17 +35,14 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 10f; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; for (int x = 0; x < 10; x++) { - Projectile.NewProjectile(position.X + (float)Main.rand.Next(-150, 150), position.Y + 600f, 0f, -10f, type, damage, knockBack, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(position.X + (float)Main.rand.Next(-150, 150), position.Y + 600f, 0f, -10f, type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index c4b2c93fcf..45500e343c 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -17,78 +17,74 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 20; + item.damage = 15; item.magic = true; item.mana = 7; item.width = 34; item.height = 34; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item8; item.autoReuse = true; - item.shoot = 590; + item.shoot = ProjectileID.TruffleSpore; item.shootSpeed = 1f; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld + vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y; + float speed = item.shootSpeed; + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = (float)Main.mouseX + Main.screenPosition.X + source.X; + float yDist = (float)Main.mouseY + Main.screenPosition.Y + source.Y; + Vector2 spawnVec = new Vector2(xDist, yDist); if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + vector2.Y; + spawnVec.Y = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + source.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + float distance = spawnVec.Length(); + if ((float.IsNaN(spawnVec.X) && float.IsNaN(spawnVec.Y)) || (spawnVec.X == 0f && spawnVec.Y == 0f)) { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; + spawnVec.X = (float)player.direction; + spawnVec.Y = 0f; + distance = speed; } else { - num80 = num72 / num80; + distance = speed / distance; } - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) + int projAmt = 3; + for (int projIndex = 0; projIndex < projAmt; projIndex++) { - 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); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-100, 101); - vector2.Y -= (float)(50 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) + source = 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); + source.X = (source.X + player.Center.X) / 2f + (float)Main.rand.Next(-100, 101); + source.Y -= (float)(50 * projIndex); + spawnVec.X = (float)Main.mouseX + Main.screenPosition.X - source.X; + spawnVec.Y = (float)Main.mouseY + Main.screenPosition.Y - source.Y; + if (spawnVec.Y < 0f) { - num79 *= -1f; + spawnVec.Y *= -1f; } - if (num79 < 20f) + if (spawnVec.Y < 20f) { - num79 = 20f; + spawnVec.Y = 20f; } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-180, 181) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, i, 0f, (float)Main.rand.Next(3)); + distance = spawnVec.Length(); + distance = speed / distance; + spawnVec.X *= distance; + spawnVec.Y *= distance; + spawnVec.X += (float)Main.rand.Next(-180, 181) * 0.02f; + spawnVec.Y += (float)Main.rand.Next(-180, 181) * 0.02f; + int proj = Projectile.NewProjectile(source, spawnVec, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3)); Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].timeLeft = CalamityUtils.SecondsToFrames(8f); } return false; } diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index cf2aae3f70..0931211c2a 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Ammo; +using CalamityMod.Items.Ammo; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Tiles.Furniture.CraftingStations; diff --git a/Items/Weapons/Magic/IcicleStaff.cs b/Items/Weapons/Magic/IcicleStaff.cs index 2f37571e0d..dd038b4c7d 100644 --- a/Items/Weapons/Magic/IcicleStaff.cs +++ b/Items/Weapons/Magic/IcicleStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 44; item.useTime = 15; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 1, 0, 0); diff --git a/Items/Weapons/Magic/IcicleTrident.cs b/Items/Weapons/Magic/IcicleTrident.cs index 927517853a..78255e0839 100644 --- a/Items/Weapons/Magic/IcicleTrident.cs +++ b/Items/Weapons/Magic/IcicleTrident.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 64; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 7f; diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index 448966fc4d..b7db467ddf 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -4,11 +4,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Items.Weapons.Magic { - public class InfernalRift : ModItem + public class InfernalRift : ModItem { public override void SetStaticDefaults() { @@ -28,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 4; item.reuseDelay = item.useAnimation + 6; item.crit = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index 82eaf50a6d..fad71a3dc0 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 6; item.useAnimation = 10; item.useTime = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 5.5f; item.UseSound = SoundID.Item91; item.autoReuse = true; diff --git a/Items/Weapons/Magic/Keelhaul.cs b/Items/Weapons/Magic/Keelhaul.cs index 144ba99e79..5485b3308d 100644 --- a/Items/Weapons/Magic/Keelhaul.cs +++ b/Items/Weapons/Magic/Keelhaul.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 30; item.useAnimation = 30; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2f; item.UseSound = SoundID.Item102; item.autoReuse = true; diff --git a/Items/Weapons/Magic/Lazhar.cs b/Items/Weapons/Magic/Lazhar.cs index 9e9eff4ef5..4ed61c734a 100644 --- a/Items/Weapons/Magic/Lazhar.cs +++ b/Items/Weapons/Magic/Lazhar.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 20; item.useTime = 7; item.useAnimation = 7; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index c844846ad9..2ec949bfc4 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 36; item.useTime = 3; item.useAnimation = 3; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs index 167eefcb28..3eea56cf0f 100644 --- a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs +++ b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 36; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/MagnaCannon.cs b/Items/Weapons/Magic/MagnaCannon.cs index eb0402a653..2f5a987604 100644 --- a/Items/Weapons/Magic/MagnaCannon.cs +++ b/Items/Weapons/Magic/MagnaCannon.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 34; item.useTime = 32; item.useAnimation = 32; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index 77556128fd..8cebeba233 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 78; item.useTime = 27; item.useAnimation = 27; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/ManaRose.cs b/Items/Weapons/Magic/ManaRose.cs index b598d88cda..5f645699d6 100644 --- a/Items/Weapons/Magic/ManaRose.cs +++ b/Items/Weapons/Magic/ManaRose.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 38; item.useTime = 27; item.useAnimation = 27; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index 3871950373..bd39f7269f 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 48; item.useTime = 6; item.useAnimation = 6; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 6c840fb496..7b4d0d00de 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 50; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Magic/NuclearFury.cs b/Items/Weapons/Magic/NuclearFury.cs index 399e34adff..9a42be9721 100644 --- a/Items/Weapons/Magic/NuclearFury.cs +++ b/Items/Weapons/Magic/NuclearFury.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 9b48e1101c..a562d2398f 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -1,6 +1,5 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Magic { public override void SetStaticDefaults() { - DisplayName.SetDefault("Parasitic Sceptor"); + DisplayName.SetDefault("Parasitic Scepter"); Tooltip.SetDefault("Fires a spread of water leeches that latch onto enemies, dealing a stacking damage over time"); Item.staff[item.type] = true; } @@ -30,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic item.width = item.height = 52; item.UseSound = SoundID.Item46; item.noMelee = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.rare = 2; item.value = CalamityGlobalItem.Rarity2BuyPrice; } @@ -39,28 +38,28 @@ namespace CalamityMod.Items.Weapons.Magic 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 speed = item.shootSpeed; - Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; - float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; - if (player.gravDir == -1f) - { - yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; - } + float speed = item.shootSpeed; + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = Main.mouseX + Main.screenPosition.X - playerPos.X; + float yDist = Main.mouseY + Main.screenPosition.Y - playerPos.Y; + if (player.gravDir == -1f) + { + yDist = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; + } Vector2 vector = new Vector2(xDist, yDist); float speedMult = vector.Length(); - if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) - { - xDist = player.direction; - yDist = 0f; - speedMult = speed; - } - else - { - speedMult = speed / speedMult; - } - xDist *= speedMult; - yDist *= speedMult; + if ((float.IsNaN(xDist) && float.IsNaN(yDist)) || (xDist == 0f && yDist == 0f)) + { + xDist = player.direction; + yDist = 0f; + speedMult = speed; + } + else + { + speedMult = speed / speedMult; + } + xDist *= speedMult; + yDist *= speedMult; int leechAmt = 2; if (Main.rand.NextBool(3)) { @@ -74,21 +73,21 @@ namespace CalamityMod.Items.Weapons.Magic { leechAmt ++; } - for (int i = 0; i < leechAmt; i++) - { - float xVec = xDist; - float yVec = yDist; - float spreadMult = 0.05f * i; - xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; - yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + for (int i = 0; i < leechAmt; i++) + { + float xVec = xDist; + float yVec = yDist; + float spreadMult = 0.05f * i; + xVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; + yVec += Main.rand.NextFloat(-25f, 25f) * spreadMult; Vector2 directionToShoot = new Vector2(xVec, yVec); speedMult = directionToShoot.Length(); - speedMult = speed / speedMult; - xVec *= speedMult; - yVec *= speedMult; - directionToShoot = new Vector2(xVec, yVec); - Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); - } + speedMult = speed / speedMult; + xVec *= speedMult; + yVec *= speedMult; + directionToShoot = new Vector2(xVec, yVec); + Projectile.NewProjectile(playerPos, directionToShoot, type, damage, knockBack, player.whoAmI, 0f, 0f); + } return false; } } diff --git a/Items/Weapons/Magic/PhantasmalFury.cs b/Items/Weapons/Magic/PhantasmalFury.cs index 2210557969..5cd1e41a10 100644 --- a/Items/Weapons/Magic/PhantasmalFury.cs +++ b/Items/Weapons/Magic/PhantasmalFury.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 60; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index dffa051d42..74ffcbb075 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 70; item.useTime = 15; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index 8b90cd7c5e..5059626301 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 46; item.useTime = 21; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index 640c62a2c0..29142fe633 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 22; item.useTime = 40; item.useAnimation = 40; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/PlasmaRod.cs b/Items/Weapons/Magic/PlasmaRod.cs index dc55c85321..59ed119a27 100644 --- a/Items/Weapons/Magic/PlasmaRod.cs +++ b/Items/Weapons/Magic/PlasmaRod.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 40; item.useTime = 36; item.useAnimation = 36; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 1, 0, 0); diff --git a/Items/Weapons/Magic/Poseidon.cs b/Items/Weapons/Magic/Poseidon.cs index beab2e94f4..24642c3bad 100644 --- a/Items/Weapons/Magic/Poseidon.cs +++ b/Items/Weapons/Magic/Poseidon.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 8addb9e132..052a74c31d 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 48; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index 97dfe1b26a..303278d42a 100644 --- a/Items/Weapons/Magic/PrimordialEarth.cs +++ b/Items/Weapons/Magic/PrimordialEarth.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/Purge.cs b/Items/Weapons/Magic/Purge.cs index 5c9108e9ca..1aca1916f0 100644 --- a/Items/Weapons/Magic/Purge.cs +++ b/Items/Weapons/Magic/Purge.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 12; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.channel = true; diff --git a/Items/Weapons/Magic/PurgeGuzzler.cs b/Items/Weapons/Magic/PurgeGuzzler.cs index 2770ccd882..8b231d57b1 100644 --- a/Items/Weapons/Magic/PurgeGuzzler.cs +++ b/Items/Weapons/Magic/PurgeGuzzler.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 44; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index fb150cfe9d..b6c4a3b792 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.crit += 20; item.noMelee = true; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 18; item.knockBack = 8.5f; item.UseSound = SoundID.Item8; diff --git a/Items/Weapons/Magic/RelicofRuin.cs b/Items/Weapons/Magic/RelicofRuin.cs index a6f315c111..30cfe57299 100644 --- a/Items/Weapons/Magic/RelicofRuin.cs +++ b/Items/Weapons/Magic/RelicofRuin.cs @@ -17,14 +17,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 26; + item.damage = 20; item.magic = true; item.mana = 16; item.width = 28; item.height = 30; item.useTime = 35; item.useAnimation = 35; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.25f; item.value = Item.buyPrice(0, 36, 0, 0); @@ -37,12 +37,11 @@ namespace CalamityMod.Items.Weapons.Magic 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 spread = 22.5f * 0.0174f; + float spread = 22.5f * 0.01f * MathHelper.PiOver2; double startAngle = Math.Atan2(speedX, speedY) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int i; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), type, damage, knockBack, Main.myPlayer); diff --git a/Items/Weapons/Magic/RougeSlash.cs b/Items/Weapons/Magic/RougeSlash.cs index 4dafbc4b84..0159ae94c4 100644 --- a/Items/Weapons/Magic/RougeSlash.cs +++ b/Items/Weapons/Magic/RougeSlash.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 19; item.useAnimation = 19; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.UseSound = SoundID.Item91; diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 4bfd67fdb4..8a3b91912c 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 34; item.useTime = 50; item.useAnimation = 50; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.rare = 5; diff --git a/Items/Weapons/Magic/SanguineFlare.cs b/Items/Weapons/Magic/SanguineFlare.cs index 5a6b9b34a6..3bee34a1cd 100644 --- a/Items/Weapons/Magic/SanguineFlare.cs +++ b/Items/Weapons/Magic/SanguineFlare.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 60; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index c0488f1753..c9acd0befb 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.75f; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/FlareSound"); diff --git a/Items/Weapons/Magic/Serpentine.cs b/Items/Weapons/Magic/Serpentine.cs index 8d1cc473a0..c9f481b19d 100644 --- a/Items/Weapons/Magic/Serpentine.cs +++ b/Items/Weapons/Magic/Serpentine.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 32; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/ShadecrystalTome.cs b/Items/Weapons/Magic/ShadecrystalTome.cs index 52e676c48b..25a3624454 100644 --- a/Items/Weapons/Magic/ShadecrystalTome.cs +++ b/Items/Weapons/Magic/ShadecrystalTome.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 6; item.useAnimation = 6; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index 6629f15a5e..df4e88c5c5 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 42; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 0f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index f962f3079e..a62dad29a0 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 56; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/ShadowdropStaff.cs b/Items/Weapons/Magic/ShadowdropStaff.cs index 0683f16b44..296c86aa69 100644 --- a/Items/Weapons/Magic/ShadowdropStaff.cs +++ b/Items/Weapons/Magic/ShadowdropStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 44; item.useTime = 9; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index 6882e3429a..7e69a5dbaa 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 58; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/SirensSong.cs b/Items/Weapons/Magic/SirensSong.cs index 91772c9742..9a371b9788 100644 --- a/Items/Weapons/Magic/SirensSong.cs +++ b/Items/Weapons/Magic/SirensSong.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 50; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/SkyGlaze.cs b/Items/Weapons/Magic/SkyGlaze.cs index 768831d436..941e02af33 100644 --- a/Items/Weapons/Magic/SkyGlaze.cs +++ b/Items/Weapons/Magic/SkyGlaze.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 74; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 1, 0, 0); diff --git a/Items/Weapons/Magic/SnowstormStaff.cs b/Items/Weapons/Magic/SnowstormStaff.cs index 795414ddeb..2bf94b296b 100644 --- a/Items/Weapons/Magic/SnowstormStaff.cs +++ b/Items/Weapons/Magic/SnowstormStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 66; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 4846f7549d..7fb36a4fe8 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -5,11 +5,10 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Items.Weapons.Magic { - public class SoulPiercer : ModItem + public class SoulPiercer : ModItem { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 64; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Magic/StardustStaff.cs b/Items/Weapons/Magic/StardustStaff.cs index fff419d968..77264c15f6 100644 --- a/Items/Weapons/Magic/StardustStaff.cs +++ b/Items/Weapons/Magic/StardustStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 56; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/Starfall.cs b/Items/Weapons/Magic/Starfall.cs index 58c95ea694..58846ac042 100644 --- a/Items/Weapons/Magic/Starfall.cs +++ b/Items/Weapons/Magic/Starfall.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/StormSpray.cs b/Items/Weapons/Magic/StormSpray.cs index 1d39ed22ff..afa23b2fd0 100644 --- a/Items/Weapons/Magic/StormSpray.cs +++ b/Items/Weapons/Magic/StormSpray.cs @@ -17,14 +17,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 18; + item.damage = 14; item.magic = true; item.mana = 8; item.width = 42; item.height = 42; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/StratusSphere.cs b/Items/Weapons/Magic/StratusSphere.cs index d572461059..0f754b82ef 100644 --- a/Items/Weapons/Magic/StratusSphere.cs +++ b/Items/Weapons/Magic/StratusSphere.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useAnimation = 45; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 7f; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.mana = 30; item.knockBack = 2; item.UseSound = SoundID.Item20; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 48c8c0223f..ce180eb264 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Magic; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -10,17 +9,21 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class SubsumingVortex : ModItem + public class SubsumingVortex : ModItem { + public const int MaxVortexCount = 4; public override void SetStaticDefaults() { DisplayName.SetDefault("Subsuming Vortex"); - Tooltip.SetDefault("Fires 3 vortexes of elemental energy"); + Tooltip.SetDefault("Fires a giant slow-moving vortex\n" + + "When an enemy is nearby, the vortex releases tentacles that redirect towards the enemy.\n" + + "After some time, the vortex slows down, charges, and eventually explodes.\n" + + $"Only {MaxVortexCount} vortexes can exist at once."); } public override void SetDefaults() { - item.damage = 520; + item.damage = 480; item.magic = true; item.mana = 20; item.width = 38; @@ -28,14 +31,14 @@ namespace CalamityMod.Items.Weapons.Magic item.UseSound = SoundID.Item84; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 9f; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7f; item.Calamity().customRarity = CalamityRarity.Violet; } @@ -45,16 +48,11 @@ namespace CalamityMod.Items.Weapons.Magic spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < MaxVortexCount; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int num6 = 3; - for (int index = 0; index < num6; ++index) - { - float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f; - float ai = Main.rand.NextFloat() + 0.5f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, ai); - } + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); return false; } diff --git a/Items/Weapons/Magic/T1000.cs b/Items/Weapons/Magic/T1000.cs index b76bc6e8d1..9c0fbfef8a 100644 --- a/Items/Weapons/Magic/T1000.cs +++ b/Items/Weapons/Magic/T1000.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic @@ -24,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 12; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.channel = true; diff --git a/Items/Weapons/Magic/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index f919aca926..b30c6c2aaf 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index b61f0556ac..578f2652bb 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 54; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/TheSwarmer.cs b/Items/Weapons/Magic/TheSwarmer.cs index 76ac5e1a49..8618c2cbdc 100644 --- a/Items/Weapons/Magic/TheSwarmer.cs +++ b/Items/Weapons/Magic/TheSwarmer.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 8; item.useAnimation = 8; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; diff --git a/Items/Weapons/Magic/TheWand.cs b/Items/Weapons/Magic/TheWand.cs index 11f6805c22..c5d2d616a3 100644 --- a/Items/Weapons/Magic/TheWand.cs +++ b/Items/Weapons/Magic/TheWand.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useAnimation = 250; item.useTime = 250; item.useTurn = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 0.5f; item.UseSound = SoundID.Item102; item.autoReuse = true; diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index d3e2b2aaea..78ee67d598 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 68; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/Thunderstorm.cs b/Items/Weapons/Magic/Thunderstorm.cs index a08cdb4226..ded4b0bba3 100644 --- a/Items/Weapons/Magic/Thunderstorm.cs +++ b/Items/Weapons/Magic/Thunderstorm.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 22; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/TomeofFates.cs b/Items/Weapons/Magic/TomeofFates.cs index e852aa6602..a1147d2298 100644 --- a/Items/Weapons/Magic/TomeofFates.cs +++ b/Items/Weapons/Magic/TomeofFates.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 5; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Magic/Tradewinds.cs b/Items/Weapons/Magic/Tradewinds.cs index 13d4e68cc6..ddcffce055 100644 --- a/Items/Weapons/Magic/Tradewinds.cs +++ b/Items/Weapons/Magic/Tradewinds.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Magic/UltraLiquidator.cs b/Items/Weapons/Magic/UltraLiquidator.cs index 9d18479c0f..7f3db174f7 100644 --- a/Items/Weapons/Magic/UltraLiquidator.cs +++ b/Items/Weapons/Magic/UltraLiquidator.cs @@ -4,11 +4,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Items.Weapons.Magic { - public class UltraLiquidator : ModItem + public class UltraLiquidator : ModItem { public override void SetStaticDefaults() { @@ -29,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 3; item.reuseDelay = item.useAnimation; item.crit = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index bc85307e05..1b07fcdcb9 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 64; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 095e5705b7..9f70cb4bb8 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 26; item.useTime = ChargeFrames + CooldownFrames; item.useAnimation = ChargeFrames + CooldownFrames; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.NPCDeath7; item.useTurn = false; item.noMelee = true; diff --git a/Items/Weapons/Magic/Vehemenc.cs b/Items/Weapons/Magic/Vehemenc.cs index 8738aebf5c..1e20d281a9 100644 --- a/Items/Weapons/Magic/Vehemenc.cs +++ b/Items/Weapons/Magic/Vehemenc.cs @@ -3,11 +3,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Items.Weapons.Magic { - public class Vehemenc : ModItem + public class Vehemenc : ModItem { public override void SetStaticDefaults() { @@ -29,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 44; item.useTime = 50; item.useAnimation = 50; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.75f; item.value = Item.buyPrice(1, 0, 0, 0); diff --git a/Items/Weapons/Magic/VenusianTrident.cs b/Items/Weapons/Magic/VenusianTrident.cs index bee24a26d4..af53338209 100644 --- a/Items/Weapons/Magic/VenusianTrident.cs +++ b/Items/Weapons/Magic/VenusianTrident.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 48; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 9f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index 2ec0fe3b9f..8f22d466d8 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useAnimation = 20; item.useTime = 20; item.noMelee = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 3f; item.UseSound = SoundID.Item88; item.autoReuse = true; diff --git a/Items/Weapons/Magic/Viscera.cs b/Items/Weapons/Magic/Viscera.cs index 4dd87bf603..2fe4d94d4f 100644 --- a/Items/Weapons/Magic/Viscera.cs +++ b/Items/Weapons/Magic/Viscera.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 52; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Magic/VividClarity.cs b/Items/Weapons/Magic/VividClarity.cs index bde4eeeaa7..e3d625197c 100644 --- a/Items/Weapons/Magic/VividClarity.cs +++ b/Items/Weapons/Magic/VividClarity.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useAnimation = 20; item.useTime = 4; item.reuseDelay = item.useAnimation; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(2, 50, 0, 0); @@ -50,29 +50,28 @@ namespace CalamityMod.Items.Weapons.Magic 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 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num72 = item.shootSpeed; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - float f = Main.rand.NextFloat() * 6.28318548f; - float value12 = 20f; - float value13 = 60f; - Vector2 vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat()); + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float speed = item.shootSpeed; + float xPos = (float)Main.mouseX + Main.screenPosition.X - playerPos.X; + float yPos = (float)Main.mouseY + Main.screenPosition.Y - playerPos.Y; + float f = Main.rand.NextFloat() * MathHelper.TwoPi; + float sourceVariationLow = 20f; + float sourceVariationHigh = 60f; + Vector2 source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(sourceVariationLow, sourceVariationHigh, Main.rand.NextFloat()); for (int num202 = 0; num202 < 50; num202++) { - vector13 = vector2 + f.ToRotationVector2() * MathHelper.Lerp(value12, value13, Main.rand.NextFloat()); - if (Collision.CanHit(vector2, 0, 0, vector13 + (vector13 - vector2).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) + source = playerPos + f.ToRotationVector2() * MathHelper.Lerp(sourceVariationLow, sourceVariationHigh, Main.rand.NextFloat()); + if (Collision.CanHit(playerPos, 0, 0, source + (source - playerPos).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) { break; } - f = Main.rand.NextFloat() * 6.28318548f; + f = Main.rand.NextFloat() * MathHelper.TwoPi; } - Vector2 mouseWorld = Main.MouseWorld; - Vector2 vector14 = mouseWorld - vector13; - Vector2 vector15 = new Vector2(num78, num79).SafeNormalize(Vector2.UnitY) * num72; - vector14 = vector14.SafeNormalize(vector15) * num72; - vector14 = Vector2.Lerp(vector14, vector15, 0.25f); - Projectile.NewProjectile(vector13, vector14, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3)); + Vector2 velocity = Main.MouseWorld - source; + Vector2 velocityVariation = new Vector2(xPos, yPos).SafeNormalize(Vector2.UnitY) * speed; + velocity = velocity.SafeNormalize(velocityVariation) * speed; + velocity = Vector2.Lerp(velocity, velocityVariation, 0.25f); + Projectile.NewProjectile(source, velocity, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3)); return false; } diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 5a05f26ded..bdf4c64a67 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 130; item.useTime = 41; item.useAnimation = 41; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 0f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Magic/Waywasher.cs b/Items/Weapons/Magic/Waywasher.cs index 6ff0f3baab..bd7b32b3c8 100644 --- a/Items/Weapons/Magic/Waywasher.cs +++ b/Items/Weapons/Magic/Waywasher.cs @@ -16,14 +16,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 20; + item.damage = 15; item.magic = true; item.mana = 4; item.width = 30; item.height = 30; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Magic/Wingman.cs b/Items/Weapons/Magic/Wingman.cs index 6edfcd2e38..20be7e8f2b 100644 --- a/Items/Weapons/Magic/Wingman.cs +++ b/Items/Weapons/Magic/Wingman.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 22; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/WintersFury.cs b/Items/Weapons/Magic/WintersFury.cs index b69736bc4f..5803b47218 100644 --- a/Items/Weapons/Magic/WintersFury.cs +++ b/Items/Weapons/Magic/WintersFury.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 5f; diff --git a/Items/Weapons/Magic/WrathoftheAncients.cs b/Items/Weapons/Magic/WrathoftheAncients.cs index 84f05e6845..d7aa63ac3d 100644 --- a/Items/Weapons/Magic/WrathoftheAncients.cs +++ b/Items/Weapons/Magic/WrathoftheAncients.cs @@ -2,6 +2,7 @@ using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 30; item.useTime = 38; item.useAnimation = 38; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index c81ccd8c55..9341c3853b 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -18,14 +18,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 10; + item.damage = 12; item.magic = true; item.mana = 4; item.width = 44; item.height = 46; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3; item.value = Item.buyPrice(0, 1, 0, 0); diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 1c7c5fbf54..06048e3dbe 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -26,7 +26,7 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles item.height = 74; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.75f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index 21872e981e..5021b79b7d 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.useTime = 10; item.useAnimation = 10; item.reuseDelay = 5; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item13; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/Zapper.cs b/Items/Weapons/Magic/Zapper.cs index 33808b6d71..25e1ddc0d3 100644 --- a/Items/Weapons/Magic/Zapper.cs +++ b/Items/Weapons/Magic/Zapper.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic item.height = 22; item.useTime = 7; item.useAnimation = 7; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 48, 0, 0); diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index a30e6f597f..c19b0be69a 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 58; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = false; item.knockBack = 4f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 48ebd44440..81e597cecb 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 26; item.useTime = 26; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/AccretionDiskMelee.cs b/Items/Weapons/Melee/AccretionDiskMelee.cs index 1eadd4f954..71f32bf6b9 100644 --- a/Items/Weapons/Melee/AccretionDiskMelee.cs +++ b/Items/Weapons/Melee/AccretionDiskMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 9f; item.UseSound = SoundID.Item1; @@ -36,13 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index 0ad7576f0c..67d9db46ac 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.useTime = 20; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 15; item.useAnimation = 15; item.UseSound = SoundID.Item1; - item.shoot = 0; + item.shoot = ProjectileID.None; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Melee/Aftershock.cs b/Items/Weapons/Melee/Aftershock.cs index 367dd49c9a..5cbf307cdd 100644 --- a/Items/Weapons/Melee/Aftershock.cs +++ b/Items/Weapons/Melee/Aftershock.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 28; item.useAnimation = 28; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; diff --git a/Items/Weapons/Melee/AirSpinner.cs b/Items/Weapons/Melee/AirSpinner.cs index 4a05ae5486..c2bb163b95 100644 --- a/Items/Weapons/Melee/AirSpinner.cs +++ b/Items/Weapons/Melee/AirSpinner.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/AmidiasTrident.cs b/Items/Weapons/Melee/AmidiasTrident.cs index 8c6372ab45..a6c0e0b474 100644 --- a/Items/Weapons/Melee/AmidiasTrident.cs +++ b/Items/Weapons/Melee/AmidiasTrident.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 17; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 17; item.knockBack = 4.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index 4cd6222c92..3e5cd7ccca 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 19; item.useTime = 19; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/AncientCrusher.cs b/Items/Weapons/Melee/AncientCrusher.cs index a93ddd3189..4aa33271fa 100644 --- a/Items/Weapons/Melee/AncientCrusher.cs +++ b/Items/Weapons/Melee/AncientCrusher.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 55; item.melee = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/AncientShiv.cs b/Items/Weapons/Melee/AncientShiv.cs index dad30b9ee6..db8df68ce8 100644 --- a/Items/Weapons/Melee/AncientShiv.cs +++ b/Items/Weapons/Melee/AncientShiv.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 12; item.useTime = 12; diff --git a/Items/Weapons/Melee/Animus.cs b/Items/Weapons/Melee/Animus.cs index 65fe9f4017..a9a09b298b 100644 --- a/Items/Weapons/Melee/Animus.cs +++ b/Items/Weapons/Melee/Animus.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 4000; item.melee = true; item.useAnimation = 11; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 11; item.useTurn = true; item.knockBack = 20f; diff --git a/Items/Weapons/Melee/Aorta.cs b/Items/Weapons/Melee/Aorta.cs index 83390a98b1..5144e55830 100644 --- a/Items/Weapons/Melee/Aorta.cs +++ b/Items/Weapons/Melee/Aorta.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/AquaticDischarge.cs b/Items/Weapons/Melee/AquaticDischarge.cs index f9f1ee8bee..39e0bc38f1 100644 --- a/Items/Weapons/Melee/AquaticDischarge.cs +++ b/Items/Weapons/Melee/AquaticDischarge.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 12; item.useTime = 12; diff --git a/Items/Weapons/Melee/AquaticDissolution.cs b/Items/Weapons/Melee/AquaticDissolution.cs index bf5b6b75bd..61bbe6e53e 100644 --- a/Items/Weapons/Melee/AquaticDissolution.cs +++ b/Items/Weapons/Melee/AquaticDissolution.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 16; item.useTime = 16; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item60; item.autoReuse = true; diff --git a/Items/Weapons/Melee/ArkoftheAncients.cs b/Items/Weapons/Melee/ArkoftheAncients.cs index 55a9ab0908..5b192c82d5 100644 --- a/Items/Weapons/Melee/ArkoftheAncients.cs +++ b/Items/Weapons/Melee/ArkoftheAncients.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.useTime = 22; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index d36fddba5a..a26fa91711 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 15; item.useTime = 15; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.crit += 15; item.knockBack = 9.5f; item.UseSound = SoundID.Item60; diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index e6e70fe1c6..7a868328b0 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.useTime = 20; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.crit += 10; item.knockBack = 8.5f; item.UseSound = SoundID.Item60; diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index efdd75c998..88b2b4cd31 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework; @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 9; item.useAnimation = 9; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; diff --git a/Items/Weapons/Melee/AstralPike.cs b/Items/Weapons/Melee/AstralPike.cs index e86c53a34b..c1af96dbe8 100644 --- a/Items/Weapons/Melee/AstralPike.cs +++ b/Items/Weapons/Melee/AstralPike.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 13; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/AstralScythe.cs b/Items/Weapons/Melee/AstralScythe.cs index 90852c6093..2708359934 100644 --- a/Items/Weapons/Melee/AstralScythe.cs +++ b/Items/Weapons/Melee/AstralScythe.cs @@ -19,11 +19,11 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 56; item.height = 60; - item.damage = 95; + item.damage = 120; item.melee = true; item.useTurn = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 6f; item.UseSound = SoundID.Item71; @@ -36,7 +36,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, type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index b9fa8607a1..6f51d843d0 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; diff --git a/Items/Weapons/Melee/Avalanche.cs b/Items/Weapons/Melee/Avalanche.cs index 962d41f3f2..c5bfe28f4c 100644 --- a/Items/Weapons/Melee/Avalanche.cs +++ b/Items/Weapons/Melee/Avalanche.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 30; item.useTime = 30; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Azathoth.cs b/Items/Weapons/Melee/Azathoth.cs index 396e32b38c..3713313821 100644 --- a/Items/Weapons/Melee/Azathoth.cs +++ b/Items/Weapons/Melee/Azathoth.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/BalefulHarvester.cs b/Items/Weapons/Melee/BalefulHarvester.cs index 33ca237241..844d57d178 100644 --- a/Items/Weapons/Melee/BalefulHarvester.cs +++ b/Items/Weapons/Melee/BalefulHarvester.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 66; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/BallOFugu.cs b/Items/Weapons/Melee/BallOFugu.cs index c8e28c327b..a3b34079b3 100644 --- a/Items/Weapons/Melee/BallOFugu.cs +++ b/Items/Weapons/Melee/BallOFugu.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 10; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/BansheeHook.cs b/Items/Weapons/Melee/BansheeHook.cs index 13a98989bd..690070ad15 100644 --- a/Items/Weapons/Melee/BansheeHook.cs +++ b/Items/Weapons/Melee/BansheeHook.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.channel = true; item.melee = true; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 21; item.knockBack = 8.5f; item.UseSound = SoundID.DD2_GhastlyGlaivePierce; diff --git a/Items/Weapons/Melee/BiomeBlade.cs b/Items/Weapons/Melee/BiomeBlade.cs index 9f8d84c2ef..16be34da7b 100644 --- a/Items/Weapons/Melee/BiomeBlade.cs +++ b/Items/Weapons/Melee/BiomeBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 24; item.useTime = 24; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index 18d4f2caf2..3e5f9c2aa0 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -16,16 +16,16 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 58; + item.width = 56; + item.height = 56; item.damage = 25; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.knockBack = 4f; item.UseSound = SoundID.Item1; item.autoReuse = false; - item.height = 58; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/BladecrestOathsword.png b/Items/Weapons/Melee/BladecrestOathsword.png index fb687ddfc0..3f02a452d5 100644 Binary files a/Items/Weapons/Melee/BladecrestOathsword.png and b/Items/Weapons/Melee/BladecrestOathsword.png differ diff --git a/Items/Weapons/Melee/BladeofEnmity.cs b/Items/Weapons/Melee/BladeofEnmity.cs index 81cd369c1c..c7ddba4fe2 100644 --- a/Items/Weapons/Melee/BladeofEnmity.cs +++ b/Items/Weapons/Melee/BladeofEnmity.cs @@ -15,12 +15,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 72; - item.height = 76; + item.width = 60; + item.height = 64; item.damage = 158; item.melee = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/BladeofEnmity.png b/Items/Weapons/Melee/BladeofEnmity.png index 9a2d2ca0b0..85eaf83a33 100644 Binary files a/Items/Weapons/Melee/BladeofEnmity.png and b/Items/Weapons/Melee/BladeofEnmity.png differ diff --git a/Items/Weapons/Melee/BloodyEdge.cs b/Items/Weapons/Melee/BloodyEdge.cs index 8ad4ccc251..9585d9682a 100644 --- a/Items/Weapons/Melee/BloodyEdge.cs +++ b/Items/Weapons/Melee/BloodyEdge.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 52; item.melee = true; item.useAnimation = 23; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 23; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { int healAmount = Main.rand.Next(3) + 1; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool(2) && !player.moonLeech) { player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/BloodyRupture.cs b/Items/Weapons/Melee/BloodyRupture.cs index 5c6fed7379..af33b33ee1 100644 --- a/Items/Weapons/Melee/BloodyRupture.cs +++ b/Items/Weapons/Melee/BloodyRupture.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 15; item.useTime = 15; diff --git a/Items/Weapons/Melee/Bonebreaker.cs b/Items/Weapons/Melee/Bonebreaker.cs index aea4ceeb2f..89d6de48af 100644 --- a/Items/Weapons/Melee/Bonebreaker.cs +++ b/Items/Weapons/Melee/Bonebreaker.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Items.Materials; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class Bonebreaker : ModItem + public class Bonebreaker : ModItem { public const int BaseDamage = 60; @@ -19,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 15; item.useTime = 15; item.width = 32; diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 0eb0b15909..b3f400c4b6 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 19; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 19; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Brimlash.cs b/Items/Weapons/Melee/Brimlash.cs index 3adb80c8fc..161eb295ad 100644 --- a/Items/Weapons/Melee/Brimlash.cs +++ b/Items/Weapons/Melee/Brimlash.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/BrimlashBuster.cs b/Items/Weapons/Melee/BrimlashBuster.cs index f1ed473d10..f576976d36 100644 --- a/Items/Weapons/Melee/BrimlashBuster.cs +++ b/Items/Weapons/Melee/BrimlashBuster.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 4cf4b19886..a273951ccf 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -25,13 +25,13 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.useTime = 20; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 62; item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; + item.rare = ItemRarityID.Yellow; item.shootSpeed = 4f; item.Calamity().customRarity = CalamityRarity.ItemSpecific; } @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 20; item.useAnimation = 20; item.UseSound = SoundID.Item1; - item.shoot = 0; + item.shoot = ProjectileID.None; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Melee/BurntSienna.cs b/Items/Weapons/Melee/BurntSienna.cs index f861213e2d..bbf06f93b9 100644 --- a/Items/Weapons/Melee/BurntSienna.cs +++ b/Items/Weapons/Melee/BurntSienna.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 21; item.useTime = 21; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.life <= 0) + if (target.life <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(3); float randomSpeedY = (float)Main.rand.Next(3, 5); @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (target.statLife <= 0) + if (target.statLife <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(3); float randomSpeedY = (float)Main.rand.Next(3, 5); diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 0eeedbbc78..02c0136f32 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 55; item.melee = true; item.useAnimation = 21; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 21; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (target.life <= 0) { - Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)target.position.X, (int)target.position.Y); target.position.X += (float)(target.width / 2); target.position.Y += (float)(target.height / 2); target.position.X -= (float)(target.width / 2); @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (target.statLife <= 0) { - Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)target.position.X, (int)target.position.Y); target.position.X += (float)(target.width / 2); target.position.Y += (float)(target.height / 2); target.position.X -= (float)(target.width / 2); diff --git a/Items/Weapons/Melee/CatastropheClaymore.cs b/Items/Weapons/Melee/CatastropheClaymore.cs index 556abda6b2..0688de26a9 100644 --- a/Items/Weapons/Melee/CatastropheClaymore.cs +++ b/Items/Weapons/Melee/CatastropheClaymore.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 23; item.useTime = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -73,9 +73,9 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(3)) { - target.AddBuff(BuffID.Ichor, 120); + target.AddBuff(BuffID.Ichor, 60); target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.Frostburn, 150); } } @@ -83,9 +83,9 @@ namespace CalamityMod.Items.Weapons.Melee { if (Main.rand.NextBool(3)) { - target.AddBuff(BuffID.Ichor, 120); + target.AddBuff(BuffID.Ichor, 60); target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.Frostburn, 150); } } } diff --git a/Items/Weapons/Melee/CausticEdge.cs b/Items/Weapons/Melee/CausticEdge.cs index 58f796b9c5..b8975fef49 100644 --- a/Items/Weapons/Melee/CausticEdge.cs +++ b/Items/Weapons/Melee/CausticEdge.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useTurn = true; item.useAnimation = 27; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 27; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/CelestialClaymore.cs b/Items/Weapons/Melee/CelestialClaymore.cs index 7cba73378e..775543a275 100644 --- a/Items/Weapons/Melee/CelestialClaymore.cs +++ b/Items/Weapons/Melee/CelestialClaymore.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 23; item.useTime = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Chaotrix.cs b/Items/Weapons/Melee/Chaotrix.cs index 1a35401fe1..df07558233 100644 --- a/Items/Weapons/Melee/Chaotrix.cs +++ b/Items/Weapons/Melee/Chaotrix.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/ClamCrusher.cs b/Items/Weapons/Melee/ClamCrusher.cs index 08562b8c22..361197b733 100644 --- a/Items/Weapons/Melee/ClamCrusher.cs +++ b/Items/Weapons/Melee/ClamCrusher.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 60; item.useTime = 50; item.useAnimation = 50; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.knockBack = 10f; diff --git a/Items/Weapons/Melee/Cnidarian.cs b/Items/Weapons/Melee/Cnidarian.cs index 830a0a369b..1205d112ba 100644 --- a/Items/Weapons/Melee/Cnidarian.cs +++ b/Items/Weapons/Melee/Cnidarian.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/ColdheartIcicle.cs b/Items/Weapons/Melee/ColdheartIcicle.cs index e6433e35a0..b8edf40604 100644 --- a/Items/Weapons/Melee/ColdheartIcicle.cs +++ b/Items/Weapons/Melee/ColdheartIcicle.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 27; item.useAnimation = 27; item.autoReuse = true; - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.UseSound = SoundID.Item1; item.useTurn = true; item.knockBack = 3f; diff --git a/Items/Weapons/Melee/CometQuasher.cs b/Items/Weapons/Melee/CometQuasher.cs index 5174b979e2..902a6676c3 100644 --- a/Items/Weapons/Melee/CometQuasher.cs +++ b/Items/Weapons/Melee/CometQuasher.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 120; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 7.75f; diff --git a/Items/Weapons/Melee/CorpusAvertorMelee.cs b/Items/Weapons/Melee/CorpusAvertorMelee.cs index d50d006414..c73dbd5a7b 100644 --- a/Items/Weapons/Melee/CorpusAvertorMelee.cs +++ b/Items/Weapons/Melee/CorpusAvertorMelee.cs @@ -24,12 +24,12 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 3f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.value = Item.buyPrice(0, 80, 0, 0); + item.value = Item.buyPrice(gold: 80); item.rare = 8; item.Calamity().customRarity = CalamityRarity.Dedicated; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/CorruptedCrusherBlade.cs b/Items/Weapons/Melee/CorruptedCrusherBlade.cs index dd1d05b5fe..4bcc479fe3 100644 --- a/Items/Weapons/Melee/CorruptedCrusherBlade.cs +++ b/Items/Weapons/Melee/CorruptedCrusherBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 26; item.useAnimation = 26; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.75f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.CursedInferno, 120); if (target.defense > 0 && crit) { target.defense -= 5; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.CursedInferno, 120); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/CosmicDischarge.cs b/Items/Weapons/Melee/CosmicDischarge.cs index 781b5bec93..24f867a7e9 100644 --- a/Items/Weapons/Melee/CosmicDischarge.cs +++ b/Items/Weapons/Melee/CosmicDischarge.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useAnimation = 15; item.useTime = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 0.5f; item.UseSound = SoundID.Item122; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 6ac343fad0..b13ae6dc5f 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 18; item.useTime = 18; item.width = 44; item.height = 44; - item.damage = 800; + item.damage = 666; item.melee = true; item.knockBack = 9f; diff --git a/Items/Weapons/Melee/CrescentMoon.cs b/Items/Weapons/Melee/CrescentMoon.cs index 20211d1cd5..c881acf21c 100644 --- a/Items/Weapons/Melee/CrescentMoon.cs +++ b/Items/Weapons/Melee/CrescentMoon.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useAnimation = 18; item.useTime = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 4f; item.UseSound = SoundID.Item82; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Melee/CrimsonCrusherBlade.cs b/Items/Weapons/Melee/CrimsonCrusherBlade.cs index dbe72daf9c..501c2443e4 100644 --- a/Items/Weapons/Melee/CrimsonCrusherBlade.cs +++ b/Items/Weapons/Melee/CrimsonCrusherBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 28; item.useAnimation = 28; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); if (target.damage > 0 && crit) { target.damage -= 10; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/CrystalBlade.cs b/Items/Weapons/Melee/CrystalBlade.cs index 1445a4a406..1ab40aa0af 100644 --- a/Items/Weapons/Melee/CrystalBlade.cs +++ b/Items/Weapons/Melee/CrystalBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 45; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.useTurn = true; item.knockBack = 4.5f; diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index 9b49fab046..3f4cc4ff24 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 75; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.useTurn = true; item.knockBack = 5; diff --git a/Items/Weapons/Melee/DepthBlade.cs b/Items/Weapons/Melee/DepthBlade.cs index 0cd1dad426..956da57f64 100644 --- a/Items/Weapons/Melee/DepthBlade.cs +++ b/Items/Weapons/Melee/DepthBlade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.useTime = 22; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Devastation.cs b/Items/Weapons/Melee/Devastation.cs index 7610867339..c41aa48ea2 100644 --- a/Items/Weapons/Melee/Devastation.cs +++ b/Items/Weapons/Melee/Devastation.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 24; item.useTime = 24; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -124,14 +124,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Frostburn, 300); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Frostburn, 300); } diff --git a/Items/Weapons/Melee/DevilsDevastation.cs b/Items/Weapons/Melee/DevilsDevastation.cs index 42740edf13..792337455b 100644 --- a/Items/Weapons/Melee/DevilsDevastation.cs +++ b/Items/Weapons/Melee/DevilsDevastation.cs @@ -15,23 +15,23 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Devil's Devastation"); - Tooltip.SetDefault("Fires a spread of demonic blades and blasts\n" + + Tooltip.SetDefault("Fires a spread of demonic scythes\n" + "Pitchforks rise from the underworld to skewer your foes\n" + "Critical hits cause shadowflame explosions"); } public override void SetDefaults() { - item.width = 74; + item.width = 118; + item.height = 118; item.damage = 520; item.melee = true; item.useAnimation = 20; item.useTime = 20; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.75f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 74; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.shoot = ModContent.ProjectileType(); @@ -41,58 +41,63 @@ 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) { + //Shoot 3 oathblades in a spread int index = 8; for (int j = -index; j <= index; j += index) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(j)); - Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI, 0f, 0f); } - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + //Not actually sure what this middle code does + float speed = item.shootSpeed; + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float directionX = (float)Main.mouseX + Main.screenPosition.X - source.X; + float directionY = (float)Main.mouseY + Main.screenPosition.Y - source.Y; if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + directionY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - source.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + Vector2 direction = new Vector2(directionX, directionY); + float aimDist = direction.Length(); + if ((float.IsNaN(direction.X) && float.IsNaN(direction.Y)) || (direction.X == 0f && direction.Y == 0f)) { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; + direction.X = (float)player.direction; + direction.Y = 0f; + aimDist = speed; } else { - num80 = num72 / num80; + aimDist = speed / aimDist; } - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) + //Shoot 9 tridents from below + int projAmt = 3; //Since the method spawns 3 projectiles, it spawns 9 total + for (int projIndex = 0; projIndex < projAmt; projIndex++) { - 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); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) + source = 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); + source.X = (source.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + source.Y += (float)(100 * projIndex); + direction.X = (float)Main.mouseX + Main.screenPosition.X - source.X; + direction.Y = (float)Main.mouseY + Main.screenPosition.Y - source.Y; + if (direction.Y < 0f) { - num79 *= -1f; + direction.Y *= -1f; } - if (num79 < 20f) + if (direction.Y < 20f) { - num79 = 20f; + direction.Y = 20f; } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(5)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(3)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 1f); + aimDist = direction.Length(); + aimDist = speed / aimDist; + direction.X *= aimDist; + direction.Y *= aimDist; + direction.X += Main.rand.NextFloat(-40f, 40f) * 0.02f; + direction.Y += Main.rand.NextFloat(-40f, 40f) * 0.02f; + direction.Y *= -1; + Projectile.NewProjectile(source, direction, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, Main.rand.Next(5)); + Projectile.NewProjectile(source, direction, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3)); + Projectile.NewProjectile(source, direction, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 1f); } return false; } @@ -126,42 +131,39 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.ShadowFlame, 900); target.AddBuff(BuffID.OnFire, 900); player.ApplyDamageToNPC(target, (int)(item.damage * player.MeleeDamage()) * 4, 0f, 0, false); - float num50 = 1.7f; - float num51 = 0.8f; - float num52 = 2f; - Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2(); + float scalar1 = 1.7f; + float scalar2 = 0.8f; + float scalar3 = 2f; + Vector2 value3 = (target.rotation - MathHelper.PiOver2).ToRotationVector2(); Vector2 value4 = value3 * target.velocity.Length(); Main.PlaySound(SoundID.Item14, target.position); - int num3; - for (int num53 = 0; num53 < 40; num53 = num3 + 1) + for (int i = 0; i < 40; i++) { - int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 200, default, num50); - Dust dust = Main.dust[num54]; - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + int dustInt = Dust.NewDust(target.position, target.width, target.height, 173, 0f, 0f, 200, default, scalar1); + Dust dust = Main.dust[dustInt]; + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * target.width / 2f; dust.noGravity = true; dust.velocity.Y -= 4.5f; dust.velocity *= 3f; dust.velocity += value4 * Main.rand.NextFloat(); - num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 100, default, num51); - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dustInt = Dust.NewDust(target.position, target.width, target.height, 173, 0f, 0f, 100, default, scalar2); + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * Main.rand.NextFloat() * target.width / 2f; dust.velocity.Y -= 3f; dust.velocity *= 2f; dust.noGravity = true; dust.fadeIn = 1f; dust.color = Color.Crimson * 0.5f; dust.velocity += value4 * Main.rand.NextFloat(); - num3 = num53; } - for (int num55 = 0; num55 < 20; num55 = num3 + 1) + for (int j = 0; j < 20; j++) { - int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 173, 0f, 0f, 0, default, num52); - Dust dust = Main.dust[num56]; - dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; + int dustInt = Dust.NewDust(target.position, target.width, target.height, 173, 0f, 0f, 0, default, scalar3); + Dust dust = Main.dust[dustInt]; + dust.position = target.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)target.velocity.ToRotation(), default) * target.width / 3f; dust.noGravity = true; dust.velocity.Y -= 1.5f; dust.velocity *= 0.5f; dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); - num3 = num55; } } } diff --git a/Items/Weapons/Melee/DevilsDevastation.png b/Items/Weapons/Melee/DevilsDevastation.png index 59afcbb8e6..2ed24ed381 100644 Binary files a/Items/Weapons/Melee/DevilsDevastation.png and b/Items/Weapons/Melee/DevilsDevastation.png differ diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index d47472a4fe..f7c515ef93 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 5; item.autoReuse = false; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Dedicated; diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index fbcf8cb69d..2bf14a10a8 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/DivineHatchet.cs b/Items/Weapons/Melee/DivineHatchet.cs index 6025795649..a0f6c55d17 100644 --- a/Items/Weapons/Melee/DivineHatchet.cs +++ b/Items/Weapons/Melee/DivineHatchet.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 1bb40c681d..81ed5fdcf8 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 350; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.useTurn = true; item.knockBack = 7.25f; diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index b09f0ceb06..0abf7fbb2b 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -4,7 +4,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -24,28 +23,28 @@ namespace CalamityMod.Items.Weapons.Melee "The lower your HP the more damage this blade does and heals the player on enemy hits"); } - public override void SetDefaults() - { - item.width = 80; - item.damage = 5000; - item.useAnimation = 14; - item.useStyle = 1; - item.useTime = 14; - item.useTurn = true; - item.melee = true; - item.knockBack = 9f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 114; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 19f; - item.Calamity().customRarity = CalamityRarity.Violet; - } + public override void SetDefaults() + { + item.width = 80; + item.damage = 5000; + item.useAnimation = 14; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTime = 14; + item.useTurn = true; + item.melee = true; + item.knockBack = 9f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.height = 114; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 19f; + item.Calamity().customRarity = CalamityRarity.Violet; + } - // Gains 100% of missing health as base damage. - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + // Gains 100% of missing health as base damage. + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { int lifeAmount = player.statLifeMax2 - player.statLife; flat += lifeAmount * player.MeleeDamage(); @@ -74,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 88); + Main.PlaySound(SoundID.Item88, player.Center); float xPos = player.position.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); float yPos = player.position.Y + Main.rand.Next(-800, 801); Vector2 startPos = new Vector2(xPos, yPos); @@ -92,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, ai1); } } - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -116,7 +115,7 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 88); + Main.PlaySound(SoundID.Item88, player.Center); float xPos = player.position.X + 800 * Main.rand.NextBool(2).ToDirectionInt(); float yPos = player.position.Y + Main.rand.Next(-800, 801); Vector2 startPos = new Vector2(xPos, yPos); @@ -134,6 +133,8 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, ai1); } } + if (player.moonLeech) + return; int healAmount = Main.rand.Next(5) + 5; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index 540e59e277..502c711040 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; @@ -37,7 +37,7 @@ Summons a barrage of petals and waterfalls on enemy hits"); item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"); item.channel = true; diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 185870139a..f0c4867db7 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 38858f734f..d523e08913 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 840; item.melee = true; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 16; item.useTurn = true; item.knockBack = 9.5f; @@ -86,14 +86,14 @@ namespace CalamityMod.Items.Weapons.Melee float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; 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 (target.type == NPCID.TargetDummy || !target.canGhostHeal) - { - return; - } if (Main.rand.NextBool(2)) { target.defense -= 50; } + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) + { + return; + } int heal = Main.rand.Next(1, 69); player.statLife += heal; player.HealEffect(heal); @@ -145,6 +145,8 @@ namespace CalamityMod.Items.Weapons.Melee float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } + if (player.moonLeech) + return; int heal = Main.rand.Next(1, 69); player.statLife += heal; player.HealEffect(heal); diff --git a/Items/Weapons/Melee/EarthenPike.cs b/Items/Weapons/Melee/EarthenPike.cs index fc81f15ceb..c805164c20 100644 --- a/Items/Weapons/Melee/EarthenPike.cs +++ b/Items/Weapons/Melee/EarthenPike.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 25; item.knockBack = 7f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index 3ef670429d..3dffa266cc 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = BaseDamage; item.crit += 10; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.useTurn = true; item.melee = true; @@ -63,16 +63,13 @@ namespace CalamityMod.Items.Weapons.Melee return false; } - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) { if (player.altFunctionUse == 2) { - item.shoot = 0; + item.shoot = ProjectileID.None; item.shootSpeed = 0f; } else @@ -157,7 +154,7 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.Ichor, 240); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -177,6 +174,8 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.Ichor, 240); + if (player.moonLeech) + return; int healAmount = Main.rand.Next(10) + 10; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/ElementalShortsword.cs b/Items/Weapons/Melee/ElementalShortsword.cs index bdaadec96f..98bc836fdb 100644 --- a/Items/Weapons/Melee/ElementalShortsword.cs +++ b/Items/Weapons/Melee/ElementalShortsword.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 10; item.useTime = 10; diff --git a/Items/Weapons/Melee/EmpyreanKnives.cs b/Items/Weapons/Melee/EmpyreanKnives.cs index 279009840b..d2b4690363 100644 --- a/Items/Weapons/Melee/EmpyreanKnives.cs +++ b/Items/Weapons/Melee/EmpyreanKnives.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 3f; item.UseSound = SoundID.Item39; diff --git a/Items/Weapons/Melee/EradicatorMelee.cs b/Items/Weapons/Melee/EradicatorMelee.cs index 31f6afb425..2a6563425c 100644 --- a/Items/Weapons/Melee/EradicatorMelee.cs +++ b/Items/Weapons/Melee/EradicatorMelee.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.knockBack = 7f; item.UseSound = SoundID.Item1; @@ -36,13 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Vector2 origin = new Vector2(31f, 29f); diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index 8618e64136..03438002ab 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 450; item.melee = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/EutrophicScimitar.cs b/Items/Weapons/Melee/EutrophicScimitar.cs index 907f8f29c2..6ee823c34f 100644 --- a/Items/Weapons/Melee/EutrophicScimitar.cs +++ b/Items/Weapons/Melee/EutrophicScimitar.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 78; item.useTime = 38; item.useAnimation = 38; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 2; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 17; diff --git a/Items/Weapons/Melee/EutrophicShank.cs b/Items/Weapons/Melee/EutrophicShank.cs index acb3e6bcd4..1bba054bde 100644 --- a/Items/Weapons/Melee/EutrophicShank.cs +++ b/Items/Weapons/Melee/EutrophicShank.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 14; item.useTime = 14; diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index a9a000ac7c..2617c8eca1 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 55; item.melee = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/ExcaliburShortsword.cs b/Items/Weapons/Melee/ExcaliburShortsword.cs index e99e7927fe..801a4024ad 100644 --- a/Items/Weapons/Melee/ExcaliburShortsword.cs +++ b/Items/Weapons/Melee/ExcaliburShortsword.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 10; item.useTime = 10; diff --git a/Items/Weapons/Melee/Excelsus.cs b/Items/Weapons/Melee/Excelsus.cs index 0e785ce60d..45191fba72 100644 --- a/Items/Weapons/Melee/Excelsus.cs +++ b/Items/Weapons/Melee/Excelsus.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 340; item.melee = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs index ae76d02137..543f56e7e1 100644 --- a/Items/Weapons/Melee/ExoGladius.cs +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 12; item.useTime = 12; diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index 838bf0e9f9..e0bd75f771 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 22; item.knockBack = 6.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/FeralthornClaymore.cs b/Items/Weapons/Melee/FeralthornClaymore.cs index ec4ee53216..9d24a0b22f 100644 --- a/Items/Weapons/Melee/FeralthornClaymore.cs +++ b/Items/Weapons/Melee/FeralthornClaymore.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 63; item.melee = true; item.useAnimation = 13; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.useTurn = true; item.knockBack = 7.25f; diff --git a/Items/Weapons/Melee/FlameScytheMelee.cs b/Items/Weapons/Melee/FlameScytheMelee.cs index 5ded2dbf1f..e5abf72199 100644 --- a/Items/Weapons/Melee/FlameScytheMelee.cs +++ b/Items/Weapons/Melee/FlameScytheMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; @@ -35,13 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 16f; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/FlameburstShortsword.cs b/Items/Weapons/Melee/FlameburstShortsword.cs index 1065f8462f..d22f20615d 100644 --- a/Items/Weapons/Melee/FlameburstShortsword.cs +++ b/Items/Weapons/Melee/FlameburstShortsword.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 15; item.useTime = 15; diff --git a/Items/Weapons/Melee/FlarefrostBlade.cs b/Items/Weapons/Melee/FlarefrostBlade.cs index 7493f962a6..f4060cc88d 100644 --- a/Items/Weapons/Melee/FlarefrostBlade.cs +++ b/Items/Weapons/Melee/FlarefrostBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 24; item.useTime = 24; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index c62bf2d458..c7b129b64f 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.useAnimation = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index 5bdae7c940..0a0e834e27 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -17,17 +17,17 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 76; + item.width = 74; + item.height = 74; item.damage = 64; item.melee = true; item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 76; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/ForbiddenOathblade.png b/Items/Weapons/Melee/ForbiddenOathblade.png index a0705d7c37..ae681cfcb3 100644 Binary files a/Items/Weapons/Melee/ForbiddenOathblade.png and b/Items/Weapons/Melee/ForbiddenOathblade.png differ diff --git a/Items/Weapons/Melee/ForsakenSaber.cs b/Items/Weapons/Melee/ForsakenSaber.cs index de304b98f0..788a1d6090 100644 --- a/Items/Weapons/Melee/ForsakenSaber.cs +++ b/Items/Weapons/Melee/ForsakenSaber.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 65; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 6; diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 154957f3de..6ba6cbdd1b 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 17; item.useTime = 17; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 9; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index 016a11e406..dec29f09b8 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 53; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 5f; @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.autoReuse = false; item.shoot = ModContent.ProjectileType(); } @@ -53,9 +53,9 @@ namespace CalamityMod.Items.Weapons.Melee { item.noMelee = false; item.noUseGraphic = false; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.autoReuse = true; - item.shoot = 0; + item.shoot = ProjectileID.None; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 09d39e5921..b1e3f5aa89 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Melee; -using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; @@ -9,7 +8,7 @@ using Terraria.World.Generation; namespace CalamityMod.Items.Weapons.Melee { - public class GaelsGreatsword : ModItem + public class GaelsGreatsword : ModItem { //Help, they're forcing me to slave away at Calamity until I die! - Dominic @@ -133,7 +132,7 @@ namespace CalamityMod.Items.Weapons.Melee } if (Main.netMode == NetmodeID.Server) { - var netMessage = CalamityMod.instance.GetPacket(); + var netMessage = CalamityMod.Instance.GetPacket(); netMessage.Write((byte)CalamityModMessageType.GaelsGreatswordSwingSync); netMessage.Write((byte)player.whoAmI); netMessage.Write(player.Calamity().gaelSwipes); diff --git a/Items/Weapons/Melee/GalacticaBlade.cs b/Items/Weapons/Melee/GalacticaBlade.cs index 0dea32d88c..cfc875183d 100644 --- a/Items/Weapons/Melee/GalacticaBlade.cs +++ b/Items/Weapons/Melee/GalacticaBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 110; item.melee = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.useTurn = true; item.knockBack = 6f; diff --git a/Items/Weapons/Melee/GalaxySmasherMelee.cs b/Items/Weapons/Melee/GalaxySmasherMelee.cs index 3c7b87bc71..1953455a5e 100644 --- a/Items/Weapons/Melee/GalaxySmasherMelee.cs +++ b/Items/Weapons/Melee/GalaxySmasherMelee.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; diff --git a/Items/Weapons/Melee/GalileoGladius.cs b/Items/Weapons/Melee/GalileoGladius.cs index d0238f7842..ac9aac6711 100644 --- a/Items/Weapons/Melee/GalileoGladius.cs +++ b/Items/Weapons/Melee/GalileoGladius.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 10; item.useTime = 10; diff --git a/Items/Weapons/Melee/GeliticBlade.cs b/Items/Weapons/Melee/GeliticBlade.cs index a0c38d5e50..0e6388920d 100644 --- a/Items/Weapons/Melee/GeliticBlade.cs +++ b/Items/Weapons/Melee/GeliticBlade.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 30; item.useTime = 30; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 1f80a37c3c..4e275e09ff 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 19; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 19; item.knockBack = 8.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/GlacialCrusher.cs b/Items/Weapons/Melee/GlacialCrusher.cs index 99ca2a4169..d93d32f2a5 100644 --- a/Items/Weapons/Melee/GlacialCrusher.cs +++ b/Items/Weapons/Melee/GlacialCrusher.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 27; item.useTime = 27; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/GoldplumeSpear.cs b/Items/Weapons/Melee/GoldplumeSpear.cs index b60316f56c..9a521df477 100644 --- a/Items/Weapons/Melee/GoldplumeSpear.cs +++ b/Items/Weapons/Melee/GoldplumeSpear.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 23; item.knockBack = 5.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs index 3ea14221fb..de8dd329ad 100644 --- a/Items/Weapons/Melee/GrandDad.cs +++ b/Items/Weapons/Melee/GrandDad.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 777; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.useTurn = true; item.knockBack = 77f; diff --git a/Items/Weapons/Melee/GrandGuardian.cs b/Items/Weapons/Melee/GrandGuardian.cs index 7aef9f9409..f2a640c604 100644 --- a/Items/Weapons/Melee/GrandGuardian.cs +++ b/Items/Weapons/Melee/GrandGuardian.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 150; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 8.5f; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee { target.defense -= 15; } - if (target.defense <= 0 && target.canGhostHeal) + if (target.defense <= 0 && target.canGhostHeal && !player.moonLeech) { player.statLife += 4; player.HealEffect(4); @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), knockback, player.whoAmI); Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)((float)item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), knockback, player.whoAmI); } - if (target.life <= 0) + if (target.life <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(9); float randomSpeedY = (float)Main.rand.Next(6, 15); @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), item.knockBack, player.whoAmI); Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)((float)item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), item.knockBack, player.whoAmI); } - if (target.statLife <= 0) + if (target.statLife <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(9); float randomSpeedY = (float)Main.rand.Next(6, 15); diff --git a/Items/Weapons/Melee/GreatswordofBlah.cs b/Items/Weapons/Melee/GreatswordofBlah.cs index 3723ad07b5..0ec76c9d6f 100644 --- a/Items/Weapons/Melee/GreatswordofBlah.cs +++ b/Items/Weapons/Melee/GreatswordofBlah.cs @@ -21,17 +21,16 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 110; + item.width = item.height = 102; item.damage = 300; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 7f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 110; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/GreatswordofBlah.png b/Items/Weapons/Melee/GreatswordofBlah.png index 9dbb9c816e..03444ed9d3 100644 Binary files a/Items/Weapons/Melee/GreatswordofBlah.png and b/Items/Weapons/Melee/GreatswordofBlah.png differ diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index 2fc24cb7d6..505cbe23f6 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 60; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 7f; diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index e461536704..d2b8c3c049 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class Greentide : ModItem + public class Greentide : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 24; item.useAnimation = 24; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; diff --git a/Items/Weapons/Melee/HellfireFlamberge.cs b/Items/Weapons/Melee/HellfireFlamberge.cs index 1423a1a1a6..d394a1ad1c 100644 --- a/Items/Weapons/Melee/HellfireFlamberge.cs +++ b/Items/Weapons/Melee/HellfireFlamberge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 90; item.melee = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.useTurn = true; item.knockBack = 7.75f; @@ -36,7 +36,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) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 20); + Main.PlaySound(SoundID.Item20, player.position); for (int index = 0; index < 3; ++index) { float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f; diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index c261d3e6e6..bafef201d8 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index c93dfd9550..481d157a65 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 100; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/HolidayHalberd.cs b/Items/Weapons/Melee/HolidayHalberd.cs index 18f62bf8d4..1657fe4757 100644 --- a/Items/Weapons/Melee/HolidayHalberd.cs +++ b/Items/Weapons/Melee/HolidayHalberd.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 98; item.melee = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.useTurn = true; item.knockBack = 7.5f; diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index 39ec83b7dd..6c2242bb99 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 400; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 7.75f; @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); + Main.PlaySound(SoundID.Item14, player.position); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 2f); @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); + Main.PlaySound(SoundID.Item14, player.position); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 2f); diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 82ca44962d..1c6669f6f7 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class InsidiousImpaler : ModItem + public class InsidiousImpaler : ModItem { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.cs b/Items/Weapons/Melee/KelvinCatalystMelee.cs index 4141e27668..cbc7739b66 100644 --- a/Items/Weapons/Melee/KelvinCatalystMelee.cs +++ b/Items/Weapons/Melee/KelvinCatalystMelee.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.knockBack = 4f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index 5ac2723a06..f473722f4d 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/LeechingDagger.cs b/Items/Weapons/Melee/LeechingDagger.cs index a8feaf0068..d753a621fb 100644 --- a/Items/Weapons/Melee/LeechingDagger.cs +++ b/Items/Weapons/Melee/LeechingDagger.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 15; item.useTime = 15; diff --git a/Items/Weapons/Melee/LifefruitScythe.cs b/Items/Weapons/Melee/LifefruitScythe.cs index 4bd35bc74d..49797fa2eb 100644 --- a/Items/Weapons/Melee/LifefruitScythe.cs +++ b/Items/Weapons/Melee/LifefruitScythe.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 250; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 7.5f; @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -64,6 +64,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (player.moonLeech) + return; player.statLife += 5; player.HealEffect(5); } diff --git a/Items/Weapons/Melee/LionHeart.cs b/Items/Weapons/Melee/LionHeart.cs index 83c22f596b..ab70b17bb0 100644 --- a/Items/Weapons/Melee/LionHeart.cs +++ b/Items/Weapons/Melee/LionHeart.cs @@ -1,14 +1,13 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class LionHeart : ModItem + public class LionHeart : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 700; item.knockBack = 5.5f; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 15; item.useTime = 15; item.shootSpeed = 0f; @@ -50,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee } else { - item.shoot = 0; + item.shoot = ProjectileID.None; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Melee/Lucrecia.cs b/Items/Weapons/Melee/Lucrecia.cs index ea219d9bd8..0eec0dd93f 100644 --- a/Items/Weapons/Melee/Lucrecia.cs +++ b/Items/Weapons/Melee/Lucrecia.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 25; item.useTime = 25; diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index 3e25680803..71889588be 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 60; item.melee = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.useTurn = true; item.knockBack = 7.5f; @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee target.defense -= 10; // Healing effect does not trigger versus dummies - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || player.moonLeech) return; if (target.defense <= 0 && target.canGhostHeal) diff --git a/Items/Weapons/Melee/MandibleClaws.cs b/Items/Weapons/Melee/MandibleClaws.cs index ba3303b8ca..e321cb025a 100644 --- a/Items/Weapons/Melee/MandibleClaws.cs +++ b/Items/Weapons/Melee/MandibleClaws.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 14; item.melee = true; item.useAnimation = 6; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 6; item.useTurn = true; item.knockBack = 3.5f; diff --git a/Items/Weapons/Melee/MangroveChakramMelee.cs b/Items/Weapons/Melee/MangroveChakramMelee.cs index b2c51b0be1..c0be4942a7 100644 --- a/Items/Weapons/Melee/MangroveChakramMelee.cs +++ b/Items/Weapons/Melee/MangroveChakramMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; @@ -34,13 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 16f; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/MantisClaws.cs b/Items/Weapons/Melee/MantisClaws.cs index c03cb1c42c..a999aa626d 100644 --- a/Items/Weapons/Melee/MantisClaws.cs +++ b/Items/Weapons/Melee/MantisClaws.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 120; item.melee = true; item.useAnimation = 6; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 6; item.useTurn = true; item.knockBack = 7f; diff --git a/Items/Weapons/Melee/Mariana.cs b/Items/Weapons/Melee/Mariana.cs index 0693c85d9e..0d0c869f39 100644 --- a/Items/Weapons/Melee/Mariana.cs +++ b/Items/Weapons/Melee/Mariana.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 62; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.useTurn = true; item.knockBack = 6.5f; diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 4cbf780e06..830da229cf 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 21; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/MirrorBlade.cs b/Items/Weapons/Melee/MirrorBlade.cs index 1714a27389..13cadae545 100644 --- a/Items/Weapons/Melee/MirrorBlade.cs +++ b/Items/Weapons/Melee/MirrorBlade.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 12; item.useTime = 12; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/MonstrousKnives.cs b/Items/Weapons/Melee/MonstrousKnives.cs index b0f22ac525..35800a9933 100644 --- a/Items/Weapons/Melee/MonstrousKnives.cs +++ b/Items/Weapons/Melee/MonstrousKnives.cs @@ -1,14 +1,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class MonstrousKnives : ModItem + public class MonstrousKnives : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Melee/Mourningstar.cs b/Items/Weapons/Melee/Mourningstar.cs index b225ad82c4..65bb92e1c4 100644 --- a/Items/Weapons/Melee/Mourningstar.cs +++ b/Items/Weapons/Melee/Mourningstar.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; -using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class Mourningstar : ModItem + public class Mourningstar : ModItem { public override void SetStaticDefaults() { @@ -28,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useAnimation = 10; item.useTime = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2.5f; item.UseSound = SoundID.Item116; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 88e6769f96..96056ec929 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -4,85 +4,85 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.Weapons.Melee { - public class Murasama : ModItem - { - private int frameCounter = 0; - private int frame = 0; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Murasama"); - Tooltip.SetDefault("There will be blood!\n" + - "ID and power-level locked\n" + - "Prove your strength or have the correct user ID to wield this sword"); - } + public class Murasama : ModItem + { + private int frameCounter = 0; + private int frame = 0; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Murasama"); + Tooltip.SetDefault("There will be blood!\n" + + "ID and power-level locked\n" + + "Prove your strength or have the correct user ID to wield this sword"); + } - public override void SetDefaults() - { - item.height = 128; - item.width = 56; - item.damage = 999; - item.crit += 30; - item.melee = true; - item.noMelee = true; - item.noUseGraphic = true; - item.channel = true; - item.useAnimation = 25; - item.useStyle = 5; - item.useTime = 5; - item.knockBack = 6.5f; - item.autoReuse = false; - item.value = Item.buyPrice(2, 50, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 24f; - item.Calamity().customRarity = CalamityRarity.Violet; - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 14)); - } + public override void SetDefaults() + { + item.height = 128; + item.width = 56; + item.damage = 20001; + item.crit += 30; + item.melee = true; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.useAnimation = 25; + item.useStyle = ItemUseStyleID.HoldingOut; + item.useTime = 5; + item.knockBack = 6.5f; + item.autoReuse = false; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 24f; + item.Calamity().customRarity = CalamityRarity.Violet; + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 14)); + } - private Rectangle getCurrentFrame() - { - //0 = 6 frames, 8 = 3 frames] - int applicableCounter = frame == 0 ? 36 : frame == 8 ? 24 : 6; - - if (frameCounter >= applicableCounter) - { - frameCounter = -1; - frame = frame == 13 ? 0 : frame + 1; - } + internal Rectangle GetCurrentFrame() + { + //0 = 6 frames, 8 = 3 frames] + int applicableCounter = frame == 0 ? 36 : frame == 8 ? 24 : 6; + + if (frameCounter >= applicableCounter) + { + frameCounter = -1; + frame = frame == 13 ? 0 : frame + 1; + } + frameCounter++; + return new Rectangle(0, item.height * frame, item.width, item.height); + } - if (!Main.gamePaused) - { - frameCounter++; - } - return new Rectangle(0, item.height * frame, item.width, item.height); - } + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + Texture2D texture = ModContent.GetTexture(Texture); + spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + return false; + } - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D tex = ModContent.GetTexture(Texture); - spriteBatch.Draw(tex, position, getCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); - return false; - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture(Texture); + spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } - public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) - { - Texture2D tex = ModContent.GetTexture(Texture); - spriteBatch.Draw(tex, item.position - Main.screenPosition + new Vector2(), getCurrentFrame(), Color.White, 0f, new Vector2(), 1f, SpriteEffects.None, 0); - return false; - } + public override bool CanUseItem(Player player) + { + if (player.ownedProjectileCounts[item.shoot] > 0) + return false; + return CalamityWorld.downedYharon || player.name == "Sam" || player.name == "Samuel Rodrigues"; + } - public override bool CanUseItem(Player player) - { - return CalamityWorld.downedYharon || player.name == "Sam" || player.name == "Samuel Rodrigues"; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } } diff --git a/Items/Weapons/Melee/MycelialClaws.cs b/Items/Weapons/Melee/MycelialClaws.cs index 48ebf9f227..a45636ce4b 100644 --- a/Items/Weapons/Melee/MycelialClaws.cs +++ b/Items/Weapons/Melee/MycelialClaws.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 14; item.melee = true; item.useAnimation = 6; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 6; item.useTurn = true; item.knockBack = 3.75f; diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index 978f6640e9..da7b2637e4 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Melee { public class Nadir : ModItem { - public static int BaseDamage = 800; + public static int BaseDamage = 700; public static float ShootSpeed = 12f; public override void SetStaticDefaults() @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.noMelee = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.rare = 10; diff --git a/Items/Weapons/Melee/NanoblackReaperMelee.cs b/Items/Weapons/Melee/NanoblackReaperMelee.cs index 1b869aecba..5332cf626b 100644 --- a/Items/Weapons/Melee/NanoblackReaperMelee.cs +++ b/Items/Weapons/Melee/NanoblackReaperMelee.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item18; item.rare = 10; diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index 8bd1bc30e5..17e5b3f214 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useAnimation = 18; item.useTime = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2f; item.UseSound = SoundID.Item117; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Melee/NeptunesBounty.cs b/Items/Weapons/Melee/NeptunesBounty.cs index 436b2c29d3..12435c830a 100644 --- a/Items/Weapons/Melee/NeptunesBounty.cs +++ b/Items/Weapons/Melee/NeptunesBounty.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.useTime = 22; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 9f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/NightsStabber.cs b/Items/Weapons/Melee/NightsStabber.cs index e9c167dec8..445f576ddf 100644 --- a/Items/Weapons/Melee/NightsStabber.cs +++ b/Items/Weapons/Melee/NightsStabber.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 15; item.useTime = 15; diff --git a/Items/Weapons/Melee/OldLordOathsword.cs b/Items/Weapons/Melee/OldLordOathsword.cs index df9a014864..9a7ddea88c 100644 --- a/Items/Weapons/Melee/OldLordOathsword.cs +++ b/Items/Weapons/Melee/OldLordOathsword.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.damage = 34; - item.width = 78; - item.height = 78; + item.width = 70; + item.height = 70; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.useTurn = true; item.knockBack = 7f; diff --git a/Items/Weapons/Melee/OldLordOathsword.png b/Items/Weapons/Melee/OldLordOathsword.png index c9ce86acec..9326b47f1e 100644 Binary files a/Items/Weapons/Melee/OldLordOathsword.png and b/Items/Weapons/Melee/OldLordOathsword.png differ diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index 2c4bb8a4b7..cff0e16ea8 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 18; item.useTime = 18; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 4261451c30..aad75f2df4 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.crit += 45; item.melee = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.useTurn = true; item.knockBack = 6f; diff --git a/Items/Weapons/Melee/Oracle.cs b/Items/Weapons/Melee/Oracle.cs index 747dfefd44..4855ab593d 100644 --- a/Items/Weapons/Melee/Oracle.cs +++ b/Items/Weapons/Melee/Oracle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/PerfectDark.cs b/Items/Weapons/Melee/PerfectDark.cs index 2921616f43..901a31e9f1 100644 --- a/Items/Weapons/Melee/PerfectDark.cs +++ b/Items/Weapons/Melee/PerfectDark.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 22; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.useTurn = true; item.knockBack = 4.25f; diff --git a/Items/Weapons/Melee/PhoenixBlade.cs b/Items/Weapons/Melee/PhoenixBlade.cs index 7998b627e0..7a16c00a43 100644 --- a/Items/Weapons/Melee/PhoenixBlade.cs +++ b/Items/Weapons/Melee/PhoenixBlade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 120; item.melee = true; item.useAnimation = 27; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 27; item.useTurn = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/PlagueKeeper.cs b/Items/Weapons/Melee/PlagueKeeper.cs index 7e15c95487..79ec5adbf0 100644 --- a/Items/Weapons/Melee/PlagueKeeper.cs +++ b/Items/Weapons/Melee/PlagueKeeper.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 80; item.melee = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.useTurn = true; item.knockBack = 6f; diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 63586c1f30..fb0ec5f0da 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -53,11 +53,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 400; + item.damage = 1200; item.crit += 8; - item.useAnimation = 15; item.useStyle = 1; - item.useTime = 15; + item.useTime = item.useAnimation = 15; item.useTurn = true; item.melee = true; item.knockBack = 7f; @@ -91,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage * 2, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 1), knockBack, player.whoAmI, 0f, 0f); } else { diff --git a/Items/Weapons/Melee/ProfanedSword.cs b/Items/Weapons/Melee/ProfanedSword.cs index 11c8f3325d..6ed2429af9 100644 --- a/Items/Weapons/Melee/ProfanedSword.cs +++ b/Items/Weapons/Melee/ProfanedSword.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.useAnimation = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.noMelee = false; item.noUseGraphic = false; - item.shoot = 0; + item.shoot = ProjectileID.None; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Melee/PwnagehammerMelee.cs b/Items/Weapons/Melee/PwnagehammerMelee.cs index 60f28b067f..357ec3a8dc 100644 --- a/Items/Weapons/Melee/PwnagehammerMelee.cs +++ b/Items/Weapons/Melee/PwnagehammerMelee.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 10f; item.UseSound = SoundID.Item1; @@ -34,13 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 12f; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/Quagmire.cs b/Items/Weapons/Melee/Quagmire.cs index bd2ecd28a2..38902118c6 100644 --- a/Items/Weapons/Melee/Quagmire.cs +++ b/Items/Weapons/Melee/Quagmire.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index 5297863e9e..b82929fc9e 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.reuseDelay = 20; item.useAnimation = 30; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/RedtideSword.cs b/Items/Weapons/Melee/RedtideSword.cs index 98b7af3eb5..e13aed66fa 100644 --- a/Items/Weapons/Melee/RedtideSword.cs +++ b/Items/Weapons/Melee/RedtideSword.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 20; item.melee = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.useTurn = true; item.knockBack = 4; diff --git a/Items/Weapons/Melee/Roxcalibur.cs b/Items/Weapons/Melee/Roxcalibur.cs index 243fe4e424..1956ae9588 100644 --- a/Items/Weapons/Melee/Roxcalibur.cs +++ b/Items/Weapons/Melee/Roxcalibur.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 13; item.crit += 8; item.melee = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.NPCHit42; item.width = 80; item.height = 80; @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Melee Main.dust[d].noGravity = true; Main.dust[d].position = player.Center; } - Main.PlaySound(2, player.position, 70); + Main.PlaySound(SoundID.Item70, player.position); } // Resets the weapon usage if the alt fire collides with the ground if (RoxAlt && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) @@ -118,14 +118,14 @@ namespace CalamityMod.Items.Weapons.Melee { player.itemLocation.X -= 32f * player.direction; player.itemLocation.Y -= 60f; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; RoxAlt = true; } //Modifies to use style and hold out of the main fire mode else { player.itemLocation += new Vector2(-7.5f * player.direction, 8.5f * player.gravDir).RotatedBy(player.itemRotation); - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; RoxAlt = false; } } @@ -207,7 +207,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) { - if (item.useStyle == 4) + if (item.useStyle == ItemUseStyleID.HoldingUp) { //Spawns a projectile on the tip of the sword in the alt fire float positionx; @@ -255,7 +255,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { - if (item.useStyle == 4) + if (item.useStyle == ItemUseStyleID.HoldingUp) { if (player.whoAmI == Main.myPlayer) { @@ -278,7 +278,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (item.useStyle == 4) + if (item.useStyle == ItemUseStyleID.HoldingUp) { if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index c502b927d9..fc6cabc9ce 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 3f; item.UseSound = SoundID.Item39; diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index 97f9d5e6b0..03528cd944 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index c5112d6e8a..543a96349d 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -19,12 +19,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 18; - item.damage = 1550; + item.damage = 1300; item.melee = true; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 5f; item.UseSound = SoundID.Item109; diff --git a/Items/Weapons/Melee/SeashellBoomerangMelee.cs b/Items/Weapons/Melee/SeashellBoomerangMelee.cs index 79febc672a..d226d3ca7a 100644 --- a/Items/Weapons/Melee/SeashellBoomerangMelee.cs +++ b/Items/Weapons/Melee/SeashellBoomerangMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 5.5f; item.UseSound = SoundID.Item1; @@ -33,13 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 11.5f; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/Shimmerspark.cs b/Items/Weapons/Melee/Shimmerspark.cs index c303468917..783b48dc67 100644 --- a/Items/Weapons/Melee/Shimmerspark.cs +++ b/Items/Weapons/Melee/Shimmerspark.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/SolarFlare.cs b/Items/Weapons/Melee/SolarFlare.cs index 266c7959af..f99be3b328 100644 --- a/Items/Weapons/Melee/SolarFlare.cs +++ b/Items/Weapons/Melee/SolarFlare.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/SolsticeClaymore.cs b/Items/Weapons/Melee/SolsticeClaymore.cs index 5d9a48ade3..da9697e8bd 100644 --- a/Items/Weapons/Melee/SolsticeClaymore.cs +++ b/Items/Weapons/Melee/SolsticeClaymore.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 520; item.melee = true; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 16; item.useTurn = true; item.knockBack = 6.5f; diff --git a/Items/Weapons/Melee/SolsticeClaymore.png b/Items/Weapons/Melee/SolsticeClaymore.png index becb3b8406..3063428cd6 100644 Binary files a/Items/Weapons/Melee/SolsticeClaymore.png and b/Items/Weapons/Melee/SolsticeClaymore.png differ diff --git a/Items/Weapons/Melee/SoulEdge.cs b/Items/Weapons/Melee/SoulEdge.cs index 8705a97247..875f594be7 100644 --- a/Items/Weapons/Melee/SoulEdge.cs +++ b/Items/Weapons/Melee/SoulEdge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 365; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 5.5f; diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 0c493eb12e..15200cba64 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 98; item.melee = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.useTurn = true; item.knockBack = 7.5f; @@ -58,10 +58,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.CursedInferno, 120); if (target.life <= (target.lifeMax * 0.15f)) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); + Main.PlaySound(SoundID.Item14, target.position); // DEFECT -- HiveBombExplosion does not exist. // Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), knockback, Main.myPlayer); @@ -90,10 +90,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.CursedInferno, 120); if (target.statLife <= (target.statLifeMax * 0.15f)) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 14); + Main.PlaySound(SoundID.Item14, target.position); // DEFECT -- HiveBombExplosion does not exist. // Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, Main.myPlayer); diff --git a/Items/Weapons/Melee/SpatialLance.cs b/Items/Weapons/Melee/SpatialLance.cs index 348dfe9479..ac33398c35 100644 --- a/Items/Weapons/Melee/SpatialLance.cs +++ b/Items/Weapons/Melee/SpatialLance.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 30; item.knockBack = 9.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/SporeKnife.cs b/Items/Weapons/Melee/SporeKnife.cs index 83b0f57f32..feb2b1eb20 100644 --- a/Items/Weapons/Melee/SporeKnife.cs +++ b/Items/Weapons/Melee/SporeKnife.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 12; item.useTime = 12; diff --git a/Items/Weapons/Melee/StarnightLance.cs b/Items/Weapons/Melee/StarnightLance.cs index 737ffef31d..0d710c75aa 100644 --- a/Items/Weapons/Melee/StarnightLance.cs +++ b/Items/Weapons/Melee/StarnightLance.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 23; item.knockBack = 6; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/StellarContemptMelee.cs b/Items/Weapons/Melee/StellarContemptMelee.cs index 49ab290972..cbaa7639c5 100644 --- a/Items/Weapons/Melee/StellarContemptMelee.cs +++ b/Items/Weapons/Melee/StellarContemptMelee.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index b9f097c495..aad8f52610 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 640; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.useTurn = true; item.knockBack = 7.75f; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee { return; } - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 88); + Main.PlaySound(SoundID.Item88, player.position); int i = Main.myPlayer; float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 88); + Main.PlaySound(SoundID.Item88, player.position); int i = Main.myPlayer; float num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Melee/StormRuler.cs b/Items/Weapons/Melee/StormRuler.cs index 44889f4bbf..ecd1264918 100644 --- a/Items/Weapons/Melee/StormRuler.cs +++ b/Items/Weapons/Melee/StormRuler.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index 9f71a449b8..3afea0d9e3 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 23; item.useTime = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index 19c411dd09..4ab2194d10 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 19; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 19; item.knockBack = 9.75f; item.UseSound = SoundID.Item20; diff --git a/Items/Weapons/Melee/SubmarineShocker.cs b/Items/Weapons/Melee/SubmarineShocker.cs index 8ea6eb405e..1c1e3249c6 100644 --- a/Items/Weapons/Melee/SubmarineShocker.cs +++ b/Items/Weapons/Melee/SubmarineShocker.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 10; item.useTime = 10; diff --git a/Items/Weapons/Melee/SulphurousGrabber.cs b/Items/Weapons/Melee/SulphurousGrabber.cs index c9d64b577d..e03e4d6b21 100644 --- a/Items/Weapons/Melee/SulphurousGrabber.cs +++ b/Items/Weapons/Melee/SulphurousGrabber.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index 5f1b235dfe..fd2a34ecaa 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 30; item.useTime = 30; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 15f; item.UseSound = SoundID.Item60; item.autoReuse = true; diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index 05d8907c4f..734d625898 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 18; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.useTurn = true; item.knockBack = 4.5f; diff --git a/Items/Weapons/Melee/TemporalFloeSword.cs b/Items/Weapons/Melee/TemporalFloeSword.cs index 339acd5767..f60bd4a45f 100644 --- a/Items/Weapons/Melee/TemporalFloeSword.cs +++ b/Items/Weapons/Melee/TemporalFloeSword.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 95; item.melee = true; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 16; item.useTurn = true; item.knockBack = 6; diff --git a/Items/Weapons/Melee/TenebreusTides.cs b/Items/Weapons/Melee/TenebreusTides.cs index 4aa3fc0331..d4b147c54b 100644 --- a/Items/Weapons/Melee/TenebreusTides.cs +++ b/Items/Weapons/Melee/TenebreusTides.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 75; + item.damage = 80; item.knockBack = 4.5f; item.melee = true; - item.useAnimation = item.useTime = 15; + item.useAnimation = item.useTime = 14; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Melee/TerraDiskMelee.cs b/Items/Weapons/Melee/TerraDiskMelee.cs index 83ff1603bd..cdcfb0e8b1 100644 --- a/Items/Weapons/Melee/TerraDiskMelee.cs +++ b/Items/Weapons/Melee/TerraDiskMelee.cs @@ -32,7 +32,7 @@ A max of three disks can be active at a time"); item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Melee/TerraEdge.cs b/Items/Weapons/Melee/TerraEdge.cs index b37082e869..d3451bfce9 100644 --- a/Items/Weapons/Melee/TerraEdge.cs +++ b/Items/Weapons/Melee/TerraEdge.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 112; item.melee = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.useTurn = true; item.knockBack = 6.25f; @@ -69,7 +69,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(BuffID.Ichor, 120); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -80,6 +81,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + target.AddBuff(BuffID.Ichor, 120); + if (player.moonLeech) + return; int healAmount = Main.rand.Next(2) + 2; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/TerraLance.cs b/Items/Weapons/Melee/TerraLance.cs index c1a9e4bbc0..7355f241e1 100644 --- a/Items/Weapons/Melee/TerraLance.cs +++ b/Items/Weapons/Melee/TerraLance.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 17; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 17; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TerraShiv.cs b/Items/Weapons/Melee/TerraShiv.cs index b36c56ad4d..4a39609a7a 100644 --- a/Items/Weapons/Melee/TerraShiv.cs +++ b/Items/Weapons/Melee/TerraShiv.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 13; item.useTime = 13; diff --git a/Items/Weapons/Melee/Terracotta.cs b/Items/Weapons/Melee/Terracotta.cs index 4cf8b287e6..8613959193 100644 --- a/Items/Weapons/Melee/Terracotta.cs +++ b/Items/Weapons/Melee/Terracotta.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 17; item.useTime = 17; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 9fab60c74f..8f60a38641 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee DisplayName.SetDefault("Terratomere"); Tooltip.SetDefault("Linked to the essence of Terraria\n" + "Heals the player on true melee hits\n" + - "Fires a barrage of homing beams that inflict several debuffs"); + "Fires a barrage of homing beams that freeze enemies"); } public override void SetDefaults() @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 125; item.melee = true; item.useAnimation = 21; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 21; item.useTurn = true; item.knockBack = 7f; @@ -83,15 +83,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 300); - } - target.AddBuff(BuffID.CursedInferno, 600); - target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Ichor, 300); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 120); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -102,14 +95,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (Main.rand.NextBool(3)) - { - target.AddBuff(ModContent.BuffType(), 300); - } - target.AddBuff(BuffID.CursedInferno, 600); - target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.Ichor, 300); + target.AddBuff(ModContent.BuffType(), 120); + if (player.moonLeech) + return; int healAmount = Main.rand.Next(3) + 2; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/TerrorBlade.cs b/Items/Weapons/Melee/TerrorBlade.cs index e3cbcf53f9..593b852799 100644 --- a/Items/Weapons/Melee/TerrorBlade.cs +++ b/Items/Weapons/Melee/TerrorBlade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 18; item.useTime = 18; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index 3c7e3163a9..134ba00dc2 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useTime = 5; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = true; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TheEnforcer.cs b/Items/Weapons/Melee/TheEnforcer.cs index eaf6807a58..01e7eebf04 100644 --- a/Items/Weapons/Melee/TheEnforcer.cs +++ b/Items/Weapons/Melee/TheEnforcer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 1900; item.melee = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.useTurn = true; item.knockBack = 9f; @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 73); + Main.PlaySound(SoundID.Item73, player.position); int i = Main.myPlayer; float num72 = 6f; float num74 = 7f; @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 73); + Main.PlaySound(SoundID.Item73, player.position); int i = Main.myPlayer; float num72 = 6f; float num74 = 7f; diff --git a/Items/Weapons/Melee/TheEyeofCalamitas.cs b/Items/Weapons/Melee/TheEyeofCalamitas.cs index 8f21300764..d03fbc0b6b 100644 --- a/Items/Weapons/Melee/TheEyeofCalamitas.cs +++ b/Items/Weapons/Melee/TheEyeofCalamitas.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index b4860c4b8e..2719abf18d 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 21; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/TheLastMourning.cs b/Items/Weapons/Melee/TheLastMourning.cs index d0815c3c7c..70975ce34b 100644 --- a/Items/Weapons/Melee/TheLastMourning.cs +++ b/Items/Weapons/Melee/TheLastMourning.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; diff --git a/Items/Weapons/Melee/TheMicrowave.cs b/Items/Weapons/Melee/TheMicrowave.cs index 8d5eb11ed0..779e884570 100644 --- a/Items/Weapons/Melee/TheMicrowave.cs +++ b/Items/Weapons/Melee/TheMicrowave.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 7369dbcbb3..1d38a5308e 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 950; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 8f; @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, 58, 1, false, 0, false, false); } - Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 14); + Main.PlaySound(SoundID.Item14, target.position); target.position.X += (float)(target.width / 2); target.position.Y += (float)(target.height / 2); target.position.X -= (float)(target.width / 2); diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 147e967a08..737747f98e 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 20; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/ThePlaguebringer.cs b/Items/Weapons/Melee/ThePlaguebringer.cs index 64867678b4..8c6cd8417a 100644 --- a/Items/Weapons/Melee/ThePlaguebringer.cs +++ b/Items/Weapons/Melee/ThePlaguebringer.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/TitanArm.cs b/Items/Weapons/Melee/TitanArm.cs index e5c40af72e..cf31e4570f 100644 --- a/Items/Weapons/Melee/TitanArm.cs +++ b/Items/Weapons/Melee/TitanArm.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.useTurn = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 9001f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index ba5e4479cd..1cb1f1e4bd 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -1,7 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.knockBack = 50f; item.UseSound = SoundID.Item1; @@ -37,13 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Developer; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/Trinity.cs b/Items/Weapons/Melee/Trinity.cs index f43f1f7973..f12d436eb6 100644 --- a/Items/Weapons/Melee/Trinity.cs +++ b/Items/Weapons/Melee/Trinity.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 77829cbe2a..75f7020e26 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.useTime = 25; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 8eb1ea1d1a..f043fe7c76 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 21; item.useTime = 21; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Melee/TrueBloodyEdge.cs b/Items/Weapons/Melee/TrueBloodyEdge.cs index 8f745cb00a..477a61ae48 100644 --- a/Items/Weapons/Melee/TrueBloodyEdge.cs +++ b/Items/Weapons/Melee/TrueBloodyEdge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 70; item.melee = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.knockBack = 6f; item.UseSound = SoundID.Item1; @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || player.moonLeech) { return; } @@ -67,6 +67,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (player.moonLeech) + return; int healAmount = Main.rand.Next(6) + 1; if (Main.rand.NextBool(2)) { diff --git a/Items/Weapons/Melee/TrueCausticEdge.cs b/Items/Weapons/Melee/TrueCausticEdge.cs index 17d20b4a2f..1377f73494 100644 --- a/Items/Weapons/Melee/TrueCausticEdge.cs +++ b/Items/Weapons/Melee/TrueCausticEdge.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 100; item.melee = true; item.useAnimation = 28; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 28; item.useTurn = true; item.knockBack = 5.75f; diff --git a/Items/Weapons/Melee/TrueExcaliburShortsword.cs b/Items/Weapons/Melee/TrueExcaliburShortsword.cs index 5d8a402c8a..a3580d3bb1 100644 --- a/Items/Weapons/Melee/TrueExcaliburShortsword.cs +++ b/Items/Weapons/Melee/TrueExcaliburShortsword.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 12; item.useTime = 12; diff --git a/Items/Weapons/Melee/TrueForbiddenOathblade.cs b/Items/Weapons/Melee/TrueForbiddenOathblade.cs index d303f9216a..97fcab0849 100644 --- a/Items/Weapons/Melee/TrueForbiddenOathblade.cs +++ b/Items/Weapons/Melee/TrueForbiddenOathblade.cs @@ -18,17 +18,17 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 78; + item.width = 88; + item.height = 88; item.damage = 200; item.melee = true; item.useAnimation = 23; item.useTime = 23; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 78; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/TrueForbiddenOathblade.png b/Items/Weapons/Melee/TrueForbiddenOathblade.png index 309864b6ae..44fe38ad94 100644 Binary files a/Items/Weapons/Melee/TrueForbiddenOathblade.png and b/Items/Weapons/Melee/TrueForbiddenOathblade.png differ diff --git a/Items/Weapons/Melee/TrueNightsStabber.cs b/Items/Weapons/Melee/TrueNightsStabber.cs index 2827f3fceb..3d3970a71c 100644 --- a/Items/Weapons/Melee/TrueNightsStabber.cs +++ b/Items/Weapons/Melee/TrueNightsStabber.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.useStyle = 3; + item.useStyle = ItemUseStyleID.Stabbing; item.useTurn = false; item.useAnimation = 16; item.useTime = 16; diff --git a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs index 63838e1415..bce78402a4 100644 --- a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs +++ b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,12 +17,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 14; - item.damage = 81; + item.damage = 87; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 13; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 20f; item.UseSound = SoundID.Item1; @@ -35,13 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 14f; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/TrueTyrantYharimsUltisword.cs b/Items/Weapons/Melee/TrueTyrantYharimsUltisword.cs index d93736f308..bf9811f014 100644 --- a/Items/Weapons/Melee/TrueTyrantYharimsUltisword.cs +++ b/Items/Weapons/Melee/TrueTyrantYharimsUltisword.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 185; item.melee = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.useTurn = true; item.knockBack = 7.5f; @@ -83,9 +83,6 @@ namespace CalamityMod.Items.Weapons.Melee player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.OnFire, 300); target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.CursedInferno, 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) @@ -93,9 +90,6 @@ namespace CalamityMod.Items.Weapons.Melee player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.OnFire, 300); target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.CursedInferno, 300); - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Items/Weapons/Melee/Tumbleweed.cs b/Items/Weapons/Melee/Tumbleweed.cs index 9159a7683a..44d41224c8 100644 --- a/Items/Weapons/Melee/Tumbleweed.cs +++ b/Items/Weapons/Melee/Tumbleweed.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 10; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.knockBack = 8f; diff --git a/Items/Weapons/Melee/TyphonsGreed.cs b/Items/Weapons/Melee/TyphonsGreed.cs index 8b3c402fdf..402c10ed16 100644 --- a/Items/Weapons/Melee/TyphonsGreed.cs +++ b/Items/Weapons/Melee/TyphonsGreed.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 16; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.knockBack = 5f; diff --git a/Items/Weapons/Melee/TyrantYharimsUltisword.cs b/Items/Weapons/Melee/TyrantYharimsUltisword.cs index 4f63892808..153324131f 100644 --- a/Items/Weapons/Melee/TyrantYharimsUltisword.cs +++ b/Items/Weapons/Melee/TyrantYharimsUltisword.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 64; item.melee = true; item.useAnimation = 26; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 26; item.useTurn = true; item.knockBack = 5.5f; @@ -42,16 +42,6 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.BrokenHeroSword); recipe.AddIngredient(ItemID.FlaskofVenom, 5); - recipe.AddIngredient(ItemID.FlaskofCursedFlames, 5); - recipe.AddIngredient(ItemID.ChlorophyteBar, 15); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.BrokenHeroSword); - recipe.AddIngredient(ItemID.FlaskofVenom, 5); - recipe.AddIngredient(ItemID.FlaskofIchor, 5); recipe.AddIngredient(ItemID.ChlorophyteBar, 15); recipe.AddTile(TileID.DemonAltar); recipe.SetResult(this); @@ -69,17 +59,15 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { player.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.Venom, 180); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { player.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(BuffID.OnFire, 300); - target.AddBuff(BuffID.Venom, 300); - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.Venom, 180); } } } diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index b7b1700ff7..ed8d836c01 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class UltimusCleaver : ModItem + public class UltimusCleaver : ModItem { public override void SetStaticDefaults() @@ -18,14 +17,14 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 300; + item.damage = 130; item.melee = true; item.rare = 8; item.width = 72; item.height = 62; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 8f; item.value = Item.buyPrice(0, 80, 0, 0); item.autoReuse = true; diff --git a/Items/Weapons/Melee/UrchinFlail.cs b/Items/Weapons/Melee/UrchinFlail.cs index 100886cf2c..c6e6bef3f9 100644 --- a/Items/Weapons/Melee/UrchinFlail.cs +++ b/Items/Weapons/Melee/UrchinFlail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 36; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.knockBack = 6f; diff --git a/Items/Weapons/Melee/UrchinSpear.cs b/Items/Weapons/Melee/UrchinSpear.cs index 30a47c0763..e251016645 100644 --- a/Items/Weapons/Melee/UrchinSpear.cs +++ b/Items/Weapons/Melee/UrchinSpear.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 25; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/VeinBurster.cs b/Items/Weapons/Melee/VeinBurster.cs index 49adf7196e..02350c2c5c 100644 --- a/Items/Weapons/Melee/VeinBurster.cs +++ b/Items/Weapons/Melee/VeinBurster.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 22; item.melee = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.useTurn = true; item.knockBack = 4.25f; diff --git a/Items/Weapons/Melee/Verdant.cs b/Items/Weapons/Melee/Verdant.cs index 730ac72254..a649f8c471 100644 --- a/Items/Weapons/Melee/Verdant.cs +++ b/Items/Weapons/Melee/Verdant.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/VirulentKatana.cs b/Items/Weapons/Melee/VirulentKatana.cs index b5a69bb3a9..c1244aaa8b 100644 --- a/Items/Weapons/Melee/VirulentKatana.cs +++ b/Items/Weapons/Melee/VirulentKatana.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 96; item.melee = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.useTurn = true; item.knockBack = 5.5f; diff --git a/Items/Weapons/Melee/Waraxe.cs b/Items/Weapons/Melee/Waraxe.cs index 3b62e391e1..e68f65bbb2 100644 --- a/Items/Weapons/Melee/Waraxe.cs +++ b/Items/Weapons/Melee/Waraxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 22; item.useTurn = true; item.axe = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5.25f; item.value = Item.buyPrice(0, 1, 0, 0); item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/Warblade.cs b/Items/Weapons/Melee/Warblade.cs index f577dd8f78..c413967bd7 100644 --- a/Items/Weapons/Melee/Warblade.cs +++ b/Items/Weapons/Melee/Warblade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 19; item.useAnimation = 19; item.useTurn = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4.25f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; diff --git a/Items/Weapons/Melee/Whirlpool.cs b/Items/Weapons/Melee/Whirlpool.cs index 7a33f3adc7..51685046a2 100644 --- a/Items/Weapons/Melee/Whirlpool.cs +++ b/Items/Weapons/Melee/Whirlpool.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 8e666fc6da..5fa592c5b3 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 27; item.melee = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.useTurn = true; item.knockBack = 5; diff --git a/Items/Weapons/Melee/WulfrumBlade.cs b/Items/Weapons/Melee/WulfrumBlade.cs index 2b8fb8052b..7dbf7198ae 100644 --- a/Items/Weapons/Melee/WulfrumBlade.cs +++ b/Items/Weapons/Melee/WulfrumBlade.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 12; item.melee = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.useTurn = true; item.knockBack = 3.75f; diff --git a/Items/Weapons/Melee/XerocsGreatsword.cs b/Items/Weapons/Melee/XerocsGreatsword.cs index 48b94e1a84..07a2e2b818 100644 --- a/Items/Weapons/Melee/XerocsGreatsword.cs +++ b/Items/Weapons/Melee/XerocsGreatsword.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee item.damage = 90; item.melee = true; item.useAnimation = 26; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 26; item.useTurn = true; item.knockBack = 5.25f; @@ -62,15 +62,5 @@ namespace CalamityMod.Items.Weapons.Melee int dust = 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); - } - - public override void OnHitPvp(Player player, Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 300); - } } } diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 8f81f86c68..5488338b04 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = false; item.useTurn = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.rare = 2; diff --git a/Items/Weapons/Melee/YinYo.cs b/Items/Weapons/Melee/YinYo.cs index 9f6998ec83..eb29299eaa 100644 --- a/Items/Weapons/Melee/YinYo.cs +++ b/Items/Weapons/Melee/YinYo.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useAnimation = 25; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item1; item.channel = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index fab41ac3ce..cc26c11ea7 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -4,6 +4,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Weapons.Ranged { @@ -25,14 +26,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 60; item.useAnimation = 60; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 9.5f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index 2b22d5f43d..5269bf97d6 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 3; item.reuseDelay = 8; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Ranged/Aeries.cs b/Items/Weapons/Ranged/Aeries.cs index 2adb159c86..73f1d677d5 100644 --- a/Items/Weapons/Ranged/Aeries.cs +++ b/Items/Weapons/Ranged/Aeries.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index ee8b0de2d3..f35b97d54f 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 90; item.useTime = 9; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index f5cf3a8766..91cfeca001 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -34,7 +34,7 @@ Fighting 'til the war's won"); item.useTime = 26; item.useAnimation = 26; item.UseSound = SoundID.Item38; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.rare = 10; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index 6625e2378d..2caa6c376d 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -24,14 +24,14 @@ Right click to fire a burst of bullets"); item.useTime = 4; item.reuseDelay = 15; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 11f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/AquashardShotgun.cs b/Items/Weapons/Ranged/AquashardShotgun.cs index 65456aa44e..633d343339 100644 --- a/Items/Weapons/Ranged/AquashardShotgun.cs +++ b/Items/Weapons/Ranged/AquashardShotgun.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 6; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 67cb7532f5..6998cd5678 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 10f; item.useAmmo = 40; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Ranged/Archerfish.cs b/Items/Weapons/Ranged/Archerfish.cs index eb6427dae9..3645170f9a 100644 --- a/Items/Weapons/Ranged/Archerfish.cs +++ b/Items/Weapons/Ranged/Archerfish.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 36; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 7bc4a3bd7e..5e2db0fb4b 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 3; item.reuseDelay = 10; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.25f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/AstralBlaster.cs b/Items/Weapons/Ranged/AstralBlaster.cs index 641edd0b91..076ca3c920 100644 --- a/Items/Weapons/Ranged/AstralBlaster.cs +++ b/Items/Weapons/Ranged/AstralBlaster.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.75f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Ranged/AstralRepeater.cs b/Items/Weapons/Ranged/AstralRepeater.cs index a461ffdc4f..87df0cd217 100644 --- a/Items/Weapons/Ranged/AstralRepeater.cs +++ b/Items/Weapons/Ranged/AstralRepeater.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 5; item.reuseDelay = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/AstrealDefeat.cs b/Items/Weapons/Ranged/AstrealDefeat.cs index 48a2425001..874f77695d 100644 --- a/Items/Weapons/Ranged/AstrealDefeat.cs +++ b/Items/Weapons/Ranged/AstrealDefeat.cs @@ -1,14 +1,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class AstrealDefeat : ModItem + public class AstrealDefeat : ModItem { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 78; item.useTime = 4; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index 3364382d01..6d6583af85 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 101; + item.damage = 49; item.ranged = true; - item.useTime = 15; - item.useAnimation = 15; + item.useTime = 18; + item.useAnimation = 18; item.knockBack = 2f; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index 8d74533b68..82a464a341 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 44; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 14f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 63539ad4f4..9ff306beba 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 4; item.reuseDelay = 20; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/BarracudaGun.cs b/Items/Weapons/Ranged/BarracudaGun.cs index 7af724d86d..28588e51e6 100644 --- a/Items/Weapons/Ranged/BarracudaGun.cs +++ b/Items/Weapons/Ranged/BarracudaGun.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/BladedgeGreatbow.cs b/Items/Weapons/Ranged/BladedgeGreatbow.cs index c783cf4763..adc7c99bcb 100644 --- a/Items/Weapons/Ranged/BladedgeGreatbow.cs +++ b/Items/Weapons/Ranged/BladedgeGreatbow.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 14f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/BlissfulBombardier.cs b/Items/Weapons/Ranged/BlissfulBombardier.cs index 713d9aa80b..6924c37d28 100644 --- a/Items/Weapons/Ranged/BlissfulBombardier.cs +++ b/Items/Weapons/Ranged/BlissfulBombardier.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 5d042c5a21..73d60211db 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 5; item.useAnimation = 600; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index efe3e790f5..9952255947 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 62; item.useTime = 4; item.useAnimation = 16; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 0.15f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Ranged/BrimstoneFlameblaster.cs b/Items/Weapons/Ranged/BrimstoneFlameblaster.cs index 6d740d05ea..b2c93c6f06 100644 --- a/Items/Weapons/Ranged/BrimstoneFlameblaster.cs +++ b/Items/Weapons/Ranged/BrimstoneFlameblaster.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 18; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs b/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs index 248dfe8f3c..984d746581 100644 --- a/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs +++ b/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 18; item.useTime = 9; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/BrimstoneFury.cs b/Items/Weapons/Ranged/BrimstoneFury.cs index 64c162a949..d6e9398c30 100644 --- a/Items/Weapons/Ranged/BrimstoneFury.cs +++ b/Items/Weapons/Ranged/BrimstoneFury.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 58; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.75f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/Butcher.cs b/Items/Weapons/Ranged/Butcher.cs index 1827f2bd1d..95006a28b1 100644 --- a/Items/Weapons/Ranged/Butcher.cs +++ b/Items/Weapons/Ranged/Butcher.cs @@ -7,65 +7,54 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class Butcher : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Butcher"); - Tooltip.SetDefault("Fires faster and more accurately the longer you hold the trigger"); - } + public class Butcher : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Butcher"); + Tooltip.SetDefault("Fires faster and more accurately the longer you hold the trigger"); + } - public override void SetDefaults() - { - item.damage = 17; - item.width = 20; - item.height = 12; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.rare = 5; - item.knockBack = 1f; - item.value = Item.buyPrice(0, 36, 0, 0); - item.UseSound = SoundID.Item38; - item.noMelee = true; - item.noUseGraphic = true; - item.ranged = true; - item.channel = true; - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; - item.useAmmo = 97; - } + public override void SetDefaults() + { + item.damage = 18; + item.width = 20; + item.height = 12; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = ItemUseStyleID.HoldingOut; + item.rare = 5; + item.knockBack = 1f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.UseSound = SoundID.Item38; + item.noMelee = true; + item.noUseGraphic = true; + item.ranged = true; + item.channel = true; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.projectile.Length; i++) - { - Projectile p = Main.projectile[i]; - if (p.active && p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) - { - return false; - } - } - return true; - } + public override bool CanUseItem(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) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } + 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, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Shotgun); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ModContent.ItemType(), 4); - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shotgun); + recipe.AddIngredient(ItemID.HallowedBar, 5); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Ranged/ChargedDartRifle.cs b/Items/Weapons/Ranged/ChargedDartRifle.cs index f4e46172a8..61f49ceed9 100644 --- a/Items/Weapons/Ranged/ChargedDartRifle.cs +++ b/Items/Weapons/Ranged/ChargedDartRifle.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 3f238644d6..d17cfaf6d5 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 13; item.useAnimation = 13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8.5f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 041ddc9c07..5dd52eabfe 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -1,46 +1,46 @@ using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Ranged { - public class ClamorRifle : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Clamor Rifle"); - Tooltip.SetDefault("Shoots homing energy bolts"); - } + public class ClamorRifle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Clamor Rifle"); + Tooltip.SetDefault("Shoots homing energy bolts"); + } - public override void SetDefaults() - { - item.damage = 32; - item.ranged = true; - item.width = 64; - item.height = 30; - item.useTime = 13; - item.useAnimation = 13; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 2.5f; - item.value = Item.buyPrice(0, 36, 0, 0); - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"); - item.autoReuse = true; - item.rare = 5; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15f; - item.useAmmo = 97; - } + public override void SetDefaults() + { + item.damage = 23; + item.ranged = true; + item.width = 64; + item.height = 30; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 36, 0, 0); + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"); + item.autoReuse = true; + item.rare = 5; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 15f; + item.useAmmo = AmmoID.Bullet; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-5, 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) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - } + 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, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } } diff --git a/Items/Weapons/Ranged/ClaretCannon.cs b/Items/Weapons/Ranged/ClaretCannon.cs index 9c24bfb9e2..8ee1d8d91f 100644 --- a/Items/Weapons/Ranged/ClaretCannon.cs +++ b/Items/Weapons/Ranged/ClaretCannon.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 3; item.reuseDelay = 10; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index 79cb7ae596..b56133746c 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 3; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/ClockGatlignum.cs b/Items/Weapons/Ranged/ClockGatlignum.cs index f90ac552cd..4005ee070b 100644 --- a/Items/Weapons/Ranged/ClockGatlignum.cs +++ b/Items/Weapons/Ranged/ClockGatlignum.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 3; item.reuseDelay = 12; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.75f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 20f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/ClockworkBow.cs b/Items/Weapons/Ranged/ClockworkBow.cs index a844f963f8..773258218d 100644 --- a/Items/Weapons/Ranged/ClockworkBow.cs +++ b/Items/Weapons/Ranged/ClockworkBow.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 100; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.25f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 30f; item.useAmmo = 40; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs index 56141a72df..1b5d374212 100644 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ b/Items/Weapons/Ranged/ConferenceCall.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 80, 0, 0); @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item38; item.autoReuse = true; item.shootSpeed = 13f; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index a807100e39..e55426048e 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 50; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.channel = true; diff --git a/Items/Weapons/Ranged/CoralCannon.cs b/Items/Weapons/Ranged/CoralCannon.cs index 9f226d5c2b..bc12424758 100644 --- a/Items/Weapons/Ranged/CoralCannon.cs +++ b/Items/Weapons/Ranged/CoralCannon.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 10; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 748e92202f..487a68ca53 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 20; item.useTime = 45; item.useAnimation = 45; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/CosmicBolter.cs b/Items/Weapons/Ranged/CosmicBolter.cs index ac01336e13..520971a077 100644 --- a/Items/Weapons/Ranged/CosmicBolter.cs +++ b/Items/Weapons/Ranged/CosmicBolter.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 76; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.75f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/CursedCapper.cs b/Items/Weapons/Ranged/CursedCapper.cs index d8e224cffa..f4d6636b88 100644 --- a/Items/Weapons/Ranged/CursedCapper.cs +++ b/Items/Weapons/Ranged/CursedCapper.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index c5e2504f85..0840edaa83 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 128; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 4f; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; diff --git a/Items/Weapons/Ranged/DarkechoGreatbow.cs b/Items/Weapons/Ranged/DarkechoGreatbow.cs index 207225e6f3..21772861cb 100644 --- a/Items/Weapons/Ranged/DarkechoGreatbow.cs +++ b/Items/Weapons/Ranged/DarkechoGreatbow.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 62; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 9b04611136..b5ee19e731 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 82; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 439445107c..b38fd89fff 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -18,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Ranged { item.width = 70; item.height = 42; - item.damage = 450; + item.damage = 485; item.crit += 16; item.ranged = true; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 10f; diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index 75d25cade5..42b8c5e8e8 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.5f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = SoundID.Item36; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index a8da8a5f06..b6f437caf7 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -27,7 +27,7 @@ Right click to fire two devastating barrages of five empowered fireballs. item.damage = 700; item.knockBack = 1f; item.shootSpeed = 18f; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useAnimation = 10; item.useTime = 10; item.reuseDelay = 0; diff --git a/Items/Weapons/Ranged/Dualpoon.cs b/Items/Weapons/Ranged/Dualpoon.cs index 07119520a0..5a82517b10 100644 --- a/Items/Weapons/Ranged/Dualpoon.cs +++ b/Items/Weapons/Ranged/Dualpoon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.5f; item.value = Item.buyPrice(0, 36, 0, 0); @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item10; item.autoReuse = true; item.shootSpeed = 20f; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); } public override Vector2? HoldoutOffset() @@ -38,28 +38,27 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-5, 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) - { - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num117 = 0.314159274f; - int num118 = 2; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 40f; - bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) - { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) - { - value9 -= vector7; - } - int harpoon = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[harpoon].timeLeft = 300; - } - return false; - } + 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); + float piOverTen = MathHelper.Pi * 0.1f; + int projCount = 2; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= 40f; + bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); + for (int projIndex = 0; projIndex < projCount; projIndex++) + { + float num120 = projIndex - (projCount - 1f) / 2f; + Vector2 offset = velocity.RotatedBy((double)(piOverTen * num120), default); + if (!canHit) + { + offset -= velocity; + } + Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } public override void AddRecipes() { diff --git a/Items/Weapons/Ranged/EffluviumBow.cs b/Items/Weapons/Ranged/EffluviumBow.cs index fb4397f7fe..3e1e2011b8 100644 --- a/Items/Weapons/Ranged/EffluviumBow.cs +++ b/Items/Weapons/Ranged/EffluviumBow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 70; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/ElementalBlaster.cs b/Items/Weapons/Ranged/ElementalBlaster.cs index 6f962e4f9b..18c979cc82 100644 --- a/Items/Weapons/Ranged/ElementalBlaster.cs +++ b/Items/Weapons/Ranged/ElementalBlaster.cs @@ -18,13 +18,13 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 77; + item.damage = 66; item.ranged = true; item.width = 104; item.height = 42; item.useTime = 2; item.useAnimation = 6; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.75f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index 983132859b..abf998ede5 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -18,13 +18,13 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 40; + item.damage = 56; item.ranged = true; item.width = 64; item.height = 34; item.useTime = 7; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/EternalBlizzard.cs b/Items/Weapons/Ranged/EternalBlizzard.cs index f0bf745c2d..3e321751a6 100644 --- a/Items/Weapons/Ranged/EternalBlizzard.cs +++ b/Items/Weapons/Ranged/EternalBlizzard.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 62; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 3f; diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index c0233eaebc..f2a040e334 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 25; item.useTime = 60; item.useAnimation = 60; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 92462ddbf0..d6b97883e0 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 10; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = AmmoID.Bullet; } diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index fda0b30f0f..a70fae6475 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 9; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 163; + item.shoot = ProjectileID.Flare; item.shootSpeed = 5.5f; item.useAmmo = 931; } diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 8986adf70c..ce2117d615 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -20,12 +20,12 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 54; item.ranged = true; - item.width = 16; - item.height = 16; + item.width = 152; + item.height = 58; item.useTime = 10; item.useAnimation = 10; item.reuseDelay = 5; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.noUseGraphic = true; item.channel = true; diff --git a/Items/Weapons/Ranged/FlakKraken.png b/Items/Weapons/Ranged/FlakKraken.png index 88f490cdcd..1353a556b8 100644 Binary files a/Items/Weapons/Ranged/FlakKraken.png and b/Items/Weapons/Ranged/FlakKraken.png differ diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 40f669e2ec..4ba63f8dab 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.width = 88; item.height = 28; item.useTime = item.useAnimation = 13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 7f; diff --git a/Items/Weapons/Ranged/FlarewingBow.cs b/Items/Weapons/Ranged/FlarewingBow.cs index be2afe56c7..e84d56e2c8 100644 --- a/Items/Weapons/Ranged/FlarewingBow.cs +++ b/Items/Weapons/Ranged/FlarewingBow.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 62; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 1; + item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 16f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/FlurrystormCannon.cs b/Items/Weapons/Ranged/FlurrystormCannon.cs index 98dea6a3bc..de3a235f7f 100644 --- a/Items/Weapons/Ranged/FlurrystormCannon.cs +++ b/Items/Weapons/Ranged/FlurrystormCannon.cs @@ -1,14 +1,13 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class FlurrystormCannon : ModItem + public class FlurrystormCannon : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 34; item.useTime = 8; item.useAnimation = 8; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 1.2f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; diff --git a/Items/Weapons/Ranged/FrostbiteBlaster.cs b/Items/Weapons/Ranged/FrostbiteBlaster.cs index 8f4eb1103d..9bfbb41b24 100644 --- a/Items/Weapons/Ranged/FrostbiteBlaster.cs +++ b/Items/Weapons/Ranged/FrostbiteBlaster.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 7; item.useAnimation = 21; item.reuseDelay = 54; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; item.knockBack = 5f; diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 68b9373d22..a7d097672a 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Ranged/Galeforce.cs b/Items/Weapons/Ranged/Galeforce.cs index 83f2673b55..5a943c7e28 100644 --- a/Items/Weapons/Ranged/Galeforce.cs +++ b/Items/Weapons/Ranged/Galeforce.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 52; item.useTime = 17; item.useAnimation = 17; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 20f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index 38a541081c..7d4db85f6c 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -22,13 +22,13 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 3f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item41; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 20f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 537d49b6c8..c3d63b9085 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 50; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 12, 0, 0); item.rare = 4; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index 6ed6729314..e450153f54 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -18,46 +18,46 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 27; + item.damage = 31; item.ranged = true; item.width = 18; item.height = 36; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 17f; item.useAmmo = 40; } 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 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num117 = 0.314159274f; - int num118 = 3; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 40f; - bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float piOverTen = MathHelper.Pi * 0.1f; + int arrowAmt = 3; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= 40f; + bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); + for (int projIndex = 0; projIndex < arrowAmt; projIndex++) { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) + float num120 = (float)projIndex - ((float)arrowAmt - 1f) / 2f; + Vector2 offset = velocity.RotatedBy((double)(piOverTen * num120), default); + if (!canHit) { - value9 -= vector7; + offset -= velocity; } if (type == ProjectileID.WoodenArrowFriendly) { type = ProjectileID.FireArrow; } - int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num121].noDropItem = true; } for (int i = 0; i < 2; i++) @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Ranged default: break; } - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); Main.projectile[index].noDropItem = true; Main.projectile[index].usesLocalNPCImmunity = true; Main.projectile[index].localNPCHitCooldown = 10; diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index fb967e555c..f4f5f43a13 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 32; item.useAnimation = 32; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 12, 0, 0); item.rare = 4; item.UseSound = SoundID.Item36; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 5f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index d6bc60d761..464f2bcce8 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 54; item.useTime = 10; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.rare = 10; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(1, 0, 0, 0); item.UseSound = SoundID.Item38; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/HalleysInferno.cs b/Items/Weapons/Ranged/HalleysInferno.cs index 9520c9fdc6..f313f0ea94 100644 --- a/Items/Weapons/Ranged/HalleysInferno.cs +++ b/Items/Weapons/Ranged/HalleysInferno.cs @@ -21,14 +21,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1750; + item.damage = 1666; item.crit += 20; item.ranged = true; item.width = 84; item.height = 34; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.UseSound = SoundID.Item34; @@ -41,17 +41,9 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 23; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-15, 0); - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 50) - return false; - return true; - } + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) >= 50; public override void AddRecipes() { diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 8d3f0e7b60..a06e8e1fab 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAnimation = 71; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TankCannon"); item.noMelee = true; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 7807f30b9e..e9f0bb684b 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -29,14 +29,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 58; item.useTime = 11; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 1; + item.shoot = ProjectileID.WoodenArrowFriendly; item.shootSpeed = 17f; item.useAmmo = 40; item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index 5653451a36..a3ba1b9d97 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -22,13 +22,13 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 9; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 1f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 14f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index 5dc282e178..8abd01de1c 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -23,13 +23,13 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 7; item.useAnimation = 7; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 11.5f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/Impaler.cs b/Items/Weapons/Ranged/Impaler.cs index c17a6e0fc7..59314c0b2a 100644 --- a/Items/Weapons/Ranged/Impaler.cs +++ b/Items/Weapons/Ranged/Impaler.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index a7d55b5804..822326f822 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -28,14 +28,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 2; item.reuseDelay = 6; item.useAnimation = 1800; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Ranged/Interfacer.cs b/Items/Weapons/Ranged/Interfacer.cs index 8865cacdc7..e2ca5b631a 100644 --- a/Items/Weapons/Ranged/Interfacer.cs +++ b/Items/Weapons/Ranged/Interfacer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(1, 20, 0, 0); @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item38; item.autoReuse = true; item.shootSpeed = 13f; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Turquoise; } diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index b3c2e0ece9..2f4d4081da 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAnimation = 52; item.autoReuse = true; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/MechGaussRifle"); item.noMelee = true; diff --git a/Items/Weapons/Ranged/LeadWizard.cs b/Items/Weapons/Ranged/LeadWizard.cs index 8c8aff1999..7c592996ee 100644 --- a/Items/Weapons/Ranged/LeadWizard.cs +++ b/Items/Weapons/Ranged/LeadWizard.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 3; item.reuseDelay = 12; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 20f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index fd7697881e..ab9315b9ba 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class Leviatitan : ModItem + public class Leviatitan : ModItem { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 9; item.useAnimation = 9; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index 357d639795..38a62c1498 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 62; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs index c04ddef551..bada51268d 100644 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ b/Items/Weapons/Ranged/MagnaStriker.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 5; item.reuseDelay = 6; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 46b8b7340f..ac425bae1e 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 9.5f; item.UseSound = SoundID.Item11; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index 2d8577923d..178fe4cafb 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 58; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/MandibleBow.cs b/Items/Weapons/Ranged/MandibleBow.cs index 130b862c23..c07ea8e099 100644 --- a/Items/Weapons/Ranged/MandibleBow.cs +++ b/Items/Weapons/Ranged/MandibleBow.cs @@ -20,14 +20,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 40; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; item.UseSound = SoundID.Item5; item.autoReuse = false; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 30f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 15b6356c1a..673a3e4fe1 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 32; + item.damage = 27; item.ranged = true; item.crit += 20; item.width = 36; diff --git a/Items/Weapons/Ranged/MarniteRifleSpear.cs b/Items/Weapons/Ranged/MarniteRifleSpear.cs index f462e8f6af..c51dad9a98 100644 --- a/Items/Weapons/Ranged/MarniteRifleSpear.cs +++ b/Items/Weapons/Ranged/MarniteRifleSpear.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 20; item.useTime = 28; item.useAnimation = 28; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 22f; item.useAmmo = 97; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/Megafleet.cs b/Items/Weapons/Ranged/Megafleet.cs index bc000c72d3..b804555cb7 100644 --- a/Items/Weapons/Ranged/Megafleet.cs +++ b/Items/Weapons/Ranged/Megafleet.cs @@ -24,14 +24,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 38; item.useTime = 5; item.useAnimation = 5; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 18f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Developer; diff --git a/Items/Weapons/Ranged/Megalodon.cs b/Items/Weapons/Ranged/Megalodon.cs index 5bdc398647..c97ada1a85 100644 --- a/Items/Weapons/Ranged/Megalodon.cs +++ b/Items/Weapons/Ranged/Megalodon.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 6; item.useAnimation = 6; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/Meowthrower.cs b/Items/Weapons/Ranged/Meowthrower.cs index a3a7a49b2c..d093097adc 100644 --- a/Items/Weapons/Ranged/Meowthrower.cs +++ b/Items/Weapons/Ranged/Meowthrower.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 10; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.25f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/MepheticSprayer.cs b/Items/Weapons/Ranged/MepheticSprayer.cs index 323b676624..b81d3cc519 100644 --- a/Items/Weapons/Ranged/MepheticSprayer.cs +++ b/Items/Weapons/Ranged/MepheticSprayer.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 36; item.useTime = 10; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index be4953ee6a..bb3f6d1a3b 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 33; item.useAnimation = 33; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/Minigun.cs b/Items/Weapons/Ranged/Minigun.cs index e5f29a1062..cdb0dc96c5 100644 --- a/Items/Weapons/Ranged/Minigun.cs +++ b/Items/Weapons/Ranged/Minigun.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 34; item.useTime = 3; item.useAnimation = 3; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = SoundID.Item41; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 22f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Weapons/Ranged/MolecularManipulator.cs b/Items/Weapons/Ranged/MolecularManipulator.cs index cfc0c3929e..c1ca27efe4 100644 --- a/Items/Weapons/Ranged/MolecularManipulator.cs +++ b/Items/Weapons/Ranged/MolecularManipulator.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 6bca8a0224..95b6cb3235 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 78; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/Needler.cs b/Items/Weapons/Ranged/Needler.cs index 385aea044d..d2fd642406 100644 --- a/Items/Weapons/Ranged/Needler.cs +++ b/Items/Weapons/Ranged/Needler.cs @@ -16,13 +16,13 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 38; + item.damage = 45; item.ranged = true; item.width = 44; item.height = 26; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(0, 36, 0, 0); @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 9f; item.shoot = ModContent.ProjectileType(); - item.useAmmo = 97; + item.useAmmo = AmmoID.Bullet; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/NettlelineGreatbow.cs b/Items/Weapons/Ranged/NettlelineGreatbow.cs index 4d81612587..10efe736e6 100644 --- a/Items/Weapons/Ranged/NettlelineGreatbow.cs +++ b/Items/Weapons/Ranged/NettlelineGreatbow.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 64; item.useTime = 17; item.useAnimation = 17; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 40; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Ranged/Norfleet.cs b/Items/Weapons/Ranged/Norfleet.cs index 475e69dd03..84778f3741 100644 --- a/Items/Weapons/Ranged/Norfleet.cs +++ b/Items/Weapons/Ranged/Norfleet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.damage = 1000; item.knockBack = 15f; item.shootSpeed = 30f; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useAnimation = 75; item.useTime = 75; item.reuseDelay = 0; diff --git a/Items/Weapons/Ranged/NullificationRifle.cs b/Items/Weapons/Ranged/NullificationRifle.cs index 4c0e8d9019..b04a77e85b 100644 --- a/Items/Weapons/Ranged/NullificationRifle.cs +++ b/Items/Weapons/Ranged/NullificationRifle.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index edd0d1463d..6c21317f68 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item36; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 24f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 53a30951e9..ba192d21bd 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; @@ -20,20 +20,20 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 210; + item.damage = 200; item.ranged = true; item.width = 84; item.height = 34; - item.useTime = 8; - item.useAnimation = 8; - item.useStyle = 5; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.UseSound = SoundID.Item36; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; // wait why item.shootSpeed = 28f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Violet; @@ -48,11 +48,12 @@ namespace CalamityMod.Items.Weapons.Ranged { // Fire the Onyx Shard that is characteristic of the Onyx Blaster // The shard deals triple damage and double knockback - int shardDamage = 3 * damage; + int shardDamage = (int)(2.5 * damage); float shardKB = 2f * knockBack; float shardVelocityX = (speedX + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; float shardVelocityY = (speedY + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; - Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); + int onyx = Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); + Main.projectile[onyx].timeLeft -= 20; // Fire three symmetric pairs of bullets alongside it Vector2 baseVelocity = new Vector2(speedX, speedY); diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 672f5635f7..e02eeb06e3 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -6,51 +6,53 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class OpalStriker : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Opal Striker"); - Tooltip.SetDefault("Fires a string of opal strikes"); - } + public class OpalStriker : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Opal Striker"); + Tooltip.SetDefault("Fires a string of opal strikes"); + } - public override void SetDefaults() - { - item.damage = 9; - item.ranged = true; - item.width = 64; - item.height = 16; - item.useTime = 5; - item.reuseDelay = 25; - item.useAnimation = 20; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 0f; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike"); - item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 6f; - item.useAmmo = 97; - } + public override void SetDefaults() + { + item.damage = 9; + item.ranged = true; + item.width = 64; + item.height = 16; + item.useTime = 5; + item.reuseDelay = 25; + item.useAnimation = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 0f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike"); + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 6f; + item.useAmmo = 97; + } - 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, 0f, player.whoAmI, 0f, 0f); - return false; - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Marble, 20); - recipe.AddIngredient(ItemID.Amber, 5); - recipe.AddIngredient(ItemID.Diamond, 3); - recipe.AddIngredient(ItemID.FlintlockPistol); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + 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, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Marble, 20); + recipe.AddIngredient(ItemID.Amber, 5); + recipe.AddIngredient(ItemID.Diamond, 3); + recipe.AddIngredient(ItemID.FlintlockPistol); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Ranged/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 820db43ae8..bca705351f 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 34; item.useTime = 17; item.useAnimation = 17; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Ranged/P90.cs b/Items/Weapons/Ranged/P90.cs index ea248f11b0..011b5ff209 100644 --- a/Items/Weapons/Ranged/P90.cs +++ b/Items/Weapons/Ranged/P90.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 28; item.useTime = 2; item.useAnimation = 2; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 18f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/PaintballBlaster.cs b/Items/Weapons/Ranged/PaintballBlaster.cs index aa40eebd21..9ddd9dfc9e 100644 --- a/Items/Weapons/Ranged/PaintballBlaster.cs +++ b/Items/Weapons/Ranged/PaintballBlaster.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAnimation = 24; item.reuseDelay = 9; item.useTime = 4; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 36, 0, 0); @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = null; item.autoReuse = true; item.shootSpeed = 20f; - item.shoot = 587; + item.shoot = ProjectileID.PainterPaintball; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged { vector2 += new Vector2(num208, num209); } - Projectile.NewProjectile(position.X, position.Y - player.gravDir * 4f, num208, num209, 587, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(12) / 6f); + Projectile.NewProjectile(position.X, position.Y - player.gravDir * 4f, num208, num209, ProjectileID.PainterPaintball, damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(12) / 6f); return false; } diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 9a7dafaf4a..516e4fc598 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index 5d356ae7d5..f800ed5ca8 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 20; item.useTime = 37; item.useAnimation = 37; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 9.5f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/Phangasm.cs b/Items/Weapons/Ranged/Phangasm.cs index f18afe61dd..e6ec1a1eee 100644 --- a/Items/Weapons/Ranged/Phangasm.cs +++ b/Items/Weapons/Ranged/Phangasm.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 12; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 3f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index 0442c34c4f..689b383ad4 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -10,34 +10,55 @@ namespace CalamityMod.Items.Weapons.Ranged { public class Photoviscerator : ModItem { + public const int CooldownTime = 60 * 7; // 7 second cooldown. + public const double AltFireDamageMult = 3.0; + public override void SetStaticDefaults() { DisplayName.SetDefault("Photoviscerator"); Tooltip.SetDefault("90% chance to not consume gel\n" + - "Fires a stream of exo flames that literally melts everything"); + "Fires a stream of exo flames and light that explodes into homing sparks\n" + + "Right click to fire homing flares which stick to enemies and incinerate them"); } public override void SetDefaults() { - item.damage = 250; + item.damage = 370; item.ranged = true; item.width = 84; item.height = 30; item.useTime = 2; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.UseSound = SoundID.Item34; item.value = Item.buyPrice(2, 50, 0, 0); item.rare = 10; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); item.shootSpeed = 6f; - item.useAmmo = 23; + item.useAmmo = AmmoID.Gel; item.Calamity().customRarity = CalamityRarity.Violet; } + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = ModContent.ProjectileType(); + item.useTime = item.useAnimation = 27; + } + else + { + item.useTime = 2; + item.useAnimation = 10; + item.shoot = ModContent.ProjectileType(); + } + return base.CanUseItem(player); + } + public override Vector2? HoldoutOffset() { return new Vector2(-15, 0); @@ -45,11 +66,33 @@ namespace CalamityMod.Items.Weapons.Ranged 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 < 2; i++) + if (player.altFunctionUse == 2) { - float SpeedX = speedX + (float)Main.rand.Next(-5, 6) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-5, 6) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + Vector2 velocity = new Vector2(speedX, speedY); + position += velocity.ToRotation().ToRotationVector2() * 80f; + Projectile.NewProjectile(position, velocity.SafeNormalize(Vector2.Zero) * 17f, ModContent.ProjectileType(), (int)(damage * AltFireDamageMult), knockBack, player.whoAmI); + } + else + { + for (int i = 0; i < 2; i++) + { + 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)) + { + for (int i = 0; i < 2; i++) + { + Vector2 velocity = new Vector2(speedX, speedY) * 2f; + position += velocity.ToRotation().ToRotationVector2() * 64f; + int yDirection = (i == 0).ToDirectionInt(); + velocity = velocity.RotatedBy(0.2f * yDirection); + Projectile lightBomb = Projectile.NewProjectileDirect(position, velocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + + lightBomb.localAI[1] = yDirection; + lightBomb.netUpdate = true; + } + } } return false; } diff --git a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs index b0c8f47790..0b35ec650a 100644 --- a/Items/Weapons/Ranged/PlanetaryAnnihilation.cs +++ b/Items/Weapons/Ranged/PlanetaryAnnihilation.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 102; item.useTime = 23; item.useAnimation = 23; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs index 80f27431fd..61fa7e259e 100644 --- a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 5; item.useAnimation = 5; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; item.value = CalamityGlobalItem.Rarity12BuyPrice; diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index ebac376c63..4976c299d0 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 44; item.useTime = 3; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.rare = 10; diff --git a/Items/Weapons/Ranged/ProporsePistol.cs b/Items/Weapons/Ranged/ProporsePistol.cs index 02947b9352..d0b2542485 100644 --- a/Items/Weapons/Ranged/ProporsePistol.cs +++ b/Items/Weapons/Ranged/ProporsePistol.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 20; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index 365f92a458..1ef6a68d5a 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -22,14 +22,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 36; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.25f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 11f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/RaidersGlory.cs b/Items/Weapons/Ranged/RaidersGlory.cs index 0e0b3a749a..ade619b15f 100644 --- a/Items/Weapons/Ranged/RaidersGlory.cs +++ b/Items/Weapons/Ranged/RaidersGlory.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 15f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index b2750d1247..9765a18abc 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Items.Weapons.Ranged item.ranged = true; item.width = 76; item.height = 32; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 80, 0, 0); @@ -31,17 +31,15 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 30f; item.shoot = ModContent.ProjectileType(); - item.useAmmo = 97; + item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 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) { - for (int index = 0; index < 5; ++index) + int numBullets = Main.rand.NextBool() ? 4 : 3; + for (int index = 0; index < numBullets; ++index) { float SpeedX = speedX + (float)Main.rand.Next(-75, 76) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-75, 76) * 0.05f; diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index e444d39168..9a41a5dd4e 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 5600; + item.damage = 2601; item.ranged = true; item.crit += 40; item.knockBack = 10f; diff --git a/Items/Weapons/Ranged/SDFMG.cs b/Items/Weapons/Ranged/SDFMG.cs index fcae1c8324..e47beef7b9 100644 --- a/Items/Weapons/Ranged/SDFMG.cs +++ b/Items/Weapons/Ranged/SDFMG.cs @@ -27,14 +27,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 15; item.useTime = 2; item.useAnimation = 2; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.75f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Weapons/Ranged/SandstormGun.cs b/Items/Weapons/Ranged/SandstormGun.cs index 2d08dff1ef..f07dc2539c 100644 --- a/Items/Weapons/Ranged/SandstormGun.cs +++ b/Items/Weapons/Ranged/SandstormGun.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Ranged/Scorpion.cs b/Items/Weapons/Ranged/Scorpion.cs index af08c157ad..7febcd2dcb 100644 --- a/Items/Weapons/Ranged/Scorpion.cs +++ b/Items/Weapons/Ranged/Scorpion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 14; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6.5f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Ranged/Seabow.cs b/Items/Weapons/Ranged/Seabow.cs index 83d15e5146..e1f677c778 100644 --- a/Items/Weapons/Ranged/Seabow.cs +++ b/Items/Weapons/Ranged/Seabow.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 46; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 40; } diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 714c5edd53..5166b370dd 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -25,14 +25,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 5; item.useAnimation = 5; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; item.UseSound = SoundID.Item11; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 16f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.PureGreen; diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index 8683c91dab..f806265a32 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 5; item.useAnimation = 15; item.reuseDelay = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.rare = 5; diff --git a/Items/Weapons/Ranged/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index 9cb2ab7352..fe682ba41b 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -1,5 +1,3 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class SepticSkewer : ModItem + public class SepticSkewer : ModItem { public override void SetStaticDefaults() { @@ -25,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/Shadethrower.cs b/Items/Weapons/Ranged/Shadethrower.cs index 80d3876a84..ccb34cce8a 100644 --- a/Items/Weapons/Ranged/Shadethrower.cs +++ b/Items/Weapons/Ranged/Shadethrower.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 10; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index 7858e7c7f2..d6d1c91932 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 15; item.useTime = 70; item.useAnimation = 70; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Ranged/Shredder.cs b/Items/Weapons/Ranged/Shredder.cs index 36579f487f..adfc43918f 100644 --- a/Items/Weapons/Ranged/Shredder.cs +++ b/Items/Weapons/Ranged/Shredder.cs @@ -26,14 +26,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 4; item.reuseDelay = 12; item.useAnimation = 32; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(1, 20, 0, 0); item.rare = 10; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Ranged/Shroomer.cs b/Items/Weapons/Ranged/Shroomer.cs index 35de462bed..aa8cd532d0 100644 --- a/Items/Weapons/Ranged/Shroomer.cs +++ b/Items/Weapons/Ranged/Shroomer.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 35; item.useTime = 27; item.useAnimation = 27; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 9.75f; item.value = Item.buyPrice(0, 95, 0, 0); item.rare = 9; item.UseSound = SoundID.Item40; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 10f; item.useAmmo = 97; } diff --git a/Items/Weapons/Ranged/Skullmasher.cs b/Items/Weapons/Ranged/Skullmasher.cs index 7208b6c37b..e695dd2781 100644 --- a/Items/Weapons/Ranged/Skullmasher.cs +++ b/Items/Weapons/Ranged/Skullmasher.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { @@ -22,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 60; item.useAnimation = 60; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(1, 80, 0, 0); item.rare = 10; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBlast"); item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Weapons/Ranged/SlagMagnum.cs b/Items/Weapons/Ranged/SlagMagnum.cs index 3c2ef5dd32..5ee03954bf 100644 --- a/Items/Weapons/Ranged/SlagMagnum.cs +++ b/Items/Weapons/Ranged/SlagMagnum.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 7eb0145fe7..38ed410cb8 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 40; item.useTime = 2; item.useAnimation = 2; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(5, 0, 0, 0); diff --git a/Items/Weapons/Ranged/SparkSpreader.cs b/Items/Weapons/Ranged/SparkSpreader.cs index 34ad14ba87..5b9e319afc 100644 --- a/Items/Weapons/Ranged/SparkSpreader.cs +++ b/Items/Weapons/Ranged/SparkSpreader.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 20; item.useTime = 10; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index 60b6c0023b..e6dbb7e5c7 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -1,3 +1,4 @@ +using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 4; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; item.value = Item.buyPrice(0, 95, 0, 0); @@ -34,10 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 931; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool ConsumeAmmo(Player player) { @@ -57,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged Main.projectile[projectile].timeLeft = 200; Main.projectile[projectile].Calamity().forceRanged = true; } - int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.LostSoulFriendly, damage, knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].timeLeft = 600; Main.projectile[proj].Calamity().forceRanged = true; return false; diff --git a/Items/Weapons/Ranged/SpectreRifle.cs b/Items/Weapons/Ranged/SpectreRifle.cs index de4406722f..ff79224e6c 100644 --- a/Items/Weapons/Ranged/SpectreRifle.cs +++ b/Items/Weapons/Ranged/SpectreRifle.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.crit += 22; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7; item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item40; item.autoReuse = false; - item.shoot = 297; + item.shoot = ProjectileID.LostSoulFriendly; item.shootSpeed = 24f; item.useAmmo = 97; } @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, 297, damage, knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.LostSoulFriendly, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].Calamity().forceRanged = true; return false; } diff --git a/Items/Weapons/Ranged/Spyker.cs b/Items/Weapons/Ranged/Spyker.cs index 4cba9ae60c..63674d439d 100644 --- a/Items/Weapons/Ranged/Spyker.cs +++ b/Items/Weapons/Ranged/Spyker.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 13; item.useAnimation = 13; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/StarCannonEX.cs b/Items/Weapons/Ranged/StarCannonEX.cs index 3e7337dc1b..4af049b1e6 100644 --- a/Items/Weapons/Ranged/StarCannonEX.cs +++ b/Items/Weapons/Ranged/StarCannonEX.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.rare = 7; item.noMelee = true; item.knockBack = 8f; diff --git a/Items/Weapons/Ranged/StarSputter.cs b/Items/Weapons/Ranged/StarSputter.cs index a39cf362a0..a100ad0ece 100644 --- a/Items/Weapons/Ranged/StarSputter.cs +++ b/Items/Weapons/Ranged/StarSputter.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 8; item.reuseDelay = 15; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 15f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Ranged/Starfleet.cs b/Items/Weapons/Ranged/Starfleet.cs index bc079179e5..854eec0872 100644 --- a/Items/Weapons/Ranged/Starfleet.cs +++ b/Items/Weapons/Ranged/Starfleet.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 36; item.useTime = 55; item.useAnimation = 55; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 15f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/StarfleetMK2.cs b/Items/Weapons/Ranged/StarfleetMK2.cs index f60078e36b..abb70fb3c5 100644 --- a/Items/Weapons/Ranged/StarfleetMK2.cs +++ b/Items/Weapons/Ranged/StarfleetMK2.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.damage = 222; item.knockBack = 15f; item.shootSpeed = 16f; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useAnimation = 27; item.useTime = 27; item.reuseDelay = 0; diff --git a/Items/Weapons/Ranged/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index 62b679f2a1..2a7feab749 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 40; item.useAnimation = 40; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Ranged/StormDragoon.cs b/Items/Weapons/Ranged/StormDragoon.cs index 15d5db9778..9bca0f55a4 100644 --- a/Items/Weapons/Ranged/StormDragoon.cs +++ b/Items/Weapons/Ranged/StormDragoon.cs @@ -23,14 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTime = 2; item.reuseDelay = 10; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; item.UseSound = SoundID.Item31; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 18f; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.PureGreen; diff --git a/Items/Weapons/Ranged/StormSurge.cs b/Items/Weapons/Ranged/StormSurge.cs index ffabd498be..79b2aeab93 100644 --- a/Items/Weapons/Ranged/StormSurge.cs +++ b/Items/Weapons/Ranged/StormSurge.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.UseSound = SoundID.Item122; diff --git a/Items/Weapons/Ranged/SulphuricAcidCannon.cs b/Items/Weapons/Ranged/SulphuricAcidCannon.cs index aba0c12e73..ef3377c279 100644 --- a/Items/Weapons/Ranged/SulphuricAcidCannon.cs +++ b/Items/Weapons/Ranged/SulphuricAcidCannon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 18; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 6f; item.autoReuse = true; diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 8bffd57e93..c33f24268b 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAnimation = 24; item.reuseDelay = 10; item.useTime = 2; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(5, 0, 0, 0); @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item31; item.autoReuse = true; item.shootSpeed = 12f; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.ItemSpecific; } diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index e85901230c..6ced351bc1 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 92; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Ranged/TerraFlameburster.cs b/Items/Weapons/Ranged/TerraFlameburster.cs index e038769d50..fd01f97192 100644 --- a/Items/Weapons/Ranged/TerraFlameburster.cs +++ b/Items/Weapons/Ranged/TerraFlameburster.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 3; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index be663e605b..e2e2446527 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 70; item.useTime = 22; item.useAnimation = 22; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/TheEmpyrean.cs b/Items/Weapons/Ranged/TheEmpyrean.cs index 01c24d0243..0df599984b 100644 --- a/Items/Weapons/Ranged/TheEmpyrean.cs +++ b/Items/Weapons/Ranged/TheEmpyrean.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 6; item.useAnimation = 18; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.UseSound = SoundID.Item34; diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index ff9cd81e5f..96350ccf26 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 30; item.useTime = 21; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Ranged/ThePack.cs b/Items/Weapons/Ranged/ThePack.cs index 3df35fcff6..6b4b4744c7 100644 --- a/Items/Weapons/Ranged/ThePack.cs +++ b/Items/Weapons/Ranged/ThePack.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 40; item.useTime = 52; item.useAnimation = 52; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(1, 80, 0, 0); diff --git a/Items/Weapons/Ranged/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 2c043519d2..edda608153 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 50; item.useTime = 7; item.useAnimation = 14; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Ranged/TitaniumRailgun.cs b/Items/Weapons/Ranged/TitaniumRailgun.cs index ca588121bf..117e1ae47c 100644 --- a/Items/Weapons/Ranged/TitaniumRailgun.cs +++ b/Items/Weapons/Ranged/TitaniumRailgun.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 32; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index ee6d94767b..96f44bd015 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 1; item.UseSound = SoundID.Item5; item.autoReuse = true; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 15f; item.useAmmo = AmmoID.Arrow; } diff --git a/Items/Weapons/Ranged/Triploon.cs b/Items/Weapons/Ranged/Triploon.cs index ed97b542ef..8b931de2b6 100644 --- a/Items/Weapons/Ranged/Triploon.cs +++ b/Items/Weapons/Ranged/Triploon.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 24; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; item.value = Item.buyPrice(0, 60, 0, 0); @@ -42,24 +42,23 @@ namespace CalamityMod.Items.Weapons.Ranged 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 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num117 = 0.314159274f; - int num118 = 3; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 30f; - bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) - { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) - { - value9 -= vector7; - } - int harpoon = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[harpoon].timeLeft = 300; - } + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float piOverTen = MathHelper.Pi * 0.1f; + int projCount = 3; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= 30f; + bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); + for (int projIndex = 0; projIndex < projCount; projIndex++) + { + float num120 = projIndex - (projCount - 1f) / 2f; + Vector2 offset = velocity.RotatedBy((double)(piOverTen * num120), default); + if (!canHit) + { + offset -= velocity; + } + Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + } return false; } diff --git a/Items/Weapons/Ranged/Triploon.png b/Items/Weapons/Ranged/Triploon.png index e68939e24b..c5e054a398 100644 Binary files a/Items/Weapons/Ranged/Triploon.png and b/Items/Weapons/Ranged/Triploon.png differ diff --git a/Items/Weapons/Ranged/TrueConferenceCall.cs b/Items/Weapons/Ranged/TrueConferenceCall.cs index 1cb6a55de5..e9aa772f86 100644 --- a/Items/Weapons/Ranged/TrueConferenceCall.cs +++ b/Items/Weapons/Ranged/TrueConferenceCall.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 26; item.useTime = 26; item.useAnimation = 26; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 80, 0, 0); @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.UseSound = SoundID.Item38; item.autoReuse = true; item.shootSpeed = 18f; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.useAmmo = 97; item.Calamity().customRarity = CalamityRarity.RareVariant; } diff --git a/Items/Weapons/Ranged/TrueConferenceCall.png b/Items/Weapons/Ranged/TrueConferenceCall.png index a0176dadac..b3ae40d01d 100644 Binary files a/Items/Weapons/Ranged/TrueConferenceCall.png and b/Items/Weapons/Ranged/TrueConferenceCall.png differ diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 501414bdd9..fa56707ae3 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 4000; + item.damage = 4200; item.crit += 35; item.knockBack = 9.5f; item.ranged = true; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged 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, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; } } diff --git a/Items/Weapons/Ranged/Vortexpopper.cs b/Items/Weapons/Ranged/Vortexpopper.cs index 11a8f353fc..18b875c2f6 100644 --- a/Items/Weapons/Ranged/Vortexpopper.cs +++ b/Items/Weapons/Ranged/Vortexpopper.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 22; item.useTime = 16; item.useAnimation = 16; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3.25f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Ranged/WulfrumBow.cs b/Items/Weapons/Ranged/WulfrumBow.cs index a5b7b24805..6462f3e949 100644 --- a/Items/Weapons/Ranged/WulfrumBow.cs +++ b/Items/Weapons/Ranged/WulfrumBow.cs @@ -21,14 +21,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.height = 56; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 1; item.UseSound = SoundID.Item5; item.autoReuse = false; - item.shoot = 10; + item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = 40; } diff --git a/Items/Weapons/Rogue/AccretionDisk.cs b/Items/Weapons/Rogue/AccretionDisk.cs index 32da2c5c22..b9852d9422 100644 --- a/Items/Weapons/Rogue/AccretionDisk.cs +++ b/Items/Weapons/Rogue/AccretionDisk.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 9f; item.UseSound = SoundID.Item1; @@ -35,6 +36,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs b/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs index 0d6c75b87d..771fcdcee7 100644 --- a/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs +++ b/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 3.25f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/AlphaVirus.cs b/Items/Weapons/Rogue/AlphaVirus.cs index a2563c0223..fcb64f6b27 100644 --- a/Items/Weapons/Rogue/AlphaVirus.cs +++ b/Items/Weapons/Rogue/AlphaVirus.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 31; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 31; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index 776dfbb294..aa832fd900 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 100; + item.damage = 120; item.shootSpeed = 15f; item.shoot = ModContent.ProjectileType(); item.width = 66; item.height = 64; - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 24; + item.useAnimation = 24; item.useStyle = 1; item.knockBack = 10f; item.crit = 20; diff --git a/Items/Weapons/Rogue/AshenStalactite.cs b/Items/Weapons/Rogue/AshenStalactite.cs index a41677b24f..e7ddae13ff 100644 --- a/Items/Weapons/Rogue/AshenStalactite.cs +++ b/Items/Weapons/Rogue/AshenStalactite.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index 1715ae47ab..8753a50292 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -2,14 +2,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BallisticPoisonBomb : RogueWeapon + public class BallisticPoisonBomb : RogueWeapon { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.knockBack = 6.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.png b/Items/Weapons/Rogue/BallisticPoisonBomb.png index 6f037bb9f6..3534f76575 100644 Binary files a/Items/Weapons/Rogue/BallisticPoisonBomb.png and b/Items/Weapons/Rogue/BallisticPoisonBomb.png differ diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index 8e22e2eb93..2426848aad 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 1; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4f; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 4; diff --git a/Items/Weapons/Rogue/BloodsoakedCrasher.cs b/Items/Weapons/Rogue/BloodsoakedCrasher.cs index 175fd54ac9..fc756358c2 100644 --- a/Items/Weapons/Rogue/BloodsoakedCrasher.cs +++ b/Items/Weapons/Rogue/BloodsoakedCrasher.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/BouncySpikyBall.cs b/Items/Weapons/Rogue/BouncySpikyBall.cs index ab8d132080..e7ea6bde8c 100644 --- a/Items/Weapons/Rogue/BouncySpikyBall.cs +++ b/Items/Weapons/Rogue/BouncySpikyBall.cs @@ -23,7 +23,7 @@ Stealth strikes provide a bigger boost after richocheting"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/BrackishFlask.cs b/Items/Weapons/Rogue/BrackishFlask.cs index 2ac0c49937..1f63de6c31 100644 --- a/Items/Weapons/Rogue/BrackishFlask.cs +++ b/Items/Weapons/Rogue/BrackishFlask.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BrackishFlask : RogueWeapon + public class BrackishFlask : RogueWeapon { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 35; item.knockBack = 6.5f; item.UseSound = SoundID.Item106; diff --git a/Items/Weapons/Rogue/Brimblade.cs b/Items/Weapons/Rogue/Brimblade.cs index 3c0f1faf82..07aa7437e5 100644 --- a/Items/Weapons/Rogue/Brimblade.cs +++ b/Items/Weapons/Rogue/Brimblade.cs @@ -2,14 +2,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Brimblade : RogueWeapon + public class Brimblade : RogueWeapon { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 6.5f; item.UseSound = SoundID.Item1; @@ -48,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue for (int i = -6; i <= 6; i += 4) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage / 2, knockBack * 0.5f, player.whoAmI, 0f, 0f); + int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, knockBack * 0.5f, player.whoAmI, 0f, 0f); Main.projectile[dart].Calamity().forceRogue = true; } return false; diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index de2370dae1..b74e338755 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 4bfccb67fe..75c4160d02 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 21; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 7; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Cinquedea.cs b/Items/Weapons/Rogue/Cinquedea.cs index cccb5f564d..94dde06ab3 100644 --- a/Items/Weapons/Rogue/Cinquedea.cs +++ b/Items/Weapons/Rogue/Cinquedea.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = true; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 32; item.height = 32; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/CobaltKunai.cs b/Items/Weapons/Rogue/CobaltKunai.cs index f7d71dc102..ce7d94d42c 100644 --- a/Items/Weapons/Rogue/CobaltKunai.cs +++ b/Items/Weapons/Rogue/CobaltKunai.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 74e7573bc9..5429079bfc 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 3f; item.UseSound = SoundID.Item1; @@ -46,7 +46,8 @@ 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) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + int dagger = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[dagger].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } } diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 68dd1c60d6..2f0e296443 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 2; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.UseSound = SoundID.Item109; item.autoReuse = true; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 28f; - item.rare = 9; item.Calamity().rogue = true; item.Calamity().customRarity = CalamityRarity.PureGreen; } diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index fa34c83b75..2a1e7a4ca2 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -19,12 +19,12 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 50; item.height = 50; - item.damage = 140; + item.damage = 120; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 4f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/CrushsawCrasher.cs b/Items/Weapons/Rogue/CrushsawCrasher.cs index 7b97756049..d1adf9c3dd 100644 --- a/Items/Weapons/Rogue/CrushsawCrasher.cs +++ b/Items/Weapons/Rogue/CrushsawCrasher.cs @@ -1,14 +1,13 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CrushsawCrasher : RogueWeapon + public class CrushsawCrasher : RogueWeapon { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.width = 38; item.damage = 65; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 7f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/CrystalPiercer.cs b/Items/Weapons/Rogue/CrystalPiercer.cs index 1e5d561b4d..f27d2da7f3 100644 --- a/Items/Weapons/Rogue/CrystalPiercer.cs +++ b/Items/Weapons/Rogue/CrystalPiercer.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 17; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 17; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index ebfb1e7d4c..675602ca33 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -18,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 44; - item.damage = 18; + item.damage = 16; item.crit += 4; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/CursedDagger.cs b/Items/Weapons/Rogue/CursedDagger.cs index 3e90bd3c16..9cee3f0275 100644 --- a/Items/Weapons/Rogue/CursedDagger.cs +++ b/Items/Weapons/Rogue/CursedDagger.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 16; item.knockBack = 4.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/DeepSeaDumbbell.cs b/Items/Weapons/Rogue/DeepSeaDumbbell.cs index e0814e9fd0..5beb803159 100644 --- a/Items/Weapons/Rogue/DeepSeaDumbbell.cs +++ b/Items/Weapons/Rogue/DeepSeaDumbbell.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.knockBack = 16f; item.UseSound = SoundID.Item1; @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.altFunctionUse == 2) { - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.useAnimation = 45; item.useTime = 45; item.noMelee = false; @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Rogue } else { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useAnimation = 25; item.useTime = 25; item.noMelee = true; diff --git a/Items/Weapons/Rogue/DeepWounder.cs b/Items/Weapons/Rogue/DeepWounder.cs index 9b33d8e8bb..75e9dbdf5c 100644 --- a/Items/Weapons/Rogue/DeepWounder.cs +++ b/Items/Weapons/Rogue/DeepWounder.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 23; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 23; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index d3d5a54a0c..57524c28af 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -2,12 +2,11 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; -using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Rogue { - public class DefectiveSphere : RogueWeapon + public class DefectiveSphere : RogueWeapon { public static int BaseDamage = 130; public static float Speed = 15f; @@ -33,7 +32,7 @@ Stealth strikes launch all 4 sphere types at once"); item.noUseGraphic = true; item.maxStack = 5; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item15; //phaseblade sound effect item.value = Item.buyPrice(0, 16, 0, 0); diff --git a/Items/Weapons/Rogue/DeificThunderbolt.cs b/Items/Weapons/Rogue/DeificThunderbolt.cs index ff69272bda..4647493c50 100644 --- a/Items/Weapons/Rogue/DeificThunderbolt.cs +++ b/Items/Weapons/Rogue/DeificThunderbolt.cs @@ -26,7 +26,7 @@ Stealth strikes summon more lightning and travel faster"); item.width = 56; item.height = 56; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/DukesDecapitator.cs b/Items/Weapons/Rogue/DukesDecapitator.cs index 172f95619b..ce7038a314 100644 --- a/Items/Weapons/Rogue/DukesDecapitator.cs +++ b/Items/Weapons/Rogue/DukesDecapitator.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items; using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue @@ -29,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.knockBack = 2f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/DuneHopper.cs b/Items/Weapons/Rogue/DuneHopper.cs index 3d2a64850a..9c44f3eb67 100644 --- a/Items/Weapons/Rogue/DuneHopper.cs +++ b/Items/Weapons/Rogue/DuneHopper.cs @@ -22,7 +22,7 @@ Stealth strikes throw three high speed spears"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.knockBack = 4f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index 9c5cbb4799..a01a81e3f0 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.knockBack = 5f; item.UseSound = SoundID.Item106; diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index 981ad55e52..50ab8f9f39 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 21; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 21; item.knockBack = 3.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index f114c903d6..9a3ad6e804 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 3f; item.UseSound = SoundID.Item39; @@ -94,7 +94,8 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } return false; } diff --git a/Items/Weapons/Rogue/EnchantedAxe.cs b/Items/Weapons/Rogue/EnchantedAxe.cs index 675f181ad6..f5f217b07c 100644 --- a/Items/Weapons/Rogue/EnchantedAxe.cs +++ b/Items/Weapons/Rogue/EnchantedAxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Equanimity.cs b/Items/Weapons/Rogue/Equanimity.cs index 7fa5f35f71..1edee00726 100644 --- a/Items/Weapons/Rogue/Equanimity.cs +++ b/Items/Weapons/Rogue/Equanimity.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 21d7a99cbc..5d89e84644 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.knockBack = 7f; item.UseSound = SoundID.Item1; @@ -36,6 +36,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.PureGreen; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Vector2 origin = new Vector2(31f, 29f); diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index d2345619d0..3249a74251 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 3; item.useAnimation = 9; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6.75f; item.UseSound = SoundID.Item73; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index c5f92cfc24..f5e8a70cdc 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Exorcism : RogueWeapon + public class Exorcism : RogueWeapon { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index 6da32df8f8..22df27c2bb 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -26,7 +26,7 @@ Stealth strikes release more souls and leave behind souls as they travel"); item.noUseGraphic = true; item.useAnimation = 16; item.useTime = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 6f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/FeatherKnife.cs b/Items/Weapons/Rogue/FeatherKnife.cs index ae66ad6dda..1db009fbf7 100644 --- a/Items/Weapons/Rogue/FeatherKnife.cs +++ b/Items/Weapons/Rogue/FeatherKnife.cs @@ -24,7 +24,7 @@ Stealth strike throws a volley of knives"); item.consumable = true; item.noUseGraphic = true; item.useAnimation = 11; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 2f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/FinalDawn.cs b/Items/Weapons/Rogue/FinalDawn.cs index 9911cfcbbf..1b05b1c4e2 100644 --- a/Items/Weapons/Rogue/FinalDawn.cs +++ b/Items/Weapons/Rogue/FinalDawn.cs @@ -1,7 +1,6 @@ using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; -using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Rogue diff --git a/Items/Weapons/Rogue/FlameScythe.cs b/Items/Weapons/Rogue/FlameScythe.cs index 55d7aa87c8..d56eeac022 100644 --- a/Items/Weapons/Rogue/FlameScythe.cs +++ b/Items/Weapons/Rogue/FlameScythe.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 21; item.useAnimation = 21; item.knockBack = 8.5f; @@ -34,6 +35,14 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 141f26064a..bd9f0a5943 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -31,7 +31,7 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl item.useAnimation = 19; item.width = 32; item.height = 46; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.autoReuse = true; item.shootSpeed = Speed; diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index 3ab0ab8e20..8aa60e0f39 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 22; item.useTime = 16; item.useAnimation = 16; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTurn = false; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/GalaxySmasherRogue.cs b/Items/Weapons/Rogue/GalaxySmasherRogue.cs index f5bbadb4c6..5cdc9bc5e8 100644 --- a/Items/Weapons/Rogue/GalaxySmasherRogue.cs +++ b/Items/Weapons/Rogue/GalaxySmasherRogue.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; @@ -47,6 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/GelDart.cs b/Items/Weapons/Rogue/GelDart.cs index 0099ee01c2..dc0f702264 100644 --- a/Items/Weapons/Rogue/GelDart.cs +++ b/Items/Weapons/Rogue/GelDart.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GelDart : RogueWeapon + public class GelDart : RogueWeapon { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 11; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 11; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index d310cb8223..318f5099a1 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 12; item.useTime = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/GildedDagger.cs b/Items/Weapons/Rogue/GildedDagger.cs index ca9c877ca0..5c9d62a210 100644 --- a/Items/Weapons/Rogue/GildedDagger.cs +++ b/Items/Weapons/Rogue/GildedDagger.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index b4b51fe8b8..aba7b11d9a 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -31,7 +31,7 @@ Stealth strikes are super fast and pierce infinitely"); item.height = 1; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = Knockback; item.value = Item.buyPrice(0, 1, 40, 0); item.rare = 3; diff --git a/Items/Weapons/Rogue/GleamingDagger.cs b/Items/Weapons/Rogue/GleamingDagger.cs index d9a9c5f93c..18698a1eae 100644 --- a/Items/Weapons/Rogue/GleamingDagger.cs +++ b/Items/Weapons/Rogue/GleamingDagger.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 8e3b212583..93859a760f 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -1,4 +1,3 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +9,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class GodsParanoia : RogueWeapon + public class GodsParanoia : RogueWeapon { private static int damage = 125; private static int knockBack = 5; @@ -34,7 +33,7 @@ Right click to delete all existing spiky balls"); item.height = 1; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = knockBack; item.value = Item.buyPrice(0, 18, 0, 0); item.rare = 10; @@ -48,44 +47,28 @@ Right click to delete all existing spiky balls"); } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 5f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -96,6 +79,8 @@ Right click to delete all existing spiky balls"); public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.cs b/Items/Weapons/Rogue/HardenedHoneycomb.cs index bd004f53b3..33c9bf8f2e 100644 --- a/Items/Weapons/Rogue/HardenedHoneycomb.cs +++ b/Items/Weapons/Rogue/HardenedHoneycomb.cs @@ -25,7 +25,7 @@ Stealth strikes can bounce off walls and enemies"); item.noUseGraphic = true; item.useAnimation = 21; item.useTime = 21; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 3f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 151d519d3c..95ec66c1ef 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index d6e73f5fea..3f9fd0407f 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -1,4 +1,3 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +8,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class HellsSun : RogueWeapon + public class HellsSun : RogueWeapon { private static int damage = 84; private static int knockBack = 5; @@ -35,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 1; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = knockBack; item.value = Item.buyPrice(0, 12, 0, 0); item.rare = 10; @@ -46,47 +45,30 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 5f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 5f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * SdamageMult), knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -99,6 +81,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 1f7e04b2a3..889e1246ea 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -2,14 +2,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Hypothermia : RogueWeapon + public class Hypothermia : RogueWeapon { private int counter = 0; private bool justStealthStriked = false; diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index 9f7117c81b..4a082ccfeb 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class IceStar : RogueWeapon + public class IceStar : RogueWeapon { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 12; item.crit = 7; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Icebreaker.cs b/Items/Weapons/Rogue/Icebreaker.cs index 718e7eff2d..a1aa6a5137 100644 --- a/Items/Weapons/Rogue/Icebreaker.cs +++ b/Items/Weapons/Rogue/Icebreaker.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.knockBack = 6.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index c587177e6a..fa902a23b9 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 3809a131e7..7b369ce570 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.consumable = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/IronFrancisca.cs b/Items/Weapons/Rogue/IronFrancisca.cs index 57302003c7..810a99d3e8 100644 --- a/Items/Weapons/Rogue/IronFrancisca.cs +++ b/Items/Weapons/Rogue/IronFrancisca.cs @@ -18,19 +18,19 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 8; + item.damage = 7; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = false; item.height = 36; item.maxStack = 999; - item.value = 1000; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 0; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/JawsOfOblivion.cs b/Items/Weapons/Rogue/JawsOfOblivion.cs index f4533bd13c..ec15ef1d98 100644 --- a/Items/Weapons/Rogue/JawsOfOblivion.cs +++ b/Items/Weapons/Rogue/JawsOfOblivion.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index f8dad5bc9b..0f170ce3fa 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.knockBack = 4f; item.UseSound = SoundID.Item1; @@ -43,7 +43,8 @@ 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) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index fbb8eb6a17..046cc17f12 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.useAnimation = 25; item.width = 32; item.height = 46; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.shootSpeed = Speed; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/LatcherMine.cs b/Items/Weapons/Rogue/LatcherMine.cs index 4275b2264e..f2437be008 100644 --- a/Items/Weapons/Rogue/LatcherMine.cs +++ b/Items/Weapons/Rogue/LatcherMine.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class LatcherMine : RogueWeapon + public class LatcherMine : RogueWeapon { public const int BaseDamage = 80; public override void SetStaticDefaults() diff --git a/Items/Weapons/Rogue/LeadTomahawk.cs b/Items/Weapons/Rogue/LeadTomahawk.cs index 414d6034d9..fa1580de50 100644 --- a/Items/Weapons/Rogue/LeadTomahawk.cs +++ b/Items/Weapons/Rogue/LeadTomahawk.cs @@ -18,19 +18,19 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 8; + item.damage = 7; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = false; item.height = 36; item.maxStack = 999; - item.value = 1000; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 0; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 9fb0b301b7..3155da29e8 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -1,7 +1,6 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index 5c8743f064..4bde96dd81 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Lionfish.cs b/Items/Weapons/Rogue/Lionfish.cs index d56a67f756..28db5d8cd3 100644 --- a/Items/Weapons/Rogue/Lionfish.cs +++ b/Items/Weapons/Rogue/Lionfish.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 22; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index 94a1f5dc91..cbebf08305 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -1,17 +1,12 @@ -using System; -using System.Collections.Generic; -using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class LuminousStriker : RogueWeapon + public class LuminousStriker : RogueWeapon { public override void SetStaticDefaults() { @@ -30,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 30; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/LunarKunai.cs b/Items/Weapons/Rogue/LunarKunai.cs index 9419c1db49..8ede908a84 100644 --- a/Items/Weapons/Rogue/LunarKunai.cs +++ b/Items/Weapons/Rogue/LunarKunai.cs @@ -1,16 +1,13 @@ using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items; using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class LunarKunai : RogueWeapon + public class LunarKunai : RogueWeapon { public override void SetStaticDefaults() { @@ -30,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.knockBack = 2f; item.UseSound = SoundID.Item39; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 71d9c69bcc..f4094c5815 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 10; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 1.25f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index 5a0d797ec6..e9fbe78f30 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; @@ -33,6 +34,14 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/MetalMonstrosity.cs b/Items/Weapons/Rogue/MetalMonstrosity.cs index b1683fed4f..1062543202 100644 --- a/Items/Weapons/Rogue/MetalMonstrosity.cs +++ b/Items/Weapons/Rogue/MetalMonstrosity.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Rogue/MeteorFist.cs b/Items/Weapons/Rogue/MeteorFist.cs index d7fa48ea95..52455782c0 100644 --- a/Items/Weapons/Rogue/MeteorFist.cs +++ b/Items/Weapons/Rogue/MeteorFist.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.useTurn = true; item.noUseGraphic = true; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 30; item.knockBack = 5.75f; item.UseSound = SoundID.Item20; diff --git a/Items/Weapons/Rogue/MoltenAmputator.cs b/Items/Weapons/Rogue/MoltenAmputator.cs index 7b3cd734cb..e64c29892c 100644 --- a/Items/Weapons/Rogue/MoltenAmputator.cs +++ b/Items/Weapons/Rogue/MoltenAmputator.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 9f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/MonkeyDarts.cs b/Items/Weapons/Rogue/MonkeyDarts.cs index b6cfcb5c74..4a1025cd8f 100644 --- a/Items/Weapons/Rogue/MonkeyDarts.cs +++ b/Items/Weapons/Rogue/MonkeyDarts.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.maxStack = 999; item.width = 27; item.height = 27; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.useTime = 20; item.useAnimation = 20; diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index 3a8af59781..0613df6623 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 5; item.useAnimation = 5; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 1.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/MythrilKnife.cs b/Items/Weapons/Rogue/MythrilKnife.cs index 51eab369d3..032f75a77d 100644 --- a/Items/Weapons/Rogue/MythrilKnife.cs +++ b/Items/Weapons/Rogue/MythrilKnife.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.knockBack = 1.75f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/NanoblackReaperRogue.cs b/Items/Weapons/Rogue/NanoblackReaperRogue.cs index c2ea74d77f..13cfc320d5 100644 --- a/Items/Weapons/Rogue/NanoblackReaperRogue.cs +++ b/Items/Weapons/Rogue/NanoblackReaperRogue.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item18; item.rare = 10; @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/NastyCholla.cs b/Items/Weapons/Rogue/NastyCholla.cs index 0cee08e76c..95cea7ae77 100644 --- a/Items/Weapons/Rogue/NastyCholla.cs +++ b/Items/Weapons/Rogue/NastyCholla.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class NastyCholla : RogueWeapon + public class NastyCholla : RogueWeapon { public static int BaseDamage = 9; @@ -29,7 +28,7 @@ Stealth strikes throw five at once"); item.maxStack = 999; item.consumable = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index f8f924b92a..275f6b3f85 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 2f7048ba92..687670d704 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 1f; item.UseSound = SoundID.Item1; @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { - for (int j = 0; j < item.stack - player.ownedProjectileCounts[item.shoot]; j++) + for (int j = 0; j < item.stack - player.ownedProjectileCounts[ModContent.ProjectileType()]; j++) { float spread = 2; int pIndex = Projectile.NewProjectile(position.X, position.Y, speedX + Main.rand.NextFloat(-spread, spread), speedY + Main.rand.NextFloat(-spread, spread), type, damage, knockBack, player.whoAmI, 0f, 1f); @@ -79,10 +79,22 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - public override bool CanUseItem(Player player) - { - return player.ownedProjectileCounts[item.shoot] < item.stack && player.altFunctionUse != 2; - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } + else + { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 6f; + int UseMax = item.stack; + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; + } + } public override void AddRecipes() { diff --git a/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs b/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs index 08f2fae2a7..55afca0c10 100644 --- a/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs +++ b/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 13; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 2f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 24; - item.shoot = 330; + item.shoot = ProjectileID.StarAnise; item.maxStack = 999; item.value = 1200; item.rare = 4; diff --git a/Items/Weapons/Rogue/PalladiumJavelin.cs b/Items/Weapons/Rogue/PalladiumJavelin.cs index 7f5c32987b..ea6eb6f105 100644 --- a/Items/Weapons/Rogue/PalladiumJavelin.cs +++ b/Items/Weapons/Rogue/PalladiumJavelin.cs @@ -21,13 +21,13 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.knockBack = 5.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 44; - item.shoot = 330; + item.shoot = ProjectileID.StarAnise; item.maxStack = 999; item.value = 1200; item.rare = 4; diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index dcfde784da..76c004631d 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -1,15 +1,14 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Penumbra : RogueWeapon + public class Penumbra : RogueWeapon { public static float ShootSpeed = 8f; public override void SetStaticDefaults() diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index 7b6882864b..f7806b6747 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -24,7 +24,7 @@ Stealth strikes summon ghost clones instead of lost souls"); item.width = 102; item.height = 98; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs index bb4ca73c94..616cf7307c 100644 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -20,12 +20,12 @@ Stealth strikes don't slow down and souls always deal full damage"); public override void SafeSetDefaults() { - item.damage = 60; + item.damage = 70; item.knockBack = 5f; item.width = 62; item.height = 68; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/Plaguenade.cs b/Items/Weapons/Rogue/Plaguenade.cs index b181d4091a..8c162bf461 100644 --- a/Items/Weapons/Rogue/Plaguenade.cs +++ b/Items/Weapons/Rogue/Plaguenade.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.consumable = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1.5f; item.maxStack = 999; diff --git a/Items/Weapons/Rogue/PoisonPack.cs b/Items/Weapons/Rogue/PoisonPack.cs index 07e2541d12..16ffc490fa 100644 --- a/Items/Weapons/Rogue/PoisonPack.cs +++ b/Items/Weapons/Rogue/PoisonPack.cs @@ -1,15 +1,13 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class PoisonPack : RogueWeapon + public class PoisonPack : RogueWeapon { private static int damage = 20; private static float knockBack = 1.8f; @@ -33,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 14; item.useTime = 19; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = knockBack; item.value = Item.buyPrice(0, 0, 33, 0); item.rare = 1; @@ -42,47 +40,30 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 7f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -93,6 +74,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index ed28e0d7c6..bb0c0bbc19 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index f419ac7ed7..39a2dcb009 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; @@ -24,7 +24,7 @@ Stealth strikes spawn smaller spears to fly along side it"); item.width = 56; item.height = 56; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/ProfanedTrident.cs b/Items/Weapons/Rogue/ProfanedTrident.cs index 13ca758e8b..2eb6842430 100644 --- a/Items/Weapons/Rogue/ProfanedTrident.cs +++ b/Items/Weapons/Rogue/ProfanedTrident.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 13; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Pwnagehammer.cs b/Items/Weapons/Rogue/Pwnagehammer.cs index 22c306977d..c3a55d46f6 100644 --- a/Items/Weapons/Rogue/Pwnagehammer.cs +++ b/Items/Weapons/Rogue/Pwnagehammer.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 10f; item.UseSound = SoundID.Item1; @@ -33,6 +34,14 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/Quasar.cs b/Items/Weapons/Rogue/Quasar.cs index 37a02673c9..18d82acb66 100644 --- a/Items/Weapons/Rogue/Quasar.cs +++ b/Items/Weapons/Rogue/Quasar.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 0f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 9423226319..144a4ad26a 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index b5a5b7294f..f646a017cb 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class RegulusRiot : RogueWeapon + public class RegulusRiot : RogueWeapon { public override void SetStaticDefaults() { @@ -23,7 +22,7 @@ Stealth strikes explode into energy stars"); item.width = 28; item.height = 34; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index ba11775685..e0bcb51f9a 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -1,7 +1,13 @@ +using CalamityMod.Items; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using Terraria; +using Terraria.DataStructures; using Terraria.ModLoader; +using Terraria.ModLoader.IO; +using Terraria.Utilities; namespace CalamityMod.Items.Weapons.Rogue { public abstract class RogueWeapon : ModItem @@ -10,6 +16,48 @@ namespace CalamityMod.Items.Weapons.Rogue { } + public float StealthStrikeDamage; + + public RogueWeapon() + { + StealthStrikeDamage = 1f; + } + + public override ModItem Clone(Item itemClone) + { + RogueWeapon myClone = (RogueWeapon)base.Clone(itemClone); + myClone.StealthStrikeDamage = StealthStrikeDamage; + return myClone; + } + + public override int ChoosePrefix(UnifiedRandom rand) + { + WeightedRandom newPrefix = new WeightedRandom(); + newPrefix.Add("Pointy", 1); + newPrefix.Add("Sharp", 1); + newPrefix.Add("Feathered", 1); + newPrefix.Add("Sleek", 1); + newPrefix.Add("Hefty", 1); + newPrefix.Add("Mighty", 1); + newPrefix.Add("Glorious", 1); + newPrefix.Add("Serrated", 1); + newPrefix.Add("Vicious", 1); + newPrefix.Add("Lethal", 1); + newPrefix.Add("Flawless", 1); + newPrefix.Add("Radical", 1); + newPrefix.Add("Blunt", 1); + newPrefix.Add("Flimsy", 1); + newPrefix.Add("Unbalanced", 1); + newPrefix.Add("Atrocious", 1); + return mod.GetPrefix(newPrefix).Type; + } + + public override bool NewPreReforge() + { + StealthStrikeDamage = 1f; + return true; + } + public sealed override void SetDefaults() { SafeSetDefaults(); @@ -26,6 +74,11 @@ namespace CalamityMod.Items.Weapons.Rogue public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { add += player.Calamity().throwingDamage - 1f; + //Boost (or lower) the weapon's damage if it has a stealth strike available and an associated prefix + if (player.Calamity().StealthStrikeAvailable() && item.prefix > 0) + { + mult += StealthStrikeDamage - 1f; + } } // Simply add the player's dedicated rogue crit chance. @@ -55,6 +108,27 @@ namespace CalamityMod.Items.Weapons.Rogue string damageWord = splitText.Last(); tt.text = damageValue + " rogue " + damageWord; } + if (item.prefix > 0) + { + float ssDmgBoost = StealthStrikeDamage - 1f; + if (ssDmgBoost > 0) + { + TooltipLine StealthBonus = new TooltipLine(mod, "PrefixSSDmg", "+" + Math.Round(ssDmgBoost * 100f) + "% stealth strike damage") + { + isModifier = true + }; + tooltips.Add(StealthBonus); + } + else if (ssDmgBoost < 0) + { + TooltipLine StealthBonus = new TooltipLine(mod, "PrefixSSDmg", "-" + Math.Round(Math.Abs(ssDmgBoost) * 100f) + "% stealth strike damage") + { + isModifier = true, + isModifierBad = true + }; + tooltips.Add(StealthBonus); + } + } } public override bool ConsumeItem(Player player) diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index b3f9d4383d..66ae3177ef 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 13; item.crit = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 2814bc4c33..03098ed750 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 3f; item.UseSound = SoundID.Item39; @@ -93,7 +93,8 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } return false; } diff --git a/Items/Weapons/Rogue/SandDollar.cs b/Items/Weapons/Rogue/SandDollar.cs index 2ca96a4d0f..919b973711 100644 --- a/Items/Weapons/Rogue/SandDollar.cs +++ b/Items/Weapons/Rogue/SandDollar.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SandDollar : RogueWeapon + public class SandDollar : RogueWeapon { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.maxStack = 2; item.knockBack = 3.5f; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Sandslasher.cs b/Items/Weapons/Rogue/Sandslasher.cs index 62169b918c..e9d124a1bc 100644 --- a/Items/Weapons/Rogue/Sandslasher.cs +++ b/Items/Weapons/Rogue/Sandslasher.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; @@ -29,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index 5f760e2c66..0cfb18d8a9 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 60; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 60; item.knockBack = 8f; item.UseSound = SoundID.Item60; diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index 9be81be0ae..a126f5de1d 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 20; item.knockBack = 5f; item.UseSound = SoundID.Item109; @@ -39,7 +39,8 @@ 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) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index 93fbb34f65..f921a3f08b 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -22,7 +22,7 @@ Stealth strikes gain damage as they damage enemies"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 3.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ScourgeoftheSeas.cs b/Items/Weapons/Rogue/ScourgeoftheSeas.cs index 723b7a3c03..1ceaa3e5f5 100644 --- a/Items/Weapons/Rogue/ScourgeoftheSeas.cs +++ b/Items/Weapons/Rogue/ScourgeoftheSeas.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 3.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/SeafoamBomb.cs b/Items/Weapons/Rogue/SeafoamBomb.cs index a51080fc3b..3949f42128 100644 --- a/Items/Weapons/Rogue/SeafoamBomb.cs +++ b/Items/Weapons/Rogue/SeafoamBomb.cs @@ -24,7 +24,7 @@ Stealth strikes are faster and explode into 5 bubbles"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 25; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 3574841393..d56a78eca5 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 47; + item.damage = 169; item.knockBack = 5f; item.useAnimation = item.useTime = 25; item.useStyle = 1; diff --git a/Items/Weapons/Rogue/SeashellBoomerang.cs b/Items/Weapons/Rogue/SeashellBoomerang.cs index cd9eb3a0c4..3f5f16ef1f 100644 --- a/Items/Weapons/Rogue/SeashellBoomerang.cs +++ b/Items/Weapons/Rogue/SeashellBoomerang.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 5.5f; item.UseSound = SoundID.Item1; @@ -32,6 +33,14 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index ec10eaa50e..5bd1692dad 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 12; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ShinobiBlade.cs b/Items/Weapons/Rogue/ShinobiBlade.cs index d54227b538..49d9401678 100644 --- a/Items/Weapons/Rogue/ShinobiBlade.cs +++ b/Items/Weapons/Rogue/ShinobiBlade.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ShockGrenade.cs b/Items/Weapons/Rogue/ShockGrenade.cs index f607055862..7c004ec3f2 100644 --- a/Items/Weapons/Rogue/ShockGrenade.cs +++ b/Items/Weapons/Rogue/ShockGrenade.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ShockGrenade : RogueWeapon + public class ShockGrenade : RogueWeapon { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.consumable = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Shroomerang.cs b/Items/Weapons/Rogue/Shroomerang.cs index da2051445a..77e213a379 100644 --- a/Items/Weapons/Rogue/Shroomerang.cs +++ b/Items/Weapons/Rogue/Shroomerang.cs @@ -23,7 +23,7 @@ Stealth strikes grant the Mushy buff to the user on enemy hits and summon homing item.noUseGraphic = true; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 1.5f; item.UseSound = SoundID.Item1; item.height = 50; diff --git a/Items/Weapons/Rogue/SkyStabber.cs b/Items/Weapons/Rogue/SkyStabber.cs index 1c58dc7cd6..a20ed6cf8f 100644 --- a/Items/Weapons/Rogue/SkyStabber.cs +++ b/Items/Weapons/Rogue/SkyStabber.cs @@ -1,4 +1,3 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +8,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class SkyStabber : RogueWeapon + public class SkyStabber : RogueWeapon { private static int damage = 50; private static int knockBack = 2; @@ -33,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 1; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = knockBack; item.value = Item.buyPrice(0, 1, 0, 0); item.rare = 3; @@ -42,47 +41,30 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 2f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 2f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -93,6 +75,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/SkyfinBombers.cs b/Items/Weapons/Rogue/SkyfinBombers.cs index 9179e00dac..dc798627a2 100644 --- a/Items/Weapons/Rogue/SkyfinBombers.cs +++ b/Items/Weapons/Rogue/SkyfinBombers.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SkyfinBombers : RogueWeapon + public class SkyfinBombers : RogueWeapon { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 35; item.knockBack = 6.5f; item.UseSound = SoundID.Item11; diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index f2bb5e884d..1da1868d16 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.consumable = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 1f; item.autoReuse = true; @@ -39,7 +39,7 @@ 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) { - Main.PlaySound(4, (int)player.position.X, (int)player.position.Y, 9, 2, 0); + Main.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 9, 2, 0); if (player.Calamity().StealthStrikeAvailable()) { diff --git a/Items/Weapons/Rogue/SnapClam.cs b/Items/Weapons/Rogue/SnapClam.cs index db23091342..bce343461f 100644 --- a/Items/Weapons/Rogue/SnapClam.cs +++ b/Items/Weapons/Rogue/SnapClam.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SnapClam : RogueWeapon + public class SnapClam : RogueWeapon { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 3f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index 091b67d2f4..8801178ce1 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 2f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/SpearofPaleolith.cs b/Items/Weapons/Rogue/SpearofPaleolith.cs index d00e413d90..bc6571ad50 100644 --- a/Items/Weapons/Rogue/SpearofPaleolith.cs +++ b/Items/Weapons/Rogue/SpearofPaleolith.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 27; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 27; item.knockBack = 6f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 7f2eb59c11..98ac50f628 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 38; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 38; item.knockBack = 10f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/StellarContemptRogue.cs b/Items/Weapons/Rogue/StellarContemptRogue.cs index 307f59266f..2e4725eb2f 100644 --- a/Items/Weapons/Rogue/StellarContemptRogue.cs +++ b/Items/Weapons/Rogue/StellarContemptRogue.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.rare = 10; @@ -45,6 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index 8593ddf729..1dce4dda87 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 9; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 9; item.knockBack = 4f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/StickySpikyBall.cs b/Items/Weapons/Rogue/StickySpikyBall.cs index 699c5afac6..28f78f1baf 100644 --- a/Items/Weapons/Rogue/StickySpikyBall.cs +++ b/Items/Weapons/Rogue/StickySpikyBall.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class StickySpikyBall : RogueWeapon + public class StickySpikyBall : RogueWeapon { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ Stealth strikes throw seven at once and last a lot longer"); item.maxStack = 999; item.consumable = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index d728326a52..65e3b12d14 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.value = Item.buyPrice(0, 30, 0, 0); item.rare = 5; diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index 7fa1cfc232..b2b02583b7 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -25,7 +25,7 @@ Stealth strikes release energy as they fly"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 24; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 24; item.knockBack = 8f; item.UseSound = SoundID.Item15; diff --git a/Items/Weapons/Rogue/SylvanSlasher.cs b/Items/Weapons/Rogue/SylvanSlasher.cs index f05db9a4c8..1f7169befb 100644 --- a/Items/Weapons/Rogue/SylvanSlasher.cs +++ b/Items/Weapons/Rogue/SylvanSlasher.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { @@ -23,7 +24,7 @@ Does not consume stealth and cannot stealth strike"); item.noUseGraphic = true; item.channel = true; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.useTime = 5; item.knockBack = 3f; item.autoReuse = false; diff --git a/Items/Weapons/Rogue/TarragonThrowingDart.cs b/Items/Weapons/Rogue/TarragonThrowingDart.cs index cd92a35639..0c40848ac3 100644 --- a/Items/Weapons/Rogue/TarragonThrowingDart.cs +++ b/Items/Weapons/Rogue/TarragonThrowingDart.cs @@ -24,7 +24,7 @@ Stealth strikes erupt into thorns on enemy hits"); item.consumable = true; item.noUseGraphic = true; item.useAnimation = 11; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 11; item.knockBack = 4.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index 84124fafee..6396bcb0ad 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -31,7 +31,7 @@ A max of three disks can be active at a time"); item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; item.value = Item.buyPrice(0, 80, 0, 0); @@ -58,6 +58,7 @@ A max of three disks can be active at a time"); { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 3c5e2f1516..e465d03bfd 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.damage = 47; item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 7; item.useAnimation = 7; item.knockBack = 3f; diff --git a/Items/Weapons/Rogue/TheReaper.cs b/Items/Weapons/Rogue/TheReaper.cs index 7b96d716e7..69bc7cb8c9 100644 --- a/Items/Weapons/Rogue/TheReaper.cs +++ b/Items/Weapons/Rogue/TheReaper.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 22; item.useTime = 22; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 4f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 63039ec8e9..f1087d35ad 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -7,7 +6,7 @@ using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class TheSyringe : RogueWeapon + public class TheSyringe : RogueWeapon { public static int BaseDamage = 60; public static float Knockback = 5f; @@ -29,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = true; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 14; item.height = 50; item.UseSound = SoundID.Item106; diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index 807a5d198f..66e6d63fcf 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 20; item.useTime = 20; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.crit = 20; item.value = Item.buyPrice(0, 0, 0, 50); diff --git a/Items/Weapons/Rogue/TimeBolt.cs b/Items/Weapons/Rogue/TimeBolt.cs index 51e85b6ee3..1303d6996d 100644 --- a/Items/Weapons/Rogue/TimeBolt.cs +++ b/Items/Weapons/Rogue/TimeBolt.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 4f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/TitaniumShuriken.cs b/Items/Weapons/Rogue/TitaniumShuriken.cs index 66b855bc1a..5bf4de4d84 100644 --- a/Items/Weapons/Rogue/TitaniumShuriken.cs +++ b/Items/Weapons/Rogue/TitaniumShuriken.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 9; item.crit = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 9; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index 8cacc713ca..317dc13453 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 13; item.crit = 8; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 2.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index d8c035c1af..d0c954ec52 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -24,7 +24,7 @@ Stealth strikes leak tar as they fly"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 28; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 28; item.knockBack = 5f; item.UseSound = SoundID.Item106; diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 2e7c0109e6..2f3309268c 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Toxicant Twister"); - Tooltip.SetDefault("Throws a speedy boomerang\n" + + Tooltip.SetDefault("Throws a speedy, homing boomerang\n" + "Stealth strikes fire two boomerangs that go much faster and release sand rapidly"); } @@ -19,56 +19,45 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 42; item.height = 46; - item.damage = 950; + item.damage = 650; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = item.useTime = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 5f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.value = Item.buyPrice(1, 40, 0, 0); item.Calamity().postMoonLordRarity = 13; item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 18f; 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) { - int projType = item.shoot; - if (Main.rand.NextBool(2)) - { - projType = ModContent.ProjectileType(); - } - if (player.Calamity().StealthStrikeAvailable()) { float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; + int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].velocity *= 1.5f; + Main.projectile[stealth].timeLeft = 420; + Main.projectile[stealth].penetrate = -1; + Main.projectile[stealth].localNPCHitCooldown = 6; + float SpeedX2 = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY2 = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[stealth].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - Main.projectile[stealth2].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - if (Main.projectile[stealth].Calamity().stealthStrike) - { - Main.projectile[stealth].velocity *= 1.5f; - Main.projectile[stealth].timeLeft = 420; - Main.projectile[stealth].penetrate = -1; - Main.projectile[stealth].localNPCHitCooldown = 6; - } - if (Main.projectile[stealth2].Calamity().stealthStrike) - { - Main.projectile[stealth2].penetrate += 2; - Main.projectile[stealth2].localNPCHitCooldown = 8; - } + int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, type, (int)(damage * 0.6f), knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth2].Calamity().stealthStrike = true; + Main.projectile[stealth2].penetrate += 2; + Main.projectile[stealth2].localNPCHitCooldown = 8; } else { - Projectile.NewProjectile(position, new Vector2(speedX, speedY), projType, damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs index cc7d1d8545..a55ae882c3 100644 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 10; item.knockBack = 50f; item.UseSound = SoundID.Item1; @@ -36,6 +37,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Developer; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.cs b/Items/Weapons/Rogue/TruePaladinsHammer.cs index eeaee61fc5..a68434ff8a 100644 --- a/Items/Weapons/Rogue/TruePaladinsHammer.cs +++ b/Items/Weapons/Rogue/TruePaladinsHammer.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,12 +18,12 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 14; - item.damage = 81; + item.damage = 87; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; item.useAnimation = 13; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 13; item.knockBack = 20f; item.UseSound = SoundID.Item1; @@ -34,6 +35,14 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index 33af5d8363..89847b3b9d 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -24,7 +24,7 @@ Stealth strikes are trailed by homing wind slashes"); item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 18; item.knockBack = 5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/UrchinStinger.cs b/Items/Weapons/Rogue/UrchinStinger.cs index 9aee33aacc..d70ddd1b2b 100644 --- a/Items/Weapons/Rogue/UrchinStinger.cs +++ b/Items/Weapons/Rogue/UrchinStinger.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 14; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 14; item.knockBack = 1.5f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index d75c63b183..700cb0d61e 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 8f; item.noMelee = true; item.noUseGraphic = true; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.reuseDelay = 15; item.useAnimation = 45; diff --git a/Items/Weapons/Rogue/Valediction.cs b/Items/Weapons/Rogue/Valediction.cs index e285772213..f047e1a40b 100644 --- a/Items/Weapons/Rogue/Valediction.cs +++ b/Items/Weapons/Rogue/Valediction.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.noUseGraphic = true; item.useAnimation = 15; item.useTime = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 7f; item.UseSound = SoundID.Item1; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/WebBall.cs b/Items/Weapons/Rogue/WebBall.cs index e8e4c470ef..d95e54c019 100644 --- a/Items/Weapons/Rogue/WebBall.cs +++ b/Items/Weapons/Rogue/WebBall.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class WebBall : RogueWeapon + public class WebBall : RogueWeapon { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ Stealth strikes slow enemies down longer"); item.maxStack = 999; item.consumable = true; item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 20; item.knockBack = 3f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 86ef24f4aa..e3237c91dd 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -18,19 +18,19 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 22; - item.damage = 8; + item.damage = 11; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 15; item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 38; item.maxStack = 999; - item.value = 100; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 1; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/XerocPitchfork.cs b/Items/Weapons/Rogue/XerocPitchfork.cs index f028813edd..a395ed989f 100644 --- a/Items/Weapons/Rogue/XerocPitchfork.cs +++ b/Items/Weapons/Rogue/XerocPitchfork.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.consumable = true; item.noUseGraphic = true; item.useAnimation = 19; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.useTime = 19; item.knockBack = 8f; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index 3032e41aec..fa629db71e 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; -using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using System; using Terraria; @@ -9,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class AbandonedSlimeStaff : ModItem + public class AbandonedSlimeStaff : ModItem { int slimeSlots; public override void SetStaticDefaults() diff --git a/Items/Weapons/Summon/AncientIceChunk.cs b/Items/Weapons/Summon/AncientIceChunk.cs index 3bc8b8d41a..dd0ced89f2 100644 --- a/Items/Weapons/Summon/AncientIceChunk.cs +++ b/Items/Weapons/Summon/AncientIceChunk.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 30; item.height = 30; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index b82f767b15..e54a19ad9f 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -2,6 +2,8 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Summon { public class AngryChickenStaff : ModItem @@ -18,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon { item.mana = 50; item.damage = 160; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 32; item.height = 32; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs index a46727efcd..df9fafc995 100644 --- a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs +++ b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Summon; -using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class BelladonnaSpiritStaff : ModItem + public class BelladonnaSpiritStaff : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index 0132e1a567..d53d17fc6e 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -1,18 +1,14 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Tools; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class BensUmbrella : ModItem + public class BensUmbrella : ModItem { public override void SetStaticDefaults() { @@ -28,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon { item.mana = 99; item.damage = 963; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 74; item.height = 72; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/BlackHawkRemote.cs b/Items/Weapons/Summon/BlackHawkRemote.cs index 31e2eeca3b..121e537e48 100644 --- a/Items/Weapons/Summon/BlackHawkRemote.cs +++ b/Items/Weapons/Summon/BlackHawkRemote.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 36; + item.damage = 32; item.mana = 10; item.width = 46; item.height = 28; item.useTime = item.useAnimation = 25; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Summon/BlightedEyeStaff.cs b/Items/Weapons/Summon/BlightedEyeStaff.cs index c1ad10dbd9..85b17abb35 100644 --- a/Items/Weapons/Summon/BlightedEyeStaff.cs +++ b/Items/Weapons/Summon/BlightedEyeStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 62; item.height = 62; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Summon/BloodClotStaff.cs b/Items/Weapons/Summon/BloodClotStaff.cs index a10b33d628..bc06032153 100644 --- a/Items/Weapons/Summon/BloodClotStaff.cs +++ b/Items/Weapons/Summon/BloodClotStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 58; item.height = 64; item.useTime = item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Summon/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index cf4df4ecd6..62ab1d1dd2 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 48; item.height = 56; item.useTime = item.useAnimation = 20; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index 50ec9f63c8..32a59de547 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 54; item.height = 56; item.useTime = item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index 1933d3f0ab..4a2b7b8f0c 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 62; item.height = 62; item.useTime = item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index 876789d406..792e9fa1b0 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 52; item.height = 50; item.useTime = item.useAnimation = 25; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 48, 0, 0); diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index 25cbefd23f..3fd764654c 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 52; item.height = 54; item.useTime = item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 0136f9bd61..a5fbf51a9a 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -1,6 +1,5 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class CosmicImmaterializer : ModItem + public class CosmicImmaterializer : ModItem { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon { item.mana = 100; item.damage = 3000; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.width = 74; item.height = 72; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/CosmicViperEngine.cs b/Items/Weapons/Summon/CosmicViperEngine.cs index f75752739a..a3674cf226 100644 --- a/Items/Weapons/Summon/CosmicViperEngine.cs +++ b/Items/Weapons/Summon/CosmicViperEngine.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 28; item.useTime = item.useAnimation = 10; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 6f; item.value = Item.buyPrice(2, 50, 0, 0); diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index a99819178c..f041ee5d2c 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 42; item.height = 60; item.useTime = item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 32c7dc8549..0bc4f464ff 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 52; item.height = 52; item.useTime = item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 12, 0, 0); diff --git a/Items/Weapons/Summon/CryogenicStaff.cs b/Items/Weapons/Summon/CryogenicStaff.cs index 04036bc027..c5e872ef1e 100644 --- a/Items/Weapons/Summon/CryogenicStaff.cs +++ b/Items/Weapons/Summon/CryogenicStaff.cs @@ -24,7 +24,7 @@ Fire rate and range increase the longer it targets an enemy"); item.width = 40; item.height = 40; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 48, 0, 0); diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index 8ce63f1322..7edaeacbc8 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.height = 58; item.useTime = item.useAnimation = 30; item.scale = 0.85f; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2.25f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 5f017bf7a6..f4679ecafa 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; -using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -8,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class DazzlingStabberStaff : ModItem + public class DazzlingStabberStaff : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index f0a0b4a005..5b0e65337e 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 46; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index e0b19b0df9..f54d4b2645 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -1,15 +1,13 @@ -using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class DragonbloodDisgorger : ModItem + public class DragonbloodDisgorger : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Summon/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index 2b873ac060..b6048dba73 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 44; item.height = 44; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4.5f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Summon/DreadmineStaff.png b/Items/Weapons/Summon/DreadmineStaff.png index db85833a8f..bd951759a3 100644 Binary files a/Items/Weapons/Summon/DreadmineStaff.png and b/Items/Weapons/Summon/DreadmineStaff.png differ diff --git a/Items/Weapons/Summon/ElementalAxe.cs b/Items/Weapons/Summon/ElementalAxe.cs index caba5b6ccf..ac360cdd80 100644 --- a/Items/Weapons/Summon/ElementalAxe.cs +++ b/Items/Weapons/Summon/ElementalAxe.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Tools; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class ElementalAxe : ModItem + public class ElementalAxe : ModItem { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 36; item.height = 36; item.useTime = item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index 10abe1e3a1..76591fac43 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Summon/EnergyStaff.cs b/Items/Weapons/Summon/EnergyStaff.cs index a4a858dfa5..14e62b75f1 100644 --- a/Items/Weapons/Summon/EnergyStaff.cs +++ b/Items/Weapons/Summon/EnergyStaff.cs @@ -2,6 +2,8 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Items.Weapons.Summon { public class EnergyStaff : ModItem @@ -22,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 66; item.height = 68; item.useTime = item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index bc0779b2f9..139cdae3f3 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 66; item.height = 70; item.useTime = item.useAnimation = 10; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index ef200ca91f..447071087b 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using Terraria.ID; using Terraria; using CalamityMod.Projectiles.Summon; diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 273e2ac851..37cfab3018 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class FrostBlossomStaff : ModItem + public class FrostBlossomStaff : ModItem { public override void SetStaticDefaults() { @@ -17,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 12; + item.damage = 10; item.mana = 10; item.width = 34; item.height = 24; diff --git a/Items/Weapons/Summon/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs new file mode 100644 index 0000000000..380aac1b23 --- /dev/null +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -0,0 +1,73 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class GastricBelcherStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gastric Belcher Staff"); + Tooltip.SetDefault("Summons aquatic aberrations to protect you\n" + + "Aberrations fire vomit at nearby enemies with every third attack firing bubbles"); + } + + public override void SetDefaults() + { + item.damage = 60; + item.mana = 10; + item.width = 66; + item.height = 70; + item.useTime = item.useAnimation = 20; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 1f; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; + item.UseSound = SoundID.Item76; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + item.autoReuse = 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.altFunctionUse != 2) + { + player.itemTime = item.useTime; + Vector2 playerPos = player.RotatedRelativePoint(player.MountedCenter, true); + float directionX = Main.mouseX + Main.screenPosition.X - playerPos.X; + float directionY = Main.mouseY + Main.screenPosition.Y - playerPos.Y; + if (player.gravDir == -1f) + { + directionY = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - playerPos.Y; + } + Vector2 spinningpoint = new Vector2(directionX, directionY); + float dist = spinningpoint.Length(); + if ((float.IsNaN(spinningpoint.X) && float.IsNaN(spinningpoint.Y)) || (spinningpoint.X == 0f && spinningpoint.Y == 0f)) + { + spinningpoint.X = player.direction; + spinningpoint.Y = 0f; + dist = item.shootSpeed; + } + else + { + dist = item.shootSpeed / dist; + } + spinningpoint.X *= dist; + spinningpoint.Y *= dist; + playerPos.X = Main.mouseX + Main.screenPosition.X; + playerPos.Y = Main.mouseY + Main.screenPosition.Y; + spinningpoint = spinningpoint.RotatedBy(Math.PI / 2D, default); + Projectile.NewProjectile(playerPos + spinningpoint, spinningpoint, type, damage, knockBack, player.whoAmI, 0f, 1f); + } + return false; + } + } +} diff --git a/Items/Weapons/Summon/GastricBelcherStaff.png b/Items/Weapons/Summon/GastricBelcherStaff.png new file mode 100644 index 0000000000..11b0ee087a Binary files /dev/null and b/Items/Weapons/Summon/GastricBelcherStaff.png differ diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.cs b/Items/Weapons/Summon/GodspawnHelixStaff.cs index d1fd6b2773..258c47d857 100644 --- a/Items/Weapons/Summon/GodspawnHelixStaff.cs +++ b/Items/Weapons/Summon/GodspawnHelixStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 50; item.height = 50; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1.25f; item.value = Item.buyPrice(0, 95, 0, 0); diff --git a/Items/Weapons/Summon/HauntedScroll.cs b/Items/Weapons/Summon/HauntedScroll.cs index af4814d224..25b164e886 100644 --- a/Items/Weapons/Summon/HauntedScroll.cs +++ b/Items/Weapons/Summon/HauntedScroll.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class HauntedScroll : ModItem + public class HauntedScroll : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 52; item.height = 52; item.useTime = item.useAnimation = 25; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index c5b620cd32..82985b8340 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 46; item.useTime = item.useAnimation = 30; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1.25f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Summon/HivePod.cs b/Items/Weapons/Summon/HivePod.cs index fb8d79aa5f..6b4c3d4bc5 100644 --- a/Items/Weapons/Summon/HivePod.cs +++ b/Items/Weapons/Summon/HivePod.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 50; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index 6b379cbbb8..2de1cdc0e8 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 28; item.useTime = item.useAnimation = 20; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 5f; item.UseSound = SoundID.Item15; //phaseblade sound effect diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs index 95673a3af0..0f0db90d30 100644 --- a/Items/Weapons/Summon/LanternoftheSoul.cs +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class LanternoftheSoul : ModItem + public class LanternoftheSoul : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 42; item.height = 60; item.useTime = item.useAnimation = 15; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/MagicalConch.cs b/Items/Weapons/Summon/MagicalConch.cs index 9ac0054cfa..53303132e1 100644 --- a/Items/Weapons/Summon/MagicalConch.cs +++ b/Items/Weapons/Summon/MagicalConch.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 34; item.height = 24; item.useTime = item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index f22e5764d3..e11daf2b26 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -1,7 +1,6 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class PlantationStaff : ModItem + public class PlantationStaff : ModItem { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 66; item.height = 70; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Summon/PrototypeAndromechaRing.cs b/Items/Weapons/Summon/PrototypeAndromechaRing.cs index b1b38912a1..54ee78dbdc 100644 --- a/Items/Weapons/Summon/PrototypeAndromechaRing.cs +++ b/Items/Weapons/Summon/PrototypeAndromechaRing.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Prototype Andromecha Ring"); - Tooltip.SetDefault("Summons an colossal controllable mech\n" + + Tooltip.SetDefault("Summons a colossal controllable mech\n" + "Right click to display the mech's control panel\n" + "The panel has 3 possible configurations, that you can choose using the brackets on the UI\n" + "Each bracket powers 2 out of 3 functions, represented by icons on the UI.\n" + diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index 01342a29ad..ae6af0b315 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class ResurrectionButterfly : ModItem + public class ResurrectionButterfly : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 46; item.height = 46; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Summon/RustyBeaconPrototype.cs b/Items/Weapons/Summon/RustyBeaconPrototype.cs index c71acf5653..95760c4e02 100644 --- a/Items/Weapons/Summon/RustyBeaconPrototype.cs +++ b/Items/Weapons/Summon/RustyBeaconPrototype.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 28; item.height = 20; item.useTime = item.useAnimation = 35; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 0.5f; item.value = CalamityGlobalItem.Rarity1BuyPrice; @@ -44,8 +44,7 @@ namespace CalamityMod.Items.Weapons.Summon } public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 1); + ModRecipe recipe = new ModRecipe(mod);; recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddRecipeGroup("IronBar", 10); recipe.AddTile(TileID.Anvils); diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 8e82126311..cbe8aed05d 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 48; item.height = 56; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 60, 0, 0); diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index ab78232363..f3d14ff91b 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -1,14 +1,12 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class ScabRipper : ModItem + public class ScabRipper : ModItem { public override void SetStaticDefaults() { @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 66; item.height = 70; item.useTime = item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 0.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/SeaboundStaff.cs b/Items/Weapons/Summon/SeaboundStaff.cs index 7c1440b5a3..f5ed30b147 100644 --- a/Items/Weapons/Summon/SeaboundStaff.cs +++ b/Items/Weapons/Summon/SeaboundStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.height = 32; item.useTime = item.useAnimation = 35; item.scale = 0.75f; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index 33fe501073..5d703af829 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 50; item.height = 50; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index e59accbe2a..4e076e9e8b 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 50; item.height = 50; item.useTime = item.useAnimation = 20; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 80, 0, 0); @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Summon position = Main.MouseWorld; speedX = 0; speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 120f, 0f); player.UpdateMaxTurrets(); } return false; diff --git a/Items/Weapons/Summon/SquirrelSquireStaff.cs b/Items/Weapons/Summon/SquirrelSquireStaff.cs index 32da220a04..fb43684b17 100644 --- a/Items/Weapons/Summon/SquirrelSquireStaff.cs +++ b/Items/Weapons/Summon/SquirrelSquireStaff.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class SquirrelSquireStaff : ModItem + public class SquirrelSquireStaff : ModItem { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 52; item.height = 52; item.useTime = item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 0.5f; item.value = Item.buyPrice(0, 0, 50, 0); diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 291d3d519d..36eaeb83f8 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,13 +1,12 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class StaffoftheMechworm : ModItem + public class StaffoftheMechworm : ModItem { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.height = 58; item.useTime = 12; item.useAnimation = 12; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index a11a056b57..546883a77f 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.height = 32; item.useTime = item.useAnimation = 35; item.scale = 0.75f; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/SunGodStaff.cs index dd305b8186..4da962d734 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/SunGodStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 50; item.height = 50; item.useTime = item.useAnimation = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1.25f; item.value = Item.buyPrice(0, 48, 0, 0); diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index a89447ebeb..00f9a88a12 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 44; item.height = 42; item.useTime = item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 1.15f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index b2deaa6b64..fc425782b0 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 28; item.height = 20; item.useTime = item.useAnimation = 15; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 0.5f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index b746faaccf..4b64f37e23 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -1,6 +1,5 @@ using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class VileFeeder : ModItem + public class VileFeeder : ModItem { public static int BaseDamage = 9; @@ -25,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 66; item.height = 70; item.useTime = item.useAnimation = 35; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; item.knockBack = 0.5f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 2bc26dd85b..73811e9ff8 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 28; item.height = 20; item.useTime = item.useAnimation = 35; - item.useStyle = 4; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 0.5f; item.value = Item.buyPrice(0, 1, 0, 0); diff --git a/Items/Weapons/Typeless/Aestheticus.cs b/Items/Weapons/Typeless/Aestheticus.cs index 257d8cf737..36432205b7 100644 --- a/Items/Weapons/Typeless/Aestheticus.cs +++ b/Items/Weapons/Typeless/Aestheticus.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.rare = 3; item.useAnimation = 25; item.useTime = 25; - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.knockBack = 3f; item.UseSound = SoundID.Item109; item.autoReuse = true; diff --git a/Items/Weapons/Typeless/AethersWhisper.cs b/Items/Weapons/Typeless/AethersWhisper.cs index fa581c0416..b4dfa58729 100644 --- a/Items/Weapons/Typeless/AethersWhisper.cs +++ b/Items/Weapons/Typeless/AethersWhisper.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.height = 38; item.useTime = 24; item.useAnimation = 24; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.5f; item.value = Item.buyPrice(1, 40, 0, 0); diff --git a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs index 89ef19bf8c..047b1f6d2a 100644 --- a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs +++ b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse item.height = 26; item.useTime = 30; item.useAnimation = 30; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 10f; item.value = Item.buyPrice(0, 36, 0, 0); diff --git a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs index ce4a92d54b..3069600ec9 100644 --- a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs +++ b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse item.height = 26; item.useTime = 19; item.useAnimation = 19; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(1, 20, 0, 0); diff --git a/Items/Weapons/Typeless/FiniteUse/Hydra.cs b/Items/Weapons/Typeless/FiniteUse/Hydra.cs index ce941f8dc3..0bf0ebd7b2 100644 --- a/Items/Weapons/Typeless/FiniteUse/Hydra.cs +++ b/Items/Weapons/Typeless/FiniteUse/Hydra.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse item.height = 30; item.useTime = 33; item.useAnimation = 33; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 10f; item.value = Item.buyPrice(0, 80, 0, 0); diff --git a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs index a847416fbd..c456560ec9 100644 --- a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs +++ b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse item.height = 28; item.useTime = 21; item.useAnimation = 21; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(0, 48, 0, 0); diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.cs b/Items/Weapons/Typeless/FiniteUse/Magnum.cs index 45dfb0f8bb..3afac8019c 100644 --- a/Items/Weapons/Typeless/FiniteUse/Magnum.cs +++ b/Items/Weapons/Typeless/FiniteUse/Magnum.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse item.height = 24; item.useTime = 25; item.useAnimation = 25; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 8f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Typeless/GoldenGun.cs b/Items/Weapons/Typeless/GoldenGun.cs index f304bfad15..52e34318c6 100644 --- a/Items/Weapons/Typeless/GoldenGun.cs +++ b/Items/Weapons/Typeless/GoldenGun.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.height = 36; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; item.value = Item.buyPrice(0, 4, 0, 0); diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index eb8c0c840c..6184c7dffe 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.rare = 5; item.useAnimation = 15; item.useTime = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 4.5f; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); item.autoReuse = true; diff --git a/Items/Weapons/Typeless/MarkedMagnum.cs b/Items/Weapons/Typeless/MarkedMagnum.cs index 67b152445d..08f95a0fe7 100644 --- a/Items/Weapons/Typeless/MarkedMagnum.cs +++ b/Items/Weapons/Typeless/MarkedMagnum.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.height = 20; item.useTime = 15; item.useAnimation = 15; - item.useStyle = 5; + item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; item.value = Item.buyPrice(0, 2, 0, 0); diff --git a/Items/Weapons/Typeless/RelicOfResilience.cs b/Items/Weapons/Typeless/RelicOfResilience.cs index 29be8f0f03..a2da4ccee0 100644 --- a/Items/Weapons/Typeless/RelicOfResilience.cs +++ b/Items/Weapons/Typeless/RelicOfResilience.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.Cooldowns; using CalamityMod.Projectiles.Damageable; -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Typeless { - public class RelicOfResilience : ModItem + public class RelicOfResilience : ModItem { public const int CooldownSeconds = 5; public const float WeaknessDR = 0.45f; diff --git a/Items/Weapons/Typeless/StarStruckWater.cs b/Items/Weapons/Typeless/StarStruckWater.cs index ebe719a356..d78cf18e64 100644 --- a/Items/Weapons/Typeless/StarStruckWater.cs +++ b/Items/Weapons/Typeless/StarStruckWater.cs @@ -1,13 +1,11 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.Items.Placeables; -using Microsoft.Xna.Framework; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Typeless { - public class StarStruckWater : ModItem + public class StarStruckWater : ModItem { public override void SetStaticDefaults() { @@ -17,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetDefaults() { - item.useStyle = 1; + item.useStyle = ItemUseStyleID.SwingThrow; item.shootSpeed = 14f; item.rare = 3; item.damage = 20; diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 83cd81c3f9..1d36e513ef 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Localization { diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 8f6de6c33f..d0b0276999 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -4,7 +4,6 @@ using CalamityMod.Items; using CalamityMod.Projectiles; using CalamityMod.World; using System; -using System.Runtime.InteropServices.WindowsRuntime; using Terraria; namespace CalamityMod diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 08933814c5..23b6437d50 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Items.Accessories; @@ -344,7 +344,7 @@ namespace CalamityMod { BossDifficulty.TryGetValue("Leviathan", out float order); List bosses = new List() { NPCType(), NPCType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HotlineFishingHook, ItemID.BottomlessBucket, ItemID.SuperAbsorbantSponge, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HotlineFishingHook, ItemID.BottomlessBucket, ItemID.SuperAbsorbantSponge, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = "By killing an unknown entity in the Ocean Biome"; string despawn = CalamityUtils.ColorMessage("The aquatic entities sink back beneath the ocean depths.", new Color(0x7F, 0xFF, 0xD4)); @@ -357,7 +357,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumAureus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night in the Astral Biome"; string despawn = CalamityUtils.ColorMessage("Astrum Aureus’ program has been executed. Initiate recall.", new Color(0xFF, 0xD7, 0x00)); @@ -370,7 +370,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("PlaguebringerGoliath", 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(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemID.Stinger, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("HOSTILE SPECIMENS TERMINATED. INITIATE RECALL TO HOME BASE.", new Color(0x00, 0xFF, 0x00)); @@ -396,7 +396,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumDeus", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Defeat 3 empowered astral titans or use a [i:{summon}] at Night"; string despawn = CalamityUtils.ColorMessage("The infected deity retreats to the heavens.", new Color(0xFF, 0xD7, 0x00)); @@ -536,7 +536,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(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), 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)); @@ -551,7 +551,7 @@ namespace CalamityMod InvasionDifficulty.TryGetValue("Acid Rain Initial", out float order); List enemies = AcidRainEvent.PossibleEnemiesPreHM.Select(enemy => enemy.Key).ToList(); int summon = ItemType(); - List loot = new List() { ItemType() }; + List loot = new List() { ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{summon}] or wait for the invasion to occur naturally after the Eye of Cthulhu is defeated."; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the ocean.", new Color(146, 183, 116)); @@ -566,7 +566,7 @@ namespace CalamityMod enemies.Add(ModContent.NPCType()); enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType(), ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or [i:{ItemType()}] or wait for the invasion to occur naturally after the Aquatic Scourge is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); @@ -580,7 +580,7 @@ namespace CalamityMod List enemies = AcidRainEvent.PossibleEnemiesPolter.Select(enemy => enemy.Key).ToList(); enemies.AddRange(AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType(), ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or [i:{ItemType()}] or wait for the invasion to occur naturally after the Polterghast is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); @@ -618,7 +618,7 @@ namespace CalamityMod // Queen Bee AddLoot(bossChecklist, "QueenBee", - new List() { ItemType() }, + new List() { ItemType(), ItemID.Stinger }, new List() { ItemType() } ); @@ -844,6 +844,7 @@ namespace CalamityMod //Entropy's Vigil is a bruh moment sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType()}); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 551d04374f..16d8273463 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index c2fc5f21c7..9d64cbbeaf 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 80; npc.height = 40; npc.defense = 50; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.lifeMax = 10000; npc.knockBackResist = 0f; aiType = -1; @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Abyss npc.noTileCollide = true; npc.collideX = false; npc.collideY = false; - float num663 = 11f; + float num663 = 16f; Vector2 vector80 = new Vector2(npc.Center.X, npc.Center.Y); float num664 = Main.player[npc.target].Center.X - vector80.X; float num665 = Main.player[npc.target].Center.Y - vector80.Y; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.Abyss else if (npc.ai[0] == 3f) { npc.noTileCollide = true; - float num671 = 11f; + float num671 = 16f; float num672 = 0.25f; Vector2 vector82 = new Vector2(npc.Center.X, npc.Center.Y); float num673 = Main.player[npc.target].Center.X - vector82.X; diff --git a/NPCs/Abyss/BobbitWormSegment.cs b/NPCs/Abyss/BobbitWormSegment.cs index 223736b0b6..b29a1d839f 100644 --- a/NPCs/Abyss/BobbitWormSegment.cs +++ b/NPCs/Abyss/BobbitWormSegment.cs @@ -1,4 +1,4 @@ -using System.Linq; +using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index f35a30cd7a..9c1509965a 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -21,11 +21,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { npc.noGravity = true; - npc.damage = 22; + npc.damage = 44; npc.width = 30; npc.height = 33; npc.defense = 5; - npc.lifeMax = 45; + npc.lifeMax = 90; npc.alpha = 20; npc.aiStyle = -1; aiType = -1; @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.Abyss if (npc.velocity.Y == 0f) { npc.velocity.X = npc.velocity.X * 0.98f; - if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01) + if (npc.velocity.X > -0.01 && npc.velocity.X < 0.01) { npc.velocity.X = 0f; } @@ -84,24 +84,24 @@ namespace CalamityMod.NPCs.Abyss } bool flag16 = false; npc.TargetClosest(false); - if (Main.player[npc.target].wet && !Main.player[npc.target].dead) + if (Main.player[npc.target].wet && !Main.player[npc.target].dead && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { flag16 = true; } if (flag16) { npc.localAI[2] = 1f; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; npc.velocity *= 0.975f; float num263 = 0.8f; if (npc.velocity.X > -num263 && npc.velocity.X < num263 && npc.velocity.Y > -num263 && npc.velocity.Y < num263) { npc.TargetClosest(true); float num264 = CalamityWorld.death ? 12f : 8f; - Vector2 vector31 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num265 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector31.X; - float num266 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector31.Y; - float num267 = (float)Math.Sqrt((double)(num265 * num265 + num266 * num266)); + Vector2 vector31 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num265 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector31.X; + float num266 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector31.Y; + float num267 = (float)Math.Sqrt(num265 * num265 + num266 * num266); num267 = num264 / num267; num265 *= num267; num266 *= num267; @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.Abyss else { npc.localAI[2] = 0f; - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.02f; + npc.velocity.X = npc.velocity.X + npc.direction * 0.02f; npc.rotation = npc.velocity.X * 0.4f; if (npc.velocity.X < -1f || npc.velocity.X > 1f) { @@ -134,8 +134,8 @@ namespace CalamityMod.NPCs.Abyss npc.ai[0] = -1f; } } - int num268 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num269 = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int num268 = (int)(npc.position.X + (npc.width / 2)) / 16; + int num269 = (int)(npc.position.Y + (npc.height / 2)) / 16; if (Main.tile[num268, num269 - 1] == null) { Main.tile[num268, num269 - 1] = new Tile(); @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.Abyss { npc.ai[0] = 1f; } - if ((double)npc.velocity.Y > 1.2 || (double)npc.velocity.Y < -1.2) + if (npc.velocity.Y > 1.2 || npc.velocity.Y < -1.2) { npc.velocity.Y = npc.velocity.Y * 0.99f; } diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index fe525c6f94..56d54b9e29 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Weapons.Ranged; @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Abyss public void Boom() { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.NPCDeath14, (int)npc.position.X, (int)npc.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient && puffedUp) { int damageBoom = 100; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 739ff992a4..09ff55a9bb 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 180; npc.height = 180; npc.defense = 50; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = 220000; npc.aiStyle = -1; aiType = -1; @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Abyss } if (Main.rand.NextBool(300)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 34); } npc.noTileCollide = false; if (npc.ai[0] == 0f) @@ -340,7 +340,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.rand.NextBool(300)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 34); } if (npc.ai[3] > 0f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) { @@ -420,7 +420,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.rand.NextBool(300)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 35); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 35); } npc.localAI[2] = 0f; npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.02f; diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index f713b850d0..10a59dfb8d 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; @@ -26,11 +26,11 @@ namespace CalamityMod.NPCs.Abyss { npc.noGravity = true; npc.chaseable = false; - npc.damage = 17; + npc.damage = 34; npc.width = 50; npc.height = 28; npc.defense = 12; - npc.lifeMax = 55; + npc.lifeMax = 110; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; @@ -48,7 +48,6 @@ namespace CalamityMod.NPCs.Abyss int num = 200; if (npc.ai[2] == 0f) { - npc.localAI[0] += 1f; npc.alpha = num; npc.TargetClosest(true); if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f && @@ -56,11 +55,86 @@ namespace CalamityMod.NPCs.Abyss { npc.ai[2] = -16f; } - if (npc.velocity.X != 0f || npc.velocity.Y < 0f || npc.velocity.Y > 2f || npc.justHit || npc.localAI[0] >= 420f) + if (npc.justHit) { npc.ai[2] = -16f; } - return; + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * -1f; + npc.direction *= -1; + } + if (npc.collideY) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y) * -1f; + npc.directionY = -1; + npc.ai[0] = -1f; + } + else if (npc.velocity.Y < 0f) + { + npc.velocity.Y = Math.Abs(npc.velocity.Y); + npc.directionY = 1; + npc.ai[0] = 1f; + } + } + npc.velocity.X = npc.velocity.X + npc.direction * 0.02f; + npc.rotation = npc.velocity.X * 0.4f; + if (npc.velocity.X < -1f || npc.velocity.X > 1f) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + if (npc.ai[0] == -1f) + { + npc.velocity.Y = npc.velocity.Y - 0.01f; + if (npc.velocity.Y < -1f) + { + npc.ai[0] = 1f; + } + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.01f; + if (npc.velocity.Y > 1f) + { + npc.ai[0] = -1f; + } + } + int num268 = (int)(npc.position.X + (npc.width / 2)) / 16; + int num269 = (int)(npc.position.Y + (npc.height / 2)) / 16; + if (Main.tile[num268, num269 - 1] == null) + { + Main.tile[num268, num269 - 1] = new Tile(); + } + if (Main.tile[num268, num269 + 1] == null) + { + Main.tile[num268, num269 + 1] = new Tile(); + } + if (Main.tile[num268, num269 + 2] == null) + { + Main.tile[num268, num269 + 2] = new Tile(); + } + if (Main.tile[num268, num269 - 1].liquid > 128) + { + if (Main.tile[num268, num269 + 1].active()) + { + npc.ai[0] = -1f; + } + else if (Main.tile[num268, num269 + 2].active()) + { + npc.ai[0] = -1f; + } + } + else + { + npc.ai[0] = 1f; + } + if (npc.velocity.Y > 1.2 || npc.velocity.Y < -1.2) + { + npc.velocity.Y = npc.velocity.Y * 0.99f; + } + return; } if (npc.ai[2] < 0f) { @@ -75,8 +149,9 @@ namespace CalamityMod.NPCs.Abyss npc.ai[2] += 1f; if (npc.ai[2] == 0f) { - npc.ai[2] = 1f; - npc.velocity.X = (float)(npc.direction * 2); + npc.ai[0] = 0f; + npc.ai[2] = 1f; + npc.velocity.X = npc.direction * 2; } return; } diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 47f86a1bd4..ce796bb938 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.Abyss { npc.noGravity = true; npc.lavaImmune = true; - npc.damage = 60; + npc.damage = 90; npc.width = 126; npc.height = 66; npc.defense = 999999; - npc.lifeMax = 200; + npc.lifeMax = 400; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Abyss { flag14 = true; } - if ((!player.wet || player.dead) && flag14) + if ((!player.wet || player.dead || !Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) && flag14) { flag14 = false; } diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 1acd7e7e22..d0bce64a95 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.Abyss { npc.noGravity = true; npc.lavaImmune = true; - npc.damage = 60; + npc.damage = 90; npc.width = 126; npc.height = 66; npc.defense = 999999; - npc.lifeMax = 200; + npc.lifeMax = 400; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Abyss { flag14 = true; } - if ((!player.wet || player.dead) && flag14) + if ((!player.wet || player.dead || !Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) && flag14) { flag14 = false; } diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index a59ed55160..32bcbc21f0 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index 0e608c3275..4f4d418e2f 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs index c189c0833d..b14e0c6fc3 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.cs b/NPCs/Abyss/EidolonWyrmBodyHuge.cs index 7bb9441d8f..c74de819f5 100644 --- a/NPCs/Abyss/EidolonWyrmBodyHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyHuge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index fa38820a2e..0a043e6a15 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 126; //36 npc.height = 76; //20 npc.defense = 300; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 160000; npc.aiStyle = -1; aiType = -1; @@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.Abyss public override void AI() { - if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) + if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) { detectsPlayer = true; npc.damage = Main.expertMode ? 340 : 170; @@ -106,7 +106,6 @@ namespace CalamityMod.NPCs.Abyss { npc.TargetClosest(true); } - npc.velocity.Length(); if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) @@ -134,7 +133,7 @@ namespace CalamityMod.NPCs.Abyss Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -157,7 +156,7 @@ namespace CalamityMod.NPCs.Abyss int random = Main.rand.Next(3); if (random == 0) { - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } else if (random == 1) { @@ -170,7 +169,7 @@ namespace CalamityMod.NPCs.Abyss for (int n = 0; n < 1; n++) { Vector2 vector4 = vec * 4f; - Projectile.NewProjectile(vector2.X, vector2.Y, vector4.X, vector4.Y, 464, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(vector2.X, vector2.Y, vector4.X, vector4.Y, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } } else @@ -237,44 +236,21 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 600); //800 - if (!detectsPlayer) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500 - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 500f; //600 - } - else - { - num191 = Main.player[npc.target].Center.X - 500f; //600 - } - } - } - } + if (!detectsPlayer) + { + num192 += 800; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500 + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 500f; //600 + } + else + { + num191 = Main.player[npc.target].Center.X - 500f; //600 + } + } + } if (detectsPlayer) { num188 = 7.5f; @@ -301,40 +277,6 @@ namespace CalamityMod.NPCs.Abyss npc.velocity *= num49; } } - if (!detectsPlayer) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -554,7 +496,7 @@ namespace CalamityMod.NPCs.Abyss { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 4a027e7e3f..95e026dfe2 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.Abyss { npc.TargetClosest(true); } - if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) + if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) { if (!detectsPlayer) { @@ -111,7 +111,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - npc.velocity.Length(); if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) @@ -139,7 +138,7 @@ namespace CalamityMod.NPCs.Abyss Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -158,8 +157,8 @@ namespace CalamityMod.NPCs.Abyss int random = Main.rand.Next(3); if (random == 0) { - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(-vector2.X, -vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(-vector2.X, -vector2.Y, 0f, 0f, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } else if (random == 1) { @@ -172,8 +171,8 @@ namespace CalamityMod.NPCs.Abyss for (int n = 0; n < 1; n++) { Vector2 vector4 = vec * 4f; - Projectile.NewProjectile(vector2.X, vector2.Y, vector4.X, vector4.Y, 464, damage, 0f, Main.myPlayer, 0f, 1f); - Projectile.NewProjectile(-vector2.X, -vector2.Y, -vector4.X, -vector4.Y, 464, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(vector2.X, vector2.Y, vector4.X, vector4.Y, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(-vector2.X, -vector2.Y, -vector4.X, -vector4.Y, ProjectileID.CultistBossIceMist, damage, 0f, Main.myPlayer, 0f, 1f); } } else @@ -240,44 +239,21 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 600); //800 - if (!detectsPlayer) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500 - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 500f; //600 - } - else - { - num191 = Main.player[npc.target].Center.X - 500f; //600 - } - } - } - } + if (!detectsPlayer) + { + num192 += 800; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500 + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 500f; //600 + } + else + { + num191 = Main.player[npc.target].Center.X - 500f; //600 + } + } + } if (detectsPlayer) { num188 = 10f; @@ -304,40 +280,6 @@ namespace CalamityMod.NPCs.Abyss npc.velocity *= num49; } } - if (!detectsPlayer) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -541,7 +483,7 @@ namespace CalamityMod.NPCs.Abyss { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index adb543c760..f8e6ce9535 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -52,19 +52,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -92,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/EidolonWyrmTailHuge.cs b/NPCs/Abyss/EidolonWyrmTailHuge.cs index 900f9d5747..c77d688ed9 100644 --- a/NPCs/Abyss/EidolonWyrmTailHuge.cs +++ b/NPCs/Abyss/EidolonWyrmTailHuge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -52,19 +52,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -92,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 430a054eca..b87541b206 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { npc.noGravity = true; - npc.damage = 80; + npc.damage = 100; npc.width = 50; npc.height = 220; npc.defense = 25; - npc.lifeMax = 400; + npc.lifeMax = 800; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Abyss if (npc.velocity.Y == 0f) { npc.velocity.X = npc.velocity.X * 0.98f; - if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01) + if (npc.velocity.X > -0.01 && npc.velocity.X < 0.01) { npc.velocity.X = 0f; } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index ce9d81c95d..453fc7e2be 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index b80ec4dfc2..4bfc45465d 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index cdc7c2acaf..1a43a13b37 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -84,7 +84,6 @@ namespace CalamityMod.NPCs.Abyss { npc.TargetClosest(true); } - npc.velocity.Length(); if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) @@ -112,7 +111,7 @@ namespace CalamityMod.NPCs.Abyss Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -144,44 +143,26 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 400); //800 - if (!detectsPlayer) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 300f) - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 400f; - } - else - { - num191 = Main.player[npc.target].Center.X - 400f; - } - } - } - } + if (!detectsPlayer) + { + num192 += 500; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 300f) + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 400f; + } + else + { + num191 = Main.player[npc.target].Center.X - 400f; + } + } + } + else + { + num188 *= 1.5f; + num189 *= 1.5f; + } float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; float num50 = npc.velocity.Length(); @@ -198,40 +179,6 @@ namespace CalamityMod.NPCs.Abyss npc.velocity *= num49; } } - if (!detectsPlayer) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -436,7 +383,7 @@ namespace CalamityMod.NPCs.Abyss { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index eea75a9444..ffa21aeb66 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 372125df97..83f47b4147 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -13,7 +12,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Abyss { - public class Laserfish : ModNPC + public class Laserfish : ModNPC { public override void SetStaticDefaults() { @@ -24,11 +23,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { npc.noGravity = true; - npc.damage = 20; + npc.damage = 40; npc.width = 60; npc.height = 26; npc.defense = 25; - npc.lifeMax = 240; + npc.lifeMax = 480; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 9716346b52..52fec5e91f 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 4703c5b19f..75c98426ea 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Abyss { npc.noGravity = true; npc.noTileCollide = true; - npc.damage = 80; + npc.damage = 100; npc.width = 70; npc.height = 162; npc.defense = 10; @@ -100,15 +100,18 @@ namespace CalamityMod.NPCs.Abyss num1250 = (int)player.Center.X / 16; num1251 = (int)player.Center.Y / 16; - int min = 9; - int max = 16; + int min = 6; + int max = 9; if (Main.rand.NextBool(2)) num1250 += Main.rand.Next(min, max); else num1250 -= Main.rand.Next(min, max); - num1251 += Main.rand.Next(min, max); + min = 11; + max = 26; + + num1251 += Main.rand.Next(min, max); if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, player.position, player.width, player.height) && Main.tile[num1250, num1251].liquid > 204) @@ -149,7 +152,7 @@ namespace CalamityMod.NPCs.Abyss npc.alpha -= 5; if (npc.alpha <= 0) { - npc.damage = Main.expertMode ? 160 : 80; + npc.damage = Main.expertMode ? 200 : 100; npc.chaseable = true; npc.dontTakeDamage = false; npc.alpha = 0; diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index e28028007d..2c184eece3 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -1,10 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -12,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Abyss { - public class MorayEel : ModNPC + public class MorayEel : ModNPC { public override void SetStaticDefaults() { @@ -23,11 +19,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { npc.noGravity = true; - npc.damage = 45; + npc.damage = 55; npc.width = 136; npc.height = 40; npc.defense = 8; - npc.lifeMax = 180; + npc.lifeMax = 360; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 83a6ed58c4..23560416c7 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -15,11 +15,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - npc.damage = 20; //70 + npc.damage = 30; //70 npc.width = 16; //28 npc.height = 16; //28 npc.defense = 20; - npc.lifeMax = 2000; + npc.lifeMax = 4000; npc.aiStyle = -1; //new aiType = -1; //new npc.knockBackResist = 0f; @@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - /*if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - }*/ bool flag = false; if (npc.ai[1] <= 0f) { @@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); @@ -124,14 +107,14 @@ namespace CalamityMod.NPCs.Abyss npc.velocity = Vector2.Zero; npc.position.X = npc.position.X + num191; npc.position.Y = npc.position.Y + num192; - /*if (num191 < 0f) + if (num191 < 0f) { npc.spriteDirection = -1; } else if (num191 > 0f) { npc.spriteDirection = 1; - }*/ + } } } diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 892b749993..ff6e8c1e71 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -1,10 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,7 +14,8 @@ namespace CalamityMod.NPCs.Abyss { public class OarfishHead : ModNPC { - public const int minLength = 40; + public bool detectsPlayer = false; + public const int minLength = 40; public const int maxLength = 41; public float speed = 3f; //10 public float turnSpeed = 0.05f; //0.15 @@ -26,11 +28,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - npc.damage = 30; - npc.width = 59; //36 - npc.height = 38; //20 + npc.damage = 60; + npc.width = 59; + npc.height = 38; npc.defense = 10; - npc.lifeMax = 2000; + npc.lifeMax = 4000; npc.aiStyle = -1; aiType = -1; for (int k = 0; k < npc.buffImmune.Length; k++) @@ -49,9 +51,27 @@ namespace CalamityMod.NPCs.Abyss bannerItem = ModContent.ItemType(); } - public override void AI() + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(detectsPlayer); + writer.Write(npc.chaseable); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + detectsPlayer = reader.ReadBoolean(); + npc.chaseable = reader.ReadBoolean(); + } + + public override void AI() { - if (npc.ai[3] > 0f) + if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f) || + npc.justHit) + { + detectsPlayer = true; + } + npc.chaseable = detectsPlayer; + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } @@ -80,20 +100,20 @@ namespace CalamityMod.NPCs.Abyss Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; } } - /*if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.spriteDirection = -1; } else if (npc.velocity.X > 0f) { npc.spriteDirection = 1; - }*/ + } if (Main.player[npc.target].dead) { npc.TargetClosest(false); @@ -112,47 +132,26 @@ namespace CalamityMod.NPCs.Abyss Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) + if (!detectsPlayer) { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 200); //800 - //if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating || - // Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) * - // (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) - if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f)) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 300f; - } - else - { - num191 = Main.player[npc.target].Center.X - 300f; - } - } - } + num192 += 300; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 300f; + } + else + { + num191 = Main.player[npc.target].Center.X - 300f; + } + } } + else + { + num188 *= 1.5f; + num189 *= 1.5f; + } float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; float num50 = npc.velocity.Length(); @@ -169,43 +168,6 @@ namespace CalamityMod.NPCs.Abyss npc.velocity *= num49; } } - //if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating || - // Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) * - // (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f)) - if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f)) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -315,7 +277,16 @@ namespace CalamityMod.NPCs.Abyss npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; } - public override float SpawnChance(NPCSpawnInfo spawnInfo) + public override bool? CanBeHitByProjectile(Projectile projectile) + { + if (projectile.minion && !projectile.Calamity().overridesMinionDamagePrevention) + { + return detectsPlayer; + } + return null; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.player.Calamity().ZoneAbyssLayer2 && spawnInfo.water && !NPC.AnyNPCs(ModContent.NPCType())) { @@ -375,7 +346,7 @@ namespace CalamityMod.NPCs.Abyss { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index fb1b1fe882..69628365d8 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -15,11 +15,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - npc.damage = 10; //70 + npc.damage = 15; //70 npc.width = 14; //28 npc.height = 16; //28 npc.defense = 30; - npc.lifeMax = 2000; + npc.lifeMax = 4000; npc.aiStyle = -1; //new aiType = -1; //new npc.knockBackResist = 0f; @@ -51,19 +51,7 @@ namespace CalamityMod.NPCs.Abyss { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } npc.velocity.Length(); - /*if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - }*/ bool flag = false; if (npc.ai[1] <= 0f) { @@ -91,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); @@ -124,14 +108,14 @@ namespace CalamityMod.NPCs.Abyss npc.velocity = Vector2.Zero; npc.position.X = npc.position.X + num191; npc.position.Y = npc.position.Y + num192; - /*if (num191 < 0f) + if (num191 < 0f) { npc.spriteDirection = -1; } else if (num191 > 0f) { npc.spriteDirection = 1; - }*/ + } } } diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 3e59dba172..107942f748 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; @@ -77,9 +77,9 @@ namespace CalamityMod.NPCs.Abyss public override void AI() { - bool phase1 = (double)npc.life > (double)npc.lifeMax * 0.5; - bool phase2 = (double)npc.life <= (double)npc.lifeMax * 0.5; - bool phase3 = (double)npc.life <= (double)npc.lifeMax * 0.1; + bool phase1 = npc.life > npc.lifeMax * 0.5; + bool phase2 = npc.life <= npc.lifeMax * 0.5; + bool phase3 = npc.life <= npc.lifeMax * 0.1; npc.chaseable = hasBeenHit; if (npc.soundDelay <= 0) { @@ -108,41 +108,33 @@ namespace CalamityMod.NPCs.Abyss reset2 = true; npc.netUpdate = true; } + npc.spriteDirection = (npc.direction > 0) ? -1 : 1; - int num = 200; if (npc.ai[2] == 0f) { - npc.localAI[0] += 1f; - npc.alpha = num; npc.TargetClosest(true); - if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f) + if (!Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.Center).Length() < 170f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.ai[2] = -16f; } - if (npc.velocity.X != 0f || npc.velocity.Y < 0f || npc.velocity.Y > 2f || npc.justHit || npc.localAI[0] >= 420f) + if (npc.justHit || npc.localAI[0] >= 420f) { npc.ai[2] = -16f; } return; } + if (npc.ai[2] < 0f) { - if (npc.alpha > 0) - { - npc.alpha -= num / 16; - if (npc.alpha < 0) - { - npc.alpha = 0; - } - } npc.ai[2] += 1f; if (npc.ai[2] == 0f) { npc.ai[2] = 1f; - npc.velocity.X = (float)(npc.direction * 2); + npc.velocity.X = npc.direction * 2; } return; } + if (npc.ai[2] == 1f) { if (npc.direction == 0) diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index d006cdadf6..4b9839852d 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; @@ -68,7 +68,7 @@ namespace CalamityMod.NPCs.Abyss public override bool CheckDead() { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.NPCDeath14, npc.position); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = npc.height = 40; diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 7b62d4d7b0..3103d0f344 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -6,7 +6,6 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -14,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Abyss { - public class Viperfish : ModNPC + public class Viperfish : ModNPC { public override void SetStaticDefaults() { @@ -25,11 +24,11 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { npc.noGravity = true; - npc.damage = 60; + npc.damage = 75; npc.width = 72; npc.height = 30; npc.defense = 15; - npc.lifeMax = 160; + npc.lifeMax = 320; npc.aiStyle = -1; aiType = -1; npc.buffImmune[ModContent.BuffType()] = true; diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index e62f67678b..87ff598a0d 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AcidRain if (CalamityWorld.downedPolterghast) { - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.damage = 120; npc.lifeMax = 5500; npc.defense = 45; diff --git a/NPCs/AcidRain/FlakBaby.cs b/NPCs/AcidRain/FlakBaby.cs index 28f64cd604..9328f77d17 100644 --- a/NPCs/AcidRain/FlakBaby.cs +++ b/NPCs/AcidRain/FlakBaby.cs @@ -1,8 +1,7 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Critters; using CalamityMod.Items.Pets; -using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -11,7 +10,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.AcidRain { - public class FlakBaby : ModNPC + public class FlakBaby : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index ada6f36eaa..64a564d31d 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.AcidRain if (CalamityWorld.downedPolterghast) { npc.lifeMax = 7000; - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 229328a357..ed361355c4 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Buffs.StatDebuffs; @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 130; npc.lifeMax = 5915; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.defense = 50; npc.aiStyle = aiType = -1; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 9b676700b8..82fc30c21d 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 2b1074f059..c1d60e6e58 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -14,9 +14,10 @@ namespace CalamityMod.NPCs.AcidRain { public class NuclearTerror : ModNPC { - public bool Walking = false; public int AttackIndex = 0; public int DelayTime = 0; + public bool Dying = false; + public bool Walking = false; public float JumpTimer = 0f; public Vector2 ShootPosition; public static readonly int[] PhaseArray = new int[] @@ -51,7 +52,7 @@ namespace CalamityMod.NPCs.AcidRain { npc.buffImmune[k] = true; } - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); npc.lavaImmune = false; npc.noGravity = false; npc.noTileCollide = false; @@ -61,6 +62,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); + writer.Write(Dying); writer.Write(Walking); writer.Write(AttackIndex); writer.Write(DelayTime); @@ -70,6 +72,7 @@ namespace CalamityMod.NPCs.AcidRain public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); + Dying = reader.ReadBoolean(); Walking = reader.ReadBoolean(); AttackIndex = reader.ReadInt32(); DelayTime = reader.ReadInt32(); @@ -78,8 +81,8 @@ namespace CalamityMod.NPCs.AcidRain } public override void AI() { - Lighting.AddLight(npc.Center, (npc.dontTakeDamage ? Color.Lime.ToVector3() : Color.White.ToVector3()) * 2f); - if (npc.dontTakeDamage) + Lighting.AddLight(npc.Center, (Dying ? Color.Lime.ToVector3() : Color.White.ToVector3()) * 2f); + if (Dying) return; bool phase2 = npc.life / (float)npc.lifeMax < 0.5f; if (DelayTime > 0) @@ -103,7 +106,7 @@ namespace CalamityMod.NPCs.AcidRain } Player player = Main.player[npc.target]; npc.defDamage = 170; - npc.damage = npc.dontTakeDamage ? 0 : npc.defDamage; + npc.damage = Dying ? 0 : npc.defDamage; TeleportCheck(player); npc.ai[0]++; Walking = false; @@ -347,7 +350,7 @@ namespace CalamityMod.NPCs.AcidRain public override void FindFrame(int frameHeight) { npc.frameCounter++; - int framesNeeded = npc.dontTakeDamage ? 7 : 6; + int framesNeeded = Dying ? 7 : 6; if (Walking) { framesNeeded = 8 - (int)Math.Ceiling(Math.Abs(npc.velocity.X) / 5f); // Walk faster the faster we're moving @@ -357,7 +360,7 @@ namespace CalamityMod.NPCs.AcidRain npc.frame.Y += frameHeight; npc.frameCounter = 0; } - if (npc.dontTakeDamage) + if (Dying) { if (npc.frame.Y < frameHeight * 8) { @@ -402,16 +405,17 @@ namespace CalamityMod.NPCs.AcidRain } public override bool CheckDead() { - if (!npc.dontTakeDamage) + if (!Dying) { npc.active = true; npc.life = 1; npc.dontTakeDamage = true; + Dying = true; npc.velocity = Vector2.Zero; npc.netUpdate = true; return false; } - return true; + return Dying; } public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 6dce668b5a..2a2d1b5c4b 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -29,14 +29,14 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 75; npc.lifeMax = 605; npc.defense = 15; - npc.Calamity().RevPlusDR(0.075f); + npc.DR_NERD(0.075f); if (CalamityWorld.downedPolterghast) { npc.damage = 150; npc.lifeMax = 4500; npc.defense = 65; - npc.Calamity().RevPlusDR(0.35f); + npc.DR_NERD(0.35f); } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 73b897fa45..60c2065b34 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -6,14 +6,11 @@ using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.NPCs.AcidRain { - public class Radiator : ModNPC + public class Radiator : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 946524a1b0..8adcdb1bef 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -39,13 +39,13 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 150; npc.lifeMax = 5001; npc.defense = 58; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); } else if (CalamityWorld.downedAquaticScourge) { npc.damage = 85; npc.lifeMax = 700; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); } npc.knockBackResist = 0f; @@ -86,7 +86,16 @@ namespace CalamityMod.NPCs.AcidRain { if (npc.ai[0] % 55f == 54f) { - npc.velocity = Vector2.UnitX * (player.Center.X - npc.Center.X > 0).ToDirectionInt() * 27f; + float horizontalSchoolingSpeed = 9f; + if (CalamityWorld.downedAquaticScourge) + { + horizontalSchoolingSpeed = 15f; + } + if (CalamityWorld.downedPolterghast) + { + horizontalSchoolingSpeed = 24f; + } + npc.velocity = Vector2.UnitX * (player.Center.X - npc.Center.X > 0).ToDirectionInt() * horizontalSchoolingSpeed; } if ((Math.Abs(player.Center.Y - npc.Center.Y) > 50f && player.wet) || (!player.wet && npc.ai[1] <= 0f)) { diff --git a/NPCs/AcidRain/SulfurousSkater.cs b/NPCs/AcidRain/SulfurousSkater.cs index 28ec6472ca..018bd4f27e 100644 --- a/NPCs/AcidRain/SulfurousSkater.cs +++ b/NPCs/AcidRain/SulfurousSkater.cs @@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 100; npc.lifeMax = 5000; npc.defense = 33; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 7c863b848b..5063cdb640 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -34,14 +34,14 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 66; npc.lifeMax = 850; npc.defense = 15; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); if (CalamityWorld.downedPolterghast) { npc.damage = 120; npc.lifeMax = 4900; npc.defense = 78; - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); } npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index db02795914..d11b3cd218 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -71,7 +71,33 @@ namespace CalamityMod.NPCs.AcidRain npc.TargetClosest(false); npc.localAI[0] = 1f; } + + // Anti-sticky movement and player targeting detection (only one leech and attack the player at once) Player player = Main.player[npc.target]; + bool playerAlreadyTargeted = false; + float antiStickyAcceleration = 0.25f; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].type == npc.type && + Main.npc[i].whoAmI != npc.whoAmI && + Main.npc[i].active) + { + if (Main.npc[i].target == npc.target && !playerAlreadyTargeted) + { + playerAlreadyTargeted = true; + } + if (Main.npc[i].Hitbox.Intersects(npc.Hitbox)) + { + npc.velocity += npc.DirectionFrom(Main.npc[i].Center) * antiStickyAcceleration; + } + } + } + + if (!playerAlreadyTargeted || player.Calamity().waterLeechTarget == -1) + { + player.Calamity().waterLeechTarget = npc.whoAmI; + } + // Latch onto player if (npc.ai[0] == 1f) { @@ -114,14 +140,14 @@ namespace CalamityMod.NPCs.AcidRain npc.netUpdate = true; } } - else if (player.wet) + else if (player.wet && player.Calamity().waterLeechTarget == npc.whoAmI) { - float speed = player.wet ? 23f : 15f; + float speed = player.wet ? 23f : 17f; float swimIntertia = 24f; if (CalamityWorld.downedPolterghast) { speed *= 1.6f; - swimIntertia = 13f; + swimIntertia = 17f; } npc.velocity = (npc.velocity * (swimIntertia - 1f) + npc.DirectionTo(player.Center) * speed) / swimIntertia; } diff --git a/NPCs/AquaticScourge/AquaticParasite.cs b/NPCs/AquaticScourge/AquaticParasite.cs index 81b70b4dbc..b2ea5db3d1 100644 --- a/NPCs/AquaticScourge/AquaticParasite.cs +++ b/NPCs/AquaticScourge/AquaticParasite.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 460885df00..237bdcca83 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -1,17 +1,11 @@ -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AquaticScourge { - public class AquaticScourgeBody : ModNPC + public class AquaticScourgeBody : ModNPC { public override void SetStaticDefaults() { @@ -24,13 +18,13 @@ namespace CalamityMod.NPCs.AquaticScourge npc.width = 32; npc.height = 32; npc.defense = 20; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; npc.LifeMaxNERB(73000, 85000, 10000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index db525e20ec..db1ce4db78 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -1,17 +1,11 @@ -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AquaticScourge { - public class AquaticScourgeBodyAlt : ModNPC + public class AquaticScourgeBodyAlt : ModNPC { public override void SetStaticDefaults() { @@ -24,13 +18,13 @@ namespace CalamityMod.NPCs.AquaticScourge npc.width = 32; npc.height = 32; npc.defense = 15; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; npc.LifeMaxNERB(73000, 85000, 10000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index a4c37a4cd2..31c51f86e8 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.LoreItems; @@ -12,22 +12,18 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.TownNPCs; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using CalamityMod.Items.Armor.Vanity; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AquaticScourge { - [AutoloadBossHead] + [AutoloadBossHead] public class AquaticScourgeHead : ModNPC { public override void SetStaticDefaults() @@ -42,11 +38,11 @@ namespace CalamityMod.NPCs.AquaticScourge npc.width = 100; npc.height = 90; npc.defense = 10; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.aiStyle = -1; aiType = -1; npc.LifeMaxNERB(73000, 85000, 10000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -81,7 +77,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.99 || CalamityWorld.bossRushActive) + if (npc.justHit || npc.life <= npc.lifeMax * 0.99 || CalamityWorld.bossRushActive) { Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) @@ -266,7 +262,7 @@ namespace CalamityMod.NPCs.AquaticScourge { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 26bedbf1f2..e391290aae 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -1,14 +1,11 @@ -using Microsoft.Xna.Framework; -using System.IO; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AquaticScourge { - public class AquaticScourgeTail : ModNPC + public class AquaticScourgeTail : ModNPC { public override void SetStaticDefaults() { @@ -21,13 +18,13 @@ namespace CalamityMod.NPCs.AquaticScourge npc.width = 30; npc.height = 50; npc.defense = 25; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; npc.LifeMaxNERB(73000, 85000, 10000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AquaticScourge/AquaticSeekerBody.cs b/NPCs/AquaticScourge/AquaticSeekerBody.cs index a185d176a8..35c59407be 100644 --- a/NPCs/AquaticScourge/AquaticSeekerBody.cs +++ b/NPCs/AquaticScourge/AquaticSeekerBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index 847aa16995..58d420a3d8 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.AquaticScourge Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -114,44 +114,21 @@ namespace CalamityMod.NPCs.AquaticScourge Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 200); //800 - if ((Main.player[npc.target].Center - npc.Center).Length() > 200f) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 300f; - } - else - { - num191 = Main.player[npc.target].Center.X - 300f; - } - } - } - } + if ((Main.player[npc.target].Center - npc.Center).Length() > 200f) + { + num192 -= 160; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 300f; + } + else + { + num191 = Main.player[npc.target].Center.X - 300f; + } + } + } float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; float num50 = npc.velocity.Length(); @@ -168,40 +145,6 @@ namespace CalamityMod.NPCs.AquaticScourge npc.velocity *= num49; } } - if ((Main.player[npc.target].Center - npc.Center).Length() > 200f) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -354,7 +297,7 @@ namespace CalamityMod.NPCs.AquaticScourge { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/AquaticScourge/AquaticSeekerTail.cs b/NPCs/AquaticScourge/AquaticSeekerTail.cs index 75253344ee..5a18e0422a 100644 --- a/NPCs/AquaticScourge/AquaticSeekerTail.cs +++ b/NPCs/AquaticScourge/AquaticSeekerTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; diff --git a/NPCs/AquaticScourge/AquaticUrchin.cs b/NPCs/AquaticScourge/AquaticUrchin.cs index 6839a8c8c8..f301bfa362 100644 --- a/NPCs/AquaticScourge/AquaticUrchin.cs +++ b/NPCs/AquaticScourge/AquaticUrchin.cs @@ -1,15 +1,13 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.World; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.AquaticScourge { - public class AquaticUrchin : ModNPC + public class AquaticUrchin : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 798a20ca0d..e27be4a2be 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 54; npc.aiStyle = 41; npc.defense = 14; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 300; npc.knockBackResist = 0.6f; npc.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index df64942acb..e6f1003bd7 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Astral npc.width = 30; //324 npc.height = 30; //216 npc.defense = 10; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 50; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index ffb353cfde..1dd8067b76 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 9901d2440c..3cea4ff667 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral npc.aiStyle = 3; npc.damage = 55; npc.defense = 20; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 500; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0.38f; diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index e8db4ad77b..c3a3cb7d01 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Astral npc.aiStyle = -1; npc.damage = 55; npc.defense = 20; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 500; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0f; diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 5159f6951e..3ce951f053 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 88; npc.damage = 70; npc.defense = 40; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 1200; npc.knockBackResist = 0.08f; npc.value = Item.buyPrice(0, 1, 0, 0); diff --git a/NPCs/Astral/BigSightseer.cs b/NPCs/Astral/BigSightseer.cs index 5c27dc930d..5c6552fa6c 100644 --- a/NPCs/Astral/BigSightseer.cs +++ b/NPCs/Astral/BigSightseer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 56; npc.damage = 50; npc.defense = 20; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 430; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.noGravity = true; diff --git a/NPCs/Astral/EnchantedNightcrawler.cs b/NPCs/Astral/EnchantedNightcrawler.cs index 92acdd9143..944a68c4a8 100644 --- a/NPCs/Astral/EnchantedNightcrawler.cs +++ b/NPCs/Astral/EnchantedNightcrawler.cs @@ -1,13 +1,10 @@ -using CalamityMod.Dusts; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.NPCs.Astral { - public class EnchantedNightcrawler : ModNPC + public class EnchantedNightcrawler : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 998019408b..1e7216d85b 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral npc.aiStyle = 103; npc.lifeMax = 400; npc.defense = 12; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.value = Item.buyPrice(0, 0, 20, 0); npc.knockBackResist = 0.8f; npc.behindTiles = true; diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 99eb382df8..2cc7eb6e38 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.Astral npc.aiStyle = -1; npc.damage = 50; npc.defense = 8; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 330; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0.75f; diff --git a/NPCs/Astral/Hive.cs b/NPCs/Astral/Hive.cs index 7643451a5a..c5566554ff 100644 --- a/NPCs/Astral/Hive.cs +++ b/NPCs/Astral/Hive.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.Astral npc.aiStyle = -1; npc.damage = 55; npc.defense = 15; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 470; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0f; diff --git a/NPCs/Astral/Hiveling.cs b/NPCs/Astral/Hiveling.cs index 491747b89b..13edef2367 100644 --- a/NPCs/Astral/Hiveling.cs +++ b/NPCs/Astral/Hiveling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index cd04642ca5..6a54edbd3c 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -9,6 +9,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Astral @@ -32,7 +33,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 58; npc.aiStyle = -1; npc.defense = 6; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 340; npc.knockBackResist = 0.2f; npc.value = Item.buyPrice(0, 0, 15, 0); @@ -124,7 +125,7 @@ namespace CalamityMod.NPCs.Astral npc.velocity.X *= 0.95f; if (npc.ai[2] == 25f) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 71); + Main.PlaySound(SoundID.Item71, npc.position); Vector2 vector = Main.player[npc.target].Center - npc.Center; vector.Normalize(); int damage = CalamityWorld.downedAstrageldon ? 45 : 55; diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index db273cbbbf..2cd1f5bd17 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 50; npc.damage = 45; npc.defense = 15; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 230; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.noGravity = true; diff --git a/NPCs/Astral/SmallSightseer.cs b/NPCs/Astral/SmallSightseer.cs index e3c7e0a4f6..b16d5068ce 100644 --- a/NPCs/Astral/SmallSightseer.cs +++ b/NPCs/Astral/SmallSightseer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Astral npc.height = 40; npc.damage = 38; npc.defense = 16; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 310; npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.noGravity = true; diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 1642b5fe02..d2dd20c242 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Accessories; @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.Astral npc.npcSlots = 0.5f; //needed? npc.damage = 55; npc.defense = 18; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.knockBackResist = 0.65f; npc.lifeMax = 210; npc.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 09706f7935..506f616ee7 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -1,4 +1,3 @@ -using Microsoft.Xna.Framework; using MonoMod.Cil; using System; using CalamityMod.Dusts; @@ -6,11 +5,10 @@ using CalamityMod.Items.Critters; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Terraria.ModLoader.ModContent; namespace CalamityMod.NPCs.Astral { - public class Twinkler : ModNPC + public class Twinkler : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index e47c132305..c306f05f51 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Armor.Vanity; @@ -22,12 +22,10 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AstrumAureus { - [AutoloadBossHead] + [AutoloadBossHead] public class AstrumAureus : ModNPC { private bool stomping = false; @@ -42,12 +40,13 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetDefaults() { npc.lavaImmune = true; + npc.noGravity = true; npc.npcSlots = 15f; npc.damage = 80; npc.width = 400; npc.height = 280; npc.defense = 50; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.LifeMaxNERB(96000, NPC.downedMoonlord ? 440000 : 122000, 8400000); // 30 seconds in boss rush npc.aiStyle = -1; aiType = -1; @@ -90,7 +89,7 @@ namespace CalamityMod.NPCs.AstrumAureus { npc.value = Item.buyPrice(0, 35, 0, 0); } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); } @@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (npc.ai[0] == 3f || npc.ai[0] == 4f) num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -315,7 +314,7 @@ namespace CalamityMod.NPCs.AstrumAureus Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Color.Gold); Color color40 = Color.Lerp(Color.White, color, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 5f97122228..625da296da 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.AstrumAureus float amount9 = 0.5f; int num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -242,7 +242,7 @@ namespace CalamityMod.NPCs.AstrumAureus texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumAureus/AureusSpawnGlow"); Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { @@ -291,7 +291,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override bool CheckDead() { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 14); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.damage = 150; diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs deleted file mode 100644 index 8a74392812..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ /dev/null @@ -1,186 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System.IO; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; - -namespace CalamityMod.NPCs.AstrumDeus -{ - public class AstrumDeusBody : ModNPC - { - private int spawn = 0; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus"); - } - - public override void SetDefaults() - { - npc.damage = 85; - npc.npcSlots = 5f; - npc.width = 38; - npc.height = 44; - npc.defense = 40; - npc.Calamity().RevPlusDR(0.1f); - npc.LifeMaxNERB(12000, 18000, 360000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)(npc.lifeMax * HPBoost); - npc.aiStyle = 6; - aiType = -1; - npc.knockBackResist = 0f; - npc.scale = 1.2f; - if (Main.expertMode) - { - npc.scale = 1.35f; - } - npc.alpha = 255; - npc.behindTiles = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.netAlways = true; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.dontCountMe = true; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(spawn); - writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); - writer.Write(npc.localAI[3]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - spawn = reader.ReadInt32(); - npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); - npc.localAI[3] = reader.ReadSingle(); - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - - public override void AI() - { - CalamityAI.AstrumDeusAI(npc, mod, false, false); - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - return !npc.dontTakeDamage; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAlt") : Main.npcTexture[npc.type]; - Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2"); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : 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 color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f); - - 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); - - return false; - } - - public override bool CheckActive() - { - return false; - } - - public override bool PreNPCLoot() - { - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (NPC.CountNPCS(ModContent.NPCType()) < 3 && CalamityWorld.revenge) - { - if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25)) - { - spawn = 1; - int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == NetmodeID.Server && num660 < 200) - { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } - npc.netUpdate = true; - } - } - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 180, true); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.85f); - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusBody.png b/NPCs/AstrumDeus/AstrumDeusBody.png deleted file mode 100644 index 284653890c..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusBody.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusBodyAlt.png b/NPCs/AstrumDeus/AstrumDeusBodyAlt.png deleted file mode 100644 index fac26158a6..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusBodyAlt.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index 461fe47192..b5359096a3 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -1,28 +1,16 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AstrumDeus { public class AstrumDeusBodySpectral : ModNPC { - private int spawn = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Astrum Deus"); @@ -36,9 +24,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 38; npc.height = 44; npc.defense = 50; - npc.LifeMaxNERB(37500, 53800, 1300000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + npc.LifeMaxNERB(187500, 225000, 6500000); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -70,16 +58,12 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SendExtraAI(BinaryWriter writer) { - writer.Write(spawn); writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); } public override void ReceiveExtraAI(BinaryReader reader) { - spawn = reader.ReadInt32(); npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -89,7 +73,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void AI() { - CalamityAI.AstrumDeusAI(npc, mod, false, true); + CalamityAI.AstrumDeusAI(npc, mod, false); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -100,44 +84,44 @@ namespace CalamityMod.NPCs.AstrumDeus Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyAltSpectral") : Main.npcTexture[npc.type]; Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusBodyGlow2"); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Color color36 = npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White; + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); + Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = lightColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + 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 color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f); + Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { Color color41 = color37; color41 = Color.Lerp(color41, color36, amount9); - color41 *= (float)(num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color41 *= (num153 - num163) / 15f; + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); @@ -145,7 +129,7 @@ namespace CalamityMod.NPCs.AstrumDeus { Color color43 = color42; color43 = Color.Lerp(color43, color36, amount9); - color43 *= (float)(num153 - num163) / 15f; + color43 *= (num153 - num163) / 15f; spriteBatch.Draw(texture2D16, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -176,27 +160,14 @@ namespace CalamityMod.NPCs.AstrumDeus public override void HitEffect(int hitDirection, double damage) { - if (NPC.CountNPCS(ModContent.NPCType()) < 6 && CalamityWorld.revenge) - { - if (npc.life > 0 && Main.netMode != NetmodeID.MultiplayerClient && spawn == 0 && Main.rand.NextBool(25)) - { - spawn = 1; - int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == NetmodeID.Server && num660 < 200) - { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); - } - npc.netUpdate = true; - } - } if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 50; npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); @@ -204,7 +175,7 @@ namespace CalamityMod.NPCs.AstrumDeus if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs deleted file mode 100644 index 4951512def..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ /dev/null @@ -1,165 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; - -namespace CalamityMod.NPCs.AstrumDeus -{ - [AutoloadBossHead] - public class AstrumDeusHead : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus"); - } - - public override void SetDefaults() - { - npc.damage = 100; - npc.npcSlots = 5f; - npc.width = 56; - npc.height = 56; - npc.defense = 20; - npc.Calamity().RevPlusDR(0.1f); - npc.LifeMaxNERB(12000, 18000, 360000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); - npc.aiStyle = 6; - aiType = -1; - npc.knockBackResist = 0f; - npc.scale = 1.2f; - if (Main.expertMode) - { - npc.scale = 1.35f; - } - npc.alpha = 255; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.behindTiles = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.netAlways = true; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); - if (calamityModMusic != null) - music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/AstrumDeus"); - else - music = MusicID.Boss3; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); - } - - public override void AI() - { - CalamityAI.AstrumDeusAI(npc, mod, true, false); - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - return !npc.dontTakeDamage; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2"); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow"); - Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f); - - 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); - - return false; - } - - public override bool CheckActive() - { - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - - public override bool PreNPCLoot() - { - return false; - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 240, true); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusHead.png b/NPCs/AstrumDeus/AstrumDeusHead.png deleted file mode 100644 index 36c7f52056..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusHead.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index bc37d9d99a..027f0b42a3 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -11,11 +11,6 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -24,8 +19,6 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AstrumDeus { @@ -45,9 +38,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 56; npc.height = 56; npc.defense = 25; - npc.LifeMaxNERB(37500, 53800, 1300000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + npc.LifeMaxNERB(187500, 225000, 6500000); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -80,18 +73,16 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); } public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); } public override void AI() { - CalamityAI.AstrumDeusAI(npc, mod, true, true); + CalamityAI.AstrumDeusAI(npc, mod, true); } public override bool CheckActive() @@ -107,50 +98,50 @@ namespace CalamityMod.NPCs.AstrumDeus Texture2D texture2D15 = Main.npcTexture[npc.type]; Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow2"); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Color color36 = npc.Calamity().newAI[0] == 1f ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White; + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); + Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = lightColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.Calamity().newAI[0] == 1f ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusHeadGlow"); - Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f); + Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { Color color41 = color37; color41 = Color.Lerp(color41, color36, amount9); - color41 *= (float)(num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color41 *= (num153 - num163) / 15f; + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; color43 = Color.Lerp(color43, color36, amount9); - color43 *= (float)(num153 - num163) / 15f; + color43 *= (num153 - num163) / 15f; spriteBatch.Draw(texture2D16, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -162,25 +153,16 @@ namespace CalamityMod.NPCs.AstrumDeus return false; } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - if (npc.Calamity().newAI[0] == 1f && Main.player[npc.target].gravDir != -1f) - { - return false; - } - return true; - } - public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 50; npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); @@ -188,7 +170,7 @@ namespace CalamityMod.NPCs.AstrumDeus if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) diff --git a/NPCs/AstrumDeus/AstrumDeusHead_Head_Boss.png b/NPCs/AstrumDeus/AstrumDeusHead_Head_Boss.png deleted file mode 100644 index 2c559518c5..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusHead_Head_Boss.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusProbe.cs b/NPCs/AstrumDeus/AstrumDeusProbe.cs deleted file mode 100644 index e283c02000..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusProbe.cs +++ /dev/null @@ -1,142 +0,0 @@ -using CalamityMod.Dusts; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.AstrumDeus -{ - public class AstrumDeusProbe : ModNPC - { - private bool start = true; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus Probe"); - } - - public override void SetDefaults() - { - npc.aiStyle = -1; - aiType = -1; - npc.width = 30; - npc.height = 30; - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.damage = 0; - npc.lifeMax = 100; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - } - - public override bool PreAI() - { - bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; - if (start) - { - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); - } - npc.ai[1] = npc.ai[0]; - start = false; - } - npc.TargetClosest(true); - Vector2 direction = Main.player[npc.target].Center - npc.Center; - direction.Normalize(); - direction *= CalamityWorld.bossRushActive ? 13f : 9f; - npc.rotation = direction.ToRotation(); - npc.localAI[0] += 1f; - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 720f) - { - npc.localAI[0] = 0f; - int seeProjFileforDmg = 0; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType(), seeProjFileforDmg, 0f, Main.myPlayer, 0f, 0f); - } - bool anySmallDeusHeads = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active) - { - npc.active = false; - npc.netUpdate = true; - return false; - } - Player player = Main.player[npc.target]; - int npcType = anySmallDeusHeads ? ModContent.NPCType() : ModContent.NPCType(); - NPC parent = Main.npc[NPC.FindFirstNPC(npcType)]; - double deg = (double)npc.ai[1]; - double rad = deg * (Math.PI / 180); - double dist = 75; - npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; - npc.ai[1] += 2f; - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - - public override bool CheckActive() - { - return false; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Astral/AstralProbeGlow"); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White * 0.6f, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); - - return false; - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusProbe.png b/NPCs/AstrumDeus/AstrumDeusProbe.png deleted file mode 100644 index cb5bb69dc7..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusProbe.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusProbe2.cs b/NPCs/AstrumDeus/AstrumDeusProbe2.cs deleted file mode 100644 index 03f2a6c955..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusProbe2.cs +++ /dev/null @@ -1,143 +0,0 @@ -using CalamityMod.Dusts; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.AstrumDeus -{ - public class AstrumDeusProbe2 : ModNPC - { - public int timer = 0; - public bool start = true; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus Probe"); - } - - public override void SetDefaults() - { - npc.aiStyle = -1; - aiType = -1; - npc.width = 30; - npc.height = 30; - npc.noGravity = true; - npc.noTileCollide = true; - npc.chaseable = false; - npc.dontTakeDamage = true; - npc.damage = 0; - npc.lifeMax = 100; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - } - - public override bool PreAI() - { - bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; - if (start) - { - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); - } - npc.ai[1] = npc.ai[0]; - start = false; - } - npc.TargetClosest(true); - Vector2 direction = Main.player[npc.target].Center - npc.Center; - direction.Normalize(); - direction *= 40f; - npc.rotation = direction.ToRotation(); - npc.localAI[0] += 1f; - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 360f) - { - npc.localAI[0] = 0f; - int seeProjFileforDmg = 0; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, ModContent.ProjectileType(), seeProjFileforDmg, 0f, Main.myPlayer, 0f, 0f); - } - bool anySmallDeusHeads = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active) - { - npc.active = false; - npc.netUpdate = true; - return false; - } - Player player = Main.player[npc.target]; - int npcType = anySmallDeusHeads ? ModContent.NPCType() : ModContent.NPCType(); - NPC parent = Main.npc[NPC.FindFirstNPC(npcType)]; - double deg = (double)npc.ai[1]; - double rad = deg * (Math.PI / 180); - double dist = 150; - npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; - npc.ai[1] += 2f; - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - - public override bool CheckActive() - { - return false; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Astral/AstralProbeGlow"); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White * 0.6f, npc.rotation, vector11, npc.scale, npc.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); - - return false; - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusProbe2.png b/NPCs/AstrumDeus/AstrumDeusProbe2.png deleted file mode 100644 index cb5bb69dc7..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusProbe2.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusProbe3.cs b/NPCs/AstrumDeus/AstrumDeusProbe3.cs deleted file mode 100644 index 9bdffdf84a..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusProbe3.cs +++ /dev/null @@ -1,336 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Dusts; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.AstrumDeus -{ - public class AstrumDeusProbe3 : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus Probe"); - } - - public override void SetDefaults() - { - npc.aiStyle = -1; - aiType = -1; - npc.npcSlots = 2f; - npc.damage = 0; - npc.width = 30; - npc.height = 30; - npc.defense = 30; - npc.Calamity().RevPlusDR(0.2f); - npc.lifeMax = 1400; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 120000; - } - npc.knockBackResist = 0.95f; - npc.noGravity = true; - npc.noTileCollide = true; - npc.canGhostHeal = false; - npc.DeathSound = SoundID.NPCDeath14; - npc.buffImmune[24] = true; - } - - public override void AI() - { - bool revenge = CalamityWorld.revenge; - if (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active) - { - npc.active = false; - npc.netUpdate = true; - return; - } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - float num = revenge ? 6f : 5f; - float num2 = revenge ? 0.07f : 0.065f; - if (CalamityWorld.death) - { - num = 8f; - num2 = 0.08f; - } - if (CalamityWorld.bossRushActive) - { - num *= 1.5f; - num2 *= 1.5f; - } - Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num4 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); - float num5 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - num4 = (float)((int)(num4 / 8f) * 8); - num5 = (float)((int)(num5 / 8f) * 8); - vector.X = (float)((int)(vector.X / 8f) * 8); - vector.Y = (float)((int)(vector.Y / 8f) * 8); - num4 -= vector.X; - num5 -= vector.Y; - float num6 = (float)Math.Sqrt((double)(num4 * num4 + num5 * num5)); - float num7 = num6; - bool flag = false; - if (num6 > 600f) - { - flag = true; - } - if (num6 == 0f) - { - num4 = npc.velocity.X; - num5 = npc.velocity.Y; - } - else - { - num6 = num / num6; - num4 *= num6; - num5 *= num6; - } - if (num7 > 100f) - { - npc.ai[0] += 1f; - if (npc.ai[0] > 0f) - { - npc.velocity.Y = npc.velocity.Y + 0.023f; - } - else - { - npc.velocity.Y = npc.velocity.Y - 0.023f; - } - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - { - npc.velocity.X = npc.velocity.X + 0.023f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.023f; - } - if (npc.ai[0] > 200f) - { - npc.ai[0] = -200f; - } - } - if (Main.player[npc.target].dead) - { - num4 = (float)npc.direction * num / 2f; - num5 = -num / 2f; - } - if (npc.velocity.X < num4) - { - npc.velocity.X = npc.velocity.X + num2; - } - else if (npc.velocity.X > num4) - { - npc.velocity.X = npc.velocity.X - num2; - } - if (npc.velocity.Y < num5) - { - npc.velocity.Y = npc.velocity.Y + num2; - } - else if (npc.velocity.Y > num5) - { - npc.velocity.Y = npc.velocity.Y - num2; - } - npc.localAI[0] += 1f; - if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 180f) - { - npc.localAI[0] = 0f; - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - int num8 = Main.expertMode ? 38 : 45; - int num9 = 84; - Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); - } - } - int num10 = (int)npc.position.X + npc.width / 2; - int num11 = (int)npc.position.Y + npc.height / 2; - num10 /= 16; - num11 /= 16; - if (!WorldGen.SolidTile(num10, num11)) - { - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.3f, 0f, 0.25f); - } - if (num4 > 0f) - { - npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2((double)num5, (double)num4); - } - if (num4 < 0f) - { - npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2((double)num5, (double)num4) + 3.14f; - } - float num12 = 0.7f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * -num12; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * -num12; - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) - { - npc.velocity.Y = 2f; - } - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) - { - npc.velocity.Y = -2f; - } - } - if (flag) - { - if ((npc.velocity.X > 0f && num4 > 0f) || (npc.velocity.X < 0f && num4 < 0f)) - { - if (Math.Abs(npc.velocity.X) < 12f) - { - npc.velocity.X = npc.velocity.X * 1.05f; - } - } - else - { - npc.velocity.X = npc.velocity.X * 0.9f; - } - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Astral/AstralProbeGlow"); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White * 0.6f, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.soundDelay == 0) - { - npc.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AstralEnemyHit"), npc.Center); - break; - case 1: - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AstralEnemyHit2"), npc.Center); - break; - case 2: - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AstralEnemyHit3"), npc.Center); - break; - } - } - - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 30; - npc.height = 30; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - for (int num625 = 0; num625 < 3; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; - } - } - } - - public override bool PreNPCLoot() - { - return false; - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 120, true); - if (CalamityWorld.revenge) - { - player.AddBuff(ModContent.BuffType(), 120); - } - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusProbe3.png b/NPCs/AstrumDeus/AstrumDeusProbe3.png deleted file mode 100644 index e08f7efc9e..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusProbe3.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs deleted file mode 100644 index b1da58c004..0000000000 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ /dev/null @@ -1,162 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System.IO; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; - -namespace CalamityMod.NPCs.AstrumDeus -{ - public class AstrumDeusTail : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astrum Deus"); - } - - public override void SetDefaults() - { - npc.damage = 70; - npc.npcSlots = 5f; - npc.width = 52; - npc.height = 68; - npc.defense = 60; - npc.Calamity().RevPlusDR(0.35f); - npc.LifeMaxNERB(12000, 18000, 360000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); - npc.aiStyle = 6; - aiType = -1; - npc.knockBackResist = 0f; - npc.scale = 1.2f; - if (Main.expertMode) - { - npc.scale = 1.35f; - } - npc.alpha = 255; - npc.behindTiles = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.canGhostHeal = false; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.netAlways = true; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.dontCountMe = true; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - - public override void AI() - { - CalamityAI.AstrumDeusAI(npc, mod, false, false); - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - return !npc.dontTakeDamage; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - - Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; - vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(125, 75, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow"); - Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f); - - spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f); - - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 50; - npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num621 = 0; num621 < 5; num621++) - { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 10; num623++) - { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 3f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); - Main.dust[num624].velocity *= 2f; - } - } - } - - public override bool CheckActive() - { - return false; - } - - public override bool PreNPCLoot() - { - return false; - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 120, true); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.85f); - } - } -} diff --git a/NPCs/AstrumDeus/AstrumDeusTail.png b/NPCs/AstrumDeus/AstrumDeusTail.png deleted file mode 100644 index 2e13fbf3f8..0000000000 Binary files a/NPCs/AstrumDeus/AstrumDeusTail.png and /dev/null differ diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 8f345677a9..0920f9585f 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -1,19 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Projectiles.Ranged; -using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.AstrumDeus { @@ -32,9 +24,9 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 52; npc.height = 68; npc.defense = 75; - npc.LifeMaxNERB(37500, 53800, 1300000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + npc.LifeMaxNERB(187500, 225000, 6500000); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -67,13 +59,11 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); - writer.Write(npc.chaseable); } public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); - npc.chaseable = reader.ReadBoolean(); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -83,7 +73,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void AI() { - CalamityAI.AstrumDeusAI(npc, mod, false, true); + CalamityAI.AstrumDeusAI(npc, mod, false); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -93,43 +83,43 @@ namespace CalamityMod.NPCs.AstrumDeus spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); - Color color36 = npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : Color.White; + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); + Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = lightColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); - spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.dontTakeDamage ? new Color(250, 150, Main.DiscoB, npc.alpha) : npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/AstrumDeus/AstrumDeusTailGlow"); - Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f); + Color color37 = Color.Lerp(Color.White, Color.Orange, 0.5f) * npc.Opacity; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { Color color41 = color37; color41 = Color.Lerp(color41, color36, amount9); - color41 *= (float)(num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color41 *= (num153 - num163) / 15f; + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } @@ -149,12 +139,12 @@ namespace CalamityMod.NPCs.AstrumDeus { if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 50; npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); @@ -162,7 +152,7 @@ namespace CalamityMod.NPCs.AstrumDeus if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 494d44fe18..f3256cbe44 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.width = 60; npc.height = 60; npc.defense = 0; - npc.Calamity().RevPlusDR(normalDR); + npc.DR_NERD(normalDR); npc.lifeMax = 4000; npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 98e46862e9..53fd072e5b 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -10,21 +9,17 @@ using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.BrimstoneElemental { - [AutoloadBossHead] + [AutoloadBossHead] public class BrimstoneElemental : ModNPC { public override void SetStaticDefaults() @@ -42,7 +37,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.defense = 15; npc.value = Item.buyPrice(0, 12, 0, 0); npc.LifeMaxNERB(30000, 41000, 6500000); - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; @@ -50,7 +45,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.lifeMax *= 8; npc.value *= 3f; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 6584ed016a..bbbc92f96d 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -42,13 +42,11 @@ namespace CalamityMod.NPCs.Bumblebirb npc.width = 130; npc.height = 100; npc.defense = 40; + npc.DR_NERD(0.1f, null, null, null, true); CalamityGlobalNPC global = npc.Calamity(); - global.DR = 0.1f; - global.customDR = true; - global.multDRReductions.Add(BuffID.Ichor, 0.88f); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.LifeMaxNERB(227500, 252500, 3000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) @@ -259,7 +257,7 @@ namespace CalamityMod.NPCs.Bumblebirb color = lightColor; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += num154) { @@ -314,7 +312,7 @@ namespace CalamityMod.NPCs.Bumblebirb } } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num160 = 0; num160 < num156; num160++) { @@ -356,7 +354,7 @@ namespace CalamityMod.NPCs.Bumblebirb color40 *= num161; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163 += num154) { diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index dd3ab8562f..5b55047eb6 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.Bumblebirb npc.netSpam = 5; if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } return; } @@ -339,7 +339,7 @@ namespace CalamityMod.NPCs.Bumblebirb float amount9 = 0.5f; int num153 = npc.ai[0] == 2.1f ? 7 : 0; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 6031a3655b..2c9a25d28b 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -1,21 +1,16 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Calamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class Calamitas : ModNPC { public override void SetStaticDefaults() @@ -32,7 +27,7 @@ namespace CalamityMod.NPCs.Calamitas npc.width = 120; npc.height = 120; npc.defense = 15; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.value = 0f; npc.LifeMaxNERB(37500, 51750, 5200000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) @@ -41,7 +36,7 @@ namespace CalamityMod.NPCs.Calamitas npc.defense *= 3; npc.lifeMax *= 3; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -104,7 +99,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -127,7 +122,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 6e5c28cf6f..1d1618fbdb 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -1,21 +1,17 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Calamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class CalamitasRun : ModNPC { public override void SetStaticDefaults() @@ -32,7 +28,7 @@ namespace CalamityMod.NPCs.Calamitas npc.width = 120; npc.height = 120; npc.defense = 10; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.LifeMaxNERB(9000, 13200, 800000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { @@ -40,7 +36,7 @@ namespace CalamityMod.NPCs.Calamitas npc.defense *= 5; npc.lifeMax *= 3; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -107,7 +103,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -130,7 +126,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRunGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index 9ec03c6fcd..b3f99c1857 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -1,21 +1,17 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Calamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class CalamitasRun2 : ModNPC { public override void SetStaticDefaults() @@ -32,15 +28,15 @@ namespace CalamityMod.NPCs.Calamitas npc.width = 120; npc.height = 120; npc.defense = 10; - npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERB(7500, 11025, 800000); + npc.DR_NERD(0.15f); + npc.LifeMaxNERB(7500, 11025, 800000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; npc.defense *= 5; npc.lifeMax *= 3; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -107,7 +103,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -130,7 +126,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun2Glow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index 908cd94261..525a07add1 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; @@ -12,22 +12,18 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Calamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class CalamitasRun3 : ModNPC { public override void SetStaticDefaults() @@ -45,8 +41,8 @@ namespace CalamityMod.NPCs.Calamitas npc.height = 120; npc.defense = 25; npc.value = Item.buyPrice(0, 15, 0, 0); - npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERB(28125, 38812, 3900000); + npc.DR_NERD(0.15f); + npc.LifeMaxNERB(28125, 38812, 3900000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; @@ -54,7 +50,7 @@ namespace CalamityMod.NPCs.Calamitas npc.lifeMax *= 3; npc.value *= 2.5f; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -133,7 +129,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -156,7 +152,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/CalamitasRun3Glow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index 0c4add9f14..88c1c5ea47 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -52,7 +52,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/LifeSeekerGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index cf1bbcfdf6..b4158783dd 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Calamitas npc.canGhostHeal = false; npc.damage = 40; npc.defense = 10; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 2500; if (CalamityWorld.bossRushActive) { @@ -101,8 +101,8 @@ namespace CalamityMod.NPCs.Calamitas { if (NPC.CountNPCS(ModContent.NPCType()) < 3) { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 25)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 25)); + int x = (int)(npc.position.X + Main.rand.Next(npc.width - 25)); + int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 25)); int num663 = ModContent.NPCType(); int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255); } @@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.Calamitas timer = 0; } NPC parent = Main.npc[NPC.FindFirstNPC(ModContent.NPCType())]; - double deg = (double)npc.ai[1]; + double deg = npc.ai[1]; double rad = deg * (Math.PI / 180); double dist = 150; npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.Calamitas float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.Calamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/SoulSeekerGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 316a528d53..4919dfd7ca 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs public static void AquaticScourgeAI(NPC npc, Mod mod, bool head) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; @@ -47,6 +48,9 @@ namespace CalamityMod.NPCs else npc.damage = 0; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + // Homing only works if the boss is hostile if (head) npc.chaseable = calamityGlobalNPC.newAI[0] == 1f; @@ -148,7 +152,7 @@ namespace CalamityMod.NPCs Main.npc[lol].ai[2] = npc.whoAmI; Main.npc[lol].ai[1] = Previous; Main.npc[Previous].ai[0] = lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } calamityGlobalNPC.newAI[2] = 1f; @@ -158,7 +162,7 @@ namespace CalamityMod.NPCs if (calamityGlobalNPC.newAI[0] == 1f && !doSpiral) { npc.localAI[0] += 1f; - if (player.gravDir == -1f) + if (player.gravDir == -1f && expertMode) npc.localAI[0] += 2f; if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (revenge ? 360f : 420f))) @@ -183,37 +187,37 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int damageBoom = Main.expertMode ? 23 : 28; + int damageBoom = expertMode ? 23 : 28; float velocity = revenge ? 7.5f : 6.5f; if (death) velocity += 2f; if (CalamityWorld.bossRushActive) velocity = 11f; - int totalProjectiles = 30; + int totalProjectiles = expertMode ? 30 : 20; float radians = MathHelper.TwoPi / totalProjectiles; for (int i = 0; i < totalProjectiles; i++) { - int projectileType = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - if (projectileType == ModContent.ProjectileType()) - damageBoom = Main.expertMode ? 25 : 30; - + int projectileType = ModContent.ProjectileType(); Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); Projectile.NewProjectile(npc.Center, vector255, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); } - damageBoom = Main.expertMode ? 28 : 33; - int num320 = Main.rand.Next(5, 9); - int num3; - for (int num321 = 0; num321 < num320; num321 = num3 + 1) + damageBoom = expertMode ? 28 : 33; + int num320 = expertMode ? 14 : 7; + for (int num321 = 0; num321 < num320; num321++) { Vector2 vector15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); vector15.Normalize(); - vector15 *= Main.rand.Next(50, 401) * (CalamityWorld.bossRushActive ? 0.02f : 0.01f); - if (death) + vector15 *= Main.rand.Next(50, 401); + + if (expertMode) + vector15 *= death ? 0.05f : 0.05f * (1f - lifeRatio); + + if (CalamityWorld.bossRushActive) vector15 *= 1.1f; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType(), damageBoom, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); - num3 = num321; + + Projectile.NewProjectile(npc.Center, vector15, ModContent.ProjectileType(), damageBoom, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); } } } @@ -228,7 +232,7 @@ namespace CalamityMod.NPCs { if (npc.type == ModContent.NPCType()) { - int num = (Main.expertMode || CalamityWorld.bossRushActive) ? 4 : 3; + int num = expertMode ? 4 : 3; npc.localAI[0] += Main.rand.Next(num); if (npc.localAI[0] >= Main.rand.Next(700, 10000)) { @@ -242,7 +246,7 @@ namespace CalamityMod.NPCs float num943 = player.position.Y + player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt(num942 * num942 + num943 * num943); int projectileType = ModContent.ProjectileType(); - int damage = Main.expertMode ? 25 : 30; + int damage = expertMode ? 25 : 30; float num941 = CalamityWorld.bossRushActive ? 7.5f : 5f; num944 = num941 / num944; num942 *= num944; @@ -268,7 +272,7 @@ namespace CalamityMod.NPCs float num943 = player.position.Y + player.height * 0.5f - vector104.Y; float num944 = (float)Math.Sqrt(num942 * num942 + num943 * num943); int projectileType = ModContent.ProjectileType(); - int damage = Main.expertMode ? 23 : 28; + int damage = expertMode ? 23 : 28; float num941 = CalamityWorld.bossRushActive ? 12f : 8f; num944 = num941 / num944; num942 *= num944; @@ -359,53 +363,31 @@ namespace CalamityMod.NPCs Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num191 = player.position.X + (player.width / 2); float num192 = player.position.Y + (player.height / 2); - int num42 = -1; - int num43 = (int)(player.Center.X / 16f); - int num44 = (int)(player.Center.Y / 16f); if (head && !doSpiral) { - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) + if (calamityGlobalNPC.newAI[0] != 1f) { - for (int num46 = num44; num46 <= num44 + 15; num46++) + num192 += 400; + if (Math.Abs(npc.Center.X - player.Center.X) < 500f) { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - break; - } - - if (num42 > 0) - { - num42 *= 16; - float num47 = num42 + (notOcean ? 800 : 400); //800 - if (calamityGlobalNPC.newAI[0] != 1f) - { - num192 = num47; - if (Math.Abs(npc.Center.X - player.Center.X) < (notOcean ? 500f : 400f)) //500 - { - if (npc.velocity.X > 0f) - num191 = player.Center.X + (notOcean ? 600f : 480f); //600 - else - num191 = player.Center.X - (notOcean ? 600f : 480f); //600 - } + if (npc.velocity.X > 0f) + num191 = player.Center.X + 600f; + else + num191 = player.Center.X - 600f; } } if (calamityGlobalNPC.newAI[0] == 1f) { - num188 = revenge ? 15f : 13f; - num189 = 0.16f; + num188 = revenge ? 13f : 11f; + num189 = revenge ? 0.14f : 0.12f; if (notOcean) { - num188 = 17f; - num189 = 0.18f; + num188 = 15f; + num189 = 0.15f; } - if (player.gravDir == -1f) + if (player.gravDir == -1f && expertMode) { num188 = 20f; num189 = 0.2f; @@ -415,10 +397,10 @@ namespace CalamityMod.NPCs num188 = 22f; num189 = 0.24f; } - if (death) + if (expertMode) { - num188 += 1f; - num189 += 0.02f; + num188 += death ? 4f : 4f * (1f - lifeRatio); + num189 += death ? 0.04f : 0.04f * (1f - lifeRatio); } } @@ -656,8 +638,9 @@ namespace CalamityMod.NPCs speed = 6f; else if (revenge) speed = 5.5f; - float speedBoost = death ? 2f : 2f * (1f - lifeRatio); - speed += speedBoost; + + if (expertMode) + speed += death ? 2f : 2f * (1f - lifeRatio); // Variables for target location relative to npc location float xDistance = player.Center.X - vectorCenter.X; @@ -744,7 +727,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType()) < 2 && revenge) { - NPC.NewNPC((int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)vectorCenter.X, (int)vectorCenter.Y, ModContent.NPCType()); } Main.PlaySound(SoundID.Item8, vectorCenter); npc.alpha = 255; @@ -788,26 +771,15 @@ namespace CalamityMod.NPCs { npc.chaseable = true; npc.rotation = npc.velocity.X * 0.04f; + float playerLocation = vectorCenter.X - player.Center.X; npc.direction = playerLocation < 0f ? 1 : -1; npc.spriteDirection = npc.direction; + npc.ai[1] += 1f; + float divisor = expertMode ? (death ? 30f : revenge ? 35f : 40f) - (float)Math.Ceiling(10f * (1f - lifeRatio)) : 45f; - bool shootProjectile = false; - if (lifeRatio < 0.1f || CalamityWorld.bossRushActive) - { - if (npc.ai[1] % 30f == 29f) - shootProjectile = true; - } - else if (lifeRatio < 0.5f || death) - { - if (npc.ai[1] % 35f == 34f) - shootProjectile = true; - } - else if (npc.ai[1] % 40f == 39f) - shootProjectile = true; - - if (shootProjectile) + if (npc.ai[1] % divisor == divisor - 1f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -838,14 +810,15 @@ namespace CalamityMod.NPCs } float projectileSpeed = CalamityWorld.bossRushActive ? 7f : 5f; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) projectileSpeed += 4f; if (revenge) projectileSpeed += 1f; if (!calamity) projectileSpeed += 2f; - float projectileSpeedBoost = death ? 3f : 3f * (1f - lifeRatio); - projectileSpeed += projectileSpeedBoost; + + if (expertMode) + projectileSpeed += death ? 3f : 3f * (1f - lifeRatio); vectorCenter = npc.Center; float relativeSpeedX = player.position.X + player.width * 0.5f - vectorCenter.X; @@ -904,7 +877,7 @@ namespace CalamityMod.NPCs npc.velocity.X = -8f; } - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= divisor * 6f) { npc.TargetClosest(true); npc.ai[0] = 4f; @@ -922,9 +895,11 @@ namespace CalamityMod.NPCs npc.chaseable = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - float shootBoost = death ? 2f : 2f * (1f - lifeRatio); - npc.localAI[0] += 1f + shootBoost; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + npc.localAI[0] += 1f; + if (expertMode) + npc.localAI[0] += death ? 2f : 2f * (1f - lifeRatio); + + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.localAI[0] += 2f; if (death || !calamity) npc.localAI[0] += 1f; @@ -944,7 +919,7 @@ namespace CalamityMod.NPCs float radialOffset = 0.2f; float diameter = 80f; - vectorCenter.Y -= Math.Abs(vectorCenter.X) * radialOffset; + //vectorCenter.Y -= Math.Abs(vectorCenter.X) * radialOffset; vectorCenter = Vector2.Normalize(vectorCenter) * projectileSpeed; Vector2 velocity = vectorCenter; @@ -997,19 +972,7 @@ namespace CalamityMod.NPCs Vector2 source = new Vector2(vectorCenter.X + (npc.spriteDirection > 0 ? 34f : -34f), vectorCenter.Y - 74f); Vector2 aimAt = player.Center + player.velocity * 20f; - float aimResponsiveness = 0.4f; - - switch ((int)npc.ai[2]) - { - case 0: - break; - case 1: - aimResponsiveness = 0.25f; - break; - case 2: - aimResponsiveness = 0.1f; - break; - } + float aimResponsiveness = (npc.ai[2] == 1f || death) ? 0.1f : 0.25f; Vector2 aimVector = Vector2.Normalize(aimAt - source); if (aimVector.HasNaNs()) @@ -1024,14 +987,17 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[1] = laserVelocity.X; calamityGlobalNPC.newAI[2] = laserVelocity.Y; + // Rev = 190 + 165 = 355 + // Death = 165 + npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= 240f) { npc.TargetClosest(true); npc.ai[2] += 1f; npc.localAI[0] = 0f; npc.localAI[1] = 0f; - if (npc.ai[2] >= 3f) + if (npc.ai[2] >= (death ? 1f : 2f)) { npc.ai[0] = 3f; npc.ai[1] = 0f; @@ -1051,7 +1017,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] == 180f) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 104); + Main.PlaySound(SoundID.Item68, source); Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); laserVelocity2.Normalize(); Projectile.NewProjectile(source, laserVelocity2, ModContent.ProjectileType(), 40 + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, npc.whoAmI); @@ -1060,22 +1026,24 @@ namespace CalamityMod.NPCs } else { - float playSoundTimer = 20f; + float playSoundTimer = 30f; if (npc.ai[1] < 150f) { switch ((int)npc.ai[2]) { case 0: + npc.ai[1] += 0.5f; break; case 1: - npc.ai[1] += 0.5f; - playSoundTimer = 30f; - break; - case 2: npc.ai[1] += 1f; playSoundTimer = 40f; break; } + if (death) + { + npc.ai[1] += 0.5f; + playSoundTimer += 10f; + } } if (npc.ai[1] % playSoundTimer == 0f) @@ -1117,7 +1085,7 @@ namespace CalamityMod.NPCs // Spawn phase 2 Cal if (lifeRatio <= 0.75f && Main.netMode != NetmodeID.MultiplayerClient && !phase2) { - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); string key = "Mods.CalamityMod.CalamitasBossText"; Color messageColor = Color.Orange; if (Main.netMode == NetmodeID.SinglePlayer) @@ -1149,7 +1117,7 @@ namespace CalamityMod.NPCs CalamityGlobalNPC.calamitas = npc.whoAmI; // Seeker ring - if (calamityGlobalNPC.newAI[1] == 0f && lifeRatio <= 0.35f) + if (calamityGlobalNPC.newAI[1] == 0f && lifeRatio <= 0.35f && expertMode) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1186,8 +1154,8 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[0] = npc.life; if (calamityGlobalNPC.newAI[0] <= (float)npc.lifeMax * 0.1) { - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); + NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); string key = "Mods.CalamityMod.CalamitasBossText2"; Color messageColor = Color.Orange; @@ -1197,9 +1165,9 @@ namespace CalamityMod.NPCs NetMessage.BroadcastChatMessage(NetworkText.FromKey(key), messageColor); } else if (calamityGlobalNPC.newAI[0] <= (float)npc.lifeMax * 0.4) - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); else - NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); } } } @@ -1317,6 +1285,14 @@ namespace CalamityMod.NPCs num823 += 1f; num824 += 0.02f; } + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num824 *= 0.5f; + } + if (provy) { num823 *= 1.25f; @@ -1380,8 +1356,8 @@ namespace CalamityMod.NPCs { if (!brotherAlive) { - float shootBoost = death ? 1f : 1f * (1f - lifeRatio); - npc.localAI[1] += shootBoost; + if (expertMode) + npc.localAI[1] += death ? 1f : 1f * (1f - lifeRatio); if (revenge) npc.localAI[1] += 0.5f; } @@ -1390,7 +1366,7 @@ namespace CalamityMod.NPCs { npc.localAI[1] = 0f; float num828 = CalamityWorld.bossRushActive ? 16f : (expertMode ? 14f : 12.5f); - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num828 += 5f; int num829 = expertMode ? 34 : 42; @@ -1452,6 +1428,14 @@ namespace CalamityMod.NPCs num832 += 1f; num833 += 0.02f; } + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num833 *= 0.5f; + } + if (provy) { num832 *= 1.25f; @@ -1508,7 +1492,7 @@ namespace CalamityMod.NPCs { if (revenge) npc.localAI[1] += 0.5f; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.localAI[1] += 0.5f; if (expertMode) npc.localAI[1] += 0.5f; @@ -1560,7 +1544,7 @@ namespace CalamityMod.NPCs npc.ai[2] += 1f; if (npc.ai[2] >= (phase2 ? 120f : 180f)) { - npc.ai[1] = (phase2 && !brotherAlive && lifeRatio < 0.7f && revenge ? 4f : 0f); + npc.ai[1] = phase2 && !brotherAlive && lifeRatio < 0.7f && revenge ? 4f : 0f; npc.ai[2] = 0f; npc.TargetClosest(true); npc.netUpdate = true; @@ -1578,7 +1562,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.bossRushActive) chargeVelocity *= 1.5f; - Vector2 vector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center); + Vector2 vector = Vector2.Normalize(player.Center + player.velocity * 10f - npc.Center); npc.velocity = vector * chargeVelocity; npc.ai[1] = 3f; @@ -1620,8 +1604,8 @@ namespace CalamityMod.NPCs else { int num62 = 500; - float num63 = (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 20f : 14f; - float num64 = (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 0.5f : 0.35f; + float num63 = (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 20f : 14f; + float num64 = (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 0.5f : 0.35f; if (provy) { @@ -1836,7 +1820,7 @@ namespace CalamityMod.NPCs npc.velocity.Y -= num862; } - npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f; + npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f; if (npc.ai[2] >= 240f) { npc.TargetClosest(true); @@ -1898,7 +1882,7 @@ namespace CalamityMod.NPCs num870 += 2f; if (death) num870 += 2f; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num870 += 4f; if (provy) num870 *= 1.15f; @@ -2109,7 +2093,7 @@ namespace CalamityMod.NPCs npc.velocity.Y -= num862; } - npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f; + npc.ai[2] += (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 2f : 1f; if (npc.ai[2] >= 180f) { npc.TargetClosest(true); @@ -2171,7 +2155,7 @@ namespace CalamityMod.NPCs num870 += 2f; if (death) num870 += 2f; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num870 += 4f; if (provy) num870 *= 1.15f; @@ -2245,9 +2229,12 @@ namespace CalamityMod.NPCs bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - int shootBuff = death ? 1 : (int)(2f * (1f - lifeRatio)); - float shootTimer = 1f + shootBuff; - bool dayTime = Main.dayTime; + + float shootTimer = 1f; + if (expertMode) + shootTimer += death ? 1 : (int)(2f * (1f - lifeRatio)); + + bool dayTime = Main.dayTime; // Get a target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -2300,7 +2287,7 @@ namespace CalamityMod.NPCs // Fire projectiles while walking, teleporting, or falling if (npc.ai[0] == 2f || npc.ai[0] >= 5f || (npc.ai[0] == 4f && npc.velocity.Y > 0f) || - calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -2314,7 +2301,7 @@ namespace CalamityMod.NPCs laserDamage *= 3; // Fire astral flames while teleporting - if ((npc.ai[0] >= 5f && npc.ai[0] != 7) || calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if ((npc.ai[0] >= 5f && npc.ai[0] != 7) || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { float velocity = CalamityWorld.bossRushActive ? 10f : 7f; int totalProjectiles = 8; @@ -2362,8 +2349,10 @@ namespace CalamityMod.NPCs // Start up if (npc.ai[0] == 0f) { - // If hit or after two seconds start Idle phase - npc.ai[1] += 1f; + CustomGravity(); + + // If hit or after two seconds start Idle phase + npc.ai[1] += 1f; if (npc.justHit || npc.ai[1] >= 120f) { // Set AI to next phase (Idle) and reset other AI @@ -2376,8 +2365,10 @@ namespace CalamityMod.NPCs // Idle else if (npc.ai[0] == 1f) { - // Decrease defense - npc.defense = 0; + CustomGravity(); + + // Decrease defense + npc.defense = 0; // Slow down npc.velocity.X *= 0.98f; @@ -2385,13 +2376,12 @@ namespace CalamityMod.NPCs // Stay vulnerable for a maximum of 1.5 or 2.5 seconds npc.ai[1] += 1f; - if (npc.ai[1] >= ((phase3 || calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 90f : 150f)) + if (npc.ai[1] >= ((phase3 || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 90f : 150f)) { // Increase defense npc.defense = 70; // Stop colliding with tiles - npc.noGravity = true; npc.noTileCollide = true; // Set AI to next phase (Walk) and reset other AI @@ -2406,11 +2396,14 @@ namespace CalamityMod.NPCs else if (npc.ai[0] == 2f) { // Set walking speed - float speedBoost = death ? 3f : 3f * (1f - lifeRatio); - float num823 = (CalamityWorld.bossRushActive ? 8f : 5f) + speedBoost; + float num823 = CalamityWorld.bossRushActive ? 8f : 5f; + if (expertMode) + num823 += death ? 3f : 3f * (1f - lifeRatio); + if (revenge) + num823 += Math.Abs(npc.Center.X - player.Center.X) * 0.0025f; - // Set walking direction - if (Math.Abs(npc.Center.X - player.Center.X) < 200f) + // Set walking direction + if (Math.Abs(npc.Center.X - player.Center.X) < 200f) { npc.velocity.X *= 0.9f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) @@ -2467,7 +2460,6 @@ namespace CalamityMod.NPCs if (npc.ai[1] >= 360f) { // Collide with tiles again - npc.noGravity = false; npc.noTileCollide = false; // Set AI to next phase (Jump) and reset other AI @@ -2485,7 +2477,10 @@ namespace CalamityMod.NPCs // Jump else if (npc.ai[0] == 3f) { - npc.noTileCollide = false; + CustomGravity(); + + npc.noTileCollide = false; + if (npc.velocity.Y == 0f) { // Slow down @@ -2498,11 +2493,24 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == -1f) { // Set jump velocity, reset and set AI to next phase (Stomp) - float velocityBoost = death ? 6f : 6f * (1f - lifeRatio); - float velocityX = (CalamityWorld.bossRushActive ? 9f : 6f) + velocityBoost; - npc.velocity.X = velocityX * npc.direction; + float velocityX = CalamityWorld.bossRushActive ? 9f : 6f; + if (expertMode) + velocityX += death ? 6f : 6f * (1f - lifeRatio); - if (revenge) + npc.velocity.X = velocityX * npc.direction; + + float distanceBelowTarget = npc.position.Y - (player.position.Y + 80f); + + if (revenge) + { + if (distanceBelowTarget > 0f) + calamityGlobalNPC.newAI[0] = 1f + distanceBelowTarget * 0.001f; + + if (calamityGlobalNPC.newAI[0] > 2f) + calamityGlobalNPC.newAI[0] = 2f; + } + + if (expertMode) { if (player.position.Y < npc.Bottom.Y) npc.velocity.Y = -14.5f; @@ -2514,7 +2522,10 @@ namespace CalamityMod.NPCs else npc.velocity.Y = -14.5f; - npc.ai[0] = 4f; + if (calamityGlobalNPC.newAI[0] > 1f) + npc.velocity.Y *= calamityGlobalNPC.newAI[0]; + + npc.ai[0] = 4f; npc.ai[1] = 0f; } } @@ -2539,8 +2550,10 @@ namespace CalamityMod.NPCs else npc.ai[0] = 3f; - // Spawn dust for visual effect - for (int num622 = (int)npc.position.X - 20; num622 < (int)npc.position.X + npc.width + 40; num622 += 20) + calamityGlobalNPC.newAI[0] = 0f; + + // Spawn dust for visual effect + for (int num622 = (int)npc.position.X - 20; num622 < (int)npc.position.X + npc.width + 40; num622 += 20) { for (int num623 = 0; num623 < 4; num623++) { @@ -2553,7 +2566,7 @@ namespace CalamityMod.NPCs { // Set velocities while falling, this happens before the stomp // Fall through - if (!player.dead && revenge) + if (!player.dead && expertMode) { if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) npc.noTileCollide = true; @@ -2567,26 +2580,37 @@ namespace CalamityMod.NPCs if (npc.Bottom.Y < player.position.Y) { - float fallSpeedBoost = death ? 0.8f : 0.8f * (1f - lifeRatio); - float fallSpeed = 0.8f + fallSpeedBoost; - npc.velocity.Y += fallSpeed; - } + float fallSpeed = 0.8f; + if (expertMode) + fallSpeed += death ? 0.8f : 0.8f * (1f - lifeRatio); + + if (calamityGlobalNPC.newAI[0] > 1f) + fallSpeed *= calamityGlobalNPC.newAI[0]; + + npc.velocity.Y += fallSpeed; + } } else { - if (npc.direction < 0) - npc.velocity.X -= 0.2f; + float velocityXChange = 0.02f + Math.Abs(npc.Center.X - player.Center.X) * 0.0005f; + + if (npc.direction < 0) + npc.velocity.X -= velocityXChange; else if (npc.direction > 0) - npc.velocity.X += 0.2f; + npc.velocity.X += velocityXChange; + + float num626 = CalamityWorld.bossRushActive ? 12f : 9f; + if (expertMode) + num626 += death ? 6f : 6f * (1f - lifeRatio); - float velocityBoost = death ? 6f : 6f * (1f - lifeRatio); - float num626 = (CalamityWorld.bossRushActive ? 12f : 9f) + velocityBoost; if (npc.velocity.X < -num626) npc.velocity.X = -num626; if (npc.velocity.X > num626) npc.velocity.X = num626; } - } + + CustomGravity(); + } } // Teleport @@ -2609,7 +2633,7 @@ namespace CalamityMod.NPCs if (NPC.CountNPCS(ModContent.NPCType()) > 1) spawnFlag = false; if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); // Reset localAI and find a teleport destination npc.TargetClosest(true); @@ -2673,13 +2697,11 @@ namespace CalamityMod.NPCs } // Emit dust to make the teleport pretty - int num; - for (int num245 = 0; num245 < 10; num245 = num + 1) + for (int num245 = 0; num245 < 10; num245++) { int num244 = Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X, npc.velocity.Y, 255, default, 2f); Main.dust[num244].noGravity = true; Main.dust[num244].velocity *= 0.5f; - num = num245; } } @@ -2695,7 +2717,7 @@ namespace CalamityMod.NPCs if (NPC.CountNPCS(ModContent.NPCType()) > 1) spawnFlag = false; if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 25, ModContent.NPCType()); // Become vulnerable npc.chaseable = true; @@ -2716,35 +2738,161 @@ namespace CalamityMod.NPCs } // Emit dust to make the teleport pretty - int num; - for (int num245 = 0; num245 < 10; num245 = num + 1) + for (int num245 = 0; num245 < 10; num245++) { int num244 = Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X, npc.velocity.Y, 255, default, 2f); Main.dust[num244].noGravity = true; Main.dust[num244].velocity *= 0.5f; - num = num245; } } + + void CustomGravity() + { + float gravity = 0.3f; + float maxFallSpeed = 10f; + if (npc.wet) + { + if (npc.honeyWet) + { + gravity *= 0.33f; + maxFallSpeed *= 0.4f; + } + else + { + gravity *= 0.66f; + maxFallSpeed *= 0.7f; + } + } + + if (calamityGlobalNPC.newAI[0] > 1f) + maxFallSpeed *= calamityGlobalNPC.newAI[0]; + + npc.velocity.Y += gravity; + if (npc.velocity.Y > maxFallSpeed) + npc.velocity.Y = maxFallSpeed; + } } #endregion #region Astrum Deus - public static void AstrumDeusAI(NPC npc, Mod mod, bool head, bool finalWorm) + public static void AstrumDeusAI(NPC npc, Mod mod, bool head) { - // All parts of every worm use the following code CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); // Difficulty variables bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - bool enraged = calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive); + bool enraged = calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive); + + // Deus cannot hit for 3 seconds + if (calamityGlobalNPC.newAI[1] < 180f || npc.dontTakeDamage) + npc.damage = 0; + else + npc.damage = npc.defDamage; + + // 8 seconds of reistance to prevent spawn killing + if (calamityGlobalNPC.newAI[1] < 480f) + calamityGlobalNPC.newAI[1] += 1f; + + // Get a target + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(true); + + Player player = Main.player[npc.target]; + + // Life + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Phases based on life percentage + bool halfHealth = lifeRatio < 0.5f; + bool doubleWormPhase = calamityGlobalNPC.newAI[0] != 0f; + bool phase2 = (lifeRatio < 0.9f && expertMode) || death || (doubleWormPhase && expertMode); + bool startFlightPhase = lifeRatio < 0.8f || death || doubleWormPhase; + bool phase3 = (lifeRatio < 0.7f && expertMode) || death || (doubleWormPhase && expertMode); + bool phase4 = lifeRatio < 0.5f && doubleWormPhase && expertMode; + bool phase5 = lifeRatio < 0.2f && doubleWormPhase && expertMode; + + // Set timed DR + if (!doubleWormPhase) + { + if (calamityGlobalNPC.AITimer < 3600) + calamityGlobalNPC.AITimer = 3600; + } + + // Flight timer + float aiSwitchTimer = doubleWormPhase ? 1200f : 1800f; + calamityGlobalNPC.newAI[3] += 1f; + if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) + calamityGlobalNPC.newAI[3] = 0f; + + // Enrage variable if player is flying upside down + bool targetFloatingUp = player.gravDir == -1f && expertMode; + + // Phase for flying at the player + bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; + + // Split into two worms + if (head) + { + float splitAnimationTime = 180f; + bool despawnRemainingWorm = doubleWormPhase && NPC.CountNPCS(ModContent.NPCType()) < 2; + if ((halfHealth && calamityGlobalNPC.newAI[0] == 0f) || despawnRemainingWorm) + { + npc.dontTakeDamage = true; + + calamityGlobalNPC.newAI[2] += despawnRemainingWorm ? 10f : 1f; + npc.Opacity = MathHelper.Clamp(1f - (calamityGlobalNPC.newAI[2] / splitAnimationTime), 0f, 1f); + + bool despawning = calamityGlobalNPC.newAI[2] == splitAnimationTime; + + if (despawning) + { + if (!doubleWormPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int npc2 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, npc.type, 1); + Main.npc[npc2].Calamity().newAI[0] = 1f; + Main.npc[npc2].velocity = Vector2.Normalize(player.Center - Main.npc[npc2].Center) * 16f; + Main.npc[npc2].timeLeft *= 20; + Main.npc[npc2].netUpdate = true; + int npc3 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, npc.type, 1); + Main.npc[npc3].Calamity().newAI[0] = 2f; + Main.npc[npc3].Calamity().newAI[3] = 600f; + Main.npc[npc3].velocity = Vector2.Normalize(player.Center - Main.npc[npc3].Center) * 16f; + Main.npc[npc3].timeLeft *= 20; + Main.npc[npc3].netUpdate = true; + } + } + + for (int i = 0; i < Main.maxNPCs; i++) + { + if (i == npc.whoAmI || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType()) + Main.npc[i].active = false; + } + + return; + } + } + } + + // Copy dontTakeDamage and Opacity from previous segment + else + { + npc.dontTakeDamage = Main.npc[(int)npc.ai[2]].dontTakeDamage; + npc.Opacity = Main.npc[(int)npc.ai[2]].Opacity; + } + + // Set worm variable + if (npc.ai[3] > 0f) + npc.realLife = (int)npc.ai[3]; // Emit light Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); // Dust and alpha effects - if (head || Main.npc[(int)npc.ai[1]].alpha < 128) + if ((head || Main.npc[(int)npc.ai[1]].alpha < 128) && !npc.dontTakeDamage) { // Spawn dust if (npc.alpha != 0) @@ -2763,18 +2911,30 @@ namespace CalamityMod.NPCs npc.alpha = 0; } - // Set worm variable - if (npc.ai[3] > 0f) - npc.realLife = (int)npc.ai[3]; - - // Get a target - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(true); - - Player player = Main.player[npc.target]; - - // Velocity - npc.velocity.Length(); + // Check if other segments are still alive, if not, die + if (npc.type > ModContent.NPCType()) + { + bool shouldDespawn = true; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + shouldDespawn = false; + } + if (!shouldDespawn) + { + if (npc.ai[1] > 0f) + shouldDespawn = false; + else if (Main.npc[(int)npc.ai[1]].life > 0) + shouldDespawn = false; + } + if (shouldDespawn) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + npc.active = false; + } + } // Direction if (npc.velocity.X < 0f) @@ -2782,43 +2942,17 @@ namespace CalamityMod.NPCs else if (npc.velocity.X > 0f) npc.spriteDirection = 1; - // Despawn - float maxSpeed = 20f; - bool flies = false; - if (player.dead || Main.dayTime || (!finalWorm && (CalamityGlobalNPC.astrumDeusHeadMain < 0 || !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active))) - { - flies = true; - npc.TargetClosest(false); - float velocity = finalWorm ? 10f : 3f; - npc.velocity.Y -= velocity; - if ((double)npc.position.Y < Main.topWorld + 16f) - { - maxSpeed = 40f; - npc.velocity.Y -= velocity; - } - - if ((double)npc.position.Y < Main.topWorld + 16f) - { - for (int num957 = 0; num957 < Main.maxNPCs; num957++) - { - if (Main.npc[num957].aiStyle == npc.aiStyle || Main.npc[num957].type == ModContent.NPCType() || - Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType()) - Main.npc[num957].active = false; - } - } - } - - // All heads use this code + // Head code if (head) { if (Main.netMode != NetmodeID.MultiplayerClient) { - if (calamityGlobalNPC.newAI[1] == 0f && npc.ai[0] == 0f) + if (npc.ai[0] == 0f) { - int maxLength = finalWorm ? 13 : 5; + int maxLength = doubleWormPhase ? 45 : 90; int Previous = npc.whoAmI; - int bodyType = finalWorm ? ModContent.NPCType() : ModContent.NPCType(); - int tailType = finalWorm ? ModContent.NPCType() : ModContent.NPCType(); + int bodyType = ModContent.NPCType(); + int tailType = ModContent.NPCType(); for (int num36 = 0; num36 < maxLength; num36++) { int lol; @@ -2831,262 +2965,342 @@ namespace CalamityMod.NPCs Main.npc[lol].localAI[3] = 1f; Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].Calamity().newAI[0] = calamityGlobalNPC.newAI[0]; + Main.npc[lol].Calamity().newAI[3] = calamityGlobalNPC.newAI[3]; Main.npc[lol].ai[2] = npc.whoAmI; Main.npc[lol].ai[1] = Previous; Main.npc[Previous].ai[0] = lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } - calamityGlobalNPC.newAI[1] = 1f; } } } - // All body and tail segments use this code - else + if (head) { - // Kill segments - bool flag = false; - if (npc.ai[1] <= 0f) - flag = true; - else if (Main.npc[(int)npc.ai[1]].life <= 0) - flag = true; + int num12 = (int)(npc.position.X / 16f) - 1; + int num13 = (int)((npc.position.X + npc.width) / 16f) + 2; + int num14 = (int)(npc.position.Y / 16f) - 1; + int num15 = (int)((npc.position.Y + npc.height) / 16f) + 2; - if (flag) + if (num12 < 0) + num12 = 0; + if (num13 > Main.maxTilesX) + num13 = Main.maxTilesX; + if (num14 < 0) + num14 = 0; + if (num15 > Main.maxTilesY) + num15 = Main.maxTilesY; + + // Fly or not + bool flag2 = flyAtTarget; + if (!flag2) { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.checkDead(); - } - } - - // Only the main worm uses this code - if (finalWorm) - { - // Only the main worm head uses this code - if (head) - { - // For other worms and probes - CalamityGlobalNPC.astrumDeusHeadMain = npc.whoAmI; - - // Change color depending on phase - if (NPC.AnyNPCs(ModContent.NPCType())) - calamityGlobalNPC.newAI[0] = 1f; - else - calamityGlobalNPC.newAI[0] = 0f; - - // Calculate phases based on worm HP - int astrumDeusTotalHP = 0; - double mainDeusHPRatio = npc.life / (double)npc.lifeMax; - if (calamityGlobalNPC.newAI[0] == 1f) + for (int k = num12; k < num13; k++) { - for (int i = 0; i < Main.maxNPCs; i++) + for (int l = num14; l < num15; l++) { - if (Main.npc[i].type == ModContent.NPCType()) + if (Main.tile[k, l] != null && ((Main.tile[k, l].nactive() && (Main.tileSolid[Main.tile[k, l].type] || (Main.tileSolidTop[Main.tile[k, l].type] && Main.tile[k, l].frameY == 0))) || Main.tile[k, l].liquid > 64)) { - astrumDeusTotalHP += Main.npc[i].life; - if (calamityGlobalNPC.newAI[2] < 10f) + Vector2 vector2; + vector2.X = k * 16; + vector2.Y = l * 16; + if (npc.position.X + npc.width > vector2.X && npc.position.X < vector2.X + 16f && npc.position.Y + npc.height > vector2.Y && npc.position.Y < vector2.Y + 16f) { - calamityGlobalNPC.newAI[2] += 1f; - calamityGlobalNPC.newAI[3] += Main.npc[i].lifeMax; + flag2 = true; + break; } } } - - double astrumDeusHPRatio = astrumDeusTotalHP / calamityGlobalNPC.newAI[3]; - if (astrumDeusHPRatio < 0.33) - { - if (mainDeusHPRatio > 0.33) - calamityGlobalNPC.newAI[0] = 0f; - } - else if (astrumDeusHPRatio < 0.66) - { - if (mainDeusHPRatio > 0.66) - calamityGlobalNPC.newAI[0] = 0f; - } } - - // Change vulnerability based on phase (indicated by color) - npc.dontTakeDamage = calamityGlobalNPC.newAI[0] == 1f; - npc.chaseable = calamityGlobalNPC.newAI[0] != 1f; - - // Speed and turn speed - float speedLimit = revenge ? 7f : 6f; - float turnSpeedLimit = revenge ? 0.11f : 0.1f; - if (CalamityWorld.bossRushActive) - { - speedLimit *= 1.5f; - turnSpeedLimit *= 1.5f; - } - - // Speed and turn speed boosts based on remaining HP - float speedBoost = death ? speedLimit : speedLimit * (1f - (float)mainDeusHPRatio); - float turnSpeedBoost = death ? turnSpeedLimit : turnSpeedLimit * (1f - (float)mainDeusHPRatio); - if (player.gravDir == -1f) - { - speedBoost = speedLimit; - turnSpeedBoost = turnSpeedLimit; - } - - // Velocity - float num188 = 10f + speedBoost; - float num189 = 0.2f + turnSpeedBoost; - - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - - int num42 = -1; - int num43 = (int)(player.Center.X / 16f); - int num44 = (int)(player.Center.Y / 16f); - - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - break; - } - - float num48 = num188 * 1.3f; - float num49 = num188 * 0.7f; - float num50 = npc.velocity.Length(); - if (num50 > 0f) - { - if (num50 > num48) - { - npc.velocity.Normalize(); - npc.velocity *= num48; - } - else if (num50 < num49) - { - npc.velocity.Normalize(); - npc.velocity *= num49; - } - } - - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - float num196 = Math.Abs(num191); - float num197 = Math.Abs(num192); - float num198 = num188 / num193; - num191 *= num198; - num192 *= num198; - - if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) - { - if (npc.velocity.X < num191) - { - npc.velocity.X += num189; - } - else - { - if (npc.velocity.X > num191) - npc.velocity.X -= num189; - } - - if (npc.velocity.Y < num192) - { - npc.velocity.Y += num189; - } - else - { - if (npc.velocity.Y > num192) - npc.velocity.Y -= num189; - } - - if (Math.Abs(num192) < num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += num189 * 2f; - else - npc.velocity.Y -= num189 * 2f; - } - - if (Math.Abs(num191) < num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) - { - if (npc.velocity.X > 0f) - npc.velocity.X += num189 * 2f; - else - npc.velocity.X -= num189 * 2f; - } - } - else - { - if (num196 > num197) - { - if (npc.velocity.X < num191) - npc.velocity.X += num189 * 1.1f; - else if (npc.velocity.X > num191) - npc.velocity.X -= num189 * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += num189; - else - npc.velocity.Y -= num189; - } - } - else - { - if (npc.velocity.Y < num192) - npc.velocity.Y += num189 * 1.1f; - else if (npc.velocity.Y > num192) - npc.velocity.Y -= num189 * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) - { - if (npc.velocity.X > 0f) - npc.velocity.X += num189; - else - npc.velocity.X -= num189; - } - } - } - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; } - // Only the main worm body and tail use this code - else + // Start flying if target is not within a certain distance + if (!flag2) { - // Change vulnerability based on phase (indicated by color) - if (CalamityGlobalNPC.astrumDeusHeadMain != -1) + npc.localAI[1] = 1f; + + if (head) { - npc.dontTakeDamage = Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].dontTakeDamage; - npc.chaseable = Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].chaseable; + Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); + int num16 = targetFloatingUp ? 50 : 200; + int heightReduction = death ? (targetFloatingUp ? 180 : 130) : (int)((targetFloatingUp ? 180f : 130f) * (1f - lifeRatio)); + int height = 400 - heightReduction; + bool flag3 = true; + + if (npc.position.Y > player.position.Y) + { + for (int m = 0; m < Main.maxPlayers; m++) + { + if (Main.player[m].active) + { + Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - num16, (int)Main.player[m].position.Y - num16, num16 * 2, height); + if (rectangle.Intersects(rectangle2) || revenge) + { + flag3 = false; + break; + } + } + } + if (flag3) + flag2 = true; + } + } + } + else + npc.localAI[1] = 0f; + + // Despawn + float fallSpeed = 16f; + if (player.dead || Main.dayTime) + { + flag2 = false; + float velocity = 2f; + npc.velocity.Y -= velocity; + if ((double)npc.position.Y < Main.topWorld + 16f) + { + fallSpeed = 32f; + npc.velocity.Y -= velocity; } - // Shoot lasers - if (npc.type == ModContent.NPCType() && Main.netMode != NetmodeID.MultiplayerClient) + if ((double)npc.position.Y < Main.topWorld + 16f) { - int shootTime = 4; - if (npc.life <= npc.lifeMax * 0.65 || death || player.gravDir == -1f) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { - shootTime += death ? 4 : 2; + if (Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType()) + Main.npc[num957].active = false; } - if (npc.life <= npc.lifeMax * 0.3 || death || player.gravDir == -1f) + } + } + + float fallSpeedBoost = death ? 5f : 5f * (1f - lifeRatio); + fallSpeed += fallSpeedBoost; + + // Speed and movement + float speedBoost = death ? (targetFloatingUp ? 0.26f : 0.13f) : ((targetFloatingUp ? 0.26f : 0.13f) * (1f - lifeRatio)); + float turnSpeedBoost = death ? (targetFloatingUp ? 0.4f : 0.2f) : ((targetFloatingUp ? 0.4f : 0.2f) * (1f - lifeRatio)); + float speed = 0.13f + speedBoost; + float turnSpeed = 0.2f + turnSpeedBoost; + + if (flyAtTarget) + { + float speedMultiplier = doubleWormPhase ? (phase5 ? 1.3f : phase4 ? 1.25f : 1.2f) : 1f; + speed *= speedMultiplier; + } + + if (revenge) + { + float revMultiplier = 1.1f; + speed *= revMultiplier; + turnSpeed *= revMultiplier; + fallSpeed *= revMultiplier; + } + + if (CalamityWorld.bossRushActive) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num20 = player.position.X + (player.width / 2); + float num21 = player.position.Y + (player.height / 2); + num20 = (int)(num20 / 16f) * 16; + num21 = (int)(num21 / 16f) * 16; + vector3.X = (int)(vector3.X / 16f) * 16; + vector3.Y = (int)(vector3.Y / 16f) * 16; + num20 -= vector3.X; + num21 -= vector3.Y; + float num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21); + + if (!flag2) + { + npc.TargetClosest(true); + npc.velocity.Y += 0.15f; + + if (npc.velocity.Y > fallSpeed) + npc.velocity.Y = fallSpeed; + + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * 0.4) + { + if (npc.velocity.X < 0f) + npc.velocity.X -= speed * 1.1f; + else + npc.velocity.X += speed * 1.1f; + } + else if (npc.velocity.Y == fallSpeed) + { + if (npc.velocity.X < num20) + npc.velocity.X += speed; + else if (npc.velocity.X > num20) + npc.velocity.X -= speed; + } + else if (npc.velocity.Y > 4f) + { + if (npc.velocity.X < 0f) + npc.velocity.X += speed * 0.9f; + else + npc.velocity.X -= speed * 0.9f; + } + } + else + { + num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21); + float num25 = Math.Abs(num20); + float num26 = Math.Abs(num21); + float num27 = fallSpeed / num22; + num20 *= num27; + num21 *= num27; + + bool flag6 = false; + if (flyAtTarget) + { + if (((npc.velocity.X > 0f && num20 < 0f) || (npc.velocity.X < 0f && num20 > 0f) || (npc.velocity.Y > 0f && num21 < 0f) || (npc.velocity.Y < 0f && num21 > 0f)) && Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) > speed / 2f && num22 < 400f) { - shootTime += death ? 6 : 2; + flag6 = true; + + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < fallSpeed) + npc.velocity *= 1.1f; } - npc.localAI[0] += Main.rand.Next(shootTime); - if (npc.localAI[0] >= Main.rand.Next(1400, 20000)) + + if (npc.position.Y > player.position.Y) { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + flag6 = true; + + if (Math.Abs(npc.velocity.X) < fallSpeed / 2f) { + if (npc.velocity.X == 0f) + npc.velocity.X -= npc.direction; + + npc.velocity.X *= 1.1f; + } + else if (npc.velocity.Y > -fallSpeed) + npc.velocity.Y -= speed; + } + } + + if (!flag6) + { + if (!flyAtTarget) + { + if (((npc.velocity.X > 0f && num20 > 0f) || (npc.velocity.X < 0f && num20 < 0f)) && ((npc.velocity.Y > 0f && num21 > 0f) || (npc.velocity.Y < 0f && num21 < 0f))) + { + if (npc.velocity.X < num20) + npc.velocity.X += turnSpeed; + else if (npc.velocity.X > num20) + npc.velocity.X -= turnSpeed; + if (npc.velocity.Y < num21) + npc.velocity.Y += turnSpeed; + else if (npc.velocity.Y > num21) + npc.velocity.Y -= turnSpeed; + } + } + + if ((npc.velocity.X > 0f && num20 > 0f) || (npc.velocity.X < 0f && num20 < 0f) || (npc.velocity.Y > 0f && num21 > 0f) || (npc.velocity.Y < 0f && num21 < 0f)) + { + if (npc.velocity.X < num20) + npc.velocity.X += speed; + else if (npc.velocity.X > num20) + npc.velocity.X -= speed; + if (npc.velocity.Y < num21) + npc.velocity.Y += speed; + else if (npc.velocity.Y > num21) + npc.velocity.Y -= speed; + + if (Math.Abs(num21) < fallSpeed * 0.2 && ((npc.velocity.X > 0f && num20 < 0f) || (npc.velocity.X < 0f && num20 > 0f))) + { + if (npc.velocity.Y > 0f) + npc.velocity.Y += speed * 2f; + else + npc.velocity.Y -= speed * 2f; + } + if (Math.Abs(num20) < fallSpeed * 0.2 && ((npc.velocity.Y > 0f && num21 < 0f) || (npc.velocity.Y < 0f && num21 > 0f))) + { + if (npc.velocity.X > 0f) + npc.velocity.X += speed * 2f; + else + npc.velocity.X -= speed * 2f; + } + } + else if (num25 > num26) + { + if (npc.velocity.X < num20) + npc.velocity.X += speed * 1.1f; + else if (npc.velocity.X > num20) + npc.velocity.X -= speed * 1.1f; + + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * 0.5) + { + if (npc.velocity.Y > 0f) + npc.velocity.Y += speed; + else + npc.velocity.Y -= speed; + } + } + else + { + if (npc.velocity.Y < num21) + npc.velocity.Y += speed * 1.1f; + else if (npc.velocity.Y > num21) + npc.velocity.Y -= speed * 1.1f; + + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * 0.5) + { + if (npc.velocity.X > 0f) + npc.velocity.X += speed; + else + npc.velocity.X -= speed; + } + } + } + } + + if (flag2) + { + if (npc.localAI[0] != 1f) + npc.netUpdate = true; + + npc.localAI[0] = 1f; + } + else + { + if (npc.localAI[0] != 0f) + npc.netUpdate = true; + + npc.localAI[0] = 0f; + } + + if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) + npc.netUpdate = true; + + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; + } + + // Only the main worm body and tail use this code + else + { + // Shoot lasers + if (npc.type == ModContent.NPCType() && Main.netMode != NetmodeID.MultiplayerClient) + { + int shootTime = 1; + if (phase2 || targetFloatingUp) + shootTime += 1; + if (phase3 || targetFloatingUp) + shootTime += 1; + + npc.localAI[0] += 1f; + float shootProjectile = 600 / shootTime; + float timer = npc.ai[0] + 15f; + float divisor = timer + shootProjectile; + if (!flyAtTarget) + { + if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) + { + npc.TargetClosest(true); + if (Vector2.Distance(player.Center, npc.Center) > 80f) + { + Main.PlaySound(SoundID.Item12, npc.Center); float num941 = revenge ? 14f : 13f; if (CalamityWorld.bossRushActive) { @@ -3096,7 +3310,7 @@ namespace CalamityMod.NPCs { num941 = 16f; } - if (player.gravDir == -1f) + if (targetFloatingUp) { num941 *= 2f; } @@ -3111,377 +3325,61 @@ namespace CalamityMod.NPCs int num946 = ModContent.ProjectileType(); vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, num945, 0f, Main.myPlayer, player.Center.X, player.Center.Y); npc.netUpdate = true; } } } - - // Follow the head - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; - } - catch - { - } - - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; - - if (num191 < 0f) - npc.spriteDirection = -1; - else if (num191 > 0f) - npc.spriteDirection = 1; - } - } - } - - // Only the smaller worms use this code - else - { - // Change vulnerability based on phase (indicated by final worm color) - if (CalamityGlobalNPC.astrumDeusHeadMain != -1) - { - if (Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].active) - { - npc.dontTakeDamage = !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].dontTakeDamage; - npc.chaseable = !Main.npc[CalamityGlobalNPC.astrumDeusHeadMain].chaseable; - } - } - - // Life remaining - float deusHPRatio = npc.life / (float)npc.lifeMax; - - // Only the smaller worm heads use this code - if (head) - { - // Spawn mine probes - float firstProbeSpawnThreshold = death ? 0.9f : 0.66f; - float secondProbeSpawnThreshold = death ? 0.8f : 0.33f; - - if (deusHPRatio <= firstProbeSpawnThreshold) - { - if (calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); - for (int I = 0; I < 3; I++) - { - int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 120) * 75)), (int)(npc.Center.Y + (Math.Cos(I * 120) * 75)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); - NPC Eye = Main.npc[FireEye]; - Eye.ai[0] = I * 120; - Eye.ai[3] = I * 120; - } - calamityGlobalNPC.newAI[0] = 1f; - } - } - if (deusHPRatio <= secondProbeSpawnThreshold) - { - if (calamityGlobalNPC.newAI[0] == 1f && Main.netMode != NetmodeID.MultiplayerClient) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); - for (int I = 0; I < 5; I++) - { - int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 72) * 150)), (int)(npc.Center.Y + (Math.Cos(I * 72) * 150)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); - NPC Eye = Main.npc[FireEye]; - Eye.ai[0] = I * 72; - Eye.ai[3] = I * 72; - } - calamityGlobalNPC.newAI[0] = 2f; - } - } - - // Velocity variables - float speedAdd = expertMode ? 0.06f : 0.045f; - float turnSpeedAdd = expertMode ? 0.04f : 0.03f; - float newSpeedBoost = death ? speedAdd : speedAdd * (1f - deusHPRatio); - float newTurnSpeedBoost = death ? turnSpeedAdd : turnSpeedAdd * (1f - deusHPRatio); - float newSpeed = 0.12f + newSpeedBoost; - float newTurnSpeed = 0.08f + newTurnSpeedBoost; - - // Movement variables - int num180 = (int)(npc.position.X / 16f) - 1; - int num181 = (int)((npc.position.X + npc.width) / 16f) + 2; - int num182 = (int)(npc.position.Y / 16f) - 1; - int num183 = (int)((npc.position.Y + npc.height) / 16f) + 2; - - if (num180 < 0) - num180 = 0; - if (num181 > Main.maxTilesX) - num181 = Main.maxTilesX; - if (num182 < 0) - num182 = 0; - if (num183 > Main.maxTilesY) - num183 = Main.maxTilesY; - - // Fly or not - if (!flies) - { - for (int num952 = num180; num952 < num181; num952++) - { - for (int num953 = num182; num953 < num183; num953++) - { - if (Main.tile[num952, num953] != null && ((Main.tile[num952, num953].nactive() && (Main.tileSolid[Main.tile[num952, num953].type] || (Main.tileSolidTop[Main.tile[num952, num953].type] && Main.tile[num952, num953].frameY == 0))) || Main.tile[num952, num953].liquid > 64)) - { - Vector2 vector105; - vector105.X = num952 * 16; - vector105.Y = num953 * 16; - if (npc.position.X + npc.width > vector105.X && npc.position.X < vector105.X + 16f && npc.position.Y + npc.height > vector105.Y && npc.position.Y < vector105.Y + 16f) - { - flies = true; - break; - } - } - } - } - } - - if (!flies) - { - npc.localAI[1] = 1f; - Rectangle rectangle12 = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - - int rectX = (int)(600f * deusHPRatio); - if (rectX < 200) - rectX = 200; - - int rectY = (int)(enraged ? 200f : 400f * deusHPRatio); - if (rectY < (enraged ? 75 : 150)) - rectY = enraged ? 75 : 150; - - bool flag95 = true; - if (npc.position.Y > player.position.Y) - { - for (int num955 = 0; num955 < Main.maxPlayers; num955++) - { - if (Main.player[num955].active) - { - Rectangle rectangle13 = new Rectangle((int)Main.player[num955].position.X - rectX, (int)Main.player[num955].position.Y - rectY, rectX * 2, rectY * 2); - if (rectangle12.Intersects(rectangle13)) - { - flag95 = false; - break; - } - } - } - if (flag95) - flies = true; - } - } - else - npc.localAI[1] = 0f; - - // Velocity - float num188 = newSpeed; - float num189 = newTurnSpeed; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - - // Spread the worms out based on proximity to other worms - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == npc.type && i != npc.whoAmI) - { - Vector2 vector = Main.npc[i].Center - npc.Center; - if (vector.Length() < 80f) - { - vector.Normalize(); - vector *= 300f; - num191 -= vector.X; - num192 -= vector.Y; - } - } - } - - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - - if (!flies) - { - npc.TargetClosest(true); - - npc.velocity.Y += 0.15f; - if (npc.velocity.Y > maxSpeed) - npc.velocity.Y = maxSpeed; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < maxSpeed * 0.4) - { - if (npc.velocity.X < 0f) - npc.velocity.X -= num188 * 1.1f; - else - npc.velocity.X += num188 * 1.1f; - } - else if (npc.velocity.Y == maxSpeed) - { - if (npc.velocity.X < num191) - npc.velocity.X += num188; - else if (npc.velocity.X > num191) - npc.velocity.X -= num188; - } - else if (npc.velocity.Y > 4f) - { - if (npc.velocity.X < 0f) - npc.velocity.X += num188 * 0.9f; - else - npc.velocity.X -= num188 * 0.9f; - } - } else { - if (npc.behindTiles && npc.soundDelay == 0) + if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) { - float num195 = num193 / 40f; - if (num195 < 10f) - num195 = 10f; - if (num195 > 20f) - num195 = 20f; - - npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); - } - - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - float num196 = Math.Abs(num191); - float num197 = Math.Abs(num192); - float num198 = maxSpeed / num193; - num191 *= num198; - num192 *= num198; - - if (((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f)) && ((npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f))) - { - if (npc.velocity.X < num191) - npc.velocity.X += num189; - else if (npc.velocity.X > num191) - npc.velocity.X -= num189; - - if (npc.velocity.Y < num192) - npc.velocity.Y += num189; - else if (npc.velocity.Y > num192) - npc.velocity.Y -= num189; - } - - if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) - { - if (npc.velocity.X < num191) - { - npc.velocity.X += num188; - } - else - { - if (npc.velocity.X > num191) - npc.velocity.X -= num188; - } - - if (npc.velocity.Y < num192) - { - npc.velocity.Y += num188; - } - else - { - if (npc.velocity.Y > num192) - npc.velocity.Y -= num188; - } - - if (Math.Abs(num192) < maxSpeed * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += num188 * 2f; - else - npc.velocity.Y -= num188 * 2f; - } - - if (Math.Abs(num191) < maxSpeed * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) - { - if (npc.velocity.X > 0f) - npc.velocity.X += num188 * 2f; - else - npc.velocity.X -= num188 * 2f; - } - } - else - { - if (num196 > num197) - { - if (npc.velocity.X < num191) - npc.velocity.X += num188 * 1.1f; - else if (npc.velocity.X > num191) - npc.velocity.X -= num188 * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < maxSpeed * 0.5) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += num188; - else - npc.velocity.Y -= num188; - } - } - else - { - if (npc.velocity.Y < num192) - npc.velocity.Y += num188 * 1.1f; - else if (npc.velocity.Y > num192) - npc.velocity.Y -= num188 * 1.1f; - - if ((Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < maxSpeed * 0.5) - { - if (npc.velocity.X > 0f) - npc.velocity.X += num188; - else - npc.velocity.X -= num188; - } - } - } - - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; - - if (flies) - { - if (npc.localAI[0] != 1f) - npc.netUpdate = true; - - npc.localAI[0] = 1f; - } - else - { - if (npc.localAI[0] != 0f) - npc.netUpdate = true; - - npc.localAI[0] = 0f; - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; + int num945 = expertMode ? 45 : 60; + int num946 = ModContent.ProjectileType(); + Projectile.NewProjectile(npc.Center, Vector2.Zero, num946, num945, 0f, Main.myPlayer, 0f, 0f); } } } + + // Follow the head + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + + npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; + num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + int num194 = npc.width; + num193 = (num193 - num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + + if (num191 < 0f) + npc.spriteDirection = -1; + else if (num191 > 0f) + npc.spriteDirection = 1; + } } } #endregion @@ -3606,7 +3504,7 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[1] += expertMode ? 1.5f : 1f; calamityGlobalNPC.newAI[1] += calamityGlobalNPC.newAI[2]; - if (calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) calamityGlobalNPC.newAI[1] += 2f; if (calamityGlobalNPC.newAI[1] >= 900f) @@ -3662,10 +3560,10 @@ namespace CalamityMod.NPCs } } - float num823 = 7.5f; - float num824 = 0.08f; + float num823 = expertMode ? 7.5f : 6f; + float num824 = expertMode ? 0.08f : 0.06f; if (!player.ZoneDungeon || CalamityWorld.bossRushActive) - num823 = 25f; + num823 = expertMode ? 25f : 20f; Vector2 vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num825 = player.position.X + (player.width / 2) - vector82.X; @@ -3713,9 +3611,9 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[0] = npc.life; calamityGlobalNPC.newAI[2] += 1f; - int glob = revenge ? 8 : 4; + int glob = expertMode ? 8 : 4; if (calamityGlobalNPC.newAI[0] <= 0.5f) - glob = revenge ? 16 : 8; + glob = expertMode ? 16 : 8; for (int num662 = 0; num662 < glob; num662++) { @@ -3743,6 +3641,7 @@ namespace CalamityMod.NPCs // Variables float rotationMult = 3f; float rotationAmt = 0.03f; + bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; Vector2 vector = npc.Center; @@ -3788,7 +3687,7 @@ namespace CalamityMod.NPCs // Phases bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; - bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f); + bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f) && expertMode; float newPhaseTimer = 180f; bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || @@ -3870,7 +3769,7 @@ namespace CalamityMod.NPCs npc.netSpam = 5; if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } return; } @@ -3975,7 +3874,7 @@ namespace CalamityMod.NPCs if (phase3) num1307 = 1; - int damage = Main.expertMode ? 50 : 60; + int damage = expertMode ? 50 : 60; if (num1307 == 0 && canHit) { @@ -4043,7 +3942,7 @@ namespace CalamityMod.NPCs npc.netSpam = 5; if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -4087,7 +3986,7 @@ namespace CalamityMod.NPCs Vector2 value53 = player.Center - npc.Center; value53.Y -= 20f; npc.ai[2] += 0.0222222228f; - if (Main.expertMode) + if (expertMode) npc.ai[2] += 0.0166666675f; float scaleFactor17 = 8f + npc.ai[2] + value53.Length() / 120f; //4 @@ -4310,7 +4209,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && vector208.Length() < 20f) { int num1325 = 10; - if (Main.expertMode) + if (expertMode) num1325 = (int)(num1325 * 0.75); npc.ai[3] += 1f; @@ -4410,8 +4309,8 @@ namespace CalamityMod.NPCs } // Adjust stats - calamityGlobalNPC.DR = calamityGlobalNPC.newAI[1] == 1f ? 0.15f : 0.6f; - npc.defense = calamityGlobalNPC.newAI[1] == 1f ? npc.defDefense / 4 : npc.defDefense; + calamityGlobalNPC.DR = calamityGlobalNPC.newAI[1] == 1f ? 0f : 0.5f; + npc.defense = calamityGlobalNPC.newAI[1] == 1f ? 0 : npc.defDefense; if (phase3AI) { npc.damage = (int)(npc.defDamage * 1.32f); @@ -5173,7 +5072,7 @@ namespace CalamityMod.NPCs Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(vortexSpawn.X, vortexSpawn.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } @@ -5580,7 +5479,7 @@ namespace CalamityMod.NPCs Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(vortexSpawn.X, vortexSpawn.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); } } @@ -6714,7 +6613,7 @@ namespace CalamityMod.NPCs } } } - if (Main.player[npc.target].dead && flag14) + if ((Main.player[npc.target].dead || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) && flag14) { flag14 = false; } @@ -6778,10 +6677,10 @@ namespace CalamityMod.NPCs num8 = speed / num8; num6 *= num8; num7 *= num8; - int damage = 40; + int damage = 50; if (Main.expertMode) { - damage = 30; + damage = 40; } int beam = Projectile.NewProjectile(npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (Main.player[npc.target].position.Y > npc.Center.Y ? 5f : -5f), num6, num7, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].tileCollide = true; @@ -6806,10 +6705,10 @@ namespace CalamityMod.NPCs num8 = speed / num8; num6 *= num8; num7 *= num8; - int damage = 25; + int damage = 35; if (Main.expertMode) { - damage = 19; + damage = 25; } int beam = Projectile.NewProjectile(npc.Center.X + (npc.spriteDirection == 1 ? 10f : -10f), npc.Center.Y, num6, num7, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index c1798531bb..f549857f80 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Percent life remaining - float lifeRatio = (float)npc.life / (float)npc.lifeMax; + float lifeRatio = npc.life / (float)npc.lifeMax; // Phases based on life percentage bool phase2 = lifeRatio < 0.5f || death; @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 38); + Main.PlaySound(SoundID.Item38, (int)npc.position.X, (int)npc.position.Y); NPC.NewNPC((int)vector.X, (int)vector.Y, ModContent.NPCType()); } @@ -166,10 +166,10 @@ namespace CalamityMod.NPCs // Despawn int despawnDistance = 500; - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > (float)despawnDistance) + if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) { npc.TargetClosest(true); - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > (float)despawnDistance) + if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistance) { if (npc.timeLeft > 10) npc.timeLeft = 10; @@ -552,12 +552,11 @@ namespace CalamityMod.NPCs Main.npc[num255].ai[0] = -1000 * Main.rand.Next(3); Main.npc[num255].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && num255 < Main.maxNPCs) - NetMessage.SendData(23, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); - } - } - } - + if (Main.netMode == NetmodeID.Server && num255 < Main.maxNPCs) + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num255, 0f, 0f, 0f, 0, 0, 0); + } + } + } return false; } #endregion @@ -566,7 +565,7 @@ namespace CalamityMod.NPCs public static bool BuffedEyeofCthulhuAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; float num5 = 20f; // Percent life remaining @@ -727,10 +726,10 @@ namespace CalamityMod.NPCs Main.npc[num23].velocity.Y = vector3.Y; if (Main.netMode == NetmodeID.Server && num23 < Main.maxNPCs) - NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); } - Main.PlaySound(3, (int)vector2.X, (int)vector2.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit1, (int)vector2.X, (int)vector2.Y); int num; for (int m = 0; m < 10; m = num + 1) @@ -845,7 +844,7 @@ namespace CalamityMod.NPCs Main.npc[num34].velocity.Y = vector7.Y; if (Main.netMode == NetmodeID.Server && num34 < Main.maxNPCs) - NetMessage.SendData(23, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num34, 0f, 0f, 0f, 0, 0, 0); } int num; @@ -865,7 +864,7 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; else { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); int num; for (int num35 = 0; num35 < 2; num35 = num + 1) @@ -882,7 +881,7 @@ namespace CalamityMod.NPCs num = num36; } - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } } Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); @@ -979,7 +978,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 1f) { - Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); npc.rotation = num8; float num42 = ((enraged || configBossRushBoost) ? 9.5f : 6.2f) + 4f * (0.85f - lifeRatio); @@ -1140,7 +1139,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 4f) { if (npc.ai[2] == 0f) - Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); + Main.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); float num60 = num5; npc.ai[2] += 1f; @@ -1263,7 +1262,7 @@ namespace CalamityMod.NPCs Main.npc[num23].velocity.Y = vector3.Y; if (Main.netMode == NetmodeID.Server && num23 < Main.maxNPCs) - NetMessage.SendData(23, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); } Main.PlaySound(SoundID.NPCDeath13, npc.position); @@ -1342,7 +1341,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 7f) { if (npc.ai[2] == 0f) - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); float num60 = num5 * 2.5f; npc.ai[2] += 1f; @@ -1383,7 +1382,7 @@ namespace CalamityMod.NPCs public static bool BuffedEaterofWorldsAI(NPC npc, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Total body segments @@ -1513,7 +1512,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (npc.type == NPCID.EaterofWorldsHead && !Main.npc[(int)npc.ai[0]].active) { @@ -1521,7 +1520,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (npc.type == NPCID.EaterofWorldsTail && !Main.npc[(int)npc.ai[1]].active) { @@ -1529,7 +1528,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (npc.type == NPCID.EaterofWorldsBody && (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != npc.aiStyle)) { @@ -1562,7 +1561,7 @@ namespace CalamityMod.NPCs } if (!npc.active && Main.netMode == NetmodeID.Server) - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } // Movement @@ -1732,7 +1731,7 @@ namespace CalamityMod.NPCs num54 = 20f; npc.soundDelay = (int)num54; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } num52 = (float)Math.Sqrt(num39 * num39 + num40 * num40); @@ -1767,13 +1766,13 @@ namespace CalamityMod.NPCs npc.life = 0; if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(23, -1, -1, null, num59, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num59, 0f, 0f, 0f, 0, 0, 0); num59 = arg_2853_0; } if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } num39 = 0f; num40 = num37; @@ -1906,7 +1905,7 @@ namespace CalamityMod.NPCs npc.life = 0; if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -1916,7 +1915,7 @@ namespace CalamityMod.NPCs // Spawn gore if (npc.localAI[2] == 0f) { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); npc.localAI[2] = 1f; @@ -1928,7 +1927,7 @@ namespace CalamityMod.NPCs for (int num794 = 0; num794 < 20; num794++) Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } // Percent life remaining @@ -2007,7 +2006,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 10f) { // Sound - Main.PlaySound(36, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); + Main.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); // Velocity npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * (CalamityWorld.bossRushActive ? 21f : 14f); @@ -2052,7 +2051,7 @@ namespace CalamityMod.NPCs { // Charge sound if (npc.ai[2] == 0f) - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); // Velocity int var = 120; @@ -2546,7 +2545,7 @@ namespace CalamityMod.NPCs float KBResistMultiplier = 1f - baseKnockBackResist * 0.4f; for (float num = 1f; num < balance; num += 0.34f) { - if ((double)KBResist < 0.05) + if (KBResist < 0.05) { KBResist = 0f; break; @@ -2565,11 +2564,14 @@ namespace CalamityMod.NPCs bool death = CalamityWorld.death || CalamityWorld.bossRushActive; int enrageScale = 0; - if ((double)(npc.position.Y / 16f) < Main.worldSurface) + if ((npc.position.Y / 16f) < Main.worldSurface) enrageScale++; if (!Main.player[npc.target].ZoneJungle) enrageScale++; + if (CalamityWorld.bossRushActive) + enrageScale = 0; + // Boost defense and damage as health decreases int statBoost = (int)(20f * (1f - npc.life / (float)npc.lifeMax)); if (death) @@ -2610,7 +2612,7 @@ namespace CalamityMod.NPCs npc.spriteDirection = npc.direction; - if (npc.position.X < (float)(Main.maxTilesX * 8)) + if (npc.position.X < (Main.maxTilesX * 8)) { if (npc.velocity.X > 0f) npc.velocity.X *= 0.98f; @@ -2638,22 +2640,10 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - float num617 = npc.ai[1]; int num618; - do - { - num618 = Main.rand.Next(3); - switch (num618) - { - case 1: - num618 = 2; - break; - case 2: - num618 = 3; - break; - } - } - while ((float)num618 == num617); + do num618 = Main.rand.Next(4); + while (num618 == npc.ai[1] || num618 == 1); + npc.ai[0] = num618; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -2694,7 +2684,7 @@ namespace CalamityMod.NPCs if (npc.life < npc.lifeMax * 0.1 || death) speed += 2f; - speed += 8f * (float)enrageScale; + speed += 8f * enrageScale; // Line up and initiate charge if (npc.ai[1] % 2f == 0f) @@ -2702,7 +2692,7 @@ namespace CalamityMod.NPCs // Get target and initiate charge npc.TargetClosest(true); float num620 = 20f; - num620 += (float)(20 * enrageScale); + num620 += 20 * enrageScale; if (Math.Abs(npc.position.Y + (npc.height / 2) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2))) < num620) { // Set AI variables and speed @@ -2721,7 +2711,7 @@ namespace CalamityMod.NPCs // Face the correct direction and play charge sound npc.spriteDirection = npc.direction; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); return false; } @@ -2749,8 +2739,8 @@ namespace CalamityMod.NPCs num602 += 2f; num603 += 0.1f; } - num602 += (float)(3 * enrageScale); - num603 += 0.5f * (float)enrageScale; + num602 += 3 * enrageScale; + num603 += 0.5f * enrageScale; // Velocity calculations if (npc.position.Y + (npc.height / 2) < Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2)) @@ -2813,7 +2803,7 @@ namespace CalamityMod.NPCs npc.ai[2] = 1f; flag35 = true; } - if (Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > (float)num604 * 1.5f) + if (Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > num604 * 1.5f) { npc.ai[2] = 1f; flag35 = true; @@ -2858,7 +2848,6 @@ namespace CalamityMod.NPCs npc.velocity *= 0.9f; num606 += 0.05f; } - if (enrageScale > 0) npc.velocity *= 0.7f; @@ -2970,7 +2959,7 @@ namespace CalamityMod.NPCs // Spawn bees or hornets if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && spawnBee) { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient) { int hornetAmt = CalamityMod.hornetList.Count; @@ -3041,8 +3030,9 @@ namespace CalamityMod.NPCs if (npc.ai[2] > 3f) { npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; + npc.ai[1] = 2f; + npc.ai[2] = 0f; + npc.netUpdate = true; } } @@ -3057,11 +3047,11 @@ namespace CalamityMod.NPCs float num623 = (float)Math.Sqrt(num621 * num621 + num622 * num622); npc.ai[1] += 1f; - int num650 = ((npc.life < npc.lifeMax * 0.25) ? 15 : ((npc.life < npc.lifeMax * 0.5) ? 20 : ((npc.life < npc.lifeMax * 0.75) ? 25 : 30))); + int num650 = (npc.life < npc.lifeMax * 0.25) ? 15 : ((npc.life < npc.lifeMax * 0.5) ? 20 : ((npc.life < npc.lifeMax * 0.75) ? 25 : 30)); num650 -= 5 * enrageScale; // Fire stingers - if (npc.ai[1] % (float)num650 == (float)(num650 - 1) && npc.position.Y + npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (npc.ai[1] % num650 == (num650 - 1) && npc.position.Y + npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector78, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { Main.PlaySound(SoundID.Item17, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -3069,7 +3059,7 @@ namespace CalamityMod.NPCs float num624 = CalamityWorld.bossRushActive ? 16f : 12f; if (npc.life < npc.lifeMax * 0.33 || death) num624 += 3f; - num624 += (float)(7 * enrageScale); + num624 += 7 * enrageScale; float num625 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector78.X; float num626 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector78.Y; @@ -3089,7 +3079,7 @@ namespace CalamityMod.NPCs // Movement calculations float num620 = CalamityWorld.bossRushActive ? 0.1f : 0.075f; - num620 += 0.2f * (float)enrageScale; + num620 += 0.2f * enrageScale; if (!Collision.CanHit(new Vector2(vector78.X, vector78.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { num620 = CalamityWorld.bossRushActive ? 0.125f : 0.1f; @@ -3156,9 +3146,7 @@ namespace CalamityMod.NPCs } // Go to a random phase - float num660 = 20f; - num660 -= (float)(5 * enrageScale); - if (npc.ai[1] > (float)num650 * num660) + if (npc.ai[1] > num650 * 15f) { npc.ai[0] = -1f; npc.ai[1] = 3f; @@ -3191,10 +3179,10 @@ namespace CalamityMod.NPCs } } - if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + if (Main.netMode == NetmodeID.Server) + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); - npc.netSpam = 5; + npc.netSpam = 5; return false; } @@ -3204,7 +3192,7 @@ namespace CalamityMod.NPCs public static bool BuffedSkeletronAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Percent life remaining @@ -3243,7 +3231,7 @@ namespace CalamityMod.NPCs { npc.TargetClosest(true); calamityGlobalNPC.newAI[0] = 1f; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, -0.25f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, -0.25f); int num155 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.SkeletronHand, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num155].ai[0] = -1f; @@ -3284,7 +3272,7 @@ namespace CalamityMod.NPCs if (Main.dayTime && !CalamityWorld.bossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { npc.ai[1] = 2f; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } // Hand immunity @@ -3306,7 +3294,6 @@ namespace CalamityMod.NPCs { npc.ai[3] = 0f; - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 66, 1f, -0.25f); Main.PlaySound(SoundID.Item66, npc.position); Vector2 vector10 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -3554,7 +3541,7 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[1] += 1f; if (calamityGlobalNPC.newAI[1] == 2f) - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); if (npc.ai[2] >= 300f) { @@ -3869,7 +3856,7 @@ namespace CalamityMod.NPCs public static bool BuffedWallofFleshAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Despawn @@ -3926,7 +3913,7 @@ namespace CalamityMod.NPCs if (npc.localAI[3] >= (600 + Main.rand.Next(1000))) { npc.localAI[3] = -Main.rand.Next(200); - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 10, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath10, (int)npc.position.X, (int)npc.position.Y); } // Set whoAmI variable @@ -4051,7 +4038,7 @@ namespace CalamityMod.NPCs // Play roar sound on players nearby if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 2800f) - Main.PlaySound(4, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 10, 1f, -0.25f); + Main.PlaySound(SoundID.NPCKilled, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 10, 1f, -0.25f); } } else if (distanceFromTarget < distanceBeforeSlowingDown) @@ -4238,7 +4225,7 @@ namespace CalamityMod.NPCs public static bool BuffedWallofFleshEyeAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Despawn @@ -4368,7 +4355,7 @@ namespace CalamityMod.NPCs public static bool BuffedDestroyerAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // 8 seconds of reistance to prevent spawn killing @@ -4379,13 +4366,17 @@ namespace CalamityMod.NPCs float lifeRatio = npc.life / (float)npc.lifeMax; // Phases based on life percentage - bool phase2 = lifeRatio < 0.66f || death; - bool phase3 = lifeRatio < 0.33f || death; + bool phase2 = lifeRatio < 0.85f || death; + bool phase3 = lifeRatio < 0.7f || death; + bool startFlightPhase = lifeRatio < 0.5f || death; + bool phase4 = lifeRatio < 0.25f; + bool phase5 = lifeRatio < 0.1f; // Flight timer + float newAISet = phase5 ? 900f : phase4 ? 450f : 0f; calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= 1800f) - calamityGlobalNPC.newAI[3] = 0f; + calamityGlobalNPC.newAI[3] = newAISet; // Set worm variable for worms if (npc.ai[3] > 0f) @@ -4401,10 +4392,7 @@ namespace CalamityMod.NPCs bool targetFloatingUp = player.gravDir == -1f; // Phase for flying at the player - bool flyAtTarget = calamityGlobalNPC.newAI[3] >= 900f && (lifeRatio < 0.5f || death); - - // Velocity - npc.velocity.Length(); + bool flyAtTarget = calamityGlobalNPC.newAI[3] >= 900f && startFlightPhase; // Dust on spawn and alpha effects if (npc.type == NPCID.TheDestroyer || (npc.type != NPCID.TheDestroyer && Main.npc[(int)npc.ai[1]].alpha < 128)) @@ -4493,16 +4481,16 @@ namespace CalamityMod.NPCs Main.npc[num5].realLife = npc.whoAmI; Main.npc[num5].ai[1] = num2; Main.npc[num2].ai[0] = num5; - NetMessage.SendData(23, -1, -1, null, num5, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num5, 0f, 0f, 0f, 0, 0, 0); num2 = num5; } } // Fire lasers - if (npc.type == NPCID.TheDestroyerBody && Vector2.Distance(player.Center, npc.Center) > (flyAtTarget ? 320f : 80f)) + if (npc.type == NPCID.TheDestroyerBody && Vector2.Distance(player.Center, npc.Center) > 80f && !flyAtTarget) { // Laser rate of fire - int shootTime = 1 + (int)Math.Ceiling(((enraged || configBossRushBoost) ? 7D : 3D) * lifeRatio); + int shootTime = 2 + (int)Math.Ceiling(((enraged || configBossRushBoost) ? 5D : 2D) * (1f - lifeRatio)); if (CalamityWorld.bossRushActive) shootTime += 1; @@ -4561,11 +4549,6 @@ namespace CalamityMod.NPCs damage += 4; projectileType = ModContent.ProjectileType(); } - else if (phase2) - { - damage += 2; - projectileType = ModContent.ProjectileType(); - } } else projectileType = ProjectileID.SaucerScrap; @@ -4701,6 +4684,7 @@ namespace CalamityMod.NPCs } } } + float fallSpeedBoost = death ? 5f : 5f * (1f - lifeRatio); fallSpeed += fallSpeedBoost; @@ -4710,10 +4694,16 @@ namespace CalamityMod.NPCs float speed = 0.1f + speedBoost; float turnSpeed = 0.15f + turnSpeedBoost; + if (flyAtTarget) + { + float speedMultiplier = phase5 ? 1.5f : phase4 ? 1.3f : 1.2f; + speed *= speedMultiplier; + } + if (CalamityWorld.bossRushActive) { - speed *= 1.5f; - turnSpeed *= 1.5f; + speed *= 1.25f; + turnSpeed *= 1.25f; } Vector2 vector3 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); @@ -4790,7 +4780,7 @@ namespace CalamityMod.NPCs num24 = 20f; npc.soundDelay = (int)num24; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21); @@ -4928,13 +4918,322 @@ namespace CalamityMod.NPCs return false; } - #endregion + #endregion - #region Buffed Twins AI - public static bool BuffedRetinazerAI(NPC npc, bool enraged, Mod mod, bool chaos) + // Only used for Normal and Expert Mode + #region True Melee Retinazer Phase 2 AI + public static bool TrueMeleeRetinazerPhase2AI(NPC npc) + { + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(); + } + bool dead2 = Main.player[npc.target].dead; + float num399 = npc.position.X + (npc.width / 2) - Main.player[npc.target].position.X - (Main.player[npc.target].width / 2); + float num400 = npc.position.Y + npc.height - 59f - Main.player[npc.target].position.Y - (Main.player[npc.target].height / 2); + float num401 = (float)Math.Atan2(num400, num399) + 1.57f; + if (num401 < 0f) + { + num401 += MathHelper.TwoPi; + } + else if (num401 > MathHelper.TwoPi) + { + num401 -= MathHelper.TwoPi; + } + float num402 = 0.1f; + if (npc.rotation < num401) + { + if ((double)(num401 - npc.rotation) > MathHelper.Pi) + { + npc.rotation -= num402; + } + else + { + npc.rotation += num402; + } + } + else if (npc.rotation > num401) + { + if ((double)(npc.rotation - num401) > MathHelper.Pi) + { + npc.rotation += num402; + } + else + { + npc.rotation -= num402; + } + } + if (npc.rotation > num401 - num402 && npc.rotation < num401 + num402) + { + npc.rotation = num401; + } + if (npc.rotation < 0f) + { + npc.rotation += MathHelper.TwoPi; + } + else if (npc.rotation > MathHelper.TwoPi) + { + npc.rotation -= MathHelper.TwoPi; + } + if (npc.rotation > num401 - num402 && npc.rotation < num401 + num402) + { + npc.rotation = num401; + } + if (Main.rand.Next(5) == 0) + { + int num403 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + npc.height * 0.25f), npc.width, (int)(npc.height * 0.5f), 5, npc.velocity.X, 2f); + Main.dust[num403].velocity.X *= 0.5f; + Main.dust[num403].velocity.Y *= 0.1f; + } + if (Main.netMode != NetmodeID.MultiplayerClient && !Main.dayTime && !Main.player[npc.target].dead && npc.timeLeft < 10) + { + for (int num381 = 0; num381 < Main.maxNPCs; num381++) + { + if (num381 != npc.whoAmI && Main.npc[num381].active && (Main.npc[num381].type == NPCID.Retinazer || Main.npc[num381].type == NPCID.Spazmatism) && Main.npc[num381].timeLeft - 1 > npc.timeLeft) + npc.timeLeft = Main.npc[num381].timeLeft - 1; + + } + } + if (Main.dayTime | Main.player[npc.target].dead) + { + npc.velocity.Y -= 0.04f; + if (npc.timeLeft > 10) + npc.timeLeft = 10; + return false; + } + if (npc.ai[0] == 3f) + { + npc.damage = (int)(npc.defDamage * 1.5); + npc.defense = npc.defDefense + 10; + npc.HitSound = SoundID.NPCHit4; + Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; + if (npc.ai[1] == 0f) + { + float num421 = 8f; + float num422 = 0.15f; + if (Main.expertMode) + { + num421 = 9.5f; + num422 = 0.175f; + } + // Reduce acceleration if target is holding a true melee weapon + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num422 *= 0.5f; + } + Vector2 vector39 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num423 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector39.X; + float num424 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 300f - vector39.Y; + float num425 = (float)Math.Sqrt(num423 * num423 + num424 * num424); + num425 = num421 / num425; + num423 *= num425; + num424 *= num425; + if (npc.velocity.X < num423) + { + npc.velocity.X += num422; + if (npc.velocity.X < 0f && num423 > 0f) + { + npc.velocity.X += num422; + } + } + else if (npc.velocity.X > num423) + { + npc.velocity.X -= num422; + if (npc.velocity.X > 0f && num423 < 0f) + { + npc.velocity.X -= num422; + } + } + if (npc.velocity.Y < num424) + { + npc.velocity.Y += num422; + if (npc.velocity.Y < 0f && num424 > 0f) + { + npc.velocity.Y += num422; + } + } + else if (npc.velocity.Y > num424) + { + npc.velocity.Y -= num422; + if (npc.velocity.Y > 0f && num424 < 0f) + { + npc.velocity.Y -= num422; + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= 300f) + { + npc.ai[1] = 1f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.TargetClosest(); + npc.netUpdate = true; + } + vector39 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num423 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector39.X; + num424 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector39.Y; + npc.rotation = (float)Math.Atan2(num424, num423) - 1.57f; + if (Main.netMode == NetmodeID.MultiplayerClient) + { + return false; + } + npc.localAI[1] += 1f; + if (npc.life < npc.lifeMax * 0.75) + { + npc.localAI[1] += 1f; + } + if (npc.life < npc.lifeMax * 0.5) + { + npc.localAI[1] += 1f; + } + if (npc.life < npc.lifeMax * 0.25) + { + npc.localAI[1] += 1f; + } + if (npc.life < npc.lifeMax * 0.1) + { + npc.localAI[1] += 2f; + } + if (npc.localAI[1] > 180f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.localAI[1] = 0f; + float num426 = 8.5f; + int attackDamage_ForProjectiles4 = Main.expertMode ? 23 : 25; + int num427 = 100; + if (Main.expertMode) + { + num426 = 10f; + } + num425 = (float)Math.Sqrt(num423 * num423 + num424 * num424); + num425 = num426 / num425; + num423 *= num425; + num424 *= num425; + vector39.X += num423 * 15f; + vector39.Y += num424 * 15f; + int num428 = Projectile.NewProjectile(vector39.X, vector39.Y, num423, num424, num427, attackDamage_ForProjectiles4, 0f, Main.myPlayer); + } + return false; + } + int num429 = 1; + if (npc.position.X + (npc.width / 2) < Main.player[npc.target].position.X + Main.player[npc.target].width) + { + num429 = -1; + } + float num430 = 8f; + float num431 = 0.2f; + if (Main.expertMode) + { + num430 = 9.5f; + num431 = 0.25f; + } + // Reduce acceleration if target is holding a true melee weapon + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num431 *= 0.5f; + } + Vector2 vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num432 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) + (num429 * 340) - vector40.X; + float num433 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector40.Y; + float num434 = (float)Math.Sqrt(num432 * num432 + num433 * num433); + num434 = num430 / num434; + num432 *= num434; + num433 *= num434; + if (npc.velocity.X < num432) + { + npc.velocity.X += num431; + if (npc.velocity.X < 0f && num432 > 0f) + { + npc.velocity.X += num431; + } + } + else if (npc.velocity.X > num432) + { + npc.velocity.X -= num431; + if (npc.velocity.X > 0f && num432 < 0f) + { + npc.velocity.X -= num431; + } + } + if (npc.velocity.Y < num433) + { + npc.velocity.Y += num431; + if (npc.velocity.Y < 0f && num433 > 0f) + { + npc.velocity.Y += num431; + } + } + else if (npc.velocity.Y > num433) + { + npc.velocity.Y -= num431; + if (npc.velocity.Y > 0f && num433 < 0f) + { + npc.velocity.Y -= num431; + } + } + vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num432 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector40.X; + num433 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector40.Y; + npc.rotation = (float)Math.Atan2(num433, num432) - 1.57f; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[1] += 1f; + if (npc.life < npc.lifeMax * 0.75) + { + npc.localAI[1] += 0.5f; + } + if (npc.life < npc.lifeMax * 0.5) + { + npc.localAI[1] += 0.75f; + } + if (npc.life < npc.lifeMax * 0.25) + { + npc.localAI[1] += 1f; + } + if (npc.life < npc.lifeMax * 0.1) + { + npc.localAI[1] += 1.5f; + } + if (Main.expertMode) + { + npc.localAI[1] += 1.5f; + } + if (npc.localAI[1] > 60f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.localAI[1] = 0f; + float num435 = 9f; + int attackDamage_ForProjectiles5 = Main.expertMode ? 17 : 18; + int num436 = 100; + num434 = (float)Math.Sqrt(num432 * num432 + num433 * num433); + num434 = num435 / num434; + num432 *= num434; + num433 *= num434; + vector40.X += num432 * 15f; + vector40.Y += num433 * 15f; + int num437 = Projectile.NewProjectile(vector40.X, vector40.Y, num432, num433, num436, attackDamage_ForProjectiles5, 0f, Main.myPlayer); + } + } + npc.ai[2] += 1f; + if (npc.ai[2] >= 180f) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.TargetClosest(); + npc.netUpdate = true; + } + + return false; + } + + return true; + } + #endregion + + #region Buffed Twins AI + public static bool BuffedRetinazerAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Enrage variable if player is floating upside down @@ -5024,7 +5323,8 @@ namespace CalamityMod.NPCs { float num382 = 8.25f; float num383 = 0.115f; - if (CalamityWorld.bossRushActive) + + if (CalamityWorld.bossRushActive) { num382 *= 1.5f; num383 *= 1.5f; @@ -5195,7 +5495,7 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; else { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); int num; for (int num397 = 0; num397 < 2; num397 = num + 1) @@ -5212,7 +5512,7 @@ namespace CalamityMod.NPCs num = num398; } - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } } @@ -5246,7 +5546,15 @@ namespace CalamityMod.NPCs { float num399 = 9.5f; float num400 = 0.175f; - if (CalamityWorld.bossRushActive) + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num400 *= 0.5f; + } + + if (CalamityWorld.bossRushActive) { num399 *= 1.5f; num400 *= 1.5f; @@ -5352,7 +5660,15 @@ namespace CalamityMod.NPCs float num409 = 9.5f; float num410 = 0.25f; - if (CalamityWorld.bossRushActive) + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num410 *= 0.5f; + } + + if (CalamityWorld.bossRushActive) { num409 *= 1.5f; num410 *= 1.5f; @@ -5618,7 +5934,7 @@ namespace CalamityMod.NPCs public static bool BuffedSpazmatismAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Enrage variable if player is floating upside down @@ -5718,6 +6034,7 @@ namespace CalamityMod.NPCs // Velocity float num424 = 12f; float num425 = 0.4f; + if (CalamityWorld.bossRushActive) { num424 *= 1.5f; @@ -5901,7 +6218,7 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; else { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.NPCHit, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); int num; for (int num438 = 0; num438 < 2; num438 = num + 1) @@ -5918,7 +6235,7 @@ namespace CalamityMod.NPCs num = num439; } - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } } @@ -6085,7 +6402,7 @@ namespace CalamityMod.NPCs if (npc.ai[1] == 1f) { // Play charge sound - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); // Set rotation and velocity npc.rotation = num420; @@ -6227,7 +6544,7 @@ namespace CalamityMod.NPCs else if (npc.ai[1] == 4f) { if (npc.ai[2] == 0f) - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); float num60 = (!retAlive && npc.ai[3] == 4f) ? 75f : 50f; if (CalamityWorld.bossRushActive) @@ -6370,7 +6687,7 @@ namespace CalamityMod.NPCs public static bool BuffedSkeletronPrimeAI(NPC npc, bool enraged, Mod mod, bool chaos) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; // Enrage variable if player is floating upside down @@ -6495,7 +6812,7 @@ namespace CalamityMod.NPCs } npc.ai[1] = 2f; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); } // Float near player @@ -6677,7 +6994,7 @@ namespace CalamityMod.NPCs npc.ai[2] += 1f; if (npc.ai[2] == 2f) - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); // Spin for 3 seconds then return to floating phase float phaseTimer = 180f; @@ -6803,7 +7120,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] == 2f) { // Play angry noise - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); // Set spin direction if (Main.player[npc.target].velocity.X > 0f) @@ -6831,7 +7148,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - if (NPC.CountNPCS(NPCID.Probe) < 6) + if (NPC.CountNPCS(NPCID.Probe) < 3) NPC.NewNPC((int)npc.Center.X, (int)(npc.Center.Y + 4f), NPCID.Probe); else { @@ -8062,10 +8379,11 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Phases based on HP + // Phases based on HP + bool phase1phase2 = lifeRatio < 0.75f; bool phase2 = lifeRatio <= 0.5f; - bool phase3 = lifeRatio < 0.25f || (death && phase2); - bool spawnMoreTentacles = lifeRatio < 0.1f; + bool phase3 = lifeRatio < 0.35f || (death && phase2); + bool phase4 = lifeRatio < 0.2f; // Variables and target bool enrage = false; @@ -8076,7 +8394,10 @@ namespace CalamityMod.NPCs bool surface = !CalamityWorld.bossRushActive && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; int tentacleCount = NPC.CountNPCS(NPCID.PlanterasTentacle); bool tentaclesDead = tentacleCount == 0; - bool speedUp = Vector2.Distance(Main.player[npc.target].Center, npc.Center) > (phase3 ? 480f : 640f); // 30 or 40 tile distance + float speedUpDistance = 480f; + if (tentaclesDead) + speedUpDistance -= 300f * (1f - lifeRatio); + bool speedUp = Vector2.Distance(Main.player[npc.target].Center, npc.Center) > speedUpDistance; // 30 or 40 tile distance // Despawn if (Main.player[npc.target].dead) @@ -8093,7 +8414,7 @@ namespace CalamityMod.NPCs npc.active = false; npc.life = 0; if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -8135,7 +8456,7 @@ namespace CalamityMod.NPCs { velocity = 10f; acceleration = 0.1f; - if (tentaclesDead) + if (tentaclesDead || phase4) { velocity = 12f; acceleration = 0.12f; @@ -8231,7 +8552,7 @@ namespace CalamityMod.NPCs // Velocity ranges from 17 to 30.6, Acceleration ranges from 0.15 to 0.27, enraged phase 3 // Distance Plantera can travel from her hooks - float maxDistanceFromHooks = enrage ? 850f : 550f; + float maxDistanceFromHooks = enrage ? 900f : 600f; if (phase3) maxDistanceFromHooks += 150f; @@ -8302,6 +8623,21 @@ namespace CalamityMod.NPCs // Phase 1 if (!phase2) { + if (phase1phase2 && Main.netMode != NetmodeID.MultiplayerClient) + { + if (npc.localAI[0] == 1f) + { + npc.localAI[0] = 2f; + int totalTentacles = 6; + float radians = MathHelper.TwoPi / totalTentacles; + for (int i = 0; i < totalTentacles; i++) + { + Vector2 vector255 = new Vector2(0f, -360f).RotatedBy(radians * i); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 1f, 0f, 255); + } + } + } + // Adjust stats npc.defense = 42; npc.damage = npc.defDamage; @@ -8395,7 +8731,8 @@ namespace CalamityMod.NPCs // Adjust stats npc.defense = 21; npc.damage = (int)(npc.defDamage * 1.4f); - if (enrage) + npc.chaseable = true; + if (enrage) { npc.defense *= 4; npc.damage *= 2; @@ -8404,29 +8741,35 @@ namespace CalamityMod.NPCs // Spawn tentacles if (Main.netMode != NetmodeID.MultiplayerClient) { - if (npc.localAI[0] == 1f) + if (npc.localAI[0] == 2f) { - npc.localAI[0] = 2f; - for (int num749 = 0; num749 < 8; num749++) + npc.localAI[0] = 3f; + int totalTentacles = 8 - NPC.CountNPCS(NPCID.PlanterasTentacle); + for (int i = 0; i < totalTentacles; i++) { - int num750 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, 0f, 0f, 255); } } - if (spawnMoreTentacles && npc.localAI[0] == 2f) + if (phase4 && npc.localAI[0] == 3f) { - npc.localAI[0] = 3f; - for (int num749 = 0; num749 < 8; num749++) + npc.localAI[0] = 4f; + int totalTentacles = 8; + float radians = MathHelper.TwoPi / totalTentacles; + for (int i = 0; i < totalTentacles; i++) { - int num750 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + Vector2 vector255 = new Vector2(0f, -480f).RotatedBy(radians * i); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 2f, 0f, 255); } } } - // If tentacles are alive, gain high defense - if (!tentaclesDead) - npc.defense = 9999; - npc.chaseable = tentaclesDead; + // If tentacles are alive, gain high defense + if (!tentaclesDead && !phase4) + { + npc.defense = 9999; + npc.chaseable = false; + } // Spawn gore if (npc.localAI[2] == 0f) @@ -8509,14 +8852,14 @@ namespace CalamityMod.NPCs for (int i = 0; i < numProj + 1; i++) { Vector2 perturbedSpeed = new Vector2(num743, num744).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(vector93.X, vector93.Y, perturbedSpeed.X, perturbedSpeed.Y, ProjectileID.PoisonSeedPlantera, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector93, perturbedSpeed, ProjectileID.PoisonSeedPlantera, damage, 0f, Main.myPlayer, 0f, 0f); } npc.localAI[3] = 0f; } } // Fire spread of spore clouds - if (tentaclesDead) + if (tentaclesDead || phase4) { float shootBoost = death ? 1f : 2f * (0.5f - lifeRatio); calamityGlobalNPC.newAI[0] += 1f + shootBoost; @@ -8779,18 +9122,23 @@ namespace CalamityMod.NPCs if (npc.ai[3] > 0f) num778 = (int)npc.ai[3] - 1; - // Movement variables - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[0] -= 1f; - if (npc.localAI[0] <= 0f) - { - npc.localAI[0] = Main.rand.Next(120, 480); - npc.ai[0] = Main.rand.Next(-100, 101); - npc.ai[1] = Main.rand.Next(-100, 101); - npc.netUpdate = true; - } - } + // Movement variables + if (npc.ai[2] == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[0] -= 1f; + if (npc.localAI[0] <= 0f) + { + npc.localAI[0] = Main.rand.Next(120, 480); + npc.ai[0] = Main.rand.Next(-100, 101); + npc.ai[1] = Main.rand.Next(-100, 101); + npc.netUpdate = true; + } + } + } + else + npc.knockBackResist = 0.25f; // Target npc.TargetClosest(true); @@ -9066,8 +9414,17 @@ namespace CalamityMod.NPCs npc.velocity.X = velocityX * npc.direction; - if (Main.player[npc.target].position.Y < npc.Bottom.Y) - npc.velocity.Y = ((!flag43 && !flag40) ? -15.1f : -12.1f) + (enrage ? -4f : 0f); + float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); + float speedMult = 1f; + + if (distanceBelowTarget > 0f && !flag43 && !flag40) + speedMult += distanceBelowTarget * 0.001f; + + if (speedMult > 2f) + speedMult = 2f; + + if (Main.player[npc.target].position.Y < npc.Bottom.Y) + npc.velocity.Y = (((!flag43 && !flag40) ? -15.1f : -12.1f) + (enrage ? -4f : 0f)) * speedMult; else npc.velocity.Y = 1f; @@ -9659,7 +10016,7 @@ namespace CalamityMod.NPCs { calamityGlobalNPC.newAI[2] += 1f; - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); return false; } @@ -9749,7 +10106,7 @@ namespace CalamityMod.NPCs } } - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); return false; } @@ -10027,7 +10384,7 @@ namespace CalamityMod.NPCs Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; } - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); } npc.ai[2] += 1f; @@ -10236,11 +10593,11 @@ namespace CalamityMod.NPCs // Play sounds and spawn bubbles if (npc.ai[2] == 0f) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); if (npc.ai[2] % num7 == 0f) { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -10278,7 +10635,7 @@ namespace CalamityMod.NPCs // Play sound and spawn sharknadoes if (npc.ai[2] == (float)(num9 - 30)) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 9, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 9, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num9 - 30) { @@ -10314,7 +10671,7 @@ namespace CalamityMod.NPCs // Sound if (npc.ai[2] == num10 - 60) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); npc.ai[2] += 1f; if (npc.ai[2] >= num10) @@ -10504,11 +10861,11 @@ namespace CalamityMod.NPCs { // Play sounds and spawn bubbles if (npc.ai[2] == 0f) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); if (npc.ai[2] % num14 == 0f) { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -10550,7 +10907,7 @@ namespace CalamityMod.NPCs // Play sound and spawn cthulhunado if (npc.ai[2] == num9 - 30) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num9 - 30) Projectile.NewProjectile(vector.X, vector.Y, 0f, 0f, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); @@ -10594,7 +10951,7 @@ namespace CalamityMod.NPCs // Play sound if (npc.ai[2] == num11 - 60) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); npc.ai[2] += 1f; if (npc.ai[2] >= num11) @@ -10762,7 +11119,7 @@ namespace CalamityMod.NPCs // Play sound if (npc.ai[2] == num12 / 2) - Main.PlaySound(29, (int)vector.X, (int)vector.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, 20, 1f, 0f); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num12 / 2) { @@ -10822,7 +11179,7 @@ namespace CalamityMod.NPCs // Chant sound if (npc.ai[0] != -1f && Main.rand.NextBool(1000)) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(88, 92), 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(88, 92), 1f, 0f); } // Percent life remaining @@ -10960,19 +11317,19 @@ namespace CalamityMod.NPCs npc.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } new List().Add(npc.whoAmI); for (int j = 0; j < Main.maxNPCs; j++) { - if (Main.npc[j].active && Main.npc[j].type == 440 && Main.npc[j].ai[3] == npc.whoAmI) + if (Main.npc[j].active && Main.npc[j].type == NPCID.CultistBossClone && Main.npc[j].ai[3] == npc.whoAmI) { Main.npc[j].life = 0; Main.npc[j].HitEffect(0, 10.0); Main.npc[j].active = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } } @@ -10984,7 +11341,7 @@ namespace CalamityMod.NPCs // Spawn and play sound if (npc.localAI[0] == 0f) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 89, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 89, 1f, 0f); npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; @@ -11015,7 +11372,7 @@ namespace CalamityMod.NPCs npc.velocity *= 0.95f; if (npc.localAI[2] != 13f) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 105, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 105, 1f, 0f); } npc.localAI[2] = 13f; } @@ -11529,7 +11886,7 @@ namespace CalamityMod.NPCs { int num38 = list6[-num35 - 1]; Main.npc[num38].Center = vector11; - NetMessage.SendData(23, -1, -1, null, num38, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num38, 0f, 0f, 0f, 0, 0, 0); } } } @@ -12075,7 +12432,7 @@ namespace CalamityMod.NPCs { // Play a random Moon Lord sound if (npc.ai[0] != -1f && npc.ai[0] != 2f && Main.rand.NextBool(200)) - Main.PlaySound(29, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(93, 100), 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(93, 100), 1f, 0f); // Start the AI if (npc.localAI[3] == 0f) @@ -12091,7 +12448,7 @@ namespace CalamityMod.NPCs npc.ai[1] += 1f; if (npc.ai[1] == 30f) - Main.PlaySound(29, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); if (npc.ai[1] < 60f) MoonlordDeathDrama.RequestLight(npc.ai[1] / 30f, npc.Center); @@ -12116,7 +12473,7 @@ namespace CalamityMod.NPCs npc.ai[1] += 1f; if (npc.ai[1] == 30f) - Main.PlaySound(29, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); if (npc.ai[1] < 60f) MoonlordDeathDrama.RequestLight(npc.ai[1] / 30f, npc.Center); @@ -12449,13 +12806,13 @@ namespace CalamityMod.NPCs { nPC5.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(23, -1, -1, null, nPC5.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, nPC5.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } npc.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); return false; } @@ -12483,7 +12840,7 @@ namespace CalamityMod.NPCs { projectile2.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(27, -1, -1, null, num1171, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, num1171, 0f, 0f, 0f, 0, 0, 0); } } @@ -12493,8 +12850,8 @@ namespace CalamityMod.NPCs if (nPC4.active && nPC4.type == NPCID.MoonLordFreeEye) { nPC4.active = false; - if (Main.netMode != 1) - NetMessage.SendData(23, -1, -1, null, nPC4.whoAmI, 0f, 0f, 0f, 0, 0, 0); + if (Main.netMode != NetmodeID.MultiplayerClient) + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, nPC4.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -12515,17 +12872,17 @@ namespace CalamityMod.NPCs { nPC5.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(23, -1, -1, null, nPC5.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, nPC5.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } npc.active = false; if (Main.netMode != NetmodeID.MultiplayerClient) - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); NPC.LunarApocalypseIsUp = false; if (Main.netMode == NetmodeID.Server) - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.WorldData, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); return false; } @@ -12928,7 +13285,7 @@ namespace CalamityMod.NPCs npc.localAI[1] = 1f; if (num1207 == num1208 - 35f) - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); int damage = 40; if (death) @@ -13475,7 +13832,7 @@ namespace CalamityMod.NPCs npc.localAI[1] = 1f; if (num1178 == num1179 - 35f) - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); int damage = 40; if (death) @@ -13543,6 +13900,12 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.MoonLordFreeEye) { + if (Main.npc[(int)npc.ai[3]].ai[0] == 2f) + { + npc.HitEffect(0, 9999.0); + npc.active = false; + } + if (calamityGlobalNPC.newAI[0] == 0f) { int eyeCount = NPC.CountNPCS(npc.type); @@ -13577,7 +13940,7 @@ namespace CalamityMod.NPCs } if (Main.rand.Next(420) == 0) - Main.PlaySound(29, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(100, 101), 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(100, 101), 1f, 0f); Vector2 value22 = new Vector2(30f); @@ -13742,7 +14105,7 @@ namespace CalamityMod.NPCs npc.localAI[2] = MathHelper.Lerp(npc.localAI[2], 0.4f, 0.2f); if (num1245 == num1241 - 35f) - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); if ((num1245 == num1241 - 14f || num1245 == num1241 - 7f || num1245 == num1241) && Main.netMode != NetmodeID.MultiplayerClient) { @@ -13864,7 +14227,7 @@ namespace CalamityMod.NPCs if (num1245 < 120f) { - Main.PlaySound(29, (int)npc.Center.X, (int)npc.Center.Y, 102, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 102, 1f, 0f); if (num1245 == 105f) npc.netUpdate = true; @@ -14287,7 +14650,7 @@ namespace CalamityMod.NPCs if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(7, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.WorldData, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } #endregion @@ -14915,7 +15278,7 @@ namespace CalamityMod.NPCs num870 *= num872; num871 *= num872; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num870, num871, 329, 70, 0f, Main.myPlayer, npc.rotation, (float)npc.spriteDirection); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, num870, num871, ProjectileID.FlamingScythe, 70, 0f, Main.myPlayer, npc.rotation, (float)npc.spriteDirection); } } @@ -15164,7 +15527,7 @@ namespace CalamityMod.NPCs num893 *= num895; num894 *= num895; - Projectile.NewProjectile(vector116.X, vector116.Y, num893, num894, 348, 50, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector116.X, vector116.Y, num893, num894, ProjectileID.FrostWave, 50, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[3] < 0f) @@ -15259,7 +15622,7 @@ namespace CalamityMod.NPCs num902 += 3f; float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(vector117.X, vector117.Y, speedX2, num902, 349, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + Projectile.NewProjectile(vector117.X, vector117.Y, speedX2, num902, ProjectileID.FrostShard, 44, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); } } } @@ -15304,7 +15667,7 @@ namespace CalamityMod.NPCs if (npc.ai[3] > (float)num908) { npc.ai[3] = 0f; - int num909 = Projectile.NewProjectile(vector118.X, vector118.Y, num904, num905, 349, 40, 0f, Main.myPlayer, 0f, 0f); + int num909 = Projectile.NewProjectile(vector118.X, vector118.Y, num904, num905, ProjectileID.FrostShard, 40, 0f, Main.myPlayer, 0f, 0f); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -16555,7 +16918,7 @@ namespace CalamityMod.NPCs float time = npc.ai[2] + maxTime + turnToStoneTime; if (time == 1f) { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 17, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 17, 1f, 0f); } if (time < turnToStoneTime) { @@ -17381,31 +17744,31 @@ namespace CalamityMod.NPCs { if ((npcType == NPCID.Zombie || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == NPCID.Skeleton || (npcType >= NPCID.BoneThrowingSkeleton && npcType <= NPCID.BoneThrowingSkeleton4) || npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.SkeletonArcher || npcType == NPCID.BaldZombie || npcType == NPCID.UndeadViking || npcType == NPCID.ZombieEskimo || npcType == NPCID.Frankenstein || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.ArmoredViking || npcType == NPCID.FemaleZombie || npcType == NPCID.HeadacheSkeleton || npcType == NPCID.MisassembledSkeleton || npcType == NPCID.PantlessSkeleton || npcType == NPCID.ZombieRaincoat || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.ZombieSuperman || npcType == NPCID.ZombiePixie || npcType == NPCID.ZombieDoctor || npcType == NPCID.GreekSkeleton) && Main.rand.Next(1000) == 0) { - Main.PlaySound(14, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } if (npcType == NPCID.BloodZombie && Main.rand.Next(800) == 0) { - Main.PlaySound(14, (int)npc.position.X, (int)npc.position.Y, npcType, 1f, 0f); + Main.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, npcType, 1f, 0f); } if ((npcType == NPCID.Mummy || npcType == NPCID.DarkMummy || npcType == NPCID.LightMummy) && Main.rand.Next(500) == 0) { - Main.PlaySound(26, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Mummy, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } if (npcType == NPCID.Vampire && Main.rand.Next(500) == 0) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 7, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 7, 1f, 0f); } if (npcType == NPCID.Frankenstein && Main.rand.Next(500) == 0) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); } if (npcType == NPCID.FaceMonster && Main.rand.Next(500) == 0) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 8, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 8, 1f, 0f); } if (npcType >= 269 && npcType <= 280 && Main.rand.Next(1000) == 0) { - Main.PlaySound(14, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } npc.TargetClosest(true); } @@ -18386,7 +18749,7 @@ namespace CalamityMod.NPCs npc.Transform(NPCID.VampireBat); } } - if (Main.netMode != 1 && npc.velocity.Y == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.velocity.Y == 0f) TryConvertToWallClimber(npc); if (Main.netMode != NetmodeID.MultiplayerClient && Main.expertMode && npc.target >= 0 && (npcType == NPCID.BlackRecluse || npcType == NPCID.BlackRecluseWall) && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) @@ -19211,7 +19574,7 @@ namespace CalamityMod.NPCs Vector2 spawnPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f - (float)(npc.direction * 24), npc.position.Y + 4f); int velocityX = 3 * npc.direction; int velocityY = -5; - int num160 = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, velocityX, velocityY, 75, 0, 0f, Main.myPlayer, 0f, 0f); + int num160 = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, velocityX, velocityY, ProjectileID.HappyBomb, 0, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num160].timeLeft = 300; npc.ai[2] = 0f; } @@ -19415,7 +19778,7 @@ namespace CalamityMod.NPCs if (npcType == NPCID.GoblinPeon) { WorldGen.KillTile(x, y - 1, false, false, false); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)x, (float)(y - 1), 0f, 0, 0, 0); } @@ -19430,7 +19793,7 @@ namespace CalamityMod.NPCs npc.ai[3] = (float)aiGateValue; npc.netUpdate = true; } - if (Main.netMode == 2 & flag24) + if (Main.netMode == NetmodeID.Server & flag24) { NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 0, (float)x, (float)(y - 1), (float)npc.direction, 0, 0, 0); } @@ -19443,7 +19806,7 @@ namespace CalamityMod.NPCs npc.ai[3] = (float)aiGateValue; npc.netUpdate = true; } - if (Main.netMode == 2 & flag25) + if (Main.netMode == NetmodeID.Server & flag25) { NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 4, (float)x, (float)(y - 1), 0f, 0, 0, 0); } @@ -19599,17 +19962,17 @@ namespace CalamityMod.NPCs } float num = 6f; float num2 = 0.05f; - if (npc.type == 6 || npc.type == 173) + if (npc.type == NPCID.EaterofSouls || npc.type == NPCID.Crimera) { num = 4f; num2 = 0.035f; } - else if (npc.type == 94) + else if (npc.type == NPCID.Corruptor) { num = 4.2f; num2 = 0.022f; } - else if (npc.type == 252) + else if (npc.type == NPCID.Parrot) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { @@ -19622,17 +19985,17 @@ namespace CalamityMod.NPCs num = 2f; } } - else if (npc.type == 205) + else if (npc.type == NPCID.Moth) { num = 7f; num2 = 0.06f; } - else if (npc.type == 23) + else if (npc.type == NPCID.MeteorHead) { num = 2f; num2 = 0.05f; } - else if (npc.type == 5) + else if (npc.type == NPCID.ServantofCthulhu) { num = 5f; num2 = 0.03f; @@ -19666,9 +20029,9 @@ namespace CalamityMod.NPCs num4 *= num6; num5 *= num6; } - if (npc.type == 6 || npc.type == 94 || npc.type == 139 || npc.type == 173 || npc.type == 205) + if (npc.type == NPCID.EaterofSouls || npc.type == NPCID.Corruptor || npc.type == NPCID.Probe || npc.type == NPCID.Crimera || npc.type == NPCID.Moth) { - if (num7 > 100f || npc.type == 94) + if (num7 > 100f || npc.type == NPCID.Corruptor) { npc.ai[0] += 1f; if (npc.ai[0] > 0f) @@ -19692,7 +20055,7 @@ namespace CalamityMod.NPCs npc.ai[0] = -200f; } } - if (num7 < 150f && (npc.type == 6 || npc.type == 94 || npc.type == 173)) + if (num7 < 150f && (npc.type == NPCID.EaterofSouls || npc.type == NPCID.Corruptor || npc.type == NPCID.Crimera)) { npc.velocity.X = npc.velocity.X + num4 * 0.009f; npc.velocity.Y = npc.velocity.Y + num5 * 0.009f; @@ -19706,7 +20069,7 @@ namespace CalamityMod.NPCs if (npc.velocity.X < num4) { npc.velocity.X = npc.velocity.X + num2; - if (npc.type != 173 && npc.type != 6 && npc.type != 94 && npc.type != 139 && npc.velocity.X < 0f && num4 > 0f) + if (npc.type != NPCID.Crimera && npc.type != NPCID.EaterofSouls && npc.type != NPCID.Corruptor && npc.type != NPCID.Probe && npc.velocity.X < 0f && num4 > 0f) { npc.velocity.X = npc.velocity.X + num2; } @@ -19714,7 +20077,7 @@ namespace CalamityMod.NPCs else if (npc.velocity.X > num4) { npc.velocity.X = npc.velocity.X - num2; - if (npc.type != 173 && npc.type != 6 && npc.type != 94 && npc.type != 139 && npc.velocity.X > 0f && num4 < 0f) + if (npc.type != NPCID.Crimera && npc.type != NPCID.EaterofSouls && npc.type != NPCID.Corruptor && npc.type != NPCID.Probe && npc.velocity.X > 0f && num4 < 0f) { npc.velocity.X = npc.velocity.X - num2; } @@ -19722,7 +20085,7 @@ namespace CalamityMod.NPCs if (npc.velocity.Y < num5) { npc.velocity.Y = npc.velocity.Y + num2; - if (npc.type != 173 && npc.type != 6 && npc.type != 94 && npc.type != 139 && npc.velocity.Y < 0f && num5 > 0f) + if (npc.type != NPCID.Crimera && npc.type != NPCID.EaterofSouls && npc.type != NPCID.Corruptor && npc.type != NPCID.Probe && npc.velocity.Y < 0f && num5 > 0f) { npc.velocity.Y = npc.velocity.Y + num2; } @@ -19730,12 +20093,12 @@ namespace CalamityMod.NPCs else if (npc.velocity.Y > num5) { npc.velocity.Y = npc.velocity.Y - num2; - if (npc.type != 173 && npc.type != 6 && npc.type != 94 && npc.type != 139 && npc.velocity.Y > 0f && num5 < 0f) + if (npc.type != NPCID.Crimera && npc.type != NPCID.EaterofSouls && npc.type != NPCID.Corruptor && npc.type != NPCID.Probe && npc.velocity.Y > 0f && num5 < 0f) { npc.velocity.Y = npc.velocity.Y - num2; } } - if (npc.type == 23) + if (npc.type == NPCID.MeteorHead) { if (num4 > 0f) { @@ -19748,10 +20111,10 @@ namespace CalamityMod.NPCs npc.rotation = (float)Math.Atan2((double)num5, (double)num4) + MathHelper.Pi; } } - else if (npc.type == 139) + else if (npc.type == NPCID.Probe) { npc.localAI[0] += 1f; - if (Main.netMode != 1 && npc.localAI[0] >= 120f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -19780,11 +20143,11 @@ namespace CalamityMod.NPCs npc.rotation = (float)Math.Atan2((double)num5, (double)num4) + MathHelper.Pi; } } - else if (npc.type == 6 || npc.type == 94 || npc.type == 173) + else if (npc.type == NPCID.EaterofSouls || npc.type == NPCID.Corruptor || npc.type == NPCID.Crimera) { npc.rotation = (float)Math.Atan2((double)num5, (double)num4) - MathHelper.PiOver2; } - else if (npc.type == 205) + else if (npc.type == NPCID.Moth) { if (npc.velocity.X > 0f) { @@ -19800,10 +20163,10 @@ namespace CalamityMod.NPCs { npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - MathHelper.PiOver2; } - if (npc.type == 6 || npc.type == 23 || npc.type == 94 || npc.type == 139 || npc.type == 173 || npc.type == 205) + if (npc.type == NPCID.EaterofSouls || npc.type == NPCID.MeteorHead || npc.type == NPCID.Corruptor || npc.type == NPCID.Probe || npc.type == NPCID.Crimera || npc.type == NPCID.Moth) { float num11 = 0.7f; - if (npc.type == 6 || npc.type == 173) + if (npc.type == NPCID.EaterofSouls || npc.type == NPCID.Crimera) { num11 = 0.4f; } @@ -19833,7 +20196,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = -2f; } } - if (npc.type == 23) + if (npc.type == NPCID.MeteorHead) { int num12 = Dust.NewDust(new Vector2(npc.position.X - npc.velocity.X, npc.position.Y - npc.velocity.Y), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Dust dust = Main.dust[num12]; @@ -19841,10 +20204,10 @@ namespace CalamityMod.NPCs dust.velocity.X *= 0.3f; dust.velocity.Y *= 0.3f; } - else if (npc.type != 139 && npc.type != 205 && npc.type != 252 && Main.rand.Next(20) == 0) + else if (npc.type != NPCID.Probe && npc.type != NPCID.Moth && npc.type != NPCID.Parrot && Main.rand.Next(20) == 0) { int num13 = 18; - if (npc.type == 173) + if (npc.type == NPCID.Crimera) { num13 = 5; } @@ -19854,14 +20217,14 @@ namespace CalamityMod.NPCs dust.velocity.Y *= 0.1f; } } - else if (npc.type != 252 && Main.rand.Next(40) == 0) + else if (npc.type != NPCID.Parrot && Main.rand.Next(40) == 0) { int num15 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); Dust dust = Main.dust[num15]; dust.velocity.X *= 0.5f; dust.velocity.Y *= 0.1f; } - if ((npc.type == 6 || npc.type == 94 || npc.type == 173) && npc.wet) + if ((npc.type == NPCID.EaterofSouls || npc.type == NPCID.Corruptor || npc.type == NPCID.Crimera) && npc.wet) { if (npc.velocity.Y > 0f) { @@ -19873,7 +20236,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = -3f; } } - if (npc.type == 205 && npc.wet) + if (npc.type == NPCID.Moth && npc.wet) { if (npc.velocity.Y > 0f) { @@ -19886,7 +20249,7 @@ namespace CalamityMod.NPCs } npc.TargetClosest(true); } - if (npc.type == 139 & flag) + if (npc.type == NPCID.Probe & flag) { if ((npc.velocity.X > 0f && num4 > 0f) || (npc.velocity.X < 0f && num4 < 0f)) { @@ -19900,7 +20263,7 @@ namespace CalamityMod.NPCs npc.velocity.X = npc.velocity.X * 0.9f; } } - if (Main.netMode != 1 && npc.type == 94 && !Main.player[npc.target].dead) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.type == NPCID.Corruptor && !Main.player[npc.target].dead) { npc.localAI[0] += 1f; if (npc.localAI[0] == 180f) @@ -19912,7 +20275,7 @@ namespace CalamityMod.NPCs npc.localAI[0] = 0f; } } - if ((Main.dayTime && npc.type != 173 && npc.type != 6 && npc.type != 23 && npc.type != 94 && npc.type != 205 && npc.type != 252) || Main.player[npc.target].dead) + if ((Main.dayTime && npc.type != NPCID.Crimera && npc.type != NPCID.EaterofSouls && npc.type != NPCID.MeteorHead && npc.type != NPCID.Corruptor && npc.type != NPCID.Moth && npc.type != NPCID.Parrot) || Main.player[npc.target].dead) { npc.velocity.Y = npc.velocity.Y - num2 * 2f; if (npc.timeLeft > 10) @@ -19993,7 +20356,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.type == NPCID.WyvernHead && npc.ai[0] == 0f) { @@ -20025,7 +20388,7 @@ namespace CalamityMod.NPCs Main.npc[num8].realLife = npc.whoAmI; Main.npc[num8].ai[1] = (float)num6; Main.npc[num6].ai[0] = (float)num8; - NetMessage.SendData(23, -1, -1, null, num8, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num8, 0f, 0f, 0f, 0, 0, 0); num6 = num8; } } @@ -20048,7 +20411,7 @@ namespace CalamityMod.NPCs Main.npc[num15].realLife = npc.whoAmI; Main.npc[num15].ai[1] = (float)num12; Main.npc[num12].ai[0] = (float)num15; - NetMessage.SendData(23, -1, -1, null, num15, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num15, 0f, 0f, 0f, 0, 0, 0); num12 = num15; } } @@ -20071,7 +20434,7 @@ namespace CalamityMod.NPCs Main.npc[num24].realLife = npc.whoAmI; Main.npc[num24].ai[1] = (float)num20; Main.npc[num20].ai[0] = (float)num24; - NetMessage.SendData(23, -1, -1, null, num24, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num24, 0f, 0f, 0f, 0, 0, 0); num20 = num24; } } @@ -20141,7 +20504,7 @@ namespace CalamityMod.NPCs npc.life = 0; npc.HitEffect(0, 10.0); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } if (npc.ai[0] > 0f && npc.ai[0] < (float)Main.npc.Length) @@ -20151,7 +20514,7 @@ namespace CalamityMod.NPCs npc.life = 0; npc.HitEffect(0, 10.0); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } } @@ -20163,7 +20526,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (isSplittingNPCHead && !Main.npc[(int)npc.ai[0]].active) { @@ -20171,7 +20534,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (isSplittingNPCTail && !Main.npc[(int)npc.ai[1]].active) { @@ -20179,7 +20542,7 @@ namespace CalamityMod.NPCs npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } if (isSplittingNPCBody && (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != npc.aiStyle)) { @@ -20208,9 +20571,9 @@ namespace CalamityMod.NPCs } } - if (!npc.active && Main.netMode == 2) + if (!npc.active && Main.netMode == NetmodeID.Server) { - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } @@ -20262,7 +20625,7 @@ namespace CalamityMod.NPCs if (npc.position.X + (float)npc.width > vector.X && npc.position.X < vector.X + 16f && npc.position.Y + (float)npc.height > vector.Y && npc.position.Y < vector.Y + 16f) { flag2 = true; - if (Main.rand.Next(100) == 0 && npc.type != 117 && Main.tile[num33, num34].nactive()) + if (Main.rand.Next(100) == 0 && npc.type != NPCID.LeechHead && Main.tile[num33, num34].nactive()) { WorldGen.KillTile(num33, num34, true, true, false); } @@ -20618,7 +20981,7 @@ namespace CalamityMod.NPCs num54 = 20f; } npc.soundDelay = (int)num54; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } num52 = (float)Math.Sqrt((double)(num39 * num39 + num40 * num40)); @@ -20653,7 +21016,7 @@ namespace CalamityMod.NPCs } if (flag5) { - if (Main.netMode != 1 && (double)(npc.position.Y / 16f) > (Main.rockLayer + (double)Main.maxTilesY) / 2.0) + if (Main.netMode != NetmodeID.MultiplayerClient && (double)(npc.position.Y / 16f) > (Main.rockLayer + (double)Main.maxTilesY) / 2.0) { npc.active = false; int num59 = (int)npc.ai[0]; @@ -20662,15 +21025,15 @@ namespace CalamityMod.NPCs int arg_2853_0 = (int)Main.npc[num59].ai[0]; Main.npc[num59].active = false; npc.life = 0; - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num59, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num59, 0f, 0f, 0f, 0, 0, 0); } num59 = arg_2853_0; } - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } num39 = 0f; @@ -20807,7 +21170,7 @@ namespace CalamityMod.NPCs { npc.ai[0] = 500f; } - if (npc.type == 172) + if (npc.type == NPCID.RuneWizard) { if (npc.alpha < 255) { @@ -20820,7 +21183,7 @@ namespace CalamityMod.NPCs } if (npc.ai[2] != 0f && npc.ai[3] != 0f) { - if (npc.type == 172) + if (npc.type == NPCID.RuneWizard) { npc.alpha = 255; } @@ -21014,7 +21377,7 @@ namespace CalamityMod.NPCs { npc.ai[0] = 650f; } - if (npc.ai[0] >= 650f && Main.netMode != 1) + if (npc.ai[0] >= 650f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[0] = 2f; int num86 = (int)Main.player[npc.target].position.X / 16; @@ -21070,7 +21433,7 @@ namespace CalamityMod.NPCs if (npc.ai[1] % 30f == 0f && npc.ai[1] / 30f < 5f) { Main.PlaySound(SoundID.Item8, npc.position); - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { Point point = npc.Center.ToTileCoordinates(); Point point2 = Main.player[npc.target].Center.ToTileCoordinates(); @@ -21107,7 +21470,7 @@ namespace CalamityMod.NPCs } if (flag7) { - Projectile.NewProjectile((float)(num100 * 16 + 8), (float)(num101 * 16 + 8), 0f, 0f, 596, 0, 1f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile((float)(num100 * 16 + 8), (float)(num101 * 16 + 8), 0f, 0f, ProjectileID.DesertDjinnCurse, 0, 1f, Main.myPlayer, (float)npc.target, 0f); break; } } @@ -21119,7 +21482,7 @@ namespace CalamityMod.NPCs { if (npc.type >= NPCID.RaggedCaster && npc.type <= NPCID.DiabolistWhite) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { float num102 = 6f; if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) @@ -21166,7 +21529,7 @@ namespace CalamityMod.NPCs { Main.PlaySound(SoundID.Item8, npc.position); } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { if (npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.Tim) { @@ -21211,7 +21574,7 @@ namespace CalamityMod.NPCs dust.velocity.Y = -2f; } } - else if (npc.type == 32) + else if (npc.type == NPCID.DarkCaster) { if (Main.rand.Next(3) != 0) { @@ -21500,12 +21863,12 @@ namespace CalamityMod.NPCs #region Bat AI public static bool BuffedBatAI(NPC npc, Mod mod) { - if (npc.type == 60 || npc.type == 151) + if (npc.type == NPCID.Hellbat || npc.type == NPCID.Lavabat) { int num203 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Main.dust[num203].noGravity = true; } - if (npc.type == 150 && Main.rand.Next(10) == 0) + if (npc.type == NPCID.IceBat && Main.rand.Next(10) == 0) { int num204 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); Main.dust[num204].noGravity = true; @@ -21648,7 +22011,7 @@ namespace CalamityMod.NPCs } DemonEyeBatMovement(npc, maxSpeedX, maxSpeedY, xAccel, xAccelBoost1, xAccelBoost2, yAccel, yAccelBoost1, yAccelBoost2); } - if (npc.type == 48 && npc.wet) + if (npc.type == NPCID.Harpy && npc.wet) { if (npc.velocity.Y > 0f) { @@ -21662,7 +22025,7 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); } // Turn back into a walking bat when possible - if (npc.type == NPCID.VampireBat && Main.netMode != 1) + if (npc.type == NPCID.VampireBat && Main.netMode != NetmodeID.MultiplayerClient) { if (npc.Distance(Main.player[npc.target].Center) < 200f && npc.Center.Y < Main.player[npc.target].Center.Y && @@ -21672,7 +22035,7 @@ namespace CalamityMod.NPCs } } npc.ai[1] += 2f; - if (npc.type == 158) + if (npc.type == NPCID.VampireBat) { npc.ai[1] += 1f; } @@ -22305,7 +22668,7 @@ namespace CalamityMod.NPCs npc.ai[0] -= 1f; } - if (Main.netMode != 1 && flag17 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (Main.netMode != NetmodeID.MultiplayerClient && flag17 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.ai[0] = 200f; int num274 = 10; @@ -22323,7 +22686,7 @@ namespace CalamityMod.NPCs Main.projectile[num276].ai[0] = 2f; Main.projectile[num276].timeLeft = 300; Main.projectile[num276].friendly = false; - NetMessage.SendData(27, -1, -1, null, num276, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, num276, 0f, 0f, 0f, 0, 0, 0); } npc.netUpdate = true; } @@ -22389,7 +22752,7 @@ namespace CalamityMod.NPCs { if (npc.ai[0] == 0f) { - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.TargetClosest(true); npc.direction *= -1; @@ -22635,7 +22998,7 @@ namespace CalamityMod.NPCs num292 *= num294; num293 *= num294; - if (Main.netMode != 1 && npc.ai[3] == 32f && !Main.player[npc.target].npcTypeNoAggro[npc.type]) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 32f && !Main.player[npc.target].npcTypeNoAggro[npc.type]) { int num295 = 25; int num296 = 84; @@ -22653,7 +23016,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1 && npc.ai[3] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 0f) { npc.localAI[1] += 1f; if (npc.localAI[1] > 120f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && !Main.player[npc.target].npcTypeNoAggro[npc.type]) @@ -22677,7 +23040,7 @@ namespace CalamityMod.NPCs if (Main.rand.Next(40) == 0) { - Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Pixie, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } } else if (npc.type == NPCID.IceElemental) @@ -22724,7 +23087,7 @@ namespace CalamityMod.NPCs npc.rotation = (float)Math.Atan2((double)num302, (double)num301); } - if (Main.netMode != 1 && npc.ai[3] == 16f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 16f) { int num304 = 45; int num305 = 128; @@ -22742,7 +23105,7 @@ namespace CalamityMod.NPCs } } - if (Main.netMode != 1 && npc.ai[3] == 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 0f) { npc.localAI[1] += 1f; if (npc.localAI[1] > 120f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) @@ -22766,10 +23129,10 @@ namespace CalamityMod.NPCs num290 = 9; } - if (Main.netMode != 1 && !npc.confused) + if (Main.netMode != NetmodeID.MultiplayerClient && !npc.confused) { npc.ai[3] += 1f; - if (Main.netMode != 1 && npc.ai[3] >= 120f) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= 120f) { npc.ai[3] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].head)) @@ -23374,11 +23737,11 @@ namespace CalamityMod.NPCs } } - if (flag5 && Main.netMode != 1) + if (flag5 && Main.netMode != NetmodeID.MultiplayerClient) { for (int k = 0; k < 3; k++) { - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (Main.rand.NextFloat() - 0.5f) * 2f, -4f - 10f * Main.rand.NextFloat(), 538, 50, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (Main.rand.NextFloat() - 0.5f) * 2f, -4f - 10f * Main.rand.NextFloat(), ProjectileID.Twinkle, 50, 0f, Main.myPlayer, 0f, 0f); } npc.HitEffect(9999, 10.0); npc.active = false; @@ -23422,10 +23785,10 @@ namespace CalamityMod.NPCs npc.velocity.X = 0f; } - if (npc.ai[1] == 30f && Main.netMode != 1) + if (npc.ai[1] == 30f && Main.netMode != NetmodeID.MultiplayerClient) { int num5 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 575, num5, 0f, Main.myPlayer, (float)npc.target, 0f); + Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, ProjectileID.NebulaSphere, num5, 0f, Main.myPlayer, (float)npc.target, 0f); } if (npc.ai[1] >= 60f) @@ -23460,7 +23823,7 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.Tumbleweed && npc.velocity.Y == 0f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) { npc.velocity.Y = npc.velocity.Y - 6f; - Main.PlaySound(3, npc.Center, 11); + Main.PlaySound(SoundID.NPCHit, npc.Center, 11); } if (npc.ai[3] < (float)num) @@ -24379,7 +24742,7 @@ namespace CalamityMod.NPCs } float num567 = 3f; float num568 = 0.12f; - if (npc.type == 531) + if (npc.type == NPCID.DesertScorpionWall) { num567 = 6f; num568 = 0.24f; @@ -24506,7 +24869,7 @@ namespace CalamityMod.NPCs } npc.rotation = (float)Math.Atan2((double)num570, (double)num569); } - if (npc.type == 531) + if (npc.type == NPCID.DesertScorpionWall) { npc.rotation += MathHelper.PiOver2; } @@ -24541,9 +24904,9 @@ namespace CalamityMod.NPCs { npc.netUpdate = true; } - if (Main.netMode != 1) + if (Main.netMode != NetmodeID.MultiplayerClient) { - if (Main.netMode != 1 && npc.target >= 0 && (npc.type == 163 || npc.type == 238) && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.target >= 0 && (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall) && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) { npc.localAI[0] += 1f; if (npc.localAI[0] > (float)Main.rand.Next(180, 600)) @@ -24552,7 +24915,7 @@ namespace CalamityMod.NPCs Vector2 vector71 = Main.player[npc.target].Center - npc.Center; vector71.Normalize(); vector71 *= 8f; - int num573 = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector71.X, vector71.Y, 472, 18, 0f, Main.myPlayer, 0f, 0f); + int num573 = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector71.X, vector71.Y, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); } } int num574 = (int)npc.Center.X / 16; @@ -25719,7 +26082,7 @@ namespace CalamityMod.NPCs npc.noGravity = true; npc.noTileCollide = false; npc.defense = npc.defDefense; - if (npc.justHit && Main.netMode != 1 && Main.rand.Next(10) == 0) + if (npc.justHit && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.Next(10) == 0) { npc.netUpdate = true; npc.ai[0] = -1f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3f5e146fa3..cf28e68c6e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1,10 +1,7 @@ -using CalamityMod; using CalamityMod.Buffs; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; @@ -39,7 +36,6 @@ using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Polterghast; @@ -65,18 +61,17 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using Terraria; +using Terraria.GameContent.Events; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; using static Terraria.ModLoader.ModContent; namespace CalamityMod.NPCs { - public class CalamityGlobalNPC : GlobalNPC + public class CalamityGlobalNPC : GlobalNPC { #region Variables public float DR { get; set; } = 0f; @@ -99,6 +94,9 @@ namespace CalamityMod.NPCs // Iron Heart (currently unimplemented) // private int ironHeartDamage = 0; + // Max velocity used in contact damage scaling + public float maxVelocity = 0f; + // Town NPC shop alert animation variables private int shopAlertAnimTimer = 0; private int shopAlertAnimFrame = 0; @@ -172,7 +170,6 @@ namespace CalamityMod.NPCs public static int leviathan = -1; public static int siren = -1; public static int scavenger = -1; - public static int astrumDeusHeadMain = -1; public static int energyFlame = -1; public static int doughnutBoss = -1; public static int holyBossAttacker = -1; @@ -283,9 +280,6 @@ namespace CalamityMod.NPCs /// public static List AstrumDeusIDs = new List { - NPCType(), - NPCType(), - NPCType(), NPCType(), NPCType(), NPCType() @@ -299,6 +293,19 @@ namespace CalamityMod.NPCs NPCType() }; + public static List PerforatorIDs = new List + { + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + }; + public static List DesertScourgeIDs = new List { NPCType(), @@ -326,6 +333,27 @@ namespace CalamityMod.NPCs NPCType(), NPCType() }; + + public static List GrenadeResistIDs = new List + { + ProjectileID.Grenade, + ProjectileID.StickyGrenade, + ProjectileID.BouncyGrenade, + ProjectileID.Bomb, + ProjectileID.StickyBomb, + ProjectileID.BouncyBomb, + ProjectileID.Dynamite, + ProjectileID.StickyDynamite, + ProjectileID.BouncyDynamite, + ProjectileID.Explosives, + ProjectileID.ExplosiveBunny, + ProjectileID.PartyGirlGrenade, + ProjectileID.BombFish, + ProjectileID.Beenade, + ProjectileID.Bee, + ProjectileID.GiantBee + //ProjectileID.ScarabBomb + }; #endregion #region Instance Per Entity @@ -377,7 +405,6 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref leviathan, NPCType()); ResetSavedIndex(ref siren, NPCType()); ResetSavedIndex(ref scavenger, NPCType()); - ResetSavedIndex(ref astrumDeusHeadMain, NPCType()); ResetSavedIndex(ref energyFlame, NPCType()); ResetSavedIndex(ref doughnutBoss, NPCType()); ResetSavedIndex(ref holyBossAttacker, NPCType()); @@ -518,11 +545,11 @@ namespace CalamityMod.NPCs } } - npc.lifeRegen -= projectileCount * 350; + npc.lifeRegen -= projectileCount * 250; - if (damage < projectileCount * 70) + if (damage < projectileCount * 50) { - damage = projectileCount * 70; + damage = projectileCount * 50; } } @@ -689,21 +716,18 @@ namespace CalamityMod.NPCs newAI[m] = 0f; } - // Apply DR to vanilla NPCs. No vanilla NPCs have DR except in Rev+. - // This also applies DR to other mods' NPCs who have set up their NPCs to have DR in Rev+. - if (CalamityWorld.revenge) - { - if (CalamityMod.DRValues.ContainsKey(npc.type)) - { - CalamityMod.DRValues.TryGetValue(npc.type, out float revDR); - DR = revDR; - } + // Apply DR to vanilla NPCs. + // This also applies DR to other mods' NPCs who have set up their NPCs to have DR. + if (CalamityMod.DRValues.ContainsKey(npc.type)) + { + CalamityMod.DRValues.TryGetValue(npc.type, out float newDR); + DR = newDR; + } - if (CalamityMod.bossKillTimes.ContainsKey(npc.type)) - { - CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); - KillTime = revKillTime; - } + if (CalamityMod.bossKillTimes.ContainsKey(npc.type)) + { + CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); + KillTime = revKillTime; } if (npc.boss && CalamityWorld.revenge) @@ -1019,17 +1043,6 @@ namespace CalamityMod.NPCs npc.canGhostHeal = false; } } - - /// - /// Sets the DR of this NPC only if Revengeance Mode is enabled. Otherwise sets DR to zero. - /// - /// The DR to set, assuming Rev+ difficulty. - /// Whether Revengeance Mode is currently enabled. - public bool RevPlusDR(float dr) - { - DR = CalamityWorld.revenge ? dr : 0f; - return CalamityWorld.revenge; - } #endregion #region Other Stat Changes @@ -1041,19 +1054,6 @@ namespace CalamityMod.NPCs npc.width = npc.height = 36; } - //Reduce damage in Death Mode by the Beach - if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses) - { - if (npc.type == NPCID.Sharkron) - { - npc.damage = 25; - } - if (npc.type == NPCID.Sharkron2) - { - npc.damage = 50; - } - } - if (npc.type == NPCID.CultistBoss) { npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.revenge ? 2 : 1.2)); @@ -1147,7 +1147,7 @@ namespace CalamityMod.NPCs if ((npc.boss && npc.type != NPCID.MartianSaucerCore && npc.type < NPCID.Count) || CalamityMod.bossHPScaleList.Contains(npc.type)) { - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); } } @@ -1201,7 +1201,7 @@ namespace CalamityMod.NPCs Texture2D npcTexture = texture ?? Main.npcTexture[npc.type]; Vector2 origin = npc.Size * 0.5f; int afterimageCounter = 1; - while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityMod.CalamityConfig.Afterimages) + while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityConfig.Instance.Afterimages) { Color colorToDraw = Color.Lerp(drawColor, endingColor, afterimageCounter / (float)NPCID.Sets.TrailCacheLength[npc.type]); colorToDraw *= afterimageCounter / (float)NPCID.Sets.TrailCacheLength[npc.type]; @@ -1284,7 +1284,7 @@ namespace CalamityMod.NPCs #region Scale Thorium Boss Health private void ScaleThoriumBossHealth(NPC npc, Mod mod) { - if (CalamityMod.CalamityConfig.RevengeanceAndDeathThoriumBossBuff) + if (CalamityConfig.Instance.BuffThoriumBosses) { Mod thorium = ModLoader.GetMod("ThoriumMod"); if (thorium != null) @@ -1443,17 +1443,24 @@ namespace CalamityMod.NPCs #region Strike NPC public override bool StrikeNPC(NPC npc, ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { + // Damage reduction on spawn if (CalamityWorld.revenge || CalamityWorld.bossRushActive) { - if (DestroyerIDs.Contains(npc.type)) + if (DestroyerIDs.Contains(npc.type) || AstrumDeusIDs.Contains(npc.type)) { - if (newAI[1] < 480f || newAI[2] > 0f) + if (newAI[1] < 480f || (newAI[2] > 0f && DestroyerIDs.Contains(npc.type))) { damage *= 0.01; } } } + // Large Deus worm takes reduced damage to last a long enough time + if (AstrumDeusIDs.Contains(npc.type) && newAI[0] == 0f) + { + damage *= 0.8; + } + // Override hand/head eye 'death' code and use custom 'death' code instead, this is here just in case the AI code fails if (CalamityWorld.revenge || CalamityWorld.bossRushActive) { @@ -1532,8 +1539,14 @@ namespace CalamityMod.NPCs // Calculate extra DR based on kill time, similar to the Hush boss from The Binding of Isaac if (KillTime > 0 && AITimer < KillTime && !CalamityWorld.bossRushActive) { - // The limit for how much extra DR the boss can have - float extraDRLimit = (1f - DR) * (!GetDownedBossVariable(npc.type) || CalamityMod.CalamityConfig.ExtraBossDR ? 1.5f : 1f); + float DRScalar = !GetDownedBossVariable(npc.type) || CalamityConfig.Instance.FullPowerReactiveBossDR ? 1.5f : 1f; + + // Boost Providence timed DR during the night + if (npc.type == NPCType() && !Main.dayTime) + DRScalar = 10f; + + // The limit for how much extra DR the boss can have + float extraDRLimit = (1f - DR) * DRScalar; // Ranges from 1 to 0 float currentHPRatio = npc.life / (float)npc.lifeMax; @@ -1563,11 +1576,7 @@ namespace CalamityMod.NPCs calcDR *= 0.66f; if (wCleave > 0) calcDR *= 0.75f; - - // Ichor supersedes Cursed Inferno if both are applied. - if (npc.ichor) - calcDR *= 0.75f; - else if (npc.onFire2) + if (npc.onFire2) calcDR *= 0.8f; return calcDR; @@ -1596,10 +1605,7 @@ namespace CalamityMod.NPCs FlatEditDR(ref calcDR, npc.shadowFlame, BuffID.ShadowFlame); FlatEditDR(ref calcDR, npc.daybreak, BuffID.Daybreak); FlatEditDR(ref calcDR, npc.betsysCurse, BuffID.BetsysCurse); - - // Ichor supersedes Cursed Inferno if both are applied. - FlatEditDR(ref calcDR, npc.ichor, BuffID.Ichor); - FlatEditDR(ref calcDR, npc.onFire2 && !npc.ichor, BuffID.CursedInferno); + FlatEditDR(ref calcDR, npc.onFire2, BuffID.CursedInferno); // Modded debuffs are handled modularly and use HasBuff. foreach (KeyValuePair entry in flatDRReductions) @@ -1617,10 +1623,7 @@ namespace CalamityMod.NPCs MultEditDR(ref calcDR, npc.shadowFlame, BuffID.ShadowFlame); MultEditDR(ref calcDR, npc.daybreak, BuffID.Daybreak); MultEditDR(ref calcDR, npc.betsysCurse, BuffID.BetsysCurse); - - // Ichor supersedes Cursed Inferno if both are applied. - MultEditDR(ref calcDR, npc.ichor, BuffID.Ichor); - MultEditDR(ref calcDR, npc.onFire2 && !npc.ichor, BuffID.CursedInferno); + MultEditDR(ref calcDR, npc.onFire2, BuffID.CursedInferno); // Modded debuffs are handled modularly and use HasBuff. foreach (KeyValuePair entry in multDRReductions) @@ -1662,6 +1665,12 @@ namespace CalamityMod.NPCs { SetPatreonTownNPCName(npc); + if (CalamityPlayer.areThereAnyDamnBosses) + { + if (npc.velocity.Length() > maxVelocity) + maxVelocity = npc.velocity.Length(); + } + if (KillTime > 0 && AITimer < KillTime) AITimer++; @@ -1818,6 +1827,10 @@ namespace CalamityMod.NPCs break; } } + else if (npc.type == NPCID.Retinazer) + { + return CalamityGlobalAI.TrueMeleeRetinazerPhase2AI(npc); + } if (CalamityWorld.death) { @@ -2920,8 +2933,7 @@ namespace CalamityMod.NPCs break; case 29: - if (!AstrumDeusIDs.Contains(npc.type) && npc.type != NPCType() && - npc.type != NPCType() && npc.type != NPCType()) + if (!AstrumDeusIDs.Contains(npc.type)) { npc.active = false; npc.netUpdate = true; @@ -3049,7 +3061,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || CalamityWorld.bossRushActive) { - bool configBossRushBoost = CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive; + bool configBossRushBoost = CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive; switch (npc.type) { @@ -3254,7 +3266,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge) { - if (CalamityMod.CalamityConfig.RevengeanceAndDeathThoriumBossBuff) + if (CalamityConfig.Instance.BuffThoriumBosses) { Mod thorium = ModLoader.GetMod("ThoriumMod"); if (thorium != null) @@ -3528,179 +3540,203 @@ namespace CalamityMod.NPCs } } - if (AstrumDeusIDs.Contains(npc.type)) + // Expert Mode resists, mostly worms + if (Main.expertMode) { - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || ProjectileID.Sets.StardustDragon[projectile.type]) + if (AstrumDeusIDs.Contains(npc.type)) { - damage = (int)(damage * 0.1); + GrenadeResist(projectile, ref damage); + PierceResistGlobal(projectile, ref damage); + + // Old resists + /*if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.1); + } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.2); + } + else if (projectile.type == player.beeType() || projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.4); + }*/ + + // New resists + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.2); + } + else if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.Electrosphere) + { + damage = (int)(damage * 0.4); + } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.5); + } + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.InfernoFriendlyBolt || projectile.type == ProjectileID.InfernoFriendlyBlast || projectile.type == ProjectileID.RainbowFront || projectile.type == ProjectileID.RainbowBack || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.ChargedBlasterLaser) + { + damage = (int)(damage * 0.75); + } } - else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow) + else if (StormWeaverIDs.Contains(npc.type)) { - damage = (int)(damage * 0.4); + 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 (ProjectileID.Sets.StardustDragon[projectile.type]) + { + damage = (int)(damage * 0.1); + } } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + 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.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); + } + if (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); + } + } + + // Other projectile resists + if (npc.type == NPCType()) + { + if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.2); + } + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.6); } - else if (projectile.type == ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { - damage = (int)(damage * 0.85); + damage = (int)(damage * 0.75); } - - if (projectile.penetrate == -1 && !projectile.minion) + else if (projectile.type == ProjectileID.LunarFlare) { - damage = (int)(damage * 0.2); - } - else if (projectile.penetrate > 1 && projectile.type != ProjectileType()) - { - damage /= projectile.penetrate; + damage = (int)(damage * 0.8); } } - else if (StormWeaverIDs.Contains(npc.type)) - { - 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 (ProjectileID.Sets.StardustDragon[projectile.type]) - { - damage = (int)(damage * 0.1); - } - - if (projectile.penetrate == -1 && !projectile.minion) - { - damage = (int)(damage * 0.2); - } - else if (projectile.penetrate > 1) - { - damage /= projectile.penetrate; - } - } - else if (DestroyerIDs.Contains(npc.type)) - { - if (((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)) - { - damage = (int)(damage * 0.5); - } - 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.25); - } - } - else if (AquaticScourgeIDs.Contains(npc.type)) - { - if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion) - { - damage = (int)(damage * 0.5); - } - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.9); - } - if (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 (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper) - { - if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion) - { - damage = (int)(damage * 0.6); - } - if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.7); - } - } - else if (DesertScourgeIDs.Contains(npc.type)) - { - if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.7); - } - } - else if (npc.type == NPCType()) - { - if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.2); - } - 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.6); - } - else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.75); - } - else if (projectile.type == ProjectileID.LunarFlare) - { - damage = (int)(damage * 0.8); - } - } else if (npc.type == NPCID.CultistBoss) { - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { damage = (int)(damage * 0.75); } } - else if (npc.type == NPCID.DukeFishron) + else if (npc.type == NPCID.DukeFishron) { - if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) - { + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { damage = (int)(damage * 1.35); } } - else if (npc.type == NPCType()) + else if (npc.type == NPCType()) { - if (projectile.type == ProjectileType()) - { + if (projectile.type == ProjectileType()) + { damage = (int)(damage * 1.5); } } } - #endregion - #region On Hit By Item - public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit) + private void GrenadeResist(Projectile projectile, ref int damage) + { + if (GrenadeResistIDs.Contains(projectile.type)) + damage = (int)(damage * 0.2); + } + + private void PierceResistGlobal(Projectile projectile, ref int damage) + { + if (projectile.minion) + return; + + if (projectile.penetrate == -1) + damage = (int)(damage * 0.5); + else if (projectile.penetrate > 1) + damage = (int)MathHelper.Clamp(damage * (float)Math.Pow(0.9, projectile.penetrate), damage * 0.5f, damage); + } + #endregion + + #region On Hit By Item + public override void OnHitByItem(NPC npc, Player player, Item item, int damage, float knockback, bool crit) { if (player.Calamity().bloodflareSet) { @@ -3777,7 +3813,7 @@ namespace CalamityMod.NPCs #region Check Dead public override bool CheckDead(NPC npc) { - if (npc.lifeMax > 1000 && npc.type != 288 && + if (npc.lifeMax > 1000 && npc.type != NPCID.DungeonSpirit && npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && @@ -3848,7 +3884,7 @@ namespace CalamityMod.NPCs if (Main.netMode == NetmodeID.Server && num263 < 200) { - NetMessage.SendData(23, -1, -1, null, num263, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num263, 0f, 0f, 0f, 0, 0, 0); } num = num262; @@ -4032,7 +4068,7 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 1.4); maxSpawns = (int)(maxSpawns * 0.4f); } - if (player.Calamity().zen || (CalamityMod.CalamityConfig.DisableExpertEnemySpawnsNearHouse && player.townNPCs > 1f && Main.expertMode)) + if (player.Calamity().zen || (CalamityConfig.Instance.DisableExpertTownSpawns && player.townNPCs > 1f && Main.expertMode)) { spawnRate = (int)(spawnRate * 2.5); maxSpawns = (int)(maxSpawns * 0.3f); @@ -4477,7 +4513,7 @@ namespace CalamityMod.NPCs return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, npc.alpha); } - if (enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { return new Color(200, 50, 50, npc.alpha); } @@ -4489,7 +4525,7 @@ namespace CalamityMod.NPCs { if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f)) { - if (CalamityMod.CalamityConfig.EnemyDebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type))) + if (CalamityConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type))) { List buffTextureList = new List(); @@ -4652,7 +4688,7 @@ namespace CalamityMod.NPCs } } - if (CalamityMod.CalamityConfig.TownNPCNewShopInventoryAlertDisplay && npc.townNPC) + if (CalamityConfig.Instance.ShopNewAlert && npc.townNPC) { if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newPermafrostInventory) { @@ -5310,6 +5346,11 @@ namespace CalamityMod.NPCs chat = "I happen to have several Angel Statues at the moment, a truely rare commodity. Want one?"; } + if (Main.rand.NextBool(7) && CalamityWorld.death) + { + chat = "The caverns have become increasingly dark as of late, so I stocked up on some special torches if you have the funds."; + } + break; case NPCID.Mechanic: @@ -5559,6 +5600,7 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BallOHurt : ItemID.TheRottedFork, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ItemID.MasterBait, NPC.downedBoss3); SetShopItem(ref shop, ref nextSlot, ItemID.AngelStatue, NPC.FindFirstNPC(NPCType()) != -1, Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemID.UltrabrightTorch, CalamityWorld.death); } // Because of the defiled condition, the dye trader does not receive an alert icon when hardmode starts. @@ -5580,8 +5622,8 @@ namespace CalamityMod.NPCs { SetShopItem(ref shop, ref nextSlot, ItemType(), Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); SetShopItem(ref shop, ref nextSlot, ItemType(), Main.LocalPlayer.wingTimeMax > 0); - SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); - SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityConfig.Instance.Rippers); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityConfig.Instance.Rippers); } if (type == NPCID.Cyborg) @@ -5599,11 +5641,11 @@ namespace CalamityMod.NPCs { SetShopItem(ref shop, ref nextSlot, ItemID.JungleRose, price: Item.buyPrice(0, 2)); SetShopItem(ref shop, ref nextSlot, ItemID.NaturesGift, price: Item.buyPrice(0, 10)); - SetShopItem(ref shop, ref nextSlot, ItemID.SlimeCrown, NPC.downedSlimeKing && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 2)); - SetShopItem(ref shop, ref nextSlot, ItemID.SuspiciousLookingEye, NPC.downedBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 3)); + SetShopItem(ref shop, ref nextSlot, ItemID.SlimeCrown, NPC.downedSlimeKing && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 2)); + SetShopItem(ref shop, ref nextSlot, ItemID.SuspiciousLookingEye, NPC.downedBoss1 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 3)); SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedCrabulon, Item.buyPrice(0, 4)); - SetShopItem(ref shop, ref nextSlot, ItemID.BloodySpine, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); - SetShopItem(ref shop, ref nextSlot, ItemID.WormFood, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); + SetShopItem(ref shop, ref nextSlot, ItemID.BloodySpine, NPC.downedBoss2 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 6)); + SetShopItem(ref shop, ref nextSlot, ItemID.WormFood, NPC.downedBoss2 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 6)); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BandofStarpower : ItemID.PanicNecklace, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.WormScarf : ItemID.BrainOfConfusion, Main.expertMode && NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPerforator, Item.buyPrice(0, 10)); @@ -5648,9 +5690,9 @@ namespace CalamityMod.NPCs if (type == NPCID.Steampunker) { - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalWorm, NPC.downedMechBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalEye, NPC.downedMechBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalSkull, NPC.downedMechBoss3 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalWorm, NPC.downedMechBoss1 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalEye, NPC.downedMechBoss2 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalSkull, NPC.downedMechBoss3 && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 0, 5)); } @@ -5663,7 +5705,7 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemID.SpectreStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.InfernoFork, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.ShadowbeamStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); - SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(3)); + SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(3)); SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedGuardians, Item.buyPrice(5)); } @@ -5673,10 +5715,10 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemType()); SetShopItem(ref shop, ref nextSlot, ItemType(), Main.hardMode); SetShopItem(ref shop, ref nextSlot, ItemType(), Main.hardMode); - SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, CalamityMod.CalamityConfig.SellBossSummons, price: Item.buyPrice(0, 8)); - SetShopItem(ref shop, ref nextSlot, ItemType(), NPC.downedPlantBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, CalamityConfig.Instance.SellVanillaSummons, price: Item.buyPrice(0, 8)); + SetShopItem(ref shop, ref nextSlot, ItemType(), NPC.downedPlantBoss && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemID.SolarTablet, NPC.downedGolemBoss, Item.buyPrice(0, 25)); - SetShopItem(ref shop, ref nextSlot, ItemID.LihzahrdPowerCell, NPC.downedGolemBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 30)); + SetShopItem(ref shop, ref nextSlot, ItemID.LihzahrdPowerCell, NPC.downedGolemBoss && CalamityConfig.Instance.SellVanillaSummons, Item.buyPrice(0, 30)); SetShopItem(ref shop, ref nextSlot, ItemType(), NPC.downedGolemBoss, Item.buyPrice(0, 10)); SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedScavenger, Item.buyPrice(0, 50)); SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPlaguebringer, Item.buyPrice(0, 50)); @@ -5822,6 +5864,23 @@ namespace CalamityMod.NPCs } #endregion + #region Any Events + public static bool AnyEvents(Player player) + { + if (Main.invasionType > 0) + return true; + if (player.PillarZone()) + return true; + if (DD2Event.Ongoing) + return true; + if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.bloodMoon || Main.pumpkinMoon || Main.snowMoon)) + return true; + if (CalamityWorld.rainingAcid && player.InSulphur()) + return true; + return false; + } + #endregion + #region Get Downed Boss Variable public static bool GetDownedBossVariable(int type) { @@ -5924,7 +5983,7 @@ namespace CalamityMod.NPCs { return CalamityWorld.downedAstrageldon; } - else if (type == NPCType() || type == NPCType() || type == NPCType() || type == NPCType() || type == NPCType() || type == NPCType()) + else if (type == NPCType() || type == NPCType() || type == NPCType()) { return CalamityWorld.downedStarGod; } @@ -6088,7 +6147,7 @@ namespace CalamityMod.NPCs } else { - NetMessage.SendData(61, -1, -1, null, plr, (float)type, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, plr, (float)type, 0f, 0f, 0, 0, 0); } } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 721657255b..0addaf402a 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -13,8 +13,6 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumDeus; @@ -26,7 +24,6 @@ using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.HiveMind; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Ravager; @@ -46,7 +43,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs { - public class CalamityGlobalNPCLoot : GlobalNPC + public class CalamityGlobalNPCLoot : GlobalNPC { #region Instance Per Entity public override bool InstancePerEntity => false; @@ -167,7 +164,7 @@ namespace CalamityMod.NPCs DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 1, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 8, 1, 1); DropHelper.DropItemChance(npc, ModContent.ItemType(), !Main.hardMode, Main.hardMode ? 0.1f : 1f); // 100% chance on first kill, 10% chance afterwards - DropHelper.DropItemFromSetCondition(npc, !Main.expertMode, 5, ItemID.CorruptionKey, ItemID.CrimsonKey); + DropHelper.DropItemFromSetCondition(npc, !Main.expertMode, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !Main.hardMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !Main.hardMode); @@ -201,7 +198,7 @@ namespace CalamityMod.NPCs npc.Calamity().SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); npc.Calamity().SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3); - npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss2 || !CalamityMod.CalamityConfig.SellBossSummons); + npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss2 || !CalamityConfig.Instance.SellVanillaSummons); } else if (npc.type == NPCID.TheDestroyer) { @@ -210,7 +207,7 @@ namespace CalamityMod.NPCs npc.Calamity().SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); npc.Calamity().SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3); - npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss1 || !CalamityMod.CalamityConfig.SellBossSummons); + npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss1 || !CalamityConfig.Instance.SellVanillaSummons); } else if (npc.type == NPCID.SkeletronPrime) { @@ -220,7 +217,7 @@ namespace CalamityMod.NPCs npc.Calamity().SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); npc.Calamity().SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3); - npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss3 || !CalamityMod.CalamityConfig.SellBossSummons); + npc.Calamity().SetNewShopVariable(new int[] { NPCID.Steampunker }, NPC.downedMechBoss3 || !CalamityConfig.Instance.SellVanillaSummons); } else if (npc.type == NPCID.Plantera) { @@ -309,7 +306,7 @@ namespace CalamityMod.NPCs DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedFishron); DropHelper.DropResidentEvilAmmo(npc, NPC.downedPlantBoss, 4, 2, 1); - npc.Calamity().SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedFishron || !CalamityMod.CalamityConfig.SellBossSummons); + npc.Calamity().SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedFishron || !CalamityConfig.Instance.SellVanillaSummons); } else if (npc.type == NPCID.CultistBoss) { @@ -347,7 +344,7 @@ namespace CalamityMod.NPCs DropHelper.DropResidentEvilAmmo(npc, NPC.downedMoonlord, 5, 2, 1); npc.Calamity().SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedMoonlord); - npc.Calamity().SetNewShopVariable(new int[] { NPCID.Wizard }, NPC.downedMoonlord || !CalamityMod.CalamityConfig.SellBossSummons); + npc.Calamity().SetNewShopVariable(new int[] { NPCID.Wizard }, NPC.downedMoonlord || !CalamityConfig.Instance.SellVanillaSummons); string key = "Mods.CalamityMod.MoonBossText"; Color messageColor = Color.Orange; @@ -1342,12 +1339,6 @@ namespace CalamityMod.NPCs if (lastPlayer >= 0) { CalamityWorld.ChangeTime(false); - - for (int x = 0; x < 10; x++) - { - NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); - } - NPC.SpawnOnPlayer(lastPlayer, ModContent.NPCType()); CalamityMod.astralKillCount = 0; } @@ -1623,16 +1614,18 @@ namespace CalamityMod.NPCs private void AcidRainProgression(NPC npc) { Dictionary possibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; + if (CalamityWorld.downedAquaticScourge) possibleEnemies = AcidRainEvent.PossibleEnemiesAS; if (CalamityWorld.downedPolterghast) possibleEnemies = AcidRainEvent.PossibleEnemiesPolter; + if (possibleEnemies.Select(enemy => enemy.Key).Contains(npc.type) && CalamityWorld.rainingAcid) { CalamityWorld.acidRainPoints -= possibleEnemies[npc.type].InvasionContributionPoints; if (CalamityWorld.downedPolterghast) { - CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke. + CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke. } } Dictionary possibleMinibosses = CalamityWorld.downedPolterghast ? AcidRainEvent.PossibleMinibossesPolter : AcidRainEvent.PossibleMinibossesAS; @@ -1641,7 +1634,7 @@ namespace CalamityMod.NPCs CalamityWorld.acidRainPoints -= possibleMinibosses[npc.type].InvasionContributionPoints; if (CalamityWorld.downedPolterghast) { - CalamityWorld.acidRainPoints = (int)MathHelper.Max(2, CalamityWorld.acidRainPoints); // Cap at 2. The last points are for Old Duke. + CalamityWorld.acidRainPoints = (int)MathHelper.Max(1, CalamityWorld.acidRainPoints); // Cap at 1. The last point is for Old Duke. } } @@ -1654,6 +1647,7 @@ namespace CalamityMod.NPCs CalamityWorld.triedToSummonOldDuke = false; CalamityWorld.acidRainPoints = 0; } + CalamityWorld.timeSinceAcidRainKill = 0; AcidRainEvent.UpdateInvasion(); } #endregion @@ -1689,7 +1683,7 @@ namespace CalamityMod.NPCs break; case NPCID.Plantera: - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 6, 9); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 12, 18); break; case NPCID.SolarSpearman: //Drakanian diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 470e72f160..63f055e6b2 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.CeaselessVoid float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.CeaselessVoid texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/CeaselessVoid/CeaselessVoidGlow"); Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 8d950437c8..14eee1caa6 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,11 +8,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.CeaselessVoid { - public class DarkEnergy : ModNPC + public class DarkEnergy : ModNPC { public int invinceTime = 120; @@ -40,7 +38,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { npc.lifeMax = 44000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.knockBackResist = 0.25f; npc.noGravity = true; @@ -88,7 +86,7 @@ namespace CalamityMod.NPCs.CeaselessVoid float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -112,7 +110,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index d8a50f1e32..e8acaae714 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,8 +8,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.CeaselessVoid { public class DarkEnergy2 : ModNPC @@ -40,7 +38,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { npc.lifeMax = 44000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.knockBackResist = 0.1f; npc.noGravity = true; @@ -88,7 +86,7 @@ namespace CalamityMod.NPCs.CeaselessVoid float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -112,7 +110,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 4288c4e321..08f2f50d4f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,12 +8,10 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.CeaselessVoid { - public class DarkEnergy3 : ModNPC + public class DarkEnergy3 : ModNPC { public int invinceTime = 120; @@ -40,7 +38,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { npc.lifeMax = 44000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -89,7 +87,7 @@ namespace CalamityMod.NPCs.CeaselessVoid float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -113,7 +111,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index d33f5aee09..384291388f 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Crabulon public override void AI() { - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.2f, 0.4f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.2f, 0.4f); bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; float speed = revenge ? 1.25f : 1f; Player player = Main.player[npc.target]; @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Crabulon npc.velocity.Y = speed; } npc.TargetClosest(true); - if (npc.position.X + (float)npc.width < player.position.X) + if (npc.position.X + npc.width < player.position.X) { if (npc.velocity.X < 0f) { @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Crabulon } npc.velocity.X += (CalamityWorld.bossRushActive ? 0.2f : 0.1f); } - else if (npc.position.X > player.position.X + (float)player.width) + else if (npc.position.X > player.position.X + player.width) { if (npc.velocity.X > 0f) { @@ -85,9 +85,9 @@ namespace CalamityMod.NPCs.Crabulon spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 5e50e22318..f3910a7358 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -17,11 +17,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Crabulon { - [AutoloadBossHead] + [AutoloadBossHead] public class CrabulonIdle : ModNPC { private int shotSpacing = 1000; @@ -40,7 +38,7 @@ namespace CalamityMod.NPCs.Crabulon npc.height = 160; npc.defense = 8; npc.LifeMaxNERB(3000, 4000, 11000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -77,13 +75,21 @@ namespace CalamityMod.NPCs.Crabulon { npc.gfxOffY = -16; - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.3f, 0.7f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.3f, 0.7f); bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; + npc.spriteDirection = npc.direction; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Phases + bool phase2 = (lifeRatio < 0.5f && expertMode) || death; + bool phase3 = (lifeRatio < 0.1f && expertMode) || death; + // Get a target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(true); @@ -123,10 +129,10 @@ namespace CalamityMod.NPCs.Crabulon if (npc.ai[0] != 0f && npc.ai[0] < 3f) { - Vector2 vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num349 = player.position.X + (float)(player.width / 2) - vector34.X; - float num350 = player.position.Y + (float)(player.height / 2) - vector34.Y; - float num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + Vector2 vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num349 = player.position.X + (player.width / 2) - vector34.X; + float num350 = player.position.Y + (player.height / 2) - vector34.Y; + float num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350); if (Main.netMode != NetmodeID.MultiplayerClient) { int num352 = 1; @@ -136,12 +142,12 @@ namespace CalamityMod.NPCs.Crabulon npc.localAI[3] += 2f; num352 += 3; } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || death) + if (phase2) { npc.localAI[3] += 1f; num352 += 2; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || death) + if (phase3) { npc.localAI[3] += 2f; num352 += 3; @@ -158,30 +164,30 @@ namespace CalamityMod.NPCs.Crabulon { npc.localAI[3] = 0f; npc.ai[3] += 1f; - if (npc.ai[3] >= (float)num352) + if (npc.ai[3] >= num352) { npc.ai[3] = 0f; } float num353 = 10f; int num354 = expertMode ? 12 : 16; int num355 = ModContent.ProjectileType(); - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + Main.PlaySound(SoundID.Item42, (int)npc.position.X, (int)npc.position.Y); if (CalamityWorld.bossRushActive) { num353 += 3f; } - if ((double)npc.life < (double)npc.lifeMax * 0.5 || death) + if (phase2) { num353 += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || death) + if (phase3) { num353 += 1f; } - vector34 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num349 = player.position.X + (float)player.width * 0.5f - vector34.X; - num350 = player.position.Y + (float)player.height * 0.5f - vector34.Y; - num351 = (float)Math.Sqrt((double)(num349 * num349 + num350 * num350)); + vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num349 = player.position.X + player.width * 0.5f - vector34.X; + num350 = player.position.Y + player.height * 0.5f - vector34.Y; + num351 = (float)Math.Sqrt(num349 * num349 + num350 * num350); num351 = num353 / num351; num349 *= num351; num350 *= num351; @@ -229,13 +235,13 @@ namespace CalamityMod.NPCs.Crabulon { float num823 = 1.25f; bool flag51 = false; - if ((double)npc.life < (double)npc.lifeMax * 0.5 || death) + if (phase2) num823 = 1.5f; - if ((double)npc.life < (double)npc.lifeMax * 0.1 || death) + if (phase3) num823 = 2f; if (CalamityWorld.bossRushActive) num823 = 12f; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num823 = 16f; if (Math.Abs(npc.Center.X - player.Center.X) < 50f) @@ -245,7 +251,7 @@ namespace CalamityMod.NPCs.Crabulon if (flag51) { npc.velocity.X *= 0.9f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) { npc.velocity.X = 0f; } @@ -262,9 +268,9 @@ namespace CalamityMod.NPCs.Crabulon } int num854 = 80; int num855 = 20; - Vector2 position2 = new Vector2(npc.Center.X - (float)(num854 / 2), npc.position.Y + (float)npc.height - (float)num855); + Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); bool flag52 = false; - if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width && npc.position.Y + (float)npc.height < player.position.Y + (float)player.height - 16f) + if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f) { flag52 = true; } @@ -278,7 +284,7 @@ namespace CalamityMod.NPCs.Crabulon { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y > -0.2) + if (npc.velocity.Y > -0.2) { npc.velocity.Y -= 0.025f; } @@ -297,7 +303,7 @@ namespace CalamityMod.NPCs.Crabulon { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y < 0.1) + if (npc.velocity.Y < 0.1) { npc.velocity.Y += 0.025f; } @@ -349,13 +355,13 @@ namespace CalamityMod.NPCs.Crabulon break; } } - if (npc.life < npc.lifeMax / 2 || death) + if (phase2) { - npc.ai[1] += (!revenge ? 4f : 1f); + npc.ai[1] += !revenge ? 4f : 1f; } - if (npc.life < npc.lifeMax / 4 || death) + if (phase3) { - npc.ai[1] += (!revenge ? 4f : 1f); + npc.ai[1] += !revenge ? 4f : 1f; } } @@ -367,6 +373,10 @@ namespace CalamityMod.NPCs.Crabulon { int velocityX = CalamityWorld.bossRushActive ? 12 : 4; float velocityY = CalamityWorld.bossRushActive ? -16f : -12f; + + float distanceBelowTarget = npc.position.Y - (player.position.Y + 80f); + float speedMult = 1f; + if (revenge) { switch ((int)npc.ai[3]) @@ -386,9 +396,29 @@ namespace CalamityMod.NPCs.Crabulon default: break; } + + if (distanceBelowTarget > 0f) + speedMult += distanceBelowTarget * 0.001f; + + if (speedMult > 2f) + speedMult = 2f; + + velocityY *= speedMult; } - npc.velocity.X = (float)(velocityX * npc.direction); - npc.velocity.Y = velocityY; + + if (expertMode) + { + if (player.position.Y < npc.Bottom.Y) + npc.velocity.Y = velocityY; + else + npc.velocity.Y = 1f; + + npc.noTileCollide = true; + } + else + npc.velocity.Y = velocityY; + + npc.velocity.X = velocityX * npc.direction; npc.ai[0] = 4f; npc.ai[1] = 0f; @@ -405,14 +435,14 @@ namespace CalamityMod.NPCs.Crabulon Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, ModContent.ProjectileType(), 20, 0f, Main.myPlayer, 0f, 0f); int num354 = expertMode ? 12 : 16; - if (npc.ai[2] % 2f == 0f && (double)npc.life < (double)npc.lifeMax * 0.5 && revenge) + if (npc.ai[2] % 2f == 0f && phase2 && revenge) { if (Main.netMode != NetmodeID.MultiplayerClient) { float velocityX = npc.ai[2] == 0f ? -4f : 4f; for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; @@ -421,13 +451,13 @@ namespace CalamityMod.NPCs.Crabulon npc.TargetClosest(true); npc.ai[2] += 1f; - if (npc.ai[2] >= ((double)npc.life < (double)npc.lifeMax * 0.5 ? 4f : 3f)) + if (npc.ai[2] >= (phase2 ? 4f : 3f)) { - if (Main.netMode != NetmodeID.MultiplayerClient && revenge && (double)npc.life >= (double)npc.lifeMax * 0.5) + if (Main.netMode != NetmodeID.MultiplayerClient && revenge && !phase2) { for (int x = 0; x < 20; x++) { - Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X + shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; @@ -449,17 +479,25 @@ namespace CalamityMod.NPCs.Crabulon { for (int num623 = 0; num623 < 4; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + (float)npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f); + int num624 = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + npc.height), npc.width + 20, 4, 56, 0f, 0f, 100, default, 1.5f); Main.dust[num624].velocity *= 0.2f; } } } else { - if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width) + if (!player.dead && expertMode) + { + if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) + npc.noTileCollide = true; + else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) + npc.noTileCollide = false; + } + + if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width) { npc.velocity.X *= 0.9f; - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.3f : 0.15f); + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.3f : 0.15f; } else { @@ -477,15 +515,15 @@ namespace CalamityMod.NPCs.Crabulon { num626 += 1f; } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num626 += 3f; } - if (npc.life < npc.lifeMax / 2 || death) + if (phase2) { num626 += 1f; } - if (npc.life < npc.lifeMax / 10 || death) + if (phase3) { num626 += 1f; } @@ -503,29 +541,29 @@ namespace CalamityMod.NPCs.Crabulon if (npc.localAI[0] == 0f && npc.life > 0) { - npc.localAI[0] = (float)npc.lifeMax; + npc.localAI[0] = npc.lifeMax; } if (npc.life > 0) { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.05); - if ((float)(npc.life + num660) < npc.localAI[0]) + int num660 = (int)(npc.lifeMax * 0.05); + if ((npc.life + num660) < npc.localAI[0]) { - npc.localAI[0] = (float)npc.life; + npc.localAI[0] = npc.life; int num661 = expertMode ? Main.rand.Next(2, 4) : Main.rand.Next(1, 3); for (int num662 = 0; num662 < num661; num662++) { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32)); int num663 = ModContent.NPCType(); int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663, -1f); - Main.npc[num664].velocity.X = (float)Main.rand.Next(-50, 51) * 0.1f; - Main.npc[num664].velocity.Y = (float)Main.rand.Next(-50, -31) * 0.1f; + Main.npc[num664].velocity.X = Main.rand.Next(-50, 51) * 0.1f; + Main.npc[num664].velocity.Y = Main.rand.Next(-50, -31) * 0.1f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } @@ -558,17 +596,17 @@ namespace CalamityMod.NPCs.Crabulon Texture2D textureAttack = ModContent.GetTexture("CalamityMod/NPCs/Crabulon/CrabulonAttack"); Texture2D textureAttackGlow = ModContent.GetTexture("CalamityMod/NPCs/Crabulon/CrabulonAttackGlow"); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)Main.npcTexture[npc.type].Width, (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); if (npc.ai[0] > 2f) { - vector11 = new Vector2((float)(textureAttack.Width / 2), (float)(textureAttack.Height / 2)); + vector11 = new Vector2(textureAttack.Width / 2, textureAttack.Height / 2); vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)textureAttack.Width, (float)(textureAttack.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2(textureAttack.Width, textureAttack.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(textureAttack, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); @@ -577,9 +615,9 @@ namespace CalamityMod.NPCs.Crabulon } else if (npc.ai[0] == 2f) { - vector11 = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2)); + vector11 = new Vector2(texture.Width / 2, texture.Height / 2); vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(drawColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); @@ -643,12 +681,12 @@ namespace CalamityMod.NPCs.Crabulon } if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 200; npc.height = 100; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f); @@ -656,7 +694,7 @@ namespace CalamityMod.NPCs.Crabulon if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 70; num623++) @@ -667,7 +705,7 @@ namespace CalamityMod.NPCs.Crabulon num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 56, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + float randomSpread = Main.rand.Next(-200, 200) / 100; Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon2"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Crabulon3"), 1f); diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 54f2fd78ab..c362fd2c33 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -1,16 +1,15 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags { - public class CalamityEye : ModNPC + public class CalamityEye : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/Crags/CharredSlime.cs b/NPCs/Crags/CharredSlime.cs index 4d1ddd6901..58a3c729ea 100644 --- a/NPCs/Crags/CharredSlime.cs +++ b/NPCs/Crags/CharredSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index e258a8cadd..724a9d55a8 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index eeed497276..35905612e1 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -1,16 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags { - public class DespairStone : ModNPC + public class DespairStone : ModNPC { public override void SetStaticDefaults() { @@ -25,7 +23,7 @@ namespace CalamityMod.NPCs.Crags npc.width = 72; //324 npc.height = 72; //216 npc.defense = 38; - npc.Calamity().RevPlusDR(0.35f); + npc.DR_NERD(0.35f); npc.lifeMax = 120; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index b303137fd9..e626cc9ebf 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 4150d8c190..2728702026 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index cbd0631b4a..29c1c70e67 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Crags npc.width = 60; //324 npc.height = 40; //216 npc.defense = 40; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 60; npc.knockBackResist = 0.65f; npc.value = Item.buyPrice(0, 0, 5, 0); @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.Crags float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -254,7 +254,7 @@ namespace CalamityMod.NPCs.Crags texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Calamitas/SoulSeekerGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Cryogen/Cryocore.cs b/NPCs/Cryogen/Cryocore.cs index bc215da442..f8b4e9f821 100644 --- a/NPCs/Cryogen/Cryocore.cs +++ b/NPCs/Cryogen/Cryocore.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/NPCs/Cryogen/Cryocore2.cs b/NPCs/Cryogen/Cryocore2.cs index ebaad17782..b5cad284eb 100644 --- a/NPCs/Cryogen/Cryocore2.cs +++ b/NPCs/Cryogen/Cryocore2.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 20046193a3..f717acd207 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -46,9 +46,9 @@ namespace CalamityMod.NPCs.Cryogen npc.width = 86; npc.height = 88; npc.defense = 12; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.LifeMaxNERB(17900, 26300, 3000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -124,9 +124,21 @@ namespace CalamityMod.NPCs.Cryogen bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - double multAdd = revenge ? 0.1 : 0D; - if ((int)npc.ai[0] + 1 > currentPhase && currentPhase < 6) + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Phases + bool phase2 = lifeRatio < (death ? 0.95 : revenge ? 0.89 : 0.83); + bool phase3 = lifeRatio < (death ? 0.8 : revenge ? 0.73 : 0.66); + bool phase4 = lifeRatio < (death ? 0.7 : revenge ? 0.6 : 0.49); + bool phase5 = lifeRatio < (death ? 0.55 : revenge ? 0.43 : 0.32); + bool phase6 = lifeRatio < (death ? 0.4 : revenge ? 0.27 : 0.15); + bool phase7 = lifeRatio < (death ? 0.25 : 0.15) && revenge; + bool phase8 = lifeRatio < (revenge ? 0.225 : 0.1); + bool phase9 = lifeRatio < (revenge ? 0.2 : 0.05) || death; + + if ((int)npc.ai[0] + 1 > currentPhase && currentPhase < 6) { HandlePhaseTransition((int)npc.ai[0] + 1); } @@ -195,7 +207,7 @@ namespace CalamityMod.NPCs.Cryogen else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || npc.life >= npc.lifeMax * 0.15)) + if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !phase7)) { time++; if (time >= 600) @@ -227,7 +239,7 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 16; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = Main.expertMode ? 20 : 23; + int damage = expertMode ? 20 : 23; float velocity = CalamityWorld.bossRushActive ? 12f : 8f; for (int k = 0; k < totalProjectiles; k++) { @@ -257,8 +269,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f; npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f; - double HPMult = death ? 0.95 : 0.83 + multAdd; - if (npc.life < npc.lifeMax * HPMult) + if (phase2) { npc.TargetClosest(true); npc.ai[0] = 1f; @@ -278,7 +289,7 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = Main.expertMode ? 20 : 23; + int damage = expertMode ? 20 : 23; float velocity2 = CalamityWorld.bossRushActive ? 12f : 8f; for (int k = 0; k < totalProjectiles; k++) { @@ -341,8 +352,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = -velocity; } - double HPMult = death ? 0.8 : 0.66 + multAdd; - if (npc.life < npc.lifeMax * HPMult) + if (phase3) { npc.TargetClosest(true); npc.ai[0] = 2f; @@ -366,7 +376,7 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = Main.expertMode ? 20 : 23; + int damage = expertMode ? 20 : 23; float velocity = CalamityWorld.bossRushActive ? 14f : 9f; for (int k = 0; k < totalProjectiles; k++) { @@ -392,14 +402,14 @@ namespace CalamityMod.NPCs.Cryogen int num185 = ModContent.ProjectileType(); value9.X += num180; value9.Y += num182; - for (int num186 = 0; num186 < 15; num186++) + for (int num186 = 0; num186 < 6; num186++) { num180 = player.position.X + player.width * 0.5f - value9.X; num182 = player.position.Y + player.height * 0.5f - value9.Y; num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); num183 = num179 / num183; - num180 += Main.rand.Next(-180, 181); - num182 += Main.rand.Next(-180, 181); + num180 += Main.rand.Next(-360, 361); + num182 += Main.rand.Next(-360, 361); num180 *= num183; Projectile.NewProjectile(value9.X, value9.Y, num180, -8f, num185, num184, 0f, Main.myPlayer, 0f, 0f); } @@ -427,8 +437,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = (npc.velocity.X * 50f + num1243) / 51f; npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f; - double HPMult = death ? 0.7 : 0.49 + multAdd; - if (npc.life < npc.lifeMax * HPMult) + if (phase4) { npc.TargetClosest(true); npc.ai[0] = 3f; @@ -463,7 +472,7 @@ namespace CalamityMod.NPCs.Cryogen int num185 = ModContent.ProjectileType(); value9.X += num180; value9.Y += num182; - for (int num186 = 0; num186 < 15; num186++) + for (int num186 = 0; num186 < 12; num186++) { num180 = player.position.X + player.width * 0.5f - value9.X; num182 = player.position.Y + player.height * 0.5f - value9.Y; @@ -530,8 +539,7 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = -velocity; } - double HPMult = death ? 0.55 : 0.32 + multAdd; - if (npc.life < npc.lifeMax * HPMult) + if (phase5) { npc.TargetClosest(true); npc.ai[0] = 4f; @@ -552,7 +560,7 @@ namespace CalamityMod.NPCs.Cryogen { int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = Main.expertMode ? 20 : 23; + int damage = expertMode ? 20 : 23; float velocity = CalamityWorld.bossRushActive ? 14f : 9f; for (int k = 0; k < totalProjectiles; k++) { @@ -661,8 +669,7 @@ namespace CalamityMod.NPCs.Cryogen } } - double HPMult = death ? 0.4 : 0.15 + multAdd; - if (npc.life < npc.lifeMax * HPMult) + if (phase6) { for (int num621 = 0; num621 < 40; num621++) { @@ -721,8 +728,7 @@ namespace CalamityMod.NPCs.Cryogen { npc.damage = (int)(npc.defDamage * 1.5f); - double HPMult = death ? 0.25 : 0.15; - if (revenge && npc.life < npc.lifeMax * HPMult) + if (phase7) { if (npc.ai[1] == 60f) npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (CalamityWorld.bossRushActive ? 30f : (isChill ? 18f : 24f)); @@ -771,7 +777,7 @@ namespace CalamityMod.NPCs.Cryogen num1374 *= num1376; iceShard--; - if (npc.life < npc.lifeMax * (0.1 + multAdd) || death) + if (phase9) { if (num1375 < 170f || iceShard > 0) { @@ -783,7 +789,7 @@ namespace CalamityMod.NPCs.Cryogen return; } } - else if (npc.life < npc.lifeMax * (0.125 + multAdd)) + else if (phase8) { if (num1375 < 190f || iceShard > 0) { @@ -904,7 +910,7 @@ namespace CalamityMod.NPCs.Cryogen } } - if (!revenge || npc.life >= npc.lifeMax * (death ? 0.25 : 0.15)) + if (!phase7) { if (npc.ai[3] == 0f && npc.life > 0) { @@ -955,7 +961,7 @@ namespace CalamityMod.NPCs.Cryogen int num664 = NPC.NewNPC(x, y, randomSpawn, 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } @@ -972,7 +978,7 @@ namespace CalamityMod.NPCs.Cryogen Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CryoChipGore" + i), 1f); } currentPhase = newPhase; - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); + Main.PlaySound(SoundID.NPCDeath14, (int)npc.position.X, (int)npc.position.Y); } @@ -1009,7 +1015,7 @@ namespace CalamityMod.NPCs.Cryogen if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 70; num623++) @@ -1020,7 +1026,7 @@ namespace CalamityMod.NPCs.Cryogen num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + float randomSpread = Main.rand.Next(-200, 200) / 100; for (int i = 1; i < 4; i++) { Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoDeathGore" + i), 1f); diff --git a/NPCs/Cryogen/CryogenIce.cs b/NPCs/Cryogen/CryogenIce.cs index fe68a082c0..94f11df12b 100644 --- a/NPCs/Cryogen/CryogenIce.cs +++ b/NPCs/Cryogen/CryogenIce.cs @@ -1,14 +1,13 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Cryogen { - public class CryogenIce : ModNPC + public class CryogenIce : ModNPC { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.NPCs.Cryogen npc.damage = 50; npc.width = 190; npc.height = 190; - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); npc.lifeMax = 1400; if (CalamityWorld.bossRushActive) { diff --git a/NPCs/Cryogen/IceMass.cs b/NPCs/Cryogen/IceMass.cs index 2680500612..e403f21701 100644 --- a/NPCs/Cryogen/IceMass.cs +++ b/NPCs/Cryogen/IceMass.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using System; using Terraria; using Terraria.ID; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index c725145118..e20eb2e1ba 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -6,12 +6,10 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DesertScourge { - public class DesertScourgeBody : ModNPC + public class DesertScourgeBody : ModNPC { public override void SetStaticDefaults() { @@ -25,9 +23,9 @@ namespace CalamityMod.NPCs.DesertScourge npc.width = 32; npc.height = 36; npc.defense = 6; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.LifeMaxNERB(2300, 2650, 16500000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; @@ -99,7 +97,7 @@ namespace CalamityMod.NPCs.DesertScourge if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { npc.localAI[0] += (float)Main.rand.Next(4); - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { npc.localAI[0] += 4f; } @@ -150,7 +148,7 @@ namespace CalamityMod.NPCs.DesertScourge int seeker = NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); if (Main.netMode == NetmodeID.Server && seeker < 200) { - NetMessage.SendData(23, -1, -1, null, seeker, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, seeker, 0f, 0f, 0f, 0, 0, 0); } npc.netUpdate = true; } diff --git a/NPCs/DesertScourge/DesertScourgeBodySmall.cs b/NPCs/DesertScourge/DesertScourgeBodySmall.cs index 8a8cfd2ed7..1982f7c16b 100644 --- a/NPCs/DesertScourge/DesertScourgeBodySmall.cs +++ b/NPCs/DesertScourge/DesertScourgeBodySmall.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -6,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.DesertScourge { - public class DesertScourgeBodySmall : ModNPC + public class DesertScourgeBodySmall : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 6bc5d371f4..c658ed67f3 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -18,18 +18,12 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DesertScourge { [AutoloadBossHead] public class DesertScourgeHead : ModNPC { private bool flies = false; - private float speed = 15f; - private float turnSpeed = 0.15f; - private const int minLength = 30; - private const int maxLength = 31; private bool TailSpawned = false; public override void SetStaticDefaults() @@ -44,7 +38,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.width = 32; npc.height = 80; npc.LifeMaxNERB(2300, 2650, 16500000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; @@ -89,17 +83,31 @@ namespace CalamityMod.NPCs.DesertScourge bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - float speedMult = expertMode ? 1.5f : 1.45f; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - speedMult = 2f; - if (CalamityWorld.bossRushActive) - speedMult *= 2f; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; - float speedBoost = death ? speedMult : speedMult - ((float)npc.life / (float)npc.lifeMax); - speed = 13f * speedBoost; - turnSpeed = 0.13f * speedBoost; + float speed = 8f; + float turnSpeed = 0.08f; - if (npc.ai[3] > 0f) + if (expertMode) + { + speed += death ? 6f : 6f * (1f - lifeRatio); + turnSpeed += death ? 0.06f : 0.06f * (1f - lifeRatio); + } + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (CalamityWorld.bossRushActive) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } @@ -123,7 +131,8 @@ namespace CalamityMod.NPCs.DesertScourge if (!TailSpawned && npc.ai[0] == 0f) { int Previous = npc.whoAmI; - for (int num36 = 0; num36 < maxLength; num36++) + int minLength = expertMode ? 30 : 25; + for (int num36 = 0; num36 < minLength + 1; num36++) { int lol; if (num36 >= 0 && num36 < minLength) @@ -135,19 +144,19 @@ namespace CalamityMod.NPCs.DesertScourge lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; } } int num180 = (int)(npc.position.X / 16f) - 1; - int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num181 = (int)((npc.position.X + npc.width) / 16f) + 2; int num182 = (int)(npc.position.Y / 16f) - 1; - int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + int num183 = (int)((npc.position.Y + npc.height) / 16f) + 2; if (num180 < 0) { num180 = 0; @@ -189,7 +198,7 @@ namespace CalamityMod.NPCs.DesertScourge { npc.localAI[1] = 1f; Rectangle rectangle12 = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int num954 = (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 500 : 1000; + int num954 = (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 500 : 1000; if (CalamityWorld.bossRushActive) num954 /= 2; diff --git a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs index 15da651fb8..aa8e5e76d0 100644 --- a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.DesertScourge Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -245,7 +245,7 @@ namespace CalamityMod.NPCs.DesertScourge num195 = 20f; } npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1); } num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); float num196 = System.Math.Abs(num191); diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 1e82edee6e..84063668b7 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -1,15 +1,13 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DesertScourge { - public class DesertScourgeTail : ModNPC + public class DesertScourgeTail : ModNPC { public override void SetStaticDefaults() { @@ -23,9 +21,9 @@ namespace CalamityMod.NPCs.DesertScourge npc.width = 32; npc.height = 48; npc.defense = 9; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.LifeMaxNERB(2300, 2650, 16500000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/DesertScourge/DesertScourgeTailSmall.cs b/NPCs/DesertScourge/DesertScourgeTailSmall.cs index 851ef0dee4..9fd5a57d92 100644 --- a/NPCs/DesertScourge/DesertScourgeTailSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeTailSmall.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -6,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.DesertScourge { - public class DesertScourgeTailSmall : ModNPC + public class DesertScourgeTailSmall : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/DesertScourge/DriedSeekerBody.cs b/NPCs/DesertScourge/DriedSeekerBody.cs index ed7c199ef0..e9e86211b6 100644 --- a/NPCs/DesertScourge/DriedSeekerBody.cs +++ b/NPCs/DesertScourge/DriedSeekerBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/NPCs/DesertScourge/DriedSeekerHead.cs b/NPCs/DesertScourge/DriedSeekerHead.cs index 129dd243f0..27683c9688 100644 --- a/NPCs/DesertScourge/DriedSeekerHead.cs +++ b/NPCs/DesertScourge/DriedSeekerHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.DesertScourge Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; diff --git a/NPCs/DesertScourge/DriedSeekerTail.cs b/NPCs/DesertScourge/DriedSeekerTail.cs index f70424130b..e457c5fbc6 100644 --- a/NPCs/DesertScourge/DriedSeekerTail.cs +++ b/NPCs/DesertScourge/DriedSeekerTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index d41181a173..53d65a157f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -9,11 +9,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DevourerofGods { - public class DevourerofGodsBody : ModNPC + public class DevourerofGodsBody : ModNPC { private int invinceTime = 360; @@ -33,7 +31,7 @@ namespace CalamityMod.NPCs.DevourerofGods global.DR = CalamityWorld.death ? 0.95f : 0.925f; global.unbreakableDR = true; npc.LifeMaxNERB(675000, 750000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody2.cs b/NPCs/DevourerofGods/DevourerofGodsBody2.cs index 1e100a2eb9..49e7842aff 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.DevourerofGods global.DR = 0.5f; global.unbreakableDR = true; npc.lifeMax = 100000; - npc.aiStyle = 6; + npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; @@ -64,7 +64,8 @@ namespace CalamityMod.NPCs.DevourerofGods public override void AI() { - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (invinceTime > 0) { invinceTime--; @@ -76,13 +77,29 @@ namespace CalamityMod.NPCs.DevourerofGods npc.damage = npc.defDamage; npc.dontTakeDamage = false; } - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } - if (Main.npc[(int)npc.ai[1]].alpha < 128) + + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0 || npc.life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + + if (Main.npc[(int)npc.ai[1]].alpha < 128) { if (npc.alpha != 0) { @@ -96,7 +113,39 @@ namespace CalamityMod.NPCs.DevourerofGods npc.alpha = 0; } } - } + + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + int num194 = npc.width; + num193 = (num193 - num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs index 00aa11b5da..310a107306 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -7,11 +7,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DevourerofGods { - [AutoloadBossHead] + [AutoloadBossHead] public class DevourerofGodsBodyS : ModNPC { private int invinceTime = 360; @@ -33,7 +31,7 @@ namespace CalamityMod.NPCs.DevourerofGods global.DR = CalamityWorld.death ? 0.97f : 0.955f; global.unbreakableDR = true; npc.LifeMaxNERB(1150000, 1350000, 9200000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2c4b5c6d84..2d3962f967 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -24,7 +24,6 @@ namespace CalamityMod.NPCs.DevourerofGods private bool halfLife = false; private bool halfLife2 = false; private int spawnDoGCountdown = 0; - private int phaseSwitch = 0; public override void SetStaticDefaults() { @@ -39,8 +38,8 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 104; npc.defense = 50; npc.LifeMaxNERB(675000, 750000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; npc.aiStyle = -1; aiType = -1; @@ -69,7 +68,6 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(halfLife); writer.Write(halfLife2); writer.Write(spawnDoGCountdown); - writer.Write(phaseSwitch); } public override void ReceiveExtraAI(BinaryReader reader) @@ -77,11 +75,12 @@ namespace CalamityMod.NPCs.DevourerofGods halfLife = reader.ReadBoolean(); halfLife2 = reader.ReadBoolean(); spawnDoGCountdown = reader.ReadInt32(); - phaseSwitch = reader.ReadInt32(); } public override void AI() { + CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); + // whoAmI variable CalamityGlobalNPC.DoGHead = npc.whoAmI; @@ -96,7 +95,7 @@ namespace CalamityMod.NPCs.DevourerofGods bool death = CalamityWorld.death; // Percent life remaining - float lifeRatio = (float)npc.life / (float)npc.lifeMax; + float lifeRatio = npc.life / (float)npc.lifeMax; // Light Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); @@ -133,7 +132,9 @@ namespace CalamityMod.NPCs.DevourerofGods spawnDoGCountdown--; if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) { - for (int i = 0; i < 2; i++) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerSpawn"), (int)player.position.X, (int)player.position.Y); + + for (int i = 0; i < 2; i++) NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); } } @@ -150,7 +151,10 @@ namespace CalamityMod.NPCs.DevourerofGods if (spawnDoGCountdown > 0) { spawnDoGCountdown--; - if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerSpawn"), (int)player.position.X, (int)player.position.Y); + + if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); } } @@ -192,7 +196,7 @@ namespace CalamityMod.NPCs.DevourerofGods Main.npc[segment].ai[2] = (float)npc.whoAmI; Main.npc[segment].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)segment; - NetMessage.SendData(23, -1, -1, null, segment, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment, 0f, 0f, 0f, 0); Previous = segment; } tail = true; @@ -251,7 +255,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Flying movement npc.localAI[1] = 0f; - phaseSwitch += 1; + calamityGlobalNPC.newAI[2] += 1f; float speed = death ? 16.5f : 15f; float turnSpeed = death ? 0.33f : 0.3f; @@ -260,7 +264,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - phaseSwitch += (int)(9f * (1f - lifeRatio)); + calamityGlobalNPC.newAI[2] += 9f * (1f - lifeRatio); speed += 3f * (1f - lifeRatio); turnSpeed += 0.06f * (1f - lifeRatio); @@ -270,7 +274,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Go to ground phase sooner if (Vector2.Distance(player.Center, vector) > 5600f) - phaseSwitch += 10; + calamityGlobalNPC.newAI[2] += 10f; float num188 = speed; float num189 = turnSpeed; @@ -452,10 +456,10 @@ namespace CalamityMod.NPCs.DevourerofGods npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; - if (phaseSwitch > 900) + if (calamityGlobalNPC.newAI[2] > 900f) { npc.ai[2] = 1f; - phaseSwitch = 0; + calamityGlobalNPC.newAI[2] = 0f; npc.netUpdate = true; } } @@ -469,7 +473,7 @@ namespace CalamityMod.NPCs.DevourerofGods Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); } - phaseSwitch += 1; + calamityGlobalNPC.newAI[2] += 1f; float fallSpeed = death ? 17.75f : 16f; float speed = death ? 0.22f : 0.18f; @@ -599,11 +603,11 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - maximumSpeed1 += (double)(0.08f * (1f - lifeRatio)); - maximumSpeed2 += (double)(0.16f * (1f - lifeRatio)); + maximumSpeed1 += 0.08f * (1f - lifeRatio); + maximumSpeed2 += 0.16f * (1f - lifeRatio); } - num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); + num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21); float num25 = Math.Abs(num20); float num26 = Math.Abs(num21); float num27 = fallSpeed / num22; @@ -634,14 +638,14 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.Y > num21) npc.velocity.Y -= speed; - if ((double)Math.Abs(num21) < (double)fallSpeed * maximumSpeed1 && ((npc.velocity.X > 0f && num20 < 0f) || (npc.velocity.X < 0f && num20 > 0f))) + if (Math.Abs(num21) < fallSpeed * maximumSpeed1 && ((npc.velocity.X > 0f && num20 < 0f) || (npc.velocity.X < 0f && num20 > 0f))) { if (npc.velocity.Y > 0f) npc.velocity.Y += speed * 2f; else npc.velocity.Y -= speed * 2f; } - if ((double)Math.Abs(num20) < (double)fallSpeed * maximumSpeed1 && ((npc.velocity.Y > 0f && num21 < 0f) || (npc.velocity.Y < 0f && num21 > 0f))) + if (Math.Abs(num20) < fallSpeed * maximumSpeed1 && ((npc.velocity.Y > 0f && num21 < 0f) || (npc.velocity.Y < 0f && num21 > 0f))) { if (npc.velocity.X > 0f) npc.velocity.X += speed * 2f; @@ -656,7 +660,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.X > num20) npc.velocity.X -= speed * 1.1f; - if ((double)(Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < (double)fallSpeed * maximumSpeed2) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * maximumSpeed2) { if (npc.velocity.Y > 0f) npc.velocity.Y += speed; @@ -671,7 +675,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.Y > num21) npc.velocity.Y -= speed * 1.1f; - if ((double)(Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < (double)fallSpeed * maximumSpeed2) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * maximumSpeed2) { if (npc.velocity.X > 0f) npc.velocity.X += speed; @@ -681,7 +685,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; if (flies) { @@ -701,10 +705,10 @@ namespace CalamityMod.NPCs.DevourerofGods if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) npc.netUpdate = true; - if (phaseSwitch > 900) + if (calamityGlobalNPC.newAI[2] > 900f) { npc.ai[2] = 0f; - phaseSwitch = 0; + calamityGlobalNPC.newAI[2] = 0f; npc.netUpdate = true; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead2.cs b/NPCs/DevourerofGods/DevourerofGodsHead2.cs index 909c6114c2..fdc938723f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,9 +12,8 @@ namespace CalamityMod.NPCs.DevourerofGods public class DevourerofGodsHead2 : ModNPC { private bool tail = false; - private bool flies = false; - private const int minLength = 15; - private const int maxLength = 16; + private const int minLength = 10; + private const int maxLength = 11; private int invinceTime = 180; public override void SetStaticDefaults() @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 76; npc.defense = 40; npc.lifeMax = 100000; - npc.aiStyle = 6; + npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; @@ -66,11 +66,6 @@ namespace CalamityMod.NPCs.DevourerofGods Player player = Main.player[npc.target]; - float playerRunAcceleration = player.velocity.Y == 0f ? Math.Abs(player.moveSpeed * 0.3f) : (player.runAcceleration * 0.8f); - if (playerRunAcceleration <= 1f) - { - playerRunAcceleration = 1f; - } if (invinceTime > 0) { invinceTime--; @@ -82,24 +77,29 @@ namespace CalamityMod.NPCs.DevourerofGods npc.damage = npc.defDamage; npc.dontTakeDamage = false; } + Vector2 vector = npc.Center; - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } - npc.velocity.Length(); + if (npc.alpha != 0) { int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num935].noGravity = true; Main.dust[num935].noLight = true; } + npc.alpha -= 12; if (npc.alpha < 0) { npc.alpha = 0; } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) @@ -117,9 +117,9 @@ namespace CalamityMod.NPCs.DevourerofGods segment = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } Main.npc[segment].realLife = npc.whoAmI; - Main.npc[segment].ai[2] = (float)npc.whoAmI; - Main.npc[segment].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)segment; + Main.npc[segment].ai[2] = npc.whoAmI; + Main.npc[segment].ai[1] = Previous; + Main.npc[Previous].ai[0] = segment; npc.netUpdate = true; Previous = segment; } @@ -127,12 +127,13 @@ namespace CalamityMod.NPCs.DevourerofGods } if (!npc.active && Main.netMode == NetmodeID.Server) { - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } + if (CalamityGlobalNPC.DoGHead < 0 || !Main.npc[CalamityGlobalNPC.DoGHead].active) { - for (int num569 = 0; num569 < 200; num569++) + for (int num569 = 0; num569 < Main.maxNPCs; num569++) { if (Main.npc[num569].active && (Main.npc[num569].type == ModContent.NPCType() || Main.npc[num569].type == ModContent.NPCType() || Main.npc[num569].type == ModContent.NPCType())) { @@ -140,10 +141,10 @@ namespace CalamityMod.NPCs.DevourerofGods } } } + if (player.dead) { npc.TargetClosest(false); - flies = true; npc.velocity.Y = npc.velocity.Y - 3f; if ((double)npc.position.Y < Main.topWorld + 16f) { @@ -151,7 +152,7 @@ namespace CalamityMod.NPCs.DevourerofGods } if ((double)npc.position.Y < Main.topWorld + 16f) { - for (int a = 0; a < 200; a++) + for (int a = 0; a < Main.maxNPCs; a++) { if (Main.npc[a].aiStyle == npc.aiStyle) { @@ -160,272 +161,159 @@ namespace CalamityMod.NPCs.DevourerofGods } } } - int num180 = (int)(npc.position.X / 16f) - 1; - int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; - int num182 = (int)(npc.position.Y / 16f) - 1; - int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; - if (num180 < 0) - { - num180 = 0; - } - if (num181 > Main.maxTilesX) - { - num181 = Main.maxTilesX; - } - if (num182 < 0) - { - num182 = 0; - } - if (num183 > Main.maxTilesY) - { - num183 = Main.maxTilesY; - } - float speed = playerRunAcceleration * 16f; - float turnSpeed = playerRunAcceleration * 0.23f; - if (Vector2.Distance(player.Center, vector) > 3000f) //RAGE - { - speed = playerRunAcceleration * 60f; - turnSpeed = playerRunAcceleration * 0.8f; - } - if (!flies) - { - for (int num952 = num180; num952 < num181; num952++) - { - for (int num953 = num182; num953 < num183; num953++) - { - if (Main.tile[num952, num953] != null && ((Main.tile[num952, num953].nactive() && (Main.tileSolid[(int)Main.tile[num952, num953].type] || (Main.tileSolidTop[(int)Main.tile[num952, num953].type] && Main.tile[num952, num953].frameY == 0))) || Main.tile[num952, num953].liquid > 64)) - { - Vector2 vector105; - vector105.X = (float)(num952 * 16); - vector105.Y = (float)(num953 * 16); - if (npc.position.X + (float)npc.width > vector105.X && npc.position.X < vector105.X + 16f && npc.position.Y + (float)npc.height > vector105.Y && npc.position.Y < vector105.Y + 16f) - { - flies = true; - break; - } - } - } - } - } - if (!flies) - { - npc.localAI[1] = 1f; - Rectangle rectangle12 = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int num954 = 1000; - bool flag95 = true; - if (npc.position.Y > player.position.Y) - { - for (int num955 = 0; num955 < 255; num955++) - { - if (Main.player[num955].active) - { - Rectangle rectangle13 = new Rectangle((int)Main.player[num955].position.X - num954, (int)Main.player[num955].position.Y - num954, num954 * 2, num954 * 2); - if (rectangle12.Intersects(rectangle13)) - { - flag95 = false; - break; - } - } - } - if (flag95) - { - flies = true; - } - } - } - float num188 = speed; - float num189 = turnSpeed; - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = player.position.X + (float)(player.width / 2); - float num192 = player.position.Y + (float)(player.height / 2); - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); - num191 -= vector18.X; - num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - if (!flies) - { - npc.TargetClosest(true); - npc.velocity.Y = npc.velocity.Y + (turnSpeed * 0.5f); - if (npc.velocity.Y > num188) - { - npc.velocity.Y = num188; - } - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.4) - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X - num189 * 1.1f; - } - else - { - npc.velocity.X = npc.velocity.X + num189 * 1.1f; - } - } - else if (npc.velocity.Y == num188) - { - if (npc.velocity.X < num191) - { - npc.velocity.X = npc.velocity.X + num189; - } - else if (npc.velocity.X > num191) - { - npc.velocity.X = npc.velocity.X - num189; - } - } - else if (npc.velocity.Y > 4f) - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X + num189 * 0.9f; - } - else - { - npc.velocity.X = npc.velocity.X - num189 * 0.9f; - } - } - } - else - { - if (!flies && npc.behindTiles && npc.soundDelay == 0) - { - float num195 = num193 / 40f; - if (num195 < 10f) - { - num195 = 10f; - } - if (num195 > 20f) - { - num195 = 20f; - } - npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); - } - num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - float num196 = System.Math.Abs(num191); - float num197 = System.Math.Abs(num192); - float num198 = num188 / num193; - num191 *= num198; - num192 *= num198; - if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) - { - if (npc.velocity.X < num191) - { - npc.velocity.X = npc.velocity.X + num189; - } - else - { - if (npc.velocity.X > num191) - { - npc.velocity.X = npc.velocity.X - num189; - } - } - if (npc.velocity.Y < num192) - { - npc.velocity.Y = npc.velocity.Y + num189; - } - else - { - if (npc.velocity.Y > num192) - { - npc.velocity.Y = npc.velocity.Y - num189; - } - } - if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num189 * 2f; - } - else - { - npc.velocity.Y = npc.velocity.Y - num189 * 2f; - } - } - if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + num189 * 2f; - } - else - { - npc.velocity.X = npc.velocity.X - num189 * 2f; - } - } - } - else - { - if (num196 > num197) - { - if (npc.velocity.X < num191) - { - npc.velocity.X = npc.velocity.X + num189 * 1.1f; - } - else if (npc.velocity.X > num191) - { - npc.velocity.X = npc.velocity.X - num189 * 1.1f; - } - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num189; - } - else - { - npc.velocity.Y = npc.velocity.Y - num189; - } - } - } - else - { - if (npc.velocity.Y < num192) - { - npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; - } - else if (npc.velocity.Y > num192) - { - npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; - } - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + num189; - } - else - { - npc.velocity.X = npc.velocity.X - num189; - } - } - } - } - } - npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; - if (flies) - { - if (npc.localAI[0] != 1f) - { - npc.netUpdate = true; - } - npc.localAI[0] = 1f; - } - else - { - if (npc.localAI[0] != 0f) - { - npc.netUpdate = true; - } - npc.localAI[0] = 0f; - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; - } - } + + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + float num188 = CalamityWorld.revenge ? 16f : 14f; + float num189 = CalamityWorld.revenge ? 0.15f : 0.13f; + + if (Vector2.Distance(player.Center, vector) > 3000f) //RAGE + { + num188 *= 2f; + num189 *= 2f; + } + + for (int num52 = 0; num52 < Main.maxNPCs; num52++) + { + if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) + { + Vector2 vector4 = Main.npc[num52].Center - npc.Center; + if (vector4.Length() < 60f) + { + vector4.Normalize(); + vector4 *= 200f; + num191 -= vector4.X; + num192 -= vector4.Y; + } + } + } + + float num48 = num188 * 1.3f; + float num49 = num188 * 0.7f; + float num50 = npc.velocity.Length(); + if (num50 > 0f) + { + if (num50 > num48) + { + npc.velocity.Normalize(); + npc.velocity *= num48; + } + else if (num50 < num49) + { + npc.velocity.Normalize(); + npc.velocity *= num49; + } + } + + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + float num196 = Math.Abs(num191); + float num197 = Math.Abs(num192); + float num198 = num188 / num193; + num191 *= num198; + num192 *= num198; + if ((npc.velocity.X > 0f && num191 > 0f) || (npc.velocity.X < 0f && num191 < 0f) || (npc.velocity.Y > 0f && num192 > 0f) || (npc.velocity.Y < 0f && num192 < 0f)) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189; + } + } + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + if (Math.Abs(num192) < num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189 * 2f; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189 * 2f; + } + } + if (Math.Abs(num191) < num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189 * 2f; //changed from 2 + } + else + { + npc.velocity.X = npc.velocity.X - num189 * 2f; //changed from 2 + } + } + } + else + { + if (num196 > num197) + { + if (npc.velocity.X < num191) + { + npc.velocity.X = npc.velocity.X + num189 * 1.1f; //changed from 1.1 + } + else if (npc.velocity.X > num191) + { + npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 + } + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num189; + } + else + { + npc.velocity.Y = npc.velocity.Y - num189; + } + } + } + else + { + if (npc.velocity.Y < num192) + { + npc.velocity.Y = npc.velocity.Y + num189 * 1.1f; + } + else if (npc.velocity.Y > num192) + { + npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; + } + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + num189; + } + else + { + npc.velocity.X = npc.velocity.X - num189; + } + } + } + } + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 5677ed9544..5a909d611e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -24,8 +24,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DevourerofGods { @@ -36,14 +34,12 @@ namespace CalamityMod.NPCs.DevourerofGods private const int minLength = 100; private const int maxLength = 101; private bool halfLife = false; - private int laserShoot = 0; - private int phaseSwitch = 0; private int[] shotSpacing = new int[4] { 1050, 1050, 1050, 1050 }; private const int spacingVar = 105; private const int totalShots = 20; - private int idleCounter = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 540 : 360; + private const int idleCounterMax = 360; + private int idleCounter = idleCounterMax; public int laserWallPhase = 0; - private int laserWallCounter = 0; private int postTeleportTimer = 0; public override void SetStaticDefaults() @@ -59,7 +55,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 186; npc.defense = 50; npc.LifeMaxNERB(1150000, 1350000, 9200000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; npc.aiStyle = -1; @@ -89,15 +85,12 @@ namespace CalamityMod.NPCs.DevourerofGods { writer.Write(npc.dontTakeDamage); writer.Write(halfLife); - writer.Write(laserShoot); - writer.Write(phaseSwitch); writer.Write(shotSpacing[0]); writer.Write(shotSpacing[1]); writer.Write(shotSpacing[2]); writer.Write(shotSpacing[3]); writer.Write(idleCounter); writer.Write(laserWallPhase); - writer.Write(laserWallCounter); writer.Write(postTeleportTimer); } @@ -105,15 +98,12 @@ namespace CalamityMod.NPCs.DevourerofGods { npc.dontTakeDamage = reader.ReadBoolean(); halfLife = reader.ReadBoolean(); - laserShoot = reader.ReadInt32(); - phaseSwitch = reader.ReadInt32(); shotSpacing[0] = reader.ReadInt32(); shotSpacing[1] = reader.ReadInt32(); shotSpacing[2] = reader.ReadInt32(); shotSpacing[3] = reader.ReadInt32(); idleCounter = reader.ReadInt32(); laserWallPhase = reader.ReadInt32(); - laserWallCounter = reader.ReadInt32(); postTeleportTimer = reader.ReadInt32(); } @@ -130,7 +120,7 @@ namespace CalamityMod.NPCs.DevourerofGods CalamityGlobalNPC.DoGHead = npc.whoAmI; // Percent life remaining - float lifeRatio = (float)npc.life / (float)npc.lifeMax; + float lifeRatio = npc.life / (float)npc.lifeMax; // Variables Vector2 vector = npc.Center; @@ -143,7 +133,7 @@ namespace CalamityMod.NPCs.DevourerofGods bool breathFireMore = lifeRatio < 0.15 || death; // Light - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); // Worm shit again if (npc.ai[3] > 0f) @@ -155,9 +145,6 @@ namespace CalamityMod.NPCs.DevourerofGods Player player = Main.player[npc.target]; - // Velocity - npc.velocity.Length(); - float distanceFromTarget = Vector2.Distance(player.Center, vector); bool tooFarAway = distanceFromTarget > 5600f; @@ -171,10 +158,10 @@ namespace CalamityMod.NPCs.DevourerofGods { if (Main.netMode != NetmodeID.MultiplayerClient) { - laserWallCounter += 1; - if (laserWallCounter >= 720) + calamityGlobalNPC.newAI[3] += 1f; + if (calamityGlobalNPC.newAI[3] >= 720f) { - laserWallCounter = 0; + calamityGlobalNPC.newAI[3] = 0f; laserWallPhase = 1; } } @@ -183,7 +170,7 @@ namespace CalamityMod.NPCs.DevourerofGods { npc.alpha += 5; if (npc.alpha == 255) - laserShoot = 0; + calamityGlobalNPC.newAI[1] = 0f; if (npc.alpha >= 255) { @@ -192,7 +179,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (idleCounter <= 0) { laserWallPhase = 2; - idleCounter = death ? 540 : 360; + idleCounter = idleCounterMax; } } } @@ -264,10 +251,10 @@ namespace CalamityMod.NPCs.DevourerofGods segment = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); Main.npc[segment].realLife = npc.whoAmI; - Main.npc[segment].ai[2] = (float)npc.whoAmI; - Main.npc[segment].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)segment; - NetMessage.SendData(23, -1, -1, null, segment, 0f, 0f, 0f, 0); + Main.npc[segment].ai[2] = npc.whoAmI; + Main.npc[segment].ai[1] = Previous; + Main.npc[Previous].ai[0] = segment; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment, 0f, 0f, 0f, 0); Previous = segment; } tail = true; @@ -281,15 +268,15 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[0] += 1f; if (calamityGlobalNPC.newAI[0] >= 150f && calamityGlobalNPC.newAI[0] % (breathFireMore ? 60f : 120f) == 0f) { - Vector2 vector44 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num427 = player.position.X + (float)(player.width / 2) - vector44.X; - float num428 = player.position.Y + (float)(player.height / 2) - vector44.Y; + Vector2 vector44 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num427 = player.position.X + (player.width / 2) - vector44.X; + float num428 = player.position.Y + (player.height / 2) - vector44.Y; if (Main.netMode != NetmodeID.MultiplayerClient) { float num430 = 16f; int num432 = ModContent.ProjectileType(); - float num429 = (float)Math.Sqrt((double)(num427 * num427 + num428 * num428)); + float num429 = (float)Math.Sqrt(num427 * num427 + num428 * num428); num429 = num430 / num429; num427 *= num429; num428 *= num429; @@ -306,57 +293,73 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[0] = 0f; // Laser walls - if (!speedBoost2 && (laserWallPhase == 1 || calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive))) + if (!speedBoost2 && (laserWallPhase == 1 || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive))) { - laserShoot += 1; + calamityGlobalNPC.newAI[1] += 1f; float speed = 10.5f; float spawnOffsetX = 1900f; float spawnOffsetY = 1000f; - int divisor = CalamityWorld.bossRushActive ? 90 : 120; + float divisor = 120f; - if (laserShoot % divisor == 0) - { - Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 12); + if (calamityGlobalNPC.newAI[1] % divisor == 0f) + { + if (calamityGlobalNPC.newAI[1] % idleCounterMax == 0f) + { + int cosmicGuardianCount = NPC.CountNPCS(ModContent.NPCType()); + if (cosmicGuardianCount < 2) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerSpawn"), (int)player.position.X, (int)player.position.Y); - float targetPosY = player.position.Y + (Main.rand.NextBool(2) ? 50f : 0f); + int spawnAmt = cosmicGuardianCount == 0 ? 2 : 1; - // Side walls - for (int x = 0; x < totalShots; x++) - { - Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + (float)shotSpacing[0], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + (float)shotSpacing[0], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[0] -= spacingVar; - } + for (int i = 0; i < spawnAmt; i++) + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); + } + } + else + { + Main.PlaySound(SoundID.Item12, player.position); - if (Main.rand.NextBool(2) && revenge) - { - for (int x = 0; x < 10; x++) - { - Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + (float)shotSpacing[3], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + (float)shotSpacing[3], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[3] -= Main.rand.NextBool(2) ? 180 : 200; - } - shotSpacing[3] = 1050; - } - shotSpacing[0] = 1050; + float targetPosY = player.position.Y + (Main.rand.NextBool(2) ? 50f : 0f); - // Lower wall - for (int x = 0; x < totalShots; x++) - { - Projectile.NewProjectile(player.position.X + (float)shotSpacing[1], player.position.Y + spawnOffsetY, 0f, -speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[1] -= spacingVar; - } - shotSpacing[1] = 1050; + // Side walls + for (int x = 0; x < totalShots; x++) + { + Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + shotSpacing[0], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + shotSpacing[0], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + shotSpacing[0] -= spacingVar; + } - // Upper wall - for (int x = 0; x < totalShots; x++) - { - Projectile.NewProjectile(player.position.X + (float)shotSpacing[2], player.position.Y - spawnOffsetY, 0f, speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[2] -= spacingVar; - } - shotSpacing[2] = 1050; - } + if (Main.rand.NextBool(2) && revenge) + { + for (int x = 0; x < 10; x++) + { + Projectile.NewProjectile(player.position.X + spawnOffsetX, targetPosY + shotSpacing[3], -speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - spawnOffsetX, targetPosY + shotSpacing[3], speed, 0f, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + shotSpacing[3] -= Main.rand.NextBool(2) ? 180 : 200; + } + shotSpacing[3] = 1050; + } + shotSpacing[0] = 1050; + + // Lower wall + for (int x = 0; x < totalShots; x++) + { + Projectile.NewProjectile(player.position.X + shotSpacing[1], player.position.Y + spawnOffsetY, 0f, -speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + shotSpacing[1] -= spacingVar; + } + shotSpacing[1] = 1050; + + // Upper wall + for (int x = 0; x < totalShots; x++) + { + Projectile.NewProjectile(player.position.X + shotSpacing[2], player.position.Y - spawnOffsetY, 0f, speed, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + shotSpacing[2] -= spacingVar; + } + shotSpacing[2] = 1050; + } + } } } @@ -391,9 +394,9 @@ namespace CalamityMod.NPCs.DevourerofGods // Movement int num180 = (int)(npc.position.X / 16f) - 1; - int num181 = (int)((npc.position.X + (float)npc.width) / 16f) + 2; + int num181 = (int)((npc.position.X + npc.width) / 16f) + 2; int num182 = (int)(npc.position.Y / 16f) - 1; - int num183 = (int)((npc.position.Y + (float)npc.height) / 16f) + 2; + int num183 = (int)((npc.position.Y + npc.height) / 16f) + 2; if (num180 < 0) num180 = 0; @@ -418,7 +421,7 @@ namespace CalamityMod.NPCs.DevourerofGods Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); } - phaseSwitch += 1; + calamityGlobalNPC.newAI[2] += 1f; npc.localAI[1] = 0f; @@ -447,20 +450,20 @@ namespace CalamityMod.NPCs.DevourerofGods if (revenge && laserWallPhase == 0 && !player.dead && player.active) Teleport(player); else - phaseSwitch += 10; + calamityGlobalNPC.newAI[2] += 10f; } float num188 = speed; float num189 = turnSpeed; - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = player.position.X + (float)(player.width / 2); - float num192 = player.position.Y + (float)(player.height / 2); + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); int num42 = -1; int num43 = (int)(player.Center.X / 16f); int num44 = (int)(player.Center.Y / 16f); // Charge at target for 1.5 seconds - bool flyAtTarget = (!speedBoost || speedBoost2) && phaseSwitch > phaseLimit - 90 && revenge; + bool flyAtTarget = (!speedBoost || speedBoost2) && calamityGlobalNPC.newAI[2] > phaseLimit - 90 && revenge; for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) { @@ -481,7 +484,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (num42 > 0) { num42 *= 16; - float num47 = (float)(num42 - 800); + float num47 = num42 - 800; if (player.position.Y > num47) { num192 = num47; @@ -518,53 +521,15 @@ namespace CalamityMod.NPCs.DevourerofGods } } - if (!flyAtTarget) - { - if (num42 > 0) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } - - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - float num196 = System.Math.Abs(num191); - float num197 = System.Math.Abs(num192); + float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + float num196 = Math.Abs(num191); + float num197 = Math.Abs(num192); float num198 = num188 / num193; num191 *= num198; num192 *= num198; @@ -587,7 +552,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.velocity.Y -= num189; } - if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + if (Math.Abs(num192) < num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) { if (npc.velocity.Y > 0f) npc.velocity.Y += num189 * 2f; @@ -595,7 +560,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.velocity.Y -= num189 * 2f; } - if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + if (Math.Abs(num191) < num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) { if (npc.velocity.X > 0f) npc.velocity.X += num189 * 2f; @@ -612,7 +577,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.X > num191) npc.velocity.X -= num189 * 1.1f; - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.Y > 0f) npc.velocity.Y += num189; @@ -627,7 +592,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.Y > num192) npc.velocity.Y -= num189 * 1.1f; - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.X > 0f) npc.velocity.X += num189; @@ -637,12 +602,12 @@ namespace CalamityMod.NPCs.DevourerofGods } } - npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; - if (phaseSwitch > phaseLimit) + if (calamityGlobalNPC.newAI[2] > phaseLimit) { npc.ai[2] = 1f; - phaseSwitch = 0; + calamityGlobalNPC.newAI[2] = 0f; npc.netUpdate = true; } } @@ -656,7 +621,7 @@ namespace CalamityMod.NPCs.DevourerofGods Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); } - phaseSwitch += 1; + calamityGlobalNPC.newAI[2] += 1f; float turnSpeed = death ? 0.24f : 0.18f; @@ -682,12 +647,12 @@ namespace CalamityMod.NPCs.DevourerofGods { for (int num953 = num182; num953 < num183; num953++) { - if (Main.tile[num952, num953] != null && ((Main.tile[num952, num953].nactive() && (Main.tileSolid[(int)Main.tile[num952, num953].type] || (Main.tileSolidTop[(int)Main.tile[num952, num953].type] && Main.tile[num952, num953].frameY == 0))) || Main.tile[num952, num953].liquid > 64)) + if (Main.tile[num952, num953] != null && ((Main.tile[num952, num953].nactive() && (Main.tileSolid[Main.tile[num952, num953].type] || (Main.tileSolidTop[Main.tile[num952, num953].type] && Main.tile[num952, num953].frameY == 0))) || Main.tile[num952, num953].liquid > 64)) { Vector2 vector105; - vector105.X = (float)(num952 * 16); - vector105.Y = (float)(num953 * 16); - if (npc.position.X + (float)npc.width > vector105.X && npc.position.X < vector105.X + 16f && npc.position.Y + (float)npc.height > vector105.Y && npc.position.Y < vector105.Y + 16f) + vector105.X = num952 * 16; + vector105.Y = num953 * 16; + if (npc.position.X + npc.width > vector105.X && npc.position.X < vector105.X + 16f && npc.position.Y + npc.height > vector105.Y && npc.position.Y < vector105.Y + 16f) { flies = true; break; @@ -736,16 +701,16 @@ namespace CalamityMod.NPCs.DevourerofGods npc.localAI[1] = 0f; float num189 = turnSpeed; - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = player.position.X + (float)(player.width / 2); - float num192 = player.position.Y + (float)(player.height / 2); - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = player.position.X + (player.width / 2); + float num192 = player.position.Y + (player.height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); if (!flies) { @@ -755,7 +720,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (npc.velocity.Y > fallSpeed) npc.velocity.Y = fallSpeed; - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)fallSpeed * 2.2) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * 2.2) { if (npc.velocity.X < 0f) npc.velocity.X -= num189 * 1.1f; @@ -790,11 +755,11 @@ namespace CalamityMod.NPCs.DevourerofGods if (expertMode) { - maximumSpeed1 += (double)(0.12f * (1f - lifeRatio)); - maximumSpeed2 += (double)(0.25f * (1f - lifeRatio)); + maximumSpeed1 += 0.12f * (1f - lifeRatio); + maximumSpeed2 += 0.25f * (1f - lifeRatio); } - num193 = (float)Math.Sqrt((double)(num191 * num191 + num192 * num192)); + num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); float num25 = Math.Abs(num191); float num26 = Math.Abs(num192); float num27 = fallSpeed / num193; @@ -826,7 +791,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.Y > num192) npc.velocity.Y -= turnSpeed; - if ((double)Math.Abs(num192) < (double)fallSpeed * maximumSpeed1 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + if (Math.Abs(num192) < fallSpeed * maximumSpeed1 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) { if (npc.velocity.Y > 0f) npc.velocity.Y += turnSpeed * 2f; @@ -834,7 +799,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.velocity.Y -= turnSpeed * 2f; } - if ((double)Math.Abs(num191) < (double)fallSpeed * maximumSpeed1 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + if (Math.Abs(num191) < fallSpeed * maximumSpeed1 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) { if (npc.velocity.X > 0f) npc.velocity.X += turnSpeed * 2f; @@ -849,7 +814,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.X > num191) npc.velocity.X -= turnSpeed * 1.1f; - if ((double)(Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < (double)fallSpeed * maximumSpeed2) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * maximumSpeed2) { if (npc.velocity.Y > 0f) npc.velocity.Y += turnSpeed; @@ -864,7 +829,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (npc.velocity.Y > num192) npc.velocity.Y -= turnSpeed * 1.1f; - if ((double)(Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < (double)fallSpeed * maximumSpeed2) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < fallSpeed * maximumSpeed2) { if (npc.velocity.X > 0f) npc.velocity.X += turnSpeed; @@ -874,7 +839,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; if (flies) { @@ -894,10 +859,10 @@ namespace CalamityMod.NPCs.DevourerofGods if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) npc.netUpdate = true; - if (phaseSwitch > (death ? 600 : 900)) + if (calamityGlobalNPC.newAI[2] > (death ? 600f : 900f)) { npc.ai[2] = 0f; - phaseSwitch = 0; + calamityGlobalNPC.newAI[2] = 0f; npc.netUpdate = true; } } @@ -941,8 +906,8 @@ namespace CalamityMod.NPCs.DevourerofGods int x2 = x + 50; int y2 = y + 50; - float locationX = (float)Main.rand.Next(x, x2); - float locationY = (float)Main.rand.Next(y, y2); + float locationX = Main.rand.Next(x, x2); + float locationY = Main.rand.Next(y, y2); Vector2 teleportLocation = new Vector2(locationX, locationY); npc.position = teleportLocation; @@ -961,7 +926,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - Vector2 npcCenter = new Vector2(npc.position.X + (float)(npc.width / 2), npc.position.Y + (float)(npc.height / 2)); + Vector2 npcCenter = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeMechGaussRifle"), (int)npcCenter.X, (int)npcCenter.Y); int dustAmt = 50; @@ -972,14 +937,14 @@ namespace CalamityMod.NPCs.DevourerofGods random += j * 2; int dustAmtSpawned = 0; int scale = random * 13; - float dustPositionX = npcCenter.X - (float)(scale / 2); - float dustPositionY = npcCenter.Y - (float)(scale / 2); + float dustPositionX = npcCenter.X - (scale / 2); + float dustPositionY = npcCenter.Y - (scale / 2); while (dustAmtSpawned < dustAmt) { - float dustVelocityX = (float)Main.rand.Next(-random, random); - float dustVelocityY = (float)Main.rand.Next(-random, random); - float dustVelocityScalar = (float)random * 2f; - float dustVelocity = (float)Math.Sqrt((double)(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY)); + float dustVelocityX = Main.rand.Next(-random, random); + float dustVelocityY = Main.rand.Next(-random, random); + float dustVelocityScalar = random * 2f; + float dustVelocity = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY); dustVelocity = dustVelocityScalar / dustVelocity; dustVelocityX *= dustVelocity; dustVelocityY *= dustVelocity; @@ -987,8 +952,8 @@ namespace CalamityMod.NPCs.DevourerofGods Main.dust[dust].noGravity = true; Main.dust[dust].position.X = teleportLocation.X; Main.dust[dust].position.Y = teleportLocation.Y; - Main.dust[dust].position.X += (float)Main.rand.Next(-10, 11); - Main.dust[dust].position.Y += (float)Main.rand.Next(-10, 11); + Main.dust[dust].position.X += Main.rand.Next(-10, 11); + Main.dust[dust].position.Y += Main.rand.Next(-10, 11); Main.dust[dust].velocity.X = dustVelocityX; Main.dust[dust].velocity.Y = dustVelocityY; dustAmtSpawned++; @@ -1003,10 +968,10 @@ namespace CalamityMod.NPCs.DevourerofGods spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); @@ -1198,12 +1163,12 @@ namespace CalamityMod.NPCs.DevourerofGods Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGS"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGS2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGS5"), 1f); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 50; npc.height = 50; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); @@ -1211,7 +1176,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 30; num623++) diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 48e1692ff4..d6706e9658 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -1,18 +1,15 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DevourerofGods { - [AutoloadBossHead] + [AutoloadBossHead] public class DevourerofGodsTail : ModNPC { public override void SetStaticDefaults() @@ -28,7 +25,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 66; npc.defense = 50; npc.LifeMaxNERB(675000, 750000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail2.cs b/NPCs/DevourerofGods/DevourerofGodsTail2.cs index 807acfabde..b30a865677 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 50; npc.defense = 70; npc.lifeMax = 100000; - npc.aiStyle = 6; + npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; @@ -61,7 +61,8 @@ namespace CalamityMod.NPCs.DevourerofGods public override void AI() { - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (invinceTime > 0) { invinceTime--; @@ -73,13 +74,29 @@ namespace CalamityMod.NPCs.DevourerofGods npc.damage = npc.defDamage; npc.dontTakeDamage = false; } - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } - if (Main.npc[(int)npc.ai[1]].alpha < 128) + + if (npc.ai[3] > 0f) + { + npc.realLife = (int)npc.ai[3]; + } + + bool flag = false; + if (npc.ai[1] <= 0f) + { + flag = true; + } + else if (Main.npc[(int)npc.ai[1]].life <= 0 || npc.life <= 0) + { + flag = true; + } + if (flag) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.checkDead(); + } + + if (Main.npc[(int)npc.ai[1]].alpha < 128) { if (npc.alpha != 0) { @@ -93,7 +110,39 @@ namespace CalamityMod.NPCs.DevourerofGods npc.alpha = 0; } } - } + + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; + num191 -= vector18.X; + num192 -= vector18.Y; + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + } + catch + { + } + npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + int num194 = npc.width; + num193 = (num193 - num194) / num193; + num191 *= num193; + num192 *= num193; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + num191; + npc.position.Y = npc.position.Y + num192; + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTailS.cs b/NPCs/DevourerofGods/DevourerofGodsTailS.cs index a56aa64f80..0efaec6923 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTailS.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -7,12 +7,10 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.DevourerofGods { - [AutoloadBossHead] + [AutoloadBossHead] public class DevourerofGodsTailS : ModNPC { private int invinceTime = 720; @@ -36,7 +34,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 140; npc.defense = 50; npc.LifeMaxNERB(1150000, 1350000, 9200000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; npc.aiStyle = -1; diff --git a/NPCs/DevourerofGods/DoGSky.cs b/NPCs/DevourerofGods/DoGSky.cs index c6d9b27812..c4938af624 100644 --- a/NPCs/DevourerofGods/DoGSky.cs +++ b/NPCs/DevourerofGods/DoGSky.cs @@ -27,12 +27,12 @@ namespace CalamityMod.NPCs.DevourerofGods private float GetIntensity() { - if (this.UpdateDoGIndex()) + if (UpdateDoGIndex()) { float x = 0f; - if (this.DoGIndex != -1) + if (DoGIndex != -1) { - x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.DoGIndex].Center); + x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[DoGIndex].Center); } return (1f - Utils.SmoothStep(3000f, 6000f, x)) * 0.5f; } @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override Color OnTileColor(Color inColor) { - float intensity = this.GetIntensity(); + float intensity = GetIntensity(); return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity)); } @@ -70,8 +70,8 @@ namespace CalamityMod.NPCs.DevourerofGods { if (Main.npc[CalamityGlobalNPC.DoGHead].active) { - float intensity = this.GetIntensity(); - if ((double)Main.npc[CalamityGlobalNPC.DoGHead].life < (double)Main.npc[CalamityGlobalNPC.DoGHead].lifeMax * 0.15 || CalamityWorld.death) + float intensity = GetIntensity(); + if (Main.npc[CalamityGlobalNPC.DoGHead].life < Main.npc[CalamityGlobalNPC.DoGHead].lifeMax * 0.15 || CalamityWorld.death) { spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * (intensity + 0.5f)); diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 41b23eab7b..2f9341f382 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.GreatSandShark npc.width = 300; npc.height = 120; npc.defense = 60; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.LifeMaxNERB(8000, 11000); npc.aiStyle = -1; aiType = -1; @@ -434,7 +434,7 @@ namespace CalamityMod.NPCs.GreatSandShark { if (npc.localAI[0] == 0f) { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 15); + Main.PlaySound(SoundID.NPCDeath15, npc.position); npc.localAI[0] = -1f; for (int num621 = 0; num621 < 25; num621++) { @@ -597,7 +597,7 @@ namespace CalamityMod.NPCs.GreatSandShark int num159 = 1; float num160 = 0f; int num161 = num159; - while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityMod.CalamityConfig.Afterimages) + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = npc.GetAlpha(color25); { diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index b0d436e06f..07f0ca0afc 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -21,10 +21,10 @@ namespace CalamityMod.NPCs.HiveMind npc.width = 70; npc.height = 70; npc.defense = 6; - npc.lifeMax = 45; + npc.lifeMax = 90; if (CalamityWorld.bossRushActive) { - npc.lifeMax = 10000; + npc.lifeMax = 20000; } npc.aiStyle = -1; aiType = -1; @@ -44,10 +44,15 @@ namespace CalamityMod.NPCs.HiveMind float speed = revenge ? 12f : 11f; if (CalamityWorld.bossRushActive) speed = 18f; - Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); - float num1373 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector167.X; + + if (npc.ai[1] < 90f) + npc.ai[1] += 1f; + speed = MathHelper.Lerp(3f, speed, npc.ai[1] / 90f); + + Vector2 vector167 = new Vector2(npc.Center.X + (npc.direction * 20), npc.Center.Y + 6f); + float num1373 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector167.X; float num1374 = Main.player[npc.target].Center.Y - vector167.Y; - float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374)); + float num1375 = (float)Math.Sqrt(num1373 * num1373 + num1374 * num1374); float num1376 = speed / num1375; num1373 *= num1376; num1374 *= num1376; diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index 3a394c09e0..0f936cba83 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index 6a829dd76d..6b2cd83b00 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 54ab17d024..e475cb30fe 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/HiveMind/HiveCyst.cs b/NPCs/HiveMind/HiveCyst.cs index 7e7bf044b6..254ba0bc61 100644 --- a/NPCs/HiveMind/HiveCyst.cs +++ b/NPCs/HiveMind/HiveCyst.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 9593334f92..cc664e792e 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1,15 +1,13 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.HiveMind { - [AutoloadBossHead] + [AutoloadBossHead] public class HiveMind : ModNPC { int burrowTimer = 720; @@ -28,7 +26,7 @@ namespace CalamityMod.NPCs.HiveMind npc.height = 120; npc.defense = 10; npc.LifeMaxNERB(1200, 1800, 350000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -154,33 +152,31 @@ namespace CalamityMod.NPCs.HiveMind } if (npc.ai[3] == 0f && npc.life > 0) { - npc.ai[3] = (float)npc.lifeMax; + npc.ai[3] = npc.lifeMax; } if (npc.life > 0) { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num660 = (int)((double)npc.lifeMax * 0.25); - if ((float)(npc.life + num660) < npc.ai[3]) + int num660 = (int)(npc.lifeMax * 0.25); + if ((npc.life + num660) < npc.ai[3]) { - npc.ai[3] = (float)npc.life; + npc.ai[3] = npc.life; int num661 = Main.rand.Next(3, 6); for (int num662 = 0; num662 < num661; num662++) { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32)); int num663 = ModContent.NPCType(); - if (Main.rand.NextBool(3) || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (Main.rand.NextBool(3) || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num663 = ModContent.NPCType(); } int num664 = NPC.NewNPC(x, y, num663, 0, 0f, 0f, 0f, 0f, 255); Main.npc[num664].SetDefaults(num663, -1f); - Main.npc[num664].velocity.X = (float)Main.rand.Next(-15, 16) * 0.1f; - Main.npc[num664].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } return; @@ -205,7 +201,7 @@ namespace CalamityMod.NPCs.HiveMind if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } for (int i = 0; i < 2; i++) { @@ -227,7 +223,7 @@ namespace CalamityMod.NPCs.HiveMind int tilePosY = (int)(npc.position.Y + npc.height) / 16 + 1; if (Main.tile[tilePosX, tilePosY] == null) Main.tile[tilePosX, tilePosY] = new Tile(); - while (!(Main.tile[tilePosX, tilePosY].nactive() && Main.tileSolid[(int)Main.tile[tilePosX, tilePosY].type])) + while (!(Main.tile[tilePosX, tilePosY].nactive() && Main.tileSolid[Main.tile[tilePosX, tilePosY].type])) { tilePosY++; npc.position.Y += 16; @@ -246,7 +242,7 @@ namespace CalamityMod.NPCs.HiveMind if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } for (int i = 0; i < 2; i++) { @@ -285,19 +281,19 @@ namespace CalamityMod.NPCs.HiveMind { if (Main.rand.NextBool(60) && Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); + Vector2 spawnAt = npc.Center + new Vector2(0f, npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.EaterofSouls); } if (Main.rand.NextBool(150) && Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); + Vector2 spawnAt = npc.Center + new Vector2(0f, npc.height / 2f); NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, NPCID.DevourerHead); } } int num285 = 0; - while ((double)num285 < damage / (double)npc.lifeMax * 100.0) + while (num285 < damage / npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 14, (float)hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 14, hitDirection, -1f, 0, default, 1f); num285++; } } @@ -311,7 +307,7 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.CountNPCS(ModContent.NPCType()) < 1) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, npc.target); - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0); } } } diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index ebe7dfa5b5..a3e23a410b 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -20,8 +20,6 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; /* states: * 0 = slow drift * 1 = reelback and teleport after spawn enemy @@ -34,7 +32,7 @@ using CalamityMod; namespace CalamityMod.NPCs.HiveMind { - [AutoloadBossHead] + [AutoloadBossHead] public class HiveMindP2 : ModNPC { //this block of values can be modified in SetDefaults() based on difficulty mode or something @@ -76,7 +74,7 @@ namespace CalamityMod.NPCs.HiveMind npc.height = 142; npc.defense = 5; npc.LifeMaxNERB(5800, 7560, 3000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -211,7 +209,7 @@ namespace CalamityMod.NPCs.HiveMind int num159 = 1; float num160 = 0f; int num161 = num159; - while (state != 0 && CalamityMod.CalamityConfig.Afterimages && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) + while (state != 0 && CalamityConfig.Instance.Afterimages && ((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157))) { Color color26 = color25; color26 = npc.GetAlpha(color26); @@ -279,7 +277,7 @@ namespace CalamityMod.NPCs.HiveMind if (CalamityWorld.revenge || CalamityWorld.bossRushActive) { state = 2; - Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); + Main.PlaySound(SoundID.ForceRoar, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); } else { @@ -289,11 +287,11 @@ namespace CalamityMod.NPCs.HiveMind nextState = 0; if (state == 2) { - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0); } else { - Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); + Main.PlaySound(SoundID.ForceRoar, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); } } } @@ -517,7 +515,7 @@ namespace CalamityMod.NPCs.HiveMind npc.velocity.Normalize(); npc.velocity *= teleportRadius / lungeTime; dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0); } else { @@ -555,7 +553,7 @@ namespace CalamityMod.NPCs.HiveMind if (!dashStarted) { dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0); npc.velocity.X = 3.14159265f * teleportRadius / arcTime; npc.velocity *= rotationDirection; npc.netUpdate = true; @@ -611,7 +609,7 @@ namespace CalamityMod.NPCs.HiveMind if (!dashStarted) { dashStarted = true; - Main.PlaySound(15, (int)npc.Center.X, (int)npc.Center.Y, 0); + Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0); npc.velocity.X = teleportRadius / arcTime * 3; npc.velocity *= -rotationDirection; npc.netUpdate = true; diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 819a51e37d..9418c4ebbb 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index eff39b30d3..3fd0f5cfe7 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -18,8 +18,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Leviathan { [AutoloadBossHead] @@ -40,9 +38,9 @@ namespace CalamityMod.NPCs.Leviathan npc.width = 850; npc.height = 450; npc.defense = 40; - npc.Calamity().RevPlusDR(0.35f); + npc.DR_NERD(0.35f); npc.LifeMaxNERB(69000, 90700, 7000000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -108,7 +106,13 @@ namespace CalamityMod.NPCs.Leviathan bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; Vector2 vector = npc.Center; - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Phases + bool phase2 = (lifeRatio < 0.5f && expertMode) || death; + + npc.spriteDirection = (npc.direction > 0) ? 1 : -1; bool sirenAlive = false; if (CalamityGlobalNPC.siren != -1) @@ -141,7 +145,7 @@ namespace CalamityMod.NPCs.Leviathan } Player player = Main.player[npc.target]; - bool flag6 = player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400)); + bool flag6 = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); npc.dontTakeDamage = flag6 && !CalamityWorld.bossRushActive; if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f) @@ -156,7 +160,7 @@ namespace CalamityMod.NPCs.Leviathan if (npc.velocity.Y > 16f) npc.velocity.Y = 16f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) + if (npc.position.Y > Main.worldSurface * 16.0) { for (int x = 0; x < 200; x++) { @@ -187,6 +191,11 @@ namespace CalamityMod.NPCs.Leviathan npc.TargetClosest(true); float num412 = sirenAlive ? 3.5f : 7f; float num413 = sirenAlive ? 0.1f : 0.2f; + if (expertMode && !sirenAlive) + { + num412 += death ? 3.5f : 3.5f * (1f - lifeRatio); + num413 += death ? 0.1f : 0.1f * (1f - lifeRatio); + } if (CalamityWorld.bossRushActive) { num412 *= 1.5f; @@ -194,15 +203,15 @@ namespace CalamityMod.NPCs.Leviathan } int num414 = 1; - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width) + if (npc.position.X + (npc.width / 2) < player.position.X + player.width) { num414 = -1; } - Vector2 vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num415 = player.position.X + (float)(player.width / 2) + (float)(num414 * 800) - vector40.X; - float num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; - float num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416)); + Vector2 vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num415 = player.position.X + (player.width / 2) + (num414 * 800) - vector40.X; + float num416 = player.position.Y + (player.height / 2) - vector40.Y; + float num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416); num417 = num412 / num417; num415 *= num417; num416 *= num417; @@ -261,9 +270,9 @@ namespace CalamityMod.NPCs.Leviathan if (npc.ai[2] >= 75f) { npc.ai[2] = 0f; - vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, (npc.position.Y + (float)npc.height * 0.5f) + 160f); - num415 = player.position.X + (float)(player.width / 2) - vector40.X; - num416 = player.position.Y + (float)(player.height / 2) - vector40.Y; + vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 160f); + num415 = player.position.X + (player.width / 2) - vector40.X; + num416 = player.position.Y + (player.height / 2) - vector40.Y; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -275,7 +284,7 @@ namespace CalamityMod.NPCs.Leviathan num418 = (sirenAlive && !death) ? 14f : 17f; num419 = 33; } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num418 = 22f; } @@ -284,7 +293,7 @@ namespace CalamityMod.NPCs.Leviathan num418 *= 1.5f; } - num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416)); + num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416); num417 = num418 / num417; num415 *= num417; num416 *= num417; @@ -299,11 +308,11 @@ namespace CalamityMod.NPCs.Leviathan { npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = player.position.X + (float)(player.width / 2) - vector120.X; - float num1059 = player.position.Y + (float)(player.height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + Vector2 vector119 = new Vector2(npc.position.X + (npc.width / 2) + (Main.rand.Next(20) * npc.direction), npc.position.Y + npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1058 = player.position.X + (player.width / 2) - vector120.X; + float num1059 = player.position.Y + (player.height / 2) - vector120.Y; + float num1060 = (float)Math.Sqrt(num1058 * num1058 + num1059 * num1059); npc.ai[1] += revenge ? 2f : 1f; if (!sirenAlive || death) @@ -329,27 +338,29 @@ namespace CalamityMod.NPCs.Leviathan if (Main.netMode != NetmodeID.MultiplayerClient) { int type = spawnAberration ? ModContent.NPCType() : ModContent.NPCType(); - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, type, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.01f; - Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.01f; - Main.npc[num1062].netUpdate = true; + NPC.NewNPC((int)vector119.X, (int)vector119.Y, type, 0, 0f, 0f, 0f, 0f, 255); } } - if (num1060 > 1200f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, player.position, player.width, player.height)) + if (num1060 > 1200f) { float num1063 = sirenAlive ? 7f : 8f; float num1064 = sirenAlive ? 0.05f : 0.065f; - if (CalamityWorld.bossRushActive) + if (expertMode && !sirenAlive) + { + num1063 += death ? 4f : 4f * (1f - lifeRatio); + num1064 += death ? 0.03f : 0.03f * (1f - lifeRatio); + } + if (CalamityWorld.bossRushActive) { num1063 *= 1.5f; num1064 *= 1.5f; } vector120 = vector119; - num1058 = player.position.X + (float)(player.width / 2) - vector120.X; - num1059 = player.position.Y + (float)(player.height / 2) - vector120.Y; - num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + num1058 = player.position.X + (player.width / 2) - vector120.X; + num1059 = player.position.Y + (player.height / 2) - vector120.Y; + num1060 = (float)Math.Sqrt(num1058 * num1058 + num1059 * num1059); num1060 = num1063 / num1060; if (npc.velocity.X < num1058) @@ -394,7 +405,7 @@ namespace CalamityMod.NPCs.Leviathan if (npc.ai[2] > (sirenAlive ? 2f : 3f)) { - npc.ai[0] = ((double)npc.life < (double)npc.lifeMax * 0.5 || death) ? 2f : 0f; + npc.ai[0] = phase2 ? 2f : 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.netUpdate = true; @@ -418,8 +429,8 @@ namespace CalamityMod.NPCs.Leviathan int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)(float)num24, default) + vector; - Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f).RotatedBy((j - (num24 / 2 - 1)) * 3.1415926535897931 / (float)num24, default) + vector; + Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * Main.rand.Next(3, 8); int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; @@ -429,20 +440,16 @@ namespace CalamityMod.NPCs.Leviathan npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (player.position.Y + (float)(player.height / 2))) < 20f) + if (Math.Abs(npc.position.Y + (npc.height / 2) - (player.position.Y + (player.height / 2))) < 20f) { npc.ai[1] += 1f; npc.ai[2] = 0f; float num1044 = revenge ? 20f : 18f; - if ((double)npc.life < (double)npc.lifeMax * 0.25 || death) - { - num1044 += 2f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1 || death) - { - num1044 += 2f; - } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (revenge && !sirenAlive) + { + num1044 += death ? 4f : 4f * (1f - lifeRatio); + } + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num1044 += 4f; } @@ -450,15 +457,11 @@ namespace CalamityMod.NPCs.Leviathan { num1044 *= 1.25f; } - if (sirenAlive) - { - num1044 *= 0.75f; - } - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = player.position.X + (float)(player.width / 2) - vector117.X; - float num1046 = player.position.Y + (float)(player.height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + Vector2 vector117 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1045 = player.position.X + (player.width / 2) - vector117.X; + float num1046 = player.position.Y + (player.height / 2) - vector117.Y; + float num1047 = (float)Math.Sqrt(num1045 * num1045 + num1046 * num1046); num1047 = num1044 / num1047; npc.velocity.X = num1045 * num1047; npc.velocity.Y = num1046 * num1047; @@ -469,17 +472,13 @@ namespace CalamityMod.NPCs.Leviathan float num1048 = revenge ? 7.5f : 6.5f; float num1049 = revenge ? 0.12f : 0.11f; - if ((double)npc.life < (double)npc.lifeMax * 0.66 || death) - { - num1048 += 2f; - num1049 += 0.05f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.33 || death) - { - num1048 += 2f; - num1049 += 0.1f; - } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (revenge && !sirenAlive) + { + num1048 += death ? 6f : 6f * (1f - lifeRatio); + num1049 += death ? 0.1f : 0.1f * (1f - lifeRatio); + } + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num1048 += 3f; num1049 += 0.2f; @@ -490,7 +489,7 @@ namespace CalamityMod.NPCs.Leviathan num1049 *= 1.25f; } - if (npc.position.Y + (float)(npc.height / 2) < (player.position.Y + (float)(player.height / 2))) + if (npc.position.Y + (npc.height / 2) < (player.position.Y + (player.height / 2))) npc.velocity.Y += num1049; else npc.velocity.Y -= num1049; @@ -500,10 +499,10 @@ namespace CalamityMod.NPCs.Leviathan if (npc.velocity.Y > num1048) npc.velocity.Y = num1048; - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (player.position.X + (float)(player.width / 2))) > chargeDistance + 200f) - npc.velocity.X += num1049 * (float)npc.direction; - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (player.position.X + (float)(player.width / 2))) < chargeDistance) - npc.velocity.X -= num1049 * (float)npc.direction; + if (Math.Abs(npc.position.X + (npc.width / 2) - (player.position.X + (player.width / 2))) > chargeDistance + 200f) + npc.velocity.X += num1049 * npc.direction; + else if (Math.Abs(npc.position.X + (npc.width / 2) - (player.position.X + (player.width / 2))) < chargeDistance) + npc.velocity.X -= num1049 * npc.direction; else npc.velocity.X *= 0.8f; @@ -524,9 +523,9 @@ namespace CalamityMod.NPCs.Leviathan npc.spriteDirection = npc.direction; int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2)) + if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2)) num1051 = -1; - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (player.position.X + (float)(player.width / 2))) > chargeDistance) + if (npc.direction == num1051 && Math.Abs(npc.position.X + (npc.width / 2) - (player.position.X + (player.width / 2))) > chargeDistance) npc.ai[2] = 1f; if (npc.ai[2] != 1f) @@ -538,16 +537,12 @@ namespace CalamityMod.NPCs.Leviathan npc.velocity *= 0.9f; float num1052 = revenge ? 0.11f : 0.1f; - if (npc.life < npc.lifeMax / 4 || death) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; - } - if (npc.life < npc.lifeMax / 10 || death) - { - npc.velocity *= 0.9f; - num1052 += 0.05f; - } + if (revenge && !sirenAlive) + { + npc.velocity *= death ? 0.81f : MathHelper.Lerp(0.81f, 1f, lifeRatio); + num1052 += death ? 0.1f : 0.1f * (1f - lifeRatio); + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) { npc.ai[2] = 0f; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 33058b34b4..794bd507c7 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.World; using Terraria; using Terraria.ID; diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index d4f460208b..cccfd93c34 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -1,13 +1,12 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Leviathan { - public class Parasea : ModNPC + public class Parasea : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 655efca8b6..d04dc1678d 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -10,8 +10,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Leviathan { [AutoloadBossHead] @@ -35,9 +33,9 @@ namespace CalamityMod.NPCs.Leviathan npc.width = 100; npc.height = 100; npc.defense = 20; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.LifeMaxNERB(27400, 41600, 2600000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -120,11 +118,11 @@ namespace CalamityMod.NPCs.Leviathan bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; Vector2 vector = npc.Center; - Vector2 spawnAt = vector + new Vector2(0f, (float)npc.height / 2f); - bool isNotOcean = player.position.Y < 800f || (double)player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (float)(Main.maxTilesX * 16 - 6400)); + Vector2 spawnAt = vector + new Vector2(0f, npc.height / 2f); + bool isNotOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Percent life remaining - float lifeRatio = (float)npc.life / (float)npc.lifeMax; + float lifeRatio = npc.life / (float)npc.lifeMax; // Phases bool phase2 = lifeRatio < 0.66f || death; @@ -170,11 +168,11 @@ namespace CalamityMod.NPCs.Leviathan // Ice Shield if (npc.ai[3] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { - int num6 = NPC.NewNPC((int)vector.X, (int)vector.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - npc.ai[3] = (float)(num6 + 1); + int num6 = NPC.NewNPC((int)vector.X, (int)vector.Y, ModContent.NPCType(), npc.whoAmI); + npc.ai[3] = num6 + 1; npc.localAI[1] = -1f; npc.netUpdate = true; - Main.npc[num6].ai[0] = (float)npc.whoAmI; + Main.npc[num6].ai[0] = npc.whoAmI; Main.npc[num6].netUpdate = true; } @@ -229,7 +227,7 @@ namespace CalamityMod.NPCs.Leviathan if (npc.velocity.Y > 16f) npc.velocity.Y = 16f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) + if (npc.position.Y > Main.worldSurface * 16.0) { for (int x = 0; x < 200; x++) { @@ -262,7 +260,7 @@ namespace CalamityMod.NPCs.Leviathan // Phase switch if (npc.ai[0] == -1f) { - int random = phase2 ? 3 : 2; + int random = (phase2 && expertMode) ? 3 : 2; int num871 = Main.rand.Next(random); if (num871 == 0) @@ -272,7 +270,7 @@ namespace CalamityMod.NPCs.Leviathan else num871 = 3; - npc.ai[0] = (float)num871; + npc.ai[0] = num871; if (npc.ai[0] != 3f) { @@ -295,10 +293,10 @@ namespace CalamityMod.NPCs.Leviathan npc.rotation = npc.velocity.X * 0.02f; npc.spriteDirection = npc.direction; - Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1055 = player.position.X + (float)(player.width / 2) - vector118.X; - float num1056 = player.position.Y + (float)(player.height / 2) - 200f - vector118.Y; - float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); + Vector2 vector118 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1055 = player.position.X + (player.width / 2) - vector118.X; + float num1056 = player.position.Y + (player.height / 2) - 200f - vector118.Y; + float num1057 = (float)Math.Sqrt(num1055 * num1055 + num1056 * num1056); if (num1057 < 600f) { @@ -312,7 +310,7 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y > 4f) npc.velocity.Y = 4f; } @@ -320,23 +318,23 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y < -4f) npc.velocity.Y = -4f; } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) + if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 100f) { if (npc.velocity.X > 0f) npc.velocity.X *= 0.98f; - npc.velocity.X -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X > 8f) npc.velocity.X = 8f; } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) + if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 100f) { if (npc.velocity.X < 0f) npc.velocity.X *= 0.98f; - npc.velocity.X += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X < -8f) npc.velocity.X = -8f; } @@ -348,11 +346,11 @@ namespace CalamityMod.NPCs.Leviathan npc.rotation = npc.velocity.X * 0.02f; npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = player.position.X + (float)(player.width / 2) - vector120.X; - float num1059 = player.position.Y + (float)(player.height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + Vector2 vector119 = new Vector2(npc.position.X + (npc.width / 2) + (Main.rand.Next(20) * npc.direction), npc.position.Y + npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num1058 = player.position.X + (player.width / 2) - vector120.X; + float num1059 = player.position.Y + (player.height / 2) - vector120.Y; + float num1060 = (float)Math.Sqrt(num1058 * num1058 + num1059 * num1059); npc.ai[1] += 1f; if (phase2) @@ -375,8 +373,8 @@ namespace CalamityMod.NPCs.Leviathan { int num1061 = 371; int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y - 30, num1061, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * (CalamityWorld.bossRushActive ? 0.02f : 0.01f); - Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * (CalamityWorld.bossRushActive ? 0.02f : 0.01f); + Main.npc[num1062].velocity.X = Main.rand.Next(-200, 201) * (CalamityWorld.bossRushActive ? 0.02f : 0.01f); + Main.npc[num1062].velocity.Y = Main.rand.Next(-200, 201) * (CalamityWorld.bossRushActive ? 0.02f : 0.01f); Main.npc[num1062].localAI[0] = 60f; Main.npc[num1062].netUpdate = true; } @@ -388,7 +386,7 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y > 4f) npc.velocity.Y = 4f; } @@ -396,23 +394,23 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y < -4f) npc.velocity.Y = -4f; } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) + if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 100f) { if (npc.velocity.X > 0f) npc.velocity.X *= 0.98f; - npc.velocity.X -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X > 8f) npc.velocity.X = 8f; } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) + if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 100f) { if (npc.velocity.X < 0f) npc.velocity.X *= 0.98f; - npc.velocity.X += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X < -8f) npc.velocity.X = -8f; } @@ -435,37 +433,39 @@ namespace CalamityMod.NPCs.Leviathan else if (npc.ai[0] == 2f) { npc.rotation = npc.velocity.X * 0.02f; - Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2), npc.position.Y + (float)(npc.height / 2)); + Vector2 vector121 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); npc.ai[1] += 1f; bool flag104 = false; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - { - if (npc.ai[1] % 10f == 9f) - flag104 = true; - } - else - { - if ((phase3 && !leviAlive) || CalamityWorld.bossRushActive) - { - if (npc.ai[1] % 20f == 19f) - flag104 = true; - } - else if (phase2) - { - if (npc.ai[1] % 25f == 24f) - flag104 = true; - } - else if (npc.ai[1] % 30f == 29f) - flag104 = true; - } + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + { + if (npc.ai[1] % 10f == 9f) + flag104 = true; + } + else if (expertMode) + { + if ((phase3 && !leviAlive) || CalamityWorld.bossRushActive) + { + if (npc.ai[1] % 15f == 14f) + flag104 = true; + } + else if (phase2) + { + if (npc.ai[1] % 20f == 19f) + flag104 = true; + } + else if (npc.ai[1] % 25f == 24f) + flag104 = true; + } + else if (npc.ai[1] % 30f == 29f) + flag104 = true; - if (flag104 && (npc.position.Y + (float)npc.height < player.position.Y || (!leviAlive && phase2)) && Collision.CanHit(vector121, 1, 1, player.position, player.width, player.height)) + if (flag104 && (npc.position.Y + npc.height < player.position.Y || (!leviAlive && phase2)) && Collision.CanHit(vector121, 1, 1, player.position, player.width, player.height)) { if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = revenge ? 15f : 13f; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num1070 = 24f; else if (isNotOcean || (!leviAlive && phase2) || death) num1070 = revenge ? 17f : 16f; @@ -475,9 +475,9 @@ namespace CalamityMod.NPCs.Leviathan num1070 += 2f; } - float num1071 = player.position.X + (float)player.width * 0.5f - vector121.X; - float num1072 = player.position.Y + (float)player.height * 0.5f - vector121.Y; - float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); + float num1071 = player.position.X + player.width * 0.5f - vector121.X; + float num1072 = player.position.Y + player.height * 0.5f - vector121.Y; + float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); num1073 = num1070 / num1073; num1071 *= num1073; num1072 *= num1073; @@ -502,7 +502,7 @@ namespace CalamityMod.NPCs.Leviathan if (isNotOcean) num1074 *= 2; - float ai0 = ((!leviAlive && num1075 == ModContent.ProjectileType()) ? 1f : 0f); + float ai0 = (!leviAlive && num1075 == ModContent.ProjectileType()) ? 1f : 0f; Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, ai0, 0f); } } @@ -511,7 +511,7 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y > 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y > 4f) npc.velocity.Y = 4f; } @@ -519,23 +519,23 @@ namespace CalamityMod.NPCs.Leviathan { if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.98f; - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y < -4f) npc.velocity.Y = -4f; } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 100f) + if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 100f) { if (npc.velocity.X > 0f) npc.velocity.X *= 0.98f; - npc.velocity.X -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X > 8f) npc.velocity.X = 8f; } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 100f) + if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 100f) { if (npc.velocity.X < 0f) npc.velocity.X *= 0.98f; - npc.velocity.X += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X < -8f) npc.velocity.X = -8f; } @@ -555,11 +555,11 @@ namespace CalamityMod.NPCs.Leviathan // Set up charge else if (npc.ai[0] == 3f) { - ChargeLocation(player, vector, leviAlive, expertMode); + ChargeLocation(player, vector, leviAlive, revenge); npc.ai[1] += 1f; - if (npc.ai[1] >= (expertMode ? 40f : 60f)) + if (npc.ai[1] >= (revenge ? 40f : 60f)) { forceChargeFrames = true; npc.ai[0] = npc.ai[2] >= (leviAlive ? 2f : 3f) ? -1f : 4f; @@ -568,11 +568,15 @@ namespace CalamityMod.NPCs.Leviathan // Velocity and rotation float chargeVelocity = leviAlive ? 16f : 21f; + + if (revenge) + chargeVelocity += 2f + (death ? 4f : 4f * (1f - lifeRatio)); + if (CalamityWorld.bossRushActive) chargeVelocity = 26f; npc.velocity = Vector2.Normalize(player.Center - vector) * chargeVelocity; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); // Direction int num22 = Math.Sign(player.Center.X - vector.X); @@ -595,8 +599,8 @@ namespace CalamityMod.NPCs.Leviathan int num24 = 7; for (int j = 0; j < num24; j++) { - Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f).RotatedBy((double)(j - (num24 / 2 - 1)) * 3.1415926535897931 / (double)(float)num24, default) + vector; - Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + Vector2 arg_E1C_0 = (Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f).RotatedBy((j - (num24 / 2 - 1)) * 3.1415926535897931 / (float)num24, default) + vector; + Vector2 vector4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * Main.rand.Next(3, 8); int num25 = Dust.NewDust(arg_E1C_0 + vector4, 0, 0, 172, vector4.X * 2f, vector4.Y * 2f, 100, default, 1.4f); Main.dust[num25].noGravity = true; Main.dust[num25].noLight = true; @@ -618,7 +622,7 @@ namespace CalamityMod.NPCs.Leviathan // Rotation when charging private void ChargeRotation(Player player, Vector2 vector) { - float num17 = (float)Math.Atan2((double)(player.Center.Y - vector.Y), (double)(player.Center.X - vector.X)); + float num17 = (float)Math.Atan2(player.Center.Y - vector.Y, player.Center.X - vector.X); if (npc.spriteDirection == 1) num17 += 3.14159274f; if (num17 < 0f) @@ -632,14 +636,14 @@ namespace CalamityMod.NPCs.Leviathan if (npc.rotation < num17) { - if ((double)(num17 - npc.rotation) > 3.1415926535897931) + if ((num17 - npc.rotation) > 3.1415926535897931) npc.rotation -= num18; else npc.rotation += num18; } if (npc.rotation > num17) { - if ((double)(npc.rotation - num17) > 3.1415926535897931) + if ((npc.rotation - num17) > 3.1415926535897931) npc.rotation += num18; else npc.rotation -= num18; @@ -656,16 +660,16 @@ namespace CalamityMod.NPCs.Leviathan } // Move to charge location - private void ChargeLocation(Player player, Vector2 vector, bool leviAlive, bool expertMode) + private void ChargeLocation(Player player, Vector2 vector, bool leviAlive, bool revenge) { float distance = leviAlive ? 400f : 350f; // Velocity if (npc.localAI[0] == 0f) - npc.localAI[0] = (float)((int)distance * Math.Sign((vector - player.Center).X)); + npc.localAI[0] = (int)distance * Math.Sign((vector - player.Center).X); Vector2 vector3 = Vector2.Normalize(player.Center + new Vector2(npc.localAI[0], -distance) - vector - npc.velocity) * 9f; - float acceleration = expertMode ? 0.75f : 0.5f; + float acceleration = revenge ? 0.75f : 0.5f; if (CalamityWorld.bossRushActive) acceleration = 1f; diff --git a/NPCs/Leviathan/SirenClone.cs b/NPCs/Leviathan/SirenClone.cs index 131ffdfc0d..4a891a1c89 100644 --- a/NPCs/Leviathan/SirenClone.cs +++ b/NPCs/Leviathan/SirenClone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/Leviathan/SirenIce.cs b/NPCs/Leviathan/SirenIce.cs index effa17dbd1..2237dcf9b5 100644 --- a/NPCs/Leviathan/SirenIce.cs +++ b/NPCs/Leviathan/SirenIce.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.Leviathan { - public class SirenIce : ModNPC + public class SirenIce : ModNPC { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.NPCs.Leviathan npc.width = 100; npc.height = 100; npc.defense = 10; - npc.Calamity().RevPlusDR(0.5f); + npc.DR_NERD(0.5f); npc.lifeMax = 650; if (CalamityWorld.bossRushActive) { diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 454ee1ecd7..11e8df88bc 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.World; using Terraria; diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index 0ca9383703..a2c220b9b6 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -1,16 +1,14 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Materials; using CalamityMod.World; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class AngryDog : ModNPC + public class AngryDog : ModNPC { private bool reset = false; diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 71ccf4d4bc..9b6eb621cc 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 38; npc.height = 38; npc.defense = 30; - npc.Calamity().RevPlusDR(0.35f); + npc.DR_NERD(0.35f); npc.lifeMax = CalamityWorld.death ? 30000 : 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.NormalNPCs num6 *= num8; num7 *= num8; int num9 = 30; - int num10 = 450; + int num10 = ProjectileID.SaucerScrap; vector.X += num6 * 5f; vector.Y += num7 * 5f; Projectile.NewProjectile(vector.X, vector.Y, num6, num7, num10, num9, 0f, Main.myPlayer, 0f, 0f); diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index fbd2da14f3..1a9c9fcad1 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.SummonItems; using CalamityMod.World; @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 54; npc.height = 54; npc.defense = 15; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = CalamityWorld.death ? 30000 : 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npc[num5].realLife = npc.whoAmI; Main.npc[num5].ai[1] = (float)num2; Main.npc[num2].ai[0] = (float)num5; - NetMessage.SendData(23, -1, -1, null, num5, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num5, 0f, 0f, 0f, 0, 0, 0); num2 = num5; } TailSpawned = true; @@ -243,7 +243,7 @@ namespace CalamityMod.NPCs.NormalNPCs num24 = 20f; } npc.soundDelay = (int)num24; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 2d92669e11..d2b51d0fc9 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 34; npc.height = 34; npc.defense = 45; - npc.Calamity().RevPlusDR(0.45f); + npc.DR_NERD(0.45f); npc.lifeMax = CalamityWorld.death ? 30000 : 20000; npc.knockBackResist = 0f; npc.aiStyle = -1; diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index 60323f76fc..eba03f078a 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 1fd4007cfe..6e13b87c8f 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.World; diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index fe3ac2c3df..28c66dc461 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -1,13 +1,11 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class Bohldohr : ModNPC + public class Bohldohr : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index d49b9e1c89..37a74c4614 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Enemy; @@ -26,7 +26,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 160; npc.height = 80; npc.defense = 6; - npc.Calamity().RevPlusDR(0.05f); + npc.noGravity = true; + npc.noTileCollide = true; + npc.DR_NERD(0.05f); npc.lifeMax = 400; npc.knockBackResist = 0.05f; aiType = -1; @@ -59,46 +61,44 @@ namespace CalamityMod.NPCs.NormalNPCs { Player player = Main.player[npc.target]; bool expertMode = Main.expertMode; - npc.noGravity = true; - npc.noTileCollide = true; npc.spriteDirection = (npc.direction > 0) ? 1 : -1; float num823 = 1f; npc.TargetClosest(true); bool flag51 = false; int offsetX = 80; - if ((double)npc.life < (double)npc.lifeMax * 0.33 || (CalamityWorld.death && (double)npc.life < (double)npc.lifeMax * 0.6)) + if (npc.life < npc.lifeMax * 0.33 || (CalamityWorld.death && npc.life < npc.lifeMax * 0.6)) { num823 = 2f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { num823 = 4f; } if (npc.ai[0] == 0f) { npc.ai[1] += 1f; - if ((double)npc.life < (double)npc.lifeMax * 0.33 || (CalamityWorld.death && (double)npc.life < (double)npc.lifeMax * 0.6)) + if (npc.life < npc.lifeMax * 0.33 || (CalamityWorld.death && npc.life < npc.lifeMax * 0.6)) { npc.ai[1] += 1f; } - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.life < npc.lifeMax * 0.1) { npc.ai[1] += 1f; } if (npc.ai[1] >= 300f && Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] = 0f; - if ((double)npc.life < (double)npc.lifeMax * 0.25) + if (npc.life < npc.lifeMax * 0.25) { - npc.ai[0] = (float)Main.rand.Next(3, 5); + npc.ai[0] = Main.rand.Next(3, 5); } - else if (CalamityWorld.death && (double)npc.life < (double)npc.lifeMax * 0.6) + else if (CalamityWorld.death && npc.life < npc.lifeMax * 0.6) { - npc.ai[0] = (float)Main.rand.Next(1, 5); + npc.ai[0] = Main.rand.Next(1, 5); } else { - npc.ai[0] = (float)Main.rand.Next(1, 3); + npc.ai[0] = Main.rand.Next(1, 3); } npc.netUpdate = true; } @@ -109,17 +109,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[1] += 1f; if (npc.ai[1] % 30f == 0f) { - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + 20f); - vector18.X += (float)(offsetX * npc.direction); - float num829 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector18.X; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + 20f); + vector18.X += offsetX * npc.direction; + float num829 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; float num830 = Main.player[npc.target].position.Y - vector18.Y; - float num831 = (float)Math.Sqrt((double)(num829 * num829 + num830 * num830)); + float num831 = (float)Math.Sqrt(num829 * num829 + num830 * num830); float num832 = 6f; num831 = num832 / num831; num829 *= num831; num830 *= num831; - num829 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; - num830 *= 1f + (float)Main.rand.Next(-10, 11) * 0.01f; + num829 *= 1f + Main.rand.Next(-10, 11) * 0.01f; + num830 *= 1f + Main.rand.Next(-10, 11) * 0.01f; Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), expertMode ? 8 : 11, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 120f) @@ -134,17 +134,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[1] += 1f; if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 16f == 0f) { - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + 20f); - vector18.X += (float)(offsetX * npc.direction); - float num829 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector18.X; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + 20f); + vector18.X += offsetX * npc.direction; + float num829 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; float num830 = Main.player[npc.target].position.Y - vector18.Y; - float num831 = (float)Math.Sqrt((double)(num829 * num829 + num830 * num830)); + float num831 = (float)Math.Sqrt(num829 * num829 + num830 * num830); float num832 = 8f; num831 = num832 / num831; num829 *= num831; num830 *= num831; - num829 *= 1f + (float)Main.rand.Next(-15, 16) * 0.01f; - num830 *= 1f + (float)Main.rand.Next(-15, 16) * 0.01f; + num829 *= 1f + Main.rand.Next(-15, 16) * 0.01f; + num830 *= 1f + Main.rand.Next(-15, 16) * 0.01f; Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), expertMode ? 9 : 12, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 300f) @@ -159,17 +159,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[1] += 1f; if (npc.ai[1] % 30f == 0f) { - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + 20f); - vector18.X += (float)(offsetX * npc.direction); - float num844 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector18.X; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + 20f); + vector18.X += offsetX * npc.direction; + float num844 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; float num845 = Main.player[npc.target].position.Y - vector18.Y; - float num846 = (float)Math.Sqrt((double)(num844 * num844 + num845 * num845)); + float num846 = (float)Math.Sqrt(num844 * num844 + num845 * num845); float num847 = 10f; num846 = num847 / num846; num844 *= num846; num845 *= num846; - num844 *= 1f + (float)Main.rand.Next(-10, 11) * 0.001f; - num845 *= 1f + (float)Main.rand.Next(-10, 11) * 0.001f; + num844 *= 1f + Main.rand.Next(-10, 11) * 0.001f; + num845 *= 1f + Main.rand.Next(-10, 11) * 0.001f; int num848 = Projectile.NewProjectile(vector18.X, vector18.Y, num844, num845, ModContent.ProjectileType(), expertMode ? 11 : 14, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 120f) @@ -184,17 +184,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[1] += 1f; if (npc.ai[1] % 20f == 0f) { - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + 20f); - vector18.X += (float)(offsetX * npc.direction); - float num829 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector18.X; + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + 20f); + vector18.X += offsetX * npc.direction; + float num829 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X; float num830 = Main.player[npc.target].position.Y - vector18.Y; - float num831 = (float)Math.Sqrt((double)(num829 * num829 + num830 * num830)); + float num831 = (float)Math.Sqrt(num829 * num829 + num830 * num830); float num832 = 11f; num831 = num832 / num831; num829 *= num831; num830 *= num831; - num829 *= 1f + (float)Main.rand.Next(-5, 6) * 0.01f; - num830 *= 1f + (float)Main.rand.Next(-5, 6) * 0.01f; + num829 *= 1f + Main.rand.Next(-5, 6) * 0.01f; + num830 *= 1f + Main.rand.Next(-5, 6) * 0.01f; int num833 = Projectile.NewProjectile(vector18.X, vector18.Y, num829, num830, ModContent.ProjectileType(), expertMode ? 13 : 17, 0f, Main.myPlayer, 0f, 0f); } if (npc.ai[1] >= 240f) @@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (flag51) { npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) { npc.velocity.X = 0f; } @@ -228,15 +228,15 @@ namespace CalamityMod.NPCs.NormalNPCs } int num854 = 80; int num855 = 20; - Vector2 position2 = new Vector2(npc.Center.X - (float)(num854 / 2), npc.position.Y + (float)npc.height - (float)num855); + Vector2 position2 = new Vector2(npc.Center.X - (num854 / 2), npc.position.Y + npc.height - num855); bool flag52 = false; - if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) + if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + npc.width > Main.player[npc.target].position.X + Main.player[npc.target].width && npc.position.Y + npc.height < Main.player[npc.target].position.Y + Main.player[npc.target].height - 16f) { flag52 = true; } if (flag52) { - npc.velocity.Y = npc.velocity.Y + 0.5f; + npc.velocity.Y += 0.25f; } else if (Collision.SolidCollision(position2, num854, num855)) { @@ -244,17 +244,17 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y > -0.2) + if (npc.velocity.Y > -0.2f) { - npc.velocity.Y = npc.velocity.Y - 0.025f; + npc.velocity.Y -= 0.025f; } else { - npc.velocity.Y = npc.velocity.Y - 0.2f; + npc.velocity.Y -= 0.2f; } - if (npc.velocity.Y < -4f) + if (npc.velocity.Y < -2f) { - npc.velocity.Y = -4f; + npc.velocity.Y = -2f; } } else @@ -263,18 +263,18 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.velocity.Y = 0f; } - if ((double)npc.velocity.Y < 0.1) + if (npc.velocity.Y < 0.1) { - npc.velocity.Y = npc.velocity.Y + 0.025f; + npc.velocity.Y += 0.025f; } else { - npc.velocity.Y = npc.velocity.Y + 0.5f; + npc.velocity.Y += 0.5f; } } - if (npc.velocity.Y > 10f) + if (npc.velocity.Y > 4f) { - npc.velocity.Y = 10f; + npc.velocity.Y = 4f; } } diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index a62ead81f7..6cee0687c6 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index 8454328a1f..cbc2623f4f 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerAmber : ModNPC + public class CrawlerAmber : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index c9b3ba2135..f0d0408b73 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerAmethyst : ModNPC + public class CrawlerAmethyst : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index f3f59d49ca..a29d6d2ed1 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -1,15 +1,13 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerCrystal : ModNPC + public class CrawlerCrystal : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 81b21ec950..8d79eeb493 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerDiamond : ModNPC + public class CrawlerDiamond : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 636963f40f..910a452ae1 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerEmerald : ModNPC + public class CrawlerEmerald : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 35a8e21fe7..ec639a75dd 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerRuby : ModNPC + public class CrawlerRuby : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index a4a83177f6..790844b66a 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerSapphire : ModNPC + public class CrawlerSapphire : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index f308b5f77a..e85e3a7e01 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class CrawlerTopaz : ModNPC + public class CrawlerTopaz : ModNPC { private bool detected = false; diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 1ee625d81f..be666662c0 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using Terraria; diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 4ccead5df9..f280c59aaf 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using CalamityMod.World; using Terraria; diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index f1c4e0e2e8..1a31a56967 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -1,14 +1,12 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class Cryon : ModNPC + public class Cryon : ModNPC { public override void SetStaticDefaults() { @@ -24,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 50; npc.height = 64; npc.defense = 10; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 300; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index ba182feb66..d297573336 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 014d2d13dd..2abfd1978f 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.SummonItems; using CalamityMod.World; diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 554efac7fe..9c066e63d5 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using System.Collections.Generic; @@ -292,7 +292,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag24) { - NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); } } if (Main.tile[num170, num171 - 1].type == 388) @@ -305,7 +305,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag25) { - NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); } } } diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 073e021146..7e5361b647 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -1,15 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.World; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class Frogfish : ModNPC + public class Frogfish : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/HeatSpirit.cs b/NPCs/NormalNPCs/HeatSpirit.cs index 838888ebaf..4564954fe6 100644 --- a/NPCs/NormalNPCs/HeatSpirit.cs +++ b/NPCs/NormalNPCs/HeatSpirit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index c5d1f509db..2d08d1d703 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.Weapons.Melee; @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 230; npc.height = 230; npc.defense = 20; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 3800; npc.aiStyle = -1; aiType = -1; @@ -111,7 +111,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (npc.life <= 0) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.Item14, npc.position); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = 160; @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (npc.localAI[0] >= 300f) { npc.localAI[0] = 0f; - Main.PlaySound(3, (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)(npc.height / 2)), 41); + Main.PlaySound(SoundID.NPCHit43, npc.Center); npc.TargetClosest(true); if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index 38c7f1ea33..5b7ea7a5e1 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; @@ -138,7 +138,7 @@ namespace CalamityMod.NPCs.NormalNPCs { num8 = 25; } - int num9 = 128; + int num9 = ProjectileID.FrostBlastHostile; int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].timeLeft = 300; } diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index e7f7337063..220d8c8551 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Enemy; diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index d5e7e1dd12..4a1dbd793f 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -1,14 +1,13 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class KingSlimeJewel : ModNPC + public class KingSlimeJewel : ModNPC { public override void SetStaticDefaults() { @@ -138,7 +137,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.dust[ruby].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 8); + Main.PlaySound(SoundID.Item8, npc.position); int proj = Projectile.NewProjectile(npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index e10ab7c0a0..37796796aa 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; using Terraria; @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 40; npc.height = 24; npc.defense = 10; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 30; npc.aiStyle = 3; aiType = 67; @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, 612, 0, 0f, Main.myPlayer); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, 0, 0f, Main.myPlayer); } } diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index ff10efbeff..2653eca75d 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 18; npc.height = 40; npc.defense = 18; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = NPC.downedMoonlord ? 1800 : 135; npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 2, 0); @@ -325,7 +325,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag24) { - NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); } } if (Main.tile[num170, num171 - 1].type == 388) @@ -338,7 +338,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag25) { - NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); } } } diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index 80365d7de9..529ea759e7 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index 0ae93eed05..09743b48e9 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 44; npc.height = 22; npc.defense = 20; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = NPC.downedMoonlord ? 1600 : 120; npc.aiStyle = -1; aiType = -1; @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag24) { - NetMessage.SendData(19, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 0, (float)num170, (float)(num171 - 1), (float)npc.direction, 0, 0, 0); } } if (Main.tile[num170, num171 - 1].type == 388) @@ -332,7 +332,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode == NetmodeID.Server & flag25) { - NetMessage.SendData(19, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); + NetMessage.SendData(MessageID.ChangeDoor, -1, -1, null, 4, (float)num170, (float)(num171 - 1), 0f, 0, 0, 0); } } } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 1a87bcf443..73dd268e20 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class PhantomSpirit : ModNPC + public class PhantomSpirit : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index aadd91eebb..62e1a60e31 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; @@ -86,7 +86,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float num151 = 5f; int num152 = Main.expertMode ? 53 : 65; - int num153 = ModContent.ProjectileType(); + int num153 = ModContent.ProjectileType(); num149 = num151 / num149; num147 *= num149; num148 *= num149; diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index b87a1d4903..956c2a36fa 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class PhantomSpiritM : ModNPC + public class PhantomSpiritM : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 59fb3ebd52..94b477f755 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class PhantomSpiritS : ModNPC + public class PhantomSpiritS : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 17220b7cde..6fd3803528 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Critters; using System; using Terraria; diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 2d681fc606..e2a2fba6a4 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; using Terraria.ID; diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index 10f5f879dd..dedb958099 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -80,7 +80,7 @@ namespace CalamityMod.NPCs.NormalNPCs texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index c1c9c01b83..0a5279d8b1 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/NormalNPCs/PlaguedDerpling.cs index 8e04409ddf..4d1bf5158c 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/NormalNPCs/PlaguedDerpling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/NormalNPCs/PlaguedFlyingFox.cs index 74e0885bdc..0e6c836e9d 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/NormalNPCs/PlaguedFlyingFox.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index 8651394bcb..1708341dfa 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + Main.PlaySound(SoundID.Item42, npc.position); for (int n = 0; n < 5; n++) { Vector2 vector4 = new Vector2((float)(n - 2), -4f); @@ -89,7 +89,7 @@ namespace CalamityMod.NPCs.NormalNPCs } if (Main.netMode != NetmodeID.MultiplayerClient && spikeTimer == 0f) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + Main.PlaySound(SoundID.Item42, npc.position); num15 = Main.player[npc.target].position.Y - vector3.Y - (float)Main.rand.Next(0, 200); num16 = (float)Math.Sqrt((double)(num14 * num14 + num15 * num15)); num16 = 6.5f / num16; diff --git a/NPCs/NormalNPCs/PlaguedTortoise.cs b/NPCs/NormalNPCs/PlaguedTortoise.cs index 08164a87c6..d4cadecabf 100644 --- a/NPCs/NormalNPCs/PlaguedTortoise.cs +++ b/NPCs/NormalNPCs/PlaguedTortoise.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 66d98187e3..79c8c213ed 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 72; npc.height = 36; npc.defense = 50; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 6000; npc.knockBackResist = 0f; aiType = -1; diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index 940d89409f..d4cc3fcc53 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index f57e8568d5..1f08cf8a7a 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 46; npc.height = 32; npc.defense = 30; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.scale = 1.5f; npc.lifeMax = 580; npc.knockBackResist = 0.2f; diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 4dc15764e3..d5cd1f51e2 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using System; @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 160; npc.height = 160; npc.defense = 38; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = 16000; npc.knockBackResist = 0f; aiType = -1; diff --git a/NPCs/NormalNPCs/SeaUrchin.cs b/NPCs/NormalNPCs/SeaUrchin.cs index 1c7ad00001..81f65f4314 100644 --- a/NPCs/NormalNPCs/SeaUrchin.cs +++ b/NPCs/NormalNPCs/SeaUrchin.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Rogue; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class SeaUrchin : ModNPC + public class SeaUrchin : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index a3a866540a..48df531d90 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using System; @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 64; npc.height = 38; npc.defense = 15; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 150; npc.aiStyle = -1; aiType = -1; @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.NormalNPCs } } } - Main.PlaySound(2, (int)npc.Center.X, (int)npc.Center.Y, 12); + Main.PlaySound(SoundID.Item12, npc.position); } npc.netUpdate = true; } diff --git a/NPCs/NormalNPCs/StormlionCharger.cs b/NPCs/NormalNPCs/StormlionCharger.cs index 35e829f2ae..78954750dc 100644 --- a/NPCs/NormalNPCs/StormlionCharger.cs +++ b/NPCs/NormalNPCs/StormlionCharger.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index 2dcb9cbcba..3738c615ef 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index f6ab96e2f4..22a827bbf5 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using System; diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 9309c90dd6..6eca11ab16 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.width = 80; npc.height = 140; npc.defense = 18; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = 6000; if (CalamityWorld.downedProvidence) { diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index ddd37ad72e..126d245e90 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; using Terraria; diff --git a/NPCs/NormalNPCs/WulfrumSlime.cs b/NPCs/NormalNPCs/WulfrumSlime.cs index 01227d0823..e222977360 100644 --- a/NPCs/NormalNPCs/WulfrumSlime.cs +++ b/NPCs/NormalNPCs/WulfrumSlime.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.ID; diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 77993c29e4..177ab2c180 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -12,7 +11,6 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; using System; -using System.Collections.Generic; using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -20,12 +18,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Dusts; -using CalamityMod.Projectiles; using CalamityMod.World; namespace CalamityMod.NPCs.OldDuke { - [AutoloadBossHead] + [AutoloadBossHead] public class OldDuke : ModNPC { public override void SetStaticDefaults() @@ -42,10 +39,8 @@ namespace CalamityMod.NPCs.OldDuke npc.aiStyle = -1; aiType = -1; npc.damage = 200; - npc.defense = 140; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = 0.6f; - global.customDR = true; + npc.defense = 100; + npc.DR_NERD(0.5f, null, null, null, true); npc.lifeMax = CalamityWorld.revenge ? 1000000 : 750000; npc.knockBackResist = 0f; npc.noTileCollide = true; @@ -224,7 +219,7 @@ namespace CalamityMod.NPCs.OldDuke color = lightColor; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += num154) { @@ -277,7 +272,7 @@ namespace CalamityMod.NPCs.OldDuke scaleFactor9 = 20f; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num160 = 0; num160 < num156; num160++) { @@ -333,7 +328,7 @@ namespace CalamityMod.NPCs.OldDuke color40 *= num162; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163 += num154) { diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index 029140b609..3fd351f0c3 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using System; using System.IO; using Microsoft.Xna.Framework; @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.OldDuke else npc.velocity = new Vector2(npc.ai[2], npc.ai[3]); - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath19, npc.position); } npc.ai[1] += 1f; @@ -163,7 +163,7 @@ namespace CalamityMod.NPCs.OldDuke float amount9 = 0.5f; int num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -201,10 +201,10 @@ namespace CalamityMod.NPCs.OldDuke } public override bool CheckDead() - { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 12); + { + Main.PlaySound(SoundID.NPCDeath12, npc.position); - npc.position.X = npc.position.X + (npc.width / 2); + npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = npc.height = 96; npc.position.X = npc.position.X - (npc.width / 2); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index ef7bca6f13..f8b53ba23f 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using System; using System.IO; @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.OldDuke public override bool CheckDead() { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 12); + Main.PlaySound(SoundID.Item14, npc.position); npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index eb2965af08..b061a46aef 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -9,11 +8,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorBodyLarge : ModNPC + public class PerforatorBodyLarge : ModNPC { public override void SetStaticDefaults() { @@ -28,7 +25,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 60; npc.defense = 8; npc.LifeMaxNERB(2500, 2700, 800000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 7c1378e576..c789d3039e 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -9,11 +8,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorBodyMedium : ModNPC + public class PerforatorBodyMedium : ModNPC { public override void SetStaticDefaults() { @@ -28,7 +25,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 54; npc.defense = 6; npc.LifeMaxNERB(2000, 2200, 700000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 2ee3619aa9..c86879ab83 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -9,11 +8,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorBodySmall : ModNPC + public class PerforatorBodySmall : ModNPC { public override void SetStaticDefaults() { @@ -28,7 +25,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 42; npc.defense = 4; npc.LifeMaxNERB(1250, 1500, 500000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 049bc41fbe..57972202bc 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index abefdd659e..4d41ba9276 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.World; @@ -9,16 +8,12 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - [AutoloadBossHead] + [AutoloadBossHead] public class PerforatorHeadLarge : ModNPC { private bool flies = false; - private float speed = 17f; - private float turnSpeed = 0.15f; private int minLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 7 : 15; private int maxLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 8 : 16; private bool TailSpawned = false; @@ -36,7 +31,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 84; npc.defense = 4; npc.LifeMaxNERB(2500, 2700, 800000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; @@ -55,14 +50,32 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - float speedMult = expertMode ? 1.5f : 1.425f; - if (CalamityWorld.bossRushActive) - speedMult = 3f; - float speedBoost = death ? speedMult : speedMult - ((float)npc.life / (float)npc.lifeMax); - speed = 17f * speedBoost; - turnSpeed = 0.15f * speedBoost; - if (npc.ai[3] > 0f) + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + float speed = 12f; + float turnSpeed = 0.1f; + + if (expertMode) + { + speed += death ? 9f : 9f * (1f - lifeRatio); + turnSpeed += death ? 0.08f : 0.08f * (1f - lifeRatio); + } + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (CalamityWorld.bossRushActive) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } @@ -71,14 +84,15 @@ namespace CalamityMod.NPCs.Perforator { npc.TargetClosest(true); } + Player player = Main.player[npc.target]; - npc.velocity.Length(); npc.alpha -= 42; if (npc.alpha < 0) { npc.alpha = 0; } + if (!TailSpawned) { int Previous = npc.whoAmI; @@ -101,7 +115,7 @@ namespace CalamityMod.NPCs.Perforator Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -265,7 +279,7 @@ namespace CalamityMod.NPCs.Perforator num195 = 20f; } npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1); } num193 = (float)Math.Sqrt((double)(num191 * num191 + num192 * num192)); float num196 = Math.Abs(num191); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 8882bb537c..c00967cffc 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,16 +7,12 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - [AutoloadBossHead] + [AutoloadBossHead] public class PerforatorHeadMedium : ModNPC { private bool flies = false; - private float speed = 19f; - private float turnSpeed = 0.17f; private int minLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 5 : 10; private int maxLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 6 : 11; private bool TailSpawned = false; @@ -35,7 +30,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 68; npc.defense = 2; npc.LifeMaxNERB(2000, 2200, 700000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; @@ -55,14 +50,32 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - float speedMult = expertMode ? 1.5f : 1.425f; - if (CalamityWorld.bossRushActive) - speedMult = 3f; - float speedBoost = death ? speedMult : speedMult - ((float)npc.life / (float)npc.lifeMax); - speed = 15f * speedBoost; - turnSpeed = 0.13f * speedBoost; - if (npc.ai[3] > 0f) + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + float speed = 14f; + float turnSpeed = 0.12f; + + if (expertMode) + { + speed += death ? 9f : 9f * (1f - lifeRatio); + turnSpeed += death ? 0.08f : 0.08f * (1f - lifeRatio); + } + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (CalamityWorld.bossRushActive) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } @@ -71,14 +84,15 @@ namespace CalamityMod.NPCs.Perforator { npc.TargetClosest(true); } + Player player = Main.player[npc.target]; - npc.velocity.Length(); npc.alpha -= 42; if (npc.alpha < 0) { npc.alpha = 0; } + if (!TailSpawned) { int Previous = npc.whoAmI; @@ -97,7 +111,7 @@ namespace CalamityMod.NPCs.Perforator Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -261,7 +275,7 @@ namespace CalamityMod.NPCs.Perforator num195 = 20f; } npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1); } num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); float num196 = System.Math.Abs(num191); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index c8ebcab0e9..57d5d9aa0f 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using CalamityMod.Items.Materials; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,16 +7,13 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - [AutoloadBossHead] + [AutoloadBossHead] public class PerforatorHeadSmall : ModNPC { + private const int MsgType = 23; private bool flies = false; - private float speed = 21f; - private float turnSpeed = 0.19f; private int minLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 3 : 6; private int maxLength = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 4 : 7; private bool TailSpawned = false; @@ -34,7 +30,7 @@ namespace CalamityMod.NPCs.Perforator npc.width = 42; npc.height = 62; npc.LifeMaxNERB(1250, 1500, 500000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; @@ -53,13 +49,31 @@ namespace CalamityMod.NPCs.Perforator { bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - float speedMult = expertMode ? 1.5f : 1.425f; - if (CalamityWorld.bossRushActive) - speedMult = 3f; - float speedBoost = death ? speedMult : speedMult - ((float)npc.life / (float)npc.lifeMax); - speed = 13f * speedBoost; - turnSpeed = 0.11f * speedBoost; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + float speed = 16f; + float turnSpeed = 0.14f; + + if (expertMode) + { + speed += death ? 9f : 9f * (1f - lifeRatio); + turnSpeed += death ? 0.08f : 0.08f * (1f - lifeRatio); + } + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + + if (CalamityWorld.bossRushActive) + { + speed *= 1.25f; + turnSpeed *= 1.25f; + } + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; @@ -69,14 +83,15 @@ namespace CalamityMod.NPCs.Perforator { npc.TargetClosest(true); } + Player player = Main.player[npc.target]; - npc.velocity.Length(); npc.alpha -= 42; if (npc.alpha < 0) { npc.alpha = 0; } + if (!TailSpawned) { int Previous = npc.whoAmI; @@ -95,7 +110,7 @@ namespace CalamityMod.NPCs.Perforator Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MsgType, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -259,7 +274,7 @@ namespace CalamityMod.NPCs.Perforator num195 = 20f; } npc.soundDelay = (int)num195; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1); } num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); float num196 = System.Math.Abs(num191); diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index fbec41d482..12236b7320 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 100; npc.defense = 4; npc.LifeMaxNERB(3750, 5400, 2700000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.Perforator if (NPC.AnyNPCs(ModContent.NPCType())) wormsAlive++; - if (largeWormAlive) + if (largeWormAlive && expertMode) { npc.dontTakeDamage = true; } @@ -135,7 +135,7 @@ namespace CalamityMod.NPCs.Perforator if (npc.localAI[0] >= (float)Main.rand.Next(300, 901) && npc.position.Y + (float)npc.height < player.position.Y && Vector2.Distance(player.Center, npc.Center) > 80f) { npc.localAI[0] = 0f; - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 20); + Main.PlaySound(SoundID.NPCHit20, npc.position); for (int num621 = 0; num621 < 8; num621++) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 94de9c8080..0a080fffa9 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -1,17 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorTailLarge : ModNPC + public class PerforatorTailLarge : ModNPC { public override void SetStaticDefaults() { @@ -26,7 +22,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 78; npc.defense = 12; npc.LifeMaxNERB(2500, 2700, 800000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 2d82fee146..c6975ee410 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -1,17 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorTailMedium : ModNPC + public class PerforatorTailMedium : ModNPC { public override void SetStaticDefaults() { @@ -26,7 +22,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 58; npc.defense = 10; npc.LifeMaxNERB(2000, 2200, 700000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 9748c62e77..279a23f6fa 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -1,17 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Perforator { - public class PerforatorTailSmall : ModNPC + public class PerforatorTailSmall : ModNPC { public override void SetStaticDefaults() { @@ -26,7 +22,7 @@ namespace CalamityMod.NPCs.Perforator npc.height = 34; npc.defense = 8; npc.LifeMaxNERB(1250, 1500, 500000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index dee7d3f5d4..f0b014e617 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -213,7 +213,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -236,7 +236,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index 4b5933d4ba..2303dc0cfe 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/NormalNPCs/PlagueBeeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 6bdca368de..e72d1990bb 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -180,7 +180,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/PlaguebringerGoliath/PlagueHomingMissileGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override bool CheckDead() { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.Item14, npc.position); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.width = npc.height = 216; diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 3c5911f59f..432e2133e6 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override bool CheckDead() { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 14); + Main.PlaySound(SoundID.Item14, npc.position); npc.position.X = npc.position.X + (float)(npc.width / 2); npc.position.Y = npc.position.Y + (float)(npc.height / 2); npc.damage = 200; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 26d9f78b5a..1c89dbdf70 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -22,8 +22,6 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.PlaguebringerGoliath { [AutoloadBossHead] @@ -54,10 +52,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.width = 198; npc.height = 198; npc.defense = 40; - npc.Calamity().RevPlusDR(0.25f); - npc.LifeMaxNERB(58500, 77275, 3700000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + npc.DR_NERD(0.4f); + npc.LifeMaxNERB(81000, 106500, 3700000); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -124,8 +122,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.width = npc.frame.Width / 2; npc.height = (int)(npc.frame.Height * (charging ? 1.5f : 1.8f)); - // Mode variables - bool death = CalamityWorld.death || CalamityWorld.bossRushActive; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Mode variables + bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; @@ -133,7 +134,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.3f, 0.7f, 0f); // Show message - if (!halfLife && (npc.life <= npc.lifeMax * 0.5 || death)) + if (!halfLife && ((lifeRatio < 0.5f && expertMode) || death)) { string key = "Mods.CalamityMod.PlagueBossText"; Color messageColor = Color.Lime; @@ -164,7 +165,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Defense gain if (expertMode) { - int num1040 = death ? 20 : (int)(20f * (1f - npc.life / (float)npc.lifeMax)); + int num1040 = death ? 20 : (int)(20f * (1f - lifeRatio)); npc.defense = npc.defDefense + num1040; } @@ -177,14 +178,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Distance from target Vector2 distFromPlayer = player.Center - vectorCenter; - // Enrage - bool aboveGroundEnrage = (player.position.Y < Main.worldSurface * 16.0 || player.position.Y > ((Main.maxTilesY - 200) * 16)) && !CalamityWorld.bossRushActive; + // Enrage + int enrageScale = 0; + if ((npc.position.Y / 16f) < Main.worldSurface || (npc.position.Y / 16f) > (Main.maxTilesY - 200)) + enrageScale++; + if (!player.ZoneJungle) + enrageScale++; - bool jungleEnrage = false; - if (!player.ZoneJungle && !CalamityWorld.bossRushActive) - jungleEnrage = true; + if (CalamityWorld.bossRushActive) + enrageScale = 0; - bool diagonalDash = revenge && (npc.life <= npc.lifeMax * 0.8 || death); + bool diagonalDash = revenge && (lifeRatio < 0.8f || death); if (npc.ai[0] != 0f && npc.ai[0] != 4f) { @@ -234,20 +238,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (Main.netMode != NetmodeID.MultiplayerClient) { - float num595 = npc.ai[1]; int num596; - do - { - num596 = Main.rand.Next(3); - if (MissileCountdown == 1) - num596 = 4; - else if (num596 == 1) - num596 = 2; - else if (num596 == 2) - num596 = 3; - } + do num596 = MissileCountdown == 1 ? 4 : Main.rand.Next(4); + while (num596 == npc.ai[1] || num596 == 1); - while (num596 == num595); if (num596 == 0 && diagonalDash && distFromPlayer.Length() < 1800f) { switch (Main.rand.Next(3)) @@ -273,16 +267,16 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else if (npc.ai[0] == 0f) { float num1044 = revenge ? 28f : 26f; - if (aboveGroundEnrage) - num1044 += 6f; - if (npc.life < npc.lifeMax * 0.66 || death) + if (lifeRatio < 0.66f || death) num1044 += 2f; - if (npc.life < npc.lifeMax * 0.33 || death) + if (lifeRatio < 0.33f || death) num1044 += 2f; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num1044 += 2f; - int num1043 = 2; + num1044 += 6f * enrageScale; + + int num1043 = 2 + enrageScale; if ((npc.ai[1] > (2 * num1043) && npc.ai[1] % 2f == 0f) || distFromPlayer.Length() > 1800f) { npc.ai[0] = -1f; @@ -299,7 +293,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float playerLocation = vectorCenter.X - player.Center.X; - if (Math.Abs(npc.Center.Y - (player.Center.Y - chargeDistance)) < 20f) + float num620 = 20f; + num620 += 20 * enrageScale; + + if (Math.Abs(npc.Center.Y - (player.Center.Y - chargeDistance)) < num620) { if (diagonalDash) { @@ -349,23 +346,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float num1048 = revenge ? 14f : 12f; float num1049 = revenge ? 0.25f : 0.22f; - if (npc.life < npc.lifeMax * 0.66 || death) + if (lifeRatio < 0.66f || death) { num1048 += 1f; num1049 += 0.05f; } - if (npc.life < npc.lifeMax * 0.33 || death) + if (lifeRatio < 0.33f || death) { num1048 += 1f; num1049 += 0.05f; } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num1048 += 2f; num1049 += 0.1f; } + num1048 += 3 * enrageScale; + num1049 += 0.5f * enrageScale; - if (vectorCenter.Y < (player.Center.Y - chargeDistance)) + if (vectorCenter.Y < (player.Center.Y - chargeDistance)) npc.velocity.Y += num1049; else npc.velocity.Y -= num1049; @@ -407,16 +406,17 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.spriteDirection = npc.direction; int num1050 = revenge ? 525 : 550; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num1050 = 300; - else if (aboveGroundEnrage || CalamityWorld.bossRushActive) + else if (CalamityWorld.bossRushActive) num1050 = 400; - else if (npc.life < npc.lifeMax * 0.33 || death) + else if (lifeRatio < 0.33f || death) num1050 = revenge ? 450 : 475; - else if (npc.life < npc.lifeMax * 0.66) + else if (lifeRatio < 0.66f) num1050 = revenge ? 475 : 500; + num1050 -= 100 * enrageScale; - int num1051 = 1; + int num1051 = 1; if (vectorCenter.X < player.Center.X) num1051 = -1; @@ -424,8 +424,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { npc.ai[2] = 1f; } + if (enrageScale > 0 && npc.ai[2] == 1f) + npc.velocity *= 0.5f; - if (npc.ai[2] != 1f) + if (npc.ai[2] != 1f) { charging = true; npc.frameCounter = 4; @@ -450,23 +452,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.velocity *= 0.9f; float num1052 = revenge ? 0.12f : 0.1f; - if (npc.life < npc.lifeMax * 0.8 || death) + if (lifeRatio < 0.8f || death) { npc.velocity *= 0.98f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax * 0.6 || death) + if (lifeRatio < 0.6f || death) { npc.velocity *= 0.98f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax * 0.4 || death) + if (lifeRatio < 0.4f || death) { npc.velocity *= 0.98f; num1052 += 0.05f; } + if (enrageScale > 0) + npc.velocity *= 0.7f; - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) { npc.ai[2] = 0f; npc.ai[1] += 1f; @@ -494,14 +498,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float num1057 = (float)Math.Sqrt(num1055 * num1055 + num1056 * num1056); if (num1057 < 600f) { - npc.ai[0] = (npc.life <= npc.lifeMax * 0.66 || death) ? 5f : 1f; + npc.ai[0] = (lifeRatio < 0.66f || death) ? 5f : 1f; npc.ai[1] = 0f; npc.netUpdate = true; return; } // Move closer - Movement(100f, 350f, 450f, player); + Movement(100f, 350f, 450f, player, enrageScale); } // Spawn bees @@ -519,13 +523,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[1] += 1f; npc.ai[1] += num1038 / 2; - if (npc.life < npc.lifeMax * 0.75) + if (lifeRatio < 0.75f) npc.ai[1] += 0.25f; - if (npc.life < npc.lifeMax * 0.5) + if (lifeRatio < 0.5f) npc.ai[1] += 0.25f; bool flag103 = false; - if (npc.ai[1] > 40f) + if (npc.ai[1] > 40f - 12f * enrageScale) { npc.ai[1] = 0f; npc.ai[2] += 1f; @@ -544,10 +548,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else randomAmt = ModContent.NPCType(); - if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < (aboveGroundEnrage ? 4 : 2)) + if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 2) NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - if (revenge && NPC.CountNPCS(ModContent.NPCType()) < (aboveGroundEnrage ? 2 : 1)) + if (revenge && !NPC.AnyNPCs(ModContent.NPCType())) NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (NPC.CountNPCS(ModContent.NPCType()) < 2) @@ -556,7 +560,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Main.npc[num1062].velocity = player.Center - npc.Center; Main.npc[num1062].velocity.Normalize(); - Main.npc[num1062].velocity *= (CalamityWorld.bossRushActive ? 12f : 6f); + Main.npc[num1062].velocity *= CalamityWorld.bossRushActive ? 12f : 6f; Main.npc[num1062].localAI[0] = 60f; Main.npc[num1062].netUpdate = true; @@ -566,7 +570,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer if too far away if (num1060 > 600f) - Movement(100f, 350f, 450f, player); + Movement(100f, 350f, 450f, player, enrageScale); else npc.velocity *= 0.9f; @@ -574,11 +578,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - if (npc.ai[2] > 2f) + if (npc.ai[2] > 3f) { npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; + npc.ai[1] = 2f; + npc.ai[2] = 0f; + npc.netUpdate = true; } } @@ -598,12 +603,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[1] += 1f; npc.ai[1] += num1038 / 2; bool flag103 = false; - if (npc.life < npc.lifeMax * 0.25 || death) + if (lifeRatio < 0.25f || death) npc.ai[1] += 0.25f; - if (npc.life < npc.lifeMax * 0.1 || death) + if (lifeRatio < 0.1f || death) npc.ai[1] += 0.25f; - if (npc.ai[1] > 40f) + if (npc.ai[1] > 40f - 12f * enrageScale) { npc.ai[1] = 0f; npc.ai[2] += 1f; @@ -616,10 +621,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { - if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < (aboveGroundEnrage ? 6 : 4)) + if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 3) NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - if (revenge && NPC.CountNPCS(ModContent.NPCType()) < 1 && aboveGroundEnrage) + if (revenge && !NPC.AnyNPCs(ModContent.NPCType())) NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); float projectileSpeed = revenge ? 6f : 5f; @@ -634,7 +639,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1071 *= num1073; num1072 *= num1073; - if (NPC.CountNPCS(ModContent.NPCType()) < (aboveGroundEnrage ? 8 : 5)) + if (NPC.CountNPCS(ModContent.NPCType()) < 5) { int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); Main.npc[num1062].velocity.X = num1071; @@ -646,7 +651,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Move closer if too far away if (num1060 > 600f) - Movement(100f, 350f, 450f, player); + Movement(100f, 350f, 450f, player, enrageScale); else npc.velocity *= 0.9f; @@ -654,11 +659,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - if (npc.ai[2] > 2f) + if (npc.ai[2] > 3f) { npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; + npc.ai[1] = 2f; + npc.ai[2] = 0f; + npc.netUpdate = true; } } @@ -666,21 +672,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else if (npc.ai[0] == 3f) { Vector2 vector121 = new Vector2(npc.direction == 1 ? npc.getRect().BottomLeft().X : npc.getRect().BottomRight().X, npc.getRect().Bottom().Y - 40f); - vector121.X += (npc.direction * 120); + vector121.X += npc.direction * 120; npc.ai[1] += 1f; - int num650 = ((npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 10 : ((npc.life < npc.lifeMax * 0.1 || death || aboveGroundEnrage) ? 20 : ((npc.life < npc.lifeMax * 0.5) ? 25 : 30))); + int num650 = (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 10 : ((lifeRatio < 0.1f || death) ? 20 : ((lifeRatio < 0.5f) ? 25 : 30)); + num650 -= 5 * enrageScale; - if (npc.ai[1] % (float)num650 == (float)(num650 - 1) && vectorCenter.Y < player.position.Y) + if (npc.ai[1] % num650 == (num650 - 1) && vectorCenter.Y < player.position.Y) { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); if (Main.netMode != NetmodeID.MultiplayerClient) { float projectileSpeed = revenge ? 6.5f : 6f; - if (jungleEnrage || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + projectileSpeed += 7 * enrageScale; + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) projectileSpeed += 10f; - if (CalamityWorld.bossRushActive) + + if (CalamityWorld.bossRushActive) projectileSpeed *= 1.5f; float num1071 = player.position.X + player.width * 0.5f - vector121.X; @@ -695,7 +705,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (expertMode) { num1074 = 32; - int damageBoost = death ? 5 : (int)(6f * (1f - npc.life / (float)npc.lifeMax)); + int damageBoost = death ? 5 : (int)(6f * (1f - lifeRatio)); num1074 += damageBoost; if (Main.rand.NextBool(6)) @@ -716,13 +726,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - Movement(100f, 400f, 500f, player); + Movement(100f, 400f, 500f, player, enrageScale); float playerLocation = vectorCenter.X - player.Center.X; npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - if (npc.ai[1] > (float)num650 * 10f) + if (npc.ai[1] > num650 * 10f) { npc.ai[0] = -1f; npc.ai[1] = 3f; @@ -737,12 +747,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (CalamityWorld.bossRushActive) num1044 = 32f; - int num1043 = 2; + num1044 += 6f * enrageScale; + + int num1043 = 2 + enrageScale; if (npc.ai[1] > (2 * num1043) && npc.ai[1] % 2f == 0f) { MissileCountdown = 0; npc.ai[0] = -1f; - npc.ai[1] = 0f; + npc.ai[1] = -1f; npc.ai[2] = 0f; npc.netUpdate = true; return; @@ -755,7 +767,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float playerLocation = vectorCenter.X - player.Center.X; - if (Math.Abs(vectorCenter.Y - (player.Center.Y - 500f)) < 20f) + float num620 = 20f; + num620 += 20 * enrageScale; + + if (Math.Abs(vectorCenter.Y - (player.Center.Y - 500f)) < num620) { if (MissileCountdown == 1) { @@ -764,10 +779,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { int speed = revenge ? 6 : 5; - if (aboveGroundEnrage) - speed = 8; - if (CalamityWorld.bossRushActive) + speed += 7 * enrageScale; + + if (CalamityWorld.bossRushActive) speed = 12; + int damage = expertMode ? 48 : 60; Vector2 baseVelocity = player.Center - vectorCenter; @@ -811,7 +827,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float num1048 = revenge ? 16f : 14f; float num1049 = revenge ? 0.2f : 0.18f; - if (CalamityWorld.bossRushActive) + num1048 += 3 * enrageScale; + num1049 += 0.5f * enrageScale; + if (CalamityWorld.bossRushActive) { num1048 *= 1.5f; num1049 *= 1.5f; @@ -828,16 +846,16 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.velocity.Y = num1048; if (Math.Abs(vectorCenter.X - player.Center.X) > 600f) - npc.velocity.X += 0.15f * npc.direction; + npc.velocity.X += num1049 * npc.direction; else if (Math.Abs(vectorCenter.X - player.Center.X) < 300f) - npc.velocity.X -= 0.15f * npc.direction; + npc.velocity.X -= num1049 * npc.direction; else npc.velocity.X *= 0.8f; - if (npc.velocity.X < -20f) - npc.velocity.X = -20f; - if (npc.velocity.X > 20f) - npc.velocity.X = 20f; + if (npc.velocity.X < -num1048) + npc.velocity.X = -num1048; + if (npc.velocity.X > num1048) + npc.velocity.X = num1048; npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; @@ -865,8 +883,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath num1051 = -1; if (npc.direction == num1051 && Math.Abs(vectorCenter.X - player.Center.X) > num1050) npc.ai[2] = 1f; + if (enrageScale > 0 && npc.ai[2] == 1f) + npc.velocity *= 0.5f; - if (npc.ai[2] != 1f) + if (npc.ai[2] != 1f) { charging = true; @@ -890,23 +910,25 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.velocity *= 0.9f; float num1052 = revenge ? 0.12f : 0.1f; - if (npc.life < npc.lifeMax / 2 || death) + if (lifeRatio < 0.5f || death) { - npc.velocity *= 0.98f; + npc.velocity *= 0.9f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax / 3 || death) + if (lifeRatio < 0.3f || death) { - npc.velocity *= 0.98f; + npc.velocity *= 0.9f; num1052 += 0.05f; } - if (npc.life < npc.lifeMax / 5 || death) + if (lifeRatio < 0.1f || death) { - npc.velocity *= 0.98f; + npc.velocity *= 0.9f; num1052 += 0.05f; } + if (enrageScale > 0) + npc.velocity *= 0.7f; - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) { npc.ai[2] = 0f; npc.ai[1] += 1f; @@ -922,43 +944,52 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } - private void Movement(float xPos, float yPos, float yPos2, Player player) + private void Movement(float xPos, float yPos, float yPos2, Player player, int enrageScale) { - if (npc.position.Y > player.position.Y - yPos) + Vector2 acceleration = new Vector2(CalamityWorld.bossRushActive ? 0.15f : 0.1f, CalamityWorld.bossRushActive ? 0.2f : 0.15f); + Vector2 velocity = new Vector2(8f, 5f); + float deceleration = 0.98f; + + acceleration *= 0.2f * enrageScale + 1f; + velocity *= 0.2f * enrageScale + 1f; + deceleration *= 1f - enrageScale * 0.2f; + + if (npc.position.Y > player.position.Y - yPos) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.98f; - npc.velocity.Y -= (CalamityWorld.bossRushActive ? 0.2f : 0.15f); - if (npc.velocity.Y > 5f) - npc.velocity.Y = 5f; + npc.velocity.Y *= deceleration; + npc.velocity.Y -= acceleration.Y; + if (npc.velocity.Y > velocity.Y) + npc.velocity.Y = velocity.Y; } else if (npc.position.Y < player.position.Y - yPos2) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.98f; - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.2f : 0.15f); - if (npc.velocity.Y < -5f) - npc.velocity.Y = -5f; + npc.velocity.Y *= deceleration; + npc.velocity.Y += acceleration.Y; + if (npc.velocity.Y < -velocity.Y) + npc.velocity.Y = -velocity.Y; } + if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + xPos) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.98f; - npc.velocity.X -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + npc.velocity.X *= deceleration; + npc.velocity.X -= acceleration.X; + if (npc.velocity.X > velocity.X) + npc.velocity.X = velocity.X; } if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - xPos) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.98f; - npc.velocity.X += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + npc.velocity.X *= deceleration; + npc.velocity.X += acceleration.X; + if (npc.velocity.X < -velocity.X) + npc.velocity.X = -velocity.X; } } @@ -1035,7 +1066,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (npc.ai[0] != 0f && npc.ai[0] != 4f) num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -1057,7 +1088,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 8a4a6b5cbb..2667b3c27b 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.width = 66; npc.height = 66; npc.defense = 30; - npc.Calamity().RevPlusDR(0.2f); + npc.DR_NERD(0.2f); npc.lifeMax = 3000; npc.value = Item.buyPrice(0, 1, 50, 0); if (CalamityWorld.bossRushActive) @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.velocity.X = num1045 * num1047; npc.velocity.Y = num1046 * num1047; npc.spriteDirection = npc.direction; - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0); + Main.PlaySound(SoundID.Roar, npc.position); return; } npc.localAI[0] = 0f; @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 8); + Main.PlaySound(SoundID.NPCHit8, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int num1061; @@ -472,7 +472,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } if (flag104 && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && Collision.CanHit(vector121, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 42); + Main.PlaySound(SoundID.Item42, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = 6f; @@ -583,7 +583,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -601,7 +601,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (npc.ai[0] != 0f) num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 4746ec170d..bcfec7683e 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.Polterghast } // Percent life remaining, Polter - float lifeRatio = (float)Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax; + float lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].life / Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax; npc.TargetClosest(true); @@ -95,16 +95,16 @@ namespace CalamityMod.NPCs.Polterghast timer = 0; } - Player player = Main.player[npc.target]; - double deg = (double)npc.ai[1]; + NPC parent = Main.npc[NPC.FindFirstNPC(ModContent.NPCType())]; + double deg = npc.ai[1]; double rad = deg * (Math.PI / 180); double dist = 500; - npc.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; float SPEEN = 1f - lifeRatio * 2f; if (SPEEN < 0f) SPEEN = 0f; - npc.ai[1] += 0.5f + SPEEN; //1f + npc.ai[1] += 0.5f + SPEEN; return false; } @@ -125,28 +125,28 @@ namespace CalamityMod.NPCs.Polterghast spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = Main.npcTexture[npc.type]; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = lightColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 23b57bdd04..6cf45bee81 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -8,8 +8,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Polterghast { @@ -31,8 +29,8 @@ namespace CalamityMod.NPCs.Polterghast npc.width = 90; npc.height = 120; npc.LifeMaxNERB(130000, 150000, 900000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -85,7 +83,7 @@ namespace CalamityMod.NPCs.Polterghast return; } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.5f, 0.25f, 0.75f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.5f, 0.25f, 0.75f); npc.TargetClosest(true); @@ -120,12 +118,12 @@ namespace CalamityMod.NPCs.Polterghast } num = num733; } - num730 /= (float)num732; - num731 /= (float)num732; + num730 /= num732; + num731 /= num732; float num734 = 3f; float num735 = 0.03f; - if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive && (double)Main.player[npc.target].position.Y < Main.worldSurface * 16.0) + if (!Main.player[npc.target].ZoneDungeon && !CalamityWorld.bossRushActive && Main.player[npc.target].position.Y < Main.worldSurface * 16.0) { despawnTimer--; if (despawnTimer <= 0) @@ -140,19 +138,17 @@ namespace CalamityMod.NPCs.Polterghast if (Main.npc[CalamityGlobalNPC.ghostBoss].ai[2] < 300f) { - num734 = 18.5f; - num735 = 0.12f; + num734 = 21f; + num735 = 0.13f; } - if (expertMode) - { - num734 += revenge ? 1.5f : 1f; - num734 *= revenge ? 1.2f : 1.1f; - num735 += revenge ? 0.015f : 0.01f; - num735 *= revenge ? 1.2f : 1.1f; - } + if (expertMode) + { + num734 += revenge ? 5f : 3.5f; + num735 += revenge ? 0.035f : 0.025f; + } - Vector2 vector91 = new Vector2(num730, num731); + Vector2 vector91 = new Vector2(num730, num731); float num736 = Main.player[npc.target].Center.X - vector91.X; float num737 = Main.player[npc.target].Center.Y - vector91.Y; @@ -163,16 +159,16 @@ namespace CalamityMod.NPCs.Polterghast num734 += 8f; } - float num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); + float num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); int num739 = 500; if (speedBoost1) num739 += 500; if (expertMode) num739 += 150; - if (num738 >= (float)num739) + if (num738 >= num739) { - num738 = (float)num739 / num738; + num738 = num739 / num738; num736 *= num738; num737 *= num738; } @@ -182,7 +178,7 @@ namespace CalamityMod.NPCs.Polterghast vector91 = new Vector2(vector.X, vector.Y); num736 = num730 - vector91.X; num737 = num731 - vector91.Y; - num738 = (float)Math.Sqrt((double)(num736 * num736 + num737 * num737)); + num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); if (num738 < num734) { @@ -224,7 +220,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector92 = new Vector2(vector.X, vector.Y); float num740 = Main.player[npc.target].Center.X - vector92.X; float num741 = Main.player[npc.target].Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f; + npc.rotation = (float)Math.Atan2(num741, num740) + 1.57f; npc.damage = npc.defDamage; @@ -251,7 +247,7 @@ namespace CalamityMod.NPCs.Polterghast float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 7a8b222ab1..929cc20908 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1,4 +1,3 @@ -using CalamityMod; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; @@ -23,10 +22,9 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; namespace CalamityMod.NPCs.Polterghast { - [AutoloadBossHead] + [AutoloadBossHead] public class Polterghast : ModNPC { private int despawnTimer = 600; @@ -49,13 +47,11 @@ namespace CalamityMod.NPCs.Polterghast npc.width = 90; npc.height = 120; npc.defense = 90; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = 0.15f; - global.customDR = true; - global.multDRReductions.Add(BuffID.Ichor, 0.88f); + npc.DR_NERD(0.15f, null, null, null, true); + CalamityGlobalNPC global = npc.Calamity(); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.LifeMaxNERB(412500, 495000, 3250000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -114,17 +110,20 @@ namespace CalamityMod.NPCs.Polterghast if (CalamityGlobalNPC.ghostBossClone != -1) cloneAlive = Main.npc[CalamityGlobalNPC.ghostBossClone].active; - // Variables - Vector2 vector = npc.Center; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + // Variables + Vector2 vector = npc.Center; bool speedBoost = false; bool despawnBoost = false; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; - bool phase2 = npc.life < npc.lifeMax * (death ? 0.9 : 0.75); //hooks fire beams - bool phase3 = npc.life < npc.lifeMax * (revenge ? (death ? 0.8 : 0.5) : 0.33); //hooks stop shooting and polter begins charging with ghosts spinning around player - bool phase4 = npc.life < npc.lifeMax * (revenge ? (death ? 0.5 : 0.33) : 0.2); //starts spitting ghost dudes - bool phase5 = npc.life < npc.lifeMax * (revenge ? (death ? 0.25 : 0.1) : 0.05); //starts moving incredibly fast + bool phase2 = lifeRatio < (death ? 0.9f : 0.75f); + bool phase3 = lifeRatio < (revenge ? (death ? 0.8f : 0.5f) : 0.33f); + bool phase4 = lifeRatio < (revenge ? (death ? 0.5f : 0.33f) : 0.2f); + bool phase5 = lifeRatio < (revenge ? (death ? 0.25f : 0.1f) : 0.05f); // Target npc.TargetClosest(true); @@ -182,8 +181,10 @@ namespace CalamityMod.NPCs.Polterghast // Velocity and acceleration bool charging = npc.ai[2] >= 300f; bool reset = npc.ai[2] >= 600f; - float num734 = 2.5f; - float num735 = 0.025f; + float speedUpDistance = 480f - 360f * (1f - lifeRatio); + bool speedUp = Vector2.Distance(player.Center, npc.Center) > speedUpDistance; // 30 or 40 tile distance + float velocity = 10f; // max should be 21 + float acceleration = 0.05f; // max should be 0.13 if (!player.ZoneDungeon && !CalamityWorld.bossRushActive && player.position.Y < Main.worldSurface * 16.0) { despawnTimer--; @@ -191,8 +192,8 @@ namespace CalamityMod.NPCs.Polterghast despawnBoost = true; speedBoost = true; - num734 += 2f; - num735 += 0.025f; + velocity += 5f; + acceleration += 0.05f; } else despawnTimer++; @@ -207,16 +208,16 @@ namespace CalamityMod.NPCs.Polterghast if (phase2) { - num734 += 1.5f; - num735 += 0.01f; + velocity += 2.5f; + acceleration += 0.02f; } if (!phase3) { if (charging) { - num734 += phase2 ? 9.5f : 8.5f; - num735 += phase2 ? 0.05f : 0.045f; + velocity += phase2 ? 4.5f : 3.5f; + acceleration += phase2 ? 0.03f : 0.025f; } npc.ai[2] += 1f; @@ -230,25 +231,25 @@ namespace CalamityMod.NPCs.Polterghast { if (charging) { - num734 += phase5 ? 14.5f : 10.5f; - num735 += phase5 ? 0.085f : 0.055f; + velocity += phase5 ? 8.5f : 4.5f; + acceleration += phase5 ? 0.06f : 0.03f; } else { if (phase5) { - num734 += 1.5f; - num735 += 0.015f; + velocity += 1.5f; + acceleration += 0.015f; } else if (phase4) { - num734 += 1f; - num735 += 0.01f; + velocity += 1f; + acceleration += 0.01f; } else { - num734 += 0.5f; - num735 += 0.005f; + velocity += 0.5f; + acceleration += 0.005f; } } @@ -260,17 +261,63 @@ namespace CalamityMod.NPCs.Polterghast } } - // Set DR based on phase - float dr = phase3 ? phase3DR : phase2 ? phase2DR : phase1DR; - npc.Calamity().DR = dr; + if (expertMode) + { + velocity += revenge ? 5f : 3.5f; + acceleration += revenge ? 0.035f : 0.025f; + } - if (expertMode) - { - num734 += revenge ? 1.5f : 1f; - num734 *= revenge ? 1.2f : 1.1f; - num735 += revenge ? 0.015f : 0.01f; - num735 *= revenge ? 1.2f : 1.1f; - } + // Move faster if inside active tiles + int radius = 2; // 2 tile radius + int diameter = radius * 2; + int npcCenterX = (int)(npc.Center.X / 16f); + int npcCenterY = (int)(npc.Center.Y / 16f); + Rectangle area = new Rectangle(npcCenterX - radius, npcCenterY - radius, diameter, diameter); + bool insideTiles = false; + for (int x = area.Left; x < area.Right; x++) + { + for (int y = area.Top; y < area.Bottom; y++) + { + if (Main.tile[x, y] != null) + { + if (Main.tile[x, y].nactive() && Main.tileSolid[Main.tile[x, y].type] && !Main.tileSolidTop[Main.tile[x, y].type] && !TileID.Sets.Platforms[Main.tile[x, y].type]) + insideTiles = true; + } + } + } + + // Slow down if close to target and not inside tiles + if (!speedUp && !insideTiles && !charging) + { + velocity = 8f; + acceleration = 0.035f; + } + + // Detect active tiles around Plantera + radius = 20; // 20 tile radius + diameter = radius * 2; + area = new Rectangle(npcCenterX - radius, npcCenterY - radius, diameter, diameter); + int nearbyActiveTiles = 0; // 0 to 1600 + for (int x = area.Left; x < area.Right; x++) + { + for (int y = area.Top; y < area.Bottom; y++) + { + if (Main.tile[x, y] != null) + { + if (Main.tile[x, y].nactive() && Main.tileSolid[Main.tile[x, y].type] && !Main.tileSolidTop[Main.tile[x, y].type] && !TileID.Sets.Platforms[Main.tile[x, y].type]) + nearbyActiveTiles++; + } + } + } + + // Scale multiplier based on nearby active tiles + float tileEnrageMult = 1f; + if (nearbyActiveTiles < 800) + tileEnrageMult += (800 - nearbyActiveTiles) * 0.001f; // Ranges from 1f to 1.8f + + // Set DR based on phase + float dr = phase3 ? phase3DR : phase2 ? phase2DR : phase1DR; + npc.Calamity().DR = dr; Vector2 vector91 = new Vector2(num730, num731); float num736 = player.Center.X - vector91.X; @@ -280,7 +327,7 @@ namespace CalamityMod.NPCs.Polterghast { num737 *= -1f; num736 *= -1f; - num734 += 10f; + velocity += 10f; } float num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); @@ -290,7 +337,11 @@ namespace CalamityMod.NPCs.Polterghast if (expertMode) num739 += 150; - if (num738 >= num739) + // Increase speed based on nearby active tiles + velocity *= tileEnrageMult; + acceleration *= tileEnrageMult; + + if (num738 >= num739) { num738 = num739 / num738; num736 *= num738; @@ -304,14 +355,14 @@ namespace CalamityMod.NPCs.Polterghast num737 = num731 - vector91.Y; num738 = (float)Math.Sqrt(num736 * num736 + num737 * num737); - if (num738 < num734) + if (num738 < velocity) { num736 = npc.velocity.X; num737 = npc.velocity.Y; } else { - num738 = num734 / num738; + num738 = velocity / num738; num736 *= num738; num737 *= num738; } @@ -323,30 +374,37 @@ namespace CalamityMod.NPCs.Polterghast if (npc.velocity.X < num736) { - npc.velocity.X += num735; + npc.velocity.X += acceleration; if (npc.velocity.X < 0f && num736 > 0f) - npc.velocity.X += num735 * 2f; + npc.velocity.X += acceleration * 2f; } else if (npc.velocity.X > num736) { - npc.velocity.X -= num735; + npc.velocity.X -= acceleration; if (npc.velocity.X > 0f && num736 < 0f) - npc.velocity.X -= num735 * 2f; + npc.velocity.X -= acceleration * 2f; } if (npc.velocity.Y < num737) { - npc.velocity.Y += num735; + npc.velocity.Y += acceleration; if (npc.velocity.Y < 0f && num737 > 0f) - npc.velocity.Y += num735 * 2f; + npc.velocity.Y += acceleration * 2f; } else if (npc.velocity.Y > num737) { - npc.velocity.Y -= num735; + npc.velocity.Y -= acceleration; if (npc.velocity.Y > 0f && num737 < 0f) - npc.velocity.Y -= num735 * 2f; + npc.velocity.Y -= acceleration * 2f; } - if (!phase2 && !phase3) + // Slow down considerably if near player + if (!speedUp && nearbyActiveTiles > 800 && !insideTiles && !charging) + { + if (npc.velocity.Length() > velocity) + npc.velocity *= 0.97f; + } + + if (!phase2 && !phase3) { npc.damage = npc.defDamage; npc.defense = npc.defDefense; @@ -357,13 +415,13 @@ namespace CalamityMod.NPCs.Polterghast npc.damage *= 2; } - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient && !charging) { npc.localAI[1] += expertMode ? 1.5f : 1f; if (speedBoost || CalamityWorld.bossRushActive) npc.localAI[1] += 3f; - if (npc.localAI[1] >= 40f) + if (npc.localAI[1] >= 80f) { npc.localAI[1] = 0f; @@ -376,64 +434,85 @@ namespace CalamityMod.NPCs.Polterghast if (flag47) { - float num742 = CalamityWorld.bossRushActive ? 7f : 5f; - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num742 *= 2f; - - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num743 = player.position.X + player.width * 0.5f - vector93.X; - float num744 = player.position.Y + player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - - int num746 = expertMode ? 48 : 60; - int num747 = ModContent.ProjectileType(); + int damage = expertMode ? 48 : 60; + int type = ModContent.ProjectileType(); if (Main.rand.NextBool(3)) { - num746 = expertMode ? 60 : 70; + damage = expertMode ? 60 : 70; npc.localAI[1] = -30f; - num747 = ModContent.ProjectileType(); + type = ModContent.ProjectileType(); } - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num746 *= 2; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + damage *= 2; - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = CalamityWorld.bossRushActive ? 7f : 5f; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + num742 *= 2f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = num747 == ModContent.ProjectileType() ? 300 : 1200; - } + float num743 = player.position.X + player.width * 0.5f - vector93.X; + float num744 = player.position.Y + player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + + int numProj = 4; + int spread = 45; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + int proj = Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[proj].timeLeft = type == ModContent.ProjectileType() ? 300 : 1200; + } + } else { - float num742 = CalamityWorld.bossRushActive ? 14f : 11f; - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num742 *= 2f; + int damage = expertMode ? 60 : 70; + int type = ModContent.ProjectileType(); - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num743 = player.position.X + player.width * 0.5f - vector93.X; - float num744 = player.position.Y + player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + damage *= 2; - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = CalamityWorld.bossRushActive ? 14f : 10f; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + num742 *= 2f; - int num746 = expertMode ? 60 : 70; - int num747 = ModContent.ProjectileType(); - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num746 *= 2; + float num743 = player.position.X + player.width * 0.5f - vector93.X; + float num744 = player.position.Y + player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 180; - } + int numProj = 4; + int spread = 60; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + int proj = Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[proj].timeLeft = 180; + } + } } } } @@ -443,7 +522,7 @@ namespace CalamityMod.NPCs.Polterghast { npc.ai[0] += 1f; - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + Main.PlaySound(SoundID.Item122, npc.position); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f); @@ -477,19 +556,19 @@ namespace CalamityMod.NPCs.Polterghast npc.damage = (int)(npc.defDamage * 1.2f); npc.defense = (int)(npc.defDefense * 0.8f); - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { npc.defense *= 2; npc.damage *= 2; } - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient && !charging) { npc.localAI[1] += expertMode ? 1.5f : 1f; if (speedBoost || CalamityWorld.bossRushActive) npc.localAI[1] += 3f; - if (npc.localAI[1] >= 36f) + if (npc.localAI[1] >= 90f) { npc.localAI[1] = 0f; @@ -502,65 +581,85 @@ namespace CalamityMod.NPCs.Polterghast if (flag47) { - float num742 = CalamityWorld.bossRushActive ? 8f : 6f; - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num742 *= 2f; + int damage = expertMode ? 53 : 65; + int type = ModContent.ProjectileType(); - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num743 = player.position.X + player.width * 0.5f - vector93.X; - float num744 = player.position.Y + player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + if (Main.rand.NextBool(3)) + { + damage = expertMode ? 65 : 75; + npc.localAI[1] = -30f; + type = ModContent.ProjectileType(); + } - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + damage *= 2; - int num746 = expertMode ? 53 : 65; - int num747 = ModContent.ProjectileType(); + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = CalamityWorld.bossRushActive ? 8f : 6f; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + num742 *= 2f; - if (Main.rand.NextBool(3)) - { - num746 = expertMode ? 65 : 75; - npc.localAI[1] = -30f; - num747 = ModContent.ProjectileType(); - } + float num743 = player.position.X + player.width * 0.5f - vector93.X; + float num744 = player.position.Y + player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num746 *= 2; + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = num747 == ModContent.ProjectileType() ? 300 : 1200; - } + int numProj = 5; + int spread = 60; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + int proj = Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[proj].timeLeft = type == ModContent.ProjectileType() ? 300 : 1200; + } + } else { - float num742 = CalamityWorld.bossRushActive ? 14f : 11f; - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num742 *= 2f; + int damage = expertMode ? 65 : 75; + int type = ModContent.ProjectileType(); - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num743 = player.position.X + player.width * 0.5f - vector93.X; - float num744 = player.position.Y + player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + damage *= 2; - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = CalamityWorld.bossRushActive ? 14f : 10f; + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + num742 *= 2f; - int num746 = expertMode ? 65 : 75; - int num747 = ModContent.ProjectileType(); + float num743 = player.position.X + player.width * 0.5f - vector93.X; + float num744 = player.position.Y + player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - num746 *= 2; + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - - int num748 = Projectile.NewProjectile(vector93.X, vector93.Y, num743, num744, num747, num746, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num748].timeLeft = 240; - } + int numProj = 5; + int spread = 80; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + int proj = Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[proj].timeLeft = 240; + } + } } } } @@ -568,7 +667,7 @@ namespace CalamityMod.NPCs.Polterghast { npc.HitSound = SoundID.NPCHit36; - if (!spawnGhost) + if (!spawnGhost && expertMode) { spawnGhost = true; @@ -578,15 +677,13 @@ namespace CalamityMod.NPCs.Polterghast for (int I = 0; I < 3; I++) { - int Phantom = NPC.NewNPC((int)(player.Center.X + (Math.Sin(I * 120) * 500)), - (int)(player.Center.Y + (Math.Cos(I * 120) * 500)), ModContent.NPCType(), 0, 0, 0, 0, -1); - NPC Eye = Main.npc[Phantom]; - Eye.ai[0] = I * 120; - Eye.ai[3] = I * 120; + int spawn = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 120) * 500)), (int)(npc.Center.Y + (Math.Cos(I * 120) * 500)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); + NPC npc2 = Main.npc[spawn]; + npc2.ai[0] = I * 120; } } - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + Main.PlaySound(SoundID.Item122, npc.position); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Polt2"), 1f); @@ -620,50 +717,53 @@ namespace CalamityMod.NPCs.Polterghast npc.damage = (int)(npc.defDamage * 1.4f); npc.defense = (int)(npc.defDefense * 0.5f); - if (speedBoost || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (speedBoost || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { npc.defense *= 2; npc.damage *= 2; } npc.ai[1] += 1f; - if (npc.ai[1] >= 420f && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + if (npc.ai[1] >= 210f && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { npc.ai[1] = 0f; - Vector2 vector93 = new Vector2(vector.X, vector.Y); - float num742 = CalamityWorld.bossRushActive ? 7f : 5f; - float num743 = player.position.X + player.width * 0.5f - vector93.X; - float num744 = player.position.Y + player.height * 0.5f - vector93.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - vector93.X += num743 * 3f; - vector93.Y += num744 * 3f; - - int damage = expertMode ? 53 : 65; - int numProj = 4; - int spread = 45; - float rotation = MathHelper.ToRadians(spread); - float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); - double startAngle = Math.Atan2(num743, num744) - rotation / 2; - double deltaAngle = rotation / numProj; - double offsetAngle; - int type = ModContent.ProjectileType(); - for (int i = 0; i < numProj; i++) + if (Main.netMode != NetmodeID.MultiplayerClient && !charging) { - offsetAngle = startAngle + deltaAngle * i; - if (i == 1 || i == 2) - type = ModContent.ProjectileType(); - Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Vector2 vector93 = new Vector2(vector.X, vector.Y); + float num742 = CalamityWorld.bossRushActive ? 7f : 5f; + float num743 = player.position.X + player.width * 0.5f - vector93.X; + float num744 = player.position.Y + player.height * 0.5f - vector93.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + vector93.X += num743 * 3f; + vector93.Y += num744 * 3f; + + int damage = expertMode ? 53 : 65; + int numProj = 6; + int spread = 90; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + int type = ModContent.ProjectileType(); + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + if (i == 1 || i == 2) + type = ModContent.ProjectileType(); + Projectile.NewProjectile(vector93.X, vector93.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + } } } if (phase4) { npc.localAI[1] += 1f; - if (npc.localAI[1] >= 150f) + if (npc.localAI[1] >= 420f) { npc.localAI[1] = 0f; @@ -774,7 +874,7 @@ namespace CalamityMod.NPCs.Polterghast float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -798,7 +898,7 @@ namespace CalamityMod.NPCs.Polterghast Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index c1b0cb56f2..0a5637ecec 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -45,18 +45,22 @@ namespace CalamityMod.NPCs.Polterghast { writer.Write(phase2); writer.Write(despawnTimer); - } + writer.Write(npc.localAI[0]); + writer.Write(npc.localAI[1]); + } public override void ReceiveExtraAI(BinaryReader reader) { phase2 = reader.ReadBoolean(); despawnTimer = reader.ReadInt32(); - } + npc.localAI[0] = reader.ReadSingle(); + npc.localAI[1] = reader.ReadSingle(); + } public override void AI() { // Emit light - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.3f, 0.3f); + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 0.3f, 0.3f); // Bools bool speedBoost = false; @@ -82,11 +86,11 @@ namespace CalamityMod.NPCs.Polterghast } // Percent life remaining, Polter - float lifeRatio = (float)Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax; + float lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax; // Despawn if (CalamityGlobalNPC.ghostBoss != -1 && !player.ZoneDungeon && - (double)player.position.Y < Main.worldSurface * 16.0 && !CalamityWorld.bossRushActive) + player.position.Y < Main.worldSurface * 16.0 && !CalamityWorld.bossRushActive) { despawnTimer--; if (despawnTimer <= 0) @@ -108,10 +112,10 @@ namespace CalamityMod.NPCs.Polterghast Movement(phase2, expertMode, revenge, death, speedBoost, despawnBoost, lifeRatio, player); // Fire projectiles - Vector2 vector17 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num147 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector17.X; - float num148 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector17.Y; - float num149 = (float)Math.Sqrt((double)(num147 * num147 + num148 * num148)); + Vector2 vector17 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num147 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector17.X; + float num148 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector17.Y; + float num149 = (float)Math.Sqrt(num147 * num147 + num148 * num148); num149 = 4f / num149; num147 *= num149; @@ -141,9 +145,9 @@ namespace CalamityMod.NPCs.Polterghast if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 20f) { - float num151 = 1.5f; - int num152 = expertMode ? 48 : 60; - int num153 = ModContent.ProjectileType(); + float num151 = CalamityWorld.bossRushActive ? 7f : 5f; + int num152 = expertMode ? 48 : 60; + int num153 = ModContent.ProjectileType(); num149 = num151 / num149; num147 *= num149; num148 *= num149; @@ -165,15 +169,15 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector92 = new Vector2(npc.Center.X, npc.Center.Y); float num740 = Main.player[npc.target].Center.X - vector92.X; float num741 = Main.player[npc.target].Center.Y - vector92.Y; - npc.rotation = (float)Math.Atan2((double)num741, (double)num740) + 1.57f; + npc.rotation = (float)Math.Atan2(num741, num740) + 1.57f; } if (Main.netMode == NetmodeID.MultiplayerClient) { if (npc.ai[0] == 0f) - npc.ai[0] = (float)(int)(npc.Center.X / 16f); + npc.ai[0] = (int)(npc.Center.X / 16f); if (npc.ai[1] == 0f) - npc.ai[1] = (float)(int)(npc.Center.X / 16f); + npc.ai[1] = (int)(npc.Center.X / 16f); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -183,7 +187,11 @@ namespace CalamityMod.NPCs.Polterghast float shootBoost = death ? 2f : 2f * (1f - lifeRatio); npc.localAI[0] -= 1f + shootBoost; - if (speedBoost) + if (expertMode) + npc.localAI[0] -= Vector2.Distance(npc.Center, player.Center) * 0.002f; + if (Main.npc[CalamityGlobalNPC.ghostBoss].ai[2] >= 300f) + npc.localAI[0] -= 3f; + if (speedBoost) npc.localAI[0] -= 6f; if (!despawnBoost && npc.localAI[0] <= 0f && npc.ai[0] != 0f) @@ -191,13 +199,13 @@ namespace CalamityMod.NPCs.Polterghast for (int num763 = 0; num763 < 200; num763++) { if (num763 != npc.whoAmI && Main.npc[num763].active && Main.npc[num763].type == npc.type && (Main.npc[num763].velocity.X != 0f || Main.npc[num763].velocity.Y != 0f)) - npc.localAI[0] = (float)Main.rand.Next(30, 121); + npc.localAI[0] = 180f; } } if (npc.localAI[0] <= 0f) { - npc.localAI[0] = (float)Main.rand.Next(150, 301); + npc.localAI[0] = 450f; bool flag50 = false; int num764 = 0; while (!flag50 && num764 <= 1000) @@ -216,7 +224,7 @@ namespace CalamityMod.NPCs.Polterghast num766 = (int)(Main.npc[CalamityGlobalNPC.ghostBoss].position.Y + 400f) / 16; } int num767 = 20; - num767 += (int)(100f * ((float)num764 / 1000f)); + num767 += (int)(100f * (num764 / 1000f)); int num768 = num765 + Main.rand.Next(-num767, num767 + 1); int num769 = num766 + Main.rand.Next(-num767, num767 + 1); try @@ -224,9 +232,10 @@ namespace CalamityMod.NPCs.Polterghast if (WorldGen.SolidTile(num768, num769) || Main.tile[num768, num769].wall > 0) { flag50 = true; - npc.ai[0] = (float)num768; - npc.ai[1] = (float)num769; - npc.netUpdate = true; + npc.ai[0] = num768; + npc.ai[1] = num769; + npc.localAI[1] = Vector2.Distance(npc.Center, player.Center) * 0.01f; + npc.netUpdate = true; } } catch { @@ -240,7 +249,7 @@ namespace CalamityMod.NPCs.Polterghast float velocityBoost = death ? 2f : 2f * (1f - lifeRatio); float velocity = 8f + velocityBoost; if (expertMode) - velocity += 1f; + velocity += npc.localAI[1]; if (revenge) velocity += 1f; if (speedBoost) @@ -251,7 +260,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector95 = new Vector2(npc.Center.X, npc.Center.Y); float num773 = npc.ai[0] * 16f - 8f - vector95.X; float num774 = npc.ai[1] * 16f - 8f - vector95.Y; - float num775 = (float)Math.Sqrt((double)(num773 * num773 + num774 * num774)); + float num775 = (float)Math.Sqrt(num773 * num773 + num774 * num774); if (num775 < 12f + velocity) { npc.velocity.X = num773; @@ -269,7 +278,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y); float num776 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - vector96.X; float num777 = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - vector96.Y; - npc.rotation = (float)Math.Atan2((double)num777, (double)num776) - 1.57f; + npc.rotation = (float)Math.Atan2(num777, num776) - 1.57f; } } } @@ -281,19 +290,19 @@ namespace CalamityMod.NPCs.Polterghast Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); float bossCenterX = Main.npc[CalamityGlobalNPC.ghostBoss].Center.X - center.X; float bossCenterY = Main.npc[CalamityGlobalNPC.ghostBoss].Center.Y - center.Y; - float rotation2 = (float)Math.Atan2((double)bossCenterY, (double)bossCenterX) - 1.57f; + float rotation2 = (float)Math.Atan2(bossCenterY, bossCenterX) - 1.57f; bool draw = true; while (draw) { int chainWidth = 20; //16 24 int chainHeight = 52; //32 16 - float num10 = (float)Math.Sqrt((double)(bossCenterX * bossCenterX + bossCenterY * bossCenterY)); - if (num10 < (float)chainHeight) + float num10 = (float)Math.Sqrt(bossCenterX * bossCenterX + bossCenterY * bossCenterY); + if (num10 < chainHeight) { chainWidth = (int)num10 - chainHeight + chainWidth; draw = false; } - num10 = (float)chainWidth / num10; + num10 = chainWidth / num10; bossCenterX *= num10; bossCenterY *= num10; center.X += bossCenterX; @@ -303,7 +312,7 @@ namespace CalamityMod.NPCs.Polterghast Color color2 = new Color(100, 100, 100, 0); Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain"), new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width, chainWidth)), color2, rotation2, - new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width * 0.5f, (float)ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Height * 0.5f), 1f, SpriteEffects.None, 0f); + new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Width * 0.5f, ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastChain").Height * 0.5f), 1f, SpriteEffects.None, 0f); } } @@ -317,7 +326,7 @@ namespace CalamityMod.NPCs.Polterghast float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -340,7 +349,7 @@ namespace CalamityMod.NPCs.Polterghast texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/PolterghastHookGlow"); Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 1ae31e8fd7..0922938200 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Armor.Vanity; @@ -40,9 +40,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.width = 100; npc.height = 80; npc.defense = 50; - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); npc.LifeMaxNERB(102500, 112500, 1650000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (npc.ai[0] == 2f) num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow"); Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index 26ae268aad..5f5f1215f8 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Typeless; @@ -32,9 +32,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.width = 100; npc.height = 80; npc.defense = 50; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.LifeMaxNERB(40000, 50000, 300000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -254,7 +254,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow"); Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 8fe6427d42..ad91d73b1d 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items; @@ -32,9 +32,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.width = 100; npc.height = 80; npc.defense = 35; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.LifeMaxNERB(25000, 35000, 200000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; @@ -231,7 +231,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Providence/ProvidenceAltGlow.png b/NPCs/Providence/Glowmasks/ProvidenceAltGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceAltGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceAltGlow.png diff --git a/NPCs/Providence/ProvidenceAltGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceAltGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceAltGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceAltGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceAltGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceAltGlow2Night.png new file mode 100644 index 0000000000..04cb6c8f39 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAltGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceAltGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceAltGlowNight.png new file mode 100644 index 0000000000..bbcffd77bf Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAltGlowNight.png differ diff --git a/NPCs/Providence/ProvidenceAttackAltGlow.png b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceAttackAltGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow.png diff --git a/NPCs/Providence/ProvidenceAttackAltGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceAttackAltGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow2Night.png new file mode 100644 index 0000000000..b019542ded Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlowNight.png new file mode 100644 index 0000000000..df0186d580 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAttackAltGlowNight.png differ diff --git a/NPCs/Providence/ProvidenceAttackGlow.png b/NPCs/Providence/Glowmasks/ProvidenceAttackGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceAttackGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceAttackGlow.png diff --git a/NPCs/Providence/ProvidenceAttackGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceAttackGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceAttackGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceAttackGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceAttackGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceAttackGlow2Night.png new file mode 100644 index 0000000000..0ce832dc3f Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAttackGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceAttackGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceAttackGlowNight.png new file mode 100644 index 0000000000..8a8fab82c6 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceAttackGlowNight.png differ diff --git a/NPCs/Providence/ProvidenceDefenseAltGlow.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceDefenseAltGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow.png diff --git a/NPCs/Providence/ProvidenceDefenseAltGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceDefenseAltGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow2Night.png new file mode 100644 index 0000000000..687d9e3336 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlowNight.png new file mode 100644 index 0000000000..3b9c2e7427 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceDefenseAltGlowNight.png differ diff --git a/NPCs/Providence/ProvidenceDefenseGlow.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceDefenseGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceDefenseGlow.png diff --git a/NPCs/Providence/ProvidenceDefenseGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceDefenseGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceDefenseGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceDefenseGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlow2Night.png new file mode 100644 index 0000000000..78d8a5d5df Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceDefenseGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlowNight.png new file mode 100644 index 0000000000..bd27430046 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceDefenseGlowNight.png differ diff --git a/NPCs/Providence/ProvidenceGlow.png b/NPCs/Providence/Glowmasks/ProvidenceGlow.png similarity index 100% rename from NPCs/Providence/ProvidenceGlow.png rename to NPCs/Providence/Glowmasks/ProvidenceGlow.png diff --git a/NPCs/Providence/ProvidenceGlow2.png b/NPCs/Providence/Glowmasks/ProvidenceGlow2.png similarity index 100% rename from NPCs/Providence/ProvidenceGlow2.png rename to NPCs/Providence/Glowmasks/ProvidenceGlow2.png diff --git a/NPCs/Providence/Glowmasks/ProvidenceGlow2Night.png b/NPCs/Providence/Glowmasks/ProvidenceGlow2Night.png new file mode 100644 index 0000000000..d9e79a8288 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceGlow2Night.png differ diff --git a/NPCs/Providence/Glowmasks/ProvidenceGlowNight.png b/NPCs/Providence/Glowmasks/ProvidenceGlowNight.png new file mode 100644 index 0000000000..3d1a8a1623 Binary files /dev/null and b/NPCs/Providence/Glowmasks/ProvidenceGlowNight.png differ diff --git a/NPCs/Providence/ProvSky.cs b/NPCs/Providence/ProvSky.cs index 23a36ae34e..12600cb22e 100644 --- a/NPCs/Providence/ProvSky.cs +++ b/NPCs/Providence/ProvSky.cs @@ -26,21 +26,27 @@ namespace CalamityMod.NPCs.Providence private float GetIntensity() { - if (this.UpdatePIndex()) + if (UpdatePIndex()) { float x = 0f; - if (this.ProvIndex != -1) + if (ProvIndex != -1) { - x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.ProvIndex].Center); + x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[ProvIndex].Center); } - return (1f - Utils.SmoothStep(3000f, 6000f, x)) * 0.25f; + + float spawnAnimationTimer = 180f; + float intensityScalar = 0.25f; + if (Main.npc[CalamityGlobalNPC.holyBoss].Calamity().newAI[3] < spawnAnimationTimer) + intensityScalar = MathHelper.Lerp(0f, intensityScalar, Main.npc[CalamityGlobalNPC.holyBoss].Calamity().newAI[3] / spawnAnimationTimer); + + return (1f - Utils.SmoothStep(3000f, 6000f, x)) * intensityScalar; } return 0f; //0.5 } public override Color OnTileColor(Color inColor) { - float intensity = this.GetIntensity(); + float intensity = GetIntensity(); return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity)); } @@ -67,8 +73,9 @@ namespace CalamityMod.NPCs.Providence { if (maxDepth >= 0 && minDepth < 0) { - float intensity = this.GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(255, 200, 100) * intensity); + float intensity = GetIntensity(); + Color color = Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity); } } diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 792ec416e6..03d02c235c 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -7,11 +7,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Providence { - public class ProvSpawnDefense : ModNPC + public class ProvSpawnDefense : ModNPC { public override void SetStaticDefaults() { @@ -28,14 +26,14 @@ namespace CalamityMod.NPCs.Providence npc.width = 100; npc.height = 80; npc.defense = 50; - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); npc.lifeMax = 25000; if (CalamityWorld.bossRushActive) { npc.lifeMax = 300000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; @@ -154,7 +152,7 @@ namespace CalamityMod.NPCs.Providence float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -177,7 +175,7 @@ namespace CalamityMod.NPCs.Providence texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss2Glow"); Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 904120f137..a7271b8240 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -7,11 +7,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Providence { - public class ProvSpawnHealer : ModNPC + public class ProvSpawnHealer : ModNPC { public override void SetStaticDefaults() { @@ -28,14 +26,14 @@ namespace CalamityMod.NPCs.Providence npc.width = 100; npc.height = 80; npc.defense = 35; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 40000; if (CalamityWorld.bossRushActive) { npc.lifeMax = 400000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; @@ -177,7 +175,7 @@ namespace CalamityMod.NPCs.Providence float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -201,7 +199,7 @@ namespace CalamityMod.NPCs.Providence Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 7b4515a340..65f485cf55 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -8,11 +8,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Providence { - public class ProvSpawnOffense : ModNPC + public class ProvSpawnOffense : ModNPC { public int dustTimer = 3; @@ -31,14 +29,14 @@ namespace CalamityMod.NPCs.Providence npc.width = 100; npc.height = 80; npc.defense = 40; - npc.Calamity().RevPlusDR(0.3f); + npc.DR_NERD(0.3f); npc.lifeMax = 42500; if (CalamityWorld.bossRushActive) { npc.lifeMax = 400000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.noGravity = true; npc.noTileCollide = true; @@ -231,7 +229,7 @@ namespace CalamityMod.NPCs.Providence if (npc.ai[0] == 2f) num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -254,7 +252,7 @@ namespace CalamityMod.NPCs.Providence texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBossGlow"); Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 99de93d7cc..6106fba79d 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.Providence [AutoloadBossHead] public class Providence : ModNPC { + private bool hasTakenDaytimeDamage = false; private bool text = false; private bool useDefenseFrames = false; private float bossLife; @@ -63,19 +64,18 @@ namespace CalamityMod.NPCs.Providence npc.width = 600; npc.height = 450; npc.defense = 50; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = normalDR; - global.customDR = true; - global.flatDRReductions.Add(BuffID.Ichor, 0.05f); + npc.DR_NERD(normalDR, null, null, null, true); + CalamityGlobalNPC global = npc.Calamity(); global.flatDRReductions.Add(BuffID.CursedInferno, 0.05f); npc.LifeMaxNERB(440000, 500000, 12500000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; npc.value = Item.buyPrice(0, 50, 0, 0); npc.boss = true; + npc.Opacity = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -120,6 +120,7 @@ namespace CalamityMod.NPCs.Providence writer.Write(npc.dontTakeDamage); writer.Write(npc.chaseable); writer.Write(npc.canGhostHeal); + writer.Write(npc.localAI[2]); } public override void ReceiveExtraAI(BinaryReader reader) @@ -135,6 +136,7 @@ namespace CalamityMod.NPCs.Providence npc.dontTakeDamage = reader.ReadBoolean(); npc.chaseable = reader.ReadBoolean(); npc.canGhostHeal = reader.ReadBoolean(); + npc.localAI[2] = reader.ReadSingle(); } public override void AI() @@ -155,11 +157,6 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[npc.target]; Vector2 vector = npc.Center; - // Difficulty bools - bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; - bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; - // Target's current biome bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; @@ -167,15 +164,78 @@ namespace CalamityMod.NPCs.Providence // Fire projectiles at normal rate or not bool normalAttackRate = true; - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; + // Is in spawning animation + float spawnAnimationTime = 180f; + bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime; - // Phases - bool ignoreGuardianAmt = lifeRatio < (death ? 0.2f : 0.15f); - bool phase2 = lifeRatio < 0.75f || death; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; - // Projectile fire rate multiplier - double attackRateMult = 1D; + // Night bool + bool nightTime = !Main.dayTime; + + // Play enrage animation if night starts + if (nightTime && calamityGlobalNPC.newAI[3] == spawnAnimationTime) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + } + + // Difficulty bools + bool death = CalamityWorld.death || CalamityWorld.bossRushActive || nightTime; + bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive || nightTime; + bool expertMode = Main.expertMode || CalamityWorld.bossRushActive || nightTime; + + // Projectile damage values + bool scaleExpertProjectileDamage = Main.expertMode && !nightTime; + int holyLaserDamage = 100; + int crystalDamage = scaleExpertProjectileDamage ? 57 : 70; + int holySpearDamage = scaleExpertProjectileDamage ? 52 : 65; + int holyBombDamage = scaleExpertProjectileDamage ? 48 : 60; + int moltenBlastDamage = scaleExpertProjectileDamage ? 42 : 55; + int holyFireDamage = scaleExpertProjectileDamage ? 48 : 60; + int holyBlastDamage = scaleExpertProjectileDamage ? 52 : 65; + + // Increase all projectile damage at night + int projectileDamageNight = 100; + if (nightTime) + { + holyLaserDamage = crystalDamage = holySpearDamage = holyBombDamage = moltenBlastDamage = holyFireDamage = holyBlastDamage = projectileDamageNight; + } + + // Change dust type at night + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + + // Phase times + float phaseTime = nightTime ? 240f : 300f; + float crystalPhaseTime = nightTime ? 60f : 120f; + float attackDelayAfterCocoon = 90f; + + // Phases + bool ignoreGuardianAmt = lifeRatio < (death ? 0.2f : 0.15f); + bool phase2 = (lifeRatio < 0.75f || death) && !nightTime; + bool delayAttacks = npc.localAI[2] > 0f; + + // Spear phase + float spearRateIncrease = death ? 1f : 1f * (1f - lifeRatio); + float enragedSpearRateIncrease = 0.5f; + float bossRushSpearRateIncrease = 0.25f; + float baseSpearRate = 18f; + float spearRate = 1f + spearRateIncrease; + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) + spearRate += enragedSpearRateIncrease; + + if (CalamityWorld.bossRushActive) + spearRate += bossRushSpearRateIncrease; + + // Projectile fire rate multiplier + double attackRateMult = 1D; // Distance X needed from target in order to fire holy or molten blasts float distanceNeededToShoot = revenge ? 360f : 420f; @@ -300,14 +360,14 @@ namespace CalamityMod.NPCs.Providence // Despawn bool targetDead = false; - if ((!Main.dayTime && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f) || !player.active || player.dead) + if (!player.active || player.dead) { if (!player.active || player.dead) { npc.TargetClosest(false); player = Main.player[npc.target]; } - if ((!Main.dayTime && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f) || !player.active || player.dead) + if (!player.active || player.dead) { targetDead = true; @@ -325,28 +385,33 @@ namespace CalamityMod.NPCs.Providence else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - // Guardian spawn - if (bossLife == 0f && npc.life > 0) - bossLife = npc.lifeMax; - if (npc.life > 0) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int num660 = (int)(npc.lifeMax * 0.66); - if ((npc.life + num660) < bossLife) - { - bossLife = npc.life; - int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32)); - NPC.NewNPC(x - 100, y - 100, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(x + 100, y - 100, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(x, y + 100, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - } - } - } + // Guardian spawn + if (!nightTime) + { + if (bossLife == 0f && npc.life > 0) + bossLife = npc.lifeMax; + if (npc.life > 0) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int num660 = (int)(npc.lifeMax * 0.66); + if ((npc.life + num660) < bossLife) + { + bossLife = npc.life; + int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32)); + NPC.NewNPC(x - 100, y - 100, ModContent.NPCType()); + NPC.NewNPC(x + 100, y - 100, ModContent.NPCType()); + NPC.NewNPC(x, y + 100, ModContent.NPCType()); + } + } + } + } // Set DR based on current attack phase - npc.Calamity().DR = (npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f) ? cocoonDR : normalDR; + npc.Calamity().DR = (npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f || spawnAnimation) ? + cocoonDR : delayAttacks ? + MathHelper.Lerp(normalDR, cocoonDR, npc.localAI[2] / attackDelayAfterCocoon) : normalDR; // Movement if (npc.ai[0] != 2f && npc.ai[0] != 5f) @@ -398,7 +463,7 @@ namespace CalamityMod.NPCs.Providence float velocityBoost = death ? 4f : 4f * (1f - lifeRatio); float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost; float velocity = (expertMode ? 16f : 15f) + velocityBoost; - if (CalamityWorld.bossRushActive) + if (CalamityWorld.bossRushActive || nightTime) { acceleration = 1.3f; velocity = 20f; @@ -435,14 +500,20 @@ namespace CalamityMod.NPCs.Providence if (npc.velocity.Y < (firingLaser ? -speedVariance : -6f)) npc.velocity.Y = firingLaser ? -speedVariance : -6f; } - } + + // Slowly drift down when spawning + if (spawnAnimation) + { + float minSpawnVelocity = 0.4f; + float maxSpawnVelocity = 4f; + float velocityY = maxSpawnVelocity - MathHelper.Lerp(minSpawnVelocity, maxSpawnVelocity, calamityGlobalNPC.newAI[3] / spawnAnimationTime); + npc.velocity = new Vector2(0f, velocityY); + } + } // Phase switch if (npc.ai[0] == -1f) { - npc.noGravity = true; - npc.noTileCollide = true; - phaseChange++; if (phaseChange > 14) phaseChange = 0; @@ -476,7 +547,7 @@ namespace CalamityMod.NPCs.Providence phase = 0; break; // 2175 or 2100 case 3: - phase = useCrystal ? 6 : 3; + phase = (useCrystal || nightTime) ? 6 : 3; break; case 4: phase = useCrystal ? 3 : 2; @@ -485,8 +556,8 @@ namespace CalamityMod.NPCs.Providence phase = useCrystal ? 2 : 1; break; // 900 case 6: - phase = useLaser ? 7 : 4; // 1875 or 1800 - if (useLaser) + phase = (useLaser || nightTime) ? 7 : 4; // 1875 or 1800 + if (useLaser || nightTime) { npc.TargetClosest(false); Vector2 v3 = player.Center - vector - new Vector2(0f, -22f); @@ -503,23 +574,23 @@ namespace CalamityMod.NPCs.Providence } break; // 1200 case 7: - phase = useLaser ? 4 : 3; + phase = (useLaser || nightTime) ? 4 : 3; break; // 1500 case 8: - phase = useLaser ? 3 : 5; + phase = (useLaser || nightTime) ? 3 : 5; break; case 9: phase = 0; break; // 2175 or 2100 case 10: - phase = useCrystal ? 6 : 2; + phase = (useCrystal || nightTime) ? 6 : 2; break; case 11: - phase = 3; + phase = nightTime ? 2 : 3; break; // 300 case 12: - phase = useLaser ? 7 : 4; // 675 or 600 - if (useLaser) + phase = (useLaser || nightTime) ? 7 : 4; // 675 or 600 + if (useLaser || nightTime) { npc.TargetClosest(false); Vector2 v3 = player.Center - vector - new Vector2(0f, -22f); @@ -539,7 +610,7 @@ namespace CalamityMod.NPCs.Providence phase = 5; break; // 975 or 900 case 14: - phase = useLaser ? 4 : 0; + phase = (useLaser || nightTime) ? 4 : 0; break; // 1275 or 1200 default: break; @@ -636,19 +707,87 @@ namespace CalamityMod.NPCs.Providence if (Math.Abs(vector.X - player.Center.X) > 5600f) phase = 0; + // Reset attack delay for laser + if (phase == 7) + npc.localAI[2] = 0f; + // Reset arrays npc.ai[0] = phase; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; } // Holy blasts else if (npc.ai[0] == 0f) { - npc.noGravity = true; - npc.noTileCollide = true; + if (spawnAnimation) + { + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[3] == 0f) + Projectile.NewProjectile(vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); + + if (calamityGlobalNPC.newAI[3] == 10f && nightTime) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), (int)npc.position.X, (int)npc.position.Y); + + if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < 150f) + { + int dustAmt = (int)MathHelper.Lerp(4f, 8f, calamityGlobalNPC.newAI[3] / spawnAnimationTime); + for (int m = 0; m < dustAmt; m++) + { + float fade = MathHelper.Lerp(1.3f, 0.7f, npc.Opacity) * CalamityUtils.GetLerpValue(0f, 120f, calamityGlobalNPC.newAI[3], clamped: true); + Color newColor = Main.hslToRgb(calamityGlobalNPC.newAI[3] / 180f, 1f, 0.5f); + + if (!nightTime) + { + newColor.R = 255; + if (biomeType == 2) + newColor.B = 0; + } + else + { + newColor.B = 255; + if (biomeType == 2) + newColor.G = 0; + else + newColor.R = 0; + } + + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 267, 0f, 0f, 0, newColor); + Main.dust[dust].position = npc.Center + Main.rand.NextVector2Circular(npc.width * 2f, npc.height * 2f) + new Vector2(0f, -150f); + Main.dust[dust].velocity *= Main.rand.NextFloat() * 0.8f; + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 0.6f + Main.rand.NextFloat() * 0.7f * fade; + Main.dust[dust].velocity += Vector2.UnitY * 3f; + Main.dust[dust].scale = 1.2f; + + if (dust != 6000) + { + Dust dust2 = Dust.CloneDust(dust); + dust2.scale /= 2f; + dust2.fadeIn *= 0.85f; + dust2.color = new Color(255, 255, 0, 255); + } + } + } + + npc.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f); + + calamityGlobalNPC.newAI[3] += 1f; + + if (nightTime && calamityGlobalNPC.newAI[3] >= spawnAnimationTime) + calamityGlobalNPC.newAI[3] += 1f; + + return; + } + + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } float num852 = Math.Abs(vector.X - player.Center.X); if (num852 > distanceNeededToShoot && npc.position.Y < player.position.Y) @@ -657,7 +796,7 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? 3 : (int)(4f * (1f - lifeRatio)); int num856 = (expertMode ? 24 : 26) - shootBoost; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num856 = 20; num856 = (int)(num856 * attackRateMult); @@ -674,7 +813,7 @@ namespace CalamityMod.NPCs.Providence float velocityBoost = death ? 2.5f : 2.5f * (1f - lifeRatio); float num860 = (expertMode ? 10.25f : 9f) + velocityBoost; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num860 = 12.75f; if (revenge) @@ -684,23 +823,26 @@ namespace CalamityMod.NPCs.Providence num857 *= num859; num858 *= num859; - int holyDamage = expertMode ? 52 : 65; - Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[3] < 0f) npc.ai[3] += 1f; npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= phaseTime) npc.ai[0] = -1f; } // Holy fire else if (npc.ai[0] == 1f) { - npc.noGravity = true; - npc.noTileCollide = true; + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -725,22 +867,18 @@ namespace CalamityMod.NPCs.Providence num865 += expertMode ? 4f : 3f; - int fireDamage = expertMode ? 48 : 60; - Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), fireDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f); } } npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= phaseTime) npc.ai[0] = -1f; } // Cocoon flames else if (npc.ai[0] == 2f) { - npc.noGravity = true; - npc.noTileCollide = true; - npc.TargetClosest(true); if (!targetDead) @@ -768,12 +906,17 @@ namespace CalamityMod.NPCs.Providence { if (npc.ai[3] % divisor == 0f) { - Vector2 spinningPoint = calamityGlobalNPC.newAI[1] % 2f == 0f ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity; + bool normalSpread = calamityGlobalNPC.newAI[1] % 2f == 0f; + Vector2 spinningPoint = normalSpread ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)); double radians = MathHelper.TwoPi / chains; + Main.PlaySound(SoundID.Item20, npc.position); for (int i = 0; i < chains; i++) { Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(npc.ai[2])); + if (!normalSpread) + vector2 *= velocity; + int projectileType = ModContent.ProjectileType(); if (Main.rand.NextBool(4) && !death) projectileType = ModContent.ProjectileType(); @@ -794,6 +937,7 @@ namespace CalamityMod.NPCs.Providence { calamityGlobalNPC.newAI[1] += 1f; double radians = MathHelper.TwoPi / totalProjectiles; + Main.PlaySound(SoundID.Item20, npc.position); for (int i = 0; i < totalProjectiles; i++) { Vector2 vector2 = new Vector2(0f, -velocity).RotatedBy(radians * i); @@ -804,28 +948,19 @@ namespace CalamityMod.NPCs.Providence Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f); } + + Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * velocity; + Projectile.NewProjectile(fireFrom, velocity2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); } } } if (npc.ai[3] == 0f) - { - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - projectile.Kill(); - } - } - } - } + DespawnSpecificProjectiles(); // Air is burning text npc.ai[3] += 1f; - if (npc.ai[3] >= 450f && !text) + if (npc.ai[3] >= (phaseTime * 1.5f) && !text) { text = true; string key = "Mods.CalamityMod.ProfanedBossText"; @@ -838,7 +973,7 @@ namespace CalamityMod.NPCs.Providence } // Inflict Icarus Folly - if (npc.ai[3] >= 600f) + if (npc.ai[3] >= (phaseTime * 2f)) { if (Main.netMode != NetmodeID.Server) { @@ -853,7 +988,7 @@ namespace CalamityMod.NPCs.Providence for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -865,11 +1000,11 @@ namespace CalamityMod.NPCs.Providence for (int num623 = 0; num623 < 60; num623++) { int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f); + player2.width, player2.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y), - player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -877,14 +1012,19 @@ namespace CalamityMod.NPCs.Providence text = false; npc.ai[0] = -1f; + npc.localAI[2] = attackDelayAfterCocoon; } } // Molten blasts else if (npc.ai[0] == 3f) { - npc.noGravity = true; - npc.noTileCollide = true; + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } float num852 = Math.Abs(vector.X - player.Center.X); if (num852 > distanceNeededToShoot && npc.position.Y < player.position.Y) @@ -920,23 +1060,26 @@ namespace CalamityMod.NPCs.Providence num857 *= num859; num858 *= num859; - int holyDamage = expertMode ? 42 : 55; - Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), holyDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[3] < 0f) npc.ai[3] += 1f; npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= phaseTime) npc.ai[0] = -1f; } // Holy bombs else if (npc.ai[0] == 4f) { - npc.noGravity = true; - npc.noTileCollide = true; + // Attack delay after cocoon phase + if (delayAttacks) + { + npc.localAI[2] -= 1f; + return; + } if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -944,7 +1087,7 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? 9 : (int)(10f * (1f - lifeRatio)); int num864 = (expertMode ? 73 : 77) - shootBoost; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) num864 = 63; num864 = (int)(num864 * attackRateMult); @@ -961,22 +1104,18 @@ namespace CalamityMod.NPCs.Providence num865 += expertMode ? 4f : 3f; - int fireDamage = expertMode ? 48 : 60; - Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), fireDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f); } } npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= phaseTime) npc.ai[0] = -1f; } // Cocoon spears else if (npc.ai[0] == 5f) { - npc.noGravity = true; - npc.noTileCollide = true; - npc.TargetClosest(true); if (!targetDead) @@ -991,71 +1130,57 @@ namespace CalamityMod.NPCs.Providence } if (npc.ai[1] == 0f) - { - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - projectile.Kill(); - } - } - } - } + DespawnSpecificProjectiles(); if (Main.netMode != NetmodeID.MultiplayerClient) { - float shootBoost = death ? 1f : 1f * (1f - lifeRatio); - npc.ai[2] += ((npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 1.5f : 1f) + shootBoost; - - if (CalamityWorld.bossRushActive) - npc.ai[2] += 0.25f; - - double count = 18D * attackRateMult; - if (npc.ai[2] >= (float)count) + npc.ai[2] += spearRate; + if (npc.ai[2] >= (float)(baseSpearRate * attackRateMult)) { npc.ai[2] = 0f; + Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f); + + Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, fireFrom); + float velocity = 3f; - int damage = expertMode ? 52 : 65; int projectileType = ModContent.ProjectileType(); if (calamityGlobalNPC.newAI[2] % 2f == 0f) { int totalProjectiles = 12; double radians = MathHelper.TwoPi / totalProjectiles; - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -velocity)) * velocity; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -velocity)); for (int i = 0; i < totalProjectiles; i++) { - Vector2 vector2 = spinningPoint.RotatedBy(radians * i); - Projectile.NewProjectile(vector, vector2, projectileType, damage, 0f, Main.myPlayer, 0f, 0f); + Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * velocity; + Projectile.NewProjectile(fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer, 0f, 0f); } - calamityGlobalNPC.newAI[1] += 0.2f; + float radialOffset = MathHelper.Lerp(0.2f, 0.4f, spearRateIncrease); + calamityGlobalNPC.newAI[1] += radialOffset; } calamityGlobalNPC.newAI[2] += 1f; velocity = expertMode ? 12f : 10f; - Vector2 velocity2 = Vector2.Normalize(player.Center - vector) * velocity; - Projectile.NewProjectile(vector, velocity2, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + Vector2 velocity2 = Vector2.Normalize(player.Center - fireFrom) * velocity; + Projectile.NewProjectile(fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); } } npc.ai[1] += 1f; - if (npc.ai[1] >= 300f) + if (npc.ai[1] >= phaseTime) + { npc.ai[0] = -1f; + npc.localAI[2] = attackDelayAfterCocoon; + } } // Crystal else if (npc.ai[0] == 6f) { - npc.noGravity = true; - npc.noTileCollide = true; - npc.TargetClosest(true); if (!targetDead) @@ -1064,11 +1189,13 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { npc.ai[1] += 1f; - if (npc.ai[1] >= 120f) + if (npc.ai[1] >= crystalPhaseTime) { - int damage = expertMode ? 57 : 70; - Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); - npc.ai[0] = -1f; + if (npc.ai[1] == crystalPhaseTime) + Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType(), crystalDamage, 0f, player.whoAmI, 0f, 0f); + + if (npc.ai[1] >= crystalPhaseTime + 210f || !nightTime) + npc.ai[0] = -1f; } } } @@ -1076,9 +1203,6 @@ namespace CalamityMod.NPCs.Providence // Holy ray else if (npc.ai[0] == 7f) { - npc.noGravity = true; - npc.noTileCollide = true; - Vector2 value19 = new Vector2(27f, 59f); float rotation = 450f + (guardianAmt * 18); @@ -1098,13 +1222,12 @@ namespace CalamityMod.NPCs.Providence for (int num1221 = 0; num1221 < 1 + num1220; num1221++) { - int num1222 = (int)CalamityDusts.ProfanedFire; float num1223 = 1.2f; if (num1221 % 2 == 1) num1223 = 2.8f; - Vector2 vector199 = vector + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f; - int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f); + Vector2 vector199 = new Vector2(vector.X, vector.Y + 32f) + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f; + int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, dustType, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f); Main.dust[num1224].velocity = Vector2.Normalize(vector - vector199) * 3.5f * (10f - num1220 * 2f) / 10f; Main.dust[num1224].noGravity = true; Main.dust[num1224].scale = num1223; @@ -1133,10 +1256,10 @@ namespace CalamityMod.NPCs.Providence num1225 = 1f; vector200 = vector200.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f, default); - Projectile.NewProjectile(vector.X, vector.Y - 32f, vector200.X, vector200.Y, ModContent.ProjectileType(), 100, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + Projectile.NewProjectile(vector.X, vector.Y + 32f, vector200.X, vector200.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); if (revenge) - Projectile.NewProjectile(vector.X, vector.Y - 32f, -vector200.X, -vector200.Y, ModContent.ProjectileType(), 100, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); + Projectile.NewProjectile(vector.X, vector.Y + 32f, -vector200.X, -vector200.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI); npc.ai[3] = (vector200.ToRotation() + MathHelper.TwoPi + MathHelper.Pi) * num1225; npc.netUpdate = true; @@ -1169,6 +1292,23 @@ namespace CalamityMod.NPCs.Providence } } + private void DespawnSpecificProjectiles() + { + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + { + projectile.Kill(); + } + else if (projectile.type == ModContent.ProjectileType()) + projectile.active = false; + } + } + } + public override bool CanHitPlayer(Player target, ref int cooldownSlot) { return false; @@ -1185,18 +1325,23 @@ namespace CalamityMod.NPCs.Providence npc.Calamity().SetNewShopVariable(new int[] { ModContent.NPCType() }, CalamityWorld.downedProvidence); - //Accessories clientside only in Expert + // Accessories clientside only in Expert DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, biomeType != 2 && Main.expertMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, biomeType == 2 && Main.expertMode); - //drops pre-scal, cannot be sold, does nothing aka purely vanity. Requires at least expert for consistency with other post scal dev items. + + // Drops pre-scal, cannot be sold, does nothing aka purely vanity. Requires at least expert for consistency with other post scal dev items. bool shouldDrop = challenge || (Main.expertMode && Main.rand.NextBool(CalamityWorld.downedSCal ? 10 : 200)); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, shouldDrop); + + // Special drop for defeating her at night + //DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !hasTakenDaytimeDamage); + // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) { // Materials DropHelper.DropItemSpray(npc, ModContent.ItemType(), 20, 30); - DropHelper.DropItemSpray(npc, ModContent.ItemType(), 10, 15); + DropHelper.DropItemSpray(npc, ModContent.ItemType(), 15, 20); // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); @@ -1258,8 +1403,8 @@ namespace CalamityMod.NPCs.Providence private void SpawnLootBox() { - int tileCenterX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int tileCenterY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int tileCenterX = (int)(npc.position.X + (npc.width / 2)) / 16; + int tileCenterY = (int)(npc.position.Y + (npc.height / 2)) / 16; int halfBox = npc.width / 2 / 16 + 1; for (int x = tileCenterX - halfBox; x <= tileCenterX + halfBox; x++) { @@ -1289,102 +1434,117 @@ namespace CalamityMod.NPCs.Providence public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture = Main.npcTexture[npc.type]; - Texture2D textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow"); - Texture2D textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2"); + bool nightTime = !Main.dayTime; + + string baseTextureString = "CalamityMod/NPCs/Providence/"; + string baseGlowTextureString = baseTextureString + "Glowmasks/"; + + string getTextureString = baseTextureString + "Providence"; + string getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; + string getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; if (npc.ai[0] == 2f || npc.ai[0] == 5f) { if (!useDefenseFrames) { - texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefense"); - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow2"); + getTextureString = baseTextureString + "ProvidenceDefense"; + getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseGlow2"; } else { - texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAlt"); - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow2"); + getTextureString = baseTextureString + "ProvidenceDefenseAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseAltGlow2"; } } else { if (frameUsed == 0) { - texture = Main.npcTexture[npc.type]; - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2"); + getTextureGlowString = baseGlowTextureString + "ProvidenceGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2"; } else if (frameUsed == 1) { - texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAlt"); - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow2"); + getTextureString = baseTextureString + "ProvidenceAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAltGlow2"; } else if (frameUsed == 2) { - texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttack"); - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow2"); + getTextureString = baseTextureString + "ProvidenceAttack"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAttackGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackGlow2"; } else { - texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAlt"); - textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow"); - textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow2"); + getTextureString = baseTextureString + "ProvidenceAttackAlt"; + getTextureGlowString = baseGlowTextureString + "ProvidenceAttackAltGlow"; + getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackAltGlow2"; } } + if (nightTime) + { + getTextureString += "Night"; + getTextureGlowString += "Night"; + getTextureGlow2String += "Night"; + } + + Texture2D texture = ModContent.GetTexture(getTextureString); + Texture2D textureGlow = ModContent.GetTexture(getTextureGlowString); + Texture2D textureGlow2 = ModContent.GetTexture(getTextureGlow2String); + SpriteEffects spriteEffects = SpriteEffects.None; if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2); Color color36 = Color.White; float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = lightColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); - Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f); - Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f); + Color color37 = Color.Lerp(Color.White, Main.dayTime ? Color.Yellow : Color.Cyan, 0.5f) * npc.Opacity; + Color color42 = Color.Lerp(Color.White, Main.dayTime ? Color.Violet : Color.BlueViolet, 0.5f) * npc.Opacity; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { Color color41 = color37; color41 = Color.Lerp(color41, color36, amount9); color41 = npc.GetAlpha(color41); - color41 *= (float)(num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)textureGlow.Width, (float)(textureGlow.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f; + color41 *= (num153 - num163) / 15f; + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); spriteBatch.Draw(textureGlow, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f); Color color43 = color42; color43 = Color.Lerp(color43, color36, amount9); color43 = npc.GetAlpha(color43); - color43 *= (float)(num153 - num163) / 15f; + color43 *= (num153 - num163) / 15f; spriteBatch.Draw(textureGlow2, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } @@ -1403,7 +1563,7 @@ namespace CalamityMod.NPCs.Providence if (!useDefenseFrames) { npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) + if (npc.frameCounter > 8.0) { npc.frame.Y = npc.frame.Y + frameHeight; npc.frameCounter = 0.0; @@ -1417,7 +1577,7 @@ namespace CalamityMod.NPCs.Providence else { npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) + if (npc.frameCounter > 8.0) { npc.frame.Y = npc.frame.Y + frameHeight; npc.frameCounter = 0.0; @@ -1432,7 +1592,7 @@ namespace CalamityMod.NPCs.Providence useDefenseFrames = false; npc.frameCounter += 1.0; - if (npc.frameCounter > 5.0) + if (npc.frameCounter > (npc.Calamity().newAI[3] < 180f ? 8.0 : 5.0)) { npc.frameCounter = 0.0; npc.frame.Y = npc.frame.Y + frameHeight; @@ -1461,6 +1621,8 @@ namespace CalamityMod.NPCs.Providence public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) { + hasTakenDaytimeDamage = Main.dayTime; + if (challenge) { bool goldenGun = projectile.type == ModContent.ProjectileType(); @@ -1476,6 +1638,8 @@ namespace CalamityMod.NPCs.Providence public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) { + hasTakenDaytimeDamage = Main.dayTime; + if (challenge) challenge = false; } @@ -1487,38 +1651,40 @@ namespace CalamityMod.NPCs.Providence npc.soundDelay = 8; Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt"), npc.Center); } - for (int k = 0; k < 15; k++) - Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); + + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int k = 0; k < 15; k++) + Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { - float randomSpread = (float)(Main.rand.Next(-50, 50) / 100); + float randomSpread = Main.rand.Next(-50, 50) / 100; Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence2"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence3"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence4"), 1f); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 400; npc.height = 350; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 60; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 90; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Providence/ProvidenceAltNight.png b/NPCs/Providence/ProvidenceAltNight.png new file mode 100644 index 0000000000..4fe2e26f7b Binary files /dev/null and b/NPCs/Providence/ProvidenceAltNight.png differ diff --git a/NPCs/Providence/ProvidenceAttackAltNight.png b/NPCs/Providence/ProvidenceAttackAltNight.png new file mode 100644 index 0000000000..abeb35d1e3 Binary files /dev/null and b/NPCs/Providence/ProvidenceAttackAltNight.png differ diff --git a/NPCs/Providence/ProvidenceAttackNight.png b/NPCs/Providence/ProvidenceAttackNight.png new file mode 100644 index 0000000000..d49baf5c6f Binary files /dev/null and b/NPCs/Providence/ProvidenceAttackNight.png differ diff --git a/NPCs/Providence/ProvidenceDefenseAltNight.png b/NPCs/Providence/ProvidenceDefenseAltNight.png new file mode 100644 index 0000000000..ecbd22e542 Binary files /dev/null and b/NPCs/Providence/ProvidenceDefenseAltNight.png differ diff --git a/NPCs/Providence/ProvidenceDefenseNight.png b/NPCs/Providence/ProvidenceDefenseNight.png new file mode 100644 index 0000000000..df1ff403ac Binary files /dev/null and b/NPCs/Providence/ProvidenceDefenseNight.png differ diff --git a/NPCs/Providence/ProvidenceNight.png b/NPCs/Providence/ProvidenceNight.png new file mode 100644 index 0000000000..be68806d96 Binary files /dev/null and b/NPCs/Providence/ProvidenceNight.png differ diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 6e3706c2fa..285ece606c 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -1,15 +1,14 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Ravager { - public class FlamePillar : ModNPC + public class FlamePillar : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index e2743f7e04..c557a9f079 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; @@ -25,7 +25,9 @@ namespace CalamityMod.NPCs.Ravager [AutoloadBossHead] public class RavagerBody : ModNPC { - public override void SetStaticDefaults() + private float velocityY = -16f; + + public override void SetStaticDefaults() { DisplayName.SetDefault("Ravager"); Main.npcFrameCount[npc.type] = 7; @@ -34,6 +36,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { npc.lavaImmune = true; + npc.noGravity = true; npc.npcSlots = 20f; npc.aiStyle = -1; npc.damage = 120; @@ -41,7 +44,7 @@ namespace CalamityMod.NPCs.Ravager npc.height = 214; npc.defense = 55; npc.value = Item.buyPrice(0, 25, 0, 0); - npc.Calamity().RevPlusDR(0.4f); + npc.DR_NERD(0.4f); npc.LifeMaxNERB(42700, 53500, 4600000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { @@ -50,7 +53,7 @@ namespace CalamityMod.NPCs.Ravager npc.lifeMax *= 7; npc.value *= 1.5f; } - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; aiType = -1; @@ -91,12 +94,16 @@ namespace CalamityMod.NPCs.Ravager public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); - } + writer.Write(npc.noGravity); + writer.Write(velocityY); + } public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); - } + npc.noGravity = reader.ReadBoolean(); + velocityY = reader.ReadSingle(); + } public override void FindFrame(int frameHeight) { @@ -174,18 +181,21 @@ namespace CalamityMod.NPCs.Ravager leftLegActive = true; } - bool enrage = false; + bool immunePhase = headActive || rightClawActive || leftClawActive || rightLegActive || leftLegActive; + bool finalPhase = !leftClawActive && !rightClawActive && !headActive && !leftLegActive && !rightLegActive; + + bool enrage = false; if (player.position.Y + (player.height / 2) > npc.position.Y + (npc.height / 2) + 10f) enrage = true; - if (headActive || rightClawActive || leftClawActive || rightLegActive || leftLegActive) + if (immunePhase) npc.dontTakeDamage = true; else { npc.dontTakeDamage = false; if (Main.netMode != NetmodeID.Server) { - if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) + if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && revenge) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); } } @@ -212,27 +222,30 @@ namespace CalamityMod.NPCs.Ravager } } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += enrage ? 6f : 1f; - if (npc.localAI[1] >= 600f) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - float velocity = CalamityWorld.bossRushActive ? 10f : 7f; - int totalProjectiles = 8; - float radians = MathHelper.TwoPi / totalProjectiles; - int laserDamage = 45; - for (int i = 0; i < totalProjectiles; i++) + if (!finalPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[1] += enrage ? 6f : 1f; + if (npc.localAI[1] >= 600f) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, ProjectileID.EyeBeam, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + float velocity = CalamityWorld.bossRushActive ? 10f : 7f; + int totalProjectiles = 8; + float radians = MathHelper.TwoPi / totalProjectiles; + int laserDamage = 45; + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); + Projectile.NewProjectile(npc.Center, vector255, ProjectileID.EyeBeam, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + } } - } - } - } + } + } + } } if (!rightClawActive) @@ -257,19 +270,22 @@ namespace CalamityMod.NPCs.Ravager } } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[2] += enrage ? 2f : 1f; - if (npc.localAI[2] >= 480f) - { - Main.PlaySound(SoundID.Item20, npc.position); - npc.localAI[2] = 0f; - Vector2 shootFromVector = new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f); - int damage = 40; - float velocity = CalamityWorld.bossRushActive ? 18f : 12f; - int laser = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, 258, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - } - } + if (!finalPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[2] += enrage ? 2f : 1f; + if (npc.localAI[2] >= 480f) + { + Main.PlaySound(SoundID.Item20, npc.position); + npc.localAI[2] = 0f; + Vector2 shootFromVector = new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f); + int damage = 40; + float velocity = CalamityWorld.bossRushActive ? 18f : 12f; + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, ProjectileID.Fireball, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + } + } + } } if (!leftClawActive) @@ -294,19 +310,22 @@ namespace CalamityMod.NPCs.Ravager } } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[3] += enrage ? 2f : 1f; - if (npc.localAI[3] >= 480f) - { - Main.PlaySound(SoundID.Item20, npc.position); - npc.localAI[3] = 0f; - Vector2 shootFromVector = new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f); - int damage = 40; - float velocity = CalamityWorld.bossRushActive ? -18f : -12f; - int laser = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, 258, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - } - } + if (!finalPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.localAI[3] += enrage ? 2f : 1f; + if (npc.localAI[3] >= 480f) + { + Main.PlaySound(SoundID.Item20, npc.position); + npc.localAI[3] = 0f; + Vector2 shootFromVector = new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f); + int damage = 40; + float velocity = CalamityWorld.bossRushActive ? -18f : -12f; + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, ProjectileID.Fireball, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + } + } + } } if (!rightLegActive) @@ -331,18 +350,21 @@ namespace CalamityMod.NPCs.Ravager } } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= 300f) - { - npc.ai[2] = 0f; - Vector2 shootFromVector = new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f); - int damage = 35; - int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, 326 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - Main.projectile[fire].timeLeft = 180; - } - } + if (!finalPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[2] += 1f; + if (npc.ai[2] >= 300f) + { + npc.ai[2] = 0f; + Vector2 shootFromVector = new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f); + int damage = 35; + int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, ProjectileID.GreekFire1 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Main.projectile[fire].timeLeft = 180; + } + } + } } if (!leftLegActive) @@ -367,23 +389,28 @@ namespace CalamityMod.NPCs.Ravager } } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[3] += 1f; - if (npc.ai[3] >= 300f) - { - npc.ai[3] = 0f; - Vector2 shootFromVector = new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f); - int damage = 35; - int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, 326 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); - Main.projectile[fire].timeLeft = 180; - } - } + if (!finalPhase) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + npc.ai[3] += 1f; + if (npc.ai[3] >= 300f) + { + npc.ai[3] = 0f; + Vector2 shootFromVector = new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f); + int damage = 35; + int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, ProjectileID.GreekFire1 + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Main.projectile[fire].timeLeft = 180; + } + } + } } if (npc.ai[0] == 0f) { - npc.noTileCollide = false; + CustomGravity(); + + npc.noTileCollide = false; if (npc.velocity.Y == 0f) { @@ -400,11 +427,11 @@ namespace CalamityMod.NPCs.Ravager npc.ai[1] += 1f; } - if ((!rightClawActive && !leftClawActive) || death || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if ((!rightClawActive && !leftClawActive) || death || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.ai[1] += 1f; - if (!headActive || death || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (!headActive || death || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.ai[1] += 1f; - if ((!rightLegActive && !leftLegActive) || death || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if ((!rightLegActive && !leftLegActive) || death || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.ai[1] += 1f; } @@ -416,10 +443,24 @@ namespace CalamityMod.NPCs.Ravager bool shouldFall = player.position.Y >= npc.Bottom.Y; float velocityXBoost = death ? 4f : 4f * (1f - lifeRatio); - float velocityX = ((enrage || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 8f : 4f) + velocityXBoost; - float velocityY = -16f; + float velocityX = ((enrage || npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 8f : 4f) + velocityXBoost; + velocityY = -16f; + + float distanceBelowTarget = npc.position.Y - (player.position.Y + 80f); if (revenge) + { + if (distanceBelowTarget > 0f) + npc.Calamity().newAI[1] += 1f + distanceBelowTarget * 0.001f; + + if (npc.Calamity().newAI[1] > 2f) + npc.Calamity().newAI[1] = 2f; + + if (npc.Calamity().newAI[1] > 1f) + velocityY *= npc.Calamity().newAI[1]; + } + + if (expertMode) { npc.noTileCollide = true; if (shouldFall) @@ -442,37 +483,53 @@ namespace CalamityMod.NPCs.Ravager npc.velocity.X = velocityX * npc.direction; npc.velocity.Y = velocityY; - npc.ai[0] = 1f; + npc.ai[0] = finalPhase && !shouldFall ? 2f : 1f; npc.ai[1] = 0f; - } + } } } - else if (npc.ai[0] == 1f) + else if (npc.ai[0] >= 1f) { - if (npc.velocity.Y == 0f) + if (npc.velocity.Y == 0f && (npc.ai[1] == 31f || npc.ai[0] == 1f)) { - Main.PlaySound(SoundID.Item14, npc.position); + Main.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 14, 1.25f, -0.25f); - npc.ai[0] = 0f; + npc.ai[0] = 0f; + npc.ai[1] = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient) { - if (NPC.CountNPCS(ModContent.NPCType()) < 2) - { - NPC.NewNPC((int)npc.Center.X - 360, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + 360, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - } + if (expertMode) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type == ModContent.NPCType() && Main.npc[i].ai[0] == 0f) + { + Main.npc[i].ai[1] = -1f; + Main.npc[i].direction = npc.direction; + } + } - if (NPC.CountNPCS(ModContent.NPCType()) < 2) - { - NPC.NewNPC((int)player.Center.X - 180, (int)player.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)player.Center.X + 180, (int)player.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - } + int spawnDistance = 360; + + if (!NPC.AnyNPCs(ModContent.NPCType())) + { + NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + } + else if (!NPC.AnyNPCs(ModContent.NPCType())) + { + NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + } + } } if (revenge) npc.Calamity().newAI[0] += 1f; + npc.Calamity().newAI[1] = 0f; + for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30) { for (int stompDustAmount = 0; stompDustAmount < 6; stompDustAmount++) @@ -490,7 +547,7 @@ namespace CalamityMod.NPCs.Ravager npc.TargetClosest(true); // Fall through - if (!player.dead && revenge) + if (!player.dead && expertMode) { if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) npc.noTileCollide = true; @@ -498,27 +555,82 @@ namespace CalamityMod.NPCs.Ravager npc.noTileCollide = false; } - if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width) - { - npc.velocity.X *= 0.9f; + float amount = death ? 1f : 1f - lifeRatio; + float unitsAhead = MathHelper.Lerp(48f, 160f, amount); + Vector2 targetVector = npc.ai[0] == 2f ? player.Center + player.velocity.SafeNormalize(Vector2.UnitY) * unitsAhead : player.Center; - if (npc.Bottom.Y < player.position.Y) + if (npc.ai[0] == 2f && npc.ai[1] == 0f) + { + float aimY = targetVector.Y - 240f; + if (npc.Top.Y > aimY) { - float fallSpeedBoost = death ? 0.6f : 0.6f * (1f - lifeRatio); - float fallSpeed = 0.6f + fallSpeedBoost; - npc.velocity.Y += fallSpeed; - } + if (npc.velocity.Y > velocityY) + npc.velocity.Y -= 0.2f + Math.Abs(npc.Center.Y - aimY) * 0.001f; + } + else + { + if (npc.velocity.Y < velocityY) + npc.velocity.Y += 0.2f + Math.Abs(npc.Center.Y - aimY) * 0.001f; + } + } + + Vector2 aimAt = npc.ai[0] == 2f ? targetVector : player.position; + + if ((npc.position.X < aimAt.X && npc.position.X + npc.width > aimAt.X + player.width) || npc.ai[1] > 0f) + { + if (npc.ai[0] == 2f) + { + float stopBeforeFallTime = 30f; + if (expertMode) + stopBeforeFallTime -= death ? 15f : 15f * (1f - lifeRatio); + + if (npc.ai[1] < stopBeforeFallTime) + { + npc.ai[1] += 1f; + npc.velocity = Vector2.Zero; + } + else + { + float fallSpeedBoost = death ? 1.2f : 1.2f * (1f - lifeRatio); + float fallSpeed = 1.2f + fallSpeedBoost; + + if (npc.Calamity().newAI[1] > 1f) + fallSpeed *= npc.Calamity().newAI[1]; + + npc.velocity.Y += fallSpeed; + + npc.ai[1] = 31f; + } + } + else + { + npc.velocity.X *= 0.9f; + + if (npc.Bottom.Y < player.position.Y) + { + float fallSpeedBoost = death ? 0.6f : 0.6f * (1f - lifeRatio); + float fallSpeed = 0.6f + fallSpeedBoost; + + if (npc.Calamity().newAI[1] > 1f) + fallSpeed *= npc.Calamity().newAI[1]; + + npc.velocity.Y += fallSpeed; + } + } } else { - if (npc.direction < 0) - npc.velocity.X -= 0.2f; + float velocityXChange = 0.2f + Math.Abs(npc.Center.X - targetVector.X) * 0.001f; + + if (npc.direction < 0) + npc.velocity.X -= velocityXChange; else if (npc.direction > 0) - npc.velocity.X += 0.2f; + npc.velocity.X += velocityXChange; float velocityXBoost = death ? 4f : 4f * (1f - lifeRatio); - float velocityX = 3f + velocityXBoost; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + float velocityX = 8f + velocityXBoost + Math.Abs(npc.Center.X - targetVector.X) * 0.001f; + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) velocityX += 3f; if (!rightClawActive || death) velocityX += 1f; @@ -531,14 +643,45 @@ namespace CalamityMod.NPCs.Ravager if (!leftLegActive || death) velocityX += 1f; + if (npc.ai[0] == 2f) + velocityX *= 1.4f; + if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; if (npc.velocity.X > velocityX) npc.velocity.X = velocityX; } - } + + CustomGravity(); + } } + void CustomGravity() + { + float gravity = npc.ai[0] == 2f ? 0f : 0.3f; + float maxFallSpeed = npc.ai[0] == 2f ? 24f : 10f; + if (npc.wet) + { + if (npc.honeyWet) + { + gravity *= 0.33f; + maxFallSpeed *= 0.4f; + } + else + { + gravity *= 0.66f; + maxFallSpeed *= 0.7f; + } + } + + if (npc.Calamity().newAI[1] > 1f) + maxFallSpeed *= npc.Calamity().newAI[1]; + + npc.velocity.Y += gravity; + if (npc.velocity.Y > maxFallSpeed) + npc.velocity.Y = maxFallSpeed; + } + player = Main.player[npc.target]; if (npc.target <= 0 || npc.target == 255 || player.dead || !player.active) { @@ -546,12 +689,13 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[npc.target]; } - int distanceFromTarget = 3000; - if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > distanceFromTarget) + int distanceFromTarget = 5600; + if (Vector2.Distance(npc.Center, player.Center) > distanceFromTarget) { npc.TargetClosest(true); player = Main.player[npc.target]; - if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > distanceFromTarget) + + if (Vector2.Distance(npc.Center, player.Center) > distanceFromTarget) { npc.active = false; npc.netUpdate = true; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 89d752bed3..2ce97164b0 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -7,11 +7,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Ravager { - public class RavagerClawLeft : ModNPC + public class RavagerClawLeft : ModNPC { public override void SetStaticDefaults() { @@ -26,7 +24,7 @@ namespace CalamityMod.NPCs.Ravager npc.width = 80; npc.height = 40; npc.defense = 40; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 11120; npc.knockBackResist = 0f; aiType = -1; @@ -67,7 +65,7 @@ namespace CalamityMod.NPCs.Ravager { npc.lifeMax = 260000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } @@ -96,7 +94,7 @@ namespace CalamityMod.NPCs.Ravager if (npc.ai[0] == 0f) { npc.noTileCollide = true; - float num659 = 14f; + float num659 = 21f; if (npc.life < npc.lifeMax / 2 || death) { num659 += 1f; @@ -131,7 +129,7 @@ namespace CalamityMod.NPCs.Ravager } if (npc.life < npc.lifeMax / 5 || death) { - npc.ai[1] += 10f; + npc.ai[1] += 5f; } if (npc.ai[1] >= 60f) { @@ -162,15 +160,15 @@ namespace CalamityMod.NPCs.Ravager float num663 = 12f; if (npc.life < npc.lifeMax / 2 || death) { - num663 += 4f; + num663 += 2f; } if (npc.life < npc.lifeMax / 3 || death) { - num663 += 4f; + num663 += 2f; } if (npc.life < npc.lifeMax / 5 || death) { - num663 += 10f; + num663 += 5f; } Vector2 vector80 = new Vector2(npc.Center.X, npc.Center.Y); float num664 = Main.player[npc.target].Center.X - vector80.X; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 91ba1e81d7..d3fb95b3c0 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -7,11 +7,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Ravager { - public class RavagerClawRight : ModNPC + public class RavagerClawRight : ModNPC { public override void SetStaticDefaults() { @@ -26,7 +24,7 @@ namespace CalamityMod.NPCs.Ravager npc.width = 80; npc.height = 40; npc.defense = 40; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 11120; npc.knockBackResist = 0f; aiType = -1; @@ -68,7 +66,7 @@ namespace CalamityMod.NPCs.Ravager { npc.lifeMax = 260000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } @@ -97,7 +95,7 @@ namespace CalamityMod.NPCs.Ravager if (npc.ai[0] == 0f) { npc.noTileCollide = true; - float num659 = 14f; + float num659 = 21f; if (npc.life < npc.lifeMax / 2 || death) { num659 += 1f; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 8334960d29..c81fe6dd43 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -7,11 +7,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Ravager { - public class RavagerHead : ModNPC + public class RavagerHead : ModNPC { public override void SetStaticDefaults() { @@ -25,7 +23,7 @@ namespace CalamityMod.NPCs.Ravager npc.width = 80; npc.height = 80; npc.defense = 50; - npc.Calamity().RevPlusDR(0.1f); + npc.DR_NERD(0.1f); npc.lifeMax = 32705; npc.knockBackResist = 0f; aiType = -1; @@ -67,7 +65,7 @@ namespace CalamityMod.NPCs.Ravager { npc.lifeMax = 450000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } @@ -86,7 +84,7 @@ namespace CalamityMod.NPCs.Ravager { npc.timeLeft = 1800; } - float speed = 12f; + float speed = 21f; Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); float centerX = Main.npc[CalamityGlobalNPC.scavenger].Center.X - center.X; float centerY = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - center.Y; diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index dc6da13f62..646e48ef76 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 6cad414234..63c7bd86eb 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -6,11 +6,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Ravager { - public class RavagerLegLeft : ModNPC + public class RavagerLegLeft : ModNPC { public override void SetStaticDefaults() { @@ -24,7 +22,7 @@ namespace CalamityMod.NPCs.Ravager npc.width = 60; npc.height = 60; npc.defense = 40; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 22010; npc.knockBackResist = 0f; aiType = -1; @@ -64,7 +62,7 @@ namespace CalamityMod.NPCs.Ravager { npc.lifeMax = 400000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } @@ -93,19 +91,7 @@ namespace CalamityMod.NPCs.Ravager } if (npc.ai[0] == 0f) { - float num659 = 14f; - if (npc.life < npc.lifeMax / 2) - { - num659 += 3f; - } - if (npc.life < npc.lifeMax / 3) - { - num659 += 3f; - } - if (npc.life < npc.lifeMax / 5) - { - num659 += 8f; - } + float num659 = 21f; Vector2 vector79 = new Vector2(center.X, center.Y); float num660 = Main.npc[CalamityGlobalNPC.scavenger].Center.X - vector79.X; float num661 = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - vector79.Y; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 9f84d4d5d0..2441ba9d6c 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -6,11 +6,9 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Ravager { - public class RavagerLegRight : ModNPC + public class RavagerLegRight : ModNPC { public override void SetStaticDefaults() { @@ -24,7 +22,7 @@ namespace CalamityMod.NPCs.Ravager npc.width = 60; npc.height = 60; npc.defense = 40; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 22010; npc.knockBackResist = 0f; aiType = -1; @@ -64,7 +62,7 @@ namespace CalamityMod.NPCs.Ravager { npc.lifeMax = 400000; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); } @@ -93,19 +91,7 @@ namespace CalamityMod.NPCs.Ravager } if (npc.ai[0] == 0f) { - float num659 = 14f; - if (npc.life < npc.lifeMax / 2) - { - num659 += 3f; - } - if (npc.life < npc.lifeMax / 3) - { - num659 += 3f; - } - if (npc.life < npc.lifeMax / 5) - { - num659 += 8f; - } + float num659 = 21f; Vector2 vector79 = new Vector2(center.X, center.Y); float num660 = Main.npc[CalamityGlobalNPC.scavenger].Center.X - vector79.X; float num661 = Main.npc[CalamityGlobalNPC.scavenger].Center.Y - vector79.Y; diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 2fb055fb57..c00ac6abc5 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; @@ -9,8 +9,6 @@ namespace CalamityMod.NPCs.Ravager { public class RockPillar : ModNPC { - int tileCollideCounter = 0; - public override void SetStaticDefaults() { DisplayName.SetDefault("Rock Pillar"); @@ -21,7 +19,8 @@ namespace CalamityMod.NPCs.Ravager npc.damage = 0; npc.width = 60; npc.height = 300; - npc.lifeMax = 100; + npc.DR_NERD(0.5f); + npc.lifeMax = CalamityWorld.downedProvidence ? 35000 : 5000; npc.alpha = 255; npc.aiStyle = -1; aiType = -1; @@ -30,25 +29,25 @@ namespace CalamityMod.NPCs.Ravager { npc.buffImmune[k] = true; } - npc.dontTakeDamage = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - } + npc.HitSound = SoundID.NPCHit41; + npc.DeathSound = SoundID.NPCDeath14; + } public override void AI() { if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active) { - npc.dontTakeDamage = false; npc.life = 0; HitEffect(npc.direction, 9999); npc.netUpdate = true; return; } + if (npc.timeLeft < 1800) { npc.timeLeft = 1800; } + if (npc.alpha > 0) { npc.alpha -= 10; @@ -57,17 +56,9 @@ namespace CalamityMod.NPCs.Ravager npc.alpha = 0; } } + if (Math.Abs(npc.velocity.X) > 0.5f) { - if (tileCollideCounter < 210) - { - tileCollideCounter++; - npc.noTileCollide = true; - } - else - { - npc.noTileCollide = false; - } if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage = 400; @@ -79,41 +70,50 @@ namespace CalamityMod.NPCs.Ravager } else { - npc.noTileCollide = false; npc.damage = 0; } + if (npc.ai[0] == 0f) { - npc.noTileCollide = false; if (npc.velocity.Y == 0f) { - npc.velocity.X *= 0.8f; - npc.ai[1] += 1f; - if (npc.ai[1] > 0f) + if (npc.ai[1] == -1f) { - npc.ai[1] += 1f; - } - if (npc.ai[1] >= 300f) - { - npc.ai[1] = -20f; - } - else if (npc.ai[1] == -1f) - { - npc.TargetClosest(true); - npc.velocity.X = (float)(4 * npc.direction); - npc.velocity.Y = -24.5f; + Main.PlaySound(SoundID.Item62, npc.position); + + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 10; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + + npc.noTileCollide = true; + npc.velocity.X = 12 * npc.direction; + npc.velocity.Y = -28.5f; npc.ai[0] = 1f; npc.ai[1] = 0f; } } } - else if (npc.ai[0] == 1f) + else { - if (npc.velocity.Y == 0f) + if (npc.velocity.Y == 0f || Vector2.Distance(npc.Center, Main.npc[CalamityGlobalNPC.scavenger].Center) > 2800f) { Main.PlaySound(SoundID.Item14, npc.position); npc.ai[0] = 0f; - npc.dontTakeDamage = false; npc.life = 0; HitEffect(npc.direction, 9999); npc.netUpdate = true; @@ -121,34 +121,11 @@ namespace CalamityMod.NPCs.Ravager } else { - npc.TargetClosest(true); - if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width) - { - npc.velocity.X *= 0.9f; - npc.velocity.Y += 0.2f; - } - else - { - if (npc.direction < 0) - { - npc.velocity.X -= 0.2f; - } - else if (npc.direction > 0) - { - npc.velocity.X += 0.2f; - } - float random = (float)Main.rand.Next(7); - float velocityX = 6f + random; - if (npc.velocity.X < -velocityX) - { - npc.velocity.X = -velocityX; - } - if (npc.velocity.X > velocityX) - { - npc.velocity.X = velocityX; - } - } - } + npc.velocity.Y += 0.2f; + + if (npc.velocity.Y >= 0f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + npc.noTileCollide = false; + } } } @@ -161,12 +138,12 @@ namespace CalamityMod.NPCs.Ravager { if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 80; npc.height = 360; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); @@ -174,7 +151,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 30; num623++) @@ -186,6 +163,27 @@ namespace CalamityMod.NPCs.Ravager Main.dust[num624].velocity *= 2f; } } + else + { + for (int num621 = 0; num621 < 2; num621++) + { + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 2; num623++) + { + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } } } } diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 28b619d659..376ef858f0 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -1,15 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Signus { - public class CosmicLantern : ModNPC + public class CosmicLantern : ModNPC { public override void SetStaticDefaults() { @@ -99,7 +98,7 @@ namespace CalamityMod.NPCs.Signus float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -122,7 +121,7 @@ namespace CalamityMod.NPCs.Signus texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Signus/CosmicLanternGlow"); Color color37 = Color.Lerp(Color.White, Color.Cyan, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 7df77f7d7a..874c634b3d 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -16,8 +16,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.Signus { [AutoloadBossHead] @@ -59,8 +57,8 @@ namespace CalamityMod.NPCs.Signus else music = MusicID.Boss4; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; aiType = -1; @@ -118,18 +116,14 @@ namespace CalamityMod.NPCs.Signus bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; + Vector2 vectorCenter = npc.Center; - double lifeRatio = (double)npc.life / (double)npc.lifeMax; + double lifeRatio = npc.life / (double)npc.lifeMax; lifeToAlpha = (int)(100.0 * (1.0 - lifeRatio)); - double mult = 1.0 - - (revenge ? 0.25 : 0.0); - - bool cosmicDust = lifeToAlpha > (int)(15D * mult) || death; - bool speedBoost = lifeToAlpha > (int)(25D * mult) || death; - bool cosmicRain = lifeToAlpha > (int)(35D * mult) || death; - bool cosmicSpeed = lifeToAlpha > (int)(50D * mult) || death; + bool phase2 = (lifeRatio < 0.75f && expertMode) || death; + bool phase3 = lifeRatio < 0.5f || death; // Get a target if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -183,7 +177,7 @@ namespace CalamityMod.NPCs.Signus else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - float num1000 = cosmicSpeed ? 11f : 13f; + float num1000 = expertMode ? 11f : 13f; float num1006 = 0.111111117f * num1000; if (lifeToAlpha < 50 && npc.ai[0] != 1f) @@ -206,27 +200,23 @@ namespace CalamityMod.NPCs.Signus float playerLocation = vectorCenter.X - player.Center.X; npc.direction = playerLocation < 0f ? 1 : -1; npc.spriteDirection = npc.direction; + npc.knockBackResist = 0.05f; if (expertMode) - { npc.knockBackResist *= Main.expertKnockBack; - } - if (speedBoost) - { + if (phase3 || revenge) npc.knockBackResist = 0f; - } + float speed = expertMode ? 14f : 12f; - if (speedBoost) - { - speed = expertMode ? 16f : 14f; - } - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) - { + if (expertMode) + speed += death ? 4f : 4f * (float)(1D - lifeRatio); + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) speed += 3f; - } + float num795 = player.Center.X - vectorCenter.X; float num796 = player.Center.Y - vectorCenter.Y; - float num797 = (float)Math.Sqrt((double)(num795 * num795 + num796 * num796)); + float num797 = (float)Math.Sqrt(num795 * num795 + num796 * num796); num797 = speed / num797; num795 *= num797; num796 *= num797; @@ -242,6 +232,10 @@ namespace CalamityMod.NPCs.Signus if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; + + if (expertMode) + npc.localAI[1] += death ? 2f : 2f * (float)(1D - lifeRatio); + if (npc.localAI[1] >= 120f) { npc.localAI[1] = 0f; @@ -275,8 +269,8 @@ namespace CalamityMod.NPCs.Signus return; } npc.ai[0] = 1f; - npc.ai[1] = (float)num1250; - npc.ai[2] = (float)num1251; + npc.ai[1] = num1250; + npc.ai[2] = num1251; npc.netUpdate = true; return; } @@ -284,14 +278,18 @@ namespace CalamityMod.NPCs.Signus } else if (npc.ai[0] == 1f) { - Vector2 position = new Vector2(npc.ai[1] * 16f - (float)(npc.width / 2), npc.ai[2] * 16f - (float)(npc.height / 2)); + Vector2 position = new Vector2(npc.ai[1] * 16f - (npc.width / 2), npc.ai[2] * 16f - (npc.height / 2)); for (int m = 0; m < 5; m++) { int dust = Dust.NewDust(position, npc.width, npc.height, 173, 0f, 0f, 90, default, 2f); Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; } + npc.alpha += 2; + if (expertMode) + npc.alpha += death ? 2 : (int)(3D * (1D - lifeRatio)); + if (npc.alpha >= 255) { Main.PlaySound(SoundID.Item8, vectorCenter); @@ -311,18 +309,18 @@ namespace CalamityMod.NPCs.Signus npc.alpha -= 50; if (npc.alpha <= lifeToAlpha) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { - int num660 = NPC.NewNPC((int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 122); + int num660 = NPC.NewNPC((int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } int num661 = NPC.NewNPC((int)(player.position.X - 750f), (int)player.position.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); } for (int num621 = 0; num621 < 5; num621++) { @@ -332,7 +330,7 @@ namespace CalamityMod.NPCs.Signus if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } int num623 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num623].velocity *= 3f; @@ -340,7 +338,7 @@ namespace CalamityMod.NPCs.Signus if (Main.rand.NextBool(2)) { Main.dust[num623].scale = 0.5f; - Main.dust[num623].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num623].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 20; num623++) @@ -378,50 +376,29 @@ namespace CalamityMod.NPCs.Signus float playerLocation = vectorCenter.X - player.Center.X; npc.direction = playerLocation < 0f ? 1 : -1; npc.spriteDirection = npc.direction; - Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2), npc.position.Y + (float)(npc.height / 2)); + Vector2 vector121 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); + npc.ai[1] += 1f; - bool flag104 = false; - if (npc.life < npc.lifeMax / 2 || death) - { - if (npc.ai[1] % 45f == 44f) - { - flag104 = true; - } - } - else if (npc.ai[1] % 65f == 64f) - { - flag104 = true; - } - if (flag104) + float divisor = expertMode ? (death ? 55f : revenge ? 60f : 65f) - (float)Math.Ceiling(30D * (1D - lifeRatio)) : 70f; + + if (npc.ai[1] % divisor == divisor - 1f) { if (Main.netMode != NetmodeID.MultiplayerClient) { float num1070 = 15f; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num1070 += 3f; } - if (cosmicRain) - { - num1070 += 1f; - } - if (cosmicSpeed) - { - num1070 += 1f; - } - if (revenge) - { - num1070 += 1f; - } - float num1071 = player.position.X + (float)player.width * 0.5f - vector121.X; - float num1072 = player.position.Y + (float)player.height * 0.5f - vector121.Y; - float num1073 = (float)Math.Sqrt((double)(num1071 * num1071 + num1072 * num1072)); + float num1071 = player.position.X + player.width * 0.5f - vector121.X; + float num1072 = player.position.Y + player.height * 0.5f - vector121.Y; + float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); num1073 = num1070 / num1073; num1071 *= num1073; num1072 *= num1073; int num1074 = expertMode ? 48 : 60; int num1075 = ModContent.ProjectileType(); - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, (float)(npc.target + 1)); + Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, num1075, num1074, 0f, Main.myPlayer, 0f, npc.target + 1); } } if (npc.position.Y > player.position.Y - 200f) //200 @@ -430,7 +407,7 @@ namespace CalamityMod.NPCs.Signus { npc.velocity.Y *= 0.975f; } - npc.velocity.Y -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y > 3f) { npc.velocity.Y = 3f; @@ -442,37 +419,37 @@ namespace CalamityMod.NPCs.Signus { npc.velocity.Y *= 0.975f; } - npc.velocity.Y += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.Y < -3f) { npc.velocity.Y = -3f; } } - if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 500f) //100 + if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 500f) //100 { if (npc.velocity.X > 0f) { npc.velocity.X *= 0.98f; } - npc.velocity.X -= (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X > 8f) { npc.velocity.X = 8f; } } - if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 500f) //100 + if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 500f) //100 { if (npc.velocity.X < 0f) { npc.velocity.X *= 0.98f; } - npc.velocity.X += (CalamityWorld.bossRushActive ? 0.15f : 0.1f); + npc.velocity.X += CalamityWorld.bossRushActive ? 0.15f : 0.1f; if (npc.velocity.X < -8f) { npc.velocity.X = -8f; } } - if (npc.ai[1] > 300f) + if (npc.ai[1] >= divisor * 5f) { npc.ai[0] = 4f; npc.ai[1] = 0f; @@ -489,15 +466,15 @@ namespace CalamityMod.NPCs.Signus { for (int x = 0; x < 5; x++) { - int num660 = NPC.NewNPC((int)(player.position.X + (float)spawnX), (int)(player.position.Y + (float)spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + int num660 = NPC.NewNPC((int)(player.position.X + spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } - int num661 = NPC.NewNPC((int)(player.position.X - (float)spawnX), (int)(player.position.Y + (float)spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + int num661 = NPC.NewNPC((int)(player.position.X - spawnX), (int)(player.position.Y + spawnY), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num661, 0f, 0f, 0f, 0, 0, 0); } spawnY -= 60; } @@ -521,7 +498,10 @@ namespace CalamityMod.NPCs.Signus npc.spriteDirection = Math.Sign(npc.velocity.X); if (chargeSwitch == 0) //line up the charge { - float scaleFactor6 = death ? 16f : 14f; + float scaleFactor6 = 14f; + if (expertMode) + scaleFactor6 += death ? 6f : 6f * (float)(1D - lifeRatio); + Vector2 center5 = player.Center; Vector2 vector126 = center5 - vectorCenter; Vector2 vector127 = vector126 - Vector2.UnitY * 300f; @@ -580,7 +560,7 @@ namespace CalamityMod.NPCs.Signus if (Main.netMode != NetmodeID.MultiplayerClient) { dustTimer--; - if (cosmicDust && dustTimer <= 0) + if (phase2 && dustTimer <= 0) { Main.PlaySound(SoundID.Item73, npc.position); int damage = expertMode ? 60 : 70; @@ -606,7 +586,7 @@ namespace CalamityMod.NPCs.Signus vec2.Normalize(); if (vec2.HasNaNs()) { - vec2 = new Vector2((float)npc.direction, 0f); + vec2 = new Vector2(npc.direction, 0f); } npc.velocity = (npc.velocity * (num1000 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / num1000; } @@ -705,45 +685,45 @@ namespace CalamityMod.NPCs.Signus glowMaskTexture = ModContent.GetTexture("CalamityMod/NPCs/Signus/SignusGlow"); } - Vector2 vector11 = new Vector2((float)(NPCTexture.Width / 2), (float)(NPCTexture.Height / frameCount / 2)); + Vector2 vector11 = new Vector2(NPCTexture.Width / 2, NPCTexture.Height / frameCount / 2); Color color36 = Color.White; float amount9 = 0.5f; float scale = npc.scale; float rotation = npc.rotation; float offsetY = npc.gfxOffY; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { Color color38 = drawColor; color38 = Color.Lerp(color38, color36, amount9); color38 = npc.GetAlpha(color38); - color38 *= (float)(num153 - num155) / 15f; - Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector41 -= new Vector2((float)NPCTexture.Width, (float)(NPCTexture.Height / frameCount)) * scale / 2f; + color38 *= (num153 - num155) / 15f; + Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector41 -= new Vector2(NPCTexture.Width, NPCTexture.Height / frameCount) * scale / 2f; vector41 += vector11 * scale + new Vector2(0f, 4f + offsetY); spriteBatch.Draw(NPCTexture, vector41, new Rectangle?(frame), color38, rotation, vector11, scale, spriteEffects, 0f); } } Vector2 vector43 = npc.Center - Main.screenPosition; - vector43 -= new Vector2((float)NPCTexture.Width, (float)(NPCTexture.Height / frameCount)) * scale / 2f; + vector43 -= new Vector2(NPCTexture.Width, NPCTexture.Height / frameCount) * scale / 2f; vector43 += vector11 * scale + new Vector2(0f, 4f + offsetY); spriteBatch.Draw(NPCTexture, vector43, new Rectangle?(frame), npc.GetAlpha(drawColor), rotation, vector11, scale, spriteEffects, 0f); Color color40 = Color.Lerp(Color.White, Color.Fuchsia, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { Color color41 = color40; color41 = Color.Lerp(color41, color36, amount9); color41 = npc.GetAlpha(color41); - color41 *= (float)(num153 - num163) / 15f; - Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition; - vector44 -= new Vector2((float)glowMaskTexture.Width, (float)(glowMaskTexture.Height / frameCount)) * scale / 2f; + color41 *= (num153 - num163) / 15f; + Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition; + vector44 -= new Vector2(glowMaskTexture.Width, glowMaskTexture.Height / frameCount) * scale / 2f; vector44 += vector11 * scale + new Vector2(0f, 4f + offsetY); spriteBatch.Draw(glowMaskTexture, vector44, new Rectangle?(frame), color41, rotation, vector11, scale, spriteEffects, 0f); } @@ -822,12 +802,12 @@ namespace CalamityMod.NPCs.Signus } if (npc.life <= 0) { - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.position.X = npc.position.X + (npc.width / 2); + npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 200; npc.height = 150; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); + npc.position.X = npc.position.X - (npc.width / 2); + npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); @@ -835,7 +815,7 @@ namespace CalamityMod.NPCs.Signus if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 60; num623++) @@ -846,7 +826,7 @@ namespace CalamityMod.NPCs.Signus num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); + float randomSpread = Main.rand.Next(-200, 200) / 100; Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus2"), 1f); Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Signus3"), 1f); diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index e790e18208..8267b2a7b7 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.Signus float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 0fd646eeda..b30c761e24 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -9,11 +8,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SlimeGod { - [AutoloadBossHead] + [AutoloadBossHead] public class SlimeGod : ModNPC { private float bossLife; @@ -32,7 +29,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.scale = 1.1f; npc.defense = 10; npc.LifeMaxNERB(4000, 5500, 2200000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -108,9 +105,9 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.Y = (float)(player.Center.Y / 16) * 16f - (float)(npc.height / 2) - 150f; } - if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient) + if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, npc.position); Vector2 spawnAt = vector + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.NewNPC((int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); @@ -537,7 +534,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].ai[1] = 0f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index e34674ac77..a8d20e07dd 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -9,7 +9,6 @@ using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Boss; @@ -20,13 +19,10 @@ using System; using System.IO; using Terraria; using Terraria.ID; -using Terraria.Graphics.Shaders; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SlimeGod { - [AutoloadBossHead] + [AutoloadBossHead] public class SlimeGodCore : ModNPC { int buffedSlime = 0; @@ -44,7 +40,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.height = 44; npc.defense = 6; npc.LifeMaxNERB(4000, 5000, 2500000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); NPCID.Sets.TrailCacheLength[npc.type] = 8; NPCID.Sets.TrailingMode[npc.type] = 1; @@ -116,7 +112,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.damage = npc.defDamage; // Enrage based on large slimes - bool flag100 = false; + bool phase2 = lifeRatio < 0.4f; bool hyperMode = true; bool purpleSlimeAlive = false; bool redSlimeAlive = false; @@ -134,7 +130,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.Calamity().newAI[1] = Main.npc[CalamityGlobalNPC.slimeGodPurple].Center.Y; purpleSlimeAlive = true; - flag100 = lifeRatio >= 0.5f; + phase2 = lifeRatio < 0.2f; hyperMode = false; } } @@ -152,7 +148,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.localAI[3] = Main.npc[CalamityGlobalNPC.slimeGodRed].Center.Y; redSlimeAlive = true; - flag100 = lifeRatio >= 0.5f; + phase2 = lifeRatio < 0.2f; hyperMode = false; } } @@ -243,8 +239,14 @@ namespace CalamityMod.NPCs.SlimeGod Vector2 goToPosition = goToVector - vectorCenter; npc.velocity = Vector2.Normalize(goToPosition) * (CalamityWorld.bossRushActive ? 24f : 16f); + bool slimeDead = false; + if (goToVector == purpleSlimeVector) + slimeDead = CalamityGlobalNPC.slimeGodPurple < 0 || !Main.npc[CalamityGlobalNPC.slimeGodPurple].active; + else + slimeDead = CalamityGlobalNPC.slimeGodRed < 0 || !Main.npc[CalamityGlobalNPC.slimeGodRed].active; + npc.ai[2] += 1f; - if (npc.ai[2] >= 600f) + if (npc.ai[2] >= 600f || slimeDead) { npc.ai[2] = 0f; npc.Calamity().newAI[3] = 0f; @@ -257,7 +259,7 @@ namespace CalamityMod.NPCs.SlimeGod } // Spin and shoot orbs - if (!flag100) + if (phase2) { npc.ai[1] += 1f; if (revenge) @@ -508,7 +510,7 @@ namespace CalamityMod.NPCs.SlimeGod } float num1372 = 6f; - if (!flag100 || death) + if (phase2 || death) { num1372 = 14f; } @@ -520,7 +522,7 @@ namespace CalamityMod.NPCs.SlimeGod { num1372 = 22f; } - if (npc.Calamity().enraged > 0 || player.gravDir == -1f || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || player.gravDir == -1f || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num1372 += 8f; } @@ -591,7 +593,7 @@ namespace CalamityMod.NPCs.SlimeGod float num160 = 0f; int num161 = num159; spriteBatch.Draw(texture2D3, npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, color24, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0); - while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityMod.CalamityConfig.Afterimages) + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = npc.GetAlpha(color25); { diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index be8a22d675..e88c0d36d8 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -9,11 +8,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SlimeGod { - [AutoloadBossHead] + [AutoloadBossHead] public class SlimeGodRun : ModNPC { private float bossLife; @@ -32,7 +29,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.scale = 1.1f; npc.defense = 12; npc.LifeMaxNERB(3500, 4820, 1600000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; animationType = 50; @@ -111,9 +108,9 @@ namespace CalamityMod.NPCs.SlimeGod npc.position.Y = (float)(player.Center.Y / 16) * 16f - (float)(npc.height / 2) - 150f; } - if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient) + if ((double)npc.life <= (double)npc.lifeMax * 0.5 && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, npc.position); Vector2 spawnAt = vector + new Vector2(0f, (float)npc.height / 2f); NPC.NewNPC((int)spawnAt.X - 30, (int)spawnAt.Y, ModContent.NPCType()); NPC.NewNPC((int)spawnAt.X + 30, (int)spawnAt.Y, ModContent.NPCType()); @@ -550,7 +547,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].ai[1] = 0f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index a6ae831a56..af11c2316b 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -9,11 +8,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SlimeGod { - [AutoloadBossHead] + [AutoloadBossHead] public class SlimeGodRunSplit : ModNPC { private float bossLife; @@ -27,7 +24,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { npc.LifeMaxNERB(875, 1205, 800000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.damage = 45; npc.width = 150; @@ -526,7 +523,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].ai[1] = 0f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index a68d7c5fd9..6f95f4c496 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.TreasureBags; using CalamityMod.Projectiles.Boss; using CalamityMod.World; @@ -9,11 +8,9 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SlimeGod { - [AutoloadBossHead] + [AutoloadBossHead] public class SlimeGodSplit : ModNPC { private float bossLife; @@ -27,7 +24,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { npc.LifeMaxNERB(1000, 1375, 1100000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.damage = 40; npc.width = 150; @@ -516,7 +513,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[num664].ai[1] = 0f; if (Main.netMode == NetmodeID.Server && num664 < 200) { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index 2e64bb8fe1..7a1d77fc94 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index d9816fc655..d1d6cf5c9f 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index 7db713c745..b32e6a5628 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index a5b7ab0616..cf24a872bd 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Enemy; +using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index 735c6edbd1..1512bf4556 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.width = 30; npc.height = 30; npc.defense = 60; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.lifeMax = 1200; if (CalamityWorld.bossRushActive) { diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index 52160abba8..8bc5f31d93 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 86795f1350..97b112e3a5 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -1,14 +1,12 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { - public class StormWeaverBody : ModNPC + public class StormWeaverBody : ModNPC { private int spawn = 0; @@ -41,7 +39,7 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -241,7 +239,7 @@ namespace CalamityMod.NPCs.StormWeaver int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } npc.netUpdate = true; } diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index 6585d8c743..445d0a20f3 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -1,13 +1,10 @@ using CalamityMod.World; -using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { @@ -42,8 +39,8 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -85,6 +82,7 @@ namespace CalamityMod.NPCs.StormWeaver public override void AI() { bool expertMode = Main.expertMode; + if (invinceTime > 0) { invinceTime--; @@ -96,24 +94,14 @@ namespace CalamityMod.NPCs.StormWeaver npc.damage = npc.defDamage; npc.dontTakeDamage = false; } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } + bool flag = false; if (npc.ai[1] <= 0f) { @@ -129,6 +117,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.HitEffect(0, 10.0); npc.checkDead(); } + if (Main.npc[(int)npc.ai[1]].alpha < 128) { if (npc.alpha != 0) @@ -146,34 +135,31 @@ namespace CalamityMod.NPCs.StormWeaver npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { try { - vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; } catch { } - npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; - num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); int num194 = npc.width; - num193 = (num193 - (float)num194) / num193; + num193 = (num193 - num194) / num193; num191 *= num193; num192 *= num193; npc.velocity = Vector2.Zero; @@ -205,7 +191,7 @@ namespace CalamityMod.NPCs.StormWeaver int num159 = 1; float num160 = 0f; int num161 = num159; - while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityMod.CalamityConfig.Afterimages) + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = npc.GetAlpha(color25); { @@ -288,7 +274,7 @@ namespace CalamityMod.NPCs.StormWeaver int num660 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); if (Main.netMode == NetmodeID.Server) { - NetMessage.SendData(23, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num660, 0f, 0f, 0f, 0, 0, 0); } npc.netUpdate = true; } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 77b5dae334..adb60026cc 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -5,8 +5,6 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { @@ -50,8 +48,8 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -145,17 +143,22 @@ namespace CalamityMod.NPCs.StormWeaver } tail = true; } + int damage = expertMode ? 62 : 75; - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 360f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; - float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; - Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); - } + if (expertMode) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 360f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + npc.netUpdate = true; + float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; + Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + } + } + if (BoltCountdown == 0) { BoltCountdown = 600; @@ -166,7 +169,7 @@ namespace CalamityMod.NPCs.StormWeaver if (BoltCountdown == 0) { int speed2 = revenge ? 8 : 7; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { speed2 += 1; } @@ -296,9 +299,10 @@ namespace CalamityMod.NPCs.StormWeaver } else { - num188 = revenge ? 14f : 13f; - num189 = revenge ? 0.44f : 0.4f; - if (!Main.player[npc.target].ZoneSkyHeight && CalamityWorld.DoGSecondStageCountdown <= 0) + num188 = revenge ? 11f : 10f; + num189 = revenge ? 0.31f : 0.28f; + + if (!Main.player[npc.target].ZoneSkyHeight && CalamityWorld.DoGSecondStageCountdown <= 0 && expertMode) { num188 *= 2f; num189 *= 2f; diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 13473f9169..78a8e17226 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -3,16 +3,14 @@ using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { [AutoloadBossHead] @@ -53,8 +51,8 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -93,6 +91,7 @@ namespace CalamityMod.NPCs.StormWeaver bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; + if (invinceTime > 0) { invinceTime--; @@ -104,12 +103,15 @@ namespace CalamityMod.NPCs.StormWeaver npc.damage = npc.defDamage; npc.dontTakeDamage = false; } + if (!Main.raining && !CalamityWorld.bossRushActive && CalamityWorld.DoGSecondStageCountdown <= 0) { CalamityUtils.StartRain(); } - double lifeRatio = (double)npc.life / (double)npc.lifeMax; + + double lifeRatio = npc.life / (double)npc.lifeMax; int lifePercentage = (int)(100.0 * lifeRatio); + int BoltProjectiles = 2; if (lifePercentage < 33 || death) { @@ -119,16 +121,19 @@ namespace CalamityMod.NPCs.StormWeaver { BoltProjectiles = 3; } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) { npc.TargetClosest(true); } - npc.velocity.Length(); + if (npc.alpha != 0) { for (int num934 = 0; num934 < 2; num934++) @@ -138,11 +143,13 @@ namespace CalamityMod.NPCs.StormWeaver Main.dust[num935].noLight = true; } } + npc.alpha -= 12; if (npc.alpha < 0) { npc.alpha = 0; } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!tail && npc.ai[0] == 0f) @@ -160,25 +167,30 @@ namespace CalamityMod.NPCs.StormWeaver lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType(), npc.whoAmI); } Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; + Main.npc[lol].ai[2] = npc.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; npc.netUpdate = true; Previous = lol; } tail = true; } + int damage = expertMode ? 62 : 75; - npc.localAI[0] += 1f; - if (npc.localAI[0] >= 300f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; - float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; - Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); - } + if (expertMode) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] >= 300f) + { + npc.localAI[0] = 0f; + npc.TargetClosest(true); + npc.netUpdate = true; + float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; + Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); + Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + } + } + if (BoltCountdown == 0) { BoltCountdown = 600; @@ -189,11 +201,11 @@ namespace CalamityMod.NPCs.StormWeaver if (BoltCountdown == 0) { int speed2 = revenge ? 8 : 7; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { speed2 += 1; } - float spawnX2 = (float)Main.rand.Next(2001) - 1000f + Main.player[npc.target].Center.X; + float spawnX2 = Main.rand.Next(2001) - 1000f + Main.player[npc.target].Center.X; float spawnY2 = -1000f + Main.player[npc.target].Center.Y; Vector2 baseSpawn = new Vector2(spawnX2, spawnY2); Vector2 baseVelocity = Main.player[npc.target].Center - baseSpawn; @@ -203,15 +215,16 @@ namespace CalamityMod.NPCs.StormWeaver { Vector2 spawn2 = baseSpawn; spawn2.X = spawn2.X + i * 30 - (BoltProjectiles * 15); - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / (float)BoltProjectiles))); + Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / BoltProjectiles))); velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; Vector2 vector94 = Main.player[npc.target].Center - spawn2; - float ai = (float)Main.rand.Next(100); + float ai = Main.rand.Next(100); Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, 466, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } } } + if (Main.player[npc.target].dead && npc.life > 0) { npc.TargetClosest(false); @@ -241,6 +254,7 @@ namespace CalamityMod.NPCs.StormWeaver } } } + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 10000f && npc.life > 0) { CalamityWorld.DoGSecondStageCountdown = 0; @@ -261,6 +275,7 @@ namespace CalamityMod.NPCs.StormWeaver } } } + if (npc.velocity.X < 0f) { npc.spriteDirection = -1; @@ -269,39 +284,24 @@ namespace CalamityMod.NPCs.StormWeaver { npc.spriteDirection = 1; } + if (Main.player[npc.target].dead) { npc.TargetClosest(false); } - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); float num188 = revenge ? 13f : 12f; - float num189 = revenge ? 0.41f : 0.38f; - if (!Main.player[npc.target].ZoneSkyHeight && CalamityWorld.DoGSecondStageCountdown <= 0) + float num189 = revenge ? 0.31f : 0.28f; + + if (!Main.player[npc.target].ZoneSkyHeight && CalamityWorld.DoGSecondStageCountdown <= 0 && expertMode) { num188 *= 2f; num189 *= 2f; } + float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; float num50 = npc.velocity.Length(); @@ -318,29 +318,16 @@ namespace CalamityMod.NPCs.StormWeaver npc.velocity *= num49; } } - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - float num196 = System.Math.Abs(num191); - float num197 = System.Math.Abs(num192); + float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + float num196 = Math.Abs(num191); + float num197 = Math.Abs(num192); float num198 = num188 / num193; num191 *= num198; num192 *= num198; @@ -368,7 +355,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.velocity.Y = npc.velocity.Y - num189; } } - if ((double)System.Math.Abs(num192) < (double)num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) + if (Math.Abs(num192) < num188 * 0.2 && ((npc.velocity.X > 0f && num191 < 0f) || (npc.velocity.X < 0f && num191 > 0f))) { if (npc.velocity.Y > 0f) { @@ -379,7 +366,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.velocity.Y = npc.velocity.Y - num189 * 2f; } } - if ((double)System.Math.Abs(num191) < (double)num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) + if (Math.Abs(num191) < num188 * 0.2 && ((npc.velocity.Y > 0f && num192 < 0f) || (npc.velocity.Y < 0f && num192 > 0f))) { if (npc.velocity.X > 0f) { @@ -403,7 +390,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.velocity.X = npc.velocity.X - num189 * 1.1f; //changed from 1.1 } - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.Y > 0f) { @@ -425,7 +412,7 @@ namespace CalamityMod.NPCs.StormWeaver { npc.velocity.Y = npc.velocity.Y - num189 * 1.1f; } - if ((double)(System.Math.Abs(npc.velocity.X) + System.Math.Abs(npc.velocity.Y)) < (double)num188 * 0.5) + if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < num188 * 0.5) { if (npc.velocity.X > 0f) { @@ -438,7 +425,7 @@ namespace CalamityMod.NPCs.StormWeaver } } } - npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + 1.57f; } public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) @@ -456,7 +443,7 @@ namespace CalamityMod.NPCs.StormWeaver int num159 = 1; float num160 = 0f; int num161 = num159; - while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityMod.CalamityConfig.Afterimages) + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = npc.GetAlpha(color25); { diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 313ec75c47..00f5324989 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -1,15 +1,12 @@ -using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { - public class StormWeaverTail : ModNPC + public class StormWeaverTail : ModNPC { public override void SetStaticDefaults() { @@ -38,7 +35,7 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = (double)CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index 673beadc96..c565aa4c42 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -1,13 +1,10 @@ using CalamityMod.World; -using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.StormWeaver { @@ -40,8 +37,8 @@ namespace CalamityMod.NPCs.StormWeaver else music = MusicID.Boss3; } - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -93,24 +90,14 @@ namespace CalamityMod.NPCs.StormWeaver npc.damage = npc.defDamage; npc.dontTakeDamage = false; } - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + + Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + if (npc.ai[3] > 0f) { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } + bool flag = false; if (npc.ai[1] <= 0f) { @@ -126,6 +113,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.HitEffect(0, 10.0); npc.checkDead(); } + if (Main.npc[(int)npc.ai[1]].alpha < 128) { if (npc.alpha != 0) @@ -143,34 +131,31 @@ namespace CalamityMod.NPCs.StormWeaver npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } - Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); - float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - num191 = (float)((int)(num191 / 16f) * 16); - num192 = (float)((int)(num192 / 16f) * 16); - vector18.X = (float)((int)(vector18.X / 16f) * 16); - vector18.Y = (float)((int)(vector18.Y / 16f) * 16); + + Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2); + float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2); + num191 = (int)(num191 / 16f) * 16; + num192 = (int)(num192 / 16f) * 16; + vector18.X = (int)(vector18.X / 16f) * 16; + vector18.Y = (int)(vector18.Y / 16f) * 16; num191 -= vector18.X; num192 -= vector18.Y; - float num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); - if (npc.ai[1] > 0f && npc.ai[1] < (float)Main.npc.Length) + float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { try { - vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (float)(Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; + num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; } catch { } - npc.rotation = (float)System.Math.Atan2((double)num192, (double)num191) + 1.57f; - num193 = (float)System.Math.Sqrt((double)(num191 * num191 + num192 * num192)); + npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f; + num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192); int num194 = npc.width; - num193 = (num193 - (float)num194) / num193; + num193 = (num193 - num194) / num193; num191 *= num193; num192 *= num193; npc.velocity = Vector2.Zero; @@ -202,7 +187,7 @@ namespace CalamityMod.NPCs.StormWeaver int num159 = 1; float num160 = 0f; int num161 = num159; - while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityMod.CalamityConfig.Afterimages) + while (((num158 > 0 && num161 < num157) || (num158 < 0 && num161 > num157)) && CalamityConfig.Instance.Afterimages) { Color color26 = npc.GetAlpha(color25); { diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 850e505827..f1d141f0f3 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Enemy; using CalamityMod.Items.Materials; @@ -13,7 +12,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class AnthozoanCrab : ModNPC + public class AnthozoanCrab : ModNPC { public int boulderIndex; public override void SetStaticDefaults() diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index a6532b7e3a..f92862330f 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Enemy; using CalamityMod.Items.Materials; @@ -13,7 +12,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class BelchingCoral : ModNPC + public class BelchingCoral : ModNPC { public const float CheckDistance = 480f; public override void SetStaticDefaults() diff --git a/NPCs/SulphurousSea/Catfish.cs b/NPCs/SulphurousSea/Catfish.cs index 76db0652df..e25ae8eca6 100644 --- a/NPCs/SulphurousSea/Catfish.cs +++ b/NPCs/SulphurousSea/Catfish.cs @@ -1,7 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Items.Materials; -using CalamityMod.World; -using System; +using CalamityMod.Items.Placeables.Banners; using System.IO; using Terraria; using Terraria.ID; @@ -9,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class Catfish : ModNPC + public class Catfish : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/SulphurousSea/Flounder.cs b/NPCs/SulphurousSea/Flounder.cs index 24ae839dd8..95b6cd60f2 100644 --- a/NPCs/SulphurousSea/Flounder.cs +++ b/NPCs/SulphurousSea/Flounder.cs @@ -1,16 +1,12 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class Flounder : ModNPC + public class Flounder : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 3e9ab503d7..a540b0257b 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class Gnasher : ModNPC + public class Gnasher : ModNPC { public override void SetStaticDefaults() { @@ -21,7 +20,7 @@ namespace CalamityMod.NPCs.SulphurousSea npc.width = 50; npc.height = 36; npc.defense = 30; - npc.Calamity().RevPlusDR(0.15f); + npc.DR_NERD(0.15f); npc.lifeMax = 35; npc.knockBackResist = 0.25f; npc.aiStyle = 3; diff --git a/NPCs/SulphurousSea/Mauler.cs b/NPCs/SulphurousSea/Mauler.cs index 9d6ddfba90..023a4f0eec 100644 --- a/NPCs/SulphurousSea/Mauler.cs +++ b/NPCs/SulphurousSea/Mauler.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.NPCs.AquaticScourge; @@ -14,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class Mauler : ModNPC + public class Mauler : ModNPC { private bool hasBeenHit = false; @@ -31,7 +30,7 @@ namespace CalamityMod.NPCs.SulphurousSea npc.width = 180; npc.height = 90; npc.defense = 50; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = 165000; npc.aiStyle = -1; aiType = -1; @@ -284,7 +283,7 @@ namespace CalamityMod.NPCs.SulphurousSea public void BlowUp() { - Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 60); + Main.PlaySound(SoundID.NPCDeath60, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 valueBoom = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); diff --git a/NPCs/SulphurousSea/MicrobialCluster.cs b/NPCs/SulphurousSea/MicrobialCluster.cs index 3e809a2e6d..4136974dd3 100644 --- a/NPCs/SulphurousSea/MicrobialCluster.cs +++ b/NPCs/SulphurousSea/MicrobialCluster.cs @@ -1,19 +1,12 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Banners; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.World; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class MicrobialCluster : ModNPC + public class MicrobialCluster : ModNPC { public const int ChargeRate = 120; public const int SlowdownTime = 45; diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index d55430cfe6..1b22e75f28 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SulphurousSea { - public class Trasher : ModNPC + public class Trasher : ModNPC { private bool hasBeenHit = false; diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index cde9ece8c1..660458a01d 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -1,16 +1,15 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.SunkenSea { - public class BlindedAngler : ModNPC + public class BlindedAngler : ModNPC { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.NPCs.SunkenSea npc.width = 56; npc.height = 44; npc.defense = 30; - npc.Calamity().RevPlusDR(0.2f); + npc.DR_NERD(0.2f); npc.lifeMax = 750; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index 2da9967774..6a8fa5d317 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using System.IO; @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.SunkenSea npc.width = 56; npc.height = 38; npc.defense = 9999; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.lifeMax = Main.hardMode ? 300 : 150; if (Main.expertMode) { diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 9e9fb8ae5a..015a2dfb45 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.SunkenSea npc.width = 116; npc.height = 36; npc.defense = Main.hardMode ? 15 : 5; - npc.Calamity().RevPlusDR(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = Main.hardMode ? 500 : 150; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 70c52d53e9..8f43df710d 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Accessories; using CalamityMod.World; using Microsoft.Xna.Framework; diff --git a/NPCs/SunkenSea/GhostBellSmall.cs b/NPCs/SunkenSea/GhostBellSmall.cs index 3445818d55..45cd962756 100644 --- a/NPCs/SunkenSea/GhostBellSmall.cs +++ b/NPCs/SunkenSea/GhostBellSmall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Critters; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 86f7a413dc..c2d3aa4716 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.SunkenSea npc.width = 160; npc.height = 120; npc.defense = 9999; - npc.Calamity().RevPlusDR(0.3f); + npc.DR_NERD(0.3f); npc.lifeMax = Main.hardMode ? 7500 : 1250; npc.buffImmune[ModContent.BuffType()] = false; npc.aiStyle = -1; diff --git a/NPCs/SunkenSea/PrismTurtle.cs b/NPCs/SunkenSea/PrismTurtle.cs index 14abaa841b..0f1d7f69f8 100644 --- a/NPCs/SunkenSea/PrismTurtle.cs +++ b/NPCs/SunkenSea/PrismTurtle.cs @@ -1,16 +1,15 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.SunkenSea { - public class PrismTurtle : ModNPC + public class PrismTurtle : ModNPC { public bool hasBeenHit = false; @@ -27,7 +26,7 @@ namespace CalamityMod.NPCs.SunkenSea npc.width = 72; npc.height = 58; npc.defense = Main.hardMode ? 25 : 10; - npc.Calamity().RevPlusDR(0.25f); + npc.DR_NERD(0.25f); npc.lifeMax = Main.hardMode ? 1000 : 350; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index 33ebd19221..9f1495467e 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using System.IO; using Terraria; using Terraria.ID; diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index 0d07144f69..0c9f8ceac4 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Critters; using System; using Terraria; diff --git a/NPCs/SunkenSea/SeaSerpent1.cs b/NPCs/SunkenSea/SeaSerpent1.cs index fa3b2f7a3c..c084e3269b 100644 --- a/NPCs/SunkenSea/SeaSerpent1.cs +++ b/NPCs/SunkenSea/SeaSerpent1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using System; @@ -55,7 +55,6 @@ namespace CalamityMod.NPCs.SunkenSea { npc.TargetClosest(true); } - npc.velocity.Length(); if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && npc.ai[0] == 0f) @@ -84,7 +83,7 @@ namespace CalamityMod.NPCs.SunkenSea Main.npc[lol].ai[2] = (float)npc.whoAmI; Main.npc[lol].ai[1] = (float)Previous; Main.npc[Previous].ai[0] = (float)lol; - NetMessage.SendData(23, -1, -1, null, lol, 0f, 0f, 0f, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } TailSpawned = true; @@ -116,44 +115,26 @@ namespace CalamityMod.NPCs.SunkenSea Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - int num42 = -1; - int num43 = (int)(Main.player[npc.target].Center.X / 16f); - int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) - { - for (int num46 = num44; num46 <= num44 + 15; num46++) - { - if (WorldGen.SolidTile2(num45, num46)) - { - num42 = num46; - break; - } - } - if (num42 > 0) - { - break; - } - } - if (num42 > 0) - { - num42 *= 16; - float num47 = (float)(num42 - 200); //800 - if ((Main.player[npc.target].Center - npc.Center).Length() > 250f) - { - num192 = num47; - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) - { - if (npc.velocity.X > 0f) - { - num191 = Main.player[npc.target].Center.X + 300f; - } - else - { - num191 = Main.player[npc.target].Center.X - 300f; - } - } - } - } + if (npc.life > npc.lifeMax * 0.99) + { + num192 += 300; + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f) + { + if (npc.velocity.X > 0f) + { + num191 = Main.player[npc.target].Center.X + 300f; + } + else + { + num191 = Main.player[npc.target].Center.X - 300f; + } + } + } + else + { + num188 *= 1.5f; + num189 *= 1.5f; + } float num48 = num188 * 1.3f; float num49 = num188 * 0.7f; float num50 = npc.velocity.Length(); @@ -170,40 +151,6 @@ namespace CalamityMod.NPCs.SunkenSea npc.velocity *= num49; } } - if ((Main.player[npc.target].Center - npc.Center).Length() > 250f) - { - for (int num51 = 0; num51 < 200; num51++) - { - if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) - { - Vector2 vector3 = Main.npc[num51].Center - npc.Center; - if (vector3.Length() < 400f) - { - vector3.Normalize(); - vector3 *= 1000f; - num191 -= vector3.X; - num192 -= vector3.Y; - } - } - } - } - else - { - for (int num52 = 0; num52 < 200; num52++) - { - if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) - { - Vector2 vector4 = Main.npc[num52].Center - npc.Center; - if (vector4.Length() < 60f) - { - vector4.Normalize(); - vector4 *= 200f; - num191 -= vector4.X; - num192 -= vector4.Y; - } - } - } - } num191 = (float)((int)(num191 / 16f) * 16); num192 = (float)((int)(num192 / 16f) * 16); vector18.X = (float)((int)(vector18.X / 16f) * 16); @@ -360,7 +307,7 @@ namespace CalamityMod.NPCs.SunkenSea { Main.npc[k].life = 0; Main.npc[k].netSkip = -1; - NetMessage.SendData(23, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, k, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/NPCs/SunkenSea/SeaSerpent2.cs b/NPCs/SunkenSea/SeaSerpent2.cs index 6bb4875a14..6534de15c5 100644 --- a/NPCs/SunkenSea/SeaSerpent2.cs +++ b/NPCs/SunkenSea/SeaSerpent2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -54,19 +54,6 @@ namespace CalamityMod.NPCs.SunkenSea { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -94,10 +81,6 @@ namespace CalamityMod.NPCs.SunkenSea npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/SunkenSea/SeaSerpent3.cs b/NPCs/SunkenSea/SeaSerpent3.cs index c56fce5006..cb4b02cc7d 100644 --- a/NPCs/SunkenSea/SeaSerpent3.cs +++ b/NPCs/SunkenSea/SeaSerpent3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/SunkenSea/SeaSerpent4.cs b/NPCs/SunkenSea/SeaSerpent4.cs index fd1e86d84d..faddc7c362 100644 --- a/NPCs/SunkenSea/SeaSerpent4.cs +++ b/NPCs/SunkenSea/SeaSerpent4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/SunkenSea/SeaSerpent5.cs b/NPCs/SunkenSea/SeaSerpent5.cs index ab8b4fff4b..ddb07b0079 100644 --- a/NPCs/SunkenSea/SeaSerpent5.cs +++ b/NPCs/SunkenSea/SeaSerpent5.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea { npc.realLife = (int)npc.ai[3]; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - npc.velocity.Length(); - if (npc.velocity.X < 0f) - { - npc.spriteDirection = -1; - } - else if (npc.velocity.X > 0f) - { - npc.spriteDirection = 1; - } bool flag = false; if (npc.ai[1] <= 0f) { @@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea npc.alpha = 0; } } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/SupremeCalamitas/SCalWormBody.cs b/NPCs/SupremeCalamitas/SCalWormBody.cs index 74a7abf591..f9ef65298e 100644 --- a/NPCs/SupremeCalamitas/SCalWormBody.cs +++ b/NPCs/SupremeCalamitas/SCalWormBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index bce91df87d..ba61be3cae 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using System.IO; using Terraria; diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index 7b84c4810f..696bdf7583 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!npc.active && Main.netMode == NetmodeID.Server) { - NetMessage.SendData(28, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } } if (Main.player[npc.target].dead) diff --git a/NPCs/SupremeCalamitas/SCalWormHeart.cs b/NPCs/SupremeCalamitas/SCalWormHeart.cs index bba5e562b1..f75e9ef0b0 100644 --- a/NPCs/SupremeCalamitas/SCalWormHeart.cs +++ b/NPCs/SupremeCalamitas/SCalWormHeart.cs @@ -1,12 +1,11 @@ -using CalamityMod.Projectiles.Rogue; -using CalamityMod.World; +using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.SupremeCalamitas { - public class SCalWormHeart : ModNPC + public class SCalWormHeart : ModNPC { public override void SetStaticDefaults() { diff --git a/NPCs/SupremeCalamitas/SCalWormTail.cs b/NPCs/SupremeCalamitas/SCalWormTail.cs index 75edcb310e..8b6fded520 100644 --- a/NPCs/SupremeCalamitas/SCalWormTail.cs +++ b/NPCs/SupremeCalamitas/SCalWormTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index fa3bcb42fe..f9952ccbd7 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -1,6 +1,5 @@ -using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Boss; using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.SupremeCalamitas { - public class SoulSeekerSupreme : ModNPC + public class SoulSeekerSupreme : ModNPC { private int timer = 0; private bool start = true; @@ -32,7 +31,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.canGhostHeal = false; npc.damage = 0; npc.defense = 80; - npc.Calamity().RevPlusDR(0.35f); + npc.DR_NERD(0.35f); npc.LifeMaxNERB(Main.expertMode ? 90000 : 50000, 170000); for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -147,7 +146,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float amount9 = 0.5f; int num153 = 5; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -170,7 +169,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SoulSeekerSupremeGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index a9b76ac438..76fb36b27e 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; @@ -89,14 +89,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 120; npc.height = 120; npc.defense = 120; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = CalamityWorld.bossRushActive ? bossRushDR : CalamityWorld.death ? deathDR : normalDR; - global.customDR = true; - global.multDRReductions.Add(BuffID.Ichor, 0.9f); - global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); + npc.DR_NERD(normalDR, normalDR, deathDR, bossRushDR, true); + CalamityGlobalNPC global = npc.Calamity(); + global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.value = Item.buyPrice(10, 0, 0, 0); npc.LifeMaxNERB(5000000, 5500000, 2100000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -230,7 +228,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; bool death = CalamityWorld.death || CalamityWorld.bossRushActive; - bool enraged = npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive); + bool enraged = npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive); Vector2 vectorCenter = npc.Center; // Get a target @@ -679,7 +677,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } - if (bulletHellCounter2 % 225 == 0) //giant homing fireballs + if (bulletHellCounter2 % 225 == 0 && expertMode) //giant homing fireballs { Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, passedVar); passedVar += 1f; @@ -1037,7 +1035,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (Main.netMode != NetmodeID.MultiplayerClient) { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 74); + Main.PlaySound(SoundID.Item74, npc.position); for (int I = 0; I < 20; I++) { int FireEye = NPC.NewNPC((int)(vectorCenter.X + (Math.Sin(I * 18) * 300)), (int)(vectorCenter.Y + (Math.Cos(I * 18) * 300)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); @@ -1250,6 +1248,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num823 = 12f; float num824 = 0.12f; + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num824 *= 0.5f; + } + Vector2 vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num825 = player.position.X + (player.width / 2) - vector82.X; float num826 = player.position.Y + (player.height / 2) - 550f - vector82.Y; @@ -1430,6 +1435,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num412 = 32f; float num413 = 1.2f; + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num413 *= 0.5f; + } + int num414 = 1; if (npc.position.X + (npc.width / 2) < player.position.X + player.width) num414 = -1; @@ -1516,6 +1528,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num832 = 32f; float num833 = 1.2f; + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num833 *= 0.5f; + } + Vector2 vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num834 = player.position.X + (player.width / 2) + (num831 * 750) - vector83.X; //600 float num835 = player.position.Y + (player.height / 2) - vector83.Y; @@ -1631,7 +1650,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int num388 = 0; num388 < 50; num388++) Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + Main.PlaySound(SoundID.Roar, npc.position); } } @@ -1773,6 +1792,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num823 = 12f; float num824 = 0.12f; + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num824 *= 0.5f; + } + Vector2 vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num825 = player.position.X + (player.width / 2) - vector82.X; float num826 = player.position.Y + (player.height / 2) - 550f - vector82.Y; @@ -1949,6 +1975,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float num412 = 32f; float num413 = 1.2f; + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num413 *= 0.5f; + } + int num414 = 1; if (npc.position.X + (npc.width / 2) < player.position.X + player.width) num414 = -1; @@ -2035,6 +2069,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas float num832 = 32f; float num833 = 1.2f; + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = player.inventory[player.selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num833 *= 0.5f; + } + Vector2 vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); float num834 = player.position.X + (player.width / 2) + (num831 * 750) - vector83.X; //600 float num835 = player.position.Y + (player.height / 2) - vector83.Y; @@ -2288,7 +2329,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -2311,7 +2352,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas texture2D15 = npc.ai[0] > 1f ? ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitas2Glow") : ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 1070946f59..96afbf5f59 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -1,7 +1,6 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,12 +8,10 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SupremeCalamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class SupremeCataclysm : ModNPC { private int distanceY = -375; @@ -33,14 +30,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 120; npc.height = 120; npc.defense = 100; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = CalamityWorld.bossRushActive ? 0.6f : CalamityWorld.death ? 0.75f : 0.7f; - global.customDR = true; - global.multDRReductions.Add(BuffID.Ichor, 0.9f); - global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); + npc.DR_NERD(0.7f, 0.7f, 0.75f, 0.6f, true); + CalamityGlobalNPC global = npc.Calamity(); + global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.LifeMaxNERB(1200000, 1500000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -87,7 +82,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.TargetClosest(true); float num676 = 60f; float num677 = 1.5f; - float distanceX = 750f; + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num677 *= 0.5f; + } + + float distanceX = 750f; if (npc.ai[3] < 750f) { npc.ai[3] += 1f; @@ -171,7 +174,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.ai[2] = 0f; float num689 = 7f; int num690 = expertMode ? 150 : 200; //600 500 - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 20); + Main.PlaySound(SoundID.Item20, npc.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -219,7 +222,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -242,7 +245,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysmGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 4618f0018c..d895ac72bd 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -1,7 +1,6 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,12 +8,10 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ModLoader.Config; -using CalamityMod; namespace CalamityMod.NPCs.SupremeCalamitas { - [AutoloadBossHead] + [AutoloadBossHead] public class SupremeCatastrophe : ModNPC { private int distanceY = 375; @@ -33,14 +30,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.width = 120; npc.height = 120; npc.defense = 100; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = CalamityWorld.bossRushActive ? 0.6f : CalamityWorld.death ? 0.75f : 0.7f; - global.customDR = true; - global.multDRReductions.Add(BuffID.Ichor, 0.9f); - global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); + npc.DR_NERD(0.7f, 0.7f, 0.75f, 0.6f, true); + CalamityGlobalNPC global = npc.Calamity(); + global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); npc.LifeMaxNERB(1200000, 1500000); - double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; - npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; + npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; @@ -87,7 +82,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.TargetClosest(true); float num676 = 60f; float num677 = 1.5f; - float distanceX = 750f; + + // Reduce acceleration if target is holding a true melee weapon + Item targetSelectedItem = Main.player[npc.target].inventory[Main.player[npc.target].selectedItem]; + if (targetSelectedItem.melee && (targetSelectedItem.shoot == 0 || CalamityMod.trueMeleeProjectileList.Contains(targetSelectedItem.shoot))) + { + num677 *= 0.5f; + } + + float distanceX = 750f; if (npc.ai[3] < 750f) { npc.ai[3] += 1f; @@ -171,7 +174,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.ai[2] = 0f; float num689 = 7f; int num690 = expertMode ? 150 : 200; //600 500 - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 20); + Main.PlaySound(SoundID.Item20, npc.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -219,7 +222,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float amount9 = 0.5f; int num153 = 7; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { @@ -242,7 +245,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCatastropheGlow"); Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f); - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163++) { diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index 82f98590b9..dabb943dcd 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Ammo; using CalamityMod.Items.Materials; -using CalamityMod.Items.Pets; using CalamityMod.Items.Potions; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Magic; @@ -20,7 +19,7 @@ using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.NPCs.TownNPCs { - [AutoloadHead] + [AutoloadHead] public class DILF : ModNPC { public override void SetStaticDefaults() diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index ee4acaf147..2224f11c68 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -13,10 +13,9 @@ using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ModLoader.Config; namespace CalamityMod.NPCs.TownNPCs { - [AutoloadHead] + [AutoloadHead] public class SEAHOE : ModNPC { public override void SetStaticDefaults() @@ -288,7 +287,7 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 20, 0, 0); nextSlot++; } - if (NPC.downedFishron && CalamityMod.CalamityConfig.SellBossSummons) + if (NPC.downedFishron && CalamityConfig.Instance.SellVanillaSummons) { shop.item[nextSlot].SetDefaults(ItemID.TruffleWorm); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 40, 0, 0); diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 31e18bf172..e7d0e8556a 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.TownNPCs Main.LocalPlayer.SellItem((int)Main.LocalPlayer.Calamity().moneyStolenByBandit, 1); Main.LocalPlayer.Calamity().moneyStolenByBandit = 0; NPC goblinFucker = Main.npc[goblinIndex]; - Main.PlaySound(18, -1, -1, 1, 1f, 0f); //money dink sound + Main.PlaySound(SoundID.Coins, -1, -1, 1, 1f, 0f); //money dink sound switch (Main.rand.Next(2)) { case 0: diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index d01da9fbb5..570cd234b7 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.Yharon float amount9 = 0.5f; int num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/Yharon/DetonatingFlare2.cs b/NPCs/Yharon/DetonatingFlare2.cs index ecb9f459ef..4c7178c56b 100644 --- a/NPCs/Yharon/DetonatingFlare2.cs +++ b/NPCs/Yharon/DetonatingFlare2.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Yharon { - public class DetonatingFlare2 : ModNPC + public class DetonatingFlare2 : ModNPC { float randomSpeed = 0f; @@ -83,7 +82,7 @@ namespace CalamityMod.NPCs.Yharon float amount9 = 0.5f; int num153 = 10; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += 2) { diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 3d405f54ae..54a732a52b 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -6,7 +6,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; -using CalamityMod.Items.SummonItems; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -31,7 +30,9 @@ namespace CalamityMod.NPCs.Yharon public class Yharon : ModNPC { private Rectangle safeBox = default; - private bool enraged = false; + private Vector2 flareDustBulletHellSpawn = default; + + private bool enraged = false; private bool protectionBoost = false; private bool moveCloser = false; private bool phaseOneLoot = true; @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.Yharon npc.height = 200; npc.defense = 150; npc.LifeMaxNERB(2275000, 2525000, 3700000); - double HPBoost = CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; + double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; npc.aiStyle = -1; @@ -80,10 +81,8 @@ namespace CalamityMod.NPCs.Yharon npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; - CalamityGlobalNPC global = npc.Calamity(); - global.DR = Phase1_DR; - global.customDR = true; - global.flatDRReductions.Add(BuffID.Ichor, 0.05f); + npc.DR_NERD(Phase1_DR, null, null, null, true); + CalamityGlobalNPC global = npc.Calamity(); global.flatDRReductions.Add(BuffID.CursedInferno, 0.05f); npc.noGravity = true; @@ -122,11 +121,15 @@ namespace CalamityMod.NPCs.Yharon writer.Write(secondPhasePhase); writer.Write(teleportLocation); writer.Write(invincibilityCounter); + writer.WriteVector2(flareDustBulletHellSpawn); writer.Write(safeBox.X); writer.Write(safeBox.Y); writer.Write(safeBox.Width); writer.Write(safeBox.Height); - } + writer.Write(npc.localAI[0]); + writer.Write(npc.localAI[1]); + writer.Write(npc.localAI[2]); + } public override void ReceiveExtraAI(BinaryReader reader) { @@ -143,11 +146,15 @@ namespace CalamityMod.NPCs.Yharon secondPhasePhase = reader.ReadInt32(); teleportLocation = reader.ReadInt32(); invincibilityCounter = reader.ReadInt32(); - safeBox.X = reader.ReadInt32(); + flareDustBulletHellSpawn = reader.ReadVector2(); + safeBox.X = reader.ReadInt32(); safeBox.Y = reader.ReadInt32(); safeBox.Width = reader.ReadInt32(); safeBox.Height = reader.ReadInt32(); - } + npc.localAI[0] = reader.ReadSingle(); + npc.localAI[1] = reader.ReadSingle(); + npc.localAI[2] = reader.ReadSingle(); + } public override void AI() { @@ -224,6 +231,7 @@ namespace CalamityMod.NPCs.Yharon return; } + // Timed DR adjustment if (CalamityWorld.buffedEclipse) { if (npc.Calamity().AITimer < 3600) @@ -231,105 +239,102 @@ namespace CalamityMod.NPCs.Yharon } // Phase bools - bool phase2Check = npc.life <= npc.lifeMax * (revenge ? 0.8 : 0.7); - bool phase3Check = npc.life <= npc.lifeMax * (revenge ? 0.5 : 0.4); - bool phase4Check = npc.life <= npc.lifeMax * (revenge ? 0.25 : 0.2); - bool phase5Check = npc.life <= npc.lifeMax * 0.1; + bool phase2Check = npc.life <= npc.lifeMax * (revenge ? 0.8 : (expertMode ? 0.7 : 0.5)); + bool phase3Check = npc.life <= npc.lifeMax * (revenge ? 0.5 : (expertMode ? 0.4 : 0.25)); + bool phase4Check = npc.life <= npc.lifeMax * 0.1; bool phase2Change = npc.ai[0] > 5f; bool phase3Change = npc.ai[0] > 12f; - bool phase4Change = npc.ai[0] > 20f; bool isCharging = npc.ai[3] < 20f; // Flare limit - int flareCount = 3; + int maxFlareCount = 3; - // Velocity and acceleration - int aiChangeRate = expertMode ? 36 : 38; - float npcVelocity = expertMode ? 0.7f : 0.69f; - float scaleFactor = expertMode ? 11f : 10.8f; + // Timer, velocity and acceleration for idle phase before phase switch + int phaseSwitchTimer = expertMode ? 36 : 38; + float acceleration = expertMode ? 0.7f : 0.69f; + float velocity = expertMode ? 11f : 10.8f; - if (phase4Change || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { - npcVelocity = 0.95f; - scaleFactor = 14f; - aiChangeRate = 25; + acceleration = 0.95f; + velocity = 14f; + phaseSwitchTimer = 25; } else if (phase3Change) { - npcVelocity = 0.9f; - scaleFactor = 13f; - aiChangeRate = 25; + acceleration = 0.85f; + velocity = 13f; + phaseSwitchTimer = 25; } else if (phase2Change && isCharging) { - npcVelocity = expertMode ? 0.8f : 0.78f; - scaleFactor = expertMode ? 12.2f : 12f; - aiChangeRate = expertMode ? 36 : 38; + acceleration = expertMode ? 0.8f : 0.78f; + velocity = expertMode ? 12.2f : 12f; + phaseSwitchTimer = expertMode ? 36 : 38; } - else if (isCharging && !phase2Change && !phase3Change && !phase4Change) + else if (isCharging && !phase2Change && !phase3Change) { - aiChangeRate = 25; + phaseSwitchTimer = 25; } - int chargeTime = expertMode ? 38 : 40; - int chargeTime2 = expertMode ? 34 : 36; - float chargeSpeed = expertMode ? 22f : 20.5f; - float chargeSpeed2 = expertMode ? 37f : 34f; - if (phase4Change || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + // Timers and velocity for charging + int chargeTime = expertMode ? 40 : 45; + float chargeSpeed = expertMode ? 28f : 26f; + float fastChargeVelocityMultiplier = 1.5f; + int fastChargeTelegraphTimer = 120; + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { - chargeTime = 28; - chargeSpeed = 31f; + chargeTime = 30; + chargeSpeed = 40f; } else if (phase3Change) { - chargeTime = 32; - chargeTime2 = 27; - chargeSpeed = 25f; - chargeSpeed2 = 41f; + chargeTime = 35; + chargeSpeed = 30f; } else if (isCharging && phase2Change) { - chargeTime = expertMode ? 35 : 37; - chargeTime2 = expertMode ? 31 : 33; + chargeTime = expertMode ? 38 : 43; + if (expertMode) - { - chargeSpeed = 24f; - chargeSpeed2 = 39f; - } + chargeSpeed = 28.5f; } if (revenge) { int chargeTimeDecrease = death ? 4 : 2; float velocityMult = death ? 1.1f : 1.05f; - aiChangeRate -= chargeTimeDecrease; - npcVelocity *= velocityMult; - scaleFactor *= velocityMult; + phaseSwitchTimer -= chargeTimeDecrease; + acceleration *= velocityMult; + velocity *= velocityMult; chargeTime -= chargeTimeDecrease; - chargeTime2 -= chargeTimeDecrease; chargeSpeed *= velocityMult; - chargeSpeed2 *= velocityMult; } - // Variables for charging and etc. - int xPos = 60 * npc.direction; - int num1454 = 80; - int num1455 = 4; - float num1456 = 0.3f; - float scaleFactor11 = 5f; - int num1457 = 90; - int num1458 = 180; - int num1459 = 180; - int num1460 = 30; - int num1461 = 120; - int num1462 = 4; - float scaleFactor13 = 20f; - float num1463 = MathHelper.TwoPi / (num1461 / 2); - int num1464 = 75; + // Phase timers and velocities + int flareBombPhaseTimer = 60; + int flareBombSpawnDivisor = 3; + float flareBombPhaseAcceleration = 0.5f; + float flareBombPhaseVelocity = 10f; + int fireTornadoPhaseTimer = 90; + int newPhaseTimer = 180; + int flareDustPhaseTimer = 300; + int flareDustPhaseTimer2 = 150; + float spinTime = flareDustPhaseTimer / 2; + int flareDustSpawnDivisor = 30; + int flareDustSpawnDivisor2 = 5; + int flareDustSpawnDivisor3 = 12; + float spinPhaseVelocity = 25f; + float spinPhaseRotation = MathHelper.TwoPi * 3 / spinTime; + float increasedIdleTimeAfterBulletHell = -120f; + float teleportPhaseTimer = 30f; + Vector2 vectorCenter = npc.Center; + int spawnPhaseTimer = 75; + int projectileDamage = expertMode ? 75 : 90; - // Center and target - Vector2 vectorCenter = npc.Center; - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + // Target + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(true); npc.netUpdate = true; @@ -362,11 +367,15 @@ namespace CalamityMod.NPCs.Yharon else if (npc.timeLeft < 1800) npc.timeLeft = 1800; - // Create the arena, but not as a multiplayer client. - // In single player, the arena gets created and never gets synced because it's single player. - // In multiplayer, only the server/host creates the arena, and everyone else receives it on the next frame via SendExtraAI. - // Everyone however sets spawnArena to true to confirm that the fight has started. - if (!spawnArena) + int xPos = 60 * npc.direction; + Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; + Vector2 fromMouth = new Vector2((int)vector.X + xPos, (int)vector.Y - 15); + + // Create the arena, but not as a multiplayer client. + // In single player, the arena gets created and never gets synced because it's single player. + // In multiplayer, only the server/host creates the arena, and everyone else receives it on the next frame via SendExtraAI. + // Everyone however sets spawnArena to true to confirm that the fight has started. + if (!spawnArena) { spawnArena = true; enraged = false; @@ -389,7 +398,7 @@ namespace CalamityMod.NPCs.Yharon enraged = !player.Hitbox.Intersects(safeBox); if (enraged) { - aiChangeRate = 15; + phaseSwitchTimer = 15; protectionBoost = true; npc.damage = npc.defDamage * 5; chargeSpeed += 25f; @@ -425,59 +434,21 @@ namespace CalamityMod.NPCs.Yharon npcRotation += MathHelper.TwoPi; if (npcRotation > MathHelper.TwoPi) npcRotation -= MathHelper.TwoPi; - if (npc.ai[0] == -1f) - npcRotation = 0f; - if (npc.ai[0] == 3f) - npcRotation = 0f; - if (npc.ai[0] == 4f) - npcRotation = 0f; - if (npc.ai[0] == 9f) - npcRotation = 0f; - if (npc.ai[0] == 10f) - npcRotation = 0f; - if (npc.ai[0] == 16f) - npcRotation = 0f; - if (npc.ai[0] == 20f) + if (npc.ai[0] == -1f || npc.ai[0] == 3f || npc.ai[0] == 4f || npc.ai[0] == 9f || npc.ai[0] == 10f || npc.ai[0] == 16f) npcRotation = 0f; float npcRotationSpeed = 0.04f; - if (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f) + if (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 8f || npc.ai[0] == 11f || npc.ai[0] == 12f || + npc.ai[0] == 14f || npc.ai[0] == 15f || npc.ai[0] == 18f || npc.ai[0] == 19f) npcRotationSpeed = 0f; - if (npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f) - npcRotationSpeed = 0f; - if (npc.ai[0] == 3f) - npcRotationSpeed = 0.01f; - if (npc.ai[0] == 4f) - npcRotationSpeed = 0.01f; - if (npc.ai[0] == 9f || npc.ai[0] == 16f || npc.ai[0] == 20f) + if (npc.ai[0] == 3f || npc.ai[0] == 4f || npc.ai[0] == 9f || npc.ai[0] == 16f) npcRotationSpeed = 0.01f; - if (npc.rotation < npcRotation) - { - if (npcRotation - npc.rotation > pie) - npc.rotation -= npcRotationSpeed; - else - npc.rotation += npcRotationSpeed; - } - if (npc.rotation > npcRotation) - { - if (npc.rotation - npcRotation > pie) - npc.rotation += npcRotationSpeed; - else - npc.rotation -= npcRotationSpeed; - } + if (npcRotationSpeed != 0f) + npc.rotation = npc.rotation.AngleTowards(npcRotation, npcRotationSpeed); - if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) - npc.rotation = npcRotation; - if (npc.rotation < 0f) - npc.rotation += MathHelper.TwoPi; - if (npc.rotation > MathHelper.TwoPi) - npc.rotation -= MathHelper.TwoPi; - if (npc.rotation > npcRotation - npcRotationSpeed && npc.rotation < npcRotation + npcRotationSpeed) - npc.rotation = npcRotation; - - // Alpha - if (npc.ai[0] != -1f && npc.ai[0] < 9f) + // Alpha effects + if (npc.ai[0] != -1f && ((npc.ai[0] != 6f && npc.ai[0] != 13f) || npc.ai[2] <= phaseSwitchTimer)) { bool colliding = Collision.SolidCollision(npc.position, npc.width, npc.height); @@ -500,7 +471,6 @@ namespace CalamityMod.NPCs.Yharon npc.velocity *= 0.98f; - // Direction int num1467 = Math.Sign(player.Center.X - vectorCenter.X); if (num1467 != 0) { @@ -508,7 +478,6 @@ namespace CalamityMod.NPCs.Yharon npc.spriteDirection = -npc.direction; } - // Alpha if (npc.ai[2] > 20f) { npc.velocity.Y = -2f; @@ -526,8 +495,7 @@ namespace CalamityMod.NPCs.Yharon npc.alpha = 150; } - // Dust - if (npc.ai[2] == num1457 - 30) + if (npc.ai[2] == fireTornadoPhaseTimer - 30) { int num1468 = 72; for (int num1469 = 0; num1469 < num1468; num1469++) @@ -545,7 +513,7 @@ namespace CalamityMod.NPCs.Yharon } npc.ai[2] += 1f; - if (npc.ai[2] >= num1464) + if (npc.ai[2] >= spawnPhaseTimer) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -555,39 +523,17 @@ namespace CalamityMod.NPCs.Yharon } #region Phase1 + // Phase switch else if (npc.ai[0] == 0f && !player.dead) { npc.dontTakeDamage = false; if (npc.ai[1] == 0f) - npc.ai[1] = 300 * Math.Sign((vectorCenter - player.Center).X); + npc.ai[1] = 500 * Math.Sign((vectorCenter - player.Center).X); Vector2 value17 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; - Vector2 vector170 = Vector2.Normalize(value17 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector170.X) - { - npc.velocity.X += npcVelocity; - if (npc.velocity.X < 0f && vector170.X > 0f) - npc.velocity.X += npcVelocity; - } - else if (npc.velocity.X > vector170.X) - { - npc.velocity.X -= npcVelocity; - if (npc.velocity.X > 0f && vector170.X < 0f) - npc.velocity.X -= npcVelocity; - } - if (npc.velocity.Y < vector170.Y) - { - npc.velocity.Y += npcVelocity; - if (npc.velocity.Y < 0f && vector170.Y > 0f) - npc.velocity.Y += npcVelocity; - } - else if (npc.velocity.Y > vector170.Y) - { - npc.velocity.Y -= npcVelocity; - if (npc.velocity.Y > 0f && vector170.Y < 0f) - npc.velocity.Y -= npcVelocity; - } + Vector2 vector170 = Vector2.Normalize(value17 - npc.velocity) * velocity; + npc.SimpleFlyMovement(vector170, acceleration); int num1471 = Math.Sign(player.Center.X - vectorCenter.X); if (num1471 != 0) @@ -604,28 +550,26 @@ namespace CalamityMod.NPCs.Yharon } npc.ai[2] += 1f; - if (npc.ai[2] >= aiChangeRate) + if (npc.ai[2] >= phaseSwitchTimer) { int aiState = 0; - switch ((int)npc.ai[3]) //0 2 4 6 1 3 5 7 repeat + switch ((int)npc.ai[3]) { case 0: case 1: case 2: + aiState = 1; + break; case 3: + aiState = 5; + break; case 4: - aiState = 1; //normal charges + npc.ai[3] = 1f; + aiState = 2; break; case 5: - aiState = 5; //fast charge - break; - case 6: - npc.ai[3] = 1f; - aiState = 2; //fireball attack - break; - case 7: npc.ai[3] = 0f; - aiState = 3; //tornadoes + aiState = 3; break; } @@ -671,41 +615,40 @@ namespace CalamityMod.NPCs.Yharon } else if (aiState == 5) { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; + npc.localAI[1] += 1f; + if (npc.localAI[1] == fastChargeTelegraphTimer - 60) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); + if (npc.localAI[1] > fastChargeTelegraphTimer) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.localAI[1] = 0f; - if (num1471 != 0) - { - npc.direction = num1471; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed * fastChargeVelocityMultiplier; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - if (npc.spriteDirection == 1) - npc.rotation += pie; + if (num1471 != 0) + { + npc.direction = num1471; - npc.spriteDirection = -npc.direction; - } + if (npc.spriteDirection == 1) + npc.rotation += pie; + + npc.spriteDirection = -npc.direction; + } + } } npc.netUpdate = true; } } - else if (npc.ai[0] == 1f) //charge attack + + // Charge + else if (npc.ai[0] == 1f) { - int num1473 = 7; - for (int num1474 = 0; num1474 < num1473; num1474++) - { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector171 = vector171.RotatedBy((num1474 - (num1473 / 2 - 1)) * (double)pie / (float)num1473) + vectorCenter; - Vector2 value18 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; - } + ChargeDust(7, pie); npc.ai[2] += 1f; if (npc.ai[2] >= chargeTime) @@ -717,54 +660,26 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 2f) //fireball attack + + // Fireball breath + else if (npc.ai[0] == 2f) { if (npc.ai[1] == 0f) - npc.ai[1] = 300 * Math.Sign((vectorCenter - player.Center).X); + npc.ai[1] = 500 * Math.Sign((vectorCenter - player.Center).X); - Vector2 value19 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; - Vector2 vector172 = Vector2.Normalize(value19 - npc.velocity) * scaleFactor11; - if (npc.velocity.X < vector172.X) - { - npc.velocity.X += num1456; - if (npc.velocity.X < 0f && vector172.X > 0f) - npc.velocity.X += num1456; - } - else if (npc.velocity.X > vector172.X) - { - npc.velocity.X -= num1456; - if (npc.velocity.X > 0f && vector172.X < 0f) - npc.velocity.X -= num1456; - } - if (npc.velocity.Y < vector172.Y) - { - npc.velocity.Y += num1456; - if (npc.velocity.Y < 0f && vector172.Y > 0f) - npc.velocity.Y += num1456; - } - else if (npc.velocity.Y > vector172.Y) - { - npc.velocity.Y -= num1456; - if (npc.velocity.Y > 0f && vector172.Y < 0f) - npc.velocity.Y -= num1456; - } + Vector2 value19 = player.Center + new Vector2(npc.ai[1], -400f) - vectorCenter; + Vector2 vector172 = Vector2.Normalize(value19 - npc.velocity) * flareBombPhaseVelocity; + npc.SimpleFlyMovement(vector172, flareBombPhaseAcceleration); if (npc.ai[2] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - if (npc.ai[2] % num1455 == 0f) //fire flare bombs from mouth + if (npc.ai[2] % flareBombSpawnDivisor == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; - - if (NPC.CountNPCS(ModContent.NPCType()) < flareCount) - NPC.NewNPC((int)vector.X + xPos, (int)vector.Y - 15, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - - int damage = expertMode ? 75 : 90; - Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + SpawnDetonatingFlares(fromMouth, player, maxFlareCount, new int[] { ModContent.NPCType() }); + Projectile.NewProjectile(fromMouth, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -780,7 +695,7 @@ namespace CalamityMod.NPCs.Yharon } npc.ai[2] += 1f; - if (npc.ai[2] >= num1454) + if (npc.ai[2] >= flareBombPhaseTimer) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -788,22 +703,24 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 3f) //Fire small flares + + // Fire tornadoes + else if (npc.ai[0] == 3f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == num1457 - 30) + if (npc.ai[2] == fireTornadoPhaseTimer - 30) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1457 - 30) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == fireTornadoPhaseTimer - 30) { - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, npc.direction * 2, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); //changed - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, -(float)npc.direction * 2, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); //changed + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, npc.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, -(float)npc.direction * 4, 8f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); } npc.ai[2] += 1f; - if (npc.ai[2] >= num1457) + if (npc.ai[2] >= fireTornadoPhaseTimer) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -811,18 +728,20 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 4f) //enter phase 2 + + // Enter new phase + else if (npc.ai[0] == 4f) { npc.dontTakeDamage = true; npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == num1458 - 60) + if (npc.ai[2] == newPhaseTimer - 60) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); npc.ai[2] += 1f; - if (npc.ai[2] >= num1458) + if (npc.ai[2] >= newPhaseTimer) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -831,23 +750,14 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Fast charge else if (npc.ai[0] == 5f) { - int num1473 = 14; - for (int num1474 = 0; num1474 < num1473; num1474++) - { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector171 = vector171.RotatedBy((num1474 - (num1473 / 2 - 1)) * pie / (double)num1473) + vectorCenter; - Vector2 value18 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); //changed - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; - } + ChargeDust(14, pie); npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime2) + if (npc.ai[2] >= chargeTime) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -859,39 +769,17 @@ namespace CalamityMod.NPCs.Yharon #endregion #region Phase2 - else if (npc.ai[0] == 6f && !player.dead) //phase 2 + // Phase switch + else if (npc.ai[0] == 6f && !player.dead) { npc.dontTakeDamage = false; if (npc.ai[1] == 0f) - npc.ai[1] = 300 * Math.Sign((vectorCenter - player.Center).X); + npc.ai[1] = 500 * Math.Sign((vectorCenter - player.Center).X); Vector2 value20 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; - Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector175.X) - { - npc.velocity.X += npcVelocity; - if (npc.velocity.X < 0f && vector175.X > 0f) - npc.velocity.X += npcVelocity; - } - else if (npc.velocity.X > vector175.X) - { - npc.velocity.X -= npcVelocity; - if (npc.velocity.X > 0f && vector175.X < 0f) - npc.velocity.X -= npcVelocity; - } - if (npc.velocity.Y < vector175.Y) - { - npc.velocity.Y += npcVelocity; - if (npc.velocity.Y < 0f && vector175.Y > 0f) - npc.velocity.Y += npcVelocity; - } - else if (npc.velocity.Y > vector175.Y) - { - npc.velocity.Y -= npcVelocity; - if (npc.velocity.Y > 0f && vector175.Y < 0f) - npc.velocity.Y -= npcVelocity; - } + Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * velocity; + npc.SimpleFlyMovement(vector175, acceleration); int num1477 = Math.Sign(player.Center.X - vectorCenter.X); if (num1477 != 0) @@ -908,30 +796,27 @@ namespace CalamityMod.NPCs.Yharon } npc.ai[2] += 1f; - if (npc.ai[2] >= aiChangeRate) + if (npc.ai[2] >= phaseSwitchTimer) { int aiState = 0; - switch ((int)npc.ai[3]) //0 2 4 6 8 1 3 5 7 9 repeat + switch ((int)npc.ai[3]) { case 0: case 1: case 2: case 3: - case 4: - case 5: aiState = 1; break; - case 6: + case 4: aiState = 5; break; - case 7: + case 5: aiState = 6; break; - case 8: - npc.ai[3] = 1f; + case 6: aiState = 2; break; - case 9: + case 7: npc.ai[3] = 0f; aiState = 3; break; @@ -961,7 +846,29 @@ namespace CalamityMod.NPCs.Yharon } else if (aiState == 2) { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + Vector2 npcCenter = npc.Center; + + if (npc.alpha < 255) + { + npc.alpha += 17; + if (npc.alpha > 255) + npc.alpha = 255; + } + + if (npc.ai[2] == phaseSwitchTimer + 15f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == phaseSwitchTimer + 15f) + { + teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); + Vector2 center = player.Center + new Vector2(-npc.ai[1], teleportLocation); + npcCenter = npc.Center = center; + } + + if (npc.ai[2] < phaseSwitchTimer + teleportPhaseTimer) + return; + + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * spinPhaseVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1477 != 0) @@ -977,7 +884,8 @@ namespace CalamityMod.NPCs.Yharon npc.ai[0] = 8f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } + npc.ai[3] = 1f; + } else if (aiState == 3) { npc.ai[0] = 9f; @@ -992,26 +900,34 @@ namespace CalamityMod.NPCs.Yharon } else if (aiState == 5) { - npc.ai[0] = 11f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; + npc.localAI[1] += 1f; + if (npc.localAI[1] == fastChargeTelegraphTimer - 60) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); + if (npc.localAI[1] > fastChargeTelegraphTimer) + { + npc.ai[0] = 11f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.localAI[1] = 0f; - if (num1477 != 0) - { - npc.direction = num1477; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed * fastChargeVelocityMultiplier; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - if (npc.spriteDirection == 1) - npc.rotation += pie; + if (num1477 != 0) + { + npc.direction = num1477; - npc.spriteDirection = -npc.direction; - } + if (npc.spriteDirection == 1) + npc.rotation += pie; + + npc.spriteDirection = -npc.direction; + } + } } else if (aiState == 6) { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * spinPhaseVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1477 != 0) @@ -1032,20 +948,11 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 7f) //charge + + // Charge + else if (npc.ai[0] == 7f) { - int num1479 = 7; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector176 = vector176.RotatedBy((num1480 - (num1479 / 2 - 1)) * pie / (double)num1479) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); //changed - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } + ChargeDust(7, pie); npc.ai[2] += 1f; if (npc.ai[2] >= chargeTime) @@ -1057,51 +964,54 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Flare Dust bullet hell else if (npc.ai[0] == 8f) { - if (npc.ai[2] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + if (npc.ai[2] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + flareDustBulletHellSpawn = vectorCenter + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / (MathHelper.TwoPi * 3f); + } - if (npc.ai[2] % num1462 == 0f) + npc.ai[2] += 1f; + + if (npc.ai[2] % flareDustSpawnDivisor == 0f) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; - - if (NPC.CountNPCS(ModContent.NPCType()) < flareCount) - NPC.NewNPC((int)vector.X + xPos, (int)vector.Y - 15, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - - Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, Main.rand.Next(-400, 401) * 0.13f, Main.rand.Next(-30, 31) * 0.13f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); - } + SpawnDetonatingFlares(flareDustBulletHellSpawn, player, maxFlareCount, new int[] { ModContent.NPCType() }); + int totalProjectiles = 38 - (int)(npc.ai[2] / 15f); // 36 for first ring, 18 for last ring + DoFlareDustBulletHell(0, flareDustSpawnDivisor, projectileDamage, totalProjectiles, 0f, 0f, false); + } } - npc.velocity = npc.velocity.RotatedBy(-(double)num1463 * (float)npc.direction); - npc.rotation -= num1463 * npc.direction; + npc.velocity = npc.velocity.RotatedBy(-(double)spinPhaseRotation * (float)npc.direction); + npc.rotation -= spinPhaseRotation * npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= num1461) + if (npc.ai[2] >= flareDustPhaseTimer) { - npc.ai[0] = 6f; + npc.ai[0] = 6f; npc.ai[1] = 0f; - npc.ai[2] = 0f; + npc.ai[2] = increasedIdleTimeAfterBulletHell; npc.netUpdate = true; } } + + // Infernado else if (npc.ai[0] == 9f) { npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == num1457 - 30) + if (npc.ai[2] == fireTornadoPhaseTimer - 30) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1457 - 30) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == fireTornadoPhaseTimer - 30) Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); npc.ai[2] += 1f; - if (npc.ai[2] >= num1457) + if (npc.ai[2] >= fireTornadoPhaseTimer) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1109,18 +1019,20 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 10f) //start phase 3 + + // Enter new phase + else if (npc.ai[0] == 10f) { npc.dontTakeDamage = true; npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == num1459 - 60) + if (npc.ai[2] == newPhaseTimer - 60) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); npc.ai[2] += 1f; - if (npc.ai[2] >= num1459) + if (npc.ai[2] >= newPhaseTimer) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1129,23 +1041,14 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Fast charge else if (npc.ai[0] == 11f) { - int num1479 = 14; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * pie / (float)num1479) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); //changed - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } + ChargeDust(14, pie); - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime2) + npc.ai[2] += 1f; + if (npc.ai[2] >= chargeTime) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1154,36 +1057,30 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Flare Dust that speeds up and whips around in a wave else if (npc.ai[0] == 12f) { if (npc.ai[2] == 0f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - if (npc.ai[2] % num1462 == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + npc.ai[2] += 1f; + if (npc.ai[2] % flareDustSpawnDivisor2 == 0f) + { if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = expertMode ? 75 : 90; - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); - float playerX = player.position.X + player.width * 0.5f - vectorShoot.X; - float playerY = player.position.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt(playerX * playerX + playerY * playerY); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Vector2 projectileVelocity = player.Center - fromMouth; + projectileVelocity.Normalize(); + projectileVelocity *= 0.1f; + Projectile.NewProjectile(fromMouth, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); } } - npc.velocity = npc.velocity.RotatedBy(-(double)num1463 * (float)npc.direction); - npc.rotation -= num1463 * npc.direction; + npc.velocity = npc.velocity.RotatedBy(-(double)spinPhaseRotation * (float)npc.direction); + npc.rotation -= spinPhaseRotation * npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= num1461) + if (npc.ai[2] >= flareDustPhaseTimer2) { npc.ai[0] = 6f; npc.ai[1] = 0f; @@ -1195,39 +1092,17 @@ namespace CalamityMod.NPCs.Yharon #endregion #region Phase3 + // Phase switch else if (npc.ai[0] == 13f && !player.dead) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; if (npc.ai[1] == 0f) - npc.ai[1] = 300 * Math.Sign((vectorCenter - player.Center).X); + npc.ai[1] = 500 * Math.Sign((vectorCenter - player.Center).X); Vector2 value20 = player.Center + new Vector2(npc.ai[1], -200f) - vectorCenter; - Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector175.X) - { - npc.velocity.X += npcVelocity; - if (npc.velocity.X < 0f && vector175.X > 0f) - npc.velocity.X += npcVelocity; - } - else if (npc.velocity.X > vector175.X) - { - npc.velocity.X -= npcVelocity; - if (npc.velocity.X > 0f && vector175.X < 0f) - npc.velocity.X -= npcVelocity; - } - if (npc.velocity.Y < vector175.Y) - { - npc.velocity.Y += npcVelocity; - if (npc.velocity.Y < 0f && vector175.Y > 0f) - npc.velocity.Y += npcVelocity; - } - else if (npc.velocity.Y > vector175.Y) - { - npc.velocity.Y -= npcVelocity; - if (npc.velocity.Y > 0f && vector175.Y < 0f) - npc.velocity.Y -= npcVelocity; - } + Vector2 vector175 = Vector2.Normalize(value20 - npc.velocity) * velocity; + npc.SimpleFlyMovement(vector175, acceleration); int num1477 = Math.Sign(player.Center.X - vectorCenter.X); if (num1477 != 0) @@ -1244,36 +1119,33 @@ namespace CalamityMod.NPCs.Yharon } npc.ai[2] += 1f; - if (npc.ai[2] >= aiChangeRate) + if (npc.ai[2] >= phaseSwitchTimer) { int aiState = 0; - switch ((int)npc.ai[3]) //0 2 4 6 8 9 1 3 5 7 10 repeat + switch ((int)npc.ai[3]) { case 0: case 1: + aiState = 1; + break; case 2: case 3: - aiState = death ? 5 : 1; //normal charges - break; case 4: + aiState = 5; + break; case 5: + aiState = 3; + break; case 6: - aiState = 5; //fast charges + aiState = 6; break; case 7: - aiState = 3; //big tornado - break; - case 8: - aiState = 6; //slow flare bombs - break; - case 9: npc.ai[3] = 1f; - aiState = 7; //small tornado - break; - case 10: - npc.ai[3] = 0f; - aiState = 2; //flare circle + aiState = 7; break; + case 8: + aiState = 2; + break; } if (phase4Check) @@ -1300,7 +1172,29 @@ namespace CalamityMod.NPCs.Yharon } else if (aiState == 2) { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + Vector2 npcCenter = npc.Center; + + if (npc.alpha < 255) + { + npc.alpha += 17; + if (npc.alpha > 255) + npc.alpha = 255; + } + + if (npc.ai[2] == phaseSwitchTimer + 15f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == phaseSwitchTimer + 15f) + { + teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); + Vector2 center = player.Center + new Vector2(-npc.ai[1], teleportLocation); + npcCenter = npc.Center = center; + } + + if (npc.ai[2] < phaseSwitchTimer + teleportPhaseTimer) + return; + + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * spinPhaseVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1477 != 0) @@ -1316,7 +1210,8 @@ namespace CalamityMod.NPCs.Yharon npc.ai[0] = 15f; npc.ai[1] = 0f; npc.ai[2] = 0f; - } + npc.ai[3] = 0f; + } else if (aiState == 3) { npc.ai[0] = 16f; @@ -1331,26 +1226,34 @@ namespace CalamityMod.NPCs.Yharon } else if (aiState == 5) { - npc.ai[0] = 18f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; + npc.localAI[1] += 1f; + if (npc.localAI[1] == fastChargeTelegraphTimer - 60) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed2; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); + if (npc.localAI[1] > fastChargeTelegraphTimer) + { + npc.ai[0] = 18f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.localAI[1] = 0f; - if (num1477 != 0) - { - npc.direction = num1477; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed * fastChargeVelocityMultiplier; + npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - if (npc.spriteDirection == 1) - npc.rotation += pie; + if (num1477 != 0) + { + npc.direction = num1477; - npc.spriteDirection = -npc.direction; - } + if (npc.spriteDirection == 1) + npc.rotation += pie; + + npc.spriteDirection = -npc.direction; + } + } } else if (aiState == 6) { - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * scaleFactor13; + npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * spinPhaseVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); if (num1477 != 0) @@ -1367,34 +1270,25 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 0f; npc.ai[2] = 0f; } - else if (aiState == 7) - { - npc.ai[0] = 20f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } + else if (aiState == 7) + { + npc.ai[0] = 20f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } - npc.netUpdate = true; + npc.netUpdate = true; } } - else if (npc.ai[0] == 14f) //charge + + // Charge + else if (npc.ai[0] == 14f) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; - int num1479 = 7; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector176 = vector176.RotatedBy((double)(num1480 - (num1479 / 2 - 1)) * pie / (float)num1479) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } + ChargeDust(7, pie); - npc.ai[2] += 1f; + npc.ai[2] += 1f; if (npc.ai[2] >= chargeTime) { npc.ai[0] = 13f; @@ -1404,56 +1298,63 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } - else if (npc.ai[0] == 15f) + + // Flare Dust bullet hell + else if (npc.ai[0] == 15f) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; - if (npc.ai[2] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + if (npc.ai[2] == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + flareDustBulletHellSpawn = vectorCenter + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / (MathHelper.TwoPi * 3f); + } - if (npc.ai[2] % num1462 == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + npc.ai[2] += 1f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 vector = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; + if (npc.ai[2] % flareDustSpawnDivisor == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + SpawnDetonatingFlares(flareDustBulletHellSpawn, player, maxFlareCount, new int[] { ModContent.NPCType(), ModContent.NPCType() }); + } - if (NPC.CountNPCS(ModContent.NPCType()) < flareCount && NPC.CountNPCS(ModContent.NPCType()) < flareCount) - NPC.NewNPC((int)vector.X + xPos, (int)vector.Y - 15, Main.rand.NextBool(2) ? ModContent.NPCType() : ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + if (npc.ai[2] % flareDustSpawnDivisor3 == 0f) + { + // Rotate spiral by 7.2 * (300 / 12) = +90 degrees and then back -90 degrees - Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, Main.rand.Next(-401, 401) * 0.13f, Main.rand.Next(-31, 31) * 0.13f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); //changed - Projectile.NewProjectile((int)vector.X + xPos, (int)vector.Y - 15, Main.rand.Next(-31, 31) * 0.13f, Main.rand.Next(-151, 151) * 0.13f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); //changed - } - } + if (Main.netMode != NetmodeID.MultiplayerClient) + DoFlareDustBulletHell(1, flareDustPhaseTimer, projectileDamage, 8, 12f, 7.2f, false); + } - npc.velocity = npc.velocity.RotatedBy(-(double)num1463 * (float)npc.direction); - npc.rotation -= num1463 * npc.direction; + npc.velocity = npc.velocity.RotatedBy(-(double)spinPhaseRotation * (float)npc.direction); + npc.rotation -= spinPhaseRotation * npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= num1461) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - } + if (npc.ai[2] >= flareDustPhaseTimer) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.localAI[2] = 0f; + npc.netUpdate = true; + } } + + // Infernado else if (npc.ai[0] == 16f) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == num1457 - 30) + if (npc.ai[2] == fireTornadoPhaseTimer - 30) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1457 - 30) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == fireTornadoPhaseTimer - 30) Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); npc.ai[2] += 1f; - if (npc.ai[2] >= num1457) + if (npc.ai[2] >= fireTornadoPhaseTimer) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1462,67 +1363,39 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Enter new phase else if (npc.ai[0] == 17f) { - npc.dontTakeDamage = true; + npc.dontTakeDamage = true; - if (npc.ai[2] < num1459 - 90) - { - bool colliding = Collision.SolidCollision(npc.position, npc.width, npc.height); + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (colliding) - npc.alpha += 15; - else - npc.alpha -= 15; + if (npc.ai[2] == newPhaseTimer - 60) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - if (npc.alpha < 0) - npc.alpha = 0; - - if (npc.alpha > 150) - npc.alpha = 150; - } - else if (npc.alpha < 255) - { - npc.alpha += 4; - if (npc.alpha > 255) - npc.alpha = 255; - } - - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - if (npc.ai[2] == num1459 - 60) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - - npc.ai[2] += 1f; - if (npc.ai[2] >= num1459) - { - npc.ai[0] = 21f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } + npc.ai[2] += 1f; + if (npc.ai[2] >= newPhaseTimer) + { + startSecondAI = true; + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + } } + + // Fast charge else if (npc.ai[0] == 18f) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; - int num1479 = 14; - for (int num1480 = 0; num1480 < num1479; num1480++) - { - Vector2 vector176 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector176 = vector176.RotatedBy((num1480 - (num1479 / 2 - 1)) * (double)pie / (float)num1479) + vectorCenter; - Vector2 value21 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1481 = Dust.NewDust(vector176 + value21, 0, 0, 244, value21.X * 2f, value21.Y * 2f, 100, default, 1.4f); - Main.dust[num1481].noGravity = true; - Main.dust[num1481].noLight = true; - Main.dust[num1481].velocity /= 4f; - Main.dust[num1481].velocity -= npc.velocity; - } + ChargeDust(14, pie); - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime2) + npc.ai[2] += 1f; + if (npc.ai[2] >= chargeTime) { npc.ai[0] = 13f; npc.ai[1] = 0f; @@ -1531,311 +1404,94 @@ namespace CalamityMod.NPCs.Yharon npc.netUpdate = true; } } + + // Fireball ring else if (npc.ai[0] == 19f) { - npc.dontTakeDamage = phase5Check; + npc.dontTakeDamage = phase4Check; - if (npc.ai[2] == 0f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + if (npc.ai[2] == 0f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - if (npc.ai[2] % num1462 == 0f) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + npc.ai[2] += 1f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int damage = expertMode ? 75 : 90; - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter; - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); - float playerX = player.position.X + player.width * 0.5f - vectorShoot.X; - float playerY = player.position.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt(playerX * playerX + playerY * playerY); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile((int)vector173.X + xPos, (int)vector173.Y - 15, playerX, playerY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } - } - - npc.velocity = npc.velocity.RotatedBy(-(double)num1463 * (float)npc.direction); - npc.rotation -= num1463 * npc.direction; - - npc.ai[2] += 1f; - if (npc.ai[2] >= num1461) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 20f) - { - npc.dontTakeDamage = phase5Check; - - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - if (npc.ai[2] == num1457 - 30) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - - if (death) - { - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1457 - 30) - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); - } - else - { - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1457 - 30) - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= num1457) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - } - } - #endregion - - #region Phase4 - else if (npc.ai[0] == 21f && !player.dead) - { - npc.dontTakeDamage = phase5Check; - - if (npc.alpha < 225) - { - npc.alpha += 25; - if (npc.alpha > 225) - npc.alpha = 225; - } - - if (npc.ai[1] == 0f) - { - teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); - npc.ai[1] = 360 * Math.Sign((vectorCenter - player.Center).X); - } - - Vector2 value7 = player.Center + new Vector2(npc.ai[1], teleportLocation) - vectorCenter; //teleport distance - Vector2 desiredVelocity = Vector2.Normalize(value7 - npc.velocity) * scaleFactor; - npc.SimpleFlyMovement(desiredVelocity, npcVelocity); - - int num32 = Math.Sign(player.Center.X - vectorCenter.X); - if (num32 != 0) - { - if (npc.ai[2] == 0f && num32 != npc.direction) + if (npc.ai[2] % flareDustSpawnDivisor2 == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.rotation += pie; - for (int l = 0; l < npc.oldPos.Length; l++) - npc.oldPos[l] = Vector2.Zero; + Vector2 projectileVelocity = player.Center - fromMouth; + projectileVelocity.Normalize(); + projectileVelocity *= 0.1f; + Projectile.NewProjectile(fromMouth, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); } + } - npc.direction = num32; + npc.velocity = npc.velocity.RotatedBy(-(double)spinPhaseRotation * (float)npc.direction); + npc.rotation -= spinPhaseRotation * npc.direction; - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= aiChangeRate) - { - int aiState = 0; - switch ((int)npc.ai[3]) - { - case 0: //skip 1 - case 2: - case 3: //skip 4 - case 5: - case 6: - case 7: //skip 8 - case 9: - case 10: - case 11: - case 12: //skip 13 - case 14: - case 15: - case 16: - case 17: - case 18: //skip 19 - aiState = 1; - break; - case 1: //+3 - case 4: //+4 - case 8: //+5 - case 13: //+6 - case 19: - aiState = 2; - break; - } - - if (phase5Check) - aiState = 3; - - if (aiState == 1) - { - npc.ai[0] = 22f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.velocity = Vector2.Normalize(player.Center - vectorCenter) * chargeSpeed; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - if (num32 != 0) - { - npc.direction = num32; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - else if (aiState == 2) - { - npc.ai[0] = 23f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (aiState == 3) - { - npc.ai[0] = 24f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - npc.netUpdate = true; - } + if (npc.ai[2] >= flareDustPhaseTimer2 - 50) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 1f; + npc.netUpdate = true; + } } - else if (npc.ai[0] == 22f) - { - npc.dontTakeDamage = phase5Check; - npc.alpha -= 25; - if (npc.alpha < 0) - npc.alpha = 0; + // Fireball breath + else if (npc.ai[0] == 20f) + { + npc.dontTakeDamage = phase4Check; - int num34 = 7; - for (int m = 0; m < num34; m++) - { - Vector2 vector11 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector11 = vector11.RotatedBy((m - (num34 / 2 - 1)) * pie / num34) + vectorCenter; - Vector2 value8 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num35 = Dust.NewDust(vector11 + value8, 0, 0, 244, value8.X * 2f, value8.Y * 2f, 100, default, 1.4f); - Main.dust[num35].noGravity = true; - Main.dust[num35].noLight = true; - Main.dust[num35].velocity /= 4f; - Main.dust[num35].velocity -= npc.velocity; - } + if (npc.ai[1] == 0f) + npc.ai[1] = 400 * Math.Sign((vectorCenter - player.Center).X); - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime) - { - npc.ai[0] = 21f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 23f) - { - npc.dontTakeDamage = true; + Vector2 value19 = player.Center + new Vector2(npc.ai[1], -400f) - vectorCenter; + Vector2 vector172 = Vector2.Normalize(value19 - npc.velocity) * flareBombPhaseVelocity; + npc.SimpleFlyMovement(vector172, flareBombPhaseAcceleration); - if (npc.alpha < 225) - { - npc.alpha += 17; - if (npc.alpha > 225) - npc.alpha = 225; - } + if (npc.ai[2] == 0f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] % flareBombSpawnDivisor == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + SpawnDetonatingFlares(fromMouth, player, maxFlareCount, new int[] { ModContent.NPCType(), ModContent.NPCType() }); + Projectile.NewProjectile(fromMouth, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + } + } - if (npc.ai[2] == num1460 / 2) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + int num1476 = Math.Sign(player.Center.X - vectorCenter.X); + if (num1476 != 0) + { + npc.direction = num1476; - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num1460 / 2) - { - if (npc.ai[1] == 0f) - npc.ai[1] = 300 * Math.Sign((vectorCenter - player.Center).X); + if (npc.spriteDirection != -npc.direction) + npc.rotation += pie; - Vector2 center = player.Center + new Vector2(-npc.ai[1], teleportLocation); //teleport distance - vectorCenter = npc.Center = center; + npc.spriteDirection = -npc.direction; + } - int num36 = Math.Sign(player.Center.X - vectorCenter.X); - if (num36 != 0) - { - if (npc.ai[2] == 0f && num36 != npc.direction) - { - npc.rotation += pie; - for (int n = 0; n < npc.oldPos.Length; n++) - npc.oldPos[n] = Vector2.Zero; - } - - npc.direction = num36; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= num1460) - { - npc.ai[0] = 21f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 1f; - - if (npc.ai[3] == 5f && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); - - if (npc.ai[3] >= 20f) //14 - npc.ai[3] = 0f; - - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 24f) //start phase 5 - { - npc.alpha = 0; - npc.dontTakeDamage = true; - - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - if (npc.ai[2] == num1459 - 60) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - - npc.ai[2] += 1f; - if (npc.ai[2] >= num1459) - { - startSecondAI = true; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - } - #endregion - } + npc.ai[2] += 1f; + if (npc.ai[2] >= flareBombPhaseTimer - 15) + { + npc.ai[0] = 13f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + } + } + #endregion + } #region AI2 public void Yharon_AI2(bool expertMode, bool revenge, bool death, float pie) { - bool phase2 = npc.life <= npc.lifeMax * (revenge ? 0.85 : 0.75); - bool phase3 = npc.life <= npc.lifeMax * (revenge ? 0.6 : 0.5); - bool phase4 = npc.life <= npc.lifeMax * (revenge ? 0.2 : 0.1); + bool phase2 = npc.life <= npc.lifeMax * (revenge ? 0.8 : (expertMode ? 0.7 : 0.5)); + bool phase3 = npc.life <= npc.lifeMax * (revenge ? 0.5 : (expertMode ? 0.4 : 0.25)); + bool phase4 = npc.life <= npc.lifeMax * 0.15 && revenge; if (npc.ai[0] != 8f) { @@ -1941,57 +1597,61 @@ namespace CalamityMod.NPCs.Yharon // Set DR based on protection boost (aka enrage) npc.Calamity().DR = protectionBoost ? EnragedDR : Phase2_DR; - int num = -1; - float num2 = 1f; - int num4 = expertMode ? 110 : 125; + int projectileDamage = expertMode ? 110 : 125; if (phase4) - num4 = (int)(num4 * 1.1); + projectileDamage = (int)(projectileDamage * 1.1); - float num6 = 0.575f; - float scaleFactor = 10f; - float chargeTime = 34f; - float chargeTime2 = 30f; - float chargeSpeed = 25.75f; - float chargeSpeed2 = 39f; - float num11 = 40f; - float num13 = num11 + 80f; - float num15 = 60f; - float scaleFactor3 = 14f; - float scaleFactor4 = 15.75f; - int num16 = 10; - int num17 = 6 * num16; - float num18 = 60f; - float num19 = num15 + num17 + num18; - float num20 = 60f; - float num22 = MathHelper.TwoPi * (1f / num20); - float scaleFactor5 = 37.25f; + float phaseSwitchTimer = expertMode ? 30f : 32f; + float acceleration = expertMode ? 0.92f : 0.9f; + float velocity = expertMode ? 13.5f : 13f; + float chargeTime = expertMode ? 32f : 35f; + float chargeSpeed = expertMode ? 32f : 30f; + float fastChargeVelocityMultiplier = 1.5f; + int fastChargeTelegraphTimer = phase4 ? 60 : 120; - if (npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) + float fireballBreathTimer = 60f; + float fireballBreathPhaseTimer = fireballBreathTimer + 120f; + float fireballBreathPhaseVelocity = 22f; + + float splittingFireballBreathTimer = 40f; + float splittingFireballBreathPhaseVelocity = 22f; + int splittingFireballBreathDivisor = 10; + int splittingFireballs = 10; + int splittingFireballBreathTimer2 = splittingFireballs * splittingFireballBreathDivisor; + float splittingFireballBreathYVelocityTimer = 40f; + float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer; + + float spinPhaseTimer = phase4 ? 180f : 240f; + float spinTime = spinPhaseTimer / 2; + float spinRotation = MathHelper.TwoPi * 3 / spinTime; + float spinPhaseVelocity = 25f; + int flareDustSpawnDivisor = 24; + int flareDustSpawnDivisor2 = 5; + int flareDustSpawnDivisor3 = 12 + (phase4 ? 4 : 0); + float increasedIdleTimeAfterBulletHell = -120f; + + float flareSpawnDecelerationTimer = 90f; + float flareSpawnPhaseTimer = 180f; + + float teleportPhaseTimer = 45f; + + if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && CalamityWorld.bossRushActive)) { - num6 = 0.7f; - scaleFactor = 12f; - chargeTime = 28f; - chargeTime2 = 24f; - chargeSpeed = 32f; - chargeSpeed2 = 45f; - scaleFactor4 = 20f; - scaleFactor5 = 43f; + acceleration = 1.2f; + velocity = 18f; + chargeTime = 25f; + chargeSpeed = 45f; } else if (revenge) { float chargeTimeDecrease = death ? 4f : 2f; float velocityMult = death ? 1.1f : 1.05f; - num6 *= velocityMult; - scaleFactor *= velocityMult; + acceleration *= velocityMult; + velocity *= velocityMult; chargeTime -= chargeTimeDecrease; - chargeTime2 -= chargeTimeDecrease; chargeSpeed *= velocityMult; - chargeSpeed2 *= velocityMult; - scaleFactor4 *= velocityMult; - scaleFactor5 *= velocityMult; } - float num25 = 20f; if (npc.ai[0] == 0f) { npc.ai[1] += 1f; @@ -2008,17 +1668,17 @@ namespace CalamityMod.NPCs.Yharon if (npc.ai[2] == 0f) npc.ai[2] = (npc.Center.X < targetData.Center.X) ? 1 : -1; - Vector2 destination = targetData.Center + new Vector2(-npc.ai[2] * 300f, -200f); - Vector2 desiredVelocity = npc.DirectionTo(destination) * scaleFactor; + Vector2 destination = targetData.Center + new Vector2(-npc.ai[2] * 450f, -200f); + Vector2 desiredVelocity = npc.DirectionTo(destination) * velocity; if (!targetDead) - npc.SimpleFlyMovement(desiredVelocity, num6); + npc.SimpleFlyMovement(desiredVelocity, acceleration); int num27 = (npc.Center.X < targetData.Center.X) ? 1 : -1; npc.direction = npc.spriteDirection = num27; npc.ai[1] += 1f; - if (npc.ai[1] >= 30f) + if (npc.ai[1] >= phaseSwitchTimer) { int num28 = 1; if (phase4) @@ -2146,7 +1806,7 @@ namespace CalamityMod.NPCs.Yharon break; case 4: case 5: - num28 = 2; //charge + num28 = 7; //fast charge break; case 6: num28 = 4; //fireballs @@ -2161,12 +1821,65 @@ namespace CalamityMod.NPCs.Yharon } } + if (num28 == 5 && npc.ai[1] < phaseSwitchTimer + teleportPhaseTimer) + { + float newRotation = npc.DirectionTo(targetData.Center).ToRotation(); + float amount = 0.04f; + + if (npc.spriteDirection == -1) + newRotation += pie; + + if (amount != 0f) + npc.rotation = npc.rotation.AngleTowards(newRotation, amount); + + Vector2 npcCenter = npc.Center; + + if (npc.alpha < 255) + { + npc.alpha += 17; + if (npc.alpha > 255) + npc.alpha = 255; + } + + float timeBeforeTeleport = teleportPhaseTimer - 15f; + if (npc.ai[1] == phaseSwitchTimer + timeBeforeTeleport) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + + if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] == phaseSwitchTimer + timeBeforeTeleport) + { + teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); + Vector2 center = targetData.Center + new Vector2(-npc.ai[2] * 500f, teleportLocation); + npcCenter = npc.Center = center; + } + + return; + } + + if (num28 == 7 && npc.localAI[1] <= fastChargeTelegraphTimer) + { + float newRotation = npc.DirectionTo(targetData.Center).ToRotation(); + float amount = 0.04f; + + if (npc.spriteDirection == -1) + newRotation += pie; + + if (amount != 0f) + npc.rotation = npc.rotation.AngleTowards(newRotation, amount); + + npc.localAI[1] += 1f; + if (npc.localAI[1] == fastChargeTelegraphTimer - (phase4 ? 30 : 60)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + + return; + } + npc.ai[0] = num28; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 1f; + npc.localAI[1] = 0f; - switch (secondPhasePhase) + switch (secondPhasePhase) { case 1: if (phase2) @@ -2245,7 +1958,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.spriteDirection == -1) npc.rotation += pie; - npc.velocity = vector3 * scaleFactor5; + npc.velocity = vector3 * spinPhaseVelocity; break; } @@ -2258,30 +1971,21 @@ namespace CalamityMod.NPCs.Yharon if (npc.spriteDirection == -1) npc.rotation += pie; - npc.velocity = vector * chargeSpeed2; + npc.velocity = vector * chargeSpeed * fastChargeVelocityMultiplier; break; } } } } + + // Charge else if (npc.ai[0] == 2f) { if (npc.ai[1] == 1f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - int num1473 = 7; - for (int num1474 = 0; num1474 < num1473; num1474++) - { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * pie / (float)num1473) + npc.Center; - Vector2 value18 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; - } + ChargeDust(7, pie); npc.ai[1] += 1f; if (npc.ai[1] >= chargeTime) @@ -2291,89 +1995,82 @@ namespace CalamityMod.NPCs.Yharon npc.ai[2] = 0f; } } - else if (npc.ai[0] == 3f) //fireball spit + + // Fireball spit + else if (npc.ai[0] == 3f) { int num29 = (npc.Center.X < targetData.Center.X) ? 1 : -1; npc.ai[2] = num29; npc.ai[1] += 1f; - if (npc.ai[1] < num11) + if (npc.ai[1] < fireballBreathTimer) { - Vector2 vector4 = targetData.Center + new Vector2(num29 * -600f, -250f); - Vector2 value = npc.DirectionTo(vector4) * 12f; + Vector2 vector4 = targetData.Center + new Vector2(num29 * -750f, -300f); + Vector2 value = npc.DirectionTo(vector4) * 16f; - if (npc.Distance(vector4) < 12f) + if (npc.Distance(vector4) < 16f) npc.Center = vector4; else npc.position += value; - if (Vector2.Distance(vector4, npc.Center) < 16f) - npc.ai[1] = num11 - 1f; - - num2 = 1.5f; + if (Vector2.Distance(vector4, npc.Center) < 32f) + npc.ai[1] = fireballBreathTimer - 1f; } - if (npc.ai[1] == num11) + if (npc.ai[1] == fireballBreathTimer) { - int num30 = (targetData.Center.X > npc.Center.X) ? 1 : -1; - npc.velocity = new Vector2(num30, 0f) * 22f; //10f - npc.direction = npc.spriteDirection = num30; + int direction = (targetData.Center.X > npc.Center.X) ? 1 : -1; + npc.velocity = new Vector2(direction, 0f) * fireballBreathPhaseVelocity; + npc.direction = npc.spriteDirection = direction; } - if (npc.ai[1] >= num11) + if (npc.ai[1] >= fireballBreathTimer) { - if (npc.ai[1] % 8 == 0 && Main.netMode != NetmodeID.MultiplayerClient) + if (npc.ai[1] % 10 == 0 && Main.netMode != NetmodeID.MultiplayerClient) { - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f + num33) * npc.direction, -20f).RotatedBy(npc.rotation); - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); - float playerX = targetData.Center.X - vectorShoot.X; - float playerY = targetData.Center.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt(playerX * playerX + playerY * playerY); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile(position.X, position.Y, playerX, playerY, ModContent.ProjectileType(), num4, 0f, Main.myPlayer, 1f, 0f); + float xOffset = 30f; + Vector2 position = npc.Center + new Vector2((110f + xOffset) * npc.direction, -20f).RotatedBy(npc.rotation); + Vector2 projectileVelocity = targetData.Center - position; + projectileVelocity.Normalize(); + projectileVelocity *= 0.1f; + Projectile.NewProjectile(position, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 1f, 0f); } - num2 = 1.5f; - - if (Math.Abs(targetData.Center.X - npc.Center.X) > 550f && Math.Abs(npc.velocity.X) < 20f) + if (Math.Abs(targetData.Center.X - npc.Center.X) > 700f && Math.Abs(npc.velocity.X) < chargeSpeed) npc.velocity.X += Math.Sign(npc.velocity.X) * 0.5f; } - if (npc.ai[1] >= num13) + if (npc.ai[1] >= fireballBreathPhaseTimer) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; } } - else if (npc.ai[0] == 4f) //fireball spit + + // Splitting fireball breath + else if (npc.ai[0] == 4f) { int num31 = (npc.Center.X < targetData.Center.X) ? 1 : -1; npc.ai[2] = num31; - if (npc.ai[1] < num15) + if (npc.ai[1] < splittingFireballBreathTimer) { - Vector2 vector5 = targetData.Center + new Vector2(num31 * -1500f, -350f); - Vector2 value2 = npc.DirectionTo(vector5) * scaleFactor3; + Vector2 vector5 = targetData.Center + new Vector2(num31 * -750f, -300f); + Vector2 value2 = npc.DirectionTo(vector5) * splittingFireballBreathPhaseVelocity; npc.velocity = Vector2.Lerp(npc.velocity, value2, 0.0333333351f); - int num32 = (npc.Center.X < targetData.Center.X) ? 1 : -1; - npc.direction = npc.spriteDirection = num32; + int direction = (npc.Center.X < targetData.Center.X) ? 1 : -1; + npc.direction = npc.spriteDirection = direction; - if (Vector2.Distance(vector5, npc.Center) < 16f) - npc.ai[1] = num15 - 1f; - - num2 = 1.5f; + if (Vector2.Distance(vector5, npc.Center) < 32f) + npc.ai[1] = splittingFireballBreathTimer - 1f; } - else if (npc.ai[1] == num15) + else if (npc.ai[1] == splittingFireballBreathTimer) { Vector2 vector6 = npc.DirectionTo(targetData.Center); - vector6.Y *= 0.25f; + vector6.Y *= 0.15f; vector6 = vector6.SafeNormalize(Vector2.UnitX * npc.direction); npc.spriteDirection = (vector6.X > 0f) ? 1 : -1; @@ -2382,100 +2079,112 @@ namespace CalamityMod.NPCs.Yharon if (npc.spriteDirection == -1) npc.rotation += pie; - npc.velocity = vector6 * scaleFactor4; + npc.velocity = vector6 * splittingFireballBreathPhaseVelocity; } else { - npc.position.X = npc.position.X + npc.DirectionTo(targetData.Center).X * 7f; - npc.position.Y = npc.position.Y + npc.DirectionTo(targetData.Center + new Vector2(0f, -400f)).Y * 6f; + npc.position.X += npc.DirectionTo(targetData.Center).X * 7f; + npc.position.Y += npc.DirectionTo(targetData.Center + new Vector2(0f, -400f)).Y * 6f; - if (npc.ai[1] <= num19 - num18) - num2 = 1.5f; + float xOffset = 30f; + Vector2 position = npc.Center + new Vector2((110f + xOffset) * npc.direction, -20f).RotatedBy(npc.rotation); + int num34 = (int)(npc.ai[1] - splittingFireballBreathTimer + 1f); - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f + num33) * npc.direction, -20f).RotatedBy(npc.rotation); - int num34 = (int)(npc.ai[1] - num15 + 1f); - - if (num34 <= num17 && num34 % num16 == 0 && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(position, npc.velocity, ModContent.ProjectileType(), num4, 0f, Main.myPlayer, 0f, 0f); + if (num34 <= splittingFireballBreathTimer2 && num34 % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(position, npc.velocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); } - if (npc.ai[1] > num19 - num18) + if (npc.ai[1] > splittingFireballBreathPhaseTimer - splittingFireballBreathYVelocityTimer) npc.velocity.Y -= 0.1f; npc.ai[1] += 1f; - if (npc.ai[1] >= num19) + if (npc.ai[1] >= splittingFireballBreathPhaseTimer) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; } } - else if (npc.ai[0] == 5f) //spin 2 win + + // Fireball spin + else if (npc.ai[0] == 5f) { - npc.velocity = npc.velocity.RotatedBy(-(double)num22 * (float)npc.direction); + npc.velocity = npc.velocity.RotatedBy(-(double)spinRotation * (float)npc.direction); + npc.rotation -= spinRotation * npc.direction; - npc.position.Y = npc.position.Y - 0.1f; - npc.position += npc.DirectionTo(targetData.Center) * 10f; - - npc.rotation -= num22 * npc.direction; - - num2 *= 0.7f; - - if (npc.ai[1] == 1f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + if (npc.ai[1] == 1f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); + flareDustBulletHellSpawn = npc.Center + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / (MathHelper.TwoPi * 3f); + } npc.ai[1] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { - if (npc.ai[1] % 12 == 0) - { - float num33 = 30f; - Vector2 position = npc.Center + new Vector2((110f + num33) * npc.direction, -20f).RotatedBy(npc.rotation); - Projectile.NewProjectile(position, npc.velocity, ModContent.ProjectileType(), num4, 0f, Main.myPlayer, 0f, 0f); + if (phase3) + { + // Rotate spiral by 9 * (240 / 12) = +90 degrees and then back -90 degrees - if (phase4) - { - float speed = 0.01f; - Vector2 vectorShoot = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f + 30f); - float playerX = targetData.Center.X - vectorShoot.X; - float playerY = targetData.Center.Y - vectorShoot.Y; - float playerXY = (float)Math.Sqrt(playerX * playerX + playerY * playerY); - playerXY = speed / playerXY; - playerX *= playerXY; - playerY *= playerXY; - Projectile.NewProjectile(position.X, position.Y, playerX, playerY, ModContent.ProjectileType(), num4, 0f, Main.myPlayer, 0f, 0f); - } - } + // For phase 4: Rotate spiral by 18 * (240 / 16) = +135 degrees and then back -135 degrees - if (npc.ai[1] == 45f && phase4 && useTornado) + if (npc.ai[1] % flareDustSpawnDivisor3 == 0f) + DoFlareDustBulletHell(1, (int)spinPhaseTimer, projectileDamage, phase4 ? 12 : 10, phase4 ? 16f : 12f, phase4 ? 18f : 9f, true); + } + else if (phase2) + { + if (npc.ai[1] % flareDustSpawnDivisor == 0f) + { + int totalProjectiles = 38 - (int)(npc.ai[1] / 12f); // 36 for first ring, 18 for last ring + DoFlareDustBulletHell(0, (int)spinPhaseTimer, projectileDamage, totalProjectiles, 0f, 0f, true); + } + } + else + { + if (npc.ai[1] % flareDustSpawnDivisor2 == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float xOffset = 30f; + Vector2 position = npc.Center + new Vector2((110f + xOffset) * npc.direction, -20f).RotatedBy(npc.rotation); + Vector2 projectileVelocity = targetData.Center - position; + projectileVelocity.Normalize(); + projectileVelocity *= 0.1f; + Projectile.NewProjectile(position, projectileVelocity, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + + if (npc.ai[1] == 210f && phase4 && useTornado) { useTornado = false; Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); } } - if (npc.ai[1] >= num20) + if (npc.ai[1] >= spinPhaseTimer) { npc.ai[0] = 1f; - npc.ai[1] = 0f; + npc.ai[1] = phase2 ? increasedIdleTimeAfterBulletHell : 0f; npc.ai[2] = 0f; - npc.velocity /= 2f; + npc.localAI[2] = 0f; + npc.velocity /= 2f; } } - else if (npc.ai[0] == 6f) //flare spawn + + // Flare spawn and fire ring + else if (npc.ai[0] == 6f) { if (npc.ai[1] == 0f) { Vector2 destination2 = targetData.Center + new Vector2(0f, -200f); - Vector2 desiredVelocity2 = npc.DirectionTo(destination2) * scaleFactor * 2f; - npc.SimpleFlyMovement(desiredVelocity2, num6 * 2f); + Vector2 desiredVelocity2 = npc.DirectionTo(destination2) * velocity * 1.5f; + npc.SimpleFlyMovement(desiredVelocity2, acceleration * 1.5f); int num35 = (npc.Center.X < targetData.Center.X) ? 1 : -1; npc.direction = npc.spriteDirection = num35; npc.ai[2] += 1f; - if (npc.Distance(targetData.Center) < 1000f || npc.ai[2] >= 180f) //450f + if (npc.Distance(targetData.Center) < 600f || npc.ai[2] >= 180f) { npc.ai[1] = 1f; npc.netUpdate = true; @@ -2483,15 +2192,12 @@ namespace CalamityMod.NPCs.Yharon } else { - if (npc.ai[1] == 1f) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoar"), (int)npc.position.X, (int)npc.position.Y); - - if (npc.ai[1] < num25) + if (npc.ai[1] < flareSpawnDecelerationTimer) npc.velocity *= 0.95f; else npc.velocity *= 0.98f; - if (npc.ai[1] == num25) + if (npc.ai[1] == flareSpawnDecelerationTimer) { if (npc.velocity.Y > 0f) npc.velocity.Y /= 3f; @@ -2499,72 +2205,57 @@ namespace CalamityMod.NPCs.Yharon npc.velocity.Y -= 3f; } - num2 *= 0.85f; - - bool flag3 = npc.ai[1] == 20f || npc.ai[1] == 45f || npc.ai[1] == 70f; - int flareCount = NPC.CountNPCS(ModContent.NPCType()) + NPC.CountNPCS(ModContent.NPCType()); - - if (flareCount > 5) - flag3 = false; - - if (flag3 && Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 vector7 = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); + if (npc.ai[1] == 20f || npc.ai[1] == 80f || npc.ai[1] == 140f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - if (Vector2.Distance(vector7, targetData.Center) > 100f) - { - Point point2 = vector7.ToPoint(); - NPC.NewNPC(point2.X, point2.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC(point2.X, point2.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } + if (expertMode) + DoFireRing(300, projectileDamage, 1f); - NPC.NewNPC((int)npc.Center.X + (Main.rand.NextBool(2) ? 100 : -100), (int)npc.Center.Y - 100, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + (Main.rand.NextBool(2) ? 100 : -100), (int)npc.Center.Y - 100, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + Vector2 vector7 = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 100f * (0.6f + Main.rand.NextFloat() * 0.4f); + + if (Vector2.Distance(vector7, targetData.Center) > 150f) + SpawnDetonatingFlares(vector7, targetData, 6, new int[] { ModContent.NPCType(), ModContent.NPCType() }); + } } npc.ai[1] += 1f; } - if (npc.ai[1] >= 90f) + if (npc.ai[1] >= flareSpawnPhaseTimer) { - if (Main.netMode != NetmodeID.MultiplayerClient) - { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); + + if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.target + 1); - Boom(600, num4); - } npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; } } - else if (npc.ai[0] == 7f) //speedee chargee + + // Fast charge + else if (npc.ai[0] == 7f) { if (npc.ai[1] == 1f) Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"), (int)npc.position.X, (int)npc.position.Y); - int num1473 = 7; - for (int num1474 = 0; num1474 < num1473; num1474++) - { - Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; - vector171 = vector171.RotatedBy((double)(num1474 - (num1473 / 2 - 1)) * pie / (float)num1473) + npc.Center; - Vector2 value18 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); - int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); - Main.dust[num1475].noGravity = true; - Main.dust[num1475].noLight = true; - Main.dust[num1475].velocity /= 4f; - Main.dust[num1475].velocity -= npc.velocity; - } + ChargeDust(14, pie); npc.ai[1] += 1f; - if (npc.ai[1] >= chargeTime2) + if (npc.ai[1] >= chargeTime) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; } } - else if (npc.ai[0] == 8f) //teleport + + // Teleport + else if (npc.ai[0] == 8f) { Vector2 npcCenter = npc.Center; @@ -2587,20 +2278,23 @@ namespace CalamityMod.NPCs.Yharon npc.ai[1] = 450 * Math.Sign((npcCenter - targetData.Center).X); teleportLocation = Main.rand.NextBool(2) ? (revenge ? 500 : 600) : (revenge ? -500 : -600); - Vector2 center = targetData.Center + new Vector2(-npc.ai[1], teleportLocation); //teleport distance + Vector2 center = targetData.Center + new Vector2(-npc.ai[1], teleportLocation); npcCenter = npc.Center = center; } npc.ai[2] += 1f; - if (npc.ai[2] >= 30f) + if (npc.ai[2] >= teleportPhaseTimer) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.netUpdate = true; + npc.localAI[1] = fastChargeTelegraphTimer + 1f; + npc.netUpdate = true; } } - else if (npc.ai[0] == 9f) //enter next phase + + // Enter new phase + else if (npc.ai[0] == 9f) { npc.velocity *= 0.95f; @@ -2615,8 +2309,7 @@ namespace CalamityMod.NPCs.Yharon { if (phase4) { - int proj; - for (int x = 0; x < 1000; x = proj + 1) + for (int x = 0; x < 1000; x++) { Projectile projectile = Main.projectile[x]; if (projectile.active) @@ -2631,7 +2324,6 @@ namespace CalamityMod.NPCs.Yharon else if (projectile.type == ModContent.ProjectileType()) projectile.active = false; } - proj = x; } } @@ -2649,17 +2341,6 @@ namespace CalamityMod.NPCs.Yharon } } - npc.localAI[0] += num2; - if (npc.localAI[0] >= 36f) - npc.localAI[0] = 0f; - - if (num != -1) - npc.localAI[0] = num * 4; - - npc.localAI[1] += 1f; - if (npc.localAI[1] >= 60f) - npc.localAI[1] = 0f; - float num42 = npc.DirectionTo(targetData.Center).ToRotation(); float num43 = 0.04f; @@ -2679,7 +2360,7 @@ namespace CalamityMod.NPCs.Yharon if (npc.spriteDirection == -1) num42 -= pie; - if (npc.ai[1] >= num11) + if (npc.ai[1] >= fireballBreathTimer) { num42 += npc.spriteDirection * pie / 12f; num43 = 0.05f; @@ -2710,19 +2391,128 @@ namespace CalamityMod.NPCs.Yharon if (num43 != 0f) npc.rotation = npc.rotation.AngleTowards(num42, num43); } - #endregion + #endregion - #region Drawing - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + #region Charge Dust + private void ChargeDust(int dustAmt, float pie) + { + for (int num1474 = 0; num1474 < dustAmt; num1474++) + { + Vector2 vector171 = Vector2.Normalize(npc.velocity) * new Vector2((npc.width + 50) / 2f, npc.height) * 0.75f; + vector171 = vector171.RotatedBy((num1474 - (dustAmt / 2 - 1)) * (double)pie / (float)dustAmt) + npc.Center; + Vector2 value18 = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + int num1475 = Dust.NewDust(vector171 + value18, 0, 0, 244, value18.X * 2f, value18.Y * 2f, 100, default, 1.4f); + Main.dust[num1475].noGravity = true; + Main.dust[num1475].noLight = true; + Main.dust[num1475].velocity /= 4f; + Main.dust[num1475].velocity -= npc.velocity; + } + } + #endregion + + #region Spawn Detonating Flares + private void SpawnDetonatingFlares(Vector2 origin, Player target, int maxFlareCount, int[] flareTypes) + { + if (flareTypes.Length > 1) + { + if (NPC.CountNPCS(flareTypes[0]) + NPC.CountNPCS(flareTypes[1]) < maxFlareCount) + SpawnFlares(flareTypes[0], flareTypes[1]); + } + else + { + if (NPC.CountNPCS(flareTypes[0]) < maxFlareCount) + SpawnFlares(flareTypes[0]); + } + + void SpawnFlares(int type1 = 0, int type2 = 0) + { + int type = type2 == 0 ? type1 : Main.rand.NextBool(2) ? type1 : type2; + int npc = NPC.NewNPC((int)origin.X, (int)origin.Y, type, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[npc].velocity = target.Center - origin; + Main.npc[npc].velocity.Normalize(); + Main.npc[npc].velocity *= CalamityWorld.bossRushActive ? 15f : 10f; + Main.npc[npc].netUpdate = true; + } + } + #endregion + + #region Flare Dust Bullet Hell + private void DoFlareDustBulletHell(int attackType, int timer, int projectileDamage, int totalProjectiles, float projectileVelocity, float radialOffset, bool phase2) + { + Main.PlaySound(SoundID.Item20, flareDustBulletHellSpawn); + float aiVariableUsed = phase2 ? npc.ai[1] : npc.ai[2]; + switch (attackType) + { + case 0: + float offsetAngle = 360 / totalProjectiles; + int totalSpaces = totalProjectiles / 5; + int spaceStart = Main.rand.Next(totalProjectiles - totalSpaces); + float ai0 = aiVariableUsed % (timer * 2) == 0f ? 1f : 0f; + + int spacesMade = 0; + for (int i = 0; i < totalProjectiles; i++) + { + if (i >= spaceStart && spacesMade < totalSpaces) + spacesMade++; + else + Projectile.NewProjectile(flareDustBulletHellSpawn, Vector2.Zero, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, ai0, i * offsetAngle); + } + break; + + case 1: + double radians = MathHelper.TwoPi / totalProjectiles; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-npc.localAI[2], -projectileVelocity)); + + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 vector2 = spinningPoint.RotatedBy(radians * i) * projectileVelocity; + Projectile.NewProjectile(flareDustBulletHellSpawn, vector2, ModContent.ProjectileType(), projectileDamage, 0f, Main.myPlayer, 2f, 0f); + } + + npc.localAI[2] += (aiVariableUsed < (timer / 2)) ? radialOffset : -radialOffset; + break; + + default: + break; + } + } + #endregion + + #region Fire Ring + public void DoFireRing(int timeLeft, int damage, float ai1) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float velocity = 5f; + int totalProjectiles = 50; + float radians = MathHelper.TwoPi / totalProjectiles; + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); + int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, ai1); + Main.projectile[proj].timeLeft = timeLeft; + } + } + } + #endregion + + #region Drawing + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - bool idlePhases = (!startSecondAI && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) || (startSecondAI && (npc.ai[0] == 5f || npc.ai[0] < 2f)); - bool chargingOrSpawnPhases = (!startSecondAI && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f || npc.ai[0] == 22f)) || + bool idlePhases = (!startSecondAI && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f)) || (startSecondAI && (npc.ai[0] == 5f || npc.ai[0] < 2f)); + + bool chargingOrSpawnPhases = (!startSecondAI && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f)) || (startSecondAI && (npc.ai[0] == 6f || npc.ai[0] == 2f || npc.ai[0] == 7f)); - bool projectileOrCirclePhases = (!startSecondAI && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f)) || + + bool projectileOrCirclePhases = (!startSecondAI && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f || npc.ai[0] == 20f)) || (startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 3f)); - bool tornadoPhase = !startSecondAI && (npc.ai[0] == 3f || npc.ai[0] == 9f || npc.ai[0] == -1f || npc.ai[0] == 16f || npc.ai[0] == 20f); - bool newPhasePhase = (!startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 10f || npc.ai[0] == 17f || npc.ai[0] == 24f)) || (startSecondAI && npc.ai[0] == 9f); - bool pauseAfterTeleportPhase = (!startSecondAI && npc.ai[0] == 23f) || (startSecondAI && npc.ai[0] == 8f); + + bool tornadoPhase = !startSecondAI && (npc.ai[0] == 3f || npc.ai[0] == 9f || npc.ai[0] == -1f || npc.ai[0] == 16f); + + bool newPhasePhase = (!startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 10f || npc.ai[0] == 17f)) || (startSecondAI && npc.ai[0] == 9f); + + bool pauseAfterTeleportPhase = startSecondAI && npc.ai[0] == 8f; + bool ai2 = startSecondAI && !phaseOneLoot; SpriteEffects spriteEffects = ai2 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -2739,7 +2529,7 @@ namespace CalamityMod.NPCs.Yharon bool invincible = ai2 && invincibilityCounter < 900; bool flag8 = npc.ai[0] > 5f; bool flag9 = npc.ai[0] > 12f; - bool flag10 = npc.ai[0] > 20f || startSecondAI; + bool flag10 = startSecondAI; int num150 = 120; int num151 = 60; @@ -2773,7 +2563,7 @@ namespace CalamityMod.NPCs.Yharon else color = lightColor; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num155 = 1; num155 < num153; num155 += num154) { @@ -2824,7 +2614,7 @@ namespace CalamityMod.NPCs.Yharon scaleFactor9 = 20f; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num160 = 0; num160 < num156; num160++) { @@ -2901,7 +2691,7 @@ namespace CalamityMod.NPCs.Yharon color46 *= num162; } - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int num163 = 1; num163 < num153; num163 += num154) { @@ -3037,7 +2827,7 @@ namespace CalamityMod.NPCs.Yharon DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); // Other - DropHelper.DropItem(npc, ModContent.ItemType()); + //DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedYharon); DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedYharon, 6, 3, 2); @@ -3066,7 +2856,7 @@ namespace CalamityMod.NPCs.Yharon } #endregion - #region StrikeNPC + #region Strike NPC public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { if (CalamityUtils.AntiButcher(npc, ref damage, 0.5f)) @@ -3082,7 +2872,7 @@ namespace CalamityMod.NPCs.Yharon } #endregion - #region HPBarCooldownSlotandStats + #region HP Bar Cooldown Slot and Stats public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; @@ -3102,21 +2892,57 @@ namespace CalamityMod.NPCs.Yharon } #endregion - #region FindFrame + #region Find Frame public override void FindFrame(int frameHeight) { - bool idlePhases = (!startSecondAI && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) || (startSecondAI && (npc.ai[0] == 5f || npc.ai[0] < 2f)); - bool chargingOrSpawnPhases = (!startSecondAI && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f || npc.ai[0] == 22f)) || + bool idlePhases = (!startSecondAI && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f)) || (startSecondAI && (npc.ai[0] == 5f || npc.ai[0] < 2f)); + + bool chargingOrSpawnPhases = (!startSecondAI && (npc.ai[0] == 1f || npc.ai[0] == 5f || npc.ai[0] == 7f || npc.ai[0] == 11f || npc.ai[0] == 14f || npc.ai[0] == 18f)) || (startSecondAI && (npc.ai[0] == 6f || npc.ai[0] == 2f || npc.ai[0] == 7f)); - bool projectileOrCirclePhases = (!startSecondAI && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f || npc.ai[0] == 23f)) || + + bool projectileOrCirclePhases = (!startSecondAI && (npc.ai[0] == 2f || npc.ai[0] == 8f || npc.ai[0] == 12f || npc.ai[0] == 15f || npc.ai[0] == 19f || npc.ai[0] == 20f)) || (startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 3f || npc.ai[0] == 8f)); - bool tornadoPhase = !startSecondAI && (npc.ai[0] == 3f || npc.ai[0] == 9f || npc.ai[0] == -1f || npc.ai[0] == 16f || npc.ai[0] == 20f); - bool newPhasePhase = (!startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 10f || npc.ai[0] == 17f || npc.ai[0] == 24f)) || (startSecondAI && npc.ai[0] == 9f); + + bool tornadoPhase = !startSecondAI && (npc.ai[0] == 3f || npc.ai[0] == 9f || npc.ai[0] == -1f || npc.ai[0] == 16f); + + bool newPhasePhase = (!startSecondAI && (npc.ai[0] == 4f || npc.ai[0] == 10f || npc.ai[0] == 17f)) || (startSecondAI && npc.ai[0] == 9f); + + bool chargeTelegraph = (!startSecondAI && (npc.ai[0] == 0f || npc.ai[0] == 6f || npc.ai[0] == 13f) && npc.localAI[1] > 0f) || + (startSecondAI && npc.ai[0] < 2f && npc.localAI[1] > 0f); + + if (chargeTelegraph) + { + bool phase4 = startSecondAI && npc.life <= npc.lifeMax * 0.15 && (CalamityWorld.revenge || CalamityWorld.bossRushActive); + + int num86 = phase4 ? 60 : 120; + if (npc.localAI[1] < num86 - (phase4 ? 30 : 60) || npc.localAI[1] > num86 - (phase4 ? 10 : 20)) + { + npc.frameCounter += phase4 ? 2D : 1D; + if (npc.frameCounter > 5D) + { + npc.frameCounter = 0D; + npc.frame.Y += frameHeight; + } + if (npc.frame.Y >= frameHeight * 5) + { + npc.frame.Y = 0; + } + } + else + { + npc.frame.Y = frameHeight * 5; + if (npc.localAI[1] > num86 - (phase4 ? 25 : 50) && npc.localAI[1] < num86 - (phase4 ? 12 : 25)) + { + npc.frame.Y = frameHeight * 6; + } + } + return; + } if (idlePhases) { int num84 = 5; - if (!startSecondAI && (npc.ai[0] == 6f || npc.ai[0] == 13f || npc.ai[0] == 21f)) + if (!startSecondAI && (npc.ai[0] == 6f || npc.ai[0] == 13f)) { num84 = 4; } @@ -3131,14 +2957,13 @@ namespace CalamityMod.NPCs.Yharon npc.frame.Y = 0; } } + if (chargingOrSpawnPhases) - { npc.frame.Y = frameHeight * 5; - } + if (projectileOrCirclePhases) - { npc.frame.Y = frameHeight * 5; - } + if (tornadoPhase) { int num85 = 90; @@ -3164,6 +2989,7 @@ namespace CalamityMod.NPCs.Yharon } } } + if (newPhasePhase) { int num86 = 180; @@ -3192,25 +3018,7 @@ namespace CalamityMod.NPCs.Yharon } #endregion - #region Boom - public void Boom(int timeLeft, int damage) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float velocity = 5f; - int totalProjectiles = 50; - float radians = MathHelper.TwoPi / totalProjectiles; - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[proj].timeLeft = timeLeft; - } - } - } - #endregion - - #region HitEffect + #region Hit Effect public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -3219,7 +3027,7 @@ namespace CalamityMod.NPCs.Yharon } if (npc.life <= 0) { - Boom(150, 1000); + DoFireRing(150, 1000, 0f); npc.position.X = npc.position.X + (npc.width / 2); npc.position.Y = npc.position.Y + (npc.height / 2); npc.width = 300; diff --git a/Prefixes/AccessoryPrefix.cs b/Prefixes/AccessoryPrefix.cs new file mode 100644 index 0000000000..b0646d2231 --- /dev/null +++ b/Prefixes/AccessoryPrefix.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Prefixes +{ + public class AccessoryPrefix : ModPrefix + { + //Thank you Thomas for helping me set this up =D + internal static List AccessoryModifiers; + internal float stealthGenBonus = 1f; + + public override PrefixCategory Category => PrefixCategory.Accessory; + + public AccessoryPrefix() + { + + } + + public AccessoryPrefix(float stealthGenBonus = 1f) + { + this.stealthGenBonus = stealthGenBonus; + } + + public override bool Autoload(ref string name) + { + if (base.Autoload(ref name)) + { + //Damage, Use Time, Crit, Velocity, SS Dmg + AccessoryModifiers = new List(); + AddAccessoryPrefix(mod, AccPrefixType.Quiet, 1.02f); + AddAccessoryPrefix(mod, AccPrefixType.Cloaked, 1.04f); + AddAccessoryPrefix(mod, AccPrefixType.Camouflaged, 1.06f); + AddAccessoryPrefix(mod, AccPrefixType.Silent, 1.08f); + } + return false; + } + + public override void Apply(Item item) + { + item.Calamity().StealthGenBonus = stealthGenBonus; + } + + public override void ModifyValue(ref float valueMult) + { + float extraValue = 1f + (2.5f * (stealthGenBonus - 1f)); + valueMult *= extraValue; + } + + public override float RollChance(Item item) + { + if (item.vanity) + return 0f; + if (item.type == ItemID.GuideVoodooDoll || item.type == ItemID.MusicBox || item.type == ItemID.ClothierVoodooDoll) + return 0f; + if (item.type >= ItemID.MusicBoxOverworldDay && item.type <= ItemID.MusicBoxBoss3) + return 0f; + if (item.type >= ItemID.MusicBoxSnow && item.type <= ItemID.MusicBoxMushrooms) + return 0f; + + return 1f; + } + + private static void AddAccessoryPrefix(Mod mod, AccPrefixType prefixType, float stealthGenBonus = 1f) + { + string name = prefixType.ToString(); + mod.AddPrefix(name, new AccessoryPrefix(stealthGenBonus)); + AccessoryModifiers.Add(mod.GetPrefix(name).Type); + } + } + + public enum AccPrefixType : byte + { + Quiet, + Cloaked, + Camouflaged, + Silent + } +} \ No newline at end of file diff --git a/Prefixes/RoguePrefix.cs b/Prefixes/RoguePrefix.cs new file mode 100644 index 0000000000..180539af9d --- /dev/null +++ b/Prefixes/RoguePrefix.cs @@ -0,0 +1,122 @@ +using CalamityMod.Items.Weapons.Rogue; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Prefixes +{ + public class RoguePrefix : ModPrefix + { + //Thank you Thomas for helping me set this up =D + internal static List RogueModifiers; + internal float damageMult = 1f; + internal float useTimeMult = 1f; + internal int critBonus = 0; + internal float shootSpeedMult = 1f; + internal float stealthDmgMult = 1f; + + public override PrefixCategory Category => PrefixCategory.Custom; + + public RoguePrefix() + { + + } + + public RoguePrefix(float damageMult = 1f, float useTimeMult = 1f, int critBonus = 0, float shootSpeedMult = 1f, float stealthDmgMult = 1f) + { + this.damageMult = damageMult; + this.useTimeMult = useTimeMult; + this.critBonus = critBonus; + this.shootSpeedMult = shootSpeedMult; + this.stealthDmgMult = stealthDmgMult; + } + + public override bool Autoload(ref string name) + { + if (base.Autoload(ref name)) + { + //Damage, Use Time, Crit, Velocity, SS Dmg + RogueModifiers = new List(); + AddRoguePrefix(mod, RoguePrefixType.Pointy, 1.1f, 1f, 0, 1f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Sharp, 1.15f, 1f, 0, 1f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Feathered, 1f, 0.85f, 0, 1.1f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Sleek, 1f, 0.9f, 0, 1.15f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Hefty, 1.1f, 1f, 0, 1f, 1.15f); + AddRoguePrefix(mod, RoguePrefixType.Mighty, 1.15f, 1f, 0, 1f, 1.05f); + AddRoguePrefix(mod, RoguePrefixType.Glorious, 1.1f, 0.95f, 0, 1f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Serrated, 1.1f, 0.9f, 0, 1.05f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Vicious, 1.1f, 0.95f, 0, 1.15f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Lethal, 1.1f, 0.95f, 2, 1.05f, 1.05f); + AddRoguePrefix(mod, RoguePrefixType.Flawless, 1.15f, 0.9f, 5, 1.1f, 1.15f); + AddRoguePrefix(mod, RoguePrefixType.Radical, 1.05f, 0.95f, 0, 1.05f, 0.9f); + AddRoguePrefix(mod, RoguePrefixType.Blunt, 0.85f, 1f, 0, 1f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Flimsy, 0.9f, 1f, 0, 1f, 0.9f); + AddRoguePrefix(mod, RoguePrefixType.Unbalanced, 1f, 1.15f, 0, 0.95f, 1f); + AddRoguePrefix(mod, RoguePrefixType.Atrocious, 0.85f, 1f, 0, 0.9f, 0.9f); + } + return false; + } + + public override void Apply(Item item) + { + ModItem moddedItem = item.modItem; + if(moddedItem != null && moddedItem is RogueWeapon rogueWep) + { + rogueWep.StealthStrikeDamage = stealthDmgMult; + } + } + + public override void ModifyValue(ref float valueMult) + { + float extraValue = 1f + (1f * (stealthDmgMult - 1f)); + valueMult *= extraValue; + } + + public override bool CanRoll(Item item) => item.Calamity().rogue && !item.consumable; + + public override void SetStats(ref float damageMult, ref float knockbackMult, ref float useTimeMult, ref float scaleMult, ref float shootSpeedMult, ref float manaMult, ref int critBonus) + { + damageMult = this.damageMult; + useTimeMult = this.useTimeMult; + critBonus = this.critBonus; + shootSpeedMult = this.shootSpeedMult; + } + + private static void AddRoguePrefix(Mod mod, RoguePrefixType prefixType, float damageMult = 1f, float useTimeMult = 1f, int critBonus = 0, float shootSpeedMult = 1f, float stealthDmgMult = 1f) + { + string name = prefixType.ToString(); + mod.AddPrefix(name, new RoguePrefix(damageMult, useTimeMult, critBonus, shootSpeedMult, stealthDmgMult)); + RogueModifiers.Add(mod.GetPrefix(name).Type); + } + + public override void ValidateItem(Item item, ref bool invalid) + { + if (item.damage == Math.Round(item.damage * damageMult)) + invalid = true; + if (item.useAnimation == Math.Round(item.useAnimation * useTimeMult)) + invalid = true; + } + } + + public enum RoguePrefixType : byte + { + Pointy, + Sharp, + Feathered, + Sleek, + Hefty, + Mighty, + Glorious, + Serrated, + Vicious, + Lethal, + Flawless, + Radical, + Blunt, + Flimsy, + Unbalanced, + Atrocious + } +} \ No newline at end of file diff --git a/Projectiles/BaseProjectiles/BaseSpearProjectile.cs b/Projectiles/BaseProjectiles/BaseSpearProjectile.cs index 593e0e6da1..e766d1ed90 100644 --- a/Projectiles/BaseProjectiles/BaseSpearProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseSpearProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/BaseProjectiles/BaseWhipProjectile.cs b/Projectiles/BaseProjectiles/BaseWhipProjectile.cs index f6479045e9..b99eefe670 100644 --- a/Projectiles/BaseProjectiles/BaseWhipProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseWhipProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Boss/AbyssBallVolley.cs b/Projectiles/Boss/AbyssBallVolley.cs index f7d74023b4..ea803bc3ee 100644 --- a/Projectiles/Boss/AbyssBallVolley.cs +++ b/Projectiles/Boss/AbyssBallVolley.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); } if (Main.rand.NextBool(2)) { diff --git a/Projectiles/Boss/AbyssBallVolley2.cs b/Projectiles/Boss/AbyssBallVolley2.cs index a38a67caac..0e15ff0238 100644 --- a/Projectiles/Boss/AbyssBallVolley2.cs +++ b/Projectiles/Boss/AbyssBallVolley2.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); } if (Main.rand.NextBool(2)) { diff --git a/Projectiles/Boss/AbyssMine.cs b/Projectiles/Boss/AbyssMine.cs index 80c33359fd..6373ffd5a8 100644 --- a/Projectiles/Boss/AbyssMine.cs +++ b/Projectiles/Boss/AbyssMine.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); } if (Main.rand.NextBool(6)) { @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/AbyssMine2.cs b/Projectiles/Boss/AbyssMine2.cs index 0f3af77d1c..e6533fd0c8 100644 --- a/Projectiles/Boss/AbyssMine2.cs +++ b/Projectiles/Boss/AbyssMine2.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); } if (Main.rand.NextBool(6)) { @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 96; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index f6b9284896..8e8a1ea3ef 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index 5b1f536120..cfb5c07228 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index c157f11aa7..2317658c5b 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss projectile.height = 10; projectile.hostile = true; projectile.ignoreWater = true; + projectile.tileCollide = false; projectile.alpha = 255; projectile.penetrate = -1; projectile.timeLeft = 600; @@ -30,6 +31,10 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { + Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]); + if (Vector2.Distance(targetLocation, projectile.Center) < 80f) + projectile.tileCollide = true; + projectile.frameCounter++; if (projectile.frameCounter > 4) { @@ -40,11 +45,7 @@ namespace CalamityMod.Projectiles.Boss { projectile.frame = 0; } - if (projectile.ai[0] == 0f) - { - projectile.ai[0] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); - } + if (projectile.alpha > 0) { projectile.alpha -= 25; @@ -53,7 +54,8 @@ namespace CalamityMod.Projectiles.Boss { projectile.alpha = 0; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/BigFlare.cs b/Projectiles/Boss/BigFlare.cs index 57ba185e96..63af867a07 100644 --- a/Projectiles/Boss/BigFlare.cs +++ b/Projectiles/Boss/BigFlare.cs @@ -1,7 +1,6 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BigFlare : ModProjectile + public class BigFlare : ModProjectile { public override void SetStaticDefaults() { @@ -112,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Boss/BigFlare2.cs b/Projectiles/Boss/BigFlare2.cs index e00325d4f9..78fe68cb15 100644 --- a/Projectiles/Boss/BigFlare2.cs +++ b/Projectiles/Boss/BigFlare2.cs @@ -1,7 +1,6 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BigFlare2 : ModProjectile + public class BigFlare2 : ModProjectile { public override void SetStaticDefaults() { @@ -112,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index 02ea715c1d..b1620f3de1 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -1,7 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +7,7 @@ using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BirbAura : ModProjectile + public class BirbAura : ModProjectile { float timer = 135f; float timeBeforeVanish = 0f; diff --git a/Projectiles/Boss/BirbAuraFlare.cs b/Projectiles/Boss/BirbAuraFlare.cs index 95046b04b2..2a6f8bb09c 100644 --- a/Projectiles/Boss/BirbAuraFlare.cs +++ b/Projectiles/Boss/BirbAuraFlare.cs @@ -1,6 +1,5 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BirbAuraFlare : ModProjectile + public class BirbAuraFlare : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/BloodClot.cs b/Projectiles/Boss/BloodClot.cs index 0f522879db..22cdc226b7 100644 --- a/Projectiles/Boss/BloodClot.cs +++ b/Projectiles/Boss/BloodClot.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Boss/BloodGeyser.cs b/Projectiles/Boss/BloodGeyser.cs index be5a381b1f..791e10fc55 100644 --- a/Projectiles/Boss/BloodGeyser.cs +++ b/Projectiles/Boss/BloodGeyser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 6cd0ea8190..8bdf9df0af 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 4bfd3b5c77..96f3f0394b 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BrimstoneBarrage : ModProjectile + public class BrimstoneBarrage : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index f9ff6f101c..d06dabb736 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index 245f83dfb9..93483613f7 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -1,10 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Boss { public class BrimstoneFireblast : ModProjectile @@ -48,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; @@ -86,7 +88,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); float spread = 12f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 30f; diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index ecb68f0039..3d75dbe0cf 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -6,6 +6,8 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Boss { public class BrimstoneGigaBlast : ModProjectile @@ -46,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } float num953 = revenge ? 100f : 80f; //100 float scaleFactor12 = revenge ? 20f : 15f; //5 @@ -96,7 +98,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 22c4d3cad6..9e32ff51ac 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } projectile.velocity.X *= 1.03f; projectile.velocity.Y *= 1.03f; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int dust = 0; dust <= 5; dust++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 819ba0a176..cb78339772 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index 300a6ab167..2df891bf27 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } diff --git a/Projectiles/Boss/BrimstoneLaser.cs b/Projectiles/Boss/BrimstoneLaser.cs index 99c91a4c69..556e438a16 100644 --- a/Projectiles/Boss/BrimstoneLaser.cs +++ b/Projectiles/Boss/BrimstoneLaser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using System.IO; diff --git a/Projectiles/Boss/BrimstoneLaserSplit.cs b/Projectiles/Boss/BrimstoneLaserSplit.cs index 1a859ce543..6010bc38c3 100644 --- a/Projectiles/Boss/BrimstoneLaserSplit.cs +++ b/Projectiles/Boss/BrimstoneLaserSplit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 690c378bff..4e67bf40b0 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Boss } // Fly away from other brimstone monsters - float velocity = 0.1f; + float velocity = 0.05f; for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].active) diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 9b9962edb0..c16c04b578 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +10,7 @@ using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BrimstoneRay : ModProjectile + public class BrimstoneRay : ModProjectile { public override void SetStaticDefaults() { @@ -51,20 +50,20 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[(int)projectile.ai[1]].active && Main.npc[(int)projectile.ai[1]].type == ModContent.NPCType()) { Vector2 fireFrom = new Vector2(Main.npc[(int)projectile.ai[1]].Center.X + (Main.npc[(int)projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)projectile.ai[1]].Center.Y - 74f); - projectile.position = fireFrom - new Vector2((float)projectile.width, (float)projectile.height) / 2f; + projectile.position = fireFrom - new Vector2(projectile.width, projectile.height) / 2f; } else projectile.Kill(); float num801 = 1f; projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 105f) + if (projectile.localAI[0] >= 45f) { projectile.Kill(); return; } - projectile.scale = (float)Math.Sin((double)(projectile.localAI[0] * (float)Math.PI / 105f)) * 10f * num801; + projectile.scale = (float)Math.Sin(projectile.localAI[0] * (float)Math.PI / 45f) * 10f * num801; if (projectile.scale > num801) projectile.scale = num801; @@ -78,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity = num804.ToRotationVector2(); float num805 = 3f; //3f - float num806 = (float)projectile.width; + float num806 = projectile.width; Vector2 samplingPoint = projectile.Center; if (vector78.HasValue) @@ -108,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss { float num810 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2; float num811 = (float)Main.rand.NextDouble() * 2f + 2f; - Vector2 vector80 = new Vector2((float)Math.Cos((double)num810) * num811, (float)Math.Sin((double)num810) * num811); + Vector2 vector80 = new Vector2((float)Math.Cos(num810) * num811, (float)Math.Sin(num810) * num811); int num812 = Dust.NewDust(vector79, 0, 0, (int)CalamityDusts.Brimstone, vector80.X, vector80.Y, 0, default, 1f); Main.dust[num812].noGravity = true; Main.dust[num812].scale = 1.7f; @@ -116,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.rand.NextBool(5)) { - Vector2 value29 = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; + Vector2 value29 = projectile.velocity.RotatedBy(MathHelper.PiOver2, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f); Dust dust = Main.dust[num813]; dust.velocity *= 0.5f; @@ -124,7 +123,7 @@ namespace CalamityMod.Projectiles.Boss } DelegateMethods.v3_1 = new Vector3(0.9f, 0.3f, 0.3f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -141,22 +140,22 @@ namespace CalamityMod.Projectiles.Boss Vector2 vector = projectile.Center - Main.screenPosition; Rectangle? sourceRectangle2 = null; spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, projectile.rotation, texture2D19.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - num223 -= (float)(texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; + num223 -= (texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; Vector2 value20 = projectile.Center; - value20 += projectile.velocity * projectile.scale * (float)texture2D19.Height / 2f; + value20 += projectile.velocity * projectile.scale * texture2D19.Height / 2f; if (num223 > 0f) { float num224 = 0f; Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); while (num224 + 1f < num223) { - if (num223 - num224 < (float)rectangle7.Height) + if (num223 - num224 < rectangle7.Height) { rectangle7.Height = (int)(num223 - num224); } - spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2((float)(rectangle7.Width / 2), 0f), projectile.scale, SpriteEffects.None, 0f); - num224 += (float)rectangle7.Height * projectile.scale; - value20 += projectile.velocity * (float)rectangle7.Height * projectile.scale; + spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); + num224 += rectangle7.Height * projectile.scale; + value20 += projectile.velocity * rectangle7.Height * projectile.scale; rectangle7.Y += 16; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { @@ -174,7 +173,7 @@ namespace CalamityMod.Projectiles.Boss { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Boss/BrimstoneTargetRay.cs b/Projectiles/Boss/BrimstoneTargetRay.cs index 22ba609b66..4b3c4c25c1 100644 --- a/Projectiles/Boss/BrimstoneTargetRay.cs +++ b/Projectiles/Boss/BrimstoneTargetRay.cs @@ -1,17 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.Enums; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class BrimstoneTargetRay : ModProjectile + public class BrimstoneTargetRay : ModProjectile { public override void SetStaticDefaults() { @@ -52,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[(int)projectile.ai[1]].active && Main.npc[(int)projectile.ai[1]].type == ModContent.NPCType()) { Vector2 fireFrom = new Vector2(Main.npc[(int)projectile.ai[1]].Center.X + (Main.npc[(int)projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)projectile.ai[1]].Center.Y - 74f); - projectile.position = fireFrom - new Vector2((float)projectile.width, (float)projectile.height) / 2f; + projectile.position = fireFrom - new Vector2(projectile.width, projectile.height) / 2f; } else projectile.Kill(); @@ -80,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss } float num805 = 3f; //3f - float num806 = (float)projectile.width; + float num806 = projectile.width; Vector2 samplingPoint = projectile.Center; if (vector78.HasValue) @@ -107,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num807, amount); //length of laser, linear interpolation DelegateMethods.v3_1 = new Vector3(0.9f, 0.3f, 0.3f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -124,22 +121,22 @@ namespace CalamityMod.Projectiles.Boss Vector2 vector = projectile.Center - Main.screenPosition; Rectangle? sourceRectangle2 = null; spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, projectile.rotation, texture2D19.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - num223 -= (float)(texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; + num223 -= (texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; Vector2 value20 = projectile.Center; - value20 += projectile.velocity * projectile.scale * (float)texture2D19.Height / 2f; + value20 += projectile.velocity * projectile.scale * texture2D19.Height / 2f; if (num223 > 0f) { float num224 = 0f; Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); while (num224 + 1f < num223) { - if (num223 - num224 < (float)rectangle7.Height) + if (num223 - num224 < rectangle7.Height) { rectangle7.Height = (int)(num223 - num224); } - spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2((float)(rectangle7.Width / 2), 0f), projectile.scale, SpriteEffects.None, 0f); - num224 += (float)rectangle7.Height * projectile.scale; - value20 += projectile.velocity * (float)rectangle7.Height * projectile.scale; + spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); + num224 += rectangle7.Height * projectile.scale; + value20 += projectile.velocity * rectangle7.Height * projectile.scale; rectangle7.Y += 16; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { @@ -157,7 +154,7 @@ namespace CalamityMod.Projectiles.Boss { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index 6e48536398..d5c0cd46e0 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/CosmicFlameBurst.cs b/Projectiles/Boss/CosmicFlameBurst.cs index 0146e86a1a..e8ae26ea24 100644 --- a/Projectiles/Boss/CosmicFlameBurst.cs +++ b/Projectiles/Boss/CosmicFlameBurst.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss { if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } projectile.localAI[0] += 1f; @@ -42,7 +43,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 48; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 977e0fc38a..f174260fcc 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index d737512fcd..0369e7a7ab 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -69,9 +69,9 @@ namespace CalamityMod.Projectiles.Boss start = false; } - double deg = (double)projectile.ai[0]; + double deg = projectile.ai[0]; double rad = deg * (Math.PI / 180); - distance += (projectile.ai[1] == 1f ? 2D : 1D); + distance += projectile.ai[1] == 1f ? 2D : 1D; projectile.position.X = startingPosX - (int)(Math.Cos(rad) * distance) - projectile.width / 2; projectile.position.Y = startingPosY - (int)(Math.Sin(rad) * distance) - projectile.height / 2; projectile.ai[0] += 0.5f; diff --git a/Projectiles/Boss/DarkOrb.cs b/Projectiles/Boss/DarkOrb.cs index 4dc786231b..67272b90c9 100644 --- a/Projectiles/Boss/DarkOrb.cs +++ b/Projectiles/Boss/DarkOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Boss/DestroyerFrostLaser.cs b/Projectiles/Boss/DestroyerFrostLaser.cs index 02ea888bdb..8e3e06ec70 100644 --- a/Projectiles/Boss/DestroyerFrostLaser.cs +++ b/Projectiles/Boss/DestroyerFrostLaser.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Boss { - public class DestroyerFrostLaser : ModProjectile + public class DestroyerFrostLaser : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/DestroyerHomingLaser.cs b/Projectiles/Boss/DestroyerHomingLaser.cs index 4a12062637..b1fa30dc76 100644 --- a/Projectiles/Boss/DestroyerHomingLaser.cs +++ b/Projectiles/Boss/DestroyerHomingLaser.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -48,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss } if (projectile.localAI[1] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); } projectile.localAI[1] += 1f; if (projectile.localAI[1] >= 180f) diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 2c74d10bcc..0a9f97b793 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -38,18 +39,43 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - projectile.velocity *= 0.985f; if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); } - int num8 = Main.expertMode ? 45 : 60; - if (projectile.timeLeft == 935) - projectile.damage = num8; + if (projectile.timeLeft < 85) projectile.damage = 0; - } + + if (projectile.timeLeft < 930) + return; + + float velocity = 0.1f; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].active) + { + if (i != projectile.whoAmI && Main.projectile[i].type == projectile.type) + { + if (Vector2.Distance(projectile.Center, Main.projectile[i].Center) < 48f) + { + if (projectile.position.X < Main.projectile[i].position.X) + projectile.velocity.X -= velocity; + else + projectile.velocity.X += velocity; + + if (projectile.position.Y < Main.projectile[i].position.Y) + projectile.velocity.Y -= velocity; + else + projectile.velocity.Y += velocity; + } + else + projectile.velocity = Vector2.Zero; + } + } + } + } public override bool CanHitPlayer(Player target) { @@ -66,25 +92,25 @@ namespace CalamityMod.Projectiles.Boss { projectile.localAI[1] += 1f; byte b2 = (byte)(((int)projectile.localAI[1]) * 3); - byte a2 = (byte)((float)projectile.alpha * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); + byte a2 = (byte)(projectile.alpha * (b2 / 255f)); + return new Color(b2, b2, b2, a2); } if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); - byte a2 = (byte)((float)projectile.alpha * ((float)b2 / 255f)); - return new Color((int)b2, (int)b2, (int)b2, (int)a2); + byte a2 = (byte)(projectile.alpha * (b2 / 255f)); + return new Color(b2, b2, b2, a2); } return new Color(255, 255, 255, projectile.alpha); } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 96; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); @@ -92,7 +118,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 60; num623++) diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index da22da8ed5..2a4bac8ce4 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index c734564014..844466f5c0 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -1,8 +1,9 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -54,7 +55,7 @@ namespace CalamityMod.Projectiles.Boss beamTimer--; if (beamTimer <= 0) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 33); + Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); float spread = 30f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -103,7 +104,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); + Main.PlaySound(SoundID.Item92, (int)projectile.Center.X, (int)projectile.Center.Y); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 5ed2ab0d7c..2d2e932d33 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index af7ab54a02..f93343d7cc 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.Center.X, (int)projectile.Center.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/DoGNebulaShot.cs b/Projectiles/Boss/DoGNebulaShot.cs index 628660c0cd..5c1e55803b 100644 --- a/Projectiles/Boss/DoGNebulaShot.cs +++ b/Projectiles/Boss/DoGNebulaShot.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[0] == 0f) { projectile.ai[0] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + Main.PlaySound(SoundID.Item12, (int)projectile.Center.X, (int)projectile.Center.Y); } if (projectile.alpha > 0) { diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index e37f080997..72cee558a4 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/Flare.cs b/Projectiles/Boss/Flare.cs index db2d60410e..f0795219c9 100644 --- a/Projectiles/Boss/Flare.cs +++ b/Projectiles/Boss/Flare.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Boss projectile.alpha = 255; projectile.penetrate = -1; projectile.timeLeft = 600; + projectile.extraUpdates = 1; } public override void SendExtraAI(BinaryWriter writer) @@ -59,6 +60,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[0] += 1f; num632 = (float)(Math.Cos((double)(num630 * projectile.ai[0])) - 0.5) * num631; projectile.velocity.Y = projectile.velocity.Y + num632; + projectile.localAI[0] += 1f; if (projectile.localAI[0] > 10f) { @@ -90,7 +92,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index ba6d98b64e..7313b29f6e 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -1,7 +1,8 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ignoreWater = true; projectile.penetrate = 1; projectile.alpha = 50; - projectile.timeLeft = 600; + projectile.timeLeft = 180; cooldownSlot = 1; } @@ -40,8 +41,15 @@ namespace CalamityMod.Projectiles.Boss projectile.frame = 0; } Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f); - float num953 = revenge ? 110f : 100f; //100 - float scaleFactor12 = revenge ? 27f : 25f; //5 + float num953 = revenge ? 110f : 100f; + float scaleFactor12 = revenge ? 35f : 30f; + + if (projectile.ai[1] == 1f) + { + num953 *= 0.7f; + scaleFactor12 *= 0.7f; + } + float num954 = 40f; if (projectile.timeLeft > 30 && projectile.alpha > 0) { @@ -127,13 +135,13 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 48; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.Damage(); - for (int num621 = 0; num621 < 5; num621++) + for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; @@ -143,7 +151,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 8; num623++) + for (int num623 = 0; num623 < 5; num623++) { int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 981e2a4bf9..1505a5b87a 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -1,12 +1,20 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { public class FlareDust : ModProjectile { - public override void SetStaticDefaults() + private bool start = true; + private float startingPosX = 0f; + private float startingPosY = 0f; + private double distance = 0D; + + public override void SetStaticDefaults() { DisplayName.SetDefault("Flare Dust"); Main.projFrames[projectile.type] = 4; @@ -21,11 +29,29 @@ namespace CalamityMod.Projectiles.Boss projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.timeLeft = 120; + projectile.timeLeft = 560; cooldownSlot = 1; } - public override void AI() + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + writer.Write(start); + writer.Write(startingPosX); + writer.Write(startingPosY); + writer.Write(distance); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + start = reader.ReadBoolean(); + startingPosX = reader.ReadSingle(); + startingPosY = reader.ReadSingle(); + distance = reader.ReadDouble(); + } + + public override void AI() { projectile.frameCounter++; if (projectile.frameCounter > 4) @@ -37,9 +63,45 @@ namespace CalamityMod.Projectiles.Boss { projectile.frame = 0; } - projectile.velocity *= 0.975f; + Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f); - } + + if (projectile.ai[0] == 2f) + return; + + if (start) + { + startingPosX = projectile.Center.X; + startingPosY = projectile.Center.Y; + start = false; + } + + double rad = MathHelper.ToRadians(projectile.ai[1]); + + float amount = projectile.localAI[0] / 120f; + if (amount > 1f) + amount = 1f; + + distance += MathHelper.Lerp(1f, 9f, amount); + + int timeGateValue = 180; + if (projectile.timeLeft < timeGateValue) + distance += 6f; + + if (projectile.ai[0] == 0f) + { + projectile.position.X = startingPosX - (int)(Math.Sin(rad) * distance) - projectile.width / 2; + projectile.position.Y = startingPosY - (int)(Math.Cos(rad) * distance) - projectile.height / 2; + } + else + { + projectile.position.X = startingPosX - (int)(Math.Cos(rad) * distance) - projectile.width / 2; + projectile.position.Y = startingPosY - (int)(Math.Sin(rad) * distance) - projectile.height / 2; + } + + projectile.ai[1] += (1.1f - amount) * 0.5f; + projectile.localAI[0] += 1f; + } public override Color? GetAlpha(Color lightColor) { @@ -57,12 +119,12 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; - projectile.width = projectile.height = 80; + projectile.width = projectile.height = 48; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + for (int num621 = 0; num621 < 2; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; @@ -72,7 +134,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 8; num623++) + for (int num623 = 0; num623 < 4; num623++) { int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 1ca8c24acd..07450c1ee3 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -1,13 +1,18 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { public class FlareDust2 : ModProjectile { - public override void SetStaticDefaults() + private bool start = true; + private Vector2 velocity = Vector2.Zero; + + public override void SetStaticDefaults() { DisplayName.SetDefault("Flare Bomb"); Main.projFrames[projectile.type] = 4; @@ -26,7 +31,19 @@ namespace CalamityMod.Projectiles.Boss cooldownSlot = 1; } - public override void AI() + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(start); + writer.WriteVector2(velocity); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + start = reader.ReadBoolean(); + velocity = reader.ReadVector2(); + } + + public override void AI() { projectile.frameCounter++; if (projectile.frameCounter > 4) @@ -38,20 +55,60 @@ namespace CalamityMod.Projectiles.Boss { projectile.frame = 0; } + if (projectile.ai[0] == 1f) { - if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 8f && projectile.timeLeft < 630) - { - projectile.velocity *= 1.025f; - } + if (projectile.timeLeft < 630) + { + if (projectile.velocity.Length() < 6f) + { + projectile.velocity *= 1.025f; + } + else + { + if (start) + { + velocity = projectile.velocity; + start = false; + } + + projectile.ai[1] += 0.1f; + + float amplitude = 2f; + + float wavyVelocity = (float)Math.Cos(projectile.ai[1]); + + projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude; + } + } } else { - if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 16f && projectile.timeLeft < 420) - { - projectile.velocity *= 1.05f; - } + if (projectile.timeLeft < 420) + { + if (projectile.velocity.Length() < 12f) + { + projectile.velocity *= 1.05f; + } + else + { + if (start) + { + velocity = projectile.velocity; + start = false; + } + + projectile.ai[1] += 0.1f; + + float amplitude = 2f; + + float wavyVelocity = (float)Math.Sin(projectile.ai[1]); + + projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude; + } + } } + Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f); } @@ -71,23 +128,23 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 48; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); projectile.Damage(); - for (int num621 = 0; num621 < 5; num621++) + for (int num621 = 0; num621 < 2; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 8; num623++) + for (int num623 = 0; num623 < 4; num623++) { int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].noGravity = true; diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index df018e3556..14b84be335 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index a7620d5d3f..74a0e0b614 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + Main.PlaySound(SoundID.Item30, projectile.position); } projectile.localAI[1] += 1f; if (projectile.localAI[1] == 16f) diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index 2332ebe6f7..ef3482c5ef 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/HealOrbProv.cs b/Projectiles/Boss/HealOrbProv.cs index 14831333a0..a2d6712868 100644 --- a/Projectiles/Boss/HealOrbProv.cs +++ b/Projectiles/Boss/HealOrbProv.cs @@ -1,8 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Boss { @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " burst into sinless ash."), 1000.0, 0, false); } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); } projectile.Kill(); } diff --git a/Projectiles/Boss/HellfireExplosion.cs b/Projectiles/Boss/HellfireExplosion.cs index 8051dbf562..aff72a6587 100644 --- a/Projectiles/Boss/HellfireExplosion.cs +++ b/Projectiles/Boss/HellfireExplosion.cs @@ -1,9 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(projectile.Center, 0.75f, 0f, 0f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 48e0f5f16d..d8caa973cb 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Boss projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 8; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Boss/HolyAura.cs b/Projectiles/Boss/HolyAura.cs new file mode 100644 index 0000000000..6b0ab9cac2 --- /dev/null +++ b/Projectiles/Boss/HolyAura.cs @@ -0,0 +1,110 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class HolyAura : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Holy Aura"); + } + + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.hostile = true; + projectile.aiStyle = -1; + aiType = -1; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 210; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D value = Main.projectileTexture[projectile.type]; + Vector2 origin = value.Size() / 2f; + float num = Main.GlobalTime % 10f / 10f; + Vector2 value2 = projectile.Center - Main.screenPosition; + float[] array = new float[15]; + float[] array2 = new float[15]; + float[] array3 = new float[15]; + float[] array4 = new float[15]; + float num2 = 0.5f; + int num3 = 210; + num2 = CalamityUtils.GetLerpValue(0f, 60f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(num3, num3 - 60, projectile.timeLeft, clamped: true); + float amount = CalamityUtils.GetLerpValue(0f, 60f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(num3, 90f, projectile.timeLeft, clamped: true); + amount = CalamityUtils.GetLerpValue(0.2f, 0.5f, amount, clamped: true); + float num4 = 800f / value.Width; + float num5 = num4 * 0.8f; + float num6 = (num4 - num5) / 15f; + float num7 = 30f; + float num8 = 300f; + Vector2 value3 = new Vector2(6f, 6f); + + for (int i = 0; i < 15; i++) + { + float num9 = (float)Math.Sin(num * ((float)Math.PI * 2f) + (float)Math.PI / 2f + i / 2f); + + array[i] = num9 * (num8 - i * 3f); + + array2[i] = (float)Math.Sin(num * ((float)Math.PI * 2f) * 2f + (float)Math.PI / 3f + i) * num7; + array2[i] -= i * 3f; + + array3[i] = i / 15f * 2f + num; + array3[i] = (num9 * 0.5f + 0.5f) * 0.6f + num; + + array4[i] = num5 + (i + 1) * num6; + array4[i] *= 0.3f; + + Color color = Main.hslToRgb(array3[i] % 1f, 1f, 0.5f) * num2 * amount; + + bool underworld = projectile.ai[0] == 2f; + if (Main.dayTime) + { + color.R = 255; + if (underworld) + color.B = 0; + } + else + { + color.B = 255; + if (underworld) + color.G = 0; + else + color.R = 0; + } + + color.A /= 4; + + int fadeTime = 30; + if (projectile.timeLeft < fadeTime) + { + float amount2 = projectile.timeLeft / (float)fadeTime; + + if (color.R > 0) + color.R = (byte)MathHelper.Lerp(0, color.R, amount2); + if (color.G > 0) + color.G = (byte)MathHelper.Lerp(0, color.G, amount2); + if (color.B > 0) + color.B = (byte)MathHelper.Lerp(0, color.B, amount2); + + color.A = (byte)MathHelper.Lerp(0, color.A, amount2); + } + + float rotation = (float)Math.PI / 2f + num9 * ((float)Math.PI / 4f) * -0.3f + (float)Math.PI * i; + + spriteBatch.Draw(value, value2 + new Vector2(array[i], array2[i]), null, color, rotation, origin, new Vector2(array4[i], array4[i]) * value3, SpriteEffects.None, 0); + } + + return false; + } + } +} diff --git a/Projectiles/Boss/HolyAura.png b/Projectiles/Boss/HolyAura.png new file mode 100644 index 0000000000..4254c6a1d5 Binary files /dev/null and b/Projectiles/Boss/HolyAura.png differ diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index ed3b4d113f..abce937794 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -42,44 +44,45 @@ namespace CalamityMod.Projectiles.Boss } if (projectile.ai[1] == 0f) { - for (int num621 = 0; num621 < 10; num621++) + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2) { projectile.spriteDirection = -projectile.direction; } if (projectile.velocity.X < 0f) { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X); } else { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X); } } public override Color? GetAlpha(Color lightColor) { - return new Color(250, 150, 0, projectile.alpha); + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyBlastNight"); int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } @@ -100,17 +103,18 @@ namespace CalamityMod.Projectiles.Boss Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, 0f, Main.myPlayer, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.Center); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 6; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 60; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } @@ -118,8 +122,9 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 240); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 240); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolyBlastNight.png b/Projectiles/Boss/HolyBlastNight.png new file mode 100644 index 0000000000..cd5a260342 Binary files /dev/null and b/Projectiles/Boss/HolyBlastNight.png differ diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 68fb95bf5b..d11ae92d40 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -43,13 +45,13 @@ namespace CalamityMod.Projectiles.Boss flareShootTimer--; if (flareShootTimer <= 0) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.Center); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -2f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); @@ -59,7 +61,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.Center); } projectile.velocity *= 0.975f; projectile.frameCounter++; @@ -74,39 +76,40 @@ namespace CalamityMod.Projectiles.Boss } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyBombNight"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.Center); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 150; projectile.height = 150; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num193 = 0; num193 < 3; num193++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num193 = 0; num193 < 3; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 30; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } @@ -114,8 +117,9 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 180); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 180); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolyBombNight.png b/Projectiles/Boss/HolyBombNight.png new file mode 100644 index 0000000000..90ce1f0516 Binary files /dev/null and b/Projectiles/Boss/HolyBombNight.png differ diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 2cea35d476..920c6f23d6 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -1,10 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Boss { public class HolyBurnOrb : ModProjectile @@ -12,48 +16,46 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Holy Orb"); - Main.projFrames[projectile.type] = 4; } public override void SetDefaults() { - projectile.width = 20; - projectile.height = 20; - projectile.scale = 1.5f; + projectile.width = 30; + projectile.height = 30; projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; + projectile.alpha = 255; projectile.penetrate = 1; - projectile.timeLeft = 240; + projectile.timeLeft = 200; } public override void AI() { - bool expertMode = Main.expertMode; - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - projectile.velocity.X *= 1.01f; - projectile.velocity.Y *= 1.01f; - int num487 = (int)Player.FindClosest(projectile.position, projectile.width, projectile.height); - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + if (projectile.ai[0] < 80f) + { + projectile.ai[0] += 1f; + + if (projectile.timeLeft < 160) + projectile.timeLeft = 160; + } + + bool expertMode = Main.expertMode; + projectile.velocity *= 1.01f; + int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height); + Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num489 = Main.player[num487].Center.X - vector36.X; float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) + float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490); + + if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) { int num492 = expertMode ? -150 : -100; if (CalamityWorld.death || CalamityWorld.bossRushActive) - { num492 = -200; - } + if (!Main.dayTime) + num492 = -300; + Main.player[num487].HealEffect(num492, false); Main.player[num487].statLife += num492; if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) @@ -64,48 +66,81 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " burst into sinless ash."), 1000.0, 0, false); } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0); projectile.Kill(); } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D value = Main.projectileTexture[projectile.type]; + Color baseColor = Main.dayTime ? new Color(255, 200, 100, 255) : new Color(100, 200, 255, 255); + Color color33 = baseColor * 0.5f; + color33.A = 0; + Vector2 vector28 = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color color34 = color33; + Vector2 origin5 = value.Size() / 2f; + Color color35 = color33 * 0.5f; + float num162 = CalamityUtils.GetLerpValue(15f, 30f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(240f, 200f, projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f; + Vector2 vector29 = new Vector2(0.5f, 1.5f) * num162; + Vector2 vector30 = new Vector2(0.5f, 1.5f) * num162; + color34 *= num162; + color35 *= num162; - public override void Kill(int timeLeft) + int num163 = 0; + Vector2 position3 = vector28 + projectile.velocity.SafeNormalize(Vector2.Zero) * CalamityUtils.GetLerpValue(0.5f, 1f, projectile.localAI[0] / 60f, clamped: true) * num163; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver2, origin5, vector29, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color34, 0f, origin5, vector30, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver2, origin5, vector29 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, 0f, origin5, vector30 * 0.6f, spriteEffects, 0); + + spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4, origin5, vector29 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4, origin5, vector29 * 0.36f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.36f, spriteEffects, 0); + + return false; + } + + public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item14, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 50; projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 60); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 60); + } } } diff --git a/Projectiles/Boss/HolyBurnOrb.png b/Projectiles/Boss/HolyBurnOrb.png index 385e7d67b1..0968156e79 100644 Binary files a/Projectiles/Boss/HolyBurnOrb.png and b/Projectiles/Boss/HolyBurnOrb.png differ diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 72d254ee98..2708403b29 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -1,7 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -31,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); } projectile.alpha -= 5; if (projectile.alpha <= 0) @@ -50,17 +52,17 @@ namespace CalamityMod.Projectiles.Boss } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFireNight"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } @@ -83,34 +85,36 @@ namespace CalamityMod.Projectiles.Boss Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, -0.05f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 150; projectile.height = 150; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); } } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 120); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index ccb584388f..a913902aa2 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -42,7 +44,7 @@ namespace CalamityMod.Projectiles.Boss { projectile.velocity.X *= 1.05f; } - int num103 = (int)Player.FindClosest(projectile.Center, 1, 1); + int num103 = Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; if (projectile.ai[1] < 180f && projectile.ai[1] > 60f) { @@ -56,50 +58,52 @@ namespace CalamityMod.Projectiles.Boss } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFire2"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 150; projectile.height = 150; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); } } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 120); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolyFire2Night.png b/Projectiles/Boss/HolyFire2Night.png new file mode 100644 index 0000000000..605203c3bb Binary files /dev/null and b/Projectiles/Boss/HolyFire2Night.png differ diff --git a/Projectiles/Boss/HolyFireNight.png b/Projectiles/Boss/HolyFireNight.png new file mode 100644 index 0000000000..6a2c0038d6 Binary files /dev/null and b/Projectiles/Boss/HolyFireNight.png differ diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 30459eb9fe..541ad69c39 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -1,7 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -39,19 +41,19 @@ namespace CalamityMod.Projectiles.Boss if (projectile.frame > 3) projectile.frame = 0; - float velocityY = projectile.position.Y + (float)projectile.height < player.position.Y ? 1f : 0.25f; + float velocityY = projectile.position.Y + projectile.height < player.position.Y ? 1f : 0.25f; projectile.velocity.Y += 0.01f; if (projectile.velocity.Y > velocityY) projectile.velocity.Y = velocityY; - if (projectile.position.X + (float)projectile.width < player.position.X) + if (projectile.position.X + projectile.width < player.position.X) { if (projectile.velocity.X < 0f) projectile.velocity.X *= 0.99f; projectile.velocity.X += 0.02f; } - else if (projectile.position.X > player.position.X + (float)player.width) + else if (projectile.position.X > player.position.X + player.width) { if (projectile.velocity.X > 0f) projectile.velocity.X *= 0.99f; @@ -64,50 +66,52 @@ namespace CalamityMod.Projectiles.Boss projectile.rotation = projectile.velocity.X * 0.025f; } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFlareNight"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 50; projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); } } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 120); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolyFlareNight.png b/Projectiles/Boss/HolyFlareNight.png new file mode 100644 index 0000000000..950f6775e8 Binary files /dev/null and b/Projectiles/Boss/HolyFlareNight.png differ diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 41fbdcc170..a43f292c80 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -1,7 +1,10 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Boss { public class HolyLight : ModProjectile @@ -9,7 +12,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Holy Light"); - Main.projFrames[projectile.type] = 4; } public override void SetDefaults() @@ -19,31 +21,29 @@ namespace CalamityMod.Projectiles.Boss projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; + projectile.alpha = 255; projectile.penetrate = 1; - projectile.timeLeft = 240; + projectile.timeLeft = 200; } public override void AI() { - bool expertMode = Main.expertMode; - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - projectile.velocity.X *= 1.01f; - projectile.velocity.Y *= 1.01f; - int num487 = (int)Player.FindClosest(projectile.position, projectile.width, projectile.height); - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + if (projectile.ai[0] < 80f) + { + projectile.ai[0] += 1f; + + if (projectile.timeLeft < 160) + projectile.timeLeft = 160; + } + + bool expertMode = Main.expertMode; + projectile.velocity *= 1.01f; + int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height); + Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); float num489 = Main.player[num487].Center.X - vector36.X; float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) + float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490); + if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) { int num492 = expertMode ? 50 : 35; Main.player[num487].HealEffect(num492, false); @@ -52,25 +52,56 @@ namespace CalamityMod.Projectiles.Boss { Main.player[num487].statLife = Main.player[num487].statLifeMax2; } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0); projectile.Kill(); } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(150, 255, 0, projectile.alpha); - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D value = Main.projectileTexture[projectile.type]; + Color baseColor = new Color(100, 255, 100, 255); + Color color33 = baseColor * 0.5f; + color33.A = 0; + Vector2 vector28 = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color color34 = color33; + Vector2 origin5 = value.Size() / 2f; + Color color35 = color33 * 0.5f; + float num162 = CalamityUtils.GetLerpValue(15f, 30f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(240f, 200f, projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f; + Vector2 vector29 = new Vector2(0.5f, 1f) * num162; + Vector2 vector30 = new Vector2(0.5f, 1f) * num162; + color34 *= num162; + color35 *= num162; - public override void Kill(int timeLeft) + int num163 = 0; + Vector2 position3 = vector28 + projectile.velocity.SafeNormalize(Vector2.Zero) * CalamityUtils.GetLerpValue(0.5f, 1f, projectile.localAI[0] / 60f, clamped: true) * num163; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(value, position3, null, color34, (float)Math.PI / 2f, origin5, vector29, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color34, 0f, origin5, vector30, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, (float)Math.PI / 2f, origin5, vector29 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, 0f, origin5, vector30 * 0.6f, spriteEffects, 0); + + spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4, origin5, vector29 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4, origin5, vector29 * 0.36f, spriteEffects, 0); + spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.36f, spriteEffects, 0); + + return false; + } + + public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item14, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 50; projectile.height = 50; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f); @@ -78,7 +109,7 @@ namespace CalamityMod.Projectiles.Boss if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 15; num623++) diff --git a/Projectiles/Boss/HolyLight.png b/Projectiles/Boss/HolyLight.png index 5df586c460..0968156e79 100644 Binary files a/Projectiles/Boss/HolyLight.png and b/Projectiles/Boss/HolyLight.png differ diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 6fbae0083b..7eb1df79a1 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -6,9 +6,10 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { - public class HolySpear : ModProjectile + public class HolySpear : ModProjectile { Vector2 velocity = Vector2.Zero; @@ -27,8 +28,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.alpha = 100; - projectile.timeLeft = 900; + projectile.timeLeft = 200; cooldownSlot = 1; } @@ -51,7 +51,6 @@ namespace CalamityMod.Projectiles.Boss if (projectile.localAI[0] == 0f) { projectile.localAI[0] = 1f; - Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, projectile.Center); if (projectile.ai[0] == 1f) velocity = projectile.velocity; @@ -65,21 +64,30 @@ namespace CalamityMod.Projectiles.Boss float fastGateValue = 30f; float minVelocity = 3f; float maxVelocity = 12f; + float extremeVelocity = 16f; float deceleration = 0.95f; float acceleration = 1.2f; - if (projectile.ai[1] <= slowGateValue) + if (projectile.localAI[1] > 480f) { - if (projectile.velocity.Length() > minVelocity) - projectile.velocity *= deceleration; - } - else if (projectile.ai[1] < slowGateValue + fastGateValue) - { - if (projectile.velocity.Length() < maxVelocity) + if (projectile.velocity.Length() < extremeVelocity) projectile.velocity *= acceleration; } else - projectile.ai[1] = 0f; + { + if (projectile.ai[1] <= slowGateValue) + { + if (projectile.velocity.Length() > minVelocity) + projectile.velocity *= deceleration; + } + else if (projectile.ai[1] < slowGateValue + fastGateValue) + { + if (projectile.velocity.Length() < maxVelocity) + projectile.velocity *= acceleration; + } + else + projectile.ai[1] = 0f; + } } else { @@ -93,37 +101,77 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity).RotatedBy(MathHelper.ToRadians(velocity.ToRotation())) * amplitude; } - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - } + if (projectile.localAI[1] < 540f) + { + projectile.localAI[1] += 1f; - public override Color? GetAlpha(Color lightColor) - { - if (projectile.timeLeft > 883) - { - projectile.localAI[1] += 5f; - byte b2 = (byte)(((int)projectile.localAI[1]) * 3); - byte a2 = (byte)(projectile.alpha * (b2 / 255f)); - return new Color(b2, b2, b2, a2); - } - if (projectile.timeLeft < 85) - { - byte b2 = (byte)(projectile.timeLeft * 3); - byte a2 = (byte)(projectile.alpha * (b2 / 255f)); - return new Color(b2, b2, b2, a2); - } - return new Color(255, 255, 255, projectile.alpha); + if (projectile.timeLeft < 160) + projectile.timeLeft = 160; + } + + projectile.Opacity = MathHelper.Lerp(240f, 220f, projectile.timeLeft); + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; + Texture2D value = Main.projectileTexture[projectile.type]; + int green = projectile.ai[0] != 0f ? 255 : 125; + int blue = projectile.ai[0] != 0f ? 0 : 125; + Color baseColor = new Color(255, green, blue, 255); + + if (!Main.dayTime) + { + int red = projectile.ai[0] != 0f ? 100 : 175; + green = projectile.ai[0] != 0f ? 255 : 175; + baseColor = new Color(red, green, 255, 255); + } + + Color color33 = baseColor * 0.5f; + color33.A = 0; + Vector2 vector28 = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color color34 = color33; + Vector2 origin5 = value.Size() / 2f; + Color color35 = color33 * 0.5f; + float num162 = CalamityUtils.GetLerpValue(15f, 30f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(240f, 200f, projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f; + Vector2 vector29 = new Vector2(1f, 1.5f) * num162; + Vector2 vector30 = new Vector2(0.5f, 1f) * num162; + color34 *= num162; + color35 *= num162; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + if (CalamityConfig.Instance.Afterimages) + { + for (int i = 0; i < projectile.oldPos.Length; i++) + { + Vector2 drawPos = projectile.oldPos[i] + vector28; + Color color = projectile.GetAlpha(color34) * ((projectile.oldPos.Length - i) / projectile.oldPos.Length); + Main.spriteBatch.Draw(value, drawPos, null, color, projectile.rotation, origin5, vector29, spriteEffects, 0f); + Main.spriteBatch.Draw(value, drawPos, null, color, projectile.rotation, origin5, vector30, spriteEffects, 0f); + + color = projectile.GetAlpha(color35) * ((projectile.oldPos.Length - i) / projectile.oldPos.Length); + Main.spriteBatch.Draw(value, drawPos, null, color, projectile.rotation, origin5, vector29 * 0.6f, spriteEffects, 0f); + Main.spriteBatch.Draw(value, drawPos, null, color, projectile.rotation, origin5, vector30 * 0.6f, spriteEffects, 0f); + } + } + + spriteBatch.Draw(value, vector28, null, color34, projectile.rotation, origin5, vector29, spriteEffects, 0); + spriteBatch.Draw(value, vector28, null, color34, projectile.rotation, origin5, vector30, spriteEffects, 0); + spriteBatch.Draw(value, vector28, null, color35, projectile.rotation, origin5, vector29 * 0.6f, spriteEffects, 0); + spriteBatch.Draw(value, vector28, null, color35, projectile.rotation, origin5, vector30 * 0.6f, spriteEffects, 0); + + return false; } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 120); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 120); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/HolySpear.png b/Projectiles/Boss/HolySpear.png index e64b5053e6..c1e6c2161d 100644 Binary files a/Projectiles/Boss/HolySpear.png and b/Projectiles/Boss/HolySpear.png differ diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index 361da94387..fa151dc770 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index 78823307d6..bab1c3acbd 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using System; using Terraria; using Terraria.ID; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0.01f, 0.25f, 0.25f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); float spread = 60f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index 86e93a70ad..3aa809f122 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 27, 0.25f); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 27, 0.25f); for (int num373 = 0; num373 < 3; num373++) { int num374 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 76, 0f, 0f, 0, default, 1f); diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index b0ab5ba3a8..e33da37af9 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 9b3252ef6f..8a2fca38b2 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index da7f460967..891030de8f 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index ac365efa49..ffa2e253ae 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/JewelProjectile.cs b/Projectiles/Boss/JewelProjectile.cs index 85cf65a83a..ef72f0b9ce 100644 --- a/Projectiles/Boss/JewelProjectile.cs +++ b/Projectiles/Boss/JewelProjectile.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); for (int index1 = 0; index1 < 15; ++index1) { int ruby = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, projectile.oldVelocity.X, projectile.oldVelocity.Y, 50, new Color(), 1.2f); diff --git a/Projectiles/Boss/LeviathanBomb.cs b/Projectiles/Boss/LeviathanBomb.cs index e59d739ffd..ef87549899 100644 --- a/Projectiles/Boss/LeviathanBomb.cs +++ b/Projectiles/Boss/LeviathanBomb.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); } projectile.localAI[0] += 1f; if (projectile.localAI[0] == 12f) @@ -65,7 +66,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.Damage(); for (int num621 = 0; num621 < 20; num621++) { diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 8224f79da3..c22cb912a6 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -1,9 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -51,20 +53,22 @@ namespace CalamityMod.Projectiles.Boss { projectile.Kill(); } - if (projectile.ai[1] == 0f) + + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + if (projectile.ai[1] == 0f) { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); } projectile.localAI[0] += 1f; if (projectile.localAI[0] == 30f) @@ -72,10 +76,10 @@ namespace CalamityMod.Projectiles.Boss projectile.localAI[0] = 0f; for (int l = 0; l < 12; l++) { - Vector2 vector3 = Vector2.UnitX * (float)-(float)projectile.width / 2f; - vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f); - vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default); - int num9 = Dust.NewDust(projectile.Center, 0, 0, 244, 0f, 0f, 160, default, 1f); + Vector2 vector3 = Vector2.UnitX * -projectile.width / 2f; + vector3 += -Vector2.UnitY.RotatedBy(l * 3.14159274f / 6f, default) * new Vector2(8f, 16f); + vector3 = vector3.RotatedBy(projectile.rotation - 1.57079637f, default); + int num9 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1f); Main.dust[num9].scale = 1.1f; Main.dust[num9].noGravity = true; Main.dust[num9].position = projectile.Center + vector3; @@ -83,20 +87,20 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f; } } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/MoltenBlastNight"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } @@ -107,27 +111,29 @@ namespace CalamityMod.Projectiles.Boss { for (int num252 = 0; num252 < num251; num252++) { - Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); while (value15.X == 0f && value15.Y == 0f) { - value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value15 = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); } value15.Normalize(); - value15 *= (float)Main.rand.Next(70, 121) * 0.1f; //70 101 + value15 *= Main.rand.Next(70, 121) * 0.1f; //70 101 Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.Center); + + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 3; num193++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); } for (int num194 = 0; num194 < 30; num194++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f); + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); Main.dust[num195].noGravity = true; Main.dust[num195].velocity *= 3f; - num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f); Main.dust[num195].velocity *= 2f; Main.dust[num195].noGravity = true; } @@ -135,8 +141,9 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 180); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 180); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/MoltenBlastNight.png b/Projectiles/Boss/MoltenBlastNight.png new file mode 100644 index 0000000000..9d9f45141c Binary files /dev/null and b/Projectiles/Boss/MoltenBlastNight.png differ diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index bb33c42184..cbab067719 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -1,6 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -65,41 +68,52 @@ namespace CalamityMod.Projectiles.Boss return false; } - public override Color? GetAlpha(Color lightColor) - { - return new Color(250, 150, 0, projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(100, 200, 250, projectile.alpha); + } - public override void Kill(int timeLeft) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/MoltenBlobNight"); + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.position.X = projectile.position.X + (projectile.width / 2); + projectile.position.Y = projectile.position.Y + (projectile.height / 2); projectile.width = 10; projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 3; num621++) + projectile.position.X = projectile.position.X - (projectile.width / 2); + projectile.position.Y = projectile.position.Y - (projectile.height / 2); + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + for (int num621 = 0; num621 < 3; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } for (int num623 = 0; num623 < 5; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); } } public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 90); - } + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 90); + } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { diff --git a/Projectiles/Boss/MoltenBlobNight.png b/Projectiles/Boss/MoltenBlobNight.png new file mode 100644 index 0000000000..fa915552df Binary files /dev/null and b/Projectiles/Boss/MoltenBlobNight.png differ diff --git a/Projectiles/Boss/MushBomb.cs b/Projectiles/Boss/MushBomb.cs index d14f549908..567f2809bc 100644 --- a/Projectiles/Boss/MushBomb.cs +++ b/Projectiles/Boss/MushBomb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index fc8492233b..244bfa9449 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Boss/Mushmash.cs b/Projectiles/Boss/Mushmash.cs index 396e2a56ef..c18ad09ed6 100644 --- a/Projectiles/Boss/Mushmash.cs +++ b/Projectiles/Boss/Mushmash.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { public class Mushmash : ModProjectile diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index 1c91e308a0..e51fb94960 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -1,16 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class OldDukeGore : ModProjectile + public class OldDukeGore : ModProjectile { public override void SetStaticDefaults() { @@ -62,10 +60,10 @@ namespace CalamityMod.Projectiles.Boss } public override void Kill(int timeLeft) - { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 12); + { + Main.PlaySound(SoundID.NPCDeath12, projectile.position); - int num226 = 8; + int num226 = 8; for (int num227 = 0; num227 < num226; num227++) { Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; diff --git a/Projectiles/Boss/OldDukeSummonDrop.cs b/Projectiles/Boss/OldDukeSummonDrop.cs index 7df94b7a8f..6a1a7b01a1 100644 --- a/Projectiles/Boss/OldDukeSummonDrop.cs +++ b/Projectiles/Boss/OldDukeSummonDrop.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Boss/OldDukeVortex.cs b/Projectiles/Boss/OldDukeVortex.cs index f7fe1385c5..37d32ae461 100644 --- a/Projectiles/Boss/OldDukeVortex.cs +++ b/Projectiles/Boss/OldDukeVortex.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { - public class OldDukeVortex : ModProjectile + public class OldDukeVortex : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs index 27bdabc719..551badccfa 100644 --- a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs +++ b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.NPCs.OldDuke; diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 0b599141d4..e02c601bf0 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -51,12 +51,12 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity.Y = projectile.velocity.Y + 0.035f; } float scaleFactor3 = 22f; - int num189 = (int)Player.FindClosest(projectile.Center, 1, 1); + int num189 = Player.FindClosest(projectile.Center, 1, 1); Vector2 vector20 = Main.player[num189].Center - projectile.Center; vector20.Normalize(); vector20 *= scaleFactor3; int num190 = 80; - projectile.velocity = (projectile.velocity * (float)(num190 - 1) + vector20) / (float)num190; + projectile.velocity = (projectile.velocity * (num190 - 1) + vector20) / num190; if (projectile.velocity.Length() < 14f) { projectile.velocity.Normalize(); @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index d0301057f9..dcd5a44830 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 48b0226b62..bd7c433b0b 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index 48fa03acc9..f7354d7961 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index f2cf472631..a65b2afbba 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 150; diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index bc22e50508..dab69bcdeb 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -27,19 +27,16 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { writer.Write(projectile.localAI[0]); - writer.Write(projectile.localAI[1]); } public override void ReceiveExtraAI(BinaryReader reader) { projectile.localAI[0] = reader.ReadSingle(); - projectile.localAI[1] = reader.ReadSingle(); } public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; - projectile.localAI[1] = -120f; if (projectile.penetrate <= 0) { projectile.Kill(); @@ -65,14 +62,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(SoundID.Item20, projectile.position); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 180f) - { - projectile.localAI[1] = 0f; - projectile.penetrate--; - projectile.velocity *= -1f; - } + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 9f) { @@ -80,7 +70,19 @@ namespace CalamityMod.Projectiles.Boss if (projectile.alpha < 30) projectile.alpha = 30; } - } + if (projectile.localAI[0] > 180f && projectile.localAI[0] < 240f && Main.expertMode) + { + if (projectile.ai[0] == 0f) + projectile.ai[0] = projectile.velocity.Length() * 3f; + + int num189 = Player.FindClosest(projectile.Center, 1, 1); + Vector2 vector20 = Main.player[num189].Center - projectile.Center; + vector20.Normalize(); + vector20 *= projectile.ai[0]; + int num190 = 80; + projectile.velocity = (projectile.velocity * (num190 - 1) + vector20) / num190; + } + } public override Color? GetAlpha(Color lightColor) { diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index 01f54b720a..bc1c3bc122 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -27,19 +27,16 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { writer.Write(projectile.localAI[0]); - writer.Write(projectile.localAI[1]); } public override void ReceiveExtraAI(BinaryReader reader) { projectile.localAI[0] = reader.ReadSingle(); - projectile.localAI[1] = reader.ReadSingle(); } public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; - projectile.localAI[1] -= 105f; if (projectile.penetrate <= 0) { projectile.Kill(); @@ -65,14 +62,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(SoundID.Item20, projectile.position); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 150f) - { - projectile.localAI[1] = 0f; - projectile.penetrate--; - projectile.velocity *= -1f; - } + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; projectile.localAI[0] += 1f; if (projectile.localAI[0] > 9f) { @@ -80,6 +70,18 @@ namespace CalamityMod.Projectiles.Boss if (projectile.alpha < 30) projectile.alpha = 30; } + if (projectile.localAI[0] > 180f && projectile.localAI[0] < 300f && Main.expertMode) + { + if (projectile.ai[0] == 0f) + projectile.ai[0] = projectile.velocity.Length() * 2f; + + int num189 = Player.FindClosest(projectile.Center, 1, 1); + Vector2 vector20 = Main.player[num189].Center - projectile.Center; + vector20.Normalize(); + vector20 *= projectile.ai[0]; + int num190 = 80; + projectile.velocity = (projectile.velocity * (num190 - 1) + vector20) / num190; + } } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/PlagueExplosion.cs b/Projectiles/Boss/PlagueExplosion.cs index c6d3b28710..d96878a30d 100644 --- a/Projectiles/Boss/PlagueExplosion.cs +++ b/Projectiles/Boss/PlagueExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Boss/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index 1049da53db..b7a4a8a5d7 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index e4fe78d9f1..46be68fdc6 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -56,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index ddcfe40e6e..062f25ed52 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index 31238630d7..a1751ddb0b 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -1,18 +1,16 @@ -using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Providence; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { public class ProvidenceCrystal : ModProjectile { - private float speedX = -21f; - private float speedY = -3f; - public override void SetStaticDefaults() { DisplayName.SetDefault("Holy Crystal"); @@ -32,15 +30,11 @@ namespace CalamityMod.Projectiles.Boss public override void SendExtraAI(BinaryWriter writer) { - writer.Write(speedX); - writer.Write(speedY); writer.Write(projectile.localAI[0]); } public override void ReceiveExtraAI(BinaryReader reader) { - speedX = reader.ReadSingle(); - speedY = reader.ReadSingle(); projectile.localAI[0] = reader.ReadSingle(); } @@ -53,8 +47,12 @@ namespace CalamityMod.Projectiles.Boss projectile.netUpdate = true; return; } - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 360f; + + if (!Main.dayTime) + projectile.timeLeft -= CalamityWorld.death ? 9 : 16; + + projectile.position.X = Main.player[projectile.owner].Center.X - (projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (projectile.height / 2) + Main.player[projectile.owner].gfxOffY - 360f; if (Main.player[projectile.owner].gravDir == -1f) { projectile.position.Y = projectile.position.Y + 400f; @@ -64,8 +62,8 @@ namespace CalamityMod.Projectiles.Boss { projectile.rotation = 0f; } - projectile.position.X = (float)(int)projectile.position.X; - projectile.position.Y = (float)(int)projectile.position.Y; + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; projectile.velocity = Vector2.Zero; projectile.alpha -= 5; if (projectile.alpha < 0) @@ -78,29 +76,32 @@ namespace CalamityMod.Projectiles.Boss } if (projectile.alpha == 0 && Main.rand.NextBool(15)) { - Dust dust34 = Main.dust[Dust.NewDust(projectile.Top, 0, 0, 267, 0f, 0f, 100, new Color(255, 200, Main.DiscoB), 1f)]; + Dust dust34 = Main.dust[Dust.NewDust(projectile.Top, 0, 0, 267, 0f, 0f, 100, Main.dayTime ? new Color(255, 200, Main.DiscoB) : new Color(Main.DiscoR, 200, 255), 1f)]; dust34.velocity.X = 0f; dust34.noGravity = true; dust34.fadeIn = 1f; dust34.position = projectile.Center + Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (4f * Main.rand.NextFloat() + 26f); dust34.scale = 0.5f; } + projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 300f) + if (projectile.localAI[0] >= (Main.dayTime ? 300f : 30f)) { projectile.localAI[0] = 0f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + Main.PlaySound(SoundID.Item109, projectile.position); projectile.netUpdate = true; if (projectile.owner == Main.myPlayer) { - for (int num1083 = 0; num1083 < 14; num1083++) + int totalProjectiles = Main.dayTime ? 15 : (projectile.localAI[0] % 60f == 0f ? 15 : 10); + float speedX = Main.dayTime ? -21f : -15f; + float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); + float speedY = -3f; + for (int i = 0; i < totalProjectiles; i++) { - float x4 = Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speedX, speedY, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, x4, (float)projectile.whoAmI); - speedX += 3f; // -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21 + float x4 = Main.dayTime ? Main.rgbToHsl(new Color(255, 200, Main.DiscoB)).X : Main.rgbToHsl(new Color(Main.DiscoR, 200, 255)).X; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speedX + speedAdjustment * i, speedY, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, x4, projectile.whoAmI); } } - speedX = -21f; } } @@ -111,16 +112,16 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); - Vector2 vector59 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Color color25 = Lighting.GetColor((int)(projectile.position.X + projectile.width * 0.5) / 16, (int)((projectile.position.Y + projectile.height * 0.5) / 16.0)); + Vector2 vector59 = projectile.position + new Vector2(projectile.width, projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; Texture2D texture2D34 = Main.projectileTexture[projectile.type]; Rectangle rectangle17 = texture2D34.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); Color alpha5 = projectile.GetAlpha(color25); Vector2 origin11 = rectangle17.Size() / 2f; - float scaleFactor5 = (float)Math.Cos((double)(6.28318548f * (projectile.localAI[0] / 60f))) + 3f + 3f; + float scaleFactor5 = (float)Math.Cos(6.28318548f * (projectile.localAI[0] / 60f)) + 3f + 3f; for (float num286 = 0f; num286 < 4f; num286 += 1f) { - double angle = (double)(num286 * 1.57079637f); + double angle = num286 * 1.57079637f; Vector2 center = default; Main.spriteBatch.Draw(texture2D34, vector59 + Vector2.UnitY.RotatedBy(angle, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); } diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index 390d56b5f2..d95955e4c7 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -1,8 +1,9 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -39,7 +40,10 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if (projectile.timeLeft < 300) + if (!Main.dayTime) + projectile.extraUpdates = 1; + + if (projectile.timeLeft < 300) { projectile.tileCollide = true; } @@ -64,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss else { projectile.velocity.Y *= 1.06f; - float fallSpeed = (CalamityWorld.revenge || CalamityWorld.bossRushActive) ? 3.5f : 3f; + float fallSpeed = (CalamityWorld.revenge || CalamityWorld.bossRushActive || !Main.dayTime) ? 3.5f : 3f; if (projectile.velocity.Y > fallSpeed) { projectile.velocity.Y = fallSpeed; @@ -75,13 +79,13 @@ namespace CalamityMod.Projectiles.Boss projectile.localAI[1] = 1f; projectile.velocity.Y = 0.5f; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) - 1.57f; int num3; for (int num979 = 0; num979 < 2; num979 = num3 + 1) { if (Main.rand.NextBool(10)) { - Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); + Vector2 value55 = Vector2.UnitY.RotatedBy(num979 * 3.14159274f).RotatedBy(projectile.rotation); Dust dust24 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust24.noGravity = true; dust24.noLight = true; @@ -95,7 +99,7 @@ namespace CalamityMod.Projectiles.Boss { if (Main.rand.NextBool(10)) { - Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default); + Vector2 value56 = Vector2.UnitY.RotatedBy(num980 * 3.14159274f); Dust dust25 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; dust25.noGravity = true; dust25.noLight = true; @@ -148,9 +152,9 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(3.1415927410125732); - float num69 = (float)Main.rand.Next(7, 13); + float num69 = Main.rand.Next(7, 13); Vector2 value5 = new Vector2(2.1f, 2f); Color newColor = Main.hslToRgb(projectile.ai[0], 1f, 0.5f); newColor.A = 255; @@ -159,7 +163,7 @@ namespace CalamityMod.Projectiles.Boss { int num71 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num71].position = projectile.Center; - Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num71].velocity = spinningpoint.RotatedBy(6.28318548f * num70 / num69) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Main.dust[num71].noGravity = true; Main.dust[num71].scale = 2f; Main.dust[num71].fadeIn = Main.rand.NextFloat() * 2f; @@ -175,7 +179,7 @@ namespace CalamityMod.Projectiles.Boss { int num74 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); Main.dust[num74].position = projectile.Center; - Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num74].velocity = spinningpoint.RotatedBy(6.28318548f * num73 / num69) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Dust dust = Main.dust[num74]; dust.velocity *= Main.rand.NextFloat() * 0.8f; dust.noGravity = true; diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 45ffa4f0a1..a386704c57 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.NPCs.Providence; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -53,9 +54,9 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[(int)projectile.ai[1]].active && Main.npc[(int)projectile.ai[1]].type == ModContent.NPCType()) { Vector2 value21 = new Vector2(27f, 59f); - Vector2 fireFrom = new Vector2(Main.npc[(int)projectile.ai[1]].Center.X, Main.npc[(int)projectile.ai[1]].Center.Y - 32f); + Vector2 fireFrom = new Vector2(Main.npc[(int)projectile.ai[1]].Center.X, Main.npc[(int)projectile.ai[1]].Center.Y + 32f); Vector2 value22 = Utils.Vector2FromElipse(Main.npc[(int)projectile.ai[1]].localAI[0].ToRotationVector2(), value21 * Main.npc[(int)projectile.ai[1]].localAI[1]); - projectile.position = fireFrom + value22 - new Vector2((float)projectile.width, (float)projectile.height) / 2f; + projectile.position = fireFrom + value22 - new Vector2(projectile.width, projectile.height) / 2f; } if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) @@ -71,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss return; } - projectile.scale = (float)Math.Sin((double)(projectile.localAI[0] * 3.14159274f / ((CalamityWorld.revenge || CalamityWorld.bossRushActive) ? 100f : 180f))) * 10f * num801; + projectile.scale = (float)Math.Sin(projectile.localAI[0] * 3.14159274f / ((CalamityWorld.revenge || CalamityWorld.bossRushActive) ? 100f : 180f)) * 10f * num801; if (projectile.scale > num801) { projectile.scale = num801; @@ -83,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity = num804.ToRotationVector2(); float num805 = 3f; //3f - float num806 = (float)projectile.width; + float num806 = projectile.width; Vector2 samplingPoint = projectile.Center; if (vector78.HasValue) @@ -94,11 +95,9 @@ namespace CalamityMod.Projectiles.Boss float[] array3 = new float[(int)num805]; Collision.LaserScan(samplingPoint, projectile.velocity, num806 * projectile.scale, 2400f, array3); float num807 = 0f; - int num3; - for (int num808 = 0; num808 < array3.Length; num808 = num3 + 1) + for (int num808 = 0; num808 < array3.Length; num808++) { num807 += array3[num808]; - num3 = num808; } num807 /= num805; @@ -108,31 +107,31 @@ namespace CalamityMod.Projectiles.Boss num807 = 2400f; } - float amount = 0.5f; //0.5f + int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; + float amount = 0.5f; //0.5f projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num807, amount); //length of laser, linear interpolation Vector2 vector79 = projectile.Center + projectile.velocity * (projectile.localAI[1] - 14f); - for (int num809 = 0; num809 < 2; num809 = num3 + 1) + for (int num809 = 0; num809 < 2; num809++) { float num810 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * 1.57079637f; float num811 = (float)Main.rand.NextDouble() * 2f + 2f; - Vector2 vector80 = new Vector2((float)Math.Cos((double)num810) * num811, (float)Math.Sin((double)num810) * num811); - int num812 = Dust.NewDust(vector79, 0, 0, 244, vector80.X, vector80.Y, 0, default, 1f); + Vector2 vector80 = new Vector2((float)Math.Cos(num810) * num811, (float)Math.Sin(num810) * num811); + int num812 = Dust.NewDust(vector79, 0, 0, dustType, vector80.X, vector80.Y, 0, default, 1f); Main.dust[num812].noGravity = true; Main.dust[num812].scale = 1.7f; - num3 = num809; } if (Main.rand.NextBool(5)) { - Vector2 value29 = projectile.velocity.RotatedBy(1.5707963705062866, default) * ((float)Main.rand.NextDouble() - 0.5f) * (float)projectile.width; - int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, 244, 0f, 0f, 100, default, 1.5f); + Vector2 value29 = projectile.velocity.RotatedBy(1.5707963705062866, default) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; + int num813 = Dust.NewDust(vector79 + value29 - Vector2.One * 4f, 8, 8, dustType, 0f, 0f, 100, default, 1.5f); Dust dust = Main.dust[num813]; dust.velocity *= 0.5f; Main.dust[num813].velocity.Y = -Math.Abs(Main.dust[num813].velocity.Y); } DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); - Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -141,30 +140,30 @@ namespace CalamityMod.Projectiles.Boss { return false; } - Texture2D texture2D19 = Main.projectileTexture[projectile.type]; - Texture2D texture2D20 = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid"); - Texture2D texture2D21 = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd"); + Texture2D texture2D19 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight"); + Texture2D texture2D20 = Main.dayTime ? ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid") : ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMidNight"); + Texture2D texture2D21 = Main.dayTime ? ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd") : ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight"); float num223 = projectile.localAI[1]; //length of laser - Color color44 = new Color(255, 255, 255, 0) * 0.9f; + Color color44 = Main.dayTime ? new Color(250, 250, 250, 0) : new Color(175, 175, 250, 0) * 0.9f; Vector2 vector = projectile.Center - Main.screenPosition; Rectangle? sourceRectangle2 = null; Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, projectile.rotation, texture2D19.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); - num223 -= (float)(texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; + num223 -= (texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; Vector2 value20 = projectile.Center; - value20 += projectile.velocity * projectile.scale * (float)texture2D19.Height / 2f; + value20 += projectile.velocity * projectile.scale * texture2D19.Height / 2f; if (num223 > 0f) { float num224 = 0f; Rectangle rectangle7 = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture2D20.Width, 16); while (num224 + 1f < num223) { - if (num223 - num224 < (float)rectangle7.Height) + if (num223 - num224 < rectangle7.Height) { rectangle7.Height = (int)(num223 - num224); } - Main.spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color44, projectile.rotation, new Vector2((float)(rectangle7.Width / 2), 0f), projectile.scale, SpriteEffects.None, 0f); - num224 += (float)rectangle7.Height * projectile.scale; - value20 += projectile.velocity * (float)rectangle7.Height * projectile.scale; + Main.spriteBatch.Draw(texture2D20, value20 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color44, projectile.rotation, new Vector2(rectangle7.Width / 2, 0f), projectile.scale, SpriteEffects.None, 0f); + num224 += rectangle7.Height * projectile.scale; + value20 += projectile.velocity * rectangle7.Height * projectile.scale; rectangle7.Y += 16; if (rectangle7.Y + rectangle7.Height > texture2D20.Height) { @@ -182,7 +181,7 @@ namespace CalamityMod.Projectiles.Boss { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; Vector2 unit = projectile.velocity; - Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -201,7 +200,8 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, int damage, bool crit) { - target.AddBuff(ModContent.BuffType(), 300); + int buffType = Main.dayTime ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 300); } public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) diff --git a/Projectiles/Boss/ProvidenceHolyRayNight.png b/Projectiles/Boss/ProvidenceHolyRayNight.png new file mode 100644 index 0000000000..a374d54f3f Binary files /dev/null and b/Projectiles/Boss/ProvidenceHolyRayNight.png differ diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 3642da1765..7bbbeeb4f9 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); } } diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index a53b1b96fb..4087b80d52 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -1,19 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities; namespace CalamityMod.Projectiles.Boss { - public class RedLightning : ModProjectile + public class RedLightning : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index c3ce24c99e..9a7a601c22 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -118,9 +118,9 @@ namespace CalamityMod.Projectiles.Boss } private void EmitDust() - { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 109, 1f, 0f); - for (int num193 = 0; num193 < 6; num193++) + { + Main.PlaySound(SoundID.Item109, projectile.position); + for (int num193 = 0; num193 < 6; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.5f); } diff --git a/Projectiles/Boss/SandBlast.cs b/Projectiles/Boss/SandBlast.cs index f38d82234b..62c780ae9a 100644 --- a/Projectiles/Boss/SandBlast.cs +++ b/Projectiles/Boss/SandBlast.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.ignoreWater = true; projectile.penetrate = 1; - projectile.timeLeft = 300; + projectile.timeLeft = 600; projectile.alpha = 255; } @@ -31,39 +31,39 @@ namespace CalamityMod.Projectiles.Boss { if (projectile.ai[1] == 0f) { - for (int num621 = 0; num621 < 10; num621++) + for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } projectile.ai[1] = 1f; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; projectile.alpha -= 50; if (projectile.alpha < 0) { projectile.alpha = 0; } - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 0.8f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - for (int dust = 0; dust <= 10; dust++) + Main.PlaySound(SoundID.Item14, projectile.position); + for (int dust = 0; dust <= 3; dust++) { - float num463 = (float)Main.rand.Next(-10, 11); - float num464 = (float)Main.rand.Next(-10, 11); - float num465 = (float)Main.rand.Next(3, 9); - float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + float num463 = Main.rand.Next(-10, 11); + float num464 = Main.rand.Next(-10, 11); + float num465 = Main.rand.Next(3, 9); + float num466 = (float)Math.Sqrt(num463 * num463 + num464 * num464); num466 = num465 / num466; num463 *= num466; num464 *= num466; @@ -72,9 +72,9 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num467].position.X = projectile.Center.X; Main.dust[num467].position.Y = projectile.Center.Y; Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); + expr_149DF_cp_0.position.X += Main.rand.Next(-10, 11); Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); + expr_14A09_cp_0.position.Y += Main.rand.Next(-10, 11); Main.dust[num467].velocity.X = num463; Main.dust[num467].velocity.Y = num464; } diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 1e62200597..1c4e00283e 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Boss/SandTooth.cs b/Projectiles/Boss/SandTooth.cs index 2c2143d97d..4accbc05e5 100644 --- a/Projectiles/Boss/SandTooth.cs +++ b/Projectiles/Boss/SandTooth.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Boss/ScavengerLaser.cs b/Projectiles/Boss/ScavengerLaser.cs index 382c825016..d5d713b30a 100644 --- a/Projectiles/Boss/ScavengerLaser.cs +++ b/Projectiles/Boss/ScavengerLaser.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -180,7 +180,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index 102b2ec433..c93b901a56 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -1,7 +1,8 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -95,7 +96,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 160; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index 3c8caf0d39..99f97fd8b6 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { diff --git a/Projectiles/Boss/ShaderainHostile.cs b/Projectiles/Boss/ShaderainHostile.cs index 03211cf64d..ec37178598 100644 --- a/Projectiles/Boss/ShaderainHostile.cs +++ b/Projectiles/Boss/ShaderainHostile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Boss/ShadowflameFireball.cs b/Projectiles/Boss/ShadowflameFireball.cs index ad7d0637d4..05edeffdc7 100644 --- a/Projectiles/Boss/ShadowflameFireball.cs +++ b/Projectiles/Boss/ShadowflameFireball.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Boss/Shadowflamethrower.cs b/Projectiles/Boss/Shadowflamethrower.cs index 12a5a257d7..8fd05b46d6 100644 --- a/Projectiles/Boss/Shadowflamethrower.cs +++ b/Projectiles/Boss/Shadowflamethrower.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index bed8a96238..b367ebcf9b 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, projectile.position); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Boss/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index 990a4ef8d2..8aa5ed76aa 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.IO; using Terraria; using Terraria.ID; diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index da67a400f2..457fdc6e5f 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -1,7 +1,8 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -63,7 +64,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { bool revenge = CalamityWorld.revenge; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 8940726140..7a65e48579 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -52,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index 6444c7a562..e2e5736f50 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; diff --git a/Projectiles/Boss/VileClot.cs b/Projectiles/Boss/VileClot.cs index f575ef347c..f7b5d088ef 100644 --- a/Projectiles/Boss/VileClot.cs +++ b/Projectiles/Boss/VileClot.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Boss/WaterSpear.cs b/Projectiles/Boss/WaterSpear.cs index ee41032925..8d18da7a01 100644 --- a/Projectiles/Boss/WaterSpear.cs +++ b/Projectiles/Boss/WaterSpear.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); } if (projectile.localAI[0] == 0f) { diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index b438b1d8e3..da2eddf87f 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Boss if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int i = 0; i < projectile.oldPos.Length; i++) { diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index c5dc40fb48..ac3295f599 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14, 0.5f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14, 0.5f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 144; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 7f077815ca..321b29d5d5 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; @@ -70,61 +71,21 @@ namespace CalamityMod.Projectiles #region SetDefaults public override void SetDefaults(Projectile projectile) { + if (CalamityMod.trueMeleeProjectileList.Contains(projectile.type)) + trueMelee = true; + switch (projectile.type) { - case ProjectileID.Spear: - case ProjectileID.Trident: - case ProjectileID.TheRottedFork: - case ProjectileID.Swordfish: - case ProjectileID.Arkhalis: - case ProjectileID.DarkLance: - case ProjectileID.CobaltNaginata: - case ProjectileID.PalladiumPike: - case ProjectileID.MythrilHalberd: - case ProjectileID.OrichalcumHalberd: - case ProjectileID.AdamantiteGlaive: - case ProjectileID.TitaniumTrident: - case ProjectileID.MushroomSpear: - case ProjectileID.Gungnir: - case ProjectileID.ObsidianSwordfish: - case ProjectileID.ChlorophytePartisan: - case ProjectileID.MonkStaffT1: - case ProjectileID.MonkStaffT2: - case ProjectileID.MonkStaffT3: - case ProjectileID.NorthPoleWeapon: - - //tools - case ProjectileID.CobaltDrill: - case ProjectileID.MythrilDrill: - case ProjectileID.AdamantiteDrill: - case ProjectileID.PalladiumDrill: - case ProjectileID.OrichalcumDrill: - case ProjectileID.TitaniumDrill: - case ProjectileID.ChlorophyteDrill: - case ProjectileID.CobaltChainsaw: - case ProjectileID.MythrilChainsaw: - case ProjectileID.AdamantiteChainsaw: - case ProjectileID.PalladiumChainsaw: - case ProjectileID.OrichalcumChainsaw: - case ProjectileID.TitaniumChainsaw: - case ProjectileID.ChlorophyteChainsaw: - case ProjectileID.VortexDrill: - case ProjectileID.VortexChainsaw: - case ProjectileID.NebulaDrill: - case ProjectileID.NebulaChainsaw: - case ProjectileID.SolarFlareDrill: - case ProjectileID.SolarFlareChainsaw: - case ProjectileID.StardustDrill: - case ProjectileID.StardustChainsaw: - case ProjectileID.Hamdrax: - case ProjectileID.ChlorophyteJackhammer: - case ProjectileID.SawtoothShark: - case ProjectileID.ButchersChainsaw: - trueMelee = true; - break; case ProjectileID.StarWrath: projectile.penetrate = projectile.maxPenetrate = 1; break; + + case ProjectileID.Spazmamini: + case ProjectileID.Retanimini: + case ProjectileID.MiniRetinaLaser: + projectile.localNPCHitCooldown = 10; + projectile.usesLocalNPCImmunity = true; + break; default: break; } @@ -388,7 +349,7 @@ namespace CalamityMod.Projectiles if (projectile.localAI[0] == 0f) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 104, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 104, 1f, 0f); } float num801 = 1f; @@ -465,7 +426,108 @@ namespace CalamityMod.Projectiles } } } - return true; + + if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses) + { + if (projectile.type == ProjectileID.Sharknado || projectile.type == ProjectileID.Cthulunado) + { + int num520 = 10; + int num521 = 15; + float num522 = 1f; + int num523 = 150; + int num524 = 42; + if (projectile.type == ProjectileID.Cthulunado) + { + num520 = 16; + num521 = 16; + num522 = 1.5f; + } + if (projectile.velocity.X != 0f) + { + projectile.direction = (projectile.spriteDirection = -Math.Sign(projectile.velocity.X)); + } + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 6) + { + projectile.frame = 0; + } + if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner) + { + projectile.localAI[0] = 1f; + projectile.position.X += projectile.width / 2; + projectile.position.Y += projectile.height / 2; + projectile.scale = ((float)(num520 + num521) - projectile.ai[1]) * num522 / (float)(num521 + num520); + projectile.width = (int)((float)num523 * projectile.scale); + projectile.height = (int)((float)num524 * projectile.scale); + projectile.position.X -= projectile.width / 2; + projectile.position.Y -= projectile.height / 2; + projectile.netUpdate = true; + } + if (projectile.ai[1] != -1f) + { + projectile.scale = ((float)(num520 + num521) - projectile.ai[1]) * num522 / (float)(num521 + num520); + projectile.width = (int)((float)num523 * projectile.scale); + projectile.height = (int)((float)num524 * projectile.scale); + } + if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.alpha -= 30; + if (projectile.alpha < 60) + { + projectile.alpha = 60; + } + if (projectile.type == ProjectileID.Cthulunado && projectile.alpha < 100) + { + projectile.alpha = 100; + } + } + else + { + projectile.alpha += 30; + if (projectile.alpha > 150) + { + projectile.alpha = 150; + } + } + if (projectile.ai[0] > 0f) + { + projectile.ai[0] -= 1f; + } + if (projectile.ai[0] == 1f && projectile.ai[1] > 0f && projectile.owner == Main.myPlayer) + { + projectile.netUpdate = true; + Vector2 center2 = projectile.Center; + center2.Y -= (float)num524 * projectile.scale / 2f; + float num525 = ((float)(num520 + num521) - projectile.ai[1] + 1f) * num522 / (float)(num521 + num520); + center2.Y -= (float)num524 * num525 / 2f; + center2.Y += 2f; + Projectile.NewProjectile(center2, projectile.velocity, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 10f, projectile.ai[1] - 1f); + } + if (projectile.ai[0] <= 0f) + { + float num529 = (float)Math.PI / 30f; + float num530 = (float)projectile.width / 5f; + if (projectile.type == ProjectileID.Cthulunado) + { + num530 *= 2f; + } + float num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; + projectile.position.X -= num531 * (float)(-projectile.direction); + projectile.ai[0] -= 1f; + num531 = (float)(Math.Cos(num529 * (-projectile.ai[0])) - 0.5) * num530; + projectile.position.X += num531 * (float)(-projectile.direction); + } + + return false; + } + } + + return true; } #endregion @@ -756,7 +818,7 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - int shard = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 90, (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); + int shard = Projectile.NewProjectile(projectile.oldPosition + projectile.Size * 0.5f, value15, ProjectileID.CrystalShard, (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); Main.projectile[shard].ranged = false; } } @@ -1030,15 +1092,17 @@ namespace CalamityMod.Projectiles int nebulaBooster = Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, boosterType, 1, false, 0, false, false); Main.item[nebulaBooster].velocity.Y = Main.rand.Next(-20, 1) * 0.2f; Main.item[nebulaBooster].velocity.X = Main.rand.Next(10, 31) * 0.2f * projectile.direction; - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(21, -1, -1, null, nebulaBooster, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, nebulaBooster, 0f, 0f, 0f, 0, 0, 0); } } } - if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType()) + if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType() && !player.moonLeech) { + // Commented out for now to test the global life steal nerf + /* // Increases the degree to which Spectre Healing set contributes to the lifesteal cap if (player.ghostHeal) { @@ -1060,6 +1124,7 @@ namespace CalamityMod.Projectiles Main.player[Main.myPlayer].lifeSteal -= num; } + */ if (modPlayer.vampiricTalisman && rogue && crit) { @@ -1175,7 +1240,7 @@ namespace CalamityMod.Projectiles { if (modPlayer.silvaMage && projectile.penetrate == 1 && Main.rand.Next(0, 100) >= 97) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103); projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.position.X -= projectile.width / 2; @@ -1383,13 +1448,14 @@ namespace CalamityMod.Projectiles target.AddBuff(BuffID.Venom, 240); } - if (modPlayer.shadow) + if (modPlayer.shadow && modPlayer.shadowPotCooldown <= 0) { if (CalamityMod.javelinProjList.Contains(projectile.type)) { int randrot = Main.rand.Next(-30, 391); Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); Projectile.NewProjectile(projectile.Center, SoulSpeed, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.1, 60), 3f, projectile.owner, 0f, 0f); + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.spikyBallProjList.Contains(projectile.type)) { @@ -1397,6 +1463,7 @@ namespace CalamityMod.Projectiles Main.projectile[scythe].usesLocalNPCImmunity = true; Main.projectile[scythe].localNPCHitCooldown = 10; Main.projectile[scythe].penetrate = 2; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.daggerProjList.Contains(projectile.type)) { @@ -1405,6 +1472,7 @@ namespace CalamityMod.Projectiles shardVelocity *= 5f; int shard = Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 60), 0f, projectile.owner); Main.projectile[shard].timeLeft = 150; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.boomerangProjList.Contains(projectile.type)) { @@ -1445,11 +1513,13 @@ namespace CalamityMod.Projectiles int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, (float)num3, 0f); Main.projectile[ghost].Calamity().forceRogue = true; Main.projectile[ghost].penetrate = 1; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.flaskBombProjList.Contains(projectile.type)) { int blackhole = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.05, 60), 3f, projectile.owner, 0f, 0f); Main.projectile[blackhole].Center = projectile.Center; + modPlayer.shadowPotCooldown = 30; } } } @@ -1519,8 +1589,8 @@ namespace CalamityMod.Projectiles { if (Main.rand.NextBool(4)) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 100), projectile.knockBack * 0.25f, projectile.owner); - modPlayer.jellyDmg = 20f; + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 90), projectile.knockBack * 0.25f, projectile.owner); + modPlayer.jellyDmg = 25f; } } else if (modPlayer.starbusterCore) @@ -1681,14 +1751,17 @@ namespace CalamityMod.Projectiles int frameHeight = texture.Height / Main.projFrames[projectile.type]; int frameY = frameHeight * projectile.frame; + float scale = projectile.scale; + float rotation = projectile.rotation; - Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); + Vector2 origin = rectangle.Size() / 2f; - SpriteEffects spriteEffects = SpriteEffects.None; + SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { Vector2 centerOffset = drawCentered ? projectile.Size / 2f : Vector2.Zero; switch (trailingMode) @@ -1698,7 +1771,7 @@ namespace CalamityMod.Projectiles { Vector2 drawPos = projectile.oldPos[i] + centerOffset - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - i) / projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, rectangle, color, projectile.rotation, rectangle.Size() / 2f, projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture, drawPos, rectangle, color, rotation, origin, scale, spriteEffects, 0f); } break; @@ -1712,7 +1785,7 @@ namespace CalamityMod.Projectiles color26 = projectile.GetAlpha(color26); float num164 = whyIsThisAlwaysEight - k; color26 *= num164 / (ProjectileID.Sets.TrailCacheLength[projectile.type] * 1.5f); - Main.spriteBatch.Draw(texture, projectile.oldPos[k] + centerOffset - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, color26, projectile.rotation, rectangle.Size() / 2f, projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture, projectile.oldPos[k] + centerOffset - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, color26, rotation, origin, scale, spriteEffects, 0f); k += afterimageCounter; } break; @@ -1724,7 +1797,7 @@ namespace CalamityMod.Projectiles // Draw the projectile itself Vector2 startPos = drawCentered ? projectile.Center : projectile.position; - Main.spriteBatch.Draw(texture, startPos - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, projectile.GetAlpha(lightColor), projectile.rotation, rectangle.Size() / 2f, projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture, startPos - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, projectile.GetAlpha(lightColor), rotation, origin, scale, spriteEffects, 0f); } #endregion @@ -1736,7 +1809,7 @@ namespace CalamityMod.Projectiles { if (modPlayer.providenceLore && projectile.friendly && projectile.damage > 0 && (projectile.melee || projectile.ranged || projectile.magic || rogue)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); for (int dustIndex = 0; dustIndex < 3; dustIndex++) { int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.ProfanedFire, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); @@ -1810,6 +1883,8 @@ namespace CalamityMod.Projectiles public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier) { + if (Main.player[Main.myPlayer].moonLeech) + return; Main.player[Main.myPlayer].lifeSteal -= healAmount * cooldownMultiplier; float num13 = 0f; int num14 = projectile.owner; @@ -1982,182 +2057,20 @@ namespace CalamityMod.Projectiles } } - public static void HealingProjectile(Projectile projectile, int healing, int playerToHeal, float homingVelocity, float N, bool autoHomes = true, int timeCheck = 120) + public static void ExpandHitboxBy(Projectile projectile, int width, int height) { - int target = playerToHeal; - Player player = Main.player[target]; - float homingSpeed = homingVelocity; - if (player.lifeMagnet) - homingSpeed *= 1.5f; - - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = player.Center.X - projPos.X; - float yDist = player.Center.Y - projPos.Y; - Vector2 playerVector = new Vector2(xDist, yDist); - float playerDist = playerVector.Length(); - if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int healAmt = healing; - player.HealEffect(healAmt, false); - player.statLife += healAmt; - if (player.statLife > player.statLifeMax2) - { - player.statLife = player.statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (autoHomes) - { - playerDist = homingSpeed / playerDist; - playerVector.X *= playerDist; - playerVector.Y *= playerDist; - projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); - projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); - } - else if (player.lifeMagnet && projectile.timeLeft < timeCheck) - { - playerDist = homingVelocity / playerDist; - playerVector.X *= playerDist; - playerVector.Y *= playerDist; - projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); - projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); - } + projectile.position = projectile.Center; + projectile.width = width; + projectile.height = height; + projectile.position -= projectile.Size * 0.5f; } - - public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false) + public static void ExpandHitboxBy(Projectile projectile, int newSize) { - Player player = Main.player[projectile.owner]; - - //anti sticking movement as a failsafe - float SAImovement = 0.05f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - bool flag23 = Main.projPet[proj.type]; - if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAImovement; - } - else - { - projectile.velocity.X += SAImovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAImovement; - } - else - { - projectile.velocity.Y += SAImovement; - } - } - } - - float passiveMvtFloat = 0.5f; - projectile.tileCollide = false; - float range = 100f; - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = player.Center.X - projPos.X; - float yDist = player.Center.Y - projPos.Y; - yDist += Main.rand.NextFloat(-10, 20); - xDist += Main.rand.NextFloat(-10, 20); - //Light pets lead the player, normal pets trail the player - xDist += 60f * (lightPet ? (float)player.direction : -(float)player.direction); - yDist -= 60f; - Vector2 playerVector = new Vector2(xDist, yDist); - float playerDist = playerVector.Length(); - float returnSpeed = 18f; - - //If player is close enough, resume normal - if (playerDist < range && player.velocity.Y == 0f && - projectile.position.Y + projectile.height <= player.position.Y + player.height && - !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - if (projectile.velocity.Y < -6f) - { - projectile.velocity.Y = -6f; - } - } - - //Teleport to player if too far - if (playerDist > 2000f) - { - projectile.position.X = player.Center.X - projectile.width / 2; - projectile.position.Y = player.Center.Y - projectile.height / 2; - projectile.netUpdate = true; - } - - if (playerDist < 50f) - { - if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) - { - projectile.velocity *= 0.99f; - } - passiveMvtFloat = 0.01f; - } - else - { - if (playerDist < 100f) - { - passiveMvtFloat = 0.1f; - } - if (playerDist > 300f) - { - passiveMvtFloat = 1f; - } - playerDist = returnSpeed / playerDist; - playerVector.X *= playerDist; - playerVector.Y *= playerDist; - } - if (projectile.velocity.X < playerVector.X) - { - projectile.velocity.X += passiveMvtFloat; - if (passiveMvtFloat > 0.05f && projectile.velocity.X < 0f) - { - projectile.velocity.X += passiveMvtFloat; - } - } - if (projectile.velocity.X > playerVector.X) - { - projectile.velocity.X -= passiveMvtFloat; - if (passiveMvtFloat > 0.05f && projectile.velocity.X > 0f) - { - projectile.velocity.X -= passiveMvtFloat; - } - } - if (projectile.velocity.Y < playerVector.Y) - { - projectile.velocity.Y += passiveMvtFloat; - if (passiveMvtFloat > 0.05f && projectile.velocity.Y < 0f) - { - projectile.velocity.Y += passiveMvtFloat * 2f; - } - } - if (projectile.velocity.Y > playerVector.Y) - { - projectile.velocity.Y -= passiveMvtFloat; - if (passiveMvtFloat > 0.05f && projectile.velocity.Y > 0f) - { - projectile.velocity.Y -= passiveMvtFloat * 2f; - } - } - if (projectile.velocity.X >= 0.25f) - { - projectile.direction = faceRight ? 1 : -1; - } - else if (projectile.velocity.X < -0.25f) - { - projectile.direction = faceRight ? -1 : 1; - } - //Tilting and change directions - projectile.spriteDirection = projectile.direction; - projectile.rotation = projectile.velocity.X * tiltFloat; + ExpandHitboxBy(projectile, newSize, newSize); + } + public static void ExpandHitboxBy(Projectile projectile, float expandRatio) + { + ExpandHitboxBy(projectile, (int)(projectile.width * expandRatio), (int)(projectile.height * expandRatio)); } #endregion } diff --git a/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs b/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs index dcf0fe3527..61bb60130d 100644 --- a/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs +++ b/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs index dc73b8464b..44f2f370b3 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Terraria; diff --git a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs b/Projectiles/DraedonsArsenal/GatlingLaserShot.cs index 13cbfae232..3743955ec1 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserShot.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/DraedonsArsenal/LaserRifleShot.cs b/Projectiles/DraedonsArsenal/LaserRifleShot.cs index 83b69a99fd..e7d9e3873d 100644 --- a/Projectiles/DraedonsArsenal/LaserRifleShot.cs +++ b/Projectiles/DraedonsArsenal/LaserRifleShot.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/DraedonsArsenal/PlasmaCasterShot.cs b/Projectiles/DraedonsArsenal/PlasmaCasterShot.cs index bd68a8744e..d0e6575f74 100644 --- a/Projectiles/DraedonsArsenal/PlasmaCasterShot.cs +++ b/Projectiles/DraedonsArsenal/PlasmaCasterShot.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -97,8 +97,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.CursedInferno, 600); + target.AddBuff(BuffID.OnFire, 360); + target.AddBuff(BuffID.CursedInferno, 180); } public override void Kill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index 5ff8b812ed..d4db6eaaad 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -128,19 +128,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (!target.boss) { - if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && - target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && - target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && - target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && - target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && - target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && - target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && - target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && - target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && - target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && - target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && - target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && - target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57) + if (target.Inorganic()) { damage += target.lifeMax / 250; } diff --git a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs index 3e98af10a2..e2b8ab0df7 100644 --- a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs +++ b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal { - public class TeslaCannonShot : ModProjectile + public class TeslaCannonShot : ModProjectile { private int[] dustArray = new int[7] { 56, 111, 137, 160, 206, 229, 226 }; @@ -144,11 +143,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { if (projectile.ai[1] >= 0f) { - if (target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 && - target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 && - target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && - target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && - target.HitSound != SoundID.NPCHit54 && target.HitSound != null) + if (target.Organic()) { target.velocity.X = 0f; target.velocity.Y = 0f; diff --git a/Projectiles/Enemy/AstralShot.cs b/Projectiles/Enemy/AstralShot.cs deleted file mode 100644 index d42ffde574..0000000000 --- a/Projectiles/Enemy/AstralShot.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Enemy -{ - public class AstralShot : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Laser"); - } - - public override void SetDefaults() - { - projectile.width = 5; - projectile.height = 5; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.alpha = 255; - projectile.penetrate = 1; - projectile.extraUpdates = 3; - projectile.timeLeft = 90; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.2f / 255f); - if (projectile.ai[0] == 0f) - { - projectile.ai[0] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); - } - if (projectile.alpha > 0) - { - projectile.alpha -= 25; - } - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - float num55 = 30f; - float num56 = 1f; - if (projectile.ai[1] == 0f) - { - projectile.localAI[0] += num56; - if (projectile.localAI[0] > num55) - { - projectile.localAI[0] = num55; - } - } - else - { - projectile.localAI[0] -= num56; - if (projectile.localAI[0] <= 0f) - { - projectile.Kill(); - } - } - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(255, 100, 255, 0); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); - int num147 = 0; - int num148 = 0; - float num149 = (float)(Main.projectileTexture[projectile.type].Width - projectile.width) * 0.5f + (float)projectile.width * 0.5f; - SpriteEffects spriteEffects = SpriteEffects.None; - if (projectile.spriteDirection == -1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Rectangle value6 = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 500, Main.screenWidth + 1000, Main.screenHeight + 1000); - if (projectile.getRect().Intersects(value6)) - { - Vector2 value7 = new Vector2(projectile.position.X - Main.screenPosition.X + num149 + (float)num148, projectile.position.Y - Main.screenPosition.Y + (float)(projectile.height / 2) + projectile.gfxOffY); - float num162 = 30f; - float scaleFactor = 1f; - if (projectile.ai[1] == 1f) - { - num162 = (float)(int)projectile.localAI[0]; - } - for (int num163 = 1; num163 <= (int)projectile.localAI[0]; num163++) - { - Vector2 value8 = Vector2.Normalize(projectile.velocity) * (float)num163 * scaleFactor; - Color color29 = projectile.GetAlpha(color25); - color29 *= (num162 - (float)num163) / num162; - color29.A = 0; - Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], value7 - value8, null, color29, projectile.rotation, new Vector2(num149, (float)(projectile.height / 2 + num147)), projectile.scale, spriteEffects, 0f); - } - } - return false; - } - } -} diff --git a/Projectiles/Enemy/AstralShot.png b/Projectiles/Enemy/AstralShot.png deleted file mode 100644 index d2fb806a1a..0000000000 Binary files a/Projectiles/Enemy/AstralShot.png and /dev/null differ diff --git a/Projectiles/Enemy/BelchingCoralSpike.cs b/Projectiles/Enemy/BelchingCoralSpike.cs index 470ee34328..45b275bbfa 100644 --- a/Projectiles/Enemy/BelchingCoralSpike.cs +++ b/Projectiles/Enemy/BelchingCoralSpike.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Enemy/CrabBoulder.cs b/Projectiles/Enemy/CrabBoulder.cs index b571513d75..5d18ac21a0 100644 --- a/Projectiles/Enemy/CrabBoulder.cs +++ b/Projectiles/Enemy/CrabBoulder.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Enemy/CragmawBeam.cs b/Projectiles/Enemy/CragmawBeam.cs index baba926e2c..a61e2a6847 100644 --- a/Projectiles/Enemy/CragmawBeam.cs +++ b/Projectiles/Enemy/CragmawBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Enemy/CragmawBubble.cs b/Projectiles/Enemy/CragmawBubble.cs index 5ca8c64578..190324aaea 100644 --- a/Projectiles/Enemy/CragmawBubble.cs +++ b/Projectiles/Enemy/CragmawBubble.cs @@ -1,5 +1,4 @@ -using CalamityMod.Dusts; -using CalamityMod.World; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { - public class CragmawBubble : ModProjectile + public class CragmawBubble : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Enemy/CragmawSpike.cs b/Projectiles/Enemy/CragmawSpike.cs index 696bbf3f0b..efec0d5e92 100644 --- a/Projectiles/Enemy/CragmawSpike.cs +++ b/Projectiles/Enemy/CragmawSpike.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Enemy/CragmawVibeCheckChain.cs b/Projectiles/Enemy/CragmawVibeCheckChain.cs index ab1efa67da..8aca72cbba 100644 --- a/Projectiles/Enemy/CragmawVibeCheckChain.cs +++ b/Projectiles/Enemy/CragmawVibeCheckChain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; diff --git a/Projectiles/Enemy/CrimsonSpike.cs b/Projectiles/Enemy/CrimsonSpike.cs index 8f6730b379..5fca704356 100644 --- a/Projectiles/Enemy/CrimsonSpike.cs +++ b/Projectiles/Enemy/CrimsonSpike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Enemy if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 17); + Main.PlaySound(SoundID.Item17, (int)projectile.position.X, (int)projectile.position.Y); } projectile.ai[0] += 1f; if (projectile.ai[0] >= 5f) diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 9cad47333e..8b12ba1d48 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -51,7 +52,7 @@ namespace CalamityMod.Projectiles.Enemy public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.NPCDeath14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 60; diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index ee4b128017..f9fc694331 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Enemy public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.NPCDeath14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Enemy/FlakAcid.cs b/Projectiles/Enemy/FlakAcid.cs index 86299a8d41..ea1941e212 100644 --- a/Projectiles/Enemy/FlakAcid.cs +++ b/Projectiles/Enemy/FlakAcid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Enemy/FlameBurstHostile.cs b/Projectiles/Enemy/FlameBurstHostile.cs index e272b6d0ab..87073736b7 100644 --- a/Projectiles/Enemy/FlameBurstHostile.cs +++ b/Projectiles/Enemy/FlameBurstHostile.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -26,7 +27,7 @@ namespace CalamityMod.Projectiles.Enemy { if (count == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Enemy/GammaAcid.cs b/Projectiles/Enemy/GammaAcid.cs index 607a89dbdf..3afba2d30d 100644 --- a/Projectiles/Enemy/GammaAcid.cs +++ b/Projectiles/Enemy/GammaAcid.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Enemy/GammaBeam.cs b/Projectiles/Enemy/GammaBeam.cs index fd079e6dea..48cb0dd6f9 100644 --- a/Projectiles/Enemy/GammaBeam.cs +++ b/Projectiles/Enemy/GammaBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Enemy/HorsWaterBlast.cs b/Projectiles/Enemy/HorsWaterBlast.cs index 062afd791d..a23aaa5cc1 100644 --- a/Projectiles/Enemy/HorsWaterBlast.cs +++ b/Projectiles/Enemy/HorsWaterBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Enemy } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.35f / 255f); for (int num457 = 0; num457 < 10; num457++) @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Enemy public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); for (int dust = 0; dust <= 40; dust++) { float num463 = (float)Main.rand.Next(-10, 11); diff --git a/Projectiles/Enemy/InkBomb.cs b/Projectiles/Enemy/InkBomb.cs index 40e60358ac..4328710d49 100644 --- a/Projectiles/Enemy/InkBomb.cs +++ b/Projectiles/Enemy/InkBomb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Enemy public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 28); + Main.PlaySound(SoundID.NPCDeath28, projectile.position); int num251 = Main.rand.Next(5, 8); if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Enemy/InkPoisonCloud.cs b/Projectiles/Enemy/InkPoisonCloud.cs index d9bc656bd4..b959629ee3 100644 --- a/Projectiles/Enemy/InkPoisonCloud.cs +++ b/Projectiles/Enemy/InkPoisonCloud.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/InkPoisonCloud2.cs b/Projectiles/Enemy/InkPoisonCloud2.cs index 467b45b6ec..8bf7f57d92 100644 --- a/Projectiles/Enemy/InkPoisonCloud2.cs +++ b/Projectiles/Enemy/InkPoisonCloud2.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/InkPoisonCloud3.cs b/Projectiles/Enemy/InkPoisonCloud3.cs index 40b43c2d32..2950babbc5 100644 --- a/Projectiles/Enemy/InkPoisonCloud3.cs +++ b/Projectiles/Enemy/InkPoisonCloud3.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index f52d0cc5a2..29fe90f655 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; diff --git a/Projectiles/Enemy/NuclearBulletLarge.cs b/Projectiles/Enemy/NuclearBulletLarge.cs index d9bc147081..fdf3d549d9 100644 --- a/Projectiles/Enemy/NuclearBulletLarge.cs +++ b/Projectiles/Enemy/NuclearBulletLarge.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Terraria; diff --git a/Projectiles/Enemy/NuclearBulletMedium.cs b/Projectiles/Enemy/NuclearBulletMedium.cs index 14b354b27f..71ab545c3c 100644 --- a/Projectiles/Enemy/NuclearBulletMedium.cs +++ b/Projectiles/Enemy/NuclearBulletMedium.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using System; diff --git a/Projectiles/Enemy/NuclearToadGoo.cs b/Projectiles/Enemy/NuclearToadGoo.cs index 443a006389..aab0150aad 100644 --- a/Projectiles/Enemy/NuclearToadGoo.cs +++ b/Projectiles/Enemy/NuclearToadGoo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/OrthoceraStream.cs b/Projectiles/Enemy/OrthoceraStream.cs index a95a587c36..919ecb6881 100644 --- a/Projectiles/Enemy/OrthoceraStream.cs +++ b/Projectiles/Enemy/OrthoceraStream.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/PearlBurst.cs b/Projectiles/Enemy/PearlBurst.cs index cd5912482b..640e29cf15 100644 --- a/Projectiles/Enemy/PearlBurst.cs +++ b/Projectiles/Enemy/PearlBurst.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/PearlRain.cs b/Projectiles/Enemy/PearlRain.cs index bc14eec908..ad0959721b 100644 --- a/Projectiles/Enemy/PearlRain.cs +++ b/Projectiles/Enemy/PearlRain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/PufferExplosion.cs b/Projectiles/Enemy/PufferExplosion.cs index 955cc605e7..01606b0e4b 100644 --- a/Projectiles/Enemy/PufferExplosion.cs +++ b/Projectiles/Enemy/PufferExplosion.cs @@ -2,6 +2,7 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -31,7 +32,7 @@ namespace CalamityMod.Projectiles.Enemy Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.01f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Enemy/StormMarkHostile.cs b/Projectiles/Enemy/StormMarkHostile.cs index 9fedc828f4..7cad2705ee 100644 --- a/Projectiles/Enemy/StormMarkHostile.cs +++ b/Projectiles/Enemy/StormMarkHostile.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -29,7 +30,7 @@ namespace CalamityMod.Projectiles.Enemy if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 60); + Main.PlaySound(SoundID.Item60, projectile.Center); } if (projectile.localAI[1] < 30f) { diff --git a/Projectiles/Enemy/SulphuricAcidBubble.cs b/Projectiles/Enemy/SulphuricAcidBubble.cs index f05cc9bd78..b1790cb1b5 100644 --- a/Projectiles/Enemy/SulphuricAcidBubble.cs +++ b/Projectiles/Enemy/SulphuricAcidBubble.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Enemy/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs index e3bef3ad7e..62fd008508 100644 --- a/Projectiles/Enemy/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Enemy if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 111); + Main.PlaySound(SoundID.Item111, projectile.position); } if (projectile.velocity.X < 0f) { diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index b837275777..2bc4b6be9a 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { @@ -27,7 +28,7 @@ namespace CalamityMod.Projectiles.Enemy if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 122); + Main.PlaySound(SoundID.Item122, projectile.position); } projectile.ai[0] += 1f; if (projectile.ai[0] >= num1125) diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 4670a6e322..f4feb53ef0 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Enemy/TrilobiteSpike.cs b/Projectiles/Enemy/TrilobiteSpike.cs index dd3dc20e5f..fb324324ab 100644 --- a/Projectiles/Enemy/TrilobiteSpike.cs +++ b/Projectiles/Enemy/TrilobiteSpike.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Environment/AcidDrop.cs b/Projectiles/Environment/AcidDrop.cs index 0385ff1f5d..f9f48291f3 100644 --- a/Projectiles/Environment/AcidDrop.cs +++ b/Projectiles/Environment/AcidDrop.cs @@ -1,16 +1,14 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.SummonItems.Invasion; -using CalamityMod.World; namespace CalamityMod.Projectiles.Environment { - public class AcidDrop : ModProjectile + public class AcidDrop : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Environment/GeyserTelegraph.cs b/Projectiles/Environment/GeyserTelegraph.cs index 1bb545e351..96437ff661 100644 --- a/Projectiles/Environment/GeyserTelegraph.cs +++ b/Projectiles/Environment/GeyserTelegraph.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Environment { - public class GeyserTelegraph : ModProjectile + public class GeyserTelegraph : ModProjectile { private bool initialized = false; public override void SetStaticDefaults() diff --git a/Projectiles/Environment/HotSteam.cs b/Projectiles/Environment/HotSteam.cs index fd57ffbdff..09143d06b0 100644 --- a/Projectiles/Environment/HotSteam.cs +++ b/Projectiles/Environment/HotSteam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Environment/LavaChunk.cs b/Projectiles/Environment/LavaChunk.cs index 9bee03d02d..b0a8da37ea 100644 --- a/Projectiles/Environment/LavaChunk.cs +++ b/Projectiles/Environment/LavaChunk.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Environment/LightningMark.cs b/Projectiles/Environment/LightningMark.cs index b3971032e5..9795158a32 100644 --- a/Projectiles/Environment/LightningMark.cs +++ b/Projectiles/Environment/LightningMark.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Environment { - public class LightningMark : ModProjectile + public class LightningMark : ModProjectile { public override void SetStaticDefaults() { @@ -43,10 +42,10 @@ namespace CalamityMod.Projectiles.Environment Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/LightningStrike"), (int)projectile.Center.X, (int)projectile.Center.Y); Vector2 ai0 = projectile.Center - fireFrom; - float ai = (float)Main.rand.Next(100); + float ai = Main.rand.Next(100); Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(0.78539818525314331)) * 7f; int proj = Projectile.NewProjectile(fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ProjectileID.CultistBossLightningOrbArc, 50, 0f, projectile.owner, ai0.ToRotation(), ai); - Main.projectile[proj].extraUpdates += 6; + Main.projectile[proj].extraUpdates += 11; Main.projectile[proj].friendly = true; Main.projectile[proj].Calamity().lineColor = 1; } diff --git a/Projectiles/Healing/AtaxiaHealOrb.cs b/Projectiles/Healing/AtaxiaHealOrb.cs index 98aa375101..f886f3a334 100644 --- a/Projectiles/Healing/AtaxiaHealOrb.cs +++ b/Projectiles/Healing/AtaxiaHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class AtaxiaHealOrb : ModProjectile + public class AtaxiaHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/AuricOrb.cs b/Projectiles/Healing/AuricOrb.cs index 74adb60d7d..60995c3d47 100644 --- a/Projectiles/Healing/AuricOrb.cs +++ b/Projectiles/Healing/AuricOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class AuricOrb : ModProjectile + public class AuricOrb : ModProjectile { public override void SetStaticDefaults() { @@ -42,7 +41,7 @@ namespace CalamityMod.Projectiles.Healing } } - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); return; } diff --git a/Projectiles/Healing/BurntSiennaProj.cs b/Projectiles/Healing/BurntSiennaProj.cs index 6c2ed80366..c6c3346e9d 100644 --- a/Projectiles/Healing/BurntSiennaProj.cs +++ b/Projectiles/Healing/BurntSiennaProj.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class BurntSiennaProj : ModProjectile + public class BurntSiennaProj : ModProjectile { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f, false); + projectile.HealingProjectile(3, (int)projectile.ai[0], 6f, 15f, false); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/CactusHealOrb.cs b/Projectiles/Healing/CactusHealOrb.cs index 4d919c5b6a..654c25a857 100644 --- a/Projectiles/Healing/CactusHealOrb.cs +++ b/Projectiles/Healing/CactusHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class CactusHealOrb : ModProjectile + public class CactusHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.Y *= 0.98f; - CalamityGlobalProjectile.HealingProjectile(projectile, 25, projectile.owner, 12f, 15f); + projectile.HealingProjectile(25, projectile.owner, 12f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/EarthHealOrb.cs b/Projectiles/Healing/EarthHealOrb.cs index 1b0f469446..6c936348f5 100644 --- a/Projectiles/Healing/EarthHealOrb.cs +++ b/Projectiles/Healing/EarthHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class EarthHealOrb : ModProjectile + public class EarthHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index 4b628fbf2a..2080699aaf 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class EssenceFlame : ModProjectile + public class EssenceFlame : ModProjectile { public override void SetStaticDefaults() { @@ -38,13 +38,13 @@ namespace CalamityMod.Projectiles.Healing projectile.frame = 0; } - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 3.5f, 15f); return; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Healing/Exoheal.cs b/Projectiles/Healing/Exoheal.cs index f2e6e2b59d..bcbfbf33d0 100644 --- a/Projectiles/Healing/Exoheal.cs +++ b/Projectiles/Healing/Exoheal.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class Exoheal : ModProjectile + public class Exoheal : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index 8b064add99..dbe1764206 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class FungalHeal : ModProjectile + public class FungalHeal : ModProjectile { public override void SetStaticDefaults() { @@ -40,7 +39,7 @@ namespace CalamityMod.Projectiles.Healing projectile.localAI[0] += 1f; } - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 5f, 15f); float num494 = projectile.velocity.X * 0.334f; float num495 = -(projectile.velocity.Y * 0.334f); int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.5f); diff --git a/Projectiles/Healing/GodSlayerHealOrb.cs b/Projectiles/Healing/GodSlayerHealOrb.cs index 76ab25d25d..bb6d057f40 100644 --- a/Projectiles/Healing/GodSlayerHealOrb.cs +++ b/Projectiles/Healing/GodSlayerHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class GodSlayerHealOrb : ModProjectile + public class GodSlayerHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/ManaOverloaderHealOrb.cs b/Projectiles/Healing/ManaOverloaderHealOrb.cs index 4a6a1773a8..bfd57807c9 100644 --- a/Projectiles/Healing/ManaOverloaderHealOrb.cs +++ b/Projectiles/Healing/ManaOverloaderHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class ManaOverloaderHealOrb : ModProjectile + public class ManaOverloaderHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 3f, 15f); int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1.3f); Dust dust = Main.dust[dusty]; dust.noGravity = true; diff --git a/Projectiles/Healing/PhoenixHeal.cs b/Projectiles/Healing/PhoenixHeal.cs index d876795420..0434f84892 100644 --- a/Projectiles/Healing/PhoenixHeal.cs +++ b/Projectiles/Healing/PhoenixHeal.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class PhoenixHeal : ModProjectile + public class PhoenixHeal : ModProjectile { public override void SetStaticDefaults() { @@ -25,7 +24,7 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - CalamityGlobalProjectile.HealingProjectile(projectile, 10, (int)projectile.ai[0], 6f, 15f, false, 360); + projectile.HealingProjectile(10, (int)projectile.ai[0], 6f, 15f, false, 360); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Healing/RainHeal.cs b/Projectiles/Healing/RainHeal.cs index 492030d13b..329c8fdb07 100644 --- a/Projectiles/Healing/RainHeal.cs +++ b/Projectiles/Healing/RainHeal.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class RainHeal : ModProjectile + public class RainHeal : ModProjectile { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.X *= 0.985f; projectile.velocity.Y *= 0.985f; - CalamityGlobalProjectile.HealingProjectile(projectile, 8, projectile.owner, 12f, 15f, false); + projectile.HealingProjectile(8, projectile.owner, 12f, 15f, false); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); diff --git a/Projectiles/Healing/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs index a5f7a0fea3..7d0b933b52 100644 --- a/Projectiles/Healing/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class RoyalHeal : ModProjectile + public class RoyalHeal : ModProjectile { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); for (int num493 = 0; num493 < 3; num493++) { float num494 = projectile.velocity.X * 0.334f * (float)num493; diff --git a/Projectiles/Healing/ShinobiHealOrb.cs b/Projectiles/Healing/ShinobiHealOrb.cs index 0361dfd5df..f1a9380519 100644 --- a/Projectiles/Healing/ShinobiHealOrb.cs +++ b/Projectiles/Healing/ShinobiHealOrb.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class ShinobiHealOrb : ModProjectile + public class ShinobiHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -26,7 +25,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], projectile.owner, 6f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], projectile.owner, 6f, 15f); for (int num468 = 0; num468 < 3; num468++) { diff --git a/Projectiles/Healing/SilvaOrb.cs b/Projectiles/Healing/SilvaOrb.cs index 4da5cec31c..9bece10e72 100644 --- a/Projectiles/Healing/SilvaOrb.cs +++ b/Projectiles/Healing/SilvaOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class SilvaOrb : ModProjectile + public class SilvaOrb : ModProjectile { public override void SetStaticDefaults() { @@ -42,7 +41,7 @@ namespace CalamityMod.Projectiles.Healing } } - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); return; } diff --git a/Projectiles/Healing/TerracottaProj.cs b/Projectiles/Healing/TerracottaProj.cs index 14ae4bc480..e9fdc8ca58 100644 --- a/Projectiles/Healing/TerracottaProj.cs +++ b/Projectiles/Healing/TerracottaProj.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class TerracottaProj : ModProjectile + public class TerracottaProj : ModProjectile { public override void SetStaticDefaults() { @@ -27,7 +26,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f, false, 300); + projectile.HealingProjectile(9, (int)projectile.ai[0], 8f, 15f, false, 300); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Healing/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs index 741959f1e7..cf1d9d6fbc 100644 --- a/Projectiles/Healing/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class TransfusionTrail : ModProjectile + public class TransfusionTrail : ModProjectile { public override void SetStaticDefaults() { @@ -22,7 +21,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); float num494 = projectile.velocity.X * 0.334f; float num495 = -(projectile.velocity.Y * 0.334f); int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f); diff --git a/Projectiles/Healing/XerocHealOrb.cs b/Projectiles/Healing/XerocHealOrb.cs index 5ab79c1a15..c5d09d22e5 100644 --- a/Projectiles/Healing/XerocHealOrb.cs +++ b/Projectiles/Healing/XerocHealOrb.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Healing { - public class XerocHealOrb : ModProjectile + public class XerocHealOrb : ModProjectile { public override void SetStaticDefaults() { @@ -24,7 +23,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); + projectile.HealingProjectile((int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Hybrid/AccretionDisk2.cs b/Projectiles/Hybrid/AccretionDisk2.cs index 427416d322..e104373475 100644 --- a/Projectiles/Hybrid/AccretionDisk2.cs +++ b/Projectiles/Hybrid/AccretionDisk2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Hybrid/AccretionDiskProj.cs b/Projectiles/Hybrid/AccretionDiskProj.cs index 0cc68e105f..f35fc1b399 100644 --- a/Projectiles/Hybrid/AccretionDiskProj.cs +++ b/Projectiles/Hybrid/AccretionDiskProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 400; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/AetherBeam.cs b/Projectiles/Hybrid/AetherBeam.cs index 442f59ad43..e945b3dcff 100644 --- a/Projectiles/Hybrid/AetherBeam.cs +++ b/Projectiles/Hybrid/AetherBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/CorpusAvertorClone.cs b/Projectiles/Hybrid/CorpusAvertorClone.cs index 1210f3270e..13776d6916 100644 --- a/Projectiles/Hybrid/CorpusAvertorClone.cs +++ b/Projectiles/Hybrid/CorpusAvertorClone.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/CorpusAvertorProj.cs b/Projectiles/Hybrid/CorpusAvertorProj.cs index 4e41dfb165..ffc580247e 100644 --- a/Projectiles/Hybrid/CorpusAvertorProj.cs +++ b/Projectiles/Hybrid/CorpusAvertorProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/EmpyreanKnife.cs b/Projectiles/Hybrid/EmpyreanKnife.cs index 17908efb24..ddd8abd06d 100644 --- a/Projectiles/Hybrid/EmpyreanKnife.cs +++ b/Projectiles/Hybrid/EmpyreanKnife.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/EradicatorProjectile.cs b/Projectiles/Hybrid/EradicatorProjectile.cs index 458f86a7a3..96c3f699a9 100644 --- a/Projectiles/Hybrid/EradicatorProjectile.cs +++ b/Projectiles/Hybrid/EradicatorProjectile.cs @@ -1,14 +1,13 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Hybrid { - public class EradicatorProjectile : ModProjectile + public class EradicatorProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -29,7 +28,7 @@ namespace CalamityMod.Projectiles.Hybrid aiType = ProjectileID.WoodenBoomerang; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/FlameScytheProjectile.cs b/Projectiles/Hybrid/FlameScytheProjectile.cs index 57e8b9a374..b2426aba4d 100644 --- a/Projectiles/Hybrid/FlameScytheProjectile.cs +++ b/Projectiles/Hybrid/FlameScytheProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.timeLeft = 600; projectile.alpha = 55; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -57,7 +57,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } @@ -67,7 +70,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } } diff --git a/Projectiles/Hybrid/GalaxySmasherHammer.cs b/Projectiles/Hybrid/GalaxySmasherHammer.cs index 16010c3265..6bf63941db 100644 --- a/Projectiles/Hybrid/GalaxySmasherHammer.cs +++ b/Projectiles/Hybrid/GalaxySmasherHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -164,7 +164,7 @@ namespace CalamityMod.Projectiles.Hybrid } // Makes an explosion sound. - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); // Applies God Slayer Inferno on contact. target.AddBuff(ModContent.BuffType(), 480); @@ -183,7 +183,6 @@ namespace CalamityMod.Projectiles.Hybrid float laserSpeed = Main.rand.NextFloat(15f, 18f); Vector2 velocity = startDir * (-laserSpeed); - // NebulaShot projectile adjusts its own damage type based on ai[0] if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner); @@ -225,7 +224,7 @@ namespace CalamityMod.Projectiles.Hybrid } // Makes an explosion sound. - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); // Applies God Slayer Inferno on contact. target.AddBuff(ModContent.BuffType(), 480); diff --git a/Projectiles/Hybrid/IllustriousKnife.cs b/Projectiles/Hybrid/IllustriousKnife.cs index 843ec6fe90..af48e7b922 100644 --- a/Projectiles/Hybrid/IllustriousKnife.cs +++ b/Projectiles/Hybrid/IllustriousKnife.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Hybrid/KelvinCatalystBoomerang.cs b/Projectiles/Hybrid/KelvinCatalystBoomerang.cs index ddbc6a3144..529d3089a2 100644 --- a/Projectiles/Hybrid/KelvinCatalystBoomerang.cs +++ b/Projectiles/Hybrid/KelvinCatalystBoomerang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Hybrid ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + Main.PlaySound(SoundID.Item30, projectile.position); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Hybrid ModContent.ProjectileType(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + Main.PlaySound(SoundID.Item30, projectile.position); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Hybrid/MangroveChakramProjectile.cs b/Projectiles/Hybrid/MangroveChakramProjectile.cs index 0c32453a85..a11bbb4c5e 100644 --- a/Projectiles/Hybrid/MangroveChakramProjectile.cs +++ b/Projectiles/Hybrid/MangroveChakramProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 600; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -44,12 +44,12 @@ namespace CalamityMod.Projectiles.Hybrid public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 6; - target.AddBuff(BuffID.CursedInferno, 240); + target.AddBuff(BuffID.CursedInferno, 120); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(BuffID.CursedInferno, 240); + target.AddBuff(BuffID.CursedInferno, 120); } } } diff --git a/Projectiles/Hybrid/NanoblackMain.cs b/Projectiles/Hybrid/NanoblackMain.cs index b3b27c092f..8bab65c856 100644 --- a/Projectiles/Hybrid/NanoblackMain.cs +++ b/Projectiles/Hybrid/NanoblackMain.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Hybrid/NanoblackSplit.cs b/Projectiles/Hybrid/NanoblackSplit.cs index bae91bf90e..61fb2a7bae 100644 --- a/Projectiles/Hybrid/NanoblackSplit.cs +++ b/Projectiles/Hybrid/NanoblackSplit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/OPHammer.cs b/Projectiles/Hybrid/OPHammer.cs index 0278d3d2db..b262e027f2 100644 --- a/Projectiles/Hybrid/OPHammer.cs +++ b/Projectiles/Hybrid/OPHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 2; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -118,7 +118,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } @@ -128,7 +131,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } diff --git a/Projectiles/Hybrid/PwnagehammerProj.cs b/Projectiles/Hybrid/PwnagehammerProj.cs index b84082b42c..4f9bf797e2 100644 --- a/Projectiles/Hybrid/PwnagehammerProj.cs +++ b/Projectiles/Hybrid/PwnagehammerProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.timeLeft = 120; projectile.extraUpdates = 3; aiType = ProjectileID.PaladinsHammerFriendly; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs index 468eae73a4..cc1587a8a1 100644 --- a/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Hybrid/ScourgeoftheCosmosMini.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs b/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs index fe4711abc4..fec3401f15 100644 --- a/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Hybrid/ScourgeoftheCosmosProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Hybrid } else { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 4, 1f, 0f); + Main.PlaySound(SoundID.NPCHit4, projectile.position); if (projectile.velocity.X != oldVelocity.X) { projectile.velocity.X = -oldVelocity.X; @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Hybrid public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 4, 1f, 0f); + Main.PlaySound(SoundID.NPCHit4, projectile.position); int num3; for (int num622 = 0; num622 < 10; num622 = num3 + 1) { diff --git a/Projectiles/Hybrid/SeashellBoomerangProjectile.cs b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs index d7209de0a7..2586510f85 100644 --- a/Projectiles/Hybrid/SeashellBoomerangProjectile.cs +++ b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Hybrid { @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 240; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } } } diff --git a/Projectiles/Hybrid/StellarContemptHammer.cs b/Projectiles/Hybrid/StellarContemptHammer.cs index 8391f02918..0eef764290 100644 --- a/Projectiles/Hybrid/StellarContemptHammer.cs +++ b/Projectiles/Hybrid/StellarContemptHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Hybrid // Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker) Player user = Main.player[projectile.owner]; - Main.PlaySound(2, (int)user.position.X, (int)user.position.Y, 88); + Main.PlaySound(SoundID.Item88, projectile.position); projectile.netUpdate = true; int numFlares = 2; @@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles.Hybrid // Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker) Player user = Main.player[projectile.owner]; - Main.PlaySound(2, (int)user.position.X, (int)user.position.Y, 88); + Main.PlaySound(SoundID.Item88, projectile.position); projectile.netUpdate = true; int numFlares = 2; diff --git a/Projectiles/Hybrid/TriactisOPHammer.cs b/Projectiles/Hybrid/TriactisOPHammer.cs index 1c4ddffd63..1c0dae274f 100644 --- a/Projectiles/Hybrid/TriactisOPHammer.cs +++ b/Projectiles/Hybrid/TriactisOPHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 3; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Hybrid { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); @@ -145,7 +145,7 @@ namespace CalamityMod.Projectiles.Hybrid { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Magic/AbyssBall.cs b/Projectiles/Magic/AbyssBall.cs index 1884b215dd..7c257e8a44 100644 --- a/Projectiles/Magic/AbyssBall.cs +++ b/Projectiles/Magic/AbyssBall.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Magic { public class AbyssBall : ModProjectile @@ -40,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Magic/AcidGunStream.cs b/Projectiles/Magic/AcidGunStream.cs index 6decda2f2d..f39de0662b 100644 --- a/Projectiles/Magic/AcidGunStream.cs +++ b/Projectiles/Magic/AcidGunStream.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/AcidicReed.cs b/Projectiles/Magic/AcidicReed.cs index 41491b40b9..722784a951 100644 --- a/Projectiles/Magic/AcidicReed.cs +++ b/Projectiles/Magic/AcidicReed.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class AcidicReed : ModProjectile + public class AcidicReed : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/AcidicSaxBubble.cs b/Projectiles/Magic/AcidicSaxBubble.cs index 927dcad260..cdb82843ab 100644 --- a/Projectiles/Magic/AcidicSaxBubble.cs +++ b/Projectiles/Magic/AcidicSaxBubble.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/AcidicSaxMist.cs b/Projectiles/Magic/AcidicSaxMist.cs index 90d407e7de..27bcc47185 100644 --- a/Projectiles/Magic/AcidicSaxMist.cs +++ b/Projectiles/Magic/AcidicSaxMist.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 111); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 111); } if (projectile.velocity.X < 0f) { diff --git a/Projectiles/Magic/Ancient.cs b/Projectiles/Magic/Ancient.cs index 85686900da..baaea73836 100644 --- a/Projectiles/Magic/Ancient.cs +++ b/Projectiles/Magic/Ancient.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index ac3cbc2292..dcba2cd1e3 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/AquamarineBolt.cs b/Projectiles/Magic/AquamarineBolt.cs index fa855a7ebe..e683df01cd 100644 --- a/Projectiles/Magic/AquamarineBolt.cs +++ b/Projectiles/Magic/AquamarineBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/Asteroid.cs b/Projectiles/Magic/Asteroid.cs index 2322acee60..9b9b6d8fae 100644 --- a/Projectiles/Magic/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/AsteroidMolten.cs b/Projectiles/Magic/AsteroidMolten.cs index b08eb0328b..d57eabad06 100644 --- a/Projectiles/Magic/AsteroidMolten.cs +++ b/Projectiles/Magic/AsteroidMolten.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatBuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Magic/AstralCrystal.cs b/Projectiles/Magic/AstralCrystal.cs index 265d54aa7f..9f2b8e3ce2 100644 --- a/Projectiles/Magic/AstralCrystal.cs +++ b/Projectiles/Magic/AstralCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs index 2a782f09e6..4ed5b81000 100644 --- a/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs +++ b/Projectiles/Magic/AstralCrystalInvisibleExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index f2316fd98a..6d1f5337c2 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 9); } } projectile.alpha -= 15; diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index 510d2c19d3..06f099f567 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Magic/AtlantisSpear.cs b/Projectiles/Magic/AtlantisSpear.cs index 520170fd89..8702e8bb35 100644 --- a/Projectiles/Magic/AtlantisSpear.cs +++ b/Projectiles/Magic/AtlantisSpear.cs @@ -1,8 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Magic { public class AtlantisSpear : ModProjectile @@ -50,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic int dmg = projectile.damage; float kBack = projectile.knockBack; int number = Projectile.NewProjectile(projectile.position.X + projectile.velocity.X + (float)(projectile.width / 2), projectile.position.Y + projectile.velocity.Y + (float)(projectile.height / 2), projectile.velocity.X, projectile.velocity.Y, projType, dmg, kBack, projectile.owner, 0f, projectile.ai[1] + 1f); - NetMessage.SendData(27, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Magic/AtlantisSpear2.cs b/Projectiles/Magic/AtlantisSpear2.cs index 4ac98ae888..1939696977 100644 --- a/Projectiles/Magic/AtlantisSpear2.cs +++ b/Projectiles/Magic/AtlantisSpear2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/AuraRain.cs b/Projectiles/Magic/AuraRain.cs index 962db31aef..5d44f37cde 100644 --- a/Projectiles/Magic/AuraRain.cs +++ b/Projectiles/Magic/AuraRain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/AuroraAustralis.cs b/Projectiles/Magic/AuroraAustralis.cs index aef879aa5f..cd166051f1 100644 --- a/Projectiles/Magic/AuroraAustralis.cs +++ b/Projectiles/Magic/AuroraAustralis.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class AuroraAustralis : ModProjectile + public class AuroraAustralis : ModProjectile { private static float CosFrequency = 0.05f; private static float CosAmplitude = 0.008f; diff --git a/Projectiles/Magic/BeamingBolt.cs b/Projectiles/Magic/BeamingBolt.cs index 2c275ea636..d73e0d7aaf 100644 --- a/Projectiles/Magic/BeamingBolt.cs +++ b/Projectiles/Magic/BeamingBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/BeamingBolt2.cs b/Projectiles/Magic/BeamingBolt2.cs index 98692f6227..f5a6d529da 100644 --- a/Projectiles/Magic/BeamingBolt2.cs +++ b/Projectiles/Magic/BeamingBolt2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/BeastScythe.cs b/Projectiles/Magic/BeastScythe.cs index 99fe1d3193..f35e05d828 100644 --- a/Projectiles/Magic/BeastScythe.cs +++ b/Projectiles/Magic/BeastScythe.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); projectile.position = projectile.Center; projectile.width = projectile.height = 100; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Magic/BigBeamofDeath.cs b/Projectiles/Magic/BigBeamofDeath.cs index 38c81d0612..5aa7d47319 100644 --- a/Projectiles/Magic/BigBeamofDeath.cs +++ b/Projectiles/Magic/BigBeamofDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/BigBeamofDeath2.cs b/Projectiles/Magic/BigBeamofDeath2.cs index b268a8add1..6eef268817 100644 --- a/Projectiles/Magic/BigBeamofDeath2.cs +++ b/Projectiles/Magic/BigBeamofDeath2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/BlackAnurianBubble.cs b/Projectiles/Magic/BlackAnurianBubble.cs index 10d2eaf02a..5dd510596e 100644 --- a/Projectiles/Magic/BlackAnurianBubble.cs +++ b/Projectiles/Magic/BlackAnurianBubble.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BlackAnurianPlankton.cs b/Projectiles/Magic/BlackAnurianPlankton.cs index 639bda17f7..713fc39733 100644 --- a/Projectiles/Magic/BlackAnurianPlankton.cs +++ b/Projectiles/Magic/BlackAnurianPlankton.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BlindingLight.cs b/Projectiles/Magic/BlindingLight.cs index 4c2bcb7e5c..1e1581e782 100644 --- a/Projectiles/Magic/BlindingLight.cs +++ b/Projectiles/Magic/BlindingLight.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.Graphics.Effects; diff --git a/Projectiles/Magic/BloodBeam.cs b/Projectiles/Magic/BloodBeam.cs index a06b8f6c3e..1dfb9db6b3 100644 --- a/Projectiles/Magic/BloodBeam.cs +++ b/Projectiles/Magic/BloodBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/BloodBlast.cs b/Projectiles/Magic/BloodBlast.cs index 61ccc5e742..9d1e71845d 100644 --- a/Projectiles/Magic/BloodBlast.cs +++ b/Projectiles/Magic/BloodBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/BloodBolt.cs b/Projectiles/Magic/BloodBolt.cs index 21837f8750..ff515b4f02 100644 --- a/Projectiles/Magic/BloodBolt.cs +++ b/Projectiles/Magic/BloodBolt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BloodOrb.cs b/Projectiles/Magic/BloodOrb.cs index 21597178c0..356ae37894 100644 --- a/Projectiles/Magic/BloodOrb.cs +++ b/Projectiles/Magic/BloodOrb.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class BloodOrb : ModProjectile + public class BloodOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/BloodRay.cs b/Projectiles/Magic/BloodRay.cs index 0ef97d720f..45cc4ba436 100644 --- a/Projectiles/Magic/BloodRay.cs +++ b/Projectiles/Magic/BloodRay.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BlueBubble.cs b/Projectiles/Magic/BlueBubble.cs index f680b30f3f..b5cd85edb6 100644 --- a/Projectiles/Magic/BlueBubble.cs +++ b/Projectiles/Magic/BlueBubble.cs @@ -1,10 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Magic { - public class BlueBubble : ModProjectile + public class BlueBubble : ModProjectile { public override void SetStaticDefaults() { @@ -60,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 54); + Main.PlaySound(SoundID.Item54, projectile.Center); int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { diff --git a/Projectiles/Magic/BrimstoneBeam.cs b/Projectiles/Magic/BrimstoneBeam.cs index fd570d8ff0..af28d92c43 100644 --- a/Projectiles/Magic/BrimstoneBeam.cs +++ b/Projectiles/Magic/BrimstoneBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BrimstoneBeam2.cs b/Projectiles/Magic/BrimstoneBeam2.cs index af4528083c..3abfde2659 100644 --- a/Projectiles/Magic/BrimstoneBeam2.cs +++ b/Projectiles/Magic/BrimstoneBeam2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BrimstoneBeam3.cs b/Projectiles/Magic/BrimstoneBeam3.cs index a54104a93b..bd9aa8ddd4 100644 --- a/Projectiles/Magic/BrimstoneBeam3.cs +++ b/Projectiles/Magic/BrimstoneBeam3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BrimstoneBeam4.cs b/Projectiles/Magic/BrimstoneBeam4.cs index 6cec726c04..a81fe645c5 100644 --- a/Projectiles/Magic/BrimstoneBeam4.cs +++ b/Projectiles/Magic/BrimstoneBeam4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BrimstoneBeam5.cs b/Projectiles/Magic/BrimstoneBeam5.cs index c8d4210a07..f91b48980e 100644 --- a/Projectiles/Magic/BrimstoneBeam5.cs +++ b/Projectiles/Magic/BrimstoneBeam5.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/BrimstoneFireball.cs b/Projectiles/Magic/BrimstoneFireball.cs index 6a796fb74c..108b2259c1 100644 --- a/Projectiles/Magic/BrimstoneFireball.cs +++ b/Projectiles/Magic/BrimstoneFireball.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic } velocity.Normalize(); velocity *= Main.rand.NextFloat(70f, 100f) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocity.X, velocity.Y, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.85), 0f, projectile.owner, 0f, 0f); } } } @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.penetrate--; if (projectile.penetrate <= 0) { @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs index 2a104cafb5..7c434089d7 100644 --- a/Projectiles/Magic/BrimstoneHellfireballFriendly.cs +++ b/Projectiles/Magic/BrimstoneHellfireballFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } } diff --git a/Projectiles/Magic/BrimstoneHomer.cs b/Projectiles/Magic/BrimstoneHomer.cs index ce8707b029..6adb605ff9 100644 --- a/Projectiles/Magic/BrimstoneHomer.cs +++ b/Projectiles/Magic/BrimstoneHomer.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class BrimstoneHomer : ModProjectile + public class BrimstoneHomer : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/BrimstoneTentacle.cs b/Projectiles/Magic/BrimstoneTentacle.cs index e4e5f9d4c1..80915bf57b 100644 --- a/Projectiles/Magic/BrimstoneTentacle.cs +++ b/Projectiles/Magic/BrimstoneTentacle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Magic/ClamorNoctusStar.cs b/Projectiles/Magic/ClamorNoctusStar.cs index 5bc0005438..aa14130c26 100644 --- a/Projectiles/Magic/ClamorNoctusStar.cs +++ b/Projectiles/Magic/ClamorNoctusStar.cs @@ -3,12 +3,11 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Magic { - public class ClamorNoctusStar : ModProjectile + public class ClamorNoctusStar : ModProjectile { public override void SetStaticDefaults() { @@ -39,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } if (Main.rand.NextBool(3)) @@ -55,7 +54,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/ClamorNoctusWyvern.cs b/Projectiles/Magic/ClamorNoctusWyvern.cs index 10569ea78f..a71be34eb8 100644 --- a/Projectiles/Magic/ClamorNoctusWyvern.cs +++ b/Projectiles/Magic/ClamorNoctusWyvern.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 7); + Main.PlaySound(SoundID.NPCHit7, projectile.Center); for (int i = 0; i <= 10; i++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 126, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/Climax2.cs b/Projectiles/Magic/Climax2.cs index 662fd26625..721d7ddd32 100644 --- a/Projectiles/Magic/Climax2.cs +++ b/Projectiles/Magic/Climax2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/ClimaxBeam.cs b/Projectiles/Magic/ClimaxBeam.cs index 693fc75790..12b872eb5f 100644 --- a/Projectiles/Magic/ClimaxBeam.cs +++ b/Projectiles/Magic/ClimaxBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/ClimaxProj.cs b/Projectiles/Magic/ClimaxProj.cs index 6a0285d9b2..24c196528a 100644 --- a/Projectiles/Magic/ClimaxProj.cs +++ b/Projectiles/Magic/ClimaxProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/CoralSpike.cs b/Projectiles/Magic/CoralSpike.cs index 334435f379..c67f916a44 100644 --- a/Projectiles/Magic/CoralSpike.cs +++ b/Projectiles/Magic/CoralSpike.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/CosmicTentacle.cs b/Projectiles/Magic/CosmicTentacle.cs index 2169e6c53f..450e3a9de4 100644 --- a/Projectiles/Magic/CosmicTentacle.cs +++ b/Projectiles/Magic/CosmicTentacle.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -94,7 +94,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 5; - target.AddBuff(BuffID.CursedInferno, 240); } } } diff --git a/Projectiles/Magic/Crescent.cs b/Projectiles/Magic/Crescent.cs index e5b773a9f2..bbf98cea75 100644 --- a/Projectiles/Magic/Crescent.cs +++ b/Projectiles/Magic/Crescent.cs @@ -1,9 +1,7 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index 6c644a4565..1c823439dc 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Magic/DarkSparkBeam.cs b/Projectiles/Magic/DarkSparkBeam.cs index b7703a22af..ee5c50df5c 100644 --- a/Projectiles/Magic/DarkSparkBeam.cs +++ b/Projectiles/Magic/DarkSparkBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -127,15 +127,15 @@ namespace CalamityMod.Projectiles.Magic projectile.position += value37; projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy((double)num811, default); projectile.scale = 1.5f * (1.5f - num812); - projectile.damage = projectile2.damage; - double damageMult = 1.0 + (double)(projectile2.ai[0] * 0.0015f); //1 to 2.0 (1400 * x) - if (damageMult > 2.0) + + // Takes 360 frames to reach normal damage + float amount = projectile2.ai[0] / 1200f; + if (amount > 1f) + amount = 1f; + projectile.damage = (int)(projectile2.damage * MathHelper.Lerp(0.25f, 2.5f, amount)); + + if (projectile2.ai[0] >= 720f) { - damageMult = 2.0; - } - if (projectile2.ai[0] >= 720f) - { - projectile.damage = (int)((double)projectile.damage * damageMult); vector71 = new Vector2?(projectile2.Center); } if (!Collision.CanHitLine(Main.player[projectile.owner].Center, 0, 0, projectile2.Center, 0, 0)) @@ -164,8 +164,8 @@ namespace CalamityMod.Projectiles.Magic num821 += array3[num822]; } num821 /= num819; - float amount = 0.75f; - projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num821, amount); + float amount2 = 0.75f; + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num821, amount2); if (Math.Abs(projectile.localAI[1] - num821) < 100f && projectile.scale > 0.15f) { //color.A = 0; diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index d3638d596b..b23e0c9d86 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Magic/DemonicPitchforkProj.cs b/Projectiles/Magic/DemonicPitchforkProj.cs index 604645523e..950e990e64 100644 --- a/Projectiles/Magic/DemonicPitchforkProj.cs +++ b/Projectiles/Magic/DemonicPitchforkProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/DivineRetributionSpear.cs b/Projectiles/Magic/DivineRetributionSpear.cs index 0bf105abfc..d1182f6a79 100644 --- a/Projectiles/Magic/DivineRetributionSpear.cs +++ b/Projectiles/Magic/DivineRetributionSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74, 1f, 0f); + Main.PlaySound(SoundID.Item74, (int)projectile.Center.X, (int)projectile.Center.Y); for (int num193 = 0; num193 < 6; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0, 0); diff --git a/Projectiles/Magic/DustProjectile.cs b/Projectiles/Magic/DustProjectile.cs index 1c313160d9..23cab8e791 100644 --- a/Projectiles/Magic/DustProjectile.cs +++ b/Projectiles/Magic/DustProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/EelDrop.cs b/Projectiles/Magic/EelDrop.cs index e6609a9a17..343379a522 100644 --- a/Projectiles/Magic/EelDrop.cs +++ b/Projectiles/Magic/EelDrop.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/EidolicWailSoundwave.cs b/Projectiles/Magic/EidolicWailSoundwave.cs index a095f73028..f071e356a9 100644 --- a/Projectiles/Magic/EidolicWailSoundwave.cs +++ b/Projectiles/Magic/EidolicWailSoundwave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Magic/EldritchTentacle.cs b/Projectiles/Magic/EldritchTentacle.cs index 22ca7df952..d79d073875 100644 --- a/Projectiles/Magic/EldritchTentacle.cs +++ b/Projectiles/Magic/EldritchTentacle.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/ElementBolt.cs b/Projectiles/Magic/ElementBolt.cs index fafca19a86..e5c22c235f 100644 --- a/Projectiles/Magic/ElementBolt.cs +++ b/Projectiles/Magic/ElementBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/ElementBolt2.cs b/Projectiles/Magic/ElementBolt2.cs index 09c2309267..9a155cdd78 100644 --- a/Projectiles/Magic/ElementBolt2.cs +++ b/Projectiles/Magic/ElementBolt2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/ElementOrb.cs b/Projectiles/Magic/ElementOrb.cs index d264190678..b1e0a7d19b 100644 --- a/Projectiles/Magic/ElementOrb.cs +++ b/Projectiles/Magic/ElementOrb.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class ElementOrb : ModProjectile + public class ElementOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/ElementOrb2.cs b/Projectiles/Magic/ElementOrb2.cs index b950d639ac..f57e76a5f6 100644 --- a/Projectiles/Magic/ElementOrb2.cs +++ b/Projectiles/Magic/ElementOrb2.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class ElementOrb2 : ModProjectile + public class ElementOrb2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/ElementTentacle.cs b/Projectiles/Magic/ElementTentacle.cs index 3db33a9ecc..e7c808b252 100644 --- a/Projectiles/Magic/ElementTentacle.cs +++ b/Projectiles/Magic/ElementTentacle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Magic/ElementalRayBeam.cs b/Projectiles/Magic/ElementalRayBeam.cs index 8e554902df..12433c8b39 100644 --- a/Projectiles/Magic/ElementalRayBeam.cs +++ b/Projectiles/Magic/ElementalRayBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Magic/EnormousConsumingVortex.cs b/Projectiles/Magic/EnormousConsumingVortex.cs new file mode 100644 index 0000000000..12665a5124 --- /dev/null +++ b/Projectiles/Magic/EnormousConsumingVortex.cs @@ -0,0 +1,204 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class EnormousConsumingVortex : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float IdealScale + { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + public const int TentacleSpawnRate = 30; + public const int PulseInterval = 18; + public const float PulseHitboxExpandRatio = 2.5f; + public const float RadialOffsetVarianceFactor = 0.1f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Subsuming Vortex"); + ProjectileID.Sets.NeedsUUID[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 2; + projectile.height = 2; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.scale = 0.0004f; + projectile.timeLeft = 540; + projectile.tileCollide = false; + projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 17; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(IdealScale); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + IdealScale = reader.ReadSingle(); + } + + public override void AI() + { + projectile.rotation += MathHelper.ToRadians(8f); // Spin 2 win. + projectile.alpha = (int)MathHelper.Lerp(255, 0, Utils.InverseLerp(0f, 20f, Time, true)); // Fade in completely after 20 frames. + projectile.scale = MathHelper.Lerp(0.0004f, IdealScale, Utils.InverseLerp(0f, 30f, Time, true)); // Expand completely after 30 frames. + + // Determine the ideal scale in the first frame. + if (IdealScale == 0f) + { + IdealScale = Main.rand.NextFloat(2.2f, 3f); + projectile.netUpdate = true; + } + + // Target enemy if possible and idly spawn tentacles. + if (Time < 300) + { + TargetingMovement(); + if (Time % TentacleSpawnRate == TentacleSpawnRate - 1 && Main.netMode != NetmodeID.MultiplayerClient) + { + ProduceSubsumingHentai(); + } + } + // Slow down and pulse frequently. + else if (Time < 480) + { + projectile.velocity *= 0.96f; + if (Time % PulseInterval == 0f) + { + PulseEffect(); + } + } + else if (Time == 520f) + { + ExplodeEffect(); + projectile.Kill(); + } + CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(projectile.scale * 62)); + Time++; + } + public void ProduceSubsumingHentai() + { + float xStartingAcceleration = Main.rand.NextFloat(0.001f, 0.04f) * Main.rand.NextBool(2).ToDirectionInt(); + float yStartingAcceleration = Main.rand.NextFloat(0.001f, 0.04f) * Main.rand.NextBool(2).ToDirectionInt(); + Projectile subsumingHentai = Projectile.NewProjectileDirect(projectile.Center, + Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(9f, 13f), + ModContent.ProjectileType(), + (int)(projectile.damage * 0.6), + projectile.knockBack * 0.6f, + projectile.owner, + xStartingAcceleration, + yStartingAcceleration); + subsumingHentai.tileCollide = false; + } + + public void TargetingMovement() + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1500f, true); + if (potentialTarget != null) + { + projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(potentialTarget.Center) * 7f) / 6f; + } + } + public void PulseEffect() + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, PulseHitboxExpandRatio); + projectile.Damage(); + if (!Main.dedServ) + { + Main.PlaySound(SoundID.Item43, projectile.Center); + for (int i = 0; (float)i < 85; i++) + { + float angle = i / 85f * MathHelper.TwoPi; + Vector2 spawnPosition = projectile.Center + angle.ToRotationVector2() * (500f + Main.rand.NextFloat(-8f, 8f)); + Vector2 velocity = (angle - (float)Math.PI).ToRotationVector2() * Main.rand.NextFloat(27f, 38.5f); + Dust dust = Dust.NewDustPerfect(spawnPosition, 264, velocity); + dust.scale = 0.9f; + dust.fadeIn = 1.25f; + dust.color = Main.hslToRgb(i / 85f, 1f, 0.8f); + dust.noGravity = true; + } + } + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 1f / PulseHitboxExpandRatio); + } + public void ExplodeEffect() + { + Main.PlaySound(SoundID.Zombie, projectile.Center, 104); + if (!Main.dedServ) + { + for (int i = 0; i < 200; i++) + { + Vector2 velocity = Main.rand.NextVector2Circular(50f, 50f); + Dust dust = Dust.NewDustPerfect(projectile.Center, 264, velocity); + dust.color = Main.hslToRgb(i / 100f % 1f, 1f, 0.8f); + dust.fadeIn = 1.25f; + dust.noGravity = true; + } + } + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC closestTarget = projectile.Center.ClosestNPCAt(1600f, true); + for (int i = 0; i < 12; i++) + { + float rotation = Main.rand.NextFloat(MathHelper.TwoPi); + Vector2 velocity = Vector2.UnitY.RotatedBy(rotation); + if (closestTarget != null) + velocity = projectile.DirectionTo(closestTarget.Center).RotatedByRandom(0.4f); + velocity *= Main.rand.NextFloat(3f, 5f); + Projectile.NewProjectileDirect(projectile.Center, + velocity, + ModContent.ProjectileType(), + (int)(projectile.damage * 0.7), + projectile.knockBack, + projectile.owner, + 0f, + Main.rand.NextFloat(0.5f, 1.8f)); + } + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + int vortexesToDraw = 27; + for (int i = 0; i < vortexesToDraw; i++) + { + float rotation = MathHelper.TwoPi / i * vortexesToDraw + projectile.rotation; + float drawScale = projectile.scale * 0.66f; + + drawScale *= (float)(Math.Cos(Time / 18f + rotation * 2f) + 1f) * 0.3f + 0.7f; // Range of 0.7 to 1. Used to give variance with the scale. + float offsetFactor = (float)(Math.Sin(Time / 18f + rotation * 2f) + 1f) * 0.2f + 0.8f; // Range of 0.8 to 1. + + // Due to the way RotatedBy works, the offset can be negative, giving the projectile a + // dual buzzsaw look. + Vector2 drawOffset = Vector2.UnitX.RotatedBy(rotation) * 30f * offsetFactor * drawScale; + Vector2 drawPosition = projectile.Center + drawOffset - Main.screenPosition; + Color colorToDraw = Main.hslToRgb((i / (float)vortexesToDraw + Time / 40f) % 1f, 1f, 0.75f); + spriteBatch.Draw(ModContent.GetTexture(Texture), + drawPosition, + null, + colorToDraw * 0.7f, + rotation, + ModContent.GetTexture(Texture).Size() * 0.5f, + drawScale, + SpriteEffects.None, + 0f); + } + return false; + } + } +} diff --git a/Projectiles/Magic/EnormousConsumingVortex.png b/Projectiles/Magic/EnormousConsumingVortex.png new file mode 100644 index 0000000000..0e1de2dd8f Binary files /dev/null and b/Projectiles/Magic/EnormousConsumingVortex.png differ diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index 6b0a36baff..d1ded915c0 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class EternityBook : ModProjectile + public class EternityBook : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/EventHorizonBlackhole.cs b/Projectiles/Magic/EventHorizonBlackhole.cs index ecedc4a842..1aa100d4de 100644 --- a/Projectiles/Magic/EventHorizonBlackhole.cs +++ b/Projectiles/Magic/EventHorizonBlackhole.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class EventHorizonBlackhole : ModProjectile + public class EventHorizonBlackhole : ModProjectile { public int killCounter = 21; diff --git a/Projectiles/Magic/EventHorizonStar.cs b/Projectiles/Magic/EventHorizonStar.cs index 7b907b373d..45a8c88f6d 100644 --- a/Projectiles/Magic/EventHorizonStar.cs +++ b/Projectiles/Magic/EventHorizonStar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -41,9 +41,9 @@ namespace CalamityMod.Projectiles.Magic { projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); - } + { + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); + } } //dust effects diff --git a/Projectiles/Magic/EvergladeSprayProjectile.cs b/Projectiles/Magic/EvergladeSprayProjectile.cs index 5f148f2805..55243a5a1d 100644 --- a/Projectiles/Magic/EvergladeSprayProjectile.cs +++ b/Projectiles/Magic/EvergladeSprayProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 8; - target.AddBuff(BuffID.Ichor, 900); + target.AddBuff(BuffID.Ichor, 600); target.AddBuff(BuffID.CursedInferno, 300); } diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index f5424a6bf5..cfbd639b34 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/FabOrb.cs b/Projectiles/Magic/FabOrb.cs index bf8c330a45..7ffb1f294b 100644 --- a/Projectiles/Magic/FabOrb.cs +++ b/Projectiles/Magic/FabOrb.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class FabOrb : ModProjectile + public class FabOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index f8f454aa61..55c9ed27ad 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/FatesRevealFlame.cs b/Projectiles/Magic/FatesRevealFlame.cs index b661b6d6e8..23548918c4 100644 --- a/Projectiles/Magic/FatesRevealFlame.cs +++ b/Projectiles/Magic/FatesRevealFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/FlameBeamTip.cs b/Projectiles/Magic/FlameBeamTip.cs index 5fe267103d..f862965897 100644 --- a/Projectiles/Magic/FlameBeamTip.cs +++ b/Projectiles/Magic/FlameBeamTip.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic int number = Projectile.NewProjectile(projectile.position.X + projectile.velocity.X + (float)(projectile.width / 2), projectile.position.Y + projectile.velocity.Y + (float)(projectile.height / 2), projectile.velocity.X, projectile.velocity.Y, num48, projectile.damage, projectile.knockBack, projectile.owner, 0f, projectile.ai[1] + 1f); - NetMessage.SendData(27, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Magic/FlameBeamTip2.cs b/Projectiles/Magic/FlameBeamTip2.cs index d1b0c79f75..5c67f54258 100644 --- a/Projectiles/Magic/FlameBeamTip2.cs +++ b/Projectiles/Magic/FlameBeamTip2.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/FlareBoltProjectile.cs b/Projectiles/Magic/FlareBoltProjectile.cs index a274b117aa..f8063b51ee 100644 --- a/Projectiles/Magic/FlareBoltProjectile.cs +++ b/Projectiles/Magic/FlareBoltProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -81,14 +81,14 @@ namespace CalamityMod.Projectiles.Magic { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/ForbiddenAxeBlade.cs b/Projectiles/Magic/ForbiddenAxeBlade.cs index f020086bb1..4b1268f76f 100644 --- a/Projectiles/Magic/ForbiddenAxeBlade.cs +++ b/Projectiles/Magic/ForbiddenAxeBlade.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class ForbiddenAxeBlade : ModProjectile + public class ForbiddenAxeBlade : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs index e038c35b7a..cbb7db1bf6 100644 --- a/Projectiles/Magic/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -1,4 +1,3 @@ -using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class ForbiddenSunProjectile : ModProjectile + public class ForbiddenSunProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -44,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } if (Main.rand.NextBool(4)) diff --git a/Projectiles/Magic/ForbiddenSunburst.cs b/Projectiles/Magic/ForbiddenSunburst.cs index 7fb386a91a..73600c0ddf 100644 --- a/Projectiles/Magic/ForbiddenSunburst.cs +++ b/Projectiles/Magic/ForbiddenSunburst.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } float num461 = 25f; diff --git a/Projectiles/Magic/FrigidflashBoltProjectile.cs b/Projectiles/Magic/FrigidflashBoltProjectile.cs index bb7a46ad26..e9e5fc4756 100644 --- a/Projectiles/Magic/FrigidflashBoltProjectile.cs +++ b/Projectiles/Magic/FrigidflashBoltProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -101,14 +101,14 @@ namespace CalamityMod.Projectiles.Magic { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 3; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 174, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/FrostBoltProjectile.cs b/Projectiles/Magic/FrostBoltProjectile.cs index c34ac48be7..8dc84cbcdf 100644 --- a/Projectiles/Magic/FrostBoltProjectile.cs +++ b/Projectiles/Magic/FrostBoltProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -82,14 +82,14 @@ namespace CalamityMod.Projectiles.Magic { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/GammaLaser.cs b/Projectiles/Magic/GammaLaser.cs index 7424f9dd7d..b8fd95d0ba 100644 --- a/Projectiles/Magic/GammaLaser.cs +++ b/Projectiles/Magic/GammaLaser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/GhastlyBlast.cs b/Projectiles/Magic/GhastlyBlast.cs index 881e97db47..9d634abeb2 100644 --- a/Projectiles/Magic/GhastlyBlast.cs +++ b/Projectiles/Magic/GhastlyBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/GhastlyExplosion.cs b/Projectiles/Magic/GhastlyExplosion.cs index 34e7b09ce4..f5ceb28200 100644 --- a/Projectiles/Magic/GhastlyExplosion.cs +++ b/Projectiles/Magic/GhastlyExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/GhastlyExplosionShard.cs b/Projectiles/Magic/GhastlyExplosionShard.cs index 4d0a5c284f..5b13254d52 100644 --- a/Projectiles/Magic/GhastlyExplosionShard.cs +++ b/Projectiles/Magic/GhastlyExplosionShard.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/GhastlySubBlast.cs b/Projectiles/Magic/GhastlySubBlast.cs index 4ec6cbd4b3..0636f7a965 100644 --- a/Projectiles/Magic/GhastlySubBlast.cs +++ b/Projectiles/Magic/GhastlySubBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/GhastlyVisageProj.cs b/Projectiles/Magic/GhastlyVisageProj.cs index 1ee6267dcb..00386b307a 100644 --- a/Projectiles/Magic/GhastlyVisageProj.cs +++ b/Projectiles/Magic/GhastlyVisageProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/GleamingBolt.cs b/Projectiles/Magic/GleamingBolt.cs index e5521a429b..44e0aa1684 100644 --- a/Projectiles/Magic/GleamingBolt.cs +++ b/Projectiles/Magic/GleamingBolt.cs @@ -1,5 +1,6 @@ -using System; +using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -61,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); + Main.PlaySound(SoundID.Item105, projectile.position); } } } diff --git a/Projectiles/Magic/GleamingBolt2.cs b/Projectiles/Magic/GleamingBolt2.cs index 6e9532b445..a8d0633ee3 100644 --- a/Projectiles/Magic/GleamingBolt2.cs +++ b/Projectiles/Magic/GleamingBolt2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/GraniteEnergy.cs b/Projectiles/Magic/GraniteEnergy.cs index b924ca6b51..7c2308e3e9 100644 --- a/Projectiles/Magic/GraniteEnergy.cs +++ b/Projectiles/Magic/GraniteEnergy.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index 349bc7bda1..7aaecbf6db 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -86,7 +87,7 @@ namespace CalamityMod.Projectiles.Magic } if (count == 0f) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 53); + Main.PlaySound(SoundID.NPCHit53, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; @@ -115,7 +116,7 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.timeLeft % 50 == 49) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 53); + Main.PlaySound(SoundID.NPCHit53, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Magic/HadopelagicEcho2.cs b/Projectiles/Magic/HadopelagicEcho2.cs index 80f50a1998..44ba8e87b2 100644 --- a/Projectiles/Magic/HadopelagicEcho2.cs +++ b/Projectiles/Magic/HadopelagicEcho2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.cs b/Projectiles/Magic/HadopelagicEchoSoundwave.cs index 69b758804c..9d0a35464b 100644 --- a/Projectiles/Magic/HadopelagicEchoSoundwave.cs +++ b/Projectiles/Magic/HadopelagicEchoSoundwave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(BuffID.Ichor, 600); + target.AddBuff(BuffID.Ichor, 300); target.AddBuff(BuffID.Electrified, 600); projectile.velocity *= 0.85f; diff --git a/Projectiles/Magic/HeliumFlashBlast.cs b/Projectiles/Magic/HeliumFlashBlast.cs index 7946e62696..b7964ece9c 100644 --- a/Projectiles/Magic/HeliumFlashBlast.cs +++ b/Projectiles/Magic/HeliumFlashBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs index 415ef0e59a..5d93265066 100644 --- a/Projectiles/Magic/HellfireExplosionFriendly.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, 0.9f, 0f, 0f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } float num461 = 25f; diff --git a/Projectiles/Magic/HellwingPillar.cs b/Projectiles/Magic/HellwingPillar.cs index db0af81273..0ebaa25551 100644 --- a/Projectiles/Magic/HellwingPillar.cs +++ b/Projectiles/Magic/HellwingPillar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/HolyFlame.cs b/Projectiles/Magic/HolyFlame.cs index 894b921ab4..c9ae5b511a 100644 --- a/Projectiles/Magic/HolyFlame.cs +++ b/Projectiles/Magic/HolyFlame.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -46,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/HolyLaser.cs b/Projectiles/Magic/HolyLaser.cs index e723022d10..97df80133e 100644 --- a/Projectiles/Magic/HolyLaser.cs +++ b/Projectiles/Magic/HolyLaser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs index 5c73582f71..c8b926209a 100644 --- a/Projectiles/Magic/IceBarrageMain.cs +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; diff --git a/Projectiles/Magic/IceBlock.cs b/Projectiles/Magic/IceBlock.cs index 97038953c2..cd6f7918a1 100644 --- a/Projectiles/Magic/IceBlock.cs +++ b/Projectiles/Magic/IceBlock.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using Terraria.ID; using Microsoft.Xna.Framework; diff --git a/Projectiles/Magic/IceBlockIcicle.cs b/Projectiles/Magic/IceBlockIcicle.cs index 93e0b7d34f..b0fdc30606 100644 --- a/Projectiles/Magic/IceBlockIcicle.cs +++ b/Projectiles/Magic/IceBlockIcicle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using Terraria.ID; using Microsoft.Xna.Framework; diff --git a/Projectiles/Magic/IceCluster.cs b/Projectiles/Magic/IceCluster.cs index d6b2d3d494..ab34bb945e 100644 --- a/Projectiles/Magic/IceCluster.cs +++ b/Projectiles/Magic/IceCluster.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.localAI[1] == 0f) { projectile.localAI[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 120); + Main.PlaySound(SoundID.Item120, projectile.position); } projectile.ai[0] += 1f; if (projectile.ai[1] == 1f) diff --git a/Projectiles/Magic/IceSpike.cs b/Projectiles/Magic/IceSpike.cs index dab2eb5eb7..5ed2964f46 100644 --- a/Projectiles/Magic/IceSpike.cs +++ b/Projectiles/Magic/IceSpike.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class IceSpike : ModProjectile + public class IceSpike : ModProjectile { public override void SetStaticDefaults() { @@ -38,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, 0f, 0f); diff --git a/Projectiles/Magic/IcicleStaffProj.cs b/Projectiles/Magic/IcicleStaffProj.cs index 653f482c69..4c49846feb 100644 --- a/Projectiles/Magic/IcicleStaffProj.cs +++ b/Projectiles/Magic/IcicleStaffProj.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/InfernadoFriendly.cs b/Projectiles/Magic/InfernadoFriendly.cs index f85cdf646d..bb3b9ea766 100644 --- a/Projectiles/Magic/InfernadoFriendly.cs +++ b/Projectiles/Magic/InfernadoFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/InfernadoMarkFriendly.cs b/Projectiles/Magic/InfernadoMarkFriendly.cs index 7e507eb301..9955f7dc44 100644 --- a/Projectiles/Magic/InfernadoMarkFriendly.cs +++ b/Projectiles/Magic/InfernadoMarkFriendly.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -91,7 +92,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Magic/InfernalBlade.cs b/Projectiles/Magic/InfernalBlade.cs index cc1ba229aa..a7fd668903 100644 --- a/Projectiles/Magic/InfernalBlade.cs +++ b/Projectiles/Magic/InfernalBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (projectile.alpha > 0) { - Main.PlaySound(2, projectile.Center, 9); + Main.PlaySound(SoundID.Item9, projectile.Center); projectile.alpha = 0; projectile.scale = 1.1f; projectile.frame = Main.rand.Next(14); @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { diff --git a/Projectiles/Magic/InfernalBlade2.cs b/Projectiles/Magic/InfernalBlade2.cs index 8e060ee103..22530b77c6 100644 --- a/Projectiles/Magic/InfernalBlade2.cs +++ b/Projectiles/Magic/InfernalBlade2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (projectile.alpha > 0) { - Main.PlaySound(2, projectile.Center, 9); + Main.PlaySound(SoundID.Item9, projectile.Center); projectile.alpha = 0; projectile.scale = 1.1f; projectile.frame = Main.rand.Next(14); @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { diff --git a/Projectiles/Magic/IonBlast.cs b/Projectiles/Magic/IonBlast.cs index 1a13ca1d51..8215cd5cb6 100644 --- a/Projectiles/Magic/IonBlast.cs +++ b/Projectiles/Magic/IonBlast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.Center); int num212 = Main.rand.Next(15, 30); for (int num213 = 0; num213 < num212; num213++) { diff --git a/Projectiles/Magic/KeelhaulBubble.cs b/Projectiles/Magic/KeelhaulBubble.cs index 11803c4852..84159f45e6 100644 --- a/Projectiles/Magic/KeelhaulBubble.cs +++ b/Projectiles/Magic/KeelhaulBubble.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/KeelhaulGeyserBottom.cs b/Projectiles/Magic/KeelhaulGeyserBottom.cs index 170d9bc032..0cd9ab5d5f 100644 --- a/Projectiles/Magic/KeelhaulGeyserBottom.cs +++ b/Projectiles/Magic/KeelhaulGeyserBottom.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/KeelhaulGeyserTop.cs b/Projectiles/Magic/KeelhaulGeyserTop.cs index 95e52c7503..43e9326ec2 100644 --- a/Projectiles/Magic/KeelhaulGeyserTop.cs +++ b/Projectiles/Magic/KeelhaulGeyserTop.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/LightBall.cs b/Projectiles/Magic/LightBall.cs index 666fe062c3..15b95e91ff 100644 --- a/Projectiles/Magic/LightBall.cs +++ b/Projectiles/Magic/LightBall.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 300; diff --git a/Projectiles/Magic/LightBallExplosion.cs b/Projectiles/Magic/LightBallExplosion.cs index 4aa8be71f4..c425dc446a 100644 --- a/Projectiles/Magic/LightBallExplosion.cs +++ b/Projectiles/Magic/LightBallExplosion.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { public class LightBallExplosion : ModProjectile diff --git a/Projectiles/Magic/LightBead.cs b/Projectiles/Magic/LightBead.cs index 07c6ba41a1..237effaa0b 100644 --- a/Projectiles/Magic/LightBead.cs +++ b/Projectiles/Magic/LightBead.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class LightBead : ModProjectile + public class LightBead : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/LightBeadSplit.cs b/Projectiles/Magic/LightBeadSplit.cs index cbe9368173..27905807ff 100644 --- a/Projectiles/Magic/LightBeadSplit.cs +++ b/Projectiles/Magic/LightBeadSplit.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/LightBlade.cs b/Projectiles/Magic/LightBlade.cs index 71c43ec66b..cd69b4018c 100644 --- a/Projectiles/Magic/LightBlade.cs +++ b/Projectiles/Magic/LightBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 3); + Main.PlaySound(SoundID.NPCHit3, projectile.position); int numDust = Main.rand.Next(4, 10); for (int i = 0; i < numDust; i++) { diff --git a/Projectiles/Magic/LightningArc.cs b/Projectiles/Magic/LightningArc.cs index fdaceac136..f657f594c3 100644 --- a/Projectiles/Magic/LightningArc.cs +++ b/Projectiles/Magic/LightningArc.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using Terraria; diff --git a/Projectiles/Magic/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs index c4e6b3ee3c..0e2c572a75 100644 --- a/Projectiles/Magic/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Magic Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (projectile.alpha > 0) { - Main.PlaySound(2, projectile.Center, 9); + Main.PlaySound(SoundID.Item9, projectile.position); projectile.alpha = 0; projectile.scale = 1.1f; projectile.frame = Main.rand.Next(14); @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { @@ -147,12 +147,12 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.75), 1f, projectile.owner); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 1f, projectile.owner); } - target.AddBuff(BuffID.Ichor, 1200); - target.AddBuff(BuffID.Frostburn, 1200); - target.AddBuff(BuffID.OnFire, 1200); - target.AddBuff(BuffID.CursedInferno, 1200); + target.AddBuff(BuffID.Ichor, 200); + target.AddBuff(BuffID.Frostburn, 200); + target.AddBuff(BuffID.OnFire, 200); + target.AddBuff(BuffID.CursedInferno, 100); } } } diff --git a/Projectiles/Magic/LiquidBlade2.cs b/Projectiles/Magic/LiquidBlade2.cs index 6280fdc6e9..613abf79c2 100644 --- a/Projectiles/Magic/LiquidBlade2.cs +++ b/Projectiles/Magic/LiquidBlade2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (projectile.alpha > 0) { - Main.PlaySound(2, projectile.Center, 9); + Main.PlaySound(SoundID.Item9, projectile.position); projectile.alpha = 0; projectile.scale = 1.1f; projectile.frame = Main.rand.Next(14); @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); int num487 = Main.rand.Next(4, 10); for (int num488 = 0; num488 < num487; num488++) { @@ -119,10 +119,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 1200); - target.AddBuff(BuffID.Frostburn, 1200); - target.AddBuff(BuffID.OnFire, 1200); - target.AddBuff(BuffID.CursedInferno, 1200); + target.AddBuff(BuffID.Ichor, 200); + target.AddBuff(BuffID.Frostburn, 200); + target.AddBuff(BuffID.OnFire, 200); + target.AddBuff(BuffID.CursedInferno, 100); } } } diff --git a/Projectiles/Magic/LuxorsGiftMagic.cs b/Projectiles/Magic/LuxorsGiftMagic.cs index c631247b9e..7b8b3cd489 100644 --- a/Projectiles/Magic/LuxorsGiftMagic.cs +++ b/Projectiles/Magic/LuxorsGiftMagic.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index 3a2afdbdc8..4f67a37f6f 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -40,15 +40,15 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(BuffID.Poisoned, 600); - target.AddBuff(BuffID.OnFire, 600); - target.AddBuff(BuffID.CursedInferno, 600); - target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(BuffID.Venom, 600); - target.AddBuff(BuffID.ShadowFlame, 600); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffID.Poisoned, 300); + target.AddBuff(BuffID.OnFire, 300); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(BuffID.Venom, 300); + target.AddBuff(BuffID.ShadowFlame, 300); } public override void Kill(int timeLeft) @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic float num52 = 2.5f; Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 1f, 0f); + Main.PlaySound(SoundID.Item20, projectile.Center); projectile.position = projectile.Center; projectile.width = projectile.height = height; projectile.Center = projectile.position; diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index 19794bc64e..801fa20a18 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs index 5ee9716152..d4d16ef5e5 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGasCloud.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index 14348260e6..dc1add9ccf 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index fa51ee75d0..7188ea80f2 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index eb608d1b4e..b7946e54e1 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic float num52 = 3.8f; Vector2 value3 = (0f - 1.57079637f).ToRotationVector2(); Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 2f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 20, 2f, 0f); Main.PlaySound(SoundID.Item107, projectile.position); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(projectile.Center, -projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs index b5bbf4b1ab..0cd115e19d 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailShrapnel.cs @@ -1,10 +1,9 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class MadAlchemistsCocktailShrapnel : ModProjectile + public class MadAlchemistsCocktailShrapnel : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/MagicNebulaShot.cs b/Projectiles/Magic/MagicNebulaShot.cs index 1f9affab8c..43293cf1d2 100644 --- a/Projectiles/Magic/MagicNebulaShot.cs +++ b/Projectiles/Magic/MagicNebulaShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + Main.PlaySound(SoundID.Item12, projectile.position); } if (projectile.alpha > 0) { diff --git a/Projectiles/Magic/MagnaBlast.cs b/Projectiles/Magic/MagnaBlast.cs index 7ac033a780..6f12b10dac 100644 --- a/Projectiles/Magic/MagnaBlast.cs +++ b/Projectiles/Magic/MagnaBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/MagneticBeam.cs b/Projectiles/Magic/MagneticBeam.cs index d7ff75620b..453164ab0d 100644 --- a/Projectiles/Magic/MagneticBeam.cs +++ b/Projectiles/Magic/MagneticBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/MagneticOrb.cs b/Projectiles/Magic/MagneticOrb.cs index 6270b2948d..799b640ce6 100644 --- a/Projectiles/Magic/MagneticOrb.cs +++ b/Projectiles/Magic/MagneticOrb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index cfacbdbd4a..d3a4e48a0d 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -203,7 +203,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Magic/ManaBolt.cs b/Projectiles/Magic/ManaBolt.cs index 184255ed6f..86627663b3 100644 --- a/Projectiles/Magic/ManaBolt.cs +++ b/Projectiles/Magic/ManaBolt.cs @@ -1,5 +1,6 @@ -using System; +using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -54,7 +55,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } } } diff --git a/Projectiles/Magic/ManaBoltSmall.cs b/Projectiles/Magic/ManaBoltSmall.cs index fa9fb3df1d..435e130b22 100644 --- a/Projectiles/Magic/ManaBoltSmall.cs +++ b/Projectiles/Magic/ManaBoltSmall.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -27,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; projectile.velocity.X *= 0.975f; projectile.velocity.Y *= 0.975f; - if (Main.rand.NextBool(2)) + if (projectile.timeLeft % 4 == 0) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } } } diff --git a/Projectiles/Magic/ManaBoltSmall2.cs b/Projectiles/Magic/ManaBoltSmall2.cs index db5781dd73..8a01866544 100644 --- a/Projectiles/Magic/ManaBoltSmall2.cs +++ b/Projectiles/Magic/ManaBoltSmall2.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -27,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; projectile.velocity.X *= 0.975f; projectile.velocity.Y *= 0.975f; - if (Main.rand.NextBool(2)) + if (projectile.timeLeft % 4 == 0) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } @@ -37,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } } } diff --git a/Projectiles/Magic/MelterAmp.cs b/Projectiles/Magic/MelterAmp.cs index ece39897a6..defab26993 100644 --- a/Projectiles/Magic/MelterAmp.cs +++ b/Projectiles/Magic/MelterAmp.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/MelterNote1.cs b/Projectiles/Magic/MelterNote1.cs index 40f1923371..661f494e19 100644 --- a/Projectiles/Magic/MelterNote1.cs +++ b/Projectiles/Magic/MelterNote1.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/MelterNote2.cs b/Projectiles/Magic/MelterNote2.cs index 22907e9d84..6da02af0a4 100644 --- a/Projectiles/Magic/MelterNote2.cs +++ b/Projectiles/Magic/MelterNote2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/MiasmaGas.cs b/Projectiles/Magic/MiasmaGas.cs index 3dbb75fdef..29fb35f4ee 100644 --- a/Projectiles/Magic/MiasmaGas.cs +++ b/Projectiles/Magic/MiasmaGas.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/NettleRight.cs b/Projectiles/Magic/NettleRight.cs index 15ab045ace..00369b457f 100644 --- a/Projectiles/Magic/NettleRight.cs +++ b/Projectiles/Magic/NettleRight.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class NettleRight : ModProjectile + public class NettleRight : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/NettleTip.cs b/Projectiles/Magic/NettleTip.cs index 0ad4cb465e..9ba21f48b7 100644 --- a/Projectiles/Magic/NettleTip.cs +++ b/Projectiles/Magic/NettleTip.cs @@ -1,9 +1,8 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class NettleTip : ModProjectile + public class NettleTip : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/NightBolt.cs b/Projectiles/Magic/NightBolt.cs index 45ba8f5b56..c40e79b84f 100644 --- a/Projectiles/Magic/NightBolt.cs +++ b/Projectiles/Magic/NightBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/NightOrb.cs b/Projectiles/Magic/NightOrb.cs index 15429d5a0c..a88208e905 100644 --- a/Projectiles/Magic/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class NightOrb : ModProjectile + public class NightOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/NightsRayBeam.cs b/Projectiles/Magic/NightsRayBeam.cs index 7733b371fc..bfcfe17a55 100644 --- a/Projectiles/Magic/NightsRayBeam.cs +++ b/Projectiles/Magic/NightsRayBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index 9f58a84dfc..128fd4c314 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -22,7 +23,6 @@ namespace CalamityMod.Projectiles.Magic projectile.height = 60; projectile.alpha = 255; projectile.friendly = true; - projectile.aiStyle = 71; projectile.magic = true; projectile.penetrate = -1; projectile.timeLeft = 600; @@ -31,9 +31,99 @@ namespace CalamityMod.Projectiles.Magic projectile.ignoreWater = true; } + public override void AI() + { + projectile.localAI[1] += 1f; + if (projectile.localAI[1] > 10f && Main.rand.NextBool(3)) + { + int num = 6; + for (int index1 = 0; index1 < num; ++index1) + { + Vector2 vector2_1 = (Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f).RotatedBy((double)(index1 - (num / 2 - 1)) * Math.PI / (double)num, new Vector2()) + projectile.Center; + Vector2 vector2_2 = ((Main.rand.NextFloat() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int index2 = Dust.NewDust(vector2_1 + vector2_2, 0, 0, 217, vector2_2.X * 2f, vector2_2.Y * 2f, 100, new Color(), 1.4f); + Dust dust = Main.dust[index2]; + dust.noGravity = true; + dust.noLight = true; + dust.velocity /= 4f; + dust.velocity -= projectile.velocity; + } + projectile.alpha -= 5; + if (projectile.alpha < 50) + projectile.alpha = 50; + projectile.rotation += projectile.velocity.X * 0.1f; + projectile.frame = (int)(projectile.localAI[1] / 3f) % 3; + Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, 0.1f, 0.4f, 0.6f); + } + int num1 = -1; + Vector2 vector2 = projectile.Center; + float num2 = 500f; + Vector2 value = new Vector2(0.5f); + if (projectile.localAI[0] > 0f) + { + projectile.localAI[0] -= 1f; + } + if (projectile.ai[0] == 0f && projectile.localAI[0] == 0f) + { + for (int index = 0; index < Main.maxNPCs; ++index) + { + NPC npc = Main.npc[index]; + if (npc.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == (index + 1f))) + { + Vector2 center = npc.position + npc.Size * value; + float num3 = Vector2.Distance(center, vector2); + if (num3 < num2 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + { + num2 = num3; + vector2 = center; + num1 = index; + } + } + } + if (num1 >= 0) + { + projectile.ai[0] = num1 + 1f; + projectile.netUpdate = true; + } + } + if (projectile.localAI[0] == 0f && projectile.ai[0] == 0f) + projectile.localAI[0] = 30f; + bool flag = false; + if (projectile.ai[0] != 0f) + { + int index = (int)(projectile.ai[0] - 1); + if (Main.npc[index].active && !Main.npc[index].dontTakeDamage && Main.npc[index].immune[projectile.owner] == 0) + { + if ((Math.Abs(projectile.Center.X - Main.npc[index].Center.X) + Math.Abs(projectile.Center.Y - Main.npc[index].Center.Y)) < 1000f) + { + flag = true; + vector2 = Main.npc[index].Center; + } + } + else + { + projectile.ai[0] = 0f; + flag = false; + projectile.netUpdate = true; + } + } + if (flag) + { + double num3 = (double)(vector2 - projectile.Center).ToRotation() - (double)projectile.velocity.ToRotation(); + if (num3 > Math.PI) + num3 -= 2.0 * Math.PI; + if (num3 < -1.0 * Math.PI) + num3 += 2.0 * Math.PI; + projectile.velocity = projectile.velocity.RotatedBy(num3 * 0.1, new Vector2()); + } + float num4 = projectile.velocity.Length(); + projectile.velocity.Normalize(); + projectile.velocity = projectile.velocity * (num4 + 1f / 400f); + } + public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 5; k++) { int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 34, 0f, 0f); diff --git a/Projectiles/Magic/ParticleBeamofDoom.cs b/Projectiles/Magic/ParticleBeamofDoom.cs index 85ce9140a5..ba6f47b6c3 100644 --- a/Projectiles/Magic/ParticleBeamofDoom.cs +++ b/Projectiles/Magic/ParticleBeamofDoom.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/PhantasmalFuryProj.cs b/Projectiles/Magic/PhantasmalFuryProj.cs index 0a5f132992..14b2a4819d 100644 --- a/Projectiles/Magic/PhantasmalFuryProj.cs +++ b/Projectiles/Magic/PhantasmalFuryProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 43); + Main.PlaySound(SoundID.Item43, projectile.position); for (int j = 0; j <= 10; j++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Magic/Phantom.cs b/Projectiles/Magic/Phantom.cs index 4533c69cba..48bfdad725 100644 --- a/Projectiles/Magic/Phantom.cs +++ b/Projectiles/Magic/Phantom.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class Phantom : ModProjectile + public class Phantom : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/PlagueFang.cs b/Projectiles/Magic/PlagueFang.cs index 901e4eb0f2..231dd0d669 100644 --- a/Projectiles/Magic/PlagueFang.cs +++ b/Projectiles/Magic/PlagueFang.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Magic { public class PlagueFang : ModProjectile @@ -21,6 +23,8 @@ namespace CalamityMod.Projectiles.Magic projectile.alpha = 255; projectile.penetrate = 9; projectile.timeLeft = 300; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 5; } public override void AI() @@ -59,7 +63,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int num301 = 0; num301 < 7; num301++) { int num302 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 163, 0f, 0f, 100, default, 1f); @@ -78,7 +82,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); - target.immune[projectile.owner] = 2; } } } diff --git a/Projectiles/Magic/PlasmaBolt.cs b/Projectiles/Magic/PlasmaBolt.cs index 45e37efbd0..600a9f8e2c 100644 --- a/Projectiles/Magic/PlasmaBolt.cs +++ b/Projectiles/Magic/PlasmaBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/PlasmaRay.cs b/Projectiles/Magic/PlasmaRay.cs index 9855922413..4fe4328338 100644 --- a/Projectiles/Magic/PlasmaRay.cs +++ b/Projectiles/Magic/PlasmaRay.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/PlasmaRay2.cs b/Projectiles/Magic/PlasmaRay2.cs index e5c31a2119..37ab35b144 100644 --- a/Projectiles/Magic/PlasmaRay2.cs +++ b/Projectiles/Magic/PlasmaRay2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/PlasmaShot.cs b/Projectiles/Magic/PlasmaShot.cs index 15bb4c7bae..b92b6586f9 100644 --- a/Projectiles/Magic/PlasmaShot.cs +++ b/Projectiles/Magic/PlasmaShot.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int num220 = Main.rand.Next(20, 31); if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Magic/PoseidonTyphoon.cs b/Projectiles/Magic/PoseidonTyphoon.cs index e3031e0875..a9aaba8fda 100644 --- a/Projectiles/Magic/PoseidonTyphoon.cs +++ b/Projectiles/Magic/PoseidonTyphoon.cs @@ -1,10 +1,10 @@ using Microsoft.Xna.Framework; -using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class PoseidonTyphoon : ModProjectile + public class PoseidonTyphoon : ModProjectile { public override void SetStaticDefaults() { @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/PurgeLaser.cs b/Projectiles/Magic/PurgeLaser.cs index 64894fc023..4f8cf505d6 100644 --- a/Projectiles/Magic/PurgeLaser.cs +++ b/Projectiles/Magic/PurgeLaser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/PurgeProj.cs b/Projectiles/Magic/PurgeProj.cs index b14f401183..7e74f57e6a 100644 --- a/Projectiles/Magic/PurgeProj.cs +++ b/Projectiles/Magic/PurgeProj.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic projectile.soundDelay = num3 - num4 * num2; if (projectile.ai[0] != 1f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 91); + Main.PlaySound(SoundID.Item91, projectile.position); } } if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) diff --git a/Projectiles/Magic/RougeSlashLarge.cs b/Projectiles/Magic/RougeSlashLarge.cs index 402509b7f9..c59f932ab1 100644 --- a/Projectiles/Magic/RougeSlashLarge.cs +++ b/Projectiles/Magic/RougeSlashLarge.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/RougeSlashMedium.cs b/Projectiles/Magic/RougeSlashMedium.cs index ce5dfc25af..b20d87f399 100644 --- a/Projectiles/Magic/RougeSlashMedium.cs +++ b/Projectiles/Magic/RougeSlashMedium.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/RougeSlashSmall.cs b/Projectiles/Magic/RougeSlashSmall.cs index 588f131ffc..40381f5745 100644 --- a/Projectiles/Magic/RougeSlashSmall.cs +++ b/Projectiles/Magic/RougeSlashSmall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/SHPB.cs b/Projectiles/Magic/SHPB.cs index daf9fed6b7..a95dd71891 100644 --- a/Projectiles/Magic/SHPB.cs +++ b/Projectiles/Magic/SHPB.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -106,7 +107,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); + Main.PlaySound(SoundID.Item105, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Magic/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs index 9472252545..4b7c1646a1 100644 --- a/Projectiles/Magic/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/SHPL.cs b/Projectiles/Magic/SHPL.cs index 7055a528c4..af8553ca67 100644 --- a/Projectiles/Magic/SHPL.cs +++ b/Projectiles/Magic/SHPL.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 12d74eaff4..536dcf5ad5 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 10; @@ -88,14 +88,14 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 120); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } Player player = Main.player[projectile.owner]; player.statLife += 1; player.HealEffect(1); - target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index ddcb54418f..937b9a9b5d 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index e8844e2635..37e3b42014 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); } projectile.velocity.X *= 1.03f; projectile.velocity.Y *= 1.03f; @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int dust = 0; dust <= 5; dust++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f); diff --git a/Projectiles/Magic/SerpentineBody.cs b/Projectiles/Magic/SerpentineBody.cs index 27134eaf2f..41f38f1958 100644 --- a/Projectiles/Magic/SerpentineBody.cs +++ b/Projectiles/Magic/SerpentineBody.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/SerpentineHead.cs b/Projectiles/Magic/SerpentineHead.cs index bab40332fe..4b9a562481 100644 --- a/Projectiles/Magic/SerpentineHead.cs +++ b/Projectiles/Magic/SerpentineHead.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/SerpentineTail.cs b/Projectiles/Magic/SerpentineTail.cs index 011a9eb155..cc1b97f6aa 100644 --- a/Projectiles/Magic/SerpentineTail.cs +++ b/Projectiles/Magic/SerpentineTail.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/ShadeNimbus.cs b/Projectiles/Magic/ShadeNimbus.cs index 7a53cb21e9..7dd735cb8c 100644 --- a/Projectiles/Magic/ShadeNimbus.cs +++ b/Projectiles/Magic/ShadeNimbus.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/ShadeNimbusCloud.cs b/Projectiles/Magic/ShadeNimbusCloud.cs index 491a97ad04..0197c14da6 100644 --- a/Projectiles/Magic/ShadeNimbusCloud.cs +++ b/Projectiles/Magic/ShadeNimbusCloud.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/ShadecrystalProjectile.cs b/Projectiles/Magic/ShadecrystalProjectile.cs index 36739b240b..cc755143c4 100644 --- a/Projectiles/Magic/ShadecrystalProjectile.cs +++ b/Projectiles/Magic/ShadecrystalProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/Shaderain.cs b/Projectiles/Magic/Shaderain.cs index f64b1040a4..ee94a7cf7d 100644 --- a/Projectiles/Magic/Shaderain.cs +++ b/Projectiles/Magic/Shaderain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index d5a6231820..b3ac1cf886 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 409ada1f6e..9e729a55f0 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Magic/SirensSongNote.cs b/Projectiles/Magic/SirensSongNote.cs index 451f39bcfa..1d467872d6 100644 --- a/Projectiles/Magic/SirensSongNote.cs +++ b/Projectiles/Magic/SirensSongNote.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/SlitheringEelProjectile.cs b/Projectiles/Magic/SlitheringEelProjectile.cs index 59bc79e249..b489a2cf15 100644 --- a/Projectiles/Magic/SlitheringEelProjectile.cs +++ b/Projectiles/Magic/SlitheringEelProjectile.cs @@ -1,7 +1,6 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +8,7 @@ using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Magic { - public class SlitheringEelProjectile : ModProjectile + public class SlitheringEelProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index d19df9a15c..5a147f7d12 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/SolarBeam2.cs b/Projectiles/Magic/SolarBeam2.cs index f6ca159be3..b2aac58b0c 100644 --- a/Projectiles/Magic/SolarBeam2.cs +++ b/Projectiles/Magic/SolarBeam2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/SoulPiercerBeam.cs b/Projectiles/Magic/SoulPiercerBeam.cs index 13016c38b3..04b790a956 100644 --- a/Projectiles/Magic/SoulPiercerBeam.cs +++ b/Projectiles/Magic/SoulPiercerBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/SoulPiercerBolt.cs b/Projectiles/Magic/SoulPiercerBolt.cs index af7215af00..0af21367ae 100644 --- a/Projectiles/Magic/SoulPiercerBolt.cs +++ b/Projectiles/Magic/SoulPiercerBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/SparkInfernal.cs b/Projectiles/Magic/SparkInfernal.cs index 4d3cb2f059..e39041825e 100644 --- a/Projectiles/Magic/SparkInfernal.cs +++ b/Projectiles/Magic/SparkInfernal.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Weapons.Magic; diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs index c36d09d386..5d0d1a0383 100644 --- a/Projectiles/Magic/SparklingBeam.cs +++ b/Projectiles/Magic/SparklingBeam.cs @@ -6,6 +6,7 @@ using Terraria.Enums; using Terraria.ModLoader; using CalamityMod.Projectiles.Ranged; using CalamityMod.Items.Fishing.SunkenSeaCatches; +using Terraria.ID; namespace CalamityMod.Projectiles.Magic { @@ -169,7 +170,7 @@ namespace CalamityMod.Projectiles.Magic //Play cool sound when fully charged if (playedSound == false) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68); + Main.PlaySound(SoundID.Item68, projectile.position); playedSound = true; } diff --git a/Projectiles/Magic/SpiritFlameCurse.cs b/Projectiles/Magic/SpiritFlameCurse.cs index d767983891..792c5b454d 100644 --- a/Projectiles/Magic/SpiritFlameCurse.cs +++ b/Projectiles/Magic/SpiritFlameCurse.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 160, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Magic/Starblast.cs b/Projectiles/Magic/Starblast.cs index 4d34d770e5..1aebb67f06 100644 --- a/Projectiles/Magic/Starblast.cs +++ b/Projectiles/Magic/Starblast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/StickyFeather.cs b/Projectiles/Magic/StickyFeather.cs index caff08f993..7f8eedd116 100644 --- a/Projectiles/Magic/StickyFeather.cs +++ b/Projectiles/Magic/StickyFeather.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/StratusSphereProj.cs b/Projectiles/Magic/StratusSphereProj.cs index 27d4c61033..07e0488fad 100644 --- a/Projectiles/Magic/StratusSphereProj.cs +++ b/Projectiles/Magic/StratusSphereProj.cs @@ -1,9 +1,7 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Magic { diff --git a/Projectiles/Magic/SubsumingTentacle.cs b/Projectiles/Magic/SubsumingTentacle.cs new file mode 100644 index 0000000000..bf66907557 --- /dev/null +++ b/Projectiles/Magic/SubsumingTentacle.cs @@ -0,0 +1,160 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class SubsumingTentacle : ModProjectile + { + public int AlphaFade + { + get => (int)projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + public Vector2 OffsetAcceleration + { + get => new Vector2(projectile.ai[0], projectile.ai[1]); + set + { + projectile.ai[0] = value.X; + projectile.ai[1] = value.Y; + } + } + public const float SegmentOffset = 5f; + public const float MaxArcingSpeed = 16f; + public const float MaxHomingSpeed = 18f; + public const float MaxEnemyDistance = 1450f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Tentacle"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 75; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.penetrate = 2; + projectile.MaxUpdates = 2; + projectile.magic = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 16; + } + + public override void AI() + { + if (!projectile.tileCollide) + { + AlphaFade++; + projectile.alpha = AlphaFade; + if (projectile.alpha >= 255) + { + projectile.Kill(); + return; + } + } + // Here, the old positions act more like "control points" than old postions, and will be referred as such henceforth. + // Each control point should have a set offset, to give a "chain" effect. + for (int i = 1; i < projectile.oldPos.Length; i++) + { + projectile.oldPos[i] = projectile.oldPos[i - 1] + Vector2.Normalize(projectile.oldPos[i] - projectile.oldPos[i - 1]) * SegmentOffset; + } + CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(20f * projectile.scale)); + if (Collision.SolidCollision(projectile.position, projectile.width, projectile.height) && projectile.tileCollide) + { + projectile.tileCollide = false; + } + + NPC closestTarget = projectile.Center.ClosestNPCAt(MaxEnemyDistance, true); + if (closestTarget != null) + { + HomingMovement(closestTarget); + } + else + { + ArcingMovement(); + } + projectile.scale -= closestTarget == null ? 0.007f : 0.004f; + if (projectile.scale <= 0.05f) + { + projectile.Kill(); + } + } + public void ArcingMovement() + { + // Cause the tentacle to arc around at an increasingly fast rate. + projectile.velocity += OffsetAcceleration; + if (projectile.velocity.Length() > MaxArcingSpeed) + { + projectile.velocity.Normalize(); + projectile.velocity *= MaxArcingSpeed; + } + + // Accelerate the arc. + OffsetAcceleration *= 1.035f; + } + public void HomingMovement(NPC closestTarget) + { + float angleOffset = MathHelper.WrapAngle(projectile.AngleTo(closestTarget.Center) - projectile.velocity.ToRotation()); + angleOffset = MathHelper.Clamp(angleOffset, -0.2f, 0.2f); + + if (projectile.Distance(closestTarget.Center) > 65f) + { + projectile.velocity = projectile.velocity.RotatedBy(angleOffset); + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * MaxHomingSpeed; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix); + + if (projectile.scale < 1f) + { + for (int i = 10; i < projectile.oldPos.Length; i++) + { + var tentacleShader = GameShaders.Misc["CalamityMod:SubsumingTentacle"]; + tentacleShader.UseImage("Images/Misc/Perlin"); + + Vector2 drawPos = projectile.oldPos[i] + ModContent.GetTexture(Texture).Size() / 2f - Main.screenPosition + projectile.gfxOffY * Vector2.UnitY; + float scale = MathHelper.Lerp(0.05f, 1.3f, i / (float)projectile.oldPos.Length) * projectile.scale; + scale = MathHelper.Clamp(scale, 0f, 2f); + Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - i) / projectile.oldPos.Length); + + spriteBatch.Draw(ModContent.GetTexture(Texture), drawPos, null, color, projectile.rotation, ModContent.GetTexture(Texture).Size() / 2f, scale, SpriteEffects.None, 0f); + tentacleShader.UseSaturation(i / (float)projectile.oldPos.Length); // A "completion ratio" for the shader. Used to make the entire tentacle appear multi-colored. + tentacleShader.UseOpacity(1f / projectile.oldPos.Length); // A "step value" for the shader. Used to give variance in color at each individual segment. + tentacleShader.Apply(null); + } + } + return false; + } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + for (int i = 1; i < projectile.oldPos.Length; i++) + { + float scale = MathHelper.Lerp(0.05f, 1f, i / (float)projectile.oldPos.Length) * projectile.scale * 0.85f; + if (targetHitbox.Intersects(new Rectangle((int)projectile.oldPos[i].X, (int)projectile.oldPos[i].Y, (int)(projectile.width * scale), (int)(projectile.height * scale)))) + return true; + } + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.velocity = oldVelocity; + return false; + } + } +} diff --git a/Projectiles/Magic/SubsumingTentacle.png b/Projectiles/Magic/SubsumingTentacle.png new file mode 100644 index 0000000000..c6b3592c9f Binary files /dev/null and b/Projectiles/Magic/SubsumingTentacle.png differ diff --git a/Projectiles/Magic/SupremeDustFlakProjectile.cs b/Projectiles/Magic/SupremeDustFlakProjectile.cs index a45db701e3..2005850339 100644 --- a/Projectiles/Magic/SupremeDustFlakProjectile.cs +++ b/Projectiles/Magic/SupremeDustFlakProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/SupremeDustProjectile.cs b/Projectiles/Magic/SupremeDustProjectile.cs index 6ecf7f4eb9..bc992ba6ed 100644 --- a/Projectiles/Magic/SupremeDustProjectile.cs +++ b/Projectiles/Magic/SupremeDustProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/T1000Laser.cs b/Projectiles/Magic/T1000Laser.cs index aa5f97fa7d..abdecd9dc4 100644 --- a/Projectiles/Magic/T1000Laser.cs +++ b/Projectiles/Magic/T1000Laser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/T1000Proj.cs b/Projectiles/Magic/T1000Proj.cs index 99104817dc..94d68ec45c 100644 --- a/Projectiles/Magic/T1000Proj.cs +++ b/Projectiles/Magic/T1000Proj.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -57,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic projectile.soundDelay = num3 - num4 * num2; if (projectile.ai[0] != 1f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 91); + Main.PlaySound(SoundID.Item91, projectile.position); } } if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index ad6eb2d5f9..7f800657a4 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class TearsofHeavenProjectile : ModProjectile + public class TearsofHeavenProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/TerraBeam.cs b/Projectiles/Magic/TerraBeam.cs index b5b9291a93..b5e9dbd158 100644 --- a/Projectiles/Magic/TerraBeam.cs +++ b/Projectiles/Magic/TerraBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/TerraBolt.cs b/Projectiles/Magic/TerraBolt.cs index 0d7ac5cf39..b724da7432 100644 --- a/Projectiles/Magic/TerraBolt.cs +++ b/Projectiles/Magic/TerraBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/TerraBolt2.cs b/Projectiles/Magic/TerraBolt2.cs index bfcdf4d7dd..99efba297b 100644 --- a/Projectiles/Magic/TerraBolt2.cs +++ b/Projectiles/Magic/TerraBolt2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/TerraOrb.cs b/Projectiles/Magic/TerraOrb.cs index 8ba63efb91..fa0a9f5614 100644 --- a/Projectiles/Magic/TerraOrb.cs +++ b/Projectiles/Magic/TerraOrb.cs @@ -1,10 +1,8 @@ -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class TerraOrb : ModProjectile + public class TerraOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/TerraOrb2.cs b/Projectiles/Magic/TerraOrb2.cs index 4489cadfde..e116c948f6 100644 --- a/Projectiles/Magic/TerraOrb2.cs +++ b/Projectiles/Magic/TerraOrb2.cs @@ -1,10 +1,8 @@ -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class TerraOrb2 : ModProjectile + public class TerraOrb2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/ThunderstormShot.cs b/Projectiles/Magic/ThunderstormShot.cs index 8883236d0e..b72603d63b 100644 --- a/Projectiles/Magic/ThunderstormShot.cs +++ b/Projectiles/Magic/ThunderstormShot.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -46,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.position); for (int n = 0; n < 5; n++) { float x = projectile.position.X + (float)Main.rand.Next(-200, 200); diff --git a/Projectiles/Magic/ThunderstormShotSplit.cs b/Projectiles/Magic/ThunderstormShotSplit.cs index 889920023e..aae6878bd8 100644 --- a/Projectiles/Magic/ThunderstormShotSplit.cs +++ b/Projectiles/Magic/ThunderstormShotSplit.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -50,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 16; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Magic/TradewindsProjectile.cs b/Projectiles/Magic/TradewindsProjectile.cs index 21dc99ae42..c26db1b84d 100644 --- a/Projectiles/Magic/TradewindsProjectile.cs +++ b/Projectiles/Magic/TradewindsProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Magic/UberBubble.cs b/Projectiles/Magic/UberBubble.cs index 4832f1071e..15114de365 100644 --- a/Projectiles/Magic/UberBubble.cs +++ b/Projectiles/Magic/UberBubble.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -52,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); + Main.PlaySound(SoundID.Item96, projectile.position); int num190 = Main.rand.Next(4, 6); for (int num191 = 0; num191 < num190; num191++) { diff --git a/Projectiles/Magic/UndinesRetributionSpear.cs b/Projectiles/Magic/UndinesRetributionSpear.cs index f001ca983d..43d6531e12 100644 --- a/Projectiles/Magic/UndinesRetributionSpear.cs +++ b/Projectiles/Magic/UndinesRetributionSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Magic projectile.localNPCHitCooldown = 10; projectile.damage /= 2; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 21, 1f, 0f); + Main.PlaySound(SoundID.Item21, projectile.position); for (int num193 = 0; num193 < 4; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index 57be18cc03..cbc4803782 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index 6f4fd13085..c8ec08d181 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 4d9737696d..228160bdac 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, projectile.position); for (int j = 0; j <= 25; j++) { int num459 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 65, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Magic/VenusianBolt.cs b/Projectiles/Magic/VenusianBolt.cs index 788ce02c68..3d0c7dcacb 100644 --- a/Projectiles/Magic/VenusianBolt.cs +++ b/Projectiles/Magic/VenusianBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 3; num457++) diff --git a/Projectiles/Magic/VenusianExplosion.cs b/Projectiles/Magic/VenusianExplosion.cs index df517d4fd1..411388254f 100644 --- a/Projectiles/Magic/VenusianExplosion.cs +++ b/Projectiles/Magic/VenusianExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.01f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, projectile.position); projectile.localAI[0] += 1f; } float num461 = 25f; diff --git a/Projectiles/Magic/VenusianFlame.cs b/Projectiles/Magic/VenusianFlame.cs index 88713c021b..66ea6493c3 100644 --- a/Projectiles/Magic/VenusianFlame.cs +++ b/Projectiles/Magic/VenusianFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic if (projectile.ai[1] == 0f && projectile.type >= 326 && projectile.type <= 328) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); + Main.PlaySound(SoundID.Item13, projectile.position); } if (Main.rand.NextBool(2)) { diff --git a/Projectiles/Magic/VisceraBeam.cs b/Projectiles/Magic/VisceraBeam.cs index 894d789415..9816e09feb 100644 --- a/Projectiles/Magic/VisceraBeam.cs +++ b/Projectiles/Magic/VisceraBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Magic/VitriolicViperFang.cs b/Projectiles/Magic/VitriolicViperFang.cs index a143fdf2fd..198aada41d 100644 --- a/Projectiles/Magic/VitriolicViperFang.cs +++ b/Projectiles/Magic/VitriolicViperFang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Magic/VitriolicViperSpit.cs b/Projectiles/Magic/VitriolicViperSpit.cs index 4f98f2e6ce..b7d68646b9 100644 --- a/Projectiles/Magic/VitriolicViperSpit.cs +++ b/Projectiles/Magic/VitriolicViperSpit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; diff --git a/Projectiles/Magic/VividBeam.cs b/Projectiles/Magic/VividBeam.cs index 1400979343..834975c128 100644 --- a/Projectiles/Magic/VividBeam.cs +++ b/Projectiles/Magic/VividBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; @@ -113,28 +113,27 @@ namespace CalamityMod.Projectiles.Magic { if (projectile.ai[1] == 0f) { - float x = projectile.position.X + (float)Main.rand.Next(-400, 400); - float y = projectile.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = projectile.position.X + (float)(projectile.width / 2) - vector.X; - float num16 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - float num17 = 6f; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + float xStart = projectile.position.X + (float)Main.rand.Next(-400, 400); + float yStart = projectile.position.Y - (float)Main.rand.Next(500, 800); + Vector2 startPos = new Vector2(xStart, yStart); + Vector2 velocity = projectile.Center - startPos; + velocity.X += (float)Main.rand.Next(-100, 101); + float speed = 6f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int num19 = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[num19].ai[1] = projectile.position.Y; } if (projectile.ai[1] == 1f) { - int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 2f), projectile.knockBack, projectile.owner, 0f, 0f); + int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 2f), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[boom].Calamity().forceMagic = true; } if (projectile.ai[1] == 2f) { - float spread = 30f * 0.0174f; + float spread = 30f * 0.01f * MathHelper.PiOver2; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; @@ -143,8 +142,8 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2f), projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2f), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Magic/VividBolt.cs b/Projectiles/Magic/VividBolt.cs index 37e06711f6..a0443dcca5 100644 --- a/Projectiles/Magic/VividBolt.cs +++ b/Projectiles/Magic/VividBolt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Magic/VividClarityBeam.cs b/Projectiles/Magic/VividClarityBeam.cs index a42698d8bc..59d149066b 100644 --- a/Projectiles/Magic/VividClarityBeam.cs +++ b/Projectiles/Magic/VividClarityBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Magic/VividLaser2.cs b/Projectiles/Magic/VividLaser2.cs index 7fa4d31b8e..b8f9e7ac1d 100644 --- a/Projectiles/Magic/VividLaser2.cs +++ b/Projectiles/Magic/VividLaser2.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class VividLaser2 : ModProjectile + public class VividLaser2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/VividOrb.cs b/Projectiles/Magic/VividOrb.cs index 711da6215c..e9e1607184 100644 --- a/Projectiles/Magic/VividOrb.cs +++ b/Projectiles/Magic/VividOrb.cs @@ -1,10 +1,7 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class VividOrb : ModProjectile + public class VividOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/VolatileStarcore.cs b/Projectiles/Magic/VolatileStarcore.cs index cb88ed0ab0..552a9992d3 100644 --- a/Projectiles/Magic/VolatileStarcore.cs +++ b/Projectiles/Magic/VolatileStarcore.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Magic/Vortex.cs b/Projectiles/Magic/Vortex.cs index 1f522fd091..86462050c7 100644 --- a/Projectiles/Magic/Vortex.cs +++ b/Projectiles/Magic/Vortex.cs @@ -2,7 +2,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; @@ -10,9 +9,28 @@ namespace CalamityMod.Projectiles.Magic { public class Vortex : ModProjectile { + public float TargetCheckCooldown + { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + public float Time + { + get => projectile.localAI[1]; + set => projectile.localAI[1] = value; + } + public int TargetIndex + { + get => (int)projectile.ai[0]; + set => projectile.ai[0] = value; + } + public const float AngularMovementSpeed = 0.1f; + public const float Acceleration = 0.0025f; + public const float TargetCheckInterval = 30f; + public const float MaximumTargetDistance = 1200f; public override void SetStaticDefaults() { - DisplayName.SetDefault("Vortex"); + DisplayName.SetDefault("Subsuming Vortex"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -24,10 +42,10 @@ namespace CalamityMod.Projectiles.Magic projectile.alpha = 255; projectile.friendly = true; projectile.magic = true; - projectile.penetrate = 10; - projectile.timeLeft = 300; + projectile.penetrate = 1; projectile.tileCollide = true; projectile.extraUpdates = 4; + projectile.timeLeft = 115 * projectile.extraUpdates; projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; @@ -35,119 +53,98 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.localAI[1] += 1f; + // At the very beginning, start without a target. + if (Time == 0f) + { + TargetIndex = -1; + } + Time++; if (projectile.localAI[1] > 10f && Main.rand.NextBool(3)) { - int num713 = 5; - for (int num714 = 0; num714 < num713; num714++) - { - Vector2 vector58 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f; - vector58 = vector58.RotatedBy((double)(num714 - (num713 / 2 - 1)) * 3.1415926535897931 / (double)(float)num713, default) + projectile.Center; - Vector2 value25 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num715 = Dust.NewDust(vector58 + value25, 0, 0, 66, value25.X * 2f, value25.Y * 2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.7f); - Main.dust[num715].noGravity = true; - Main.dust[num715].noLight = true; - Main.dust[num715].velocity /= 4f; - Main.dust[num715].velocity -= projectile.velocity; - } - projectile.alpha -= 5; - if (projectile.alpha < 50) - { - projectile.alpha = 50; - } - projectile.rotation += projectile.velocity.X * 0.1f; - Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); + VisualEffects(); } - int num716 = -1; - Vector2 vector59 = projectile.Center; - float num717 = 350f * projectile.ai[1]; - if (projectile.localAI[0] > 0f) - { - projectile.localAI[0] -= 1f; - } - if (projectile.ai[0] == 0f && projectile.localAI[0] == 0f) - { - for (int num718 = 0; num718 < 200; num718++) - { - NPC nPC6 = Main.npc[num718]; - if (nPC6.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(num718 + 1))) - { - Vector2 center4 = nPC6.Center; - float num719 = Vector2.Distance(center4, vector59); - if (num719 < num717 && Collision.CanHit(projectile.position, projectile.width, projectile.height, nPC6.position, nPC6.width, nPC6.height)) - { - num717 = num719; - vector59 = center4; - num716 = num718; - } - } - } - if (num716 >= 0) - { - projectile.ai[0] = (float)(num716 + 1); - projectile.netUpdate = true; - } - } - if (projectile.localAI[0] == 0f && projectile.ai[0] == 0f) - { - projectile.localAI[0] = 30f; - } - bool flag32 = false; - if (projectile.ai[0] != 0f) - { - int num720 = (int)(projectile.ai[0] - 1f); - if (Main.npc[num720].active && !Main.npc[num720].dontTakeDamage && Main.npc[num720].immune[projectile.owner] == 0) - { - float num721 = Main.npc[num720].position.X + (float)(Main.npc[num720].width / 2); - float num722 = Main.npc[num720].position.Y + (float)(Main.npc[num720].height / 2); - float num723 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num721) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num722); - if (num723 < 1000f) - { - flag32 = true; - vector59 = Main.npc[num720].Center; - } - } - else - { - projectile.ai[0] = 0f; - flag32 = false; - projectile.netUpdate = true; - } - } - if (flag32) - { - Vector2 v = vector59 - projectile.Center; - float num724 = projectile.velocity.ToRotation(); - float num725 = v.ToRotation(); - float num726 = num725 - num724; - num726 = MathHelper.WrapAngle(num726); - projectile.velocity = projectile.velocity.RotatedBy(num726 * 0.1, default); - } - float num727 = projectile.velocity.Length(); - projectile.velocity.Normalize(); - projectile.velocity *= num727 + 0.0025f; + Movement(HandleTargeting()); + projectile.rotation += projectile.velocity.X * 0.1f; } - public override bool OnTileCollide(Vector2 oldVelocity) + public bool HandleTargeting() { - projectile.penetrate--; - if (projectile.penetrate <= 0) + float targetCheckDistance = 350f * projectile.ai[1]; + + // Reduce a cooldown. Nothing special here. + if (TargetCheckCooldown > 0f) { - projectile.Kill(); + TargetCheckCooldown--; } - else + + // Attempt to find a target if the projectile has none. + if (TargetIndex == -1 && TargetCheckCooldown <= 0f) { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) + NPC potentialTarget = projectile.Center.ClosestNPCAt(targetCheckDistance, true); + if (potentialTarget != null) + TargetIndex = potentialTarget.whoAmI; + projectile.netUpdate = true; + } + if (TargetCheckCooldown <= 0f && TargetIndex == -1) + { + TargetCheckCooldown = TargetCheckInterval; + } + bool stillCanReachTarget = false; + // Ensure that the target is still in reach if there is indeed a target. + if (TargetIndex != -1) + { + stillCanReachTarget = projectile.Distance(Main.npc[TargetIndex].Center) < MaximumTargetDistance; + if (!stillCanReachTarget) { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; + TargetIndex = -1; + projectile.netUpdate = true; } } - return false; + return stillCanReachTarget; + } + + public void VisualEffects() + { + // Generate idle circular dust and light after 10 frames. + if (!Main.dedServ) + { + int dustCount = 5; + for (int i = 0; i < dustCount; i++) + { + Vector2 spawnPosition = projectile.Center + projectile.Size.RotatedBy(i / (float)dustCount * MathHelper.TwoPi) * 0.5f; + Vector2 velocity = Main.rand.NextFloat(MathHelper.TwoPi).ToRotationVector2() * Main.rand.NextFloat(6f, 16f); + Dust dust = Dust.NewDustPerfect(spawnPosition, 66, velocity, 0, Main.DiscoColor, 0.7f); + dust.noGravity = true; + dust.noLight = true; + dust.velocity = -projectile.velocity; + } + } + // Fade in. + projectile.alpha -= 5; + if (projectile.alpha < 50) + { + projectile.alpha = 50; + } + // And make rainbow light. + Lighting.AddLight(projectile.Center / 16, Main.DiscoColor.ToVector3()); + } + + public void Movement(bool stillCanReachTarget) + { + // Homing sharply towards the target in a circular fashion. + // The way this type of homing is by determining the offset between the angle to the target and the velocity's angle. + // This offset can be thought of as how much, in radians, the velocity would need to rotate to move towards the target. + // Then, the velocity is rotated by that offset (which, as established, would give perfect homing) multiplied by a <1 factor. + // This causes the velocity to constantly rotate sharply towards the target. + if (stillCanReachTarget) + { + float angleOffsetToTarget = projectile.AngleTo(Main.npc[TargetIndex].Center) - projectile.velocity.ToRotation(); + angleOffsetToTarget = MathHelper.WrapAngle(angleOffsetToTarget); // Ensure the offset is in the range of -pi to pi. + projectile.velocity = projectile.velocity.RotatedBy(angleOffsetToTarget * AngularMovementSpeed); + } + // Accelerate constantly with time. + float oldSpeed = projectile.velocity.Length(); + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * (oldSpeed + Acceleration); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Magic/Vortex.png b/Projectiles/Magic/Vortex.png index cbcf617436..fd7e0bf39c 100644 Binary files a/Projectiles/Magic/Vortex.png and b/Projectiles/Magic/Vortex.png differ diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index c092e1101d..40bff612ec 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -4,7 +4,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -49,7 +48,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 4, false); + CalamityUtils.ModifyHitNPCSticky(projectile, 3, false); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Magic/WaterStream.cs b/Projectiles/Magic/WaterStream.cs index 9173858a11..5cd0e7b1cb 100644 --- a/Projectiles/Magic/WaterStream.cs +++ b/Projectiles/Magic/WaterStream.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/WaterStream2.cs b/Projectiles/Magic/WaterStream2.cs index 0e58e022fe..4b783cc1e4 100644 --- a/Projectiles/Magic/WaterStream2.cs +++ b/Projectiles/Magic/WaterStream2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic diff --git a/Projectiles/Magic/WaywasherProj.cs b/Projectiles/Magic/WaywasherProj.cs index 8d1087b303..1cc7e7e958 100644 --- a/Projectiles/Magic/WaywasherProj.cs +++ b/Projectiles/Magic/WaywasherProj.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -55,7 +56,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, new Color(0, 142, 255), 1f); diff --git a/Projectiles/Magic/WulfrumBolt.cs b/Projectiles/Magic/WulfrumBolt.cs index a9eb6b7fec..38ab58428c 100644 --- a/Projectiles/Magic/WulfrumBolt.cs +++ b/Projectiles/Magic/WulfrumBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Magic/WyvernFeatherGreen.cs b/Projectiles/Magic/WyvernFeatherGreen.cs index 17d76da071..5751d5b4a6 100644 --- a/Projectiles/Magic/WyvernFeatherGreen.cs +++ b/Projectiles/Magic/WyvernFeatherGreen.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/WyvernFeatherPink.cs b/Projectiles/Magic/WyvernFeatherPink.cs index 36896d20f6..7d03591928 100644 --- a/Projectiles/Magic/WyvernFeatherPink.cs +++ b/Projectiles/Magic/WyvernFeatherPink.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/WyvernFeatherPurple.cs b/Projectiles/Magic/WyvernFeatherPurple.cs index 660e3a2030..4aad1f99f5 100644 --- a/Projectiles/Magic/WyvernFeatherPurple.cs +++ b/Projectiles/Magic/WyvernFeatherPurple.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Magic/WyvernProjectile.cs b/Projectiles/Magic/WyvernProjectile.cs index 11f6c2caf4..ec21c1b612 100644 --- a/Projectiles/Magic/WyvernProjectile.cs +++ b/Projectiles/Magic/WyvernProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 7); + Main.PlaySound(SoundID.NPCHit7, projectile.Center); for (int i = 0; i <= 10; i++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 16, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index 7bc72d68bb..6ad7f332a8 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Magic/YharimsCrystalPrism.cs b/Projectiles/Magic/YharimsCrystalPrism.cs index e578bb4856..db2e0a8e26 100644 --- a/Projectiles/Magic/YharimsCrystalPrism.cs +++ b/Projectiles/Magic/YharimsCrystalPrism.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/AegisBeam.cs b/Projectiles/Melee/AegisBeam.cs index cee0b73231..079d99c4c8 100644 --- a/Projectiles/Melee/AegisBeam.cs +++ b/Projectiles/Melee/AegisBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee } if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 73); projectile.localAI[0] += 1f; } int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 0.8f); diff --git a/Projectiles/Melee/AegisBlast.cs b/Projectiles/Melee/AegisBlast.cs index 297cf5ac0b..a3072f0fdf 100644 --- a/Projectiles/Melee/AegisBlast.cs +++ b/Projectiles/Melee/AegisBlast.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class AegisBlast : ModProjectile @@ -30,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 74); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Melee/AegisBlast2.cs b/Projectiles/Melee/AegisBlast2.cs index 0d8e585a64..064fc76c7d 100644 --- a/Projectiles/Melee/AegisBlast2.cs +++ b/Projectiles/Melee/AegisBlast2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/AegisFlame.cs b/Projectiles/Melee/AegisFlame.cs index fd511db3a7..3cc4d00770 100644 --- a/Projectiles/Melee/AegisFlame.cs +++ b/Projectiles/Melee/AegisFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/AftershockRock.cs b/Projectiles/Melee/AftershockRock.cs index 0ac5816a0f..83270509ba 100644 --- a/Projectiles/Melee/AftershockRock.cs +++ b/Projectiles/Melee/AftershockRock.cs @@ -1,4 +1,4 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index fe476a4b9f..87f4500b25 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 10); for (int k = 0; k < 20; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 33, projectile.oldVelocity.X, projectile.oldVelocity.Y, 0, new Color(0, 142, 255), 1f); diff --git a/Projectiles/Melee/AquaStream.cs b/Projectiles/Melee/AquaStream.cs index f889d04ab0..f72f599121 100644 --- a/Projectiles/Melee/AquaStream.cs +++ b/Projectiles/Melee/AquaStream.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/AstralScytheProjectile.cs b/Projectiles/Melee/AstralScytheProjectile.cs index 01f07ca2dc..7e8ba21c1a 100644 --- a/Projectiles/Melee/AstralScytheProjectile.cs +++ b/Projectiles/Melee/AstralScytheProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/AtaraxiaHoming.cs b/Projectiles/Melee/AtaraxiaHoming.cs index 6c569c0933..fc6928c060 100644 --- a/Projectiles/Melee/AtaraxiaHoming.cs +++ b/Projectiles/Melee/AtaraxiaHoming.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/AtaraxiaMain.cs b/Projectiles/Melee/AtaraxiaMain.cs index 825ed8c907..cb4852d734 100644 --- a/Projectiles/Melee/AtaraxiaMain.cs +++ b/Projectiles/Melee/AtaraxiaMain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/AtaraxiaSide.cs b/Projectiles/Melee/AtaraxiaSide.cs index 3ce5ec918a..0a16d89367 100644 --- a/Projectiles/Melee/AtaraxiaSide.cs +++ b/Projectiles/Melee/AtaraxiaSide.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class AtaraxiaSide : ModProjectile + public class AtaraxiaSide : ModProjectile { private static int NumAnimationFrames = 5; private static int AnimationFrameTime = 9; diff --git a/Projectiles/Melee/AtaraxiaSplit.cs b/Projectiles/Melee/AtaraxiaSplit.cs index 5acede7fdc..f358d451b1 100644 --- a/Projectiles/Melee/AtaraxiaSplit.cs +++ b/Projectiles/Melee/AtaraxiaSplit.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index ab7d9df5f2..ce4a78deaa 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -115,7 +115,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Melee/BallOFuguProj.cs b/Projectiles/Melee/BallOFuguProj.cs index b73b064dc7..888441710a 100644 --- a/Projectiles/Melee/BallOFuguProj.cs +++ b/Projectiles/Melee/BallOFuguProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); projectile.ai[0] = 1f; projectile.netUpdate = true; - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return false; } diff --git a/Projectiles/Melee/BansheeHookBoom.cs b/Projectiles/Melee/BansheeHookBoom.cs index 4f12a095f3..41eecddba0 100644 --- a/Projectiles/Melee/BansheeHookBoom.cs +++ b/Projectiles/Melee/BansheeHookBoom.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/BansheeHookScythe.cs b/Projectiles/Melee/BansheeHookScythe.cs index b796a1c490..b09579d645 100644 --- a/Projectiles/Melee/BansheeHookScythe.cs +++ b/Projectiles/Melee/BansheeHookScythe.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/BiomeOrb.cs b/Projectiles/Melee/BiomeOrb.cs index 5d102e9f1e..f24ae23333 100644 --- a/Projectiles/Melee/BiomeOrb.cs +++ b/Projectiles/Melee/BiomeOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index 0cf7549120..9266c9b913 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class BlazingPhantomBlade : ModProjectile + public class BlazingPhantomBlade : ModProjectile { public override void SetStaticDefaults() { @@ -58,9 +57,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 5; - target.AddBuff(BuffID.OnFire, 180); - target.AddBuff(BuffID.Venom, 60); - target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Venom, 120); } } } diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index b160e1f524..3b51e2f227 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Blood : ModProjectile + public class Blood : ModProjectile { public override void SetStaticDefaults() { @@ -40,6 +39,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Player player = Main.player[projectile.owner]; + if (player.moonLeech) + return; player.statLife += 5; player.HealEffect(5); } diff --git a/Projectiles/Melee/Blood2.cs b/Projectiles/Melee/Blood2.cs index ac90068252..3fe2db10ca 100644 --- a/Projectiles/Melee/Blood2.cs +++ b/Projectiles/Melee/Blood2.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Blood2 : ModProjectile + public class Blood2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/BloodBall.cs b/Projectiles/Melee/BloodBall.cs index 40d732d04c..e038de0577 100644 --- a/Projectiles/Melee/BloodBall.cs +++ b/Projectiles/Melee/BloodBall.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class BloodBall : ModProjectile @@ -98,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.NPCHit, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 22; diff --git a/Projectiles/Melee/BloodScythe.cs b/Projectiles/Melee/BloodScythe.cs index 850b1bdbf0..4ccc987cc4 100644 --- a/Projectiles/Melee/BloodScythe.cs +++ b/Projectiles/Melee/BloodScythe.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/BloodScythe.png b/Projectiles/Melee/BloodScythe.png index ee0bbd4d2b..92f9025e5d 100644 Binary files a/Projectiles/Melee/BloodScythe.png and b/Projectiles/Melee/BloodScythe.png differ diff --git a/Projectiles/Melee/BloodyBlade.cs b/Projectiles/Melee/BloodyBlade.cs index b12918e67c..b32f471883 100644 --- a/Projectiles/Melee/BloodyBlade.cs +++ b/Projectiles/Melee/BloodyBlade.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/BlueAura.cs b/Projectiles/Melee/BlueAura.cs index 9d26063058..2f06f51597 100644 --- a/Projectiles/Melee/BlueAura.cs +++ b/Projectiles/Melee/BlueAura.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/Brimblast.cs b/Projectiles/Melee/Brimblast.cs index a6c73f0f7b..2d71c0334a 100644 --- a/Projectiles/Melee/Brimblast.cs +++ b/Projectiles/Melee/Brimblast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Melee/BrimlanceHellfireExplosion.cs b/Projectiles/Melee/BrimlanceHellfireExplosion.cs index b4b4316c45..4f9e18ae7b 100644 --- a/Projectiles/Melee/BrimlanceHellfireExplosion.cs +++ b/Projectiles/Melee/BrimlanceHellfireExplosion.cs @@ -1,9 +1,11 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class BrimlanceHellfireExplosion : ModProjectile @@ -32,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Melee/BrimlanceStandingFire.cs b/Projectiles/Melee/BrimlanceStandingFire.cs index 5ea9717c07..88524b0e3a 100644 --- a/Projectiles/Melee/BrimlanceStandingFire.cs +++ b/Projectiles/Melee/BrimlanceStandingFire.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class BrimlanceStandingFire : ModProjectile @@ -55,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 0f && projectile.type >= 326 && projectile.type <= 328) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 13); } int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust expr_8976_cp_0 = Main.dust[num199]; diff --git a/Projectiles/Melee/Brimlash2.cs b/Projectiles/Melee/Brimlash2.cs index 0a4b372963..da227fae26 100644 --- a/Projectiles/Melee/Brimlash2.cs +++ b/Projectiles/Melee/Brimlash2.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Brimlash2 : ModProjectile + public class Brimlash2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/BrimlashProj.cs b/Projectiles/Melee/BrimlashProj.cs index d71d8113a9..549e560076 100644 --- a/Projectiles/Melee/BrimlashProj.cs +++ b/Projectiles/Melee/BrimlashProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/BrimstoneBoom.cs b/Projectiles/Melee/BrimstoneBoom.cs index 6388177a8e..d206aae700 100644 --- a/Projectiles/Melee/BrimstoneBoom.cs +++ b/Projectiles/Melee/BrimstoneBoom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Melee/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs index 2d93dcb867..8db8363283 100644 --- a/Projectiles/Melee/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/BrimstoneSwordExplosion.cs b/Projectiles/Melee/BrimstoneSwordExplosion.cs index 01105d1fc3..7dacf6d46b 100644 --- a/Projectiles/Melee/BrimstoneSwordExplosion.cs +++ b/Projectiles/Melee/BrimstoneSwordExplosion.cs @@ -1,9 +1,11 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class BrimstoneSwordExplosion : ModProjectile @@ -32,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Melee/BrinySpout.cs b/Projectiles/Melee/BrinySpout.cs index 1d40295ecf..bb3c922edf 100644 --- a/Projectiles/Melee/BrinySpout.cs +++ b/Projectiles/Melee/BrinySpout.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs index 3fb4a717e5..0ac830dfc2 100644 --- a/Projectiles/Melee/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class BrinyTyphoonBubble : ModProjectile @@ -94,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 96); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 96); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Melee/BurningMeteor.cs b/Projectiles/Melee/BurningMeteor.cs index 0288610f3e..409f95b045 100644 --- a/Projectiles/Melee/BurningMeteor.cs +++ b/Projectiles/Melee/BurningMeteor.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } } projectile.localAI[0] += 1f; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, 0f, 0f); diff --git a/Projectiles/Melee/CalamityAura.cs b/Projectiles/Melee/CalamityAura.cs index b1b2fc70e1..42242bc02f 100644 --- a/Projectiles/Melee/CalamityAura.cs +++ b/Projectiles/Melee/CalamityAura.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/CalamityAuraType2.cs b/Projectiles/Melee/CalamityAuraType2.cs index e3d41cd63e..abaaa68790 100644 --- a/Projectiles/Melee/CalamityAuraType2.cs +++ b/Projectiles/Melee/CalamityAuraType2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/CalamityAuraType3.cs b/Projectiles/Melee/CalamityAuraType3.cs index 4cd84af9c9..44fd90d960 100644 --- a/Projectiles/Melee/CalamityAuraType3.cs +++ b/Projectiles/Melee/CalamityAuraType3.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/ChaosFlameLarge.cs b/Projectiles/Melee/ChaosFlameLarge.cs index f55fc1dce8..3b73c8ac6c 100644 --- a/Projectiles/Melee/ChaosFlameLarge.cs +++ b/Projectiles/Melee/ChaosFlameLarge.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/ChaosFlameSmall.cs b/Projectiles/Melee/ChaosFlameSmall.cs index 6c641a7cb0..2c334e743c 100644 --- a/Projectiles/Melee/ChaosFlameSmall.cs +++ b/Projectiles/Melee/ChaosFlameSmall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/ClamCrusherFlail.cs b/Projectiles/Melee/ClamCrusherFlail.cs index ab30de06fa..654d461866 100644 --- a/Projectiles/Melee/ClamCrusherFlail.cs +++ b/Projectiles/Melee/ClamCrusherFlail.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -7,7 +6,7 @@ using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ClamCrusherFlail : ModProjectile + public class ClamCrusherFlail : ModProjectile { public int finalDamage; diff --git a/Projectiles/Melee/CosmicBolt.cs b/Projectiles/Melee/CosmicBolt.cs index 11a70d268f..2704b53356 100644 --- a/Projectiles/Melee/CosmicBolt.cs +++ b/Projectiles/Melee/CosmicBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/CosmicDischargeFlail.cs b/Projectiles/Melee/CosmicDischargeFlail.cs index 2f3aed3202..a0d774fab2 100644 --- a/Projectiles/Melee/CosmicDischargeFlail.cs +++ b/Projectiles/Melee/CosmicDischargeFlail.cs @@ -1,17 +1,16 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee { - public class CosmicDischargeFlail : BaseWhipProjectile + public class CosmicDischargeFlail : BaseWhipProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs index 8c9179afd3..08a07c3e6d 100644 --- a/Projectiles/Melee/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/CosmicOrb.cs b/Projectiles/Melee/CosmicOrb.cs index 38096790e1..974574a0fc 100644 --- a/Projectiles/Melee/CosmicOrb.cs +++ b/Projectiles/Melee/CosmicOrb.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class CosmicOrb : ModProjectile + public class CosmicOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index 09fca156bb..30dee538fd 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -78,15 +78,15 @@ namespace CalamityMod.Projectiles.Melee int directionSign = Main.rand.NextBool(2).ToDirectionInt(); Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, projectile.Center.Y + Main.rand.Next(-500, 501)); Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; - Projectile.NewProjectile(spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), projectile.damage, 1.4f, projectile.owner); + Projectile.NewProjectile(spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack * 0.1f, projectile.owner); } - int starMax = Main.rand.Next(4, 11); // 4 to 10 stars + int starMax = Main.rand.Next(6, 11); // 6 to 10 stars for (int i = -starMax / 2; i < starMax / 2; i++) { int ySpawnAdditive = Main.rand.Next(-40, 41); Vector2 toSpawn = target.Center - new Vector2(0f, 800f + ySpawnAdditive).RotatedBy(MathHelper.ToRadians(i * 11f / starMax)); Vector2 toTarget = Vector2.Normalize(target.Center - toSpawn) * 35f; - Projectile.NewProjectile(toSpawn, toTarget, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Projectile.NewProjectile(toSpawn, toTarget, ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner); } target.AddBuff(ModContent.BuffType(), 360); target.AddBuff(ModContent.BuffType(), 360); @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee target.StrikeNPC(damage, 0f, 0, crit, false, false); if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(28, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); + NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, i, damage, 0f, 0f, crit ? 1 : 0, 0, 0); } } } diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index 2557a7026d..62ff9f2b58 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/CosmicSpiritBomb1.cs b/Projectiles/Melee/CosmicSpiritBomb1.cs index 1bac4206f5..a3d5370d3c 100644 --- a/Projectiles/Melee/CosmicSpiritBomb1.cs +++ b/Projectiles/Melee/CosmicSpiritBomb1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 200; diff --git a/Projectiles/Melee/CosmicSpiritBomb2.cs b/Projectiles/Melee/CosmicSpiritBomb2.cs index e6a0f7bdb4..f742289d8c 100644 --- a/Projectiles/Melee/CosmicSpiritBomb2.cs +++ b/Projectiles/Melee/CosmicSpiritBomb2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -81,9 +81,9 @@ namespace CalamityMod.Projectiles.Melee } public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + { + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 200; projectile.height = 200; diff --git a/Projectiles/Melee/CosmicSpiritBomb3.cs b/Projectiles/Melee/CosmicSpiritBomb3.cs index fb61630970..0169c79e04 100644 --- a/Projectiles/Melee/CosmicSpiritBomb3.cs +++ b/Projectiles/Melee/CosmicSpiritBomb3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -77,13 +77,13 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 120); } public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + { + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 200; projectile.height = 200; diff --git a/Projectiles/Melee/CrescentMoonProj.cs b/Projectiles/Melee/CrescentMoonProj.cs index 6442d89531..925b0ea343 100644 --- a/Projectiles/Melee/CrescentMoonProj.cs +++ b/Projectiles/Melee/CrescentMoonProj.cs @@ -1,14 +1,13 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using CalamityMod.Buffs.DamageOverTime; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class CrescentMoonProj : ModProjectile + public class CrescentMoonProj : ModProjectile { public override void SetStaticDefaults() { @@ -43,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 30 + Main.rand.Next(50); if (Main.rand.NextBool(10)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } diff --git a/Projectiles/Melee/CrystalDust.cs b/Projectiles/Melee/CrystalDust.cs index bb6dc77f34..4d7f87d89e 100644 --- a/Projectiles/Melee/CrystalDust.cs +++ b/Projectiles/Melee/CrystalDust.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.GameContent.Achievements; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class CrystalDust : ModProjectile + public class CrystalDust : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/CrystylCrusherRay.cs b/Projectiles/Melee/CrystylCrusherRay.cs index 4a3863e8cb..ab34e78b90 100644 --- a/Projectiles/Melee/CrystylCrusherRay.cs +++ b/Projectiles/Melee/CrystylCrusherRay.cs @@ -1,11 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.Dusts; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.IO; using Terraria; using Terraria.Enums; using Terraria.GameContent.Achievements; @@ -13,7 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class CrystylCrusherRay : ModProjectile + public class CrystylCrusherRay : ModProjectile { public override void SetStaticDefaults() { @@ -136,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee //Play cool sound when fully charged if (playedSound == false) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68); + Main.PlaySound(SoundID.Item68, projectile.Center); playedSound = true; } @@ -325,7 +320,7 @@ namespace CalamityMod.Projectiles.Melee DustExplosion(destroyVector); if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } } } @@ -334,7 +329,7 @@ namespace CalamityMod.Projectiles.Melee AchievementsHelper.CurrentlyMining = false; if (Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/Cyclone.cs index e9d204b863..4d77446134 100644 --- a/Projectiles/Melee/Cyclone.cs +++ b/Projectiles/Melee/Cyclone.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 60, 0.6f); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 60, 0.6f); for (int i = 0; i <= 360; i += 3) { diff --git a/Projectiles/Melee/DNA.cs b/Projectiles/Melee/DNA.cs index 0a96e778cb..7c191175f4 100644 --- a/Projectiles/Melee/DNA.cs +++ b/Projectiles/Melee/DNA.cs @@ -1,7 +1,9 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class DNA : ModProjectile @@ -49,7 +51,7 @@ namespace CalamityMod.Projectiles.Melee int num49 = projectile.damage; float num50 = projectile.knockBack; int number = Projectile.NewProjectile(projectile.position.X + projectile.velocity.X + (float)(projectile.width / 2), projectile.position.Y + projectile.velocity.Y + (float)(projectile.height / 2), projectile.velocity.X, projectile.velocity.Y, num48, num49, num50, projectile.owner, 0f, projectile.ai[1] + 1f); - NetMessage.SendData(27, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncProjectile, -1, -1, null, number, 0f, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Melee/DNA2.cs b/Projectiles/Melee/DNA2.cs index 024251437e..643b147d8c 100644 --- a/Projectiles/Melee/DNA2.cs +++ b/Projectiles/Melee/DNA2.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Dark.cs b/Projectiles/Melee/Dark.cs index f1cedd6b62..3e25dbb8d9 100644 --- a/Projectiles/Melee/Dark.cs +++ b/Projectiles/Melee/Dark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/DarkBall.cs b/Projectiles/Melee/DarkBall.cs index 2055807c92..8dbb5a0cbf 100644 --- a/Projectiles/Melee/DarkBall.cs +++ b/Projectiles/Melee/DarkBall.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -99,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.NPCDeath21, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 22; diff --git a/Projectiles/Melee/DarkBeam.cs b/Projectiles/Melee/DarkBeam.cs index 683eb6ab1a..791587b2fb 100644 --- a/Projectiles/Melee/DarkBeam.cs +++ b/Projectiles/Melee/DarkBeam.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/DemonBlast.cs b/Projectiles/Melee/DemonBlast.cs index 9b25213bf0..f338660fc8 100644 --- a/Projectiles/Melee/DemonBlast.cs +++ b/Projectiles/Melee/DemonBlast.cs @@ -1,4 +1,9 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,46 +14,52 @@ namespace CalamityMod.Projectiles.Melee { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Devil Fork"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; } public override void SetDefaults() { - projectile.width = 10; - projectile.height = 10; + projectile.width = 30; + projectile.height = 30; projectile.friendly = true; - projectile.aiStyle = 1; projectile.penetrate = -1; projectile.extraUpdates = 5; projectile.tileCollide = false; projectile.melee = true; + projectile.alpha = 180; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.timeLeft = 300; } public override void AI() { - if (projectile.ai[1] != -1f && projectile.position.Y > projectile.ai[1]) - { - projectile.tileCollide = true; - } + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 173, + (int)CalamityDusts.Brimstone, + 172 + }); if (projectile.position.HasNaNs()) { projectile.Kill(); return; } - bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default, 1f)]; - dust6.position = projectile.Center; - dust6.velocity = Vector2.Zero; - dust6.noGravity = true; - if (flag5) + bool tileCheck = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); + Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f)]; + dust.position = projectile.Center; + dust.velocity = Vector2.Zero; + dust.noGravity = true; + if (tileCheck) { - dust6.noLight = true; + dust.noLight = true; } if (projectile.ai[1] == -1f) { projectile.ai[0] += 1f; projectile.velocity = Vector2.Zero; - projectile.tileCollide = false; projectile.penetrate = -1; projectile.position = projectile.Center; projectile.width = projectile.height = 140; @@ -58,36 +69,32 @@ namespace CalamityMod.Projectiles.Melee { projectile.alpha = 0; } - if (++projectile.frameCounter >= projectile.MaxUpdates * 3) - { - projectile.frameCounter = 0; - projectile.frame++; - } - if (projectile.ai[0] >= (float)(Main.projFrames[projectile.type] * projectile.MaxUpdates * 3)) + if (projectile.ai[0] >= projectile.MaxUpdates * 3) { projectile.Kill(); } return; } - projectile.alpha = 255; + else + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.ToRadians(45); if (projectile.numUpdates == 0) { - int num158 = -1; - float num159 = 60f; - for (int num160 = 0; num160 < 200; num160++) + int targetIndex = -1; + float detectRange = 60f; + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { - NPC nPC = Main.npc[num160]; - if (nPC.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(projectile, false)) { - float num161 = projectile.Distance(nPC.Center); - if (num161 < num159 && Collision.CanHitLine(projectile.Center, 0, 0, nPC.Center, 0, 0)) + float npcDist = projectile.Distance(npc.Center); + if (npcDist < detectRange && Collision.CanHitLine(projectile.Center, 0, 0, npc.Center, 0, 0)) { - num159 = num161; - num158 = num160; + detectRange = npcDist; + targetIndex = npcIndex; } } } - if (num158 != -1) + if (targetIndex != -1) { projectile.ai[0] = 0f; projectile.ai[1] = -1f; @@ -98,34 +105,57 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); + Main.PlaySound(SoundID.Item14, projectile.Center); + bool tileCheck = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 173, + (int)CalamityDusts.Brimstone, + 172 + }); + Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1.5f); } for (int n = 0; n < 4; n++) { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default, 2.5f); - Main.dust[num10].noGravity = true; - Main.dust[num10].velocity *= 3f; - if (flag) + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 173, + (int)CalamityDusts.Brimstone, + 172 + }); + int dustInt = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f); + Main.dust[dustInt].noGravity = true; + Main.dust[dustInt].velocity *= 3f; + if (tileCheck) { - Main.dust[num10].noLight = true; + Main.dust[dustInt].noLight = true; } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); - Main.dust[num10].velocity *= 2f; - Main.dust[num10].noGravity = true; - if (flag) + dustInt = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1.5f); + Main.dust[dustInt].velocity *= 2f; + Main.dust[dustInt].noGravity = true; + if (tileCheck) { - Main.dust[num10].noLight = true; + Main.dust[dustInt].noLight = true; } } } + //glowmask effect + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, projectile.alpha); + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.ShadowFlame, 300); + target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 120); projectile.Kill(); } } diff --git a/Projectiles/Melee/DemonBlast.png b/Projectiles/Melee/DemonBlast.png index ead80128fa..7cdcec7ec6 100644 Binary files a/Projectiles/Melee/DemonBlast.png and b/Projectiles/Melee/DemonBlast.png differ diff --git a/Projectiles/Melee/DemonBlastType2.cs b/Projectiles/Melee/DemonBlastType2.cs deleted file mode 100644 index a89979647f..0000000000 --- a/Projectiles/Melee/DemonBlastType2.cs +++ /dev/null @@ -1,132 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class DemonBlastType2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blast"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.penetrate = 1; - projectile.extraUpdates = 5; - projectile.tileCollide = false; - projectile.melee = true; - } - - public override void AI() - { - if (projectile.ai[1] != -1f && projectile.position.Y > projectile.ai[1]) - { - projectile.tileCollide = true; - } - if (projectile.position.HasNaNs()) - { - projectile.Kill(); - return; - } - bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f)]; - dust6.position = projectile.Center; - dust6.velocity = Vector2.Zero; - dust6.noGravity = true; - if (flag5) - { - dust6.noLight = true; - } - if (projectile.ai[1] == -1f) - { - projectile.ai[0] += 1f; - projectile.velocity = Vector2.Zero; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.position = projectile.Center; - projectile.width = projectile.height = 140; - projectile.Center = projectile.position; - projectile.alpha -= 10; - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - if (++projectile.frameCounter >= projectile.MaxUpdates * 3) - { - projectile.frameCounter = 0; - projectile.frame++; - } - if (projectile.ai[0] >= (float)(Main.projFrames[projectile.type] * projectile.MaxUpdates * 3)) - { - projectile.Kill(); - } - return; - } - projectile.alpha = 255; - if (projectile.numUpdates == 0) - { - int num158 = -1; - float num159 = 60f; - for (int num160 = 0; num160 < 200; num160++) - { - NPC nPC = Main.npc[num160]; - if (nPC.CanBeChasedBy(projectile, false)) - { - float num161 = projectile.Distance(nPC.Center); - if (num161 < num159 && Collision.CanHitLine(projectile.Center, 0, 0, nPC.Center, 0, 0)) - { - num159 = num161; - num158 = num160; - } - } - } - if (num158 != -1) - { - projectile.ai[0] = 0f; - projectile.ai[1] = -1f; - projectile.netUpdate = true; - } - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - for (int m = 0; m < 4; m++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f); - } - for (int n = 0; n < 4; n++) - { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 2.5f); - Main.dust[num10].noGravity = true; - Main.dust[num10].velocity *= 3f; - if (flag) - { - Main.dust[num10].noLight = true; - } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f); - Main.dust[num10].velocity *= 2f; - Main.dust[num10].noGravity = true; - if (flag) - { - Main.dust[num10].noLight = true; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 300); - projectile.Kill(); - } - } -} diff --git a/Projectiles/Melee/DemonBlastType2.png b/Projectiles/Melee/DemonBlastType2.png deleted file mode 100644 index ead80128fa..0000000000 Binary files a/Projectiles/Melee/DemonBlastType2.png and /dev/null differ diff --git a/Projectiles/Melee/DemonBlastType3.cs b/Projectiles/Melee/DemonBlastType3.cs deleted file mode 100644 index fafa0292f9..0000000000 --- a/Projectiles/Melee/DemonBlastType3.cs +++ /dev/null @@ -1,131 +0,0 @@ -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class DemonBlastType3 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blast"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.penetrate = 1; - projectile.extraUpdates = 5; - projectile.tileCollide = false; - projectile.melee = true; - } - - public override void AI() - { - if (projectile.ai[1] != -1f && projectile.position.Y > projectile.ai[1]) - { - projectile.tileCollide = true; - } - if (projectile.position.HasNaNs()) - { - projectile.Kill(); - return; - } - bool flag5 = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - Dust dust6 = Main.dust[Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default, 1f)]; - dust6.position = projectile.Center; - dust6.velocity = Vector2.Zero; - dust6.noGravity = true; - if (flag5) - { - dust6.noLight = true; - } - if (projectile.ai[1] == -1f) - { - projectile.ai[0] += 1f; - projectile.velocity = Vector2.Zero; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.position = projectile.Center; - projectile.width = projectile.height = 140; - projectile.Center = projectile.position; - projectile.alpha -= 10; - if (projectile.alpha < 0) - { - projectile.alpha = 0; - } - if (++projectile.frameCounter >= projectile.MaxUpdates * 3) - { - projectile.frameCounter = 0; - projectile.frame++; - } - if (projectile.ai[0] >= (float)(Main.projFrames[projectile.type] * projectile.MaxUpdates * 3)) - { - projectile.Kill(); - } - return; - } - projectile.alpha = 255; - if (projectile.numUpdates == 0) - { - int num158 = -1; - float num159 = 60f; - for (int num160 = 0; num160 < 200; num160++) - { - NPC nPC = Main.npc[num160]; - if (nPC.CanBeChasedBy(projectile, false)) - { - float num161 = projectile.Distance(nPC.Center); - if (num161 < num159 && Collision.CanHitLine(projectile.Center, 0, 0, nPC.Center, 0, 0)) - { - num159 = num161; - num158 = num160; - } - } - } - if (num158 != -1) - { - projectile.ai[0] = 0f; - projectile.ai[1] = -1f; - projectile.netUpdate = true; - } - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); - for (int m = 0; m < 4; m++) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default, 1.5f); - } - for (int n = 0; n < 4; n++) - { - int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 0, default, 2.5f); - Main.dust[num10].noGravity = true; - Main.dust[num10].velocity *= 3f; - if (flag) - { - Main.dust[num10].noLight = true; - } - num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 172, 0f, 0f, 100, default, 1.5f); - Main.dust[num10].velocity *= 2f; - Main.dust[num10].noGravity = true; - if (flag) - { - Main.dust[num10].noLight = true; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 120); - projectile.Kill(); - } - } -} diff --git a/Projectiles/Melee/DemonBlastType3.png b/Projectiles/Melee/DemonBlastType3.png deleted file mode 100644 index ead80128fa..0000000000 Binary files a/Projectiles/Melee/DemonBlastType3.png and /dev/null differ diff --git a/Projectiles/Melee/DepthOrb.cs b/Projectiles/Melee/DepthOrb.cs index 81c3d5e346..55372a55a9 100644 --- a/Projectiles/Melee/DepthOrb.cs +++ b/Projectiles/Melee/DepthOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Melee/DepthOrb2.cs b/Projectiles/Melee/DepthOrb2.cs index 333a4fe9cf..330c767bd4 100644 --- a/Projectiles/Melee/DepthOrb2.cs +++ b/Projectiles/Melee/DepthOrb2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index cef718c9c8..d479e4abb6 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -205,7 +205,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 88); + Main.PlaySound(SoundID.Item88, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index db87deba3c..f3123d482c 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override void AI() diff --git a/Projectiles/Melee/DracoBeam.cs b/Projectiles/Melee/DracoBeam.cs index b082503000..8f23a2cb49 100644 --- a/Projectiles/Melee/DracoBeam.cs +++ b/Projectiles/Melee/DracoBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/DracoBeam2.cs b/Projectiles/Melee/DracoBeam2.cs index e32d8d95d4..1edd0cf2c6 100644 --- a/Projectiles/Melee/DracoBeam2.cs +++ b/Projectiles/Melee/DracoBeam2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/DraconicSpark.cs b/Projectiles/Melee/DraconicSpark.cs index deffc8a304..7535d8064c 100644 --- a/Projectiles/Melee/DraconicSpark.cs +++ b/Projectiles/Melee/DraconicSpark.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index a08543c626..706d707863 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/DragonRageProj.cs b/Projectiles/Melee/DragonRageProj.cs index 7b7f2b4d73..86513eade7 100644 --- a/Projectiles/Melee/DragonRageProj.cs +++ b/Projectiles/Melee/DragonRageProj.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } if (projectile.localAI[1] <= 60f) @@ -48,7 +49,8 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile explosion = Projectile.NewProjectileDirect(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + explosion.Calamity().forceMelee = true; } } @@ -63,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 100; diff --git a/Projectiles/Melee/Earth2.cs b/Projectiles/Melee/Earth2.cs index 646be7e677..cb7f58421f 100644 --- a/Projectiles/Melee/Earth2.cs +++ b/Projectiles/Melee/Earth2.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } projectile.alpha -= 15; @@ -86,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, (int)projectile.position.X, (int)projectile.position.Y); for (int k = 0; k < 15; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index 2976363774..d4046ae419 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } projectile.alpha -= 15; @@ -85,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 30; diff --git a/Projectiles/Melee/Earth4.cs b/Projectiles/Melee/Earth4.cs index 75586af9c4..eaae96d583 100644 --- a/Projectiles/Melee/Earth4.cs +++ b/Projectiles/Melee/Earth4.cs @@ -1,7 +1,8 @@ -using CalamityMod.Projectiles.Healing; +using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } projectile.alpha -= 15; @@ -85,7 +86,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, (int)projectile.position.X, (int)projectile.position.Y); for (int k = 0; k < 15; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); @@ -94,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 4); + Main.PlaySound(SoundID.Item4, (int)projectile.position.X, (int)projectile.position.Y); float healAmt = (float)damage * 0.075f; if ((int)healAmt == 0) { diff --git a/Projectiles/Melee/EarthProj.cs b/Projectiles/Melee/EarthProj.cs index a334825aad..f12693e6ec 100644 --- a/Projectiles/Melee/EarthProj.cs +++ b/Projectiles/Melee/EarthProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } projectile.alpha -= 15; @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), projChoice, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), projChoice, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, (int)projectile.position.X, (int)projectile.position.Y); for (int k = 0; k < 15; k++) { int dustChoice = Main.rand.Next(3); @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Melee { target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Frostburn, 600); - target.AddBuff(BuffID.CursedInferno, 600); + target.AddBuff(BuffID.CursedInferno, 300); } } } diff --git a/Projectiles/Melee/ElementBall.cs b/Projectiles/Melee/ElementBall.cs index 9cbc689869..efd8cdc27e 100644 --- a/Projectiles/Melee/ElementBall.cs +++ b/Projectiles/Melee/ElementBall.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ElementBall : ModProjectile + public class ElementBall : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/ElementBallShiv.cs b/Projectiles/Melee/ElementBallShiv.cs index c527b84242..a3ebd7e5db 100644 --- a/Projectiles/Melee/ElementBallShiv.cs +++ b/Projectiles/Melee/ElementBallShiv.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/ElementalExcaliburBeam.cs b/Projectiles/Melee/ElementalExcaliburBeam.cs index 14b0b56ee5..9df00e4032 100644 --- a/Projectiles/Melee/ElementalExcaliburBeam.cs +++ b/Projectiles/Melee/ElementalExcaliburBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/EonBeam.cs b/Projectiles/Melee/EonBeam.cs index fdcf541027..089557862f 100644 --- a/Projectiles/Melee/EonBeam.cs +++ b/Projectiles/Melee/EonBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/EonBeamV2.cs b/Projectiles/Melee/EonBeamV2.cs index 6539fb3962..8e00b9bb2a 100644 --- a/Projectiles/Melee/EonBeamV2.cs +++ b/Projectiles/Melee/EonBeamV2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/EonBeamV3.cs b/Projectiles/Melee/EonBeamV3.cs index 78c5476b73..fafd897032 100644 --- a/Projectiles/Melee/EonBeamV3.cs +++ b/Projectiles/Melee/EonBeamV3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/EonBeamV4.cs b/Projectiles/Melee/EonBeamV4.cs index 1a02714fed..a2f685c4f8 100644 --- a/Projectiles/Melee/EonBeamV4.cs +++ b/Projectiles/Melee/EonBeamV4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/EssenceBeam.cs b/Projectiles/Melee/EssenceBeam.cs index 3c349854d9..ecc1241a95 100644 --- a/Projectiles/Melee/EssenceBeam.cs +++ b/Projectiles/Melee/EssenceBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/EssenceFireball.cs b/Projectiles/Melee/EssenceFireball.cs index e44ed655d1..36c4e64058 100644 --- a/Projectiles/Melee/EssenceFireball.cs +++ b/Projectiles/Melee/EssenceFireball.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/EssenceFlame2.cs b/Projectiles/Melee/EssenceFlame2.cs index 30df45ad1b..9e6f4918c4 100644 --- a/Projectiles/Melee/EssenceFlame2.cs +++ b/Projectiles/Melee/EssenceFlame2.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class EssenceFlame2 : ModProjectile + public class EssenceFlame2 : ModProjectile { public override void SetStaticDefaults() { @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, projectile.Center); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index d863436f56..de27177abd 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class EssenceScythe : ModProjectile + public class EssenceScythe : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/EutrophicScimitarProj.cs b/Projectiles/Melee/EutrophicScimitarProj.cs index 7927c51bd2..921e77504b 100644 --- a/Projectiles/Melee/EutrophicScimitarProj.cs +++ b/Projectiles/Melee/EutrophicScimitarProj.cs @@ -1,12 +1,11 @@ using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class EutrophicScimitarProj : ModProjectile + public class EutrophicScimitarProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/EutrophicSpark.cs b/Projectiles/Melee/EutrophicSpark.cs index cfe1df00a4..41b6424589 100644 --- a/Projectiles/Melee/EutrophicSpark.cs +++ b/Projectiles/Melee/EutrophicSpark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/ExcelsusBlue.cs b/Projectiles/Melee/ExcelsusBlue.cs index d8bc69fe93..9f55c3eae6 100644 --- a/Projectiles/Melee/ExcelsusBlue.cs +++ b/Projectiles/Melee/ExcelsusBlue.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/ExcelsusMain.cs b/Projectiles/Melee/ExcelsusMain.cs index d2dc77f972..9eef3383bd 100644 --- a/Projectiles/Melee/ExcelsusMain.cs +++ b/Projectiles/Melee/ExcelsusMain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/ExcelsusPink.cs b/Projectiles/Melee/ExcelsusPink.cs index 6215b85e54..327e302029 100644 --- a/Projectiles/Melee/ExcelsusPink.cs +++ b/Projectiles/Melee/ExcelsusPink.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/ExoGladComet.cs b/Projectiles/Melee/ExoGladComet.cs index 80ffa279c7..ede9497a67 100644 --- a/Projectiles/Melee/ExoGladComet.cs +++ b/Projectiles/Melee/ExoGladComet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 80; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/ExoGladProj.cs b/Projectiles/Melee/ExoGladProj.cs index d2ebdcf12e..ae2b717f7e 100644 --- a/Projectiles/Melee/ExoGladProj.cs +++ b/Projectiles/Melee/ExoGladProj.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ExoGladProj : ModProjectile + public class ExoGladProj : ModProjectile { private float counter = 0f; diff --git a/Projectiles/Melee/ExoGladSpears.cs b/Projectiles/Melee/ExoGladSpears.cs index 3cd9a5a5ae..8b1a20bf84 100644 --- a/Projectiles/Melee/ExoGladSpears.cs +++ b/Projectiles/Melee/ExoGladSpears.cs @@ -3,13 +3,12 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ExoGladSpears : ModProjectile + public class ExoGladSpears : ModProjectile { private Color currentColor = Color.Black; @@ -143,8 +142,8 @@ namespace CalamityMod.Projectiles.Melee projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74, 1f, 0f); - int dustType = Utils.SelectRandom(Main.rand, new int[] + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); + int dustType = Utils.SelectRandom(Main.rand, new int[] { 107, 234, diff --git a/Projectiles/Melee/ExoGladiusBeam.cs b/Projectiles/Melee/ExoGladiusBeam.cs index 6d2f50bedf..e0b562e115 100644 --- a/Projectiles/Melee/ExoGladiusBeam.cs +++ b/Projectiles/Melee/ExoGladiusBeam.cs @@ -3,13 +3,12 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ExoGladiusBeam : ModProjectile + public class ExoGladiusBeam : ModProjectile { private int penetrationAmt = 6; private Color currentColor = Color.Black; diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index 82ccdebbc5..77884b6d39 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.localAI[1] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[1] += 1f; } counter++; @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Melee projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(29, (int)projectile.Center.X, (int)projectile.Center.Y, 103); + Main.PlaySound(SoundID.Zombie, (int)projectile.Center.X, (int)projectile.Center.Y, 103); for (int num193 = 0; num193 < 3; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); diff --git a/Projectiles/Melee/Exoboom.cs b/Projectiles/Melee/Exoboom.cs index e95ac9fd39..8b5b528c9e 100644 --- a/Projectiles/Melee/Exoboom.cs +++ b/Projectiles/Melee/Exoboom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.75f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Melee/Exocomet.cs b/Projectiles/Melee/Exocomet.cs index 6cbfc7d942..4efc5a5ed2 100644 --- a/Projectiles/Melee/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 80; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/Feather.cs b/Projectiles/Melee/Feather.cs index 4e7731e1f7..cfb6ed319b 100644 --- a/Projectiles/Melee/Feather.cs +++ b/Projectiles/Melee/Feather.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Flarefrost.cs b/Projectiles/Melee/Flarefrost.cs index 482e53cf3d..e91ac5b1fe 100644 --- a/Projectiles/Melee/Flarefrost.cs +++ b/Projectiles/Melee/Flarefrost.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Flarefrost : ModProjectile + public class Flarefrost : ModProjectile { public override void SetStaticDefaults() { @@ -56,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.Center); for (int k = 0; k < 2; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Melee/ForbiddenOathbladeProjectile.cs b/Projectiles/Melee/ForbiddenOathbladeProjectile.cs index 9e418aff11..a2651d5e87 100644 --- a/Projectiles/Melee/ForbiddenOathbladeProjectile.cs +++ b/Projectiles/Melee/ForbiddenOathbladeProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 50; - projectile.height = 50; + projectile.width = 46; + projectile.height = 46; projectile.aiStyle = 18; projectile.alpha = 100; projectile.friendly = true; diff --git a/Projectiles/Melee/ForbiddenOathbladeProjectile.png b/Projectiles/Melee/ForbiddenOathbladeProjectile.png index e594d983b1..d453f1565e 100644 Binary files a/Projectiles/Melee/ForbiddenOathbladeProjectile.png and b/Projectiles/Melee/ForbiddenOathbladeProjectile.png differ diff --git a/Projectiles/Melee/FossilSpike.cs b/Projectiles/Melee/FossilSpike.cs index 70dc57b4ec..79a514c741 100644 --- a/Projectiles/Melee/FossilSpike.cs +++ b/Projectiles/Melee/FossilSpike.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/GaelExplosion.cs b/Projectiles/Melee/GaelExplosion.cs index 631965c72e..59a910a3ae 100644 --- a/Projectiles/Melee/GaelExplosion.cs +++ b/Projectiles/Melee/GaelExplosion.cs @@ -1,10 +1,10 @@ -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.World; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class GaelExplosion : ModProjectile @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.75f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, projectile.Center); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Melee/GaelSkull.cs b/Projectiles/Melee/GaelSkull.cs index a00e03f1d2..7cb8df1cf1 100644 --- a/Projectiles/Melee/GaelSkull.cs +++ b/Projectiles/Melee/GaelSkull.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/GaelSkull2.cs b/Projectiles/Melee/GaelSkull2.cs index 35c69be239..1ac7cfd262 100644 --- a/Projectiles/Melee/GaelSkull2.cs +++ b/Projectiles/Melee/GaelSkull2.cs @@ -1,14 +1,12 @@ -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.World; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class GaelSkull2 : ModProjectile + public class GaelSkull2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/GalacticaComet.cs b/Projectiles/Melee/GalacticaComet.cs index fd38021efd..4afed16530 100644 --- a/Projectiles/Melee/GalacticaComet.cs +++ b/Projectiles/Melee/GalacticaComet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.localAI[0] += 1f; @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 144; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/Galaxia.cs b/Projectiles/Melee/Galaxia.cs index 6747d80ca4..effeaf16c3 100644 --- a/Projectiles/Melee/Galaxia.cs +++ b/Projectiles/Melee/Galaxia.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Potions; using CalamityMod.CalPlayer; @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.alpha -= 15; diff --git a/Projectiles/Melee/Galaxia2.cs b/Projectiles/Melee/Galaxia2.cs index 5e7250853b..eebc2baa87 100644 --- a/Projectiles/Melee/Galaxia2.cs +++ b/Projectiles/Melee/Galaxia2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Potions; using CalamityMod.CalPlayer; @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.alpha -= 15; diff --git a/Projectiles/Melee/GalaxyBlast.cs b/Projectiles/Melee/GalaxyBlast.cs index 74d2505d5a..49366690f0 100644 --- a/Projectiles/Melee/GalaxyBlast.cs +++ b/Projectiles/Melee/GalaxyBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { diff --git a/Projectiles/Melee/GalaxyBlastType2.cs b/Projectiles/Melee/GalaxyBlastType2.cs index 759517a022..38701c980b 100644 --- a/Projectiles/Melee/GalaxyBlastType2.cs +++ b/Projectiles/Melee/GalaxyBlastType2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { diff --git a/Projectiles/Melee/GalaxyBlastType3.cs b/Projectiles/Melee/GalaxyBlastType3.cs index f5ea603b1a..7320c808ad 100644 --- a/Projectiles/Melee/GalaxyBlastType3.cs +++ b/Projectiles/Melee/GalaxyBlastType3.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 600); + target.AddBuff(BuffID.Ichor, 180); projectile.Kill(); } } diff --git a/Projectiles/Melee/GalaxyStar.cs b/Projectiles/Melee/GalaxyStar.cs index 7219aa3358..4a120d526d 100644 --- a/Projectiles/Melee/GalaxyStar.cs +++ b/Projectiles/Melee/GalaxyStar.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee Lighting.AddLight(projectile.Center, 1f, 1f, 1f); if (!madeCoolMagicSound) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); //starfury sound + Main.PlaySound(SoundID.Item9, projectile.position); // Starfury sound madeCoolMagicSound = true; } projectile.ai[0]++; diff --git a/Projectiles/Melee/GalileosMoon.cs b/Projectiles/Melee/GalileosMoon.cs index c5c69d8832..189e53838d 100644 --- a/Projectiles/Melee/GalileosMoon.cs +++ b/Projectiles/Melee/GalileosMoon.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.rotation += (float) projectile.direction * 0.05f; diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index 96142e5aa2..07b18d4aa5 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Melee dust.shader = GameShaders.Armor.GetSecondaryShader(47, Main.LocalPlayer); } - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43); + Main.PlaySound(SoundID.NPCDeath43, projectile.position); for (int i = 0; i < 155; i++) { diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index 7c9f243ded..c15068673d 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); projectile.localAI[0] += 1f; } Lighting.AddLight(projectile.Center, 0f, 0.2f, 0.4f); diff --git a/Projectiles/Melee/GhastlySoulLarge.cs b/Projectiles/Melee/GhastlySoulLarge.cs index 0daadc3dfe..62bb73ddd1 100644 --- a/Projectiles/Melee/GhastlySoulLarge.cs +++ b/Projectiles/Melee/GhastlySoulLarge.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 39, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath39, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Melee/GhastlySoulMedium.cs b/Projectiles/Melee/GhastlySoulMedium.cs index ea6c814a01..080d2d211b 100644 --- a/Projectiles/Melee/GhastlySoulMedium.cs +++ b/Projectiles/Melee/GhastlySoulMedium.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 39, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath39, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Melee/GhastlySoulSmall.cs b/Projectiles/Melee/GhastlySoulSmall.cs index 8be8720284..9047b19995 100644 --- a/Projectiles/Melee/GhastlySoulSmall.cs +++ b/Projectiles/Melee/GhastlySoulSmall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Melee projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 39, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath39, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Melee/GreenBall.cs b/Projectiles/Melee/GreenBall.cs index 778c0175ee..5ca2cbf060 100644 --- a/Projectiles/Melee/GreenBall.cs +++ b/Projectiles/Melee/GreenBall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.CursedInferno, 120); } } } diff --git a/Projectiles/Melee/GreenDust.cs b/Projectiles/Melee/GreenDust.cs index abf61dc874..ff2a046271 100644 --- a/Projectiles/Melee/GreenDust.cs +++ b/Projectiles/Melee/GreenDust.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/GreenWater.cs b/Projectiles/Melee/GreenWater.cs index aa89cb719b..800cffb86e 100644 --- a/Projectiles/Melee/GreenWater.cs +++ b/Projectiles/Melee/GreenWater.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); projectile.localAI[0] += 1f; } int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index 5c3548865e..a682079272 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -1,6 +1,5 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index 03859886af..73413c4317 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -71,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 150; diff --git a/Projectiles/Melee/HyperBlade.cs b/Projectiles/Melee/HyperBlade.cs index 8c399b7a59..18a8a5d620 100644 --- a/Projectiles/Melee/HyperBlade.cs +++ b/Projectiles/Melee/HyperBlade.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class HyperBlade : ModProjectile + public class HyperBlade : ModProjectile { public override void SetStaticDefaults() { @@ -60,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Venom, 120); - target.AddBuff(BuffID.CursedInferno, 240); + target.AddBuff(BuffID.CursedInferno, 120); } } } diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index d6dbbc2e85..47e0d51738 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -1,7 +1,9 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class IceBombFriendly : ModProjectile @@ -35,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); float spread = 90f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -46,9 +48,9 @@ namespace CalamityMod.Projectiles.Melee for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), 349, 30, 2f, projectile.owner, 0f, 0f); + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); Main.projectile[projectile1].Calamity().forceMelee = true; - int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), 349, 30, 2f, projectile.owner, 0f, 0f); + int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); Main.projectile[projectile2].Calamity().forceMelee = true; } } diff --git a/Projectiles/Melee/Iceberg.cs b/Projectiles/Melee/Iceberg.cs index 2d233f1b63..e2c3678cd8 100644 --- a/Projectiles/Melee/Iceberg.cs +++ b/Projectiles/Melee/Iceberg.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs index 89429184dc..5dff9df1da 100644 --- a/Projectiles/Melee/InsidiousHarpoon.cs +++ b/Projectiles/Melee/InsidiousHarpoon.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Melee { num297 = 46; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Melee/JudgementBlah.cs b/Projectiles/Melee/JudgementBlah.cs index 25da2f0ce4..ee36a00ec2 100644 --- a/Projectiles/Melee/JudgementBlah.cs +++ b/Projectiles/Melee/JudgementBlah.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/JudgementProj.cs b/Projectiles/Melee/JudgementProj.cs index bc70316b42..46b1316257 100644 --- a/Projectiles/Melee/JudgementProj.cs +++ b/Projectiles/Melee/JudgementProj.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -65,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); + Main.PlaySound(SoundID.Item122, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 100, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Melee/LaserFountain.cs b/Projectiles/Melee/LaserFountain.cs index 03ab9ade1d..d07c1d5c8e 100644 --- a/Projectiles/Melee/LaserFountain.cs +++ b/Projectiles/Melee/LaserFountain.cs @@ -1,9 +1,8 @@ -using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class LaserFountain : ModProjectile + public class LaserFountain : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Leech.cs b/Projectiles/Melee/Leech.cs index 805c041da9..f1a95baf0d 100644 --- a/Projectiles/Melee/Leech.cs +++ b/Projectiles/Melee/Leech.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Leech : ModProjectile + public class Leech : ModProjectile { public override void SetStaticDefaults() { @@ -47,6 +46,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + if (Main.player[projectile.owner].moonLeech) + return; Player player = Main.player[projectile.owner]; player.statLife += 5; player.HealEffect(5); diff --git a/Projectiles/Melee/LifeScythe.cs b/Projectiles/Melee/LifeScythe.cs index dcd932cbeb..e5d767f97e 100644 --- a/Projectiles/Melee/LifeScythe.cs +++ b/Projectiles/Melee/LifeScythe.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/Light.cs b/Projectiles/Melee/Light.cs index bcf3190735..d3945cd8de 100644 --- a/Projectiles/Melee/Light.cs +++ b/Projectiles/Melee/Light.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/LightBeam.cs b/Projectiles/Melee/LightBeam.cs index 5b0170ce8d..3a1ee284a3 100644 --- a/Projectiles/Melee/LightBeam.cs +++ b/Projectiles/Melee/LightBeam.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/LightningThing.cs b/Projectiles/Melee/LightningThing.cs index 41dbe60439..d348763537 100644 --- a/Projectiles/Melee/LightningThing.cs +++ b/Projectiles/Melee/LightningThing.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.World; namespace CalamityMod.Projectiles.Melee { - public class LightningThing : ModProjectile + public class LightningThing : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/LuxorsGiftMelee.cs b/Projectiles/Melee/LuxorsGiftMelee.cs index ca7e015c9e..b5777d5a32 100644 --- a/Projectiles/Melee/LuxorsGiftMelee.cs +++ b/Projectiles/Melee/LuxorsGiftMelee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/MarianaProjectile.cs b/Projectiles/Melee/MarianaProjectile.cs index c82ad8c5eb..999c67817c 100644 --- a/Projectiles/Melee/MarianaProjectile.cs +++ b/Projectiles/Melee/MarianaProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/MarniteObliteratorProj.cs b/Projectiles/Melee/MarniteObliteratorProj.cs index f685f7f62a..ae875ee8fc 100644 --- a/Projectiles/Melee/MarniteObliteratorProj.cs +++ b/Projectiles/Melee/MarniteObliteratorProj.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Melee projectile.hide = true; projectile.ownerHitCheck = true; projectile.melee = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } } } diff --git a/Projectiles/Melee/MicrowaveAura.cs b/Projectiles/Melee/MicrowaveAura.cs index eaa5abb38e..5b0e461914 100644 --- a/Projectiles/Melee/MicrowaveAura.cs +++ b/Projectiles/Melee/MicrowaveAura.cs @@ -2,12 +2,11 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee.Yoyos; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class MicrowaveAura : ModProjectile + public class MicrowaveAura : ModProjectile { private int radius = 100; diff --git a/Projectiles/Melee/MirrorBlast.cs b/Projectiles/Melee/MirrorBlast.cs index b296648602..ae3fb1ef53 100644 --- a/Projectiles/Melee/MirrorBlast.cs +++ b/Projectiles/Melee/MirrorBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/MourningSkull.cs b/Projectiles/Melee/MourningSkull.cs index cc30142415..c526fdfb56 100644 --- a/Projectiles/Melee/MourningSkull.cs +++ b/Projectiles/Melee/MourningSkull.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/MourningstarFlail.cs b/Projectiles/Melee/MourningstarFlail.cs index e885d8e161..e108572efd 100644 --- a/Projectiles/Melee/MourningstarFlail.cs +++ b/Projectiles/Melee/MourningstarFlail.cs @@ -1,11 +1,10 @@ -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.BaseProjectiles; using Terraria; using Terraria.ID; -using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class MourningstarFlail : BaseWhipProjectile + public class MourningstarFlail : BaseWhipProjectile { public override void SetStaticDefaults() { @@ -29,6 +28,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Daybreak, 300); + // Note: This is being left as the solar explosion projectile for now, since the weapon is in a good balancing position right now. + // If it is to be rebalanced, consider replacing it with the FuckYou projectile (which does not mess with I-frames) if (projectile.localAI[1] <= 0f && projectile.owner == Main.myPlayer) { Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); diff --git a/Projectiles/Melee/MurasamaProj.cs b/Projectiles/Melee/MurasamaProj.cs deleted file mode 100644 index 625d47d292..0000000000 --- a/Projectiles/Melee/MurasamaProj.cs +++ /dev/null @@ -1,102 +0,0 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class MurasamaProj : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Murasama"); - Main.projFrames[projectile.type] = 28; - } - - public override void SetDefaults() - { - projectile.width = 148; - projectile.height = 68; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.melee = true; - projectile.ownerHitCheck = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 0; - projectile.Calamity().trueMelee = true; - } - - public override void AI() - { - Player player = Main.player[projectile.owner]; - float num = 0f; - Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); - if (projectile.spriteDirection == -1) - { - num = 3.14159274f; - } - if (++projectile.frame >= Main.projFrames[projectile.type]) - { - projectile.frame = 0; - } - projectile.soundDelay--; - if (projectile.soundDelay <= 0) - { - Main.PlaySound(SoundID.Item15, projectile.Center); - projectile.soundDelay = 24; - } - if (Main.myPlayer == projectile.owner) - { - if (player.channel && !player.noItems && !player.CCed) - { - float scaleFactor6 = 1f; - if (player.ActiveItem().shoot == projectile.type) - { - scaleFactor6 = player.ActiveItem().shootSpeed * projectile.scale; - } - Vector2 vector13 = Main.MouseWorld - vector; - vector13.Normalize(); - if (vector13.HasNaNs()) - { - vector13 = Vector2.UnitX * (float)player.direction; - } - vector13 *= scaleFactor6; - if (vector13.X != projectile.velocity.X || vector13.Y != projectile.velocity.Y) - { - projectile.netUpdate = true; - } - projectile.velocity = vector13; - } - else - { - projectile.Kill(); - } - } - Vector2 vector14 = projectile.Center + projectile.velocity * 3f; - Lighting.AddLight(vector14, 3f, 0.2f, 0.2f); - if (Main.rand.NextBool(3)) - { - int num30 = Dust.NewDust(vector14 - projectile.Size / 2f, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, projectile.velocity.X, projectile.velocity.Y, 100, default, 2f); - Main.dust[num30].noGravity = true; - Main.dust[num30].position -= projectile.velocity; - } - projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; - projectile.rotation = projectile.velocity.ToRotation() + num; - projectile.spriteDirection = projectile.direction; - projectile.timeLeft = 2; - player.ChangeDir(projectile.direction); - player.heldProj = projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 0, 0, 0); - } - } -} diff --git a/Projectiles/Melee/MurasamaProj.png b/Projectiles/Melee/MurasamaProj.png deleted file mode 100644 index 3680218463..0000000000 Binary files a/Projectiles/Melee/MurasamaProj.png and /dev/null differ diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs new file mode 100644 index 0000000000..51fdcb2818 --- /dev/null +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -0,0 +1,140 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class MurasamaSlash : ModProjectile + { + public int frameX = 0; + public int frameY = 0; + + public int CurrentFrame + { + get => frameX * 7 + frameY; + set + { + frameX = value / 7; + frameY = value % 7; + } + } + + // A "slash" is only present during 2 specific frames (ones with a slash effect) right before they transition to the next frame. + public bool Slashing => CurrentFrame % 7 == 0 && projectile.frameCounter % 3 == 2; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Murasama"); + } + + public override void SetDefaults() + { + projectile.width = 236; + projectile.height = 180; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.ownerHitCheck = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 0; + //projectile.Calamity().trueMelee = true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Vector2 origin = texture.Size() / new Vector2(2f, 7f) * 0.5f; + Rectangle frame = texture.Frame(2, 7, frameX, frameY); + SpriteEffects spriteEffects = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, origin, 1f, spriteEffects, 0f); + return false; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + + //Frames and crap + projectile.frameCounter++; + if (projectile.frameCounter % 3 == 0) + { + CurrentFrame++; + if (frameX >= 2) + CurrentFrame = 0; + } + + // Play a "droning" noise every so often. + if (Slashing) + { + Main.PlaySound(SoundID.Item15, projectile.Center); + } + + // Create idle light and dust. + Vector2 origin = projectile.Center + projectile.velocity * 3f; + Lighting.AddLight(origin, 3f, 0.2f, 0.2f); + if (Main.rand.NextBool(3)) + { + int redDust = Dust.NewDust(origin - projectile.Size / 2f, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, projectile.velocity.X, projectile.velocity.Y, 100, default, 2f); + Main.dust[redDust].noGravity = true; + Main.dust[redDust].position -= projectile.velocity; + } + + Vector2 playerRotatedPoint = player.RotatedRelativePoint(player.MountedCenter, true); + if (Main.myPlayer == projectile.owner) + { + if (player.channel && !player.noItems && !player.CCed) + HandleChannelMovement(player, playerRotatedPoint); + else + projectile.Kill(); + } + + // Rotation and directioning. + float velocityAngle = projectile.velocity.ToRotation(); + projectile.rotation = velocityAngle + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + projectile.direction = (Math.Cos(velocityAngle) > 0).ToDirectionInt(); + + // Positioning close to the end of the player's arm. + projectile.position = playerRotatedPoint - projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * 80f; + + // Sprite and player directioning. + projectile.spriteDirection = projectile.direction; + player.ChangeDir(projectile.direction); + + // Prevents the projectile from dying + projectile.timeLeft = 2; + + // Player item-based field manipulation. + player.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + player.heldProj = projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + } + + public void HandleChannelMovement(Player player, Vector2 playerRotatedPoint) + { + float speed = 1f; + if (player.ActiveItem().shoot == projectile.type) + { + speed = player.ActiveItem().shootSpeed * projectile.scale; + } + Vector2 newVelocity = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * player.direction) * speed; + + // Sync if a velocity component changes. + if (projectile.velocity.X != newVelocity.X || projectile.velocity.Y != newVelocity.Y) + { + projectile.netUpdate = true; + } + projectile.velocity = newVelocity; + } + + public override Color? GetAlpha(Color lightColor) => new Color(200, 0, 0, 0); + + // You could possibly mess with the local immunity, but I personally prefer this method since it's actually specific. + public override bool CanDamage() => Slashing; + } +} diff --git a/Projectiles/Melee/MurasamaSlash.png b/Projectiles/Melee/MurasamaSlash.png new file mode 100644 index 0000000000..c637d8ec89 Binary files /dev/null and b/Projectiles/Melee/MurasamaSlash.png differ diff --git a/Projectiles/Melee/Nebudust.cs b/Projectiles/Melee/Nebudust.cs index 8b8d5e9fcb..aa8f896117 100644 --- a/Projectiles/Melee/Nebudust.cs +++ b/Projectiles/Melee/Nebudust.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/NebulaShot.cs b/Projectiles/Melee/NebulaShot.cs index 540bbdaff2..f85d4b842d 100644 --- a/Projectiles/Melee/NebulaShot.cs +++ b/Projectiles/Melee/NebulaShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + Main.PlaySound(SoundID.Item12, projectile.position); } if (projectile.alpha > 0) diff --git a/Projectiles/Melee/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 4e889530fc..4d111aecf6 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; -using Terraria.Enums; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee { - public class NebulashFlail : BaseWhipProjectile + public class NebulashFlail : BaseWhipProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/NeptuneOrb.cs b/Projectiles/Melee/NeptuneOrb.cs index fe47af6ba4..4ab697431c 100644 --- a/Projectiles/Melee/NeptuneOrb.cs +++ b/Projectiles/Melee/NeptuneOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Melee/NightStabber.cs b/Projectiles/Melee/NightStabber.cs index 8c7d472c97..6ecc088b0c 100644 --- a/Projectiles/Melee/NightStabber.cs +++ b/Projectiles/Melee/NightStabber.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class NightStabber : ModProjectile + public class NightStabber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Oathblade.cs b/Projectiles/Melee/Oathblade.cs index 416d3324ae..ebbde7105f 100644 --- a/Projectiles/Melee/Oathblade.cs +++ b/Projectiles/Melee/Oathblade.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -17,8 +17,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 50; - projectile.height = 50; + projectile.width = 58; + projectile.height = 58; projectile.aiStyle = 18; projectile.alpha = 100; projectile.friendly = true; diff --git a/Projectiles/Melee/Oathblade.png b/Projectiles/Melee/Oathblade.png index e594d983b1..2fc599ea4b 100644 Binary files a/Projectiles/Melee/Oathblade.png and b/Projectiles/Melee/Oathblade.png differ diff --git a/Projectiles/Melee/OceanBeam.cs b/Projectiles/Melee/OceanBeam.cs index 8b159385ef..14eda93e97 100644 --- a/Projectiles/Melee/OceanBeam.cs +++ b/Projectiles/Melee/OceanBeam.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -74,14 +74,14 @@ namespace CalamityMod.Projectiles.Melee { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 3; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.oldVelocity.X * 0.25f, projectile.oldVelocity.Y * 0.25f); diff --git a/Projectiles/Melee/OmegaBiomeOrb.cs b/Projectiles/Melee/OmegaBiomeOrb.cs index 534e678a97..ec3f516763 100644 --- a/Projectiles/Melee/OmegaBiomeOrb.cs +++ b/Projectiles/Melee/OmegaBiomeOrb.cs @@ -1,17 +1,16 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class OmegaBiomeOrb : ModProjectile + public class OmegaBiomeOrb : ModProjectile { private int dustType = 3; Color color = default; diff --git a/Projectiles/Melee/Orbacle.cs b/Projectiles/Melee/Orbacle.cs index c05c539cf0..957e59fb54 100644 --- a/Projectiles/Melee/Orbacle.cs +++ b/Projectiles/Melee/Orbacle.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/PlagueBeeDust.cs b/Projectiles/Melee/PlagueBeeDust.cs index fc06f63d25..78ebebf984 100644 --- a/Projectiles/Melee/PlagueBeeDust.cs +++ b/Projectiles/Melee/PlagueBeeDust.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/PlagueDust.cs b/Projectiles/Melee/PlagueDust.cs index 8e3659f2fd..3eb0abf276 100644 --- a/Projectiles/Melee/PlagueDust.cs +++ b/Projectiles/Melee/PlagueDust.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/PlagueSeeker.cs b/Projectiles/Melee/PlagueSeeker.cs index b581d63861..f51fb3cd54 100644 --- a/Projectiles/Melee/PlagueSeeker.cs +++ b/Projectiles/Melee/PlagueSeeker.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PlagueSeeker : ModProjectile + public class PlagueSeeker : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/PlasmaBall.cs b/Projectiles/Melee/PlasmaBall.cs index 7b032c54c8..fd5f2a8405 100644 --- a/Projectiles/Melee/PlasmaBall.cs +++ b/Projectiles/Melee/PlasmaBall.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PlasmaBall : ModProjectile + public class PlasmaBall : ModProjectile { public override void SetStaticDefaults() { @@ -51,10 +50,5 @@ namespace CalamityMod.Projectiles.Melee CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 12f, 20f); } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 300); - } } } diff --git a/Projectiles/Melee/PrismaticBeam.cs b/Projectiles/Melee/PrismaticBeam.cs index 6066e3b85e..39ecd9180e 100644 --- a/Projectiles/Melee/PrismaticBeam.cs +++ b/Projectiles/Melee/PrismaticBeam.cs @@ -1,18 +1,16 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -using System.IO; using Terraria; using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PrismaticBeam : ModProjectile + public class PrismaticBeam : ModProjectile { public Color[] colors = new Color[] { diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index ec2e35de71..130da32740 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -12,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PrismaticWave : ModProjectile + public class PrismaticWave : ModProjectile { private int alpha = 50; public Color[] colors = new Color[] diff --git a/Projectiles/Melee/ProfanedSwordProj.cs b/Projectiles/Melee/ProfanedSwordProj.cs index c1cf5da794..dbaef5da37 100644 --- a/Projectiles/Melee/ProfanedSwordProj.cs +++ b/Projectiles/Melee/ProfanedSwordProj.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,7 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ProfanedSwordProj : ModProjectile + public class ProfanedSwordProj : ModProjectile { private int explosionCount = 0; public override void SetStaticDefaults() @@ -68,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee { if (explosionCount < 3) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), knockback, projectile.owner); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), knockback, projectile.owner); explosionCount++; } } diff --git a/Projectiles/Melee/PwnagehammerMeleeProj.cs b/Projectiles/Melee/PwnagehammerMeleeProj.cs index 544d5d437c..ae2534c1bd 100644 --- a/Projectiles/Melee/PwnagehammerMeleeProj.cs +++ b/Projectiles/Melee/PwnagehammerMeleeProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/RSSolarFlare.cs b/Projectiles/Melee/RSSolarFlare.cs index 413ac4be5e..3b5952b077 100644 --- a/Projectiles/Melee/RSSolarFlare.cs +++ b/Projectiles/Melee/RSSolarFlare.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -92,7 +93,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Melee/RainBolt.cs b/Projectiles/Melee/RainBolt.cs index bd9b9f62ee..4319c2d5e9 100644 --- a/Projectiles/Melee/RainBolt.cs +++ b/Projectiles/Melee/RainBolt.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class RainBolt : ModProjectile + public class RainBolt : ModProjectile { public override void SetStaticDefaults() { @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.Center); projectile.localAI[0] += 1f; } @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.Center); for (int k = 0; k < 5; k++) { int rain = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB)); diff --git a/Projectiles/Melee/RainbowBoom.cs b/Projectiles/Melee/RainbowBoom.cs index f40286108a..8c3a10cba8 100644 --- a/Projectiles/Melee/RainbowBoom.cs +++ b/Projectiles/Melee/RainbowBoom.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Razorwind.cs b/Projectiles/Melee/Razorwind.cs index 6f5cdf8f48..7c84a05395 100644 --- a/Projectiles/Melee/Razorwind.cs +++ b/Projectiles/Melee/Razorwind.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Razorwind : ModProjectile + public class Razorwind : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/RedBall.cs b/Projectiles/Melee/RedBall.cs index 230af335f0..a489dc1a20 100644 --- a/Projectiles/Melee/RedBall.cs +++ b/Projectiles/Melee/RedBall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/RedDust.cs b/Projectiles/Melee/RedDust.cs index c864783f4f..4319ef7feb 100644 --- a/Projectiles/Melee/RedDust.cs +++ b/Projectiles/Melee/RedDust.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 5b7744a98c..6dfcb4d07f 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -71,7 +72,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 19); + Main.PlaySound(SoundID.NPCDeath19, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Melee/Rox1.cs b/Projectiles/Melee/Rox1.cs index 9ecc5f24e1..34dcb0051a 100644 --- a/Projectiles/Melee/Rox1.cs +++ b/Projectiles/Melee/Rox1.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class Rox1 : ModProjectile @@ -57,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee { Dust.NewDust(projectile.position, projectile.width, projectile.height, 191, -projectile.velocity.X * 0.4f, -projectile.velocity.Y * 0.4f, 120, default, 1.2f); } - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Melee/RoxShockwave.cs b/Projectiles/Melee/RoxShockwave.cs index afb461e645..64f81b10fc 100644 --- a/Projectiles/Melee/RoxShockwave.cs +++ b/Projectiles/Melee/RoxShockwave.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class RoxShockwave : ModProjectile diff --git a/Projectiles/Melee/RoxSlam.cs b/Projectiles/Melee/RoxSlam.cs index 25084c5720..f2aeb687ed 100644 --- a/Projectiles/Melee/RoxSlam.cs +++ b/Projectiles/Melee/RoxSlam.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class RoxSlam : ModProjectile @@ -40,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee player.fallStart = (int)(player.position.Y / 16f); //Spawns the shockwave Projectile.NewProjectile(projectile.position.X + 25, projectile.position.Y + 25, 0f, 0f, ModContent.ProjectileType(), 300, 12, projectile.owner); - Main.PlaySound(2, projectile.position, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.Kill(); //Pretty things for (int dustexplode = 0; dustexplode < 360; dustexplode++) @@ -59,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee player.velocity.Y = -14f; //reset player fall damage player.fallStart = (int)(player.position.Y / 16f); - Main.PlaySound(21, projectile.position); + Main.PlaySound(SoundID.Tink, projectile.position); projectile.Kill(); return false; diff --git a/Projectiles/Melee/SHIV.cs b/Projectiles/Melee/SHIV.cs index fa9cbbcf4c..1072dba0d2 100644 --- a/Projectiles/Melee/SHIV.cs +++ b/Projectiles/Melee/SHIV.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/SandBlade.cs b/Projectiles/Melee/SandBlade.cs index 5c699c795a..f4c092f2f8 100644 --- a/Projectiles/Melee/SandBlade.cs +++ b/Projectiles/Melee/SandBlade.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/SandFire.cs b/Projectiles/Melee/SandFire.cs index 3d65ef7d8c..f42aababec 100644 --- a/Projectiles/Melee/SandFire.cs +++ b/Projectiles/Melee/SandFire.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class SandFire : ModProjectile + public class SandFire : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/ShortBeam.cs b/Projectiles/Melee/ShortBeam.cs index 850bbce4ac..a97d2516d8 100644 --- a/Projectiles/Melee/ShortBeam.cs +++ b/Projectiles/Melee/ShortBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/ShortNightBeam.cs b/Projectiles/Melee/ShortNightBeam.cs index 695bfb1df7..8d71bb8209 100644 --- a/Projectiles/Melee/ShortNightBeam.cs +++ b/Projectiles/Melee/ShortNightBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/ShortTerraBeam.cs b/Projectiles/Melee/ShortTerraBeam.cs index 0398d26b29..846387995b 100644 --- a/Projectiles/Melee/ShortTerraBeam.cs +++ b/Projectiles/Melee/ShortTerraBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/SolsticeBeam.cs b/Projectiles/Melee/SolsticeBeam.cs index 7eeaa55737..60f27adf3c 100644 --- a/Projectiles/Melee/SolsticeBeam.cs +++ b/Projectiles/Melee/SolsticeBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Melee/SoulScythe.cs b/Projectiles/Melee/SoulScythe.cs index 938cc64f82..cce741c122 100644 --- a/Projectiles/Melee/SoulScythe.cs +++ b/Projectiles/Melee/SoulScythe.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(ModContent.BuffType(), 300); if (target.life <= (target.lifeMax * 0.15f)) { - Main.PlaySound(2, (int)target.position.X, (int)target.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(target.Center.X, target.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Melee/SoulScytheExplosion.cs b/Projectiles/Melee/SoulScytheExplosion.cs index 368ab02962..884073bcbd 100644 --- a/Projectiles/Melee/SoulScytheExplosion.cs +++ b/Projectiles/Melee/SoulScytheExplosion.cs @@ -1,14 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class SoulScytheExplosion : ModProjectile + public class SoulScytheExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Spark.cs b/Projectiles/Melee/Spark.cs index 9ceaeff60d..c186fc0840 100644 --- a/Projectiles/Melee/Spark.cs +++ b/Projectiles/Melee/Spark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/SpatialSpear.cs b/Projectiles/Melee/SpatialSpear.cs index 03276455b0..446b567508 100644 --- a/Projectiles/Melee/SpatialSpear.cs +++ b/Projectiles/Melee/SpatialSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/SpatialSpear2.cs b/Projectiles/Melee/SpatialSpear2.cs index 25b9d3a735..78c53208ac 100644 --- a/Projectiles/Melee/SpatialSpear2.cs +++ b/Projectiles/Melee/SpatialSpear2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/SpatialSpear3.cs b/Projectiles/Melee/SpatialSpear3.cs index 8457ef3a9a..d13a171c56 100644 --- a/Projectiles/Melee/SpatialSpear3.cs +++ b/Projectiles/Melee/SpatialSpear3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/SpatialSpear4.cs b/Projectiles/Melee/SpatialSpear4.cs index a87beae174..e165ff06c2 100644 --- a/Projectiles/Melee/SpatialSpear4.cs +++ b/Projectiles/Melee/SpatialSpear4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/Spears/AmidiasTridentProj.cs b/Projectiles/Melee/Spears/AmidiasTridentProj.cs index a6407aeeaf..e6ed3edefe 100644 --- a/Projectiles/Melee/Spears/AmidiasTridentProj.cs +++ b/Projectiles/Melee/Spears/AmidiasTridentProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -25,8 +25,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.penetrate = -1; projectile.ownerHitCheck = true; projectile.hide = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 1f; public override float ForwardSpeed => 0.75f; diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index f86de542cf..3dcb01869d 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -29,8 +29,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/BansheeHookProj.cs b/Projectiles/Melee/Spears/BansheeHookProj.cs index 18cc713f11..0c3f58f8ac 100644 --- a/Projectiles/Melee/Spears/BansheeHookProj.cs +++ b/Projectiles/Melee/Spears/BansheeHookProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -29,8 +29,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 2; projectile.alpha = 255; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; public override float TravelSpeed => 22f; public override Action EffectBeforeReelback => (proj) => diff --git a/Projectiles/Melee/Spears/BrimlanceProj.cs b/Projectiles/Melee/Spears/BrimlanceProj.cs index a262aa4843..56bf8f0efd 100644 --- a/Projectiles/Melee/Spears/BrimlanceProj.cs +++ b/Projectiles/Melee/Spears/BrimlanceProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -26,8 +26,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.penetrate = -1; projectile.ownerHitCheck = true; projectile.hide = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs index af0042f9e7..23764ae2ef 100644 --- a/Projectiles/Melee/Spears/DiseasedPikeSpear.cs +++ b/Projectiles/Melee/Spears/DiseasedPikeSpear.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; -using System; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears { - public class DiseasedPikeSpear : BaseSpearProjectile + public class DiseasedPikeSpear : BaseSpearProjectile { public override void SetStaticDefaults() { @@ -25,8 +24,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index bf04bce34b..940739a1db 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Ranged; using Terraria; using Terraria.ModLoader; @@ -25,8 +25,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index 0c197c8277..e98f738239 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; using Terraria; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; diff --git a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs index 9a0f909006..839d0b0979 100644 --- a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs +++ b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -25,8 +25,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index a9e3c93132..1e94a744d9 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using CalamityMod.Projectiles.BaseProjectiles; @@ -26,9 +26,10 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } - // These numbers sure are common, huh? + + // These numbers sure are common, huh? yeah, they are public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; @@ -43,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner]; diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 894f005510..1df1536735 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears @@ -23,8 +23,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 1.1f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs index beaa11dc61..4fc87924f3 100644 --- a/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs +++ b/Projectiles/Melee/Spears/HellionFlowerSpearProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index 57e63628bd..63ecb07dfc 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs index 3c81e049fd..6cbde975c3 100644 --- a/Projectiles/Melee/Spears/MarniteSpearProjectile.cs +++ b/Projectiles/Melee/Spears/MarniteSpearProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears { public class MarniteSpearProjectile : BaseSpearProjectile @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/NadirSpear.cs b/Projectiles/Melee/Spears/NadirSpear.cs index 1d16adb747..61e4138a06 100644 --- a/Projectiles/Melee/Spears/NadirSpear.cs +++ b/Projectiles/Melee/Spears/NadirSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using System; using Terraria; @@ -26,16 +26,17 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - projectile.Calamity().trueMelee = true; + projectile.localNPCHitCooldown = 4; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 5.5f; public override float ReelbackSpeed => 2.1f; public override float ForwardSpeed => 1.1f; public override Action EffectBeforeReelback => (proj) => { - int damage = Nadir.BaseDamage / 5; - float kb = 5.5f; + int damage = projectile.damage / 4; + float kb = projectile.knockBack * 0.5f; Vector2 projPos = projectile.Center + projectile.velocity; Vector2 projVel = projectile.velocity * 0.75f; if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/Spears/SausageMakerSpear.cs b/Projectiles/Melee/Spears/SausageMakerSpear.cs index 1259aeb925..cf3c3d119b 100644 --- a/Projectiles/Melee/Spears/SausageMakerSpear.cs +++ b/Projectiles/Melee/Spears/SausageMakerSpear.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs index ac9ea4cbc6..1127f9fc24 100644 --- a/Projectiles/Melee/Spears/SpatialLanceProjectile.cs +++ b/Projectiles/Melee/Spears/SpatialLanceProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs index 0cbfda6383..2ffb51c4fb 100644 --- a/Projectiles/Melee/Spears/StarnightLanceProjectile.cs +++ b/Projectiles/Melee/Spears/StarnightLanceProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -25,8 +25,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 4b8cc0e647..b06ad17ee1 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.hide = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs index 29dd0e8a69..1c64eed847 100644 --- a/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs +++ b/Projectiles/Melee/Spears/TenebreusTidesProjectile.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using System; using Terraria; @@ -8,7 +7,7 @@ using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears { - public class TenebreusTidesProjectile : BaseSpearProjectile + public class TenebreusTidesProjectile : BaseSpearProjectile { public override void SetStaticDefaults() { @@ -28,10 +27,11 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 15; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/TerraLanceProjectile.cs b/Projectiles/Melee/Spears/TerraLanceProjectile.cs index 691c0606e5..1353d9b72c 100644 --- a/Projectiles/Melee/Spears/TerraLanceProjectile.cs +++ b/Projectiles/Melee/Spears/TerraLanceProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; @@ -24,8 +24,9 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } + public override float InitialSpeed => 3f; public override float ReelbackSpeed => 2.4f; public override float ForwardSpeed => 0.95f; diff --git a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs index 795804be1f..0157170e2b 100644 --- a/Projectiles/Melee/Spears/UrchinSpearProjectile.cs +++ b/Projectiles/Melee/Spears/UrchinSpearProjectile.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/YateveoBloomSpear.cs b/Projectiles/Melee/Spears/YateveoBloomSpear.cs index 82e343da55..5220848d6b 100644 --- a/Projectiles/Melee/Spears/YateveoBloomSpear.cs +++ b/Projectiles/Melee/Spears/YateveoBloomSpear.cs @@ -1,11 +1,9 @@ -using System; using Terraria; using Terraria.ID; -using Terraria.ModLoader; using CalamityMod.Projectiles.BaseProjectiles; namespace CalamityMod.Projectiles.Melee.Spears { - public class YateveoBloomSpear : BaseSpearProjectile + public class YateveoBloomSpear : BaseSpearProjectile { public override void SetStaticDefaults() { @@ -25,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.ownerHitCheck = true; - projectile.Calamity().trueMelee = true; + //projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/StarnightBeam.cs b/Projectiles/Melee/StarnightBeam.cs index 143a35e514..eb4b348fd8 100644 --- a/Projectiles/Melee/StarnightBeam.cs +++ b/Projectiles/Melee/StarnightBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/StormBeam.cs b/Projectiles/Melee/StormBeam.cs index 856f83b350..e889ab6c1b 100644 --- a/Projectiles/Melee/StormBeam.cs +++ b/Projectiles/Melee/StormBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/StormMark.cs b/Projectiles/Melee/StormMark.cs index 4d776911d1..e28b352a50 100644 --- a/Projectiles/Melee/StormMark.cs +++ b/Projectiles/Melee/StormMark.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 60); + Main.PlaySound(SoundID.Item60, projectile.Center); } if (projectile.localAI[1] < 30f) { diff --git a/Projectiles/Melee/StormRulerProj.cs b/Projectiles/Melee/StormRulerProj.cs index 84a8ea332e..10a9935b4e 100644 --- a/Projectiles/Melee/StormRulerProj.cs +++ b/Projectiles/Melee/StormRulerProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/SulphurousGrabberBubble.cs b/Projectiles/Melee/SulphurousGrabberBubble.cs index 87eebe0957..5d21701135 100644 --- a/Projectiles/Melee/SulphurousGrabberBubble.cs +++ b/Projectiles/Melee/SulphurousGrabberBubble.cs @@ -1,6 +1,7 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 54); + Main.PlaySound(SoundID.Item54, projectile.position); int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { diff --git a/Projectiles/Melee/SulphurousGrabberBubble2.cs b/Projectiles/Melee/SulphurousGrabberBubble2.cs index 61c653fa3f..65de3db2d5 100644 --- a/Projectiles/Melee/SulphurousGrabberBubble2.cs +++ b/Projectiles/Melee/SulphurousGrabberBubble2.cs @@ -1,6 +1,7 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -34,7 +35,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 54); + Main.PlaySound(SoundID.Item54, projectile.position); int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { diff --git a/Projectiles/Melee/SunlightBlade.cs b/Projectiles/Melee/SunlightBlade.cs index afccb5de57..b280fdbca4 100644 --- a/Projectiles/Melee/SunlightBlade.cs +++ b/Projectiles/Melee/SunlightBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/TemporalFloeNumberTwo.cs b/Projectiles/Melee/TemporalFloeNumberTwo.cs index 08a0926a8c..a751649abd 100644 --- a/Projectiles/Melee/TemporalFloeNumberTwo.cs +++ b/Projectiles/Melee/TemporalFloeNumberTwo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/TemporalFloeSwordProjectile.cs b/Projectiles/Melee/TemporalFloeSwordProjectile.cs index 7c2997f2e3..f3eea114c0 100644 --- a/Projectiles/Melee/TemporalFloeSwordProjectile.cs +++ b/Projectiles/Melee/TemporalFloeSwordProjectile.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.StatDebuffs; +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.Melee { - public class TemporalFloeSwordProjectile : ModProjectile + public class TemporalFloeSwordProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/TenebreusTidesWaterSpear.cs b/Projectiles/Melee/TenebreusTidesWaterSpear.cs index ca9ed2e2fb..0dedade38f 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSpear.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSpear.cs @@ -4,11 +4,10 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TenebreusTidesWaterSpear : ModProjectile + public class TenebreusTidesWaterSpear : ModProjectile { public override string Texture => "CalamityMod/Projectiles/Magic/UndinesRetributionSpear"; diff --git a/Projectiles/Melee/TenebreusTidesWaterSword.cs b/Projectiles/Melee/TenebreusTidesWaterSword.cs index 79486b5876..0273c34318 100644 --- a/Projectiles/Melee/TenebreusTidesWaterSword.cs +++ b/Projectiles/Melee/TenebreusTidesWaterSword.cs @@ -4,11 +4,10 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.IO; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TenebreusTidesWaterSword : ModProjectile + public class TenebreusTidesWaterSword : ModProjectile { private int penetrationAmt = 4; private bool dontDraw = false; diff --git a/Projectiles/Melee/TerraBall.cs b/Projectiles/Melee/TerraBall.cs index cef1d69b3e..4e445d4b70 100644 --- a/Projectiles/Melee/TerraBall.cs +++ b/Projectiles/Melee/TerraBall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } @@ -94,10 +94,5 @@ namespace CalamityMod.Projectiles.Melee Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); } } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 180); - } } } diff --git a/Projectiles/Melee/TerraEdgeBeam.cs b/Projectiles/Melee/TerraEdgeBeam.cs index a9ec3e0eaa..f1419d3d33 100644 --- a/Projectiles/Melee/TerraEdgeBeam.cs +++ b/Projectiles/Melee/TerraEdgeBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/TerraSpear.cs b/Projectiles/Melee/TerraSpear.cs index f42dc90dc7..db9072058e 100644 --- a/Projectiles/Melee/TerraSpear.cs +++ b/Projectiles/Melee/TerraSpear.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Melee/TerracottaExplosion.cs b/Projectiles/Melee/TerracottaExplosion.cs index 59323407f4..9954828fed 100644 --- a/Projectiles/Melee/TerracottaExplosion.cs +++ b/Projectiles/Melee/TerracottaExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/TerratomereProjectile.cs b/Projectiles/Melee/TerratomereProjectile.cs index 04794c46f3..e795b9ba79 100644 --- a/Projectiles/Melee/TerratomereProjectile.cs +++ b/Projectiles/Melee/TerratomereProjectile.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TerratomereProjectile : ModProjectile + public class TerratomereProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -41,10 +40,6 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(BuffID.CursedInferno, 600); - target.AddBuff(BuffID.Frostburn, 300); - target.AddBuff(BuffID.OnFire, 900); - target.AddBuff(BuffID.Ichor, 180); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/TerrorBeam.cs b/Projectiles/Melee/TerrorBeam.cs index ddc64a4e38..28e2726d20 100644 --- a/Projectiles/Melee/TerrorBeam.cs +++ b/Projectiles/Melee/TerrorBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.localAI[1] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.position); projectile.localAI[1] += 1f; } projectile.alpha -= 40; @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 400; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/TerrorBoom.cs b/Projectiles/Melee/TerrorBoom.cs index dd0286add9..7a8968d54f 100644 --- a/Projectiles/Melee/TerrorBoom.cs +++ b/Projectiles/Melee/TerrorBoom.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -26,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 400; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/ThornBase.cs b/Projectiles/Melee/ThornBase.cs index 2bee66e6f3..d969aa4c32 100644 --- a/Projectiles/Melee/ThornBase.cs +++ b/Projectiles/Melee/ThornBase.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ThornBase : ModProjectile + public class ThornBase : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/ThornTip.cs b/Projectiles/Melee/ThornTip.cs index f625226839..883c990d6c 100644 --- a/Projectiles/Melee/ThornTip.cs +++ b/Projectiles/Melee/ThornTip.cs @@ -1,9 +1,8 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class ThornTip : ModProjectile + public class ThornTip : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/TinyCrystal.cs b/Projectiles/Melee/TinyCrystal.cs index b20c145260..5cbf4ea7de 100644 --- a/Projectiles/Melee/TinyCrystal.cs +++ b/Projectiles/Melee/TinyCrystal.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -56,9 +56,9 @@ namespace CalamityMod.Projectiles.Melee for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dustType, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); - } + } + Main.PlaySound(SoundID.Item10, projectile.position); + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Melee/TinyFlare.cs b/Projectiles/Melee/TinyFlare.cs index 4ea5e7290d..800bcd67e4 100644 --- a/Projectiles/Melee/TinyFlare.cs +++ b/Projectiles/Melee/TinyFlare.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TinyFlare : ModProjectile + public class TinyFlare : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Tornado.cs b/Projectiles/Melee/Tornado.cs index b14db38311..a64fc3c884 100644 --- a/Projectiles/Melee/Tornado.cs +++ b/Projectiles/Melee/Tornado.cs @@ -1,13 +1,13 @@ -using CalamityMod.CalPlayer; -using CalamityMod.World; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Tornado : ModProjectile + public class Tornado : ModProjectile { public override void SetStaticDefaults() { @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 122); + Main.PlaySound(SoundID.Item122, projectile.Center); } projectile.ai[0] += 1f; if (projectile.ai[0] >= num1125) diff --git a/Projectiles/Melee/TrueBiomeOrb.cs b/Projectiles/Melee/TrueBiomeOrb.cs index d4742b5a0a..f6ba37865d 100644 --- a/Projectiles/Melee/TrueBiomeOrb.cs +++ b/Projectiles/Melee/TrueBiomeOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; diff --git a/Projectiles/Melee/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs index 83236c5fcc..2267713830 100644 --- a/Projectiles/Melee/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } diff --git a/Projectiles/Melee/TumbleweedFlail.cs b/Projectiles/Melee/TumbleweedFlail.cs index 8d412f1c10..82d406939d 100644 --- a/Projectiles/Melee/TumbleweedFlail.cs +++ b/Projectiles/Melee/TumbleweedFlail.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -88,7 +89,7 @@ namespace CalamityMod.Projectiles.Melee Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); projectile.ai[0] = 1f; projectile.netUpdate = true; - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 11); + Main.PlaySound(SoundID.NPCHit11, projectile.position); return false; } @@ -133,7 +134,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 15); + Main.PlaySound(SoundID.NPCDeath15, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Melee/TumbleweedRolling.cs b/Projectiles/Melee/TumbleweedRolling.cs index 4881eef8ed..feb898ae16 100644 --- a/Projectiles/Melee/TumbleweedRolling.cs +++ b/Projectiles/Melee/TumbleweedRolling.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -27,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee (projectile.velocity.Y != projectile.velocity.Y && (projectile.velocity.Y < -3f || projectile.velocity.Y > 3f))) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 11); + Main.PlaySound(SoundID.NPCHit11, projectile.position); } if (projectile.velocity.X != projectile.velocity.X) { @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 15); + Main.PlaySound(SoundID.NPCDeath15, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 32, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Melee/TyphonsGreedBubble.cs b/Projectiles/Melee/TyphonsGreedBubble.cs index 773ab62d18..77220055cf 100644 --- a/Projectiles/Melee/TyphonsGreedBubble.cs +++ b/Projectiles/Melee/TyphonsGreedBubble.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -94,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21, 1f, 0f); + Main.PlaySound(SoundID.Item21, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 64; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Melee/TyphonsGreedStaff.cs b/Projectiles/Melee/TyphonsGreedStaff.cs index 651ab03052..7c659b2b56 100644 --- a/Projectiles/Melee/TyphonsGreedStaff.cs +++ b/Projectiles/Melee/TyphonsGreedStaff.cs @@ -1,9 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.Enums; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Melee { public class TyphonsGreedStaff : ModProjectile @@ -182,13 +184,13 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 200; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) { bool flag3; - if (Main.npc[i].type == 414) + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) { Rectangle rect = Main.npc[i].getRect(); int num5 = 8; diff --git a/Projectiles/Melee/UltimusCleaverDust.cs b/Projectiles/Melee/UltimusCleaverDust.cs index 06092fe5e3..c15eab7c35 100644 --- a/Projectiles/Melee/UltimusCleaverDust.cs +++ b/Projectiles/Melee/UltimusCleaverDust.cs @@ -1,10 +1,8 @@ -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class UltimusCleaverDust : ModProjectile + public class UltimusCleaverDust : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/UrchinBall.cs b/Projectiles/Melee/UrchinBall.cs index 7f48fa8765..87aa7082b2 100644 --- a/Projectiles/Melee/UrchinBall.cs +++ b/Projectiles/Melee/UrchinBall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Melee Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); projectile.ai[0] = 1f; projectile.netUpdate = true; - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, projectile.position); return false; } diff --git a/Projectiles/Melee/UrchinBallSpike.cs b/Projectiles/Melee/UrchinBallSpike.cs index 2b22360335..47e23b7897 100644 --- a/Projectiles/Melee/UrchinBallSpike.cs +++ b/Projectiles/Melee/UrchinBallSpike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 13; diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 8bf1617884..cfab70f370 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/VoidEssence.cs b/Projectiles/Melee/VoidEssence.cs index c8d3d72553..419900e99b 100644 --- a/Projectiles/Melee/VoidEssence.cs +++ b/Projectiles/Melee/VoidEssence.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -193,8 +193,8 @@ namespace CalamityMod.Projectiles.Melee private void SpawnTentacle(Vector2 tentacleVelocity) { - int damage = Nadir.BaseDamage; - float kb = 7f; + int damage = projectile.damage; + float kb = projectile.knockBack; // Randomize tentacle behavior variables float ai0 = Main.rand.NextFloat(0.01f, 0.08f); diff --git a/Projectiles/Melee/VoidTentacle.cs b/Projectiles/Melee/VoidTentacle.cs index 8cd574188d..d11f58d592 100644 --- a/Projectiles/Melee/VoidTentacle.cs +++ b/Projectiles/Melee/VoidTentacle.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Waterfall.cs b/Projectiles/Melee/Waterfall.cs index e7f91edc7b..4935767ba6 100644 --- a/Projectiles/Melee/Waterfall.cs +++ b/Projectiles/Melee/Waterfall.cs @@ -1,6 +1,4 @@ -using System; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -83,14 +81,14 @@ namespace CalamityMod.Projectiles.Melee { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.Center); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.Center); for (int k = 0; k < 3; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.oldVelocity.X * 0.25f, projectile.oldVelocity.Y * 0.25f); diff --git a/Projectiles/Melee/WhiteBoltAura.cs b/Projectiles/Melee/WhiteBoltAura.cs index 21141bf708..632f3471be 100644 --- a/Projectiles/Melee/WhiteBoltAura.cs +++ b/Projectiles/Melee/WhiteBoltAura.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/WhiteBoltAuraBlah.cs b/Projectiles/Melee/WhiteBoltAuraBlah.cs index 2c03411a28..5f0d78f330 100644 --- a/Projectiles/Melee/WhiteBoltAuraBlah.cs +++ b/Projectiles/Melee/WhiteBoltAuraBlah.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { diff --git a/Projectiles/Melee/WhiteOrb.cs b/Projectiles/Melee/WhiteOrb.cs index 580816e780..c9daf49a02 100644 --- a/Projectiles/Melee/WhiteOrb.cs +++ b/Projectiles/Melee/WhiteOrb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/WhiteOrbBlah.cs b/Projectiles/Melee/WhiteOrbBlah.cs index f6d263ea82..6c0f95334a 100644 --- a/Projectiles/Melee/WhiteOrbBlah.cs +++ b/Projectiles/Melee/WhiteOrbBlah.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee diff --git a/Projectiles/Melee/Whiterain.cs b/Projectiles/Melee/Whiterain.cs index f9e310e4cd..a59faa3797 100644 --- a/Projectiles/Melee/Whiterain.cs +++ b/Projectiles/Melee/Whiterain.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Whiterain : ModProjectile + public class Whiterain : ModProjectile { public override void SetStaticDefaults() { @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.Center); } Lighting.AddLight(projectile.Center, 0.2f, 0.2f, 0.2f); diff --git a/Projectiles/Melee/WhiterainBlah.cs b/Projectiles/Melee/WhiterainBlah.cs index 5fbf9969aa..0bbc0a4d59 100644 --- a/Projectiles/Melee/WhiterainBlah.cs +++ b/Projectiles/Melee/WhiterainBlah.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class WhiterainBlah : ModProjectile + public class WhiterainBlah : ModProjectile { public override void SetStaticDefaults() { @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 125); + Main.PlaySound(SoundID.Item125, projectile.Center); } Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); diff --git a/Projectiles/Melee/YateveoBloomProj.cs b/Projectiles/Melee/YateveoBloomProj.cs index 9ff164c273..baddd106e5 100644 --- a/Projectiles/Melee/YateveoBloomProj.cs +++ b/Projectiles/Melee/YateveoBloomProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Melee { projectile.netUpdate = true; Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, projectile.position); } return false; diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index 62b05c917d..56ba5f1f19 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -1,13 +1,11 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class AirSpinnerYoyo : ModProjectile + public class AirSpinnerYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index 20533a4e77..3a140242f2 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Yoyos/AzathothYoyo.cs b/Projectiles/Melee/Yoyos/AzathothYoyo.cs index 3c9bebbab6..10e9ba4b64 100644 --- a/Projectiles/Melee/Yoyos/AzathothYoyo.cs +++ b/Projectiles/Melee/Yoyos/AzathothYoyo.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs index 4a68d994ff..cdf33d9689 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs index 9417f5e7fe..0cc6fff9fd 100644 --- a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs +++ b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs @@ -1,14 +1,13 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class CnidarianYoyo : ModProjectile + public class CnidarianYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs index b3c8563486..baa3195087 100644 --- a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs +++ b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class GodsGambitYoyo : ModProjectile + public class GodsGambitYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index c9972ca647..d227d53804 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner]; if (Main.rand.NextBool(5)) diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index d163446b5d..4e8bf5dc91 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class ObliteratorYoyo : ModProjectile + public class ObliteratorYoyo : ModProjectile { private const int FramesPerShot = 5; diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index f71c87c0e4..f165bb20fe 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class OblivionYoyo : ModProjectile + public class OblivionYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index 718b32acdc..ebdf604fd0 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index 6348e17686..88dea7d94a 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class PandemicYoyo : ModProjectile + public class PandemicYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 05046bcaef..7590b46ef2 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Melee/Yoyos/RiptideYoyo.cs b/Projectiles/Melee/Yoyos/RiptideYoyo.cs index 9ded4cc8c9..f7bd3cb52a 100644 --- a/Projectiles/Melee/Yoyos/RiptideYoyo.cs +++ b/Projectiles/Melee/Yoyos/RiptideYoyo.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs index ec58297af6..ce4cf322c3 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class ShimmersparkYoyo : ModProjectile + public class ShimmersparkYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index 7061349c54..cf20c22e6d 100644 --- a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs index 9239066db9..f65e00c965 100644 --- a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs +++ b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class SulphurousGrabberYoyo : ModProjectile + public class SulphurousGrabberYoyo : ModProjectile { private int bubbleCounter = 0; private bool bubbleStronk = false; diff --git a/Projectiles/Melee/Yoyos/VerdantYoyo.cs b/Projectiles/Melee/Yoyos/VerdantYoyo.cs index 758397c7c1..2f3f26c346 100644 --- a/Projectiles/Melee/Yoyos/VerdantYoyo.cs +++ b/Projectiles/Melee/Yoyos/VerdantYoyo.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class VerdantYoyo : ModProjectile + public class VerdantYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 2d3d490853..980ccd323b 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee.Yoyos { - public class YinYoyo : ModProjectile + public class YinYoyo : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Pets/Akato.cs b/Projectiles/Pets/Akato.cs index b227a33df5..6aa169688e 100644 --- a/Projectiles/Pets/Akato.cs +++ b/Projectiles/Pets/Akato.cs @@ -1,11 +1,9 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class Akato : ModProjectile + public class Akato : ModProjectile { public override void SetStaticDefaults() { @@ -41,7 +39,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.02f); + projectile.FloatingPetAI(true, 0.02f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/BabyGhostBell.cs b/Projectiles/Pets/BabyGhostBell.cs index 2a910b4098..d85eb5a67f 100644 --- a/Projectiles/Pets/BabyGhostBell.cs +++ b/Projectiles/Pets/BabyGhostBell.cs @@ -1,13 +1,10 @@ using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class BabyGhostBell : ModProjectile + public class BabyGhostBell : ModProjectile { private bool underwater = false; @@ -55,7 +52,7 @@ namespace CalamityMod.Projectiles.Pets { Lighting.AddLight(projectile.Center, 0.1f, 0.3f, 0.5f); } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f, true); + projectile.FloatingPetAI(false, 0.05f, true); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/Bear.cs b/Projectiles/Pets/Bear.cs index bb3c4aaecd..314c5c0be7 100644 --- a/Projectiles/Pets/Bear.cs +++ b/Projectiles/Pets/Bear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Pets/BrimlingPet.cs b/Projectiles/Pets/BrimlingPet.cs index 5e5be441ea..dac6e4c26f 100644 --- a/Projectiles/Pets/BrimlingPet.cs +++ b/Projectiles/Pets/BrimlingPet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 809744d2a1..56c2768446 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Pets int type = mod.NPCType(doggoType); int n = NPC.NewNPC((int)projectile.position.X, (int)projectile.position.Y, type); - NetMessage.SendData(23, -1, -1, (NetworkText)null, n, 0.0f, 0.0f, 0.0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, (NetworkText)null, n, 0.0f, 0.0f, 0.0f, 0, 0, 0); Main.npc[n].netUpdate = true; } @@ -223,7 +223,7 @@ namespace CalamityMod.Projectiles.Pets } else { - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 2, 2f); //REEEEEEE + Main.PlaySound(SoundID.Roar, (int)player.position.X, (int)player.position.Y, 2, 2f); //REEEEEEE } notlocalai1 = -600f; } diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index 9e786e3b7a..7c62901f25 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Pets/FoxPet.cs b/Projectiles/Pets/FoxPet.cs index 9d33d0c24c..f42289fef6 100644 --- a/Projectiles/Pets/FoxPet.cs +++ b/Projectiles/Pets/FoxPet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Pets/KendraPet.cs b/Projectiles/Pets/KendraPet.cs index e3778864ae..0fbba4d37a 100644 --- a/Projectiles/Pets/KendraPet.cs +++ b/Projectiles/Pets/KendraPet.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index 882b628a22..ca2258bcfd 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Pets Main.gore[heart].velocity *= 5f; } - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 15); //mouse squeak sound + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 15); //mouse squeak sound float radius = 240f; // 15 blocks for (int j = 0; j < Main.maxNPCs; j++) diff --git a/Projectiles/Pets/LeviPet.cs b/Projectiles/Pets/LeviPet.cs index 8f9997870d..8a0f51d3f5 100644 --- a/Projectiles/Pets/LeviPet.cs +++ b/Projectiles/Pets/LeviPet.cs @@ -1,11 +1,9 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class LeviPet : ModProjectile + public class LeviPet : ModProjectile { public override void SetStaticDefaults() { @@ -41,7 +39,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); + projectile.FloatingPetAI(false, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/PerforaMini.cs b/Projectiles/Pets/PerforaMini.cs index 4ad38762ff..41a0dabd19 100644 --- a/Projectiles/Pets/PerforaMini.cs +++ b/Projectiles/Pets/PerforaMini.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.Pets; +using CalamityMod.Buffs.Pets; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class PerforaMini : ModProjectile + public class PerforaMini : ModProjectile { public override void SetStaticDefaults() { @@ -54,7 +53,7 @@ namespace CalamityMod.Projectiles.Pets projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.1f); + projectile.FloatingPetAI(true, 0.1f); //Dust if (Main.rand.NextBool(50)) diff --git a/Projectiles/Pets/PlaguebringerBab.cs b/Projectiles/Pets/PlaguebringerBab.cs index 761c84eb71..09f00c3a14 100644 --- a/Projectiles/Pets/PlaguebringerBab.cs +++ b/Projectiles/Pets/PlaguebringerBab.cs @@ -1,11 +1,9 @@ using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class PlaguebringerBab : ModProjectile + public class PlaguebringerBab : ModProjectile { public override void SetStaticDefaults() { @@ -41,7 +39,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); + projectile.FloatingPetAI(false, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs index c4ac1c447d..241890e028 100644 --- a/Projectiles/Pets/RotomPet.cs +++ b/Projectiles/Pets/RotomPet.cs @@ -1,13 +1,11 @@ using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class RotomPet : ModProjectile + public class RotomPet : ModProjectile { private int biome = 0; private float dust = 0f; @@ -75,7 +73,7 @@ namespace CalamityMod.Projectiles.Pets dust += 1f; } - CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.05f); + projectile.FloatingPetAI(true, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) diff --git a/Projectiles/Pets/SCalPet.cs b/Projectiles/Pets/SCalPet.cs index 7e28c16543..20b29b0c08 100644 --- a/Projectiles/Pets/SCalPet.cs +++ b/Projectiles/Pets/SCalPet.cs @@ -1,11 +1,9 @@ using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { - public class SCalPet : ModProjectile + public class SCalPet : ModProjectile { public override void SetStaticDefaults() { @@ -41,7 +39,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.05f); + projectile.FloatingPetAI(false, 0.05f); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Pets/SirenYoung.cs b/Projectiles/Pets/SirenYoung.cs index 55cb720496..0e59557428 100644 --- a/Projectiles/Pets/SirenYoung.cs +++ b/Projectiles/Pets/SirenYoung.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Pets/Sparks.cs b/Projectiles/Pets/Sparks.cs index 452b26e55e..de3b7c231d 100644 --- a/Projectiles/Pets/Sparks.cs +++ b/Projectiles/Pets/Sparks.cs @@ -45,15 +45,15 @@ namespace CalamityMod.Projectiles.Pets if (new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height).Intersects(new Rectangle((int)item.position.X, (int)item.position.Y, item.width, item.height))) { - if (projectile.owner == Main.myPlayer && (player.ActiveItem().type != 0 || player.itemAnimation <= 0)) + if (projectile.owner == Main.myPlayer && (player.ActiveItem().type != ItemID.None || player.itemAnimation <= 0)) { // TODO, fix this maybe? if (!ItemLoader.OnPickup(item, player)) { Main.item[itemIndex] = new Item(); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(21, -1, -1, null, itemIndex, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, itemIndex, 0f, 0f, 0f, 0, 0, 0); } continue; } @@ -115,9 +115,9 @@ namespace CalamityMod.Projectiles.Pets else { Main.item[itemIndex] = player.GetItem(projectile.owner, item, false, false); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(21, -1, -1, null, itemIndex, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, itemIndex, 0f, 0f, 0f, 0, 0, 0); } } } @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Pets { npc.life = 0; npc.active = false; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 2); + Main.PlaySound(SoundID.Item2, projectile.position); npc.netUpdate = true; } } diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index d0f5594cd8..af9b8a81ec 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -1,9 +1,8 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Pets { public class ThirdSage : ModProjectile @@ -43,7 +42,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } - CalamityGlobalProjectile.FloatingPetAI(projectile, true, 0.1f); + projectile.FloatingPetAI(true, 0.1f); //Animation projectile.frameCounter++; if (projectile.frameCounter > 6) @@ -58,7 +57,7 @@ namespace CalamityMod.Projectiles.Pets } else if (projectile.frame == 4 && projectile.ai[1] >= 45) { - Main.PlaySound(29, projectile.position, 32); + Main.PlaySound(SoundID.Zombie, projectile.Center, 32); } else if (projectile.frame > 6) { diff --git a/Projectiles/Ranged/AMR2.cs b/Projectiles/Ranged/AMR2.cs index 107ac57507..1561160879 100644 --- a/Projectiles/Ranged/AMR2.cs +++ b/Projectiles/Ranged/AMR2.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { public class AMR2 : ModProjectile diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index cbb0dfd792..08b817254f 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -1,9 +1,10 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Ranged { public class AMRShot : ModProjectile @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/AccelerationBulletProj.cs b/Projectiles/Ranged/AccelerationBulletProj.cs index 8b9d026d8e..f9b5f0f118 100644 --- a/Projectiles/Ranged/AccelerationBulletProj.cs +++ b/Projectiles/Ranged/AccelerationBulletProj.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 10); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 91, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Ranged/AcidBulletProj.cs b/Projectiles/Ranged/AcidBulletProj.cs index 1790a62322..ed00aa6163 100644 --- a/Projectiles/Ranged/AcidBulletProj.cs +++ b/Projectiles/Ranged/AcidBulletProj.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/AngelicBeam.cs b/Projectiles/Ranged/AngelicBeam.cs index 4b0163ad2e..984b2882b4 100644 --- a/Projectiles/Ranged/AngelicBeam.cs +++ b/Projectiles/Ranged/AngelicBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/AquaBlast.cs b/Projectiles/Ranged/AquaBlast.cs index b62070d64f..a4f44dbede 100644 --- a/Projectiles/Ranged/AquaBlast.cs +++ b/Projectiles/Ranged/AquaBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/AquaBlastToxic.cs b/Projectiles/Ranged/AquaBlastToxic.cs index 7c3aa71b3d..149e8918c0 100644 --- a/Projectiles/Ranged/AquaBlastToxic.cs +++ b/Projectiles/Ranged/AquaBlastToxic.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index da4ad84aa6..5faf5234ff 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class Aquashard : ModProjectile @@ -48,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Ranged/AquashardSplit.cs b/Projectiles/Ranged/AquashardSplit.cs index db269b2c9d..eb902bbc6f 100644 --- a/Projectiles/Ranged/AquashardSplit.cs +++ b/Projectiles/Ranged/AquashardSplit.cs @@ -1,5 +1,7 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class AquashardSplit : ModProjectile @@ -28,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Ranged/ArcticArrowProj.cs b/Projectiles/Ranged/ArcticArrowProj.cs index 59629286e0..04652dbf92 100644 --- a/Projectiles/Ranged/ArcticArrowProj.cs +++ b/Projectiles/Ranged/ArcticArrowProj.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class ArcticArrowProj : ModProjectile @@ -37,13 +39,13 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 27); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Ranged/AstralCannonProjectile.cs b/Projectiles/Ranged/AstralCannonProjectile.cs index fec5faa1ec..d28d1a4f7b 100644 --- a/Projectiles/Ranged/AstralCannonProjectile.cs +++ b/Projectiles/Ranged/AstralCannonProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(29, (int)projectile.Center.X, (int)projectile.Center.Y, 103, 1f, 0f); + Main.PlaySound(SoundID.Zombie, (int)projectile.Center.X, (int)projectile.Center.Y, 103, 1f, 0f); for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 50, default, 1f); diff --git a/Projectiles/Ranged/AstralRound.cs b/Projectiles/Ranged/AstralRound.cs index c5cbc724f5..919fdbb32d 100644 --- a/Projectiles/Ranged/AstralRound.cs +++ b/Projectiles/Ranged/AstralRound.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/AstrealArrow.cs b/Projectiles/Ranged/AstrealArrow.cs index 8b6e72e815..319409a80d 100644 --- a/Projectiles/Ranged/AstrealArrow.cs +++ b/Projectiles/Ranged/AstrealArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Ranged/AstrealFlame.cs b/Projectiles/Ranged/AstrealFlame.cs index 6389f5744a..c7a050c153 100644 --- a/Projectiles/Ranged/AstrealFlame.cs +++ b/Projectiles/Ranged/AstrealFlame.cs @@ -1,10 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { - public class AstrealFlame : ModProjectile + public class AstrealFlame : ModProjectile { public override void SetStaticDefaults() { @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 48; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 74); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index aae7dae614..e664972be9 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -3,12 +3,11 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class AuroraFire : ModProjectile + public class AuroraFire : ModProjectile { private const int framesBeforeTurning = 70; private bool initialized = false; @@ -30,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 8d18430c0b..adb0166742 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); float spread = 90f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index f09210617c..9e4e8c21e0 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class BeeRPG : ModProjectile @@ -82,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -119,7 +121,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/BigCoral.cs b/Projectiles/Ranged/BigCoral.cs index 08b06c0b3f..9248c8631e 100644 --- a/Projectiles/Ranged/BigCoral.cs +++ b/Projectiles/Ranged/BigCoral.cs @@ -1,11 +1,12 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { - public class BigCoral : ModProjectile + public class BigCoral : ModProjectile { public override void SetStaticDefaults() { @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 10); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 32; diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index d969e30998..37922be5c9 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class BigNuke : ModProjectile @@ -50,7 +52,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -66,7 +68,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.localNPCHitCooldown = 10; projectile.damage /= 2; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num621 = 0; num621 < 90; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index 5c0f7837e8..e70ae09c9a 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.myPlayer == projectile.owner) if (projectile.Hitbox.Intersects(player.Hitbox)) { - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool(3) && !Main.player[projectile.owner].moonLeech) { player.statLife += 1; player.HealEffect(1); @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(ModContent.BuffType(), 360); target.AddBuff(ModContent.BuffType(), 360); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index 62c65cc515..bc7f625118 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index a3066f1645..c8b41d9cfa 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -80,7 +80,8 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 360); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } @@ -90,7 +91,6 @@ namespace CalamityMod.Projectiles.Ranged player.statLife += 1; player.HealEffect(1); } - target.AddBuff(ModContent.BuffType(), 360); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/BloodfireBullet.cs b/Projectiles/Ranged/BloodfireBullet.cs index bd200a4560..43121ef10b 100644 --- a/Projectiles/Ranged/BloodfireBullet.cs +++ b/Projectiles/Ranged/BloodfireBullet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -52,7 +52,8 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 360); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } @@ -62,7 +63,6 @@ namespace CalamityMod.Projectiles.Ranged player.statLife += 1; player.HealEffect(1); } - target.AddBuff(ModContent.BuffType(), 360); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/BloodflareSoul.cs b/Projectiles/Ranged/BloodflareSoul.cs index f07d385a90..c205f99349 100644 --- a/Projectiles/Ranged/BloodflareSoul.cs +++ b/Projectiles/Ranged/BloodflareSoul.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 39, 1f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 39, 1f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 110; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Ranged/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs index f0fbcefce4..b38cfbcacc 100644 --- a/Projectiles/Ranged/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/BlueExoArrow2.cs b/Projectiles/Ranged/BlueExoArrow2.cs index 8edd5fd3d2..9a21c15e2b 100644 --- a/Projectiles/Ranged/BlueExoArrow2.cs +++ b/Projectiles/Ranged/BlueExoArrow2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/Bolt.cs b/Projectiles/Ranged/Bolt.cs index 17c649db01..15d4aba20f 100644 --- a/Projectiles/Ranged/Bolt.cs +++ b/Projectiles/Ranged/Bolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Ranged/BoltArrow.cs b/Projectiles/Ranged/BoltArrow.cs index ab5444f6ef..6021c400d3 100644 --- a/Projectiles/Ranged/BoltArrow.cs +++ b/Projectiles/Ranged/BoltArrow.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class BoltArrow : ModProjectile @@ -47,7 +49,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -63,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.localNPCHitCooldown = 10; projectile.damage = (int)(projectile.damage * 0.6f); projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 92); int num212 = Main.rand.Next(10, 20); for (int num213 = 0; num213 < num212; num213++) { diff --git a/Projectiles/Ranged/BrimstoneBallFriendly.cs b/Projectiles/Ranged/BrimstoneBallFriendly.cs index 6a4aa93af5..0f2aa04a00 100644 --- a/Projectiles/Ranged/BrimstoneBallFriendly.cs +++ b/Projectiles/Ranged/BrimstoneBallFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Ranged/BrimstoneBolt.cs b/Projectiles/Ranged/BrimstoneBolt.cs index b7c2a6001b..50ae2bfcd4 100644 --- a/Projectiles/Ranged/BrimstoneBolt.cs +++ b/Projectiles/Ranged/BrimstoneBolt.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class BrimstoneBolt : ModProjectile @@ -30,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); } if (projectile.alpha > 0) { diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index e3ba8792a1..20a0fe97a5 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/ButcherGun.cs b/Projectiles/Ranged/ButcherGun.cs index f5e40a58fb..47036152cd 100644 --- a/Projectiles/Ranged/ButcherGun.cs +++ b/Projectiles/Ranged/ButcherGun.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -27,120 +27,114 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Player player = Main.player[projectile.owner]; - float num = 0f; - Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); - if (projectile.spriteDirection == -1) - { - num = 3.14159274f; - } projectile.ai[0] += 1f; - int num39 = 0; + int incrementAmt = 0; float spreadMult = 0.15f; - if (projectile.ai[0] >= 90f) + if (projectile.ai[0] >= 80f) { - num39++; + incrementAmt++; spreadMult = 0.13f; } - if (projectile.ai[0] >= 180f) + if (projectile.ai[0] >= 160f) { - num39++; + incrementAmt++; spreadMult = 0.11f; } - if (projectile.ai[0] >= 270f) + if (projectile.ai[0] >= 240f) { - num39++; + incrementAmt++; spreadMult = 0.09f; } - if (projectile.ai[0] >= 360f) + if (projectile.ai[0] >= 320f) { - num39++; + incrementAmt++; spreadMult = 0.07f; } - if (projectile.ai[0] >= 450f) + if (projectile.ai[0] >= 400f) { - num39++; + incrementAmt++; spreadMult = 0.05f; } - if (projectile.ai[0] >= 540f) + if (projectile.ai[0] >= 480f) { - num39++; + incrementAmt++; spreadMult = 0.04f; } - if (projectile.ai[0] >= 630f) + if (projectile.ai[0] >= 560f) { - num39++; + incrementAmt++; spreadMult = 0.03f; } - if (projectile.ai[0] >= 720f) //8 + if (projectile.ai[0] >= 640f) //8 { - num39++; + incrementAmt++; spreadMult = 0.02f; } - int num40 = 40; - int num41 = 3; + int shootDelayBase = 40; + int incrementMult = 3; projectile.ai[1] -= 1f; - bool flag15 = false; + bool willShoot = false; if (projectile.ai[1] <= 0f) { - projectile.ai[1] = (float)(num40 - num41 * num39); - flag15 = true; + projectile.ai[1] = (float)(shootDelayBase - incrementMult * incrementAmt); + willShoot = true; } - bool flag16 = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; + bool canShoot = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; if (projectile.localAI[0] > 0f) { projectile.localAI[0] -= 1f; } - if (projectile.soundDelay <= 0 && flag16) + if (projectile.soundDelay <= 0 && canShoot) { - projectile.soundDelay = num40 - num41 * num39; + projectile.soundDelay = shootDelayBase - incrementMult * incrementAmt; if (projectile.ai[0] != 1f) { Main.PlaySound(SoundID.Item38, projectile.position); } projectile.localAI[0] = 12f; } - if (flag15 && Main.myPlayer == projectile.owner) + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + if (willShoot && Main.myPlayer == projectile.owner) { - int num42 = 14; - float scaleFactor11 = 14f; - int weaponDamage2 = player.GetWeaponDamage(player.ActiveItem()); - float weaponKnockback2 = player.ActiveItem().knockBack; - if (flag16) + int projType = ProjectileID.Bullet; + float speedMult = 14f; + int damage = player.GetWeaponDamage(player.ActiveItem()); + float kback = player.ActiveItem().knockBack; + if (canShoot) { - player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, false); - weaponKnockback2 = player.GetWeaponKnockback(player.ActiveItem(), weaponKnockback2); - float scaleFactor12 = player.ActiveItem().shootSpeed * projectile.scale; - Vector2 vector19 = vector; - Vector2 value18 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - vector19; + player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult, ref canShoot, ref damage, ref kback, false); + kback = player.GetWeaponKnockback(player.ActiveItem(), kback); + float speed = player.ActiveItem().shootSpeed * projectile.scale; + Vector2 targetPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - source; if (player.gravDir == -1f) { - value18.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector19.Y; + targetPos.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - source.Y; } - Vector2 value19 = Vector2.Normalize(value18); - if (float.IsNaN(value19.X) || float.IsNaN(value19.Y)) + Vector2 velMult = Vector2.Normalize(targetPos); + if (float.IsNaN(velMult.X) || float.IsNaN(velMult.Y)) { - value19 = -Vector2.UnitY; + velMult = -Vector2.UnitY; } - value19 *= scaleFactor12; - if (value19.X != projectile.velocity.X || value19.Y != projectile.velocity.Y) + velMult *= speed; + if (velMult.X != projectile.velocity.X || velMult.Y != projectile.velocity.Y) { projectile.netUpdate = true; } - projectile.velocity = value19 * 0.55f; - int randomBulletCount = Main.rand.Next(3, 5); - for (int num43 = 0; num43 < randomBulletCount; num43++) + projectile.velocity = velMult * 0.55f; + int randomBulletCount = Main.rand.Next(3, 5); //3 to 4 bullets + for (int projIndex = 0; projIndex < randomBulletCount; projIndex++) { - Vector2 vector20 = Vector2.Normalize(projectile.velocity) * scaleFactor11 * (0.6f + Main.rand.NextFloat() * spreadMult); - if (float.IsNaN(vector20.X) || float.IsNaN(vector20.Y)) + Vector2 bulletVel = Vector2.Normalize(projectile.velocity) * speedMult * (0.6f + Main.rand.NextFloat() * spreadMult); + if (float.IsNaN(bulletVel.X) || float.IsNaN(bulletVel.Y)) { - vector20 = -Vector2.UnitY; + bulletVel = -Vector2.UnitY; } - Vector2 vector21 = vector19 + Utils.RandomVector2(Main.rand, -5f, 5f); - vector20.X += (float)Main.rand.Next(-15, 16) * spreadMult; - vector20.Y += (float)Main.rand.Next(-15, 16) * spreadMult; - int num44 = Projectile.NewProjectile(vector21.X, vector21.Y, vector20.X, vector20.Y, num42, weaponDamage2, weaponKnockback2, projectile.owner, 0f, 0f); + source += Utils.RandomVector2(Main.rand, -5f, 5f); + bulletVel.X += (float)Main.rand.Next(-15, 16) * spreadMult; + bulletVel.Y += (float)Main.rand.Next(-15, 16) * spreadMult; + int num44 = Projectile.NewProjectile(source, bulletVel, projType, damage, kback, projectile.owner, 0f, 0f); Main.projectile[num44].noDropItem = true; - Main.projectile[num44].extraUpdates += num39 / 2; //0 to 4 + Main.projectile[num44].extraUpdates += incrementAmt / 2; //0 to 4 } } else @@ -149,7 +143,12 @@ namespace CalamityMod.Projectiles.Ranged } } projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; - projectile.rotation = projectile.velocity.ToRotation() + num; + float rotationAmt = 0f; + if (projectile.spriteDirection == -1) + { + rotationAmt = MathHelper.Pi; + } + projectile.rotation = projectile.velocity.ToRotation() + rotationAmt; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; player.ChangeDir(projectile.direction); diff --git a/Projectiles/Ranged/CardClub.cs b/Projectiles/Ranged/CardClub.cs index eb678fdc8b..16d290ec60 100644 --- a/Projectiles/Ranged/CardClub.cs +++ b/Projectiles/Ranged/CardClub.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/CardClubSplit.cs b/Projectiles/Ranged/CardClubSplit.cs index a408922c99..8f4101d481 100644 --- a/Projectiles/Ranged/CardClubSplit.cs +++ b/Projectiles/Ranged/CardClubSplit.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class CardClubSplit : ModProjectile + public class CardClubSplit : ModProjectile { public override void SetStaticDefaults() { @@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index ea208d6e08..ebb8b18787 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.Center.X, (int)projectile.Center.Y); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index f023af6d53..029f25bf8c 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -60,11 +60,11 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 360); - if (target.type == NPCID.TargetDummy) + Player player = Main.player[projectile.owner]; + if (target.type == NPCID.TargetDummy || player.moonLeech) { return; } - Player player = Main.player[projectile.owner]; player.statLife += 1; player.HealEffect(1); } diff --git a/Projectiles/Ranged/CardSpade.cs b/Projectiles/Ranged/CardSpade.cs index c468dbdd4e..ccca476878 100644 --- a/Projectiles/Ranged/CardSpade.cs +++ b/Projectiles/Ranged/CardSpade.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/ChargedBlast.cs b/Projectiles/Ranged/ChargedBlast.cs index 33315fcd84..ac3663da55 100644 --- a/Projectiles/Ranged/ChargedBlast.cs +++ b/Projectiles/Ranged/ChargedBlast.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -95,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + Main.PlaySound(SoundID.Item62, (int)projectile.position.X, (int)projectile.position.Y); int projectiles = Main.rand.Next(2, 5); if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/ChargedBlast2.cs b/Projectiles/Ranged/ChargedBlast2.cs index a48d48f13e..21c98913f5 100644 --- a/Projectiles/Ranged/ChargedBlast2.cs +++ b/Projectiles/Ranged/ChargedBlast2.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -95,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, (int)projectile.position.X, (int)projectile.position.Y); projectile.penetrate--; if (projectile.penetrate <= 0) { diff --git a/Projectiles/Ranged/ChargedBlast3.cs b/Projectiles/Ranged/ChargedBlast3.cs index 59e7e929e4..6640730753 100644 --- a/Projectiles/Ranged/ChargedBlast3.cs +++ b/Projectiles/Ranged/ChargedBlast3.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -95,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + Main.PlaySound(SoundID.Item62, (int)projectile.position.X, (int)projectile.position.Y); projectile.penetrate--; if (projectile.penetrate <= 0) { @@ -119,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 4, projectile.knockBack, projectile.owner, 1f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + Main.PlaySound(SoundID.Item62, (int)projectile.position.X, (int)projectile.position.Y); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/ChargedDartExplosion.cs b/Projectiles/Ranged/ChargedDartExplosion.cs index ed8eafe676..93679bae86 100644 --- a/Projectiles/Ranged/ChargedDartExplosion.cs +++ b/Projectiles/Ranged/ChargedDartExplosion.cs @@ -1,14 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class ChargedDartExplosion : ModProjectile + public class ChargedDartExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/Chicken.cs b/Projectiles/Ranged/Chicken.cs index ef6fa98d17..c5d4f7e83f 100644 --- a/Projectiles/Ranged/Chicken.cs +++ b/Projectiles/Ranged/Chicken.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -94,7 +95,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.Center.X, (int)projectile.Center.Y); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/ChickenExplosion.cs b/Projectiles/Ranged/ChickenExplosion.cs index 0e10528fa3..3d56f27e51 100644 --- a/Projectiles/Ranged/ChickenExplosion.cs +++ b/Projectiles/Ranged/ChickenExplosion.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.01f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index aeb75bfddd..b356c3be83 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class ClamorRifleProj : ModProjectile + public class ClamorRifleProj : ModProjectile { public override void SetStaticDefaults() { @@ -62,10 +61,10 @@ namespace CalamityMod.Projectiles.Ranged } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.45), 0f, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 118); + Main.PlaySound(SoundID.Item118, projectile.Center); } } } diff --git a/Projectiles/Ranged/ClamorRifleProjSplit.cs b/Projectiles/Ranged/ClamorRifleProjSplit.cs index 8ea656f765..7bae169458 100644 --- a/Projectiles/Ranged/ClamorRifleProjSplit.cs +++ b/Projectiles/Ranged/ClamorRifleProjSplit.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class ClamorRifleProjSplit : ModProjectile + public class ClamorRifleProjSplit : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/ContagionArrow.cs b/Projectiles/Ranged/ContagionArrow.cs index b0369fdab9..bdb059f307 100644 --- a/Projectiles/Ranged/ContagionArrow.cs +++ b/Projectiles/Ranged/ContagionArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/ContagionBall.cs b/Projectiles/Ranged/ContagionBall.cs index 09aa2cd28e..eb31032580 100644 --- a/Projectiles/Ranged/ContagionBall.cs +++ b/Projectiles/Ranged/ContagionBall.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.Center.X, (int)projectile.Center.Y); int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, 0f, 0f, 100, default, 0.15f); Main.dust[num622].velocity *= 1.2f; if (Main.rand.NextBool(2)) diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index 96483efc4a..11aab62623 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -67,7 +68,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.soundDelay = num3 - num4 * num2; if (projectile.ai[0] != 1f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 5); + Main.PlaySound(SoundID.Item5, (int)projectile.position.X, (int)projectile.position.Y); } } if (projectile.ai[1] == 1f && projectile.ai[0] != 1f) diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index 401b153f09..7537988e86 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/CorrodedShell.cs b/Projectiles/Ranged/CorrodedShell.cs index ea2cff9d05..b1609103d1 100644 --- a/Projectiles/Ranged/CorrodedShell.cs +++ b/Projectiles/Ranged/CorrodedShell.cs @@ -4,6 +4,7 @@ using CalamityMod.Dusts; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -53,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.maxPenetrate = -1; projectile.penetrate = -1; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item92, (int)projectile.Center.X, (int)projectile.Center.Y); int count = Main.rand.Next(6, 15); for (int i = 0; i < count; i++) { diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index 59952f0f62..08fd53fe89 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -90,7 +90,6 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 3; - target.AddBuff(BuffID.CursedInferno, 300); } } } diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index afc90e38f8..fc8884b8f3 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + Main.PlaySound(SoundID.Item12, (int)projectile.position.X, (int)projectile.position.Y); } // Force damage type based on AI variable (this is outdated code and the weapons themselves should set the force variables) diff --git a/Projectiles/Ranged/DaemonsFlameArrow.cs b/Projectiles/Ranged/DaemonsFlameArrow.cs index f8889ecaa9..56cac4d51f 100644 --- a/Projectiles/Ranged/DaemonsFlameArrow.cs +++ b/Projectiles/Ranged/DaemonsFlameArrow.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 160; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Ranged/DaemonsFlameBow.cs b/Projectiles/Ranged/DaemonsFlameBow.cs index a4d3999efa..2ebf38877f 100644 --- a/Projectiles/Ranged/DaemonsFlameBow.cs +++ b/Projectiles/Ranged/DaemonsFlameBow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Ranged/DesertMark.cs b/Projectiles/Ranged/DesertMark.cs index a8bbe810bc..046935c507 100644 --- a/Projectiles/Ranged/DesertMark.cs +++ b/Projectiles/Ranged/DesertMark.cs @@ -1,12 +1,10 @@ -using CalamityMod.World; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class DesertMark : ModProjectile + public class DesertMark : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/DesertTornado.cs b/Projectiles/Ranged/DesertTornado.cs index d4af6be148..d730ebcad7 100644 --- a/Projectiles/Ranged/DesertTornado.cs +++ b/Projectiles/Ranged/DesertTornado.cs @@ -1,12 +1,10 @@ -using CalamityMod.World; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class DesertTornado : ModProjectile + public class DesertTornado : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/DragonBurst.cs b/Projectiles/Ranged/DragonBurst.cs index e91627031a..af708a634a 100644 --- a/Projectiles/Ranged/DragonBurst.cs +++ b/Projectiles/Ranged/DragonBurst.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Ranged/DrataliornusExoArrow.cs b/Projectiles/Ranged/DrataliornusExoArrow.cs index f18b4bd10b..c032573a6e 100644 --- a/Projectiles/Ranged/DrataliornusExoArrow.cs +++ b/Projectiles/Ranged/DrataliornusExoArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index f81c2487f5..2b3f442c45 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Ranged { if (timeLeft != 0) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14, 1f, 0f); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); if (projectile.ai[0] != 0f && projectile.owner == Main.myPlayer) //if empowered, make exo arrow and dragon dust { diff --git a/Projectiles/Ranged/DrizzlefishFireball.cs b/Projectiles/Ranged/DrizzlefishFireball.cs index 91762385a8..5d6877e8e2 100644 --- a/Projectiles/Ranged/DrizzlefishFireball.cs +++ b/Projectiles/Ranged/DrizzlefishFireball.cs @@ -1,12 +1,11 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class DrizzlefishFireball : ModProjectile + public class DrizzlefishFireball : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/DualpoonProj.cs b/Projectiles/Ranged/DualpoonProj.cs new file mode 100644 index 0000000000..d5ff61e800 --- /dev/null +++ b/Projectiles/Ranged/DualpoonProj.cs @@ -0,0 +1,98 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class DualpoonProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dualpoon"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.alpha = 255; + projectile.ranged = true; + projectile.extraUpdates = 0; + projectile.timeLeft = 300; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + if (player.dead) + { + projectile.Kill(); + return; + } + if (projectile.alpha == 0) + { + if (projectile.Center.X > player.Center.X) + { + player.ChangeDir(1); + } + else + { + player.ChangeDir(-1); + } + } + if (projectile.ai[0] == 0f) + { + projectile.extraUpdates = 0; + } + else + { + projectile.extraUpdates = 1; + } + Vector2 playerVector = player.Center - projectile.Center; + float playerDist = playerVector.Length(); + if (projectile.ai[0] == 0f) + { + if (playerDist > 700f) + { + projectile.ai[0] = 1f; + } + else if (playerDist > 350f) + { + projectile.ai[0] = 1f; + } + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; + projectile.ai[1] += 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + if (projectile.ai[1] > 8f) + { + projectile.ai[1] = 8f; + } + if (projectile.ai[1] >= 10f) + { + projectile.ai[1] = 15f; + projectile.velocity.Y += 0.3f; + } + } + else if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + projectile.rotation = (float)Math.Atan2((double)playerVector.Y, (double)playerVector.X) - MathHelper.PiOver2; + float returnSpeed = 20f; + if (playerDist < 50f) + { + projectile.Kill(); + } + playerDist = returnSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = playerVector.X; + projectile.velocity.Y = playerVector.Y; + } + } + } +} diff --git a/Projectiles/Ranged/DualpoonProj.png b/Projectiles/Ranged/DualpoonProj.png new file mode 100644 index 0000000000..e3cad757f3 Binary files /dev/null and b/Projectiles/Ranged/DualpoonProj.png differ diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 9327f43d30..ea2f43977c 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.maxPenetrate = -1; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Ranged/EmesisGore.cs b/Projectiles/Ranged/EmesisGore.cs index 6df94049a0..27d0c67df6 100644 --- a/Projectiles/Ranged/EmesisGore.cs +++ b/Projectiles/Ranged/EmesisGore.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.IO; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/EnhancedNanoRoundProj.cs b/Projectiles/Ranged/EnhancedNanoRoundProj.cs index d561e4a802..c360fdb514 100644 --- a/Projectiles/Ranged/EnhancedNanoRoundProj.cs +++ b/Projectiles/Ranged/EnhancedNanoRoundProj.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); + Main.PlaySound(SoundID.Item93, (int)projectile.position.X, (int)projectile.position.Y); int num212 = Main.rand.Next(5, 10); for (int num213 = 0; num213 < num212; num213++) { diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 5dc5c5d7e2..0ef5baaf68 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs index b49155e52c..8058226979 100644 --- a/Projectiles/Ranged/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; +using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,8 +9,7 @@ namespace CalamityMod.Projectiles.Ranged { public class ExoFire : ModProjectile { - public bool speedXChoice = false; - public bool speedYChoice = false; + public bool ProducedAcceleration = false; public override void SetStaticDefaults() { @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; + projectile.width = 24; + projectile.height = 24; projectile.friendly = true; projectile.ignoreWater = true; projectile.ranged = true; @@ -27,22 +27,18 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 10; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; - projectile.timeLeft = 300; + projectile.timeLeft = 180; } public override void AI() { float speedX = 1f; float speedY = 1f; - if (!speedXChoice) + if (!ProducedAcceleration) { speedX = Main.rand.NextBool(2) ? 1.03f : 0.97f; - speedXChoice = true; - } - if (!speedYChoice) - { - speedY = Main.rand.NextBool(2) ? 1.03f : 0.97f; - speedYChoice = true; + projectile.velocity *= Utils.RandomVector2(Main.rand, 0.97f, 1.03f); + ProducedAcceleration = true; } projectile.velocity.X *= speedX; projectile.velocity.X *= speedY; diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs new file mode 100644 index 0000000000..a87ba62638 --- /dev/null +++ b/Projectiles/Ranged/ExoLight.cs @@ -0,0 +1,100 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class ExoLight : ModProjectile + { + public float OffsetSpeed + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float OffsetRotation + { + get => projectile.ai[1]; + set => projectile.ai[1] = value; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + projectile.timeLeft = 180; + } + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + OffsetRotation = Main.rand.NextFloat(MathHelper.TwoPi); + OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool(2).ToDirectionInt(); + projectile.localAI[0] = 1f; + } + Projectile owner = Main.projectile[(int)projectile.localAI[1]]; + + // Ensure the owner is the correct projectile. + if (owner.type != ModContent.ProjectileType()) + projectile.Kill(); + + // Movement around the owner. + projectile.Center = owner.Center + OffsetRotation.ToRotationVector2() * (float)Math.Cos(OffsetRotation * 0.3f) * owner.Size * 0.5f; + projectile.rotation = (projectile.position - projectile.oldPos[1]).ToRotation(); + OffsetRotation += OffsetSpeed; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D lightTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/PhotovisceratorLight"); + for (int i = 0; i < projectile.oldPos.Length; i++) + { + float colorInterpolation = (float)Math.Cos(projectile.timeLeft / 16f + Main.GlobalTime / 20f + i / (float)projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; + Color color = Color.Lerp(Color.LightGreen, Color.LightPink, colorInterpolation) * 0.4f; + color.A = 0; + Vector2 drawPosition = projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color outerColor = color; + Color innerColor = color * 0.5f; + float intensity = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTime % 60f * MathHelper.TwoPi); + + // Become smaller the futher along the old positions we are. + intensity *= MathHelper.Lerp(0.15f, 1f, 1f - i / (float)projectile.oldPos.Length); + + Vector2 outerScale = new Vector2(1.65f) * intensity; + Vector2 innerScale = new Vector2(1.65f) * intensity * 0.7f; + outerColor *= intensity; + innerColor *= intensity; + spriteBatch.Draw(lightTexture, drawPosition, null, outerColor, 0f, lightTexture.Size() * 0.5f, outerScale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(lightTexture, drawPosition, null, innerColor, 0f, lightTexture.Size() * 0.5f, innerScale * 0.6f, SpriteEffects.None, 0); + } + return false; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.Ichor, 180); + } + } +} diff --git a/Projectiles/Ranged/ExoLight.png b/Projectiles/Ranged/ExoLight.png new file mode 100644 index 0000000000..04c5646fde Binary files /dev/null and b/Projectiles/Ranged/ExoLight.png differ diff --git a/Projectiles/Ranged/ExoLightBomb.cs b/Projectiles/Ranged/ExoLightBomb.cs new file mode 100644 index 0000000000..8a0eefce83 --- /dev/null +++ b/Projectiles/Ranged/ExoLightBomb.cs @@ -0,0 +1,184 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class ExoLightBomb : ModProjectile + { + public Vector2 InitialCenter; + public Vector2 Destination; + public const float MaxRadius = 90f; + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public int DustType + { + get => (int)projectile.ai[1]; + set => projectile.ai[1] = value; + } + public float YDirection + { + get => projectile.localAI[1]; + set => projectile.localAI[1] = value; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Light"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 15; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 40; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.alpha = 127; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(YDirection); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + YDirection = reader.ReadSingle(); + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.DarkSlateGray.ToVector3()); + projectile.alpha = (int)MathHelper.Lerp(255, 127, Utils.InverseLerp(0f, 25f, Time, true)); + projectile.scale = MathHelper.Lerp(0.001f, 1f, Utils.InverseLerp(0f, 25f, Time, true)); + if (projectile.localAI[0] == 0f) + { + InitialCenter = projectile.Center; + Destination = Main.MouseWorld; + DustType = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + DustType = 269; + } + projectile.localAI[0] = 1f; + } + if (Time <= 90f) + { + projectile.position = Vector2.Lerp(InitialCenter, Destination, Time / 90f); + projectile.position.Y += (float)Math.Sin(Time / 90f * MathHelper.TwoPi) * 75f; + } + else if (Time < 180f) + { + // For those who haven't seen this yet (namely in the 1.4 source), this allows you to achieve a + // fade-in and fade-out effect with relative ease. At 90, multiply by 0, and somewhere in-between until 115, where you multiply by 1. + // And then do the same for the fade-out effect of 180f-165. These inverse linear interpolations cannot overlap by definition because + // their ranges do not overlap. Overall a really cool trick. + float radius = MaxRadius * Utils.InverseLerp(90f, 115f, Time, true) * Utils.InverseLerp(180f, 165f, Time, true); + radius *= 1f + (float)Math.Cos(Main.GlobalTime / 24f) * 0.25f; + if (radius < 5f) + radius = 5f; + projectile.Center = Destination + ((Time - 90) / 90f * MathHelper.ToRadians(720f) + (YDirection == -1).ToInt() * MathHelper.Pi).ToRotationVector2() * radius; + } + else if (Time == 180f) + { + projectile.Kill(); + } + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + Time++; + } + + public void GenerateRotationalDust() + { + for (int i = 0; i < 9; i++) + { + float angle = Time / 45f + i / 9f * MathHelper.TwoPi; + Vector2 offsetSpan = angle.ToRotationVector2() * projectile.Size * 0.65f * projectile.scale; + Vector2 edgePosition = projectile.Center + offsetSpan.RotatedBy(projectile.rotation); + Dust dust = Dust.NewDustPerfect(edgePosition + Main.rand.NextVector2Circular(4f, 4f), DustType); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.scale = 0.65f; + } + } + + public override Color? GetAlpha(Color lightColor) + { + return CalamityUtils.MulticolorLerp(Time / 60f % 1f, new Color[] + { + Color.PaleGreen, + Color.Violet, + Color.SlateGray + }) * projectile.Opacity; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D lightTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/PhotovisceratorLight"); + for (int i = 0; i < projectile.oldPos.Length; i++) + { + float colorInterpolation = (float)Math.Cos(projectile.timeLeft / 16f + Main.GlobalTime / 20f + i / (float)projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; + Color color = CalamityUtils.MulticolorLerp(MathHelper.Clamp(colorInterpolation, 0f, 0.99f), new Color[] + { + Color.PaleGreen, + Color.Violet, + Color.SlateGray + }) * projectile.Opacity; + color.A = 0; + Vector2 drawPosition = projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color outerColor = color; + Color innerColor = color * 0.5f; + float intensity = 0.9f + 0.15f * (float)Math.Cos(Main.GlobalTime % 60f * MathHelper.TwoPi); + + // Become smaller the futher along the old positions we are. + intensity *= MathHelper.Lerp(0.15f, 1f, 1f - i / (float)projectile.oldPos.Length); + + Vector2 outerScale = new Vector2(1.25f) * intensity; + Vector2 innerScale = new Vector2(1.25f) * intensity * 0.7f; + outerColor *= intensity * projectile.scale; + innerColor *= intensity * projectile.scale; + spriteBatch.Draw(lightTexture, drawPosition, null, outerColor, 0f, lightTexture.Size() * 0.5f, outerScale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(lightTexture, drawPosition, null, innerColor, 0f, lightTexture.Size() * 0.5f, innerScale * 0.6f, SpriteEffects.None, 0); + } + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item14, projectile.Center); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectileDirect(projectile.Center, + Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * 16f, + ModContent.ProjectileType(), + projectile.damage, + projectile.knockBack * 0.3f, + projectile.owner); + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.Ichor, 180); + } + } +} diff --git a/Projectiles/Ranged/ExoLightBomb.png b/Projectiles/Ranged/ExoLightBomb.png new file mode 100644 index 0000000000..67c615a142 Binary files /dev/null and b/Projectiles/Ranged/ExoLightBomb.png differ diff --git a/Projectiles/Ranged/ExoLightBurst.cs b/Projectiles/Ranged/ExoLightBurst.cs new file mode 100644 index 0000000000..b34a586853 --- /dev/null +++ b/Projectiles/Ranged/ExoLightBurst.cs @@ -0,0 +1,91 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class ExoLightBurst : ModProjectile + { + public const float MinDistanceFromTarget = 45f; + public const float MaxDistanceFromTarget = 1350f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Flare"); + ProjectileID.Sets.NeedsUUID[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 190; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.timeLeft = 180; + } + public override void AI() + { + // localAI[0] is used by the sticky AI method. + if (projectile.localAI[1] == 0f) + { + if (Main.netMode != NetmodeID.Server) + { + for (int i = 0; i < 5; i++) + { + Projectile.NewProjectileDirect(projectile.Center, + Vector2.Zero, + ModContent.ProjectileType(), + projectile.damage, + projectile.knockBack, + projectile.owner).localAI[1] = Projectile.GetByUUID(projectile.owner, projectile.whoAmI); + } + } + projectile.localAI[1] = 1f; + } + if (projectile.ai[0] == 0f) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(MaxDistanceFromTarget, true); + if (potentialTarget != null) + { + if (projectile.Distance(potentialTarget.Center) > MinDistanceFromTarget) + { + float angleOffset = projectile.AngleTo(potentialTarget.Center) - projectile.velocity.ToRotation(); + angleOffset = MathHelper.WrapAngle(angleOffset); + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.Clamp(angleOffset, -0.1f, 0.1f)); + } + } + } + CalamityUtils.StickyProjAI(projectile, 5); + } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + CalamityUtils.ModifyHitNPCSticky(projectile, 4, false); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + int width = (int)MathHelper.Max(targetHitbox.Width, 150); + int height = (int)MathHelper.Max(targetHitbox.Height, 150); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, width, height); + return null; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.CursedInferno, 180); + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(BuffID.OnFire, 180); + target.AddBuff(BuffID.Ichor, 180); + } + } +} diff --git a/Projectiles/Ranged/ExoLightBurst.png b/Projectiles/Ranged/ExoLightBurst.png new file mode 100644 index 0000000000..04c5646fde Binary files /dev/null and b/Projectiles/Ranged/ExoLightBurst.png differ diff --git a/Projectiles/Ranged/ExoMark.cs b/Projectiles/Ranged/ExoMark.cs index 7b80f3c5ab..b2e75a22d6 100644 --- a/Projectiles/Ranged/ExoMark.cs +++ b/Projectiles/Ranged/ExoMark.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -32,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 60); + Main.PlaySound(SoundID.Item60, (int)projectile.Center.X, (int)projectile.Center.Y); } if (projectile.localAI[1] < 30f) { diff --git a/Projectiles/Ranged/ExoSpark.cs b/Projectiles/Ranged/ExoSpark.cs new file mode 100644 index 0000000000..5f9aee48ff --- /dev/null +++ b/Projectiles/Ranged/ExoSpark.cs @@ -0,0 +1,84 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class ExoSpark : ModProjectile + { + public static readonly int[] FrameToDustIDTable = new int[] + { + 107, + 234, + 269, + }; + public const float HomingInertia = 10f; + public const float MaxTargetDistance = 750f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Spark"); + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 14; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.ranged = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + projectile.frame = Main.rand.Next(3); + projectile.localAI[0] = 1f; + projectile.netUpdate = true; + } + NPC potentialTarget = projectile.Center.ClosestNPCAt(MaxTargetDistance); + if (potentialTarget != null) + { + projectile.velocity = (projectile.velocity * (HomingInertia - 1) + projectile.DirectionTo(potentialTarget.Center) * 16f) / HomingInertia; + } + projectile.rotation = projectile.velocity.ToRotation(); + if (!Main.dedServ) + { + GenerateCircularDust(); + } + } + + public void GenerateCircularDust() + { + for (int i = 0; i < 12; i++) + { + float angle = i / 12f * MathHelper.TwoPi; + Vector2 spawnPosition = projectile.Center + angle.ToRotationVector2().RotatedBy(projectile.rotation) * new Vector2(10f, 6f); + Dust dust = Dust.NewDustPerfect(spawnPosition, FrameToDustIDTable[projectile.frame]); + dust.velocity = Vector2.Zero; + dust.scale = 0.5f; + dust.noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Ranged/ExoSpark.png b/Projectiles/Ranged/ExoSpark.png new file mode 100644 index 0000000000..eb696c6909 Binary files /dev/null and b/Projectiles/Ranged/ExoSpark.png differ diff --git a/Projectiles/Ranged/ExoTornado.cs b/Projectiles/Ranged/ExoTornado.cs index b23807c8d6..5f37a5ddd9 100644 --- a/Projectiles/Ranged/ExoTornado.cs +++ b/Projectiles/Ranged/ExoTornado.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 122); + Main.PlaySound(SoundID.Item122, projectile.position); } projectile.ai[0] += 1f; if (projectile.ai[0] >= num1125) diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index 7404cf203a..6e06e2293f 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/FallenStarProj.cs b/Projectiles/Ranged/FallenStarProj.cs index 10560e6034..8733fe6f61 100644 --- a/Projectiles/Ranged/FallenStarProj.cs +++ b/Projectiles/Ranged/FallenStarProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index 60a4592ebb..434cadd9c1 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } diff --git a/Projectiles/Ranged/FishronRPG.cs b/Projectiles/Ranged/FishronRPG.cs index 0ace016d77..ed7da93168 100644 --- a/Projectiles/Ranged/FishronRPG.cs +++ b/Projectiles/Ranged/FishronRPG.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) @@ -81,7 +82,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); return true; } @@ -96,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/FlakKrakenGun.cs b/Projectiles/Ranged/FlakKrakenGun.cs index 3b338314f4..068c2a669a 100644 --- a/Projectiles/Ranged/FlakKrakenGun.cs +++ b/Projectiles/Ranged/FlakKrakenGun.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -15,8 +15,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 140; - projectile.height = 44; + projectile.width = 152; + projectile.height = 58; projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; diff --git a/Projectiles/Ranged/FlakKrakenGun.png b/Projectiles/Ranged/FlakKrakenGun.png index 88f490cdcd..1353a556b8 100644 Binary files a/Projectiles/Ranged/FlakKrakenGun.png and b/Projectiles/Ranged/FlakKrakenGun.png differ diff --git a/Projectiles/Ranged/FlakKrakenProj.cs b/Projectiles/Ranged/FlakKrakenProj.cs index f6e219a0ff..3f3e24d321 100644 --- a/Projectiles/Ranged/FlakKrakenProj.cs +++ b/Projectiles/Ranged/FlakKrakenProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -18,8 +18,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 50; - projectile.height = 50; + projectile.width = 54; + projectile.height = 54; projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; diff --git a/Projectiles/Ranged/FlakKrakenProj.png b/Projectiles/Ranged/FlakKrakenProj.png index b8303e5d68..ebffc498ad 100644 Binary files a/Projectiles/Ranged/FlakKrakenProj.png and b/Projectiles/Ranged/FlakKrakenProj.png differ diff --git a/Projectiles/Ranged/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs index a6bb53d7e1..645e97232a 100644 --- a/Projectiles/Ranged/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/FlareBat.cs b/Projectiles/Ranged/FlareBat.cs index 1cdcb726cc..c2ace743bd 100644 --- a/Projectiles/Ranged/FlareBat.cs +++ b/Projectiles/Ranged/FlareBat.cs @@ -1,11 +1,9 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class FlareBat : ModProjectile + public class FlareBat : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index c720de44e5..2d48c4fbba 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Ranged/FlashBulletProj.cs b/Projectiles/Ranged/FlashBulletProj.cs index 36ae975684..de9c60d85f 100644 --- a/Projectiles/Ranged/FlashBulletProj.cs +++ b/Projectiles/Ranged/FlashBulletProj.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 93); + Main.PlaySound(SoundID.Item93, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs index 014731bf71..b32c4b8ad7 100644 --- a/Projectiles/Ranged/FlurrystormIceChunk.cs +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -1,4 +1,3 @@ -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -6,7 +5,7 @@ using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Ranged { - public class FlurrystormIceChunk : ModProjectile + public class FlurrystormIceChunk : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index 25ac61a421..e0da13936a 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/FrostsparkBulletProj.cs b/Projectiles/Ranged/FrostsparkBulletProj.cs index fb1ab6363f..72f0dfa94d 100644 --- a/Projectiles/Ranged/FrostsparkBulletProj.cs +++ b/Projectiles/Ranged/FrostsparkBulletProj.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); projectile.damage /= 3; projectile.position = projectile.Center; diff --git a/Projectiles/Ranged/FungiOrb.cs b/Projectiles/Ranged/FungiOrb.cs index 46e148b538..eb951a4840 100644 --- a/Projectiles/Ranged/FungiOrb.cs +++ b/Projectiles/Ranged/FungiOrb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f); } } - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 56, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Ranged/FungiOrb2.cs b/Projectiles/Ranged/FungiOrb2.cs index f0451f089c..e6831c49f2 100644 --- a/Projectiles/Ranged/FungiOrb2.cs +++ b/Projectiles/Ranged/FungiOrb2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 4bc571ed3d..5110295332 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -136,7 +137,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs index ad7cc5969f..14dbd90676 100644 --- a/Projectiles/Ranged/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/HandheldTankShell.cs b/Projectiles/Ranged/HandheldTankShell.cs index 0f266c680b..effbbe3a81 100644 --- a/Projectiles/Ranged/HandheldTankShell.cs +++ b/Projectiles/Ranged/HandheldTankShell.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 723dbb9681..44bcc0fcbf 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -136,7 +137,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 280144d831..7ca2d9624d 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -136,7 +137,7 @@ namespace CalamityMod.Projectiles.Ranged } } } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index c20501623f..9b76d0d1f4 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 12f012c36a..14f578fa0d 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class HyperiusBulletProj : ModProjectile + public class HyperiusBulletProj : ModProjectile { private Color currentColor = Color.Black; diff --git a/Projectiles/Ranged/IlluminatedBullet.cs b/Projectiles/Ranged/IlluminatedBullet.cs index b327b320d4..b3af24bd70 100644 --- a/Projectiles/Ranged/IlluminatedBullet.cs +++ b/Projectiles/Ranged/IlluminatedBullet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 72e536c9d0..c471d98944 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -51,19 +51,7 @@ namespace CalamityMod.Projectiles.Ranged { damageMult += 0.25; } - if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && - target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && - target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && - target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && - target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && - target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && - target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && - target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && - target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && - target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && - target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && - target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && - target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57) + if (target.Inorganic()) { damageMult += 0.1; } diff --git a/Projectiles/Ranged/KarasawaShot.cs b/Projectiles/Ranged/KarasawaShot.cs index e6c1805e5e..0786bf5b81 100644 --- a/Projectiles/Ranged/KarasawaShot.cs +++ b/Projectiles/Ranged/KarasawaShot.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Ranged/LeafArrow.cs b/Projectiles/Ranged/LeafArrow.cs index 3157b1ed82..329aded31a 100644 --- a/Projectiles/Ranged/LeafArrow.cs +++ b/Projectiles/Ranged/LeafArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(6, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Grass, projectile.position); projectile.localAI[1] += 1f; for (int num407 = 0; num407 < 5; num407++) { diff --git a/Projectiles/Ranged/LunarBolt.cs b/Projectiles/Ranged/LunarBolt.cs index 9e7608976a..6cd1925b5f 100644 --- a/Projectiles/Ranged/LunarBolt.cs +++ b/Projectiles/Ranged/LunarBolt.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[0] == 0f) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.Center); projectile.ai[0]++; } return false; diff --git a/Projectiles/Ranged/LunarBolt2.cs b/Projectiles/Ranged/LunarBolt2.cs index 02dbb1826b..7261e105d4 100644 --- a/Projectiles/Ranged/LunarBolt2.cs +++ b/Projectiles/Ranged/LunarBolt2.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[0] == 0f) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.Center); projectile.ai[0]++; } return false; diff --git a/Projectiles/Ranged/LuxorsGiftRanged.cs b/Projectiles/Ranged/LuxorsGiftRanged.cs index 8397deb6a8..41607e1e32 100644 --- a/Projectiles/Ranged/LuxorsGiftRanged.cs +++ b/Projectiles/Ranged/LuxorsGiftRanged.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); int num212 = Main.rand.Next(10, 20); for (int num213 = 0; num213 < num212; num213++) { diff --git a/Projectiles/Ranged/MagnaStrike.cs b/Projectiles/Ranged/MagnaStrike.cs index 4a0454f0a0..b78e8904e7 100644 --- a/Projectiles/Ranged/MagnaStrike.cs +++ b/Projectiles/Ranged/MagnaStrike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria.ID; diff --git a/Projectiles/Ranged/MagnomalyAura.cs b/Projectiles/Ranged/MagnomalyAura.cs index dbbdcd90f0..6487b61ecc 100644 --- a/Projectiles/Ranged/MagnomalyAura.cs +++ b/Projectiles/Ranged/MagnomalyAura.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class MagnomalyAura : ModProjectile + public class MagnomalyAura : ModProjectile { private int radius = 100; diff --git a/Projectiles/Ranged/MagnomalyBeam.cs b/Projectiles/Ranged/MagnomalyBeam.cs index 7c742eba48..c89a3e15ca 100644 --- a/Projectiles/Ranged/MagnomalyBeam.cs +++ b/Projectiles/Ranged/MagnomalyBeam.cs @@ -1,6 +1,5 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +8,7 @@ using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Ranged { - public class MagnomalyBeam : ModProjectile + public class MagnomalyBeam : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/MagnomalyExplosion.cs b/Projectiles/Ranged/MagnomalyExplosion.cs index 15be9c170c..5f6e9859f2 100644 --- a/Projectiles/Ranged/MagnomalyExplosion.cs +++ b/Projectiles/Ranged/MagnomalyExplosion.cs @@ -1,5 +1,3 @@ -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -7,7 +5,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Ranged { - public class MagnomalyExplosion : ModProjectile + public class MagnomalyExplosion : ModProjectile { public override void SetStaticDefaults() //don't remove this projectile { diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index 0d3de97a67..ebc84779fa 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 192; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); //DO NOT REMOVE THIS PROJECTILE Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/MechanicalBarracuda.cs b/Projectiles/Ranged/MechanicalBarracuda.cs index e57ef9f6f0..e9cc73d9a3 100644 --- a/Projectiles/Ranged/MechanicalBarracuda.cs +++ b/Projectiles/Ranged/MechanicalBarracuda.cs @@ -1,9 +1,8 @@ -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class MechanicalBarracuda : ModProjectile + public class MechanicalBarracuda : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index a1fa5a27c1..5c33815136 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 8; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 57); + Main.PlaySound(SoundID.Item57, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 10; diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index 1071ccd125..0217dea070 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 8; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 58); + Main.PlaySound(SoundID.Item58, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 10; diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 9b45fe6716..4be243b865 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -74,7 +75,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/Minibirb.cs b/Projectiles/Ranged/Minibirb.cs index d5f7f05a7b..be4ddb512b 100644 --- a/Projectiles/Ranged/Minibirb.cs +++ b/Projectiles/Ranged/Minibirb.cs @@ -1,9 +1,8 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Ranged { public class Minibirb : ModProjectile @@ -29,13 +28,13 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 51, 1f, 0f); + Main.PlaySound(SoundID.NPCHit51, projectile.Center); return true; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(3, (int)projectile.position.X, (int)projectile.position.Y, 51, 1f, 0f); + Main.PlaySound(SoundID.NPCHit51, projectile.Center); } public override void AI() diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index aefe0a8777..328d472513 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index e6e0fdffcc..c574334730 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillTile(num824, num825, false, false, false); if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } } for (int num829 = num824 - 1; num829 <= num824 + 1; num829++) @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillWall(num829, num830, false); if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } } } @@ -182,14 +182,14 @@ namespace CalamityMod.Projectiles.Ranged AchievementsHelper.CurrentlyMining = false; if (Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { - NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index aa0306fab5..746ebbc87b 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/NeedlerProj.cs b/Projectiles/Ranged/NeedlerProj.cs index 6ad53995fa..528667fe58 100644 --- a/Projectiles/Ranged/NeedlerProj.cs +++ b/Projectiles/Ranged/NeedlerProj.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -22,7 +23,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 2; projectile.aiStyle = 93; - aiType = 514; + aiType = ProjectileID.NailFriendly; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 1; } public override void AI() @@ -44,11 +47,6 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 1; - } - public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Ranged/NorfleetCannon.cs b/Projectiles/Ranged/NorfleetCannon.cs index d28ceb5ce7..7b122cbf95 100644 --- a/Projectiles/Ranged/NorfleetCannon.cs +++ b/Projectiles/Ranged/NorfleetCannon.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged case 540: projectile.localAI[0] += 1f; projectile.ai[0] = -1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Ranged/NorfleetComet.cs b/Projectiles/Ranged/NorfleetComet.cs index a5c8378140..39d6e1a5d7 100644 --- a/Projectiles/Ranged/NorfleetComet.cs +++ b/Projectiles/Ranged/NorfleetComet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.localAI[0] += 1f; @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), projectile.knockBack * 0.1f, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 144; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Ranged/NorfleetExplosion.cs b/Projectiles/Ranged/NorfleetExplosion.cs index 87f017b579..8451566c53 100644 --- a/Projectiles/Ranged/NorfleetExplosion.cs +++ b/Projectiles/Ranged/NorfleetExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index dbefc34db2..c92614ff2b 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 60fc241eb2..5215d220bb 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index 1953c0e1cf..60a9a3fb42 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/OnyxSharkBomb.cs b/Projectiles/Ranged/OnyxSharkBomb.cs index 06f5e300d6..7ca7cf2202 100644 --- a/Projectiles/Ranged/OnyxSharkBomb.cs +++ b/Projectiles/Ranged/OnyxSharkBomb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 109, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 159, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Ranged/OpalStrike.cs b/Projectiles/Ranged/OpalStrike.cs index 23afb175c8..5c8b0efd96 100644 --- a/Projectiles/Ranged/OpalStrike.cs +++ b/Projectiles/Ranged/OpalStrike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria.ID; diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index 194b0bc52a..085e80af95 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14, 1f, 0f); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num193 = 0; num193 < 4; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 50, default, 1f); diff --git a/Projectiles/Ranged/PhangasmBow.cs b/Projectiles/Ranged/PhangasmBow.cs index cd85a5abc1..74f2c751e5 100644 --- a/Projectiles/Ranged/PhangasmBow.cs +++ b/Projectiles/Ranged/PhangasmBow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index b4d4a70747..aec0a0cbbc 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); if (projectile.owner == Main.myPlayer) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/PlagueExplosionFriendly.cs b/Projectiles/Ranged/PlagueExplosionFriendly.cs index 175aa0b15d..3d588dda0c 100644 --- a/Projectiles/Ranged/PlagueExplosionFriendly.cs +++ b/Projectiles/Ranged/PlagueExplosionFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index f712dbb461..870632a0d8 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -1,18 +1,13 @@ using CalamityMod.CalPlayer; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class PlanarRipperBolt : ModProjectile + public class PlanarRipperBolt : ModProjectile { public static int frameWidth = 12; public static int frameHeight = 26; @@ -110,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, (Main.rand.NextBool(2) ? 93 : 92), 0.5f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, (Main.rand.NextBool(2) ? 93 : 92), 0.5f, 0f); for (int i = 0; i < 5; i++) { diff --git a/Projectiles/Ranged/PlanarRipperExplosion.cs b/Projectiles/Ranged/PlanarRipperExplosion.cs index 899d038ed2..174bf40692 100644 --- a/Projectiles/Ranged/PlanarRipperExplosion.cs +++ b/Projectiles/Ranged/PlanarRipperExplosion.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -6,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class PlanarRipperExplosion : ModProjectile + public class PlanarRipperExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs index d5d419f1e6..e7866791d7 100644 --- a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs +++ b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -58,39 +58,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 400f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 18f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 18f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs index 4645b6c2ef..b852422d7e 100644 --- a/Projectiles/Ranged/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.soundDelay == 0) { projectile.soundDelay = 20 + Main.rand.Next(40); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } projectile.localAI[0] += 1f; if (projectile.localAI[0] == 12f) @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 221, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Ranged/PlasmaExplosion.cs b/Projectiles/Ranged/PlasmaExplosion.cs index f0c37e9c49..eaef416898 100644 --- a/Projectiles/Ranged/PlasmaExplosion.cs +++ b/Projectiles/Ranged/PlasmaExplosion.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 1f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); + Main.PlaySound(SoundID.Item93, projectile.position); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index 8d9fb54077..e315f5bfe0 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -4,6 +4,8 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Ranged { public class PolarStar : ModProjectile @@ -176,13 +178,13 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); return true; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.5f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.5f); if (projectile.ai[1] == 1f) //Boost two { int projectiles = Main.rand.Next(2, 5); diff --git a/Projectiles/Ranged/PristineFire.cs b/Projectiles/Ranged/PristineFire.cs index 43fee8ce6b..ec9083f3be 100644 --- a/Projectiles/Ranged/PristineFire.cs +++ b/Projectiles/Ranged/PristineFire.cs @@ -1,14 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class PristineFire : ModProjectile + public class PristineFire : ModProjectile { private int dust1 = (int)CalamityDusts.ProfanedFire; private int dust2 = ModContent.DustType(); diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index 6c00a74439..c282d27679 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -1,15 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class PristineSecondary : ModProjectile + public class PristineSecondary : ModProjectile { private int dust1 = (int)CalamityDusts.ProfanedFire; private int dust2 = ModContent.DustType(); diff --git a/Projectiles/Ranged/ProBolt.cs b/Projectiles/Ranged/ProBolt.cs index 0e6621b814..66d9929bad 100644 --- a/Projectiles/Ranged/ProBolt.cs +++ b/Projectiles/Ranged/ProBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/RainbowBlast.cs b/Projectiles/Ranged/RainbowBlast.cs index 63ec5bbe0e..40350fe446 100644 --- a/Projectiles/Ranged/RainbowBlast.cs +++ b/Projectiles/Ranged/RainbowBlast.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +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 { - public class RainbowBlast : ModProjectile + public class RainbowBlast : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/RainbowFront.cs b/Projectiles/Ranged/RainbowFront.cs index f95db2f9c1..a012c74477 100644 --- a/Projectiles/Ranged/RainbowFront.cs +++ b/Projectiles/Ranged/RainbowFront.cs @@ -1,12 +1,10 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class RainbowFront : ModProjectile + public class RainbowFront : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/RainbowTrail.cs b/Projectiles/Ranged/RainbowTrail.cs index 4efda1e9ef..c9bb76baa7 100644 --- a/Projectiles/Ranged/RainbowTrail.cs +++ b/Projectiles/Ranged/RainbowTrail.cs @@ -1,11 +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 RainbowTrail : ModProjectile + public class RainbowTrail : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 9120c2ec8c..ba81aca67d 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -20,14 +21,14 @@ namespace CalamityMod.Projectiles.Ranged projectile.friendly = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 90; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); @@ -49,6 +50,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; projectile.Damage(); } } diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index ae81fbb23e..bd60f48538 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using CalamityMod.Walls; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillTile(num824, num825, false, false, false); if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } } for (int num829 = num824 - 1; num829 <= num824 + 1; num829++) @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillWall(num829, num830, false); if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } } } @@ -182,14 +182,14 @@ namespace CalamityMod.Projectiles.Ranged AchievementsHelper.CurrentlyMining = false; if (Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { - NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } } } @@ -226,7 +226,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); @@ -327,7 +327,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillTile(num824, num825, false, false, false); if (!Main.tile[num824, num825].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)num824, (float)num825, 0f, 0, 0, 0); } } for (int num829 = num824 - 1; num829 <= num824 + 1; num829++) @@ -339,7 +339,7 @@ namespace CalamityMod.Projectiles.Ranged WorldGen.KillWall(num829, num830, false); if (Main.tile[num829, num830].wall == 0 && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 2, (float)num829, (float)num830, 0f, 0, 0, 0); } } } @@ -350,14 +350,14 @@ namespace CalamityMod.Projectiles.Ranged AchievementsHelper.CurrentlyMining = false; if (Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(29, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, (float)projectile.owner, 0f, 0f, 0, 0, 0); } if (!projectile.noDropItem) { int num831 = -1; if (Main.netMode == NetmodeID.MultiplayerClient && num831 >= 0) { - NetMessage.SendData(21, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncItem, -1, -1, null, num831, 1f, 0f, 0f, 0, 0, 0); } } } diff --git a/Projectiles/Ranged/SandWater.cs b/Projectiles/Ranged/SandWater.cs index 1b6d886569..07429f0c36 100644 --- a/Projectiles/Ranged/SandWater.cs +++ b/Projectiles/Ranged/SandWater.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); for (int dust = 0; dust <= 40; dust++) { float num463 = (float)Main.rand.Next(-10, 11); diff --git a/Projectiles/Ranged/SandstormBullet.cs b/Projectiles/Ranged/SandstormBullet.cs index 94039471f9..8deefb9cf3 100644 --- a/Projectiles/Ranged/SandstormBullet.cs +++ b/Projectiles/Ranged/SandstormBullet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Ranged/SandyWaifuShark.cs b/Projectiles/Ranged/SandyWaifuShark.cs index b37bf9483b..cb3eb1c217 100644 --- a/Projectiles/Ranged/SandyWaifuShark.cs +++ b/Projectiles/Ranged/SandyWaifuShark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Ranged/SeaDragonRocket.cs b/Projectiles/Ranged/SeaDragonRocket.cs index 37dadfaf31..e3fc2e1452 100644 --- a/Projectiles/Ranged/SeaDragonRocket.cs +++ b/Projectiles/Ranged/SeaDragonRocket.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Ranged } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + Main.PlaySound(SoundID.Item109, projectile.position); } projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 110); + Main.PlaySound(SoundID.Item110, projectile.position); for (int num621 = 0; num621 < 15; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs index 9f32010a8b..40baf7cdb3 100644 --- a/Projectiles/Ranged/SeasSearingBubble.cs +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -78,18 +78,18 @@ namespace CalamityMod.Projectiles.Ranged } public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); - for (int k = 0; k < 5; k++) + { + Main.PlaySound(SoundID.Item96, projectile.position); + for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 202, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, new Color(60, Main.DiscoG, 190)); } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 96); - target.AddBuff(BuffID.Wet, 240); + { + Main.PlaySound(SoundID.Item96, projectile.position); + target.AddBuff(BuffID.Wet, 240); target.AddBuff(ModContent.BuffType(), 240); int type = ModContent.ProjectileType(); diff --git a/Projectiles/Ranged/SeasSearingSecondary.cs b/Projectiles/Ranged/SeasSearingSecondary.cs index 5c58ff72b3..cbcf0bfa8d 100644 --- a/Projectiles/Ranged/SeasSearingSecondary.cs +++ b/Projectiles/Ranged/SeasSearingSecondary.cs @@ -1,14 +1,12 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class SeasSearingSecondary : ModProjectile + public class SeasSearingSecondary : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/SepticSkewerBacteria.cs b/Projectiles/Ranged/SepticSkewerBacteria.cs index 081197ba2b..5090c199c1 100644 --- a/Projectiles/Ranged/SepticSkewerBacteria.cs +++ b/Projectiles/Ranged/SepticSkewerBacteria.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class SepticSkewerBacteria : ModProjectile + public class SepticSkewerBacteria : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs index 031d9bd008..3112b9b18d 100644 --- a/Projectiles/Ranged/SepticSkewerHarpoon.cs +++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Ranged { - public class SepticSkewerHarpoon : ModProjectile + public class SepticSkewerHarpoon : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs index 5752a3a62a..718f73f24e 100644 --- a/Projectiles/Ranged/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/Shell.cs b/Projectiles/Ranged/Shell.cs index 1c938fa181..bc8b666b4a 100644 --- a/Projectiles/Ranged/Shell.cs +++ b/Projectiles/Ranged/Shell.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 34; diff --git a/Projectiles/Ranged/Shockblast.cs b/Projectiles/Ranged/Shockblast.cs index 0227ffb2ab..047957c048 100644 --- a/Projectiles/Ranged/Shockblast.cs +++ b/Projectiles/Ranged/Shockblast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index fd7f0cefa0..ff994af960 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); } - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Ranged/Shroom.cs b/Projectiles/Ranged/Shroom.cs index 2ece298796..a74d61b961 100644 --- a/Projectiles/Ranged/Shroom.cs +++ b/Projectiles/Ranged/Shroom.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class Shroom : ModProjectile + public class Shroom : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Ranged/Sickness.cs b/Projectiles/Ranged/Sickness.cs index 3b7b269511..5342d88783 100644 --- a/Projectiles/Ranged/Sickness.cs +++ b/Projectiles/Ranged/Sickness.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index b0e3d42c70..92f5458091 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Ranged/SlashRound.cs b/Projectiles/Ranged/SlashRound.cs index 6cf577a325..0be707d289 100644 --- a/Projectiles/Ranged/SlashRound.cs +++ b/Projectiles/Ranged/SlashRound.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/SlimeBolt.cs b/Projectiles/Ranged/SlimeBolt.cs index ab416d2b26..e28d39bc95 100644 --- a/Projectiles/Ranged/SlimeBolt.cs +++ b/Projectiles/Ranged/SlimeBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/SmallCoral.cs b/Projectiles/Ranged/SmallCoral.cs index e6db879a32..0f66c294f1 100644 --- a/Projectiles/Ranged/SmallCoral.cs +++ b/Projectiles/Ranged/SmallCoral.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class SmallCoral : ModProjectile + public class SmallCoral : ModProjectile { public override void SetStaticDefaults() { @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.Center); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 16; diff --git a/Projectiles/Ranged/SporeBomb.cs b/Projectiles/Ranged/SporeBomb.cs index a57644c2a8..035b88d0cb 100644 --- a/Projectiles/Ranged/SporeBomb.cs +++ b/Projectiles/Ranged/SporeBomb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num407 = 0; num407 < 25; num407++) { int num408 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 157, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1f); diff --git a/Projectiles/Ranged/SputterComet.cs b/Projectiles/Ranged/SputterComet.cs index 337ab2b822..5e04f0dc13 100644 --- a/Projectiles/Ranged/SputterComet.cs +++ b/Projectiles/Ranged/SputterComet.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } } diff --git a/Projectiles/Ranged/SputterCometBig.cs b/Projectiles/Ranged/SputterCometBig.cs index 1a5a0316d1..28ddd0cf2f 100644 --- a/Projectiles/Ranged/SputterCometBig.cs +++ b/Projectiles/Ranged/SputterCometBig.cs @@ -5,11 +5,10 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using System; namespace CalamityMod.Projectiles.Ranged { - public class SputterCometBig : ModProjectile + public class SputterCometBig : ModProjectile { public override void SetStaticDefaults() { @@ -46,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 300f, 15f, 20f); @@ -65,7 +64,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 93); + Main.PlaySound(SoundID.Item93, projectile.position); if (projectile.owner == Main.myPlayer) { int flash = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index 8ab0debca0..e20aa2169b 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/StarfleetMK2Gun.cs b/Projectiles/Ranged/StarfleetMK2Gun.cs index 40b0bf1e3b..388ff54128 100644 --- a/Projectiles/Ranged/StarfleetMK2Gun.cs +++ b/Projectiles/Ranged/StarfleetMK2Gun.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged case 540: projectile.localAI[0] += 1f; projectile.ai[0] = -1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Ranged/StormSurgeTornado.cs b/Projectiles/Ranged/StormSurgeTornado.cs index b075445311..1f29cc4e4b 100644 --- a/Projectiles/Ranged/StormSurgeTornado.cs +++ b/Projectiles/Ranged/StormSurgeTornado.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Ranged/SulphuricAcidBubble2.cs b/Projectiles/Ranged/SulphuricAcidBubble2.cs index 8339346624..7535d82ea0 100644 --- a/Projectiles/Ranged/SulphuricAcidBubble2.cs +++ b/Projectiles/Ranged/SulphuricAcidBubble2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/SulphuricAcidMist2.cs b/Projectiles/Ranged/SulphuricAcidMist2.cs index 37d050cc5b..9b0c7f2348 100644 --- a/Projectiles/Ranged/SulphuricAcidMist2.cs +++ b/Projectiles/Ranged/SulphuricAcidMist2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 111); + Main.PlaySound(SoundID.Item111, projectile.position); } if (projectile.velocity.X < 0f) { diff --git a/Projectiles/Ranged/SuperballBulletProj.cs b/Projectiles/Ranged/SuperballBulletProj.cs index f337417a9f..d46834f706 100644 --- a/Projectiles/Ranged/SuperballBulletProj.cs +++ b/Projectiles/Ranged/SuperballBulletProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.velocity.Y = -oldVelocity.Y; } projectile.velocity *= 1.5f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 87, projectile.oldVelocity.X * 0.05f, projectile.oldVelocity.Y * 0.05f); diff --git a/Projectiles/Ranged/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs index d687aaa5df..4a9e00a9f9 100644 --- a/Projectiles/Ranged/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/TelluricGlareProj.cs b/Projectiles/Ranged/TelluricGlareProj.cs index ccc94595a8..caa48a860f 100644 --- a/Projectiles/Ranged/TelluricGlareProj.cs +++ b/Projectiles/Ranged/TelluricGlareProj.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -47,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/TerraArrowMain.cs b/Projectiles/Ranged/TerraArrowMain.cs index 71b5531f6c..af9e439e3f 100644 --- a/Projectiles/Ranged/TerraArrowMain.cs +++ b/Projectiles/Ranged/TerraArrowMain.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -39,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.position); for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Ranged/TerraArrowSplit.cs b/Projectiles/Ranged/TerraArrowSplit.cs index 8111bf6a73..6b821fb134 100644 --- a/Projectiles/Ranged/TerraArrowSplit.cs +++ b/Projectiles/Ranged/TerraArrowSplit.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 60); + Main.PlaySound(SoundID.Item60, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 30; diff --git a/Projectiles/Ranged/TerraBulletMain.cs b/Projectiles/Ranged/TerraBulletMain.cs index 015038c595..bd0366cb1a 100644 --- a/Projectiles/Ranged/TerraBulletMain.cs +++ b/Projectiles/Ranged/TerraBulletMain.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 118); + Main.PlaySound(SoundID.Item118, projectile.position); } } } diff --git a/Projectiles/Ranged/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs index edd9f08b6b..1c9801af74 100644 --- a/Projectiles/Ranged/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.immune[projectile.owner] = 5; - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.CursedInferno, 120); target.AddBuff(BuffID.OnFire, 300); } } diff --git a/Projectiles/Ranged/TerraFireGreen2.cs b/Projectiles/Ranged/TerraFireGreen2.cs index 3418b20107..28030a7c25 100644 --- a/Projectiles/Ranged/TerraFireGreen2.cs +++ b/Projectiles/Ranged/TerraFireGreen2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.CursedInferno, 300); + target.AddBuff(BuffID.CursedInferno, 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.OnFire, 300); target.AddBuff(ModContent.BuffType(), 120); diff --git a/Projectiles/Ranged/ThePackMinissile.cs b/Projectiles/Ranged/ThePackMinissile.cs index 0480a2bb68..684fcd6fe8 100644 --- a/Projectiles/Ranged/ThePackMinissile.cs +++ b/Projectiles/Ranged/ThePackMinissile.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -40,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int i = 0; i < 10; i++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 255, 0f, 0f, 0, default, 1f); diff --git a/Projectiles/Ranged/ThePackMissile.cs b/Projectiles/Ranged/ThePackMissile.cs index 132cd2bf4b..8b4176bbdd 100644 --- a/Projectiles/Ranged/ThePackMissile.cs +++ b/Projectiles/Ranged/ThePackMissile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.Kill(); return; } diff --git a/Projectiles/Ranged/TitRail.cs b/Projectiles/Ranged/TitRail.cs index 6c31056ffa..38af08a56c 100644 --- a/Projectiles/Ranged/TitRail.cs +++ b/Projectiles/Ranged/TitRail.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index 6a9a4a8324..087a802f04 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Ranged/ToxicArrow.cs b/Projectiles/Ranged/ToxicArrow.cs index e45da42349..e0e8fb48f5 100644 --- a/Projectiles/Ranged/ToxicArrow.cs +++ b/Projectiles/Ranged/ToxicArrow.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -39,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.localNPCHitCooldown = 10; projectile.damage /= 2; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); int count = Main.rand.Next(6, 15); for (int i = 0; i < count; i++) { diff --git a/Projectiles/Ranged/ToxicannonDrop.cs b/Projectiles/Ranged/ToxicannonDrop.cs index a0cf3f0305..689a8b0d3e 100644 --- a/Projectiles/Ranged/ToxicannonDrop.cs +++ b/Projectiles/Ranged/ToxicannonDrop.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index 2df9edd008..30ee2dc440 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/TriploonProj.cs b/Projectiles/Ranged/TriploonProj.cs index 8db99a6d9d..be1796a307 100644 --- a/Projectiles/Ranged/TriploonProj.cs +++ b/Projectiles/Ranged/TriploonProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; @@ -20,24 +20,26 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = 255; projectile.ranged = true; projectile.extraUpdates = 0; + projectile.timeLeft = 300; } public override void AI() { - if (Main.player[projectile.owner].dead) + Player player = Main.player[projectile.owner]; + if (player.dead) { projectile.Kill(); return; } if (projectile.alpha == 0) { - if (projectile.position.X + (float)(projectile.width / 2) > Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2)) + if (projectile.Center.X > player.Center.X) { - Main.player[projectile.owner].ChangeDir(1); + player.ChangeDir(1); } else { - Main.player[projectile.owner].ChangeDir(-1); + player.ChangeDir(-1); } } if (projectile.ai[0] == 0f) @@ -48,21 +50,19 @@ namespace CalamityMod.Projectiles.Ranged { projectile.extraUpdates = 1; } - Vector2 vector14 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num166 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector14.X; - float num167 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector14.Y; - float num168 = (float)Math.Sqrt((double)(num166 * num166 + num167 * num167)); + Vector2 playerVector = player.Center - projectile.Center; + float playerDist = playerVector.Length(); if (projectile.ai[0] == 0f) { - if (num168 > 700f) + if (playerDist > 700f) { projectile.ai[0] = 1f; } - else if (num168 > 350f) + else if (playerDist > 350f) { projectile.ai[0] = 1f; } - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; projectile.ai[1] += 1f; if (projectile.ai[1] > 5f) { @@ -75,23 +75,23 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.ai[1] >= 10f) { projectile.ai[1] = 15f; - projectile.velocity.Y = projectile.velocity.Y + 0.3f; + projectile.velocity.Y += 0.3f; } } else if (projectile.ai[0] == 1f) { projectile.tileCollide = false; - projectile.rotation = (float)Math.Atan2((double)num167, (double)num166) - 1.57f; - float num169 = 20f; - if (num168 < 50f) + projectile.rotation = (float)Math.Atan2((double)playerVector.Y, (double)playerVector.X) - MathHelper.PiOver2; + float returnSpeed = 20f; + if (playerDist < 50f) { projectile.Kill(); } - num168 = num169 / num168; - num166 *= num168; - num167 *= num168; - projectile.velocity.X = num166; - projectile.velocity.Y = num167; + playerDist = returnSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = playerVector.X; + projectile.velocity.Y = playerVector.Y; } } } diff --git a/Projectiles/Ranged/TriploonProj.png b/Projectiles/Ranged/TriploonProj.png index e3cad757f3..833e8b2e74 100644 Binary files a/Projectiles/Ranged/TriploonProj.png and b/Projectiles/Ranged/TriploonProj.png differ diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 41393c48a9..135b6e21c8 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index af3079d3b6..6419595806 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -93,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 19); + Main.PlaySound(SoundID.NPCDeath19, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Ranged/VanquisherArrowMain.cs b/Projectiles/Ranged/VanquisherArrowMain.cs index 894b187207..5e3f940e36 100644 --- a/Projectiles/Ranged/VanquisherArrowMain.cs +++ b/Projectiles/Ranged/VanquisherArrowMain.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs index 153a81a8c8..5e799fd498 100644 --- a/Projectiles/Ranged/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.soundDelay == 0) { projectile.soundDelay = 150 + Main.rand.Next(40); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); } projectile.localAI[0] += 1f; if (projectile.localAI[0] == 12f) @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 1f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); diff --git a/Projectiles/Ranged/WaterSpout.cs b/Projectiles/Ranged/WaterSpout.cs index c9944c6f86..2e56efabf7 100644 --- a/Projectiles/Ranged/WaterSpout.cs +++ b/Projectiles/Ranged/WaterSpout.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile.cs b/Projectiles/Rogue/AbyssalMirrorProjectile.cs index a60de771ae..4410afbd4e 100644 --- a/Projectiles/Rogue/AbyssalMirrorProjectile.cs +++ b/Projectiles/Rogue/AbyssalMirrorProjectile.cs @@ -1,10 +1,9 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; +using CalamityMod.Buffs.StatDebuffs; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class AbyssalMirrorProjectile : ModProjectile + public class AbyssalMirrorProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/AcidBarrelDrop.cs b/Projectiles/Rogue/AcidBarrelDrop.cs index 7442680b7b..a422e48017 100644 --- a/Projectiles/Rogue/AcidBarrelDrop.cs +++ b/Projectiles/Rogue/AcidBarrelDrop.cs @@ -1,14 +1,13 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Rogue { - public class AcidBarrelDrop : ModProjectile + public class AcidBarrelDrop : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/AcidShrapnel.cs b/Projectiles/Rogue/AcidShrapnel.cs index a0befa481b..803ffae8c9 100644 --- a/Projectiles/Rogue/AcidShrapnel.cs +++ b/Projectiles/Rogue/AcidShrapnel.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs index f8fbdadc74..942dee7285 100644 --- a/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs +++ b/Projectiles/Rogue/AdamantiteThrowingAxeProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/AlphaSeeker.cs b/Projectiles/Rogue/AlphaSeeker.cs index ccdb2e9490..2fbed81f09 100644 --- a/Projectiles/Rogue/AlphaSeeker.cs +++ b/Projectiles/Rogue/AlphaSeeker.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class AlphaSeeker : ModProjectile + public class AlphaSeeker : ModProjectile { public static float moveSpeed = 2f; public static float rotateSpeed = 0.04f; diff --git a/Projectiles/Rogue/AlphaVirusProjectile.cs b/Projectiles/Rogue/AlphaVirusProjectile.cs index f439c76d03..12df69f515 100644 --- a/Projectiles/Rogue/AlphaVirusProjectile.cs +++ b/Projectiles/Rogue/AlphaVirusProjectile.cs @@ -1,14 +1,14 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using CalamityMod.NPCs.StormWeaver; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { - public class AlphaVirusProjectile : ModProjectile + public class AlphaVirusProjectile : ModProjectile { public static int lifetime = 600; public static float finalVelocity = 2f; @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/AshenStalactiteDebris.cs b/Projectiles/Rogue/AshenStalactiteDebris.cs index 97dc29b133..e21e355fb9 100644 --- a/Projectiles/Rogue/AshenStalactiteDebris.cs +++ b/Projectiles/Rogue/AshenStalactiteDebris.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/AshenStalactiteProj.cs b/Projectiles/Rogue/AshenStalactiteProj.cs index 93d3d8522d..e8c73d50a4 100644 --- a/Projectiles/Rogue/AshenStalactiteProj.cs +++ b/Projectiles/Rogue/AshenStalactiteProj.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/AshenStalagmiteProj.cs b/Projectiles/Rogue/AshenStalagmiteProj.cs index a4becec216..63332c7a73 100644 --- a/Projectiles/Rogue/AshenStalagmiteProj.cs +++ b/Projectiles/Rogue/AshenStalagmiteProj.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { @@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/AuroradicalSplitter.cs b/Projectiles/Rogue/AuroradicalSplitter.cs index 7ee1c48c78..d638712c57 100644 --- a/Projectiles/Rogue/AuroradicalSplitter.cs +++ b/Projectiles/Rogue/AuroradicalSplitter.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,7 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class AuroradicalSplitter : ModProjectile + public class AuroradicalSplitter : ModProjectile { public int[] dustTypes = new int[] { @@ -100,7 +99,7 @@ namespace CalamityMod.Projectiles.Rogue for (float i = 0; i < 5; i++) { float angle = MathHelper.TwoPi / 5f * i; - int star = Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 5f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + int star = Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.87), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[star].Calamity().stealthStrike = projectile.Calamity().stealthStrike; } projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index ffcedef6f8..228ddf7dee 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); int num251 = Main.rand.Next(3, 5); if (projectile.owner == Main.myPlayer) { @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Rogue } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); } int num320 = Main.rand.Next(8, 13); int num3; @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); vector15.Normalize(); vector15 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType() + Main.rand.Next(3), (int)((double)projectile.damage * 0.3), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); num3 = num321; } } diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.png b/Projectiles/Rogue/BallisticPoisonBombProj.png index 41cbdb0949..57ee0af129 100644 Binary files a/Projectiles/Rogue/BallisticPoisonBombProj.png and b/Projectiles/Rogue/BallisticPoisonBombProj.png differ diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.cs b/Projectiles/Rogue/BallisticPoisonBombSpike.cs index cad1d39c7c..145a8f3dac 100644 --- a/Projectiles/Rogue/BallisticPoisonBombSpike.cs +++ b/Projectiles/Rogue/BallisticPoisonBombSpike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/BallisticPoisonBombSpike.png b/Projectiles/Rogue/BallisticPoisonBombSpike.png index 586b8e6639..156ae21160 100644 Binary files a/Projectiles/Rogue/BallisticPoisonBombSpike.png and b/Projectiles/Rogue/BallisticPoisonBombSpike.png differ diff --git a/Projectiles/Rogue/BarrelShrapnel.cs b/Projectiles/Rogue/BarrelShrapnel.cs index 693c76591e..779bbb38d2 100644 --- a/Projectiles/Rogue/BarrelShrapnel.cs +++ b/Projectiles/Rogue/BarrelShrapnel.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BarrelShrapnel : ModProjectile + public class BarrelShrapnel : ModProjectile { public bool hitTile = false; public override void SetStaticDefaults() diff --git a/Projectiles/Rogue/BettyExplosion.cs b/Projectiles/Rogue/BettyExplosion.cs index 896472bd27..96371c4c0f 100644 --- a/Projectiles/Rogue/BettyExplosion.cs +++ b/Projectiles/Rogue/BettyExplosion.cs @@ -1,12 +1,10 @@ -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; namespace CalamityMod.Projectiles.Rogue { - public class BettyExplosion : ModProjectile + public class BettyExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/BileExplosion.cs b/Projectiles/Rogue/BileExplosion.cs index fe491d45af..238c754d97 100644 --- a/Projectiles/Rogue/BileExplosion.cs +++ b/Projectiles/Rogue/BileExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 4a94719116..2ead573d84 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BlastBarrelProjectile : ModProjectile + public class BlastBarrelProjectile : ModProjectile { public float cooldown = 0f; public float oldVelocityX = 0f; @@ -65,7 +64,7 @@ namespace CalamityMod.Projectiles.Rogue { bool stealthS = projectile.Calamity().stealthStrike; int projectileCount = 12; - Main.PlaySound(2, projectile.Center, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); //aka can bounce multiple times if (stealthS) { diff --git a/Projectiles/Rogue/BlazingStarProj.cs b/Projectiles/Rogue/BlazingStarProj.cs index d93ca1ae9b..cf407891ab 100644 --- a/Projectiles/Rogue/BlazingStarProj.cs +++ b/Projectiles/Rogue/BlazingStarProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 24d20904ab..802f3d0811 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[stealth].Calamity().forceRogue = true; } - if (!target.canGhostHeal) //canGhostHeal be like lol + if (!target.canGhostHeal || player.moonLeech) //canGhostHeal be like lol { return; } diff --git a/Projectiles/Rogue/BlueFlamePillar.cs b/Projectiles/Rogue/BlueFlamePillar.cs index 58f07be054..00c8be3541 100644 --- a/Projectiles/Rogue/BlueFlamePillar.cs +++ b/Projectiles/Rogue/BlueFlamePillar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index 6808e31235..f2316ec925 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -1,14 +1,13 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BlunderBoosterLightning : ModProjectile + public class BlunderBoosterLightning : ModProjectile { public static int frameWidth = 12; public static int frameHeight = 26; diff --git a/Projectiles/Rogue/BouncingBettyProjectile.cs b/Projectiles/Rogue/BouncingBettyProjectile.cs index 08a94f8012..fb059edbe4 100644 --- a/Projectiles/Rogue/BouncingBettyProjectile.cs +++ b/Projectiles/Rogue/BouncingBettyProjectile.cs @@ -1,13 +1,10 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BouncingBettyProjectile : ModProjectile + public class BouncingBettyProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -26,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue //This is definitely not a near copy of the Blast Barrel nosiree :> private void Explode() { - Main.PlaySound(2, projectile.Center, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); bool stealthS = projectile.Calamity().stealthStrike; Projectile.NewProjectile(projectile.Center, new Vector2(0f, 0f), ModContent.ProjectileType(), projectile.damage, 8f, projectile.owner); if (stealthS) @@ -81,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(2, projectile.Center, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); Explode(); projectile.velocity *= -1f; } diff --git a/Projectiles/Rogue/BouncingBettyShrapnel.cs b/Projectiles/Rogue/BouncingBettyShrapnel.cs index 0d82d1f9ec..faaeeb0618 100644 --- a/Projectiles/Rogue/BouncingBettyShrapnel.cs +++ b/Projectiles/Rogue/BouncingBettyShrapnel.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/BouncingEyeballProjectile.cs b/Projectiles/Rogue/BouncingEyeballProjectile.cs index d5e5922b25..9e7b71ea70 100644 --- a/Projectiles/Rogue/BouncingEyeballProjectile.cs +++ b/Projectiles/Rogue/BouncingEyeballProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue } public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); + Main.PlaySound(SoundID.NPCHit, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); Bounces--; if (Bounces <= 0) { @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void Kill(int timeLeft) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); + Main.PlaySound(SoundID.NPCHit, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); int dustCount = Main.rand.Next(8, 16); for (int index = 0; index < dustCount; index++) { diff --git a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs index b88216d0f2..f922206b43 100644 --- a/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs +++ b/Projectiles/Rogue/BouncingEyeballProjectileStealthStrike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -47,13 +47,13 @@ namespace CalamityMod.Projectiles.Rogue { projectile.velocity = Main.rand.NextFloat(-1.15f, -0.85f) * oldVelocity * Bounciness; } - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); + Main.PlaySound(SoundID.NPCHit, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); return false; } public override void Kill(int timeLeft) { //explode into a larger display of blood. Yay - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); + Main.PlaySound(SoundID.NPCHit, (int)projectile.Center.X, (int)projectile.Center.Y, 19, 0.7f); int dustCount = Main.rand.Next(15, 26); for (int index = 0; index < dustCount; index++) { diff --git a/Projectiles/Rogue/BouncyBol.cs b/Projectiles/Rogue/BouncyBol.cs index c9e3476b2c..e9865469c3 100644 --- a/Projectiles/Rogue/BouncyBol.cs +++ b/Projectiles/Rogue/BouncyBol.cs @@ -1,15 +1,11 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using System.Collections.Generic; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class BouncyBol : ModProjectile + public class BouncyBol : ModProjectile { private bool hasHitEnemy = false; private int targetNPC = -1; diff --git a/Projectiles/Rogue/BrackishFlaskProj.cs b/Projectiles/Rogue/BrackishFlaskProj.cs index 1c3cd7792b..fe00874d77 100644 --- a/Projectiles/Rogue/BrackishFlaskProj.cs +++ b/Projectiles/Rogue/BrackishFlaskProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -27,12 +27,12 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); - int randomDust = Utils.SelectRandom(Main.rand, new int[] - { - 33, - 89 - }); + Main.PlaySound(SoundID.Item107, projectile.Center); + int randomDust = Utils.SelectRandom(Main.rand, new int[] + { + 33, + 89 + }); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X, projectile.oldVelocity.Y); diff --git a/Projectiles/Rogue/BrackishWater.cs b/Projectiles/Rogue/BrackishWater.cs index c2d0d092ec..78719abe3c 100644 --- a/Projectiles/Rogue/BrackishWater.cs +++ b/Projectiles/Rogue/BrackishWater.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.5f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 21); projectile.localAI[0] += 1f; } int randomDust = Utils.SelectRandom(Main.rand, new int[] diff --git a/Projectiles/Rogue/BrackishWaterBlast.cs b/Projectiles/Rogue/BrackishWaterBlast.cs index 384a893570..90c57ae76b 100644 --- a/Projectiles/Rogue/BrackishWaterBlast.cs +++ b/Projectiles/Rogue/BrackishWaterBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue }); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 21); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Rogue/Brick.cs b/Projectiles/Rogue/Brick.cs index a4867e0f63..416a248a60 100644 --- a/Projectiles/Rogue/Brick.cs +++ b/Projectiles/Rogue/Brick.cs @@ -1,6 +1,8 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Items.Weapons.Rogue; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class Brick : ModProjectile @@ -41,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ModContent.ItemType()); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 50); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 50); //Dust on impact int dust_splash = 0; while (dust_splash < 9) diff --git a/Projectiles/Rogue/BrickFragment.cs b/Projectiles/Rogue/BrickFragment.cs index a0bd0ab6d1..54b7e0ad19 100644 --- a/Projectiles/Rogue/BrickFragment.cs +++ b/Projectiles/Rogue/BrickFragment.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { diff --git a/Projectiles/Rogue/Brimblade2.cs b/Projectiles/Rogue/Brimblade2.cs index 1bdf0e2509..a17d1da2f3 100644 --- a/Projectiles/Rogue/Brimblade2.cs +++ b/Projectiles/Rogue/Brimblade2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/BrimbladeProj.cs b/Projectiles/Rogue/BrimbladeProj.cs index f64b912b56..9f95776b31 100644 --- a/Projectiles/Rogue/BrimbladeProj.cs +++ b/Projectiles/Rogue/BrimbladeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs index e51c763a8c..df19353474 100644 --- a/Projectiles/Rogue/BurningStrifeProj.cs +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.ShadowFlame, 180); if (projectile.Calamity().stealthStrike && projectile.penetrate != 1) { - Main.PlaySound(2, projectile.Center, 103); + Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner); Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.ShadowFlame, 180); if (projectile.Calamity().stealthStrike && projectile.penetrate != 1) { - Main.PlaySound(2, projectile.Center, 103); + Main.PlaySound(SoundID.Item, projectile.Center, 103); int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner); Main.projectile[proj].Center = projectile.Center; Main.projectile[proj].Calamity().rogue = true; @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { int proj; - Main.PlaySound(2, projectile.Center, 103); + Main.PlaySound(SoundID.Item, projectile.Center, 103); if(projectile.Calamity().stealthStrike) proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner); else diff --git a/Projectiles/Rogue/CelestialReaperAfterimage.cs b/Projectiles/Rogue/CelestialReaperAfterimage.cs index a61801ce51..c564fad218 100644 --- a/Projectiles/Rogue/CelestialReaperAfterimage.cs +++ b/Projectiles/Rogue/CelestialReaperAfterimage.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/CelestialReaperProjectile.cs b/Projectiles/Rogue/CelestialReaperProjectile.cs index 1e79c10013..a005b94e1b 100644 --- a/Projectiles/Rogue/CelestialReaperProjectile.cs +++ b/Projectiles/Rogue/CelestialReaperProjectile.cs @@ -1,13 +1,10 @@ -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CelestialReaperProjectile : ModProjectile + public class CelestialReaperProjectile : ModProjectile { public int HomingCooldown = 0; public override void SetStaticDefaults() diff --git a/Projectiles/Rogue/Celestus2.cs b/Projectiles/Rogue/Celestus2.cs index 06090a0883..7f9d070323 100644 --- a/Projectiles/Rogue/Celestus2.cs +++ b/Projectiles/Rogue/Celestus2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/CelestusBoomerang.cs b/Projectiles/Rogue/CelestusBoomerang.cs index e33863e15f..5ccaed09b3 100644 --- a/Projectiles/Rogue/CelestusBoomerang.cs +++ b/Projectiles/Rogue/CelestusBoomerang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); + Main.PlaySound(SoundID.Item122, (int)projectile.position.X, (int)projectile.position.Y); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122); + Main.PlaySound(SoundID.Item122, (int)projectile.position.X, (int)projectile.position.Y); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/CinquedeaProj.cs b/Projectiles/Rogue/CinquedeaProj.cs index 8f637e6a6f..87c5e73fa2 100644 --- a/Projectiles/Rogue/CinquedeaProj.cs +++ b/Projectiles/Rogue/CinquedeaProj.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CinquedeaProj : ModProjectile + public class CinquedeaProj : ModProjectile { internal float gravspin = 0f; diff --git a/Projectiles/Rogue/CircletMark.cs b/Projectiles/Rogue/CircletMark.cs index 487b64d914..c32acf0143 100644 --- a/Projectiles/Rogue/CircletMark.cs +++ b/Projectiles/Rogue/CircletMark.cs @@ -1,12 +1,10 @@ -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CircletMark : ModProjectile + public class CircletMark : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/CircletTornado.cs b/Projectiles/Rogue/CircletTornado.cs index 722eee8f6e..54af35c75c 100644 --- a/Projectiles/Rogue/CircletTornado.cs +++ b/Projectiles/Rogue/CircletTornado.cs @@ -1,12 +1,10 @@ -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CircletTornado : ModProjectile + public class CircletTornado : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/CobaltEnergy.cs b/Projectiles/Rogue/CobaltEnergy.cs index d201365355..a80b0ee50c 100644 --- a/Projectiles/Rogue/CobaltEnergy.cs +++ b/Projectiles/Rogue/CobaltEnergy.cs @@ -1,6 +1,5 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CobaltEnergy : ModProjectile + public class CobaltEnergy : ModProjectile { private bool hasHitEnemy = false; private int targetNPC = -1; diff --git a/Projectiles/Rogue/CobaltKunaiProjectile.cs b/Projectiles/Rogue/CobaltKunaiProjectile.cs index 0e7c7b6d39..5328a97ecf 100644 --- a/Projectiles/Rogue/CobaltKunaiProjectile.cs +++ b/Projectiles/Rogue/CobaltKunaiProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/ConsecratedWaterProjectile.cs b/Projectiles/Rogue/ConsecratedWaterProjectile.cs index f96fae503d..2e982beb4c 100644 --- a/Projectiles/Rogue/ConsecratedWaterProjectile.cs +++ b/Projectiles/Rogue/ConsecratedWaterProjectile.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.World.Generation; namespace CalamityMod.Projectiles.Rogue { - public class ConsecratedWaterProjectile : ModProjectile + public class ConsecratedWaterProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ContaminatedBileFlask.cs b/Projectiles/Rogue/ContaminatedBileFlask.cs index e436a24213..f18fdc331e 100644 --- a/Projectiles/Rogue/ContaminatedBileFlask.cs +++ b/Projectiles/Rogue/ContaminatedBileFlask.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/Corrocloud1.cs b/Projectiles/Rogue/Corrocloud1.cs index 8a328f0301..a126772cf8 100644 --- a/Projectiles/Rogue/Corrocloud1.cs +++ b/Projectiles/Rogue/Corrocloud1.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class Corrocloud1 : ModProjectile + public class Corrocloud1 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/Corrocloud2.cs b/Projectiles/Rogue/Corrocloud2.cs index 44f01228e8..4125f75db8 100644 --- a/Projectiles/Rogue/Corrocloud2.cs +++ b/Projectiles/Rogue/Corrocloud2.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class Corrocloud2 : ModProjectile + public class Corrocloud2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/Corrocloud3.cs b/Projectiles/Rogue/Corrocloud3.cs index 72ded48c55..2934a7b2c9 100644 --- a/Projectiles/Rogue/Corrocloud3.cs +++ b/Projectiles/Rogue/Corrocloud3.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class Corrocloud3 : ModProjectile + public class Corrocloud3 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/CosmicKunaiProj.cs b/Projectiles/Rogue/CosmicKunaiProj.cs index e4093f4dbc..dd3dfb91ec 100644 --- a/Projectiles/Rogue/CosmicKunaiProj.cs +++ b/Projectiles/Rogue/CosmicKunaiProj.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CosmicKunaiProj : ModProjectile + public class CosmicKunaiProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/CosmicScythe.cs b/Projectiles/Rogue/CosmicScythe.cs index d0b1149701..b59d8be648 100644 --- a/Projectiles/Rogue/CosmicScythe.cs +++ b/Projectiles/Rogue/CosmicScythe.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CosmicScythe : ModProjectile + public class CosmicScythe : ModProjectile { private int originalDamage; @@ -68,7 +67,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 50; diff --git a/Projectiles/Rogue/CraniumSMASH.cs b/Projectiles/Rogue/CraniumSMASH.cs index 1fed76310b..44c0ab554d 100644 --- a/Projectiles/Rogue/CraniumSMASH.cs +++ b/Projectiles/Rogue/CraniumSMASH.cs @@ -1,6 +1,4 @@ -using System; -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index f6810bff89..40c9faf471 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -45,8 +46,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - CalamityUtils.ExplosionGores(projectile, 3); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + CalamityUtils.ExplosionGores(projectile, 3); for (int num194 = 0; num194 < 25; num194++) { int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/CraniumSmasherProj.cs b/Projectiles/Rogue/CraniumSmasherProj.cs index c4702f2ab7..b2bc71b179 100644 --- a/Projectiles/Rogue/CraniumSmasherProj.cs +++ b/Projectiles/Rogue/CraniumSmasherProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index 0bcc649b48..71e08ebe97 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class Crushax : ModProjectile + public class Crushax : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/CrystalPiercerProjectile.cs b/Projectiles/Rogue/CrystalPiercerProjectile.cs index 4085b44d39..67d6c09b97 100644 --- a/Projectiles/Rogue/CrystalPiercerProjectile.cs +++ b/Projectiles/Rogue/CrystalPiercerProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/CrystalPiercerShard.cs b/Projectiles/Rogue/CrystalPiercerShard.cs index ad87531fc5..28d362c497 100644 --- a/Projectiles/Rogue/CrystalPiercerShard.cs +++ b/Projectiles/Rogue/CrystalPiercerShard.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class CrystalPiercerShard : ModProjectile + public class CrystalPiercerShard : ModProjectile { private bool initialized = false; diff --git a/Projectiles/Rogue/Crystalline2.cs b/Projectiles/Rogue/Crystalline2.cs index cfabb7a1bb..6aaabebe15 100644 --- a/Projectiles/Rogue/Crystalline2.cs +++ b/Projectiles/Rogue/Crystalline2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/CrystallineProj.cs b/Projectiles/Rogue/CrystallineProj.cs index 9f975121e2..d5e35bf284 100644 --- a/Projectiles/Rogue/CrystallineProj.cs +++ b/Projectiles/Rogue/CrystallineProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, (int)projectile.position.X, (int)projectile.position.Y); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/CursedDaggerProj.cs b/Projectiles/Rogue/CursedDaggerProj.cs index aac175c11f..70b8d075be 100644 --- a/Projectiles/Rogue/CursedDaggerProj.cs +++ b/Projectiles/Rogue/CursedDaggerProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/DeepSeaDumbbell1.cs b/Projectiles/Rogue/DeepSeaDumbbell1.cs index d8a8a822b7..c67740a287 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell1.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell1.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class DeepSeaDumbbell1 : ModProjectile @@ -29,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); if (projectile.velocity.X != oldVelocity.X) projectile.velocity.X = -oldVelocity.X; @@ -76,7 +78,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); projectile.velocity.X = -projectile.velocity.X; projectile.velocity.Y = -projectile.velocity.Y; @@ -116,7 +118,7 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); projectile.velocity.X = -projectile.velocity.X; projectile.velocity.Y = -projectile.velocity.Y; diff --git a/Projectiles/Rogue/DeepSeaDumbbell2.cs b/Projectiles/Rogue/DeepSeaDumbbell2.cs index fc72f80c83..e52f09b46c 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell2.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell2.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class DeepSeaDumbbell2 : ModProjectile @@ -36,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); if (projectile.velocity.X != oldVelocity.X) projectile.velocity.X = -oldVelocity.X; @@ -83,7 +85,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); projectile.velocity.X = -projectile.velocity.X; projectile.velocity.Y = -projectile.velocity.Y; @@ -123,7 +125,7 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); projectile.velocity.X = -projectile.velocity.X; projectile.velocity.Y = -projectile.velocity.Y; diff --git a/Projectiles/Rogue/DeepSeaDumbbell3.cs b/Projectiles/Rogue/DeepSeaDumbbell3.cs index 11bf71d687..bf1888a56e 100644 --- a/Projectiles/Rogue/DeepSeaDumbbell3.cs +++ b/Projectiles/Rogue/DeepSeaDumbbell3.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class DeepSeaDumbbell3 : ModProjectile @@ -36,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); if (projectile.owner == Main.myPlayer) { @@ -75,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); if (projectile.owner == Main.myPlayer) { @@ -109,7 +111,7 @@ namespace CalamityMod.Projectiles.Rogue { target.AddBuff(ModContent.BuffType(), 600); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Rogue/DeepSeaDumbbellWeight.cs b/Projectiles/Rogue/DeepSeaDumbbellWeight.cs index 2a33889ff7..2fdbe96ce3 100644 --- a/Projectiles/Rogue/DeepSeaDumbbellWeight.cs +++ b/Projectiles/Rogue/DeepSeaDumbbellWeight.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class DeepSeaDumbbellWeight : ModProjectile @@ -35,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 43, 0.35f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 36; diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs index 163f98fac5..59e0021e9b 100644 --- a/Projectiles/Rogue/DeepWounderProjectile.cs +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { @@ -87,7 +88,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/DeificThunderboltProj.cs b/Projectiles/Rogue/DeificThunderboltProj.cs index 8d43c85a9a..bcfca59e95 100644 --- a/Projectiles/Rogue/DeificThunderboltProj.cs +++ b/Projectiles/Rogue/DeificThunderboltProj.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class DeificThunderboltProj : ModProjectile + public class DeificThunderboltProj : ModProjectile { private bool playedSound = false; diff --git a/Projectiles/Rogue/DesecratedBubble.cs b/Projectiles/Rogue/DesecratedBubble.cs index 5de9d71e66..f94aa0fd13 100644 --- a/Projectiles/Rogue/DesecratedBubble.cs +++ b/Projectiles/Rogue/DesecratedBubble.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class DesecratedBubble : ModProjectile + public class DesecratedBubble : ModProjectile { public override void SetStaticDefaults() { @@ -54,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 54); + Main.PlaySound(SoundID.Item54, (int)projectile.position.X, (int)projectile.position.Y); int num190 = Main.rand.Next(5, 9); for (int num191 = 0; num191 < num190; num191++) { diff --git a/Projectiles/Rogue/DesecratedWaterProj.cs b/Projectiles/Rogue/DesecratedWaterProj.cs index e4472cdb7c..0790402941 100644 --- a/Projectiles/Rogue/DesecratedWaterProj.cs +++ b/Projectiles/Rogue/DesecratedWaterProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(13, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); + Main.PlaySound(SoundID.Shatter, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); Vector2 vector2 = new Vector2(20f, 20f); for (int index = 0; index < 10; ++index) Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f); diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index 8b075bdbf1..88a821815f 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -148,8 +148,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - for (int num621 = 0; num621 < 20; num621++) + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index e4fd1c3719..3e4ba4e834 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -79,8 +79,8 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - Vector2 vector2 = new Vector2(20f, 20f); + Main.PlaySound(SoundID.Item14, projectile.Center); + Vector2 vector2 = new Vector2(20f, 20f); for (int index1 = 0; index1 < 10; ++index1) { int index2 = Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, 0.0f, 0.0f, 100, new Color(), 1.5f); diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index 2289c1ac84..e0ae51ace5 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -1,7 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -79,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position = projectile.Center; projectile.width = projectile.height = 80; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Rogue/DukesDecapitatorBubble.cs b/Projectiles/Rogue/DukesDecapitatorBubble.cs index 8e227703f1..829d2c7a65 100644 --- a/Projectiles/Rogue/DukesDecapitatorBubble.cs +++ b/Projectiles/Rogue/DukesDecapitatorBubble.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class DukesDecapitatorBubble : ModProjectile + public class DukesDecapitatorBubble : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index 9cfacfd481..5dcde53c74 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -9,7 +7,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Rogue { - public class DukesDecapitatorProj : ModProjectile + public class DukesDecapitatorProj : ModProjectile { bool stealthBubbles = false; float rotationAmount = 1.5f; diff --git a/Projectiles/Rogue/DuneHopperProjectile.cs b/Projectiles/Rogue/DuneHopperProjectile.cs index d18a466d48..6993f781e0 100644 --- a/Projectiles/Rogue/DuneHopperProjectile.cs +++ b/Projectiles/Rogue/DuneHopperProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria.ID; diff --git a/Projectiles/Rogue/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs index 81250cee64..a488447d8a 100644 --- a/Projectiles/Rogue/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { diff --git a/Projectiles/Rogue/DuststormInABottleProj.cs b/Projectiles/Rogue/DuststormInABottleProj.cs index de59cf4eca..32ac41b268 100644 --- a/Projectiles/Rogue/DuststormInABottleProj.cs +++ b/Projectiles/Rogue/DuststormInABottleProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { bool stealth = projectile.Calamity().stealthStrike; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); //change + Main.PlaySound(SoundID.Item107, projectile.Center); for (int k = 0; k < 15; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.oldVelocity.X, projectile.oldVelocity.Y); diff --git a/Projectiles/Rogue/EclipseMirrorBurst.cs b/Projectiles/Rogue/EclipseMirrorBurst.cs index c43adc9795..abafa6657c 100644 --- a/Projectiles/Rogue/EclipseMirrorBurst.cs +++ b/Projectiles/Rogue/EclipseMirrorBurst.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/EclipsesSmol.cs b/Projectiles/Rogue/EclipsesSmol.cs index 58e287a9bc..fa9ad85291 100644 --- a/Projectiles/Rogue/EclipsesSmol.cs +++ b/Projectiles/Rogue/EclipsesSmol.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -33,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 20; num621++) { if (Main.rand.NextBool(10)) diff --git a/Projectiles/Rogue/EnchantedAxeProj.cs b/Projectiles/Rogue/EnchantedAxeProj.cs index 2b1cc1eb5c..d2cde42f4b 100644 --- a/Projectiles/Rogue/EnchantedAxeProj.cs +++ b/Projectiles/Rogue/EnchantedAxeProj.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); recall = true; projectile.tileCollide = false; return false; diff --git a/Projectiles/Rogue/EpidemicShredderProjectile.cs b/Projectiles/Rogue/EpidemicShredderProjectile.cs index c29e3b83a7..e5ad162a6c 100644 --- a/Projectiles/Rogue/EpidemicShredderProjectile.cs +++ b/Projectiles/Rogue/EpidemicShredderProjectile.cs @@ -1,16 +1,13 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class EpidemicShredderProjectile : ModProjectile + public class EpidemicShredderProjectile : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/EquanimityDarkShard.cs b/Projectiles/Rogue/EquanimityDarkShard.cs index 30842639d3..59e935f27c 100644 --- a/Projectiles/Rogue/EquanimityDarkShard.cs +++ b/Projectiles/Rogue/EquanimityDarkShard.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class EquanimityDarkShard : ModProjectile @@ -79,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return true; } diff --git a/Projectiles/Rogue/EquanimityLightShard.cs b/Projectiles/Rogue/EquanimityLightShard.cs index cbccfad414..5eebb24db8 100644 --- a/Projectiles/Rogue/EquanimityLightShard.cs +++ b/Projectiles/Rogue/EquanimityLightShard.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Rogue { public class EquanimityLightShard : ModProjectile @@ -48,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return true; } diff --git a/Projectiles/Rogue/EquanimityProj.cs b/Projectiles/Rogue/EquanimityProj.cs index 1e6aca684b..523d1a41fb 100644 --- a/Projectiles/Rogue/EquanimityProj.cs +++ b/Projectiles/Rogue/EquanimityProj.cs @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); recall = true; projectile.tileCollide = false; return false; diff --git a/Projectiles/Rogue/ExecutionersBladeProj.cs b/Projectiles/Rogue/ExecutionersBladeProj.cs index 05f8f869d6..f8cc4426ce 100644 --- a/Projectiles/Rogue/ExecutionersBladeProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeProj.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ExecutionersBladeProj : ModProjectile + public class ExecutionersBladeProj : ModProjectile { private void handleStealth(Vector2 position, int damage, bool crit, float knockback) @@ -87,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs index 106f281f3f..6a57b35726 100644 --- a/Projectiles/Rogue/ExecutionersBladeStealthProj.cs +++ b/Projectiles/Rogue/ExecutionersBladeStealthProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 3; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index eeb4b19c9c..3029ed2be5 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -1,8 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Rogue { public class ExorcismProj : ModProjectile @@ -94,15 +95,15 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.Center); projectile.Kill(); return true; } public override void Kill(int timeLeft) { - //Crystal smash sound - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + //Crystal smash sound + Main.PlaySound(SoundID.Item27, projectile.Center); // Light burst int p = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.8f), 0, projectile.owner, projectile.ai[0] - 1f, 0); Main.projectile[p].rotation = projectile.rotation; diff --git a/Projectiles/Rogue/ExorcismShockwave.cs b/Projectiles/Rogue/ExorcismShockwave.cs index 565f184725..a7211b83fc 100644 --- a/Projectiles/Rogue/ExorcismShockwave.cs +++ b/Projectiles/Rogue/ExorcismShockwave.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/ExorcismStar.cs b/Projectiles/Rogue/ExorcismStar.cs index b7a4454f5f..e3ff35b421 100644 --- a/Projectiles/Rogue/ExorcismStar.cs +++ b/Projectiles/Rogue/ExorcismStar.cs @@ -1,7 +1,8 @@ - + using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -35,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } } diff --git a/Projectiles/Rogue/ExplosiveSun.cs b/Projectiles/Rogue/ExplosiveSun.cs index 73f6c06918..b67b6fa54d 100644 --- a/Projectiles/Rogue/ExplosiveSun.cs +++ b/Projectiles/Rogue/ExplosiveSun.cs @@ -1,9 +1,9 @@ +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using CalamityMod.Buffs.DamageOverTime; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.Damage(); if (Main.rand.NextBool(3)) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14, 0.5f); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14, 0.5f); } for (int num621 = 0; num621 < 5; num621++) { diff --git a/Projectiles/Rogue/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs index 8c088e0300..003f9bf825 100644 --- a/Projectiles/Rogue/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/FinalDawnFireSlash.cs b/Projectiles/Rogue/FinalDawnFireSlash.cs index b3930b6fa6..18e059abb4 100644 --- a/Projectiles/Rogue/FinalDawnFireSlash.cs +++ b/Projectiles/Rogue/FinalDawnFireSlash.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; + if (player.dead || player is null || Main.myPlayer != projectile.owner) + projectile.Kill(); + player.direction = projectile.direction; player.heldProj = projectile.whoAmI; diff --git a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs index d7d6474030..5ed9d58eea 100644 --- a/Projectiles/Rogue/FinalDawnHorizontalSlash.cs +++ b/Projectiles/Rogue/FinalDawnHorizontalSlash.cs @@ -29,6 +29,10 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { Player player = Main.player[projectile.owner]; + + if (player.dead || player is null || Main.myPlayer != projectile.owner) + projectile.Kill(); + projectile.Center = player.Center; player.heldProj = projectile.whoAmI; projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); diff --git a/Projectiles/Rogue/FinalDawnProjectile.cs b/Projectiles/Rogue/FinalDawnProjectile.cs index c2f298dd27..a7e799af8d 100644 --- a/Projectiles/Rogue/FinalDawnProjectile.cs +++ b/Projectiles/Rogue/FinalDawnProjectile.cs @@ -30,6 +30,9 @@ namespace CalamityMod.Projectiles.Rogue { Player player = Main.player[projectile.owner]; + if (player.dead || player is null || Main.myPlayer != projectile.owner) + projectile.Kill(); + if (Main.myPlayer == player.whoAmI) { projectile.velocity = Main.MouseWorld - player.Center; diff --git a/Projectiles/Rogue/FinalDawnThrow.cs b/Projectiles/Rogue/FinalDawnThrow.cs index 04c7a8ceae..9151e544a7 100644 --- a/Projectiles/Rogue/FinalDawnThrow.cs +++ b/Projectiles/Rogue/FinalDawnThrow.cs @@ -33,12 +33,16 @@ namespace CalamityMod.Projectiles.Rogue } public override void AI() { + Player player = Main.player[projectile.owner]; + + if (player.dead || player is null || Main.myPlayer != projectile.owner) + projectile.Kill(); + if (projectile.localAI[0] == 0) { Main.PlaySound(SoundID.Item71, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] = 1; } - Player player = Main.player[projectile.owner]; projectile.spriteDirection = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation += 0.25f * projectile.direction; diff --git a/Projectiles/Rogue/FinalDawnThrow2.cs b/Projectiles/Rogue/FinalDawnThrow2.cs index cb1c736e3c..80aa357634 100644 --- a/Projectiles/Rogue/FinalDawnThrow2.cs +++ b/Projectiles/Rogue/FinalDawnThrow2.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; - + namespace CalamityMod.Projectiles.Rogue { - public class FinalDawnThrow2 : ModProjectile + public class FinalDawnThrow2 : ModProjectile { bool HasHitEnemy = false; public override void SetStaticDefaults() @@ -54,12 +53,16 @@ namespace CalamityMod.Projectiles.Rogue } public override void AI() { + Player player = Main.player[projectile.owner]; + + if (player.dead || player is null || Main.myPlayer != projectile.owner) + projectile.Kill(); + if (projectile.localAI[0] == 0) { Main.PlaySound(SoundID.Item71, projectile.position); projectile.localAI[0] = 1; } - Player player = Main.player[projectile.owner]; projectile.spriteDirection = projectile.velocity.X > 0 ? 1 : -1; projectile.rotation += 0.25f * projectile.direction; diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index faf5b1beba..c5392e9423 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/FrostShardFriendly.cs b/Projectiles/Rogue/FrostShardFriendly.cs index fd43227505..c48e26e7bd 100644 --- a/Projectiles/Rogue/FrostShardFriendly.cs +++ b/Projectiles/Rogue/FrostShardFriendly.cs @@ -67,7 +67,8 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item27, projectile.position); + if (projectile.ai[0] != 1f || Main.rand.NextBool(20)) + Main.PlaySound(SoundID.Item27, projectile.position); for (int index1 = 0; index1 < 3; ++index1) { int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 76); diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs index 86a4822802..a427357321 100644 --- a/Projectiles/Rogue/GacruxianHome.cs +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -1,14 +1,12 @@ using CalamityMod.Dusts; using CalamityMod.Projectiles.Melee; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class GacruxianHome : ModProjectile + public class GacruxianHome : ModProjectile { private int stealthTrailTimer = 10; diff --git a/Projectiles/Rogue/GelDartProjectile.cs b/Projectiles/Rogue/GelDartProjectile.cs index 802883ddcf..299cb380e0 100644 --- a/Projectiles/Rogue/GelDartProjectile.cs +++ b/Projectiles/Rogue/GelDartProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.velocity != oldVelocity) { projectile.velocity = Main.rand.NextFloat(-1.15f, -0.85f) * oldVelocity * 1.35f; - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 56); //minecart bumper sound + Main.PlaySound(SoundID.Item56, projectile.position); // Minecart bumper sound } } else diff --git a/Projectiles/Rogue/GhoulishGougerBoomerang.cs b/Projectiles/Rogue/GhoulishGougerBoomerang.cs index 1eae1dbc54..729d25a48e 100644 --- a/Projectiles/Rogue/GhoulishGougerBoomerang.cs +++ b/Projectiles/Rogue/GhoulishGougerBoomerang.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index a9e843003c..6832282326 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -1,13 +1,13 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { - public class GildedDaggerProj : ModProjectile + public class GildedDaggerProj : ModProjectile { private bool hasHitEnemy = false; private int targetNPC = -1; @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/GlaiveProj.cs b/Projectiles/Rogue/GlaiveProj.cs index 00ae018fff..e2a3d4a386 100644 --- a/Projectiles/Rogue/GlaiveProj.cs +++ b/Projectiles/Rogue/GlaiveProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index 4360d62c05..34771a7146 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -1,13 +1,13 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.Collections.Generic; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { - public class GleamingDaggerProj : ModProjectile + public class GleamingDaggerProj : ModProjectile { private bool hasHitEnemy = false; private int targetNPC = -1; @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/GodsParanoiaDart.cs b/Projectiles/Rogue/GodsParanoiaDart.cs index 8db253cfb5..c183d603df 100644 --- a/Projectiles/Rogue/GodsParanoiaDart.cs +++ b/Projectiles/Rogue/GodsParanoiaDart.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class GodsParanoiaDart : ModProjectile + public class GodsParanoiaDart : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 2a9df65f59..1cab7a319c 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -9,7 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class GodsParanoiaProj : ModProjectile + public class GodsParanoiaProj : ModProjectile { public int kunaiStabbing = 12; diff --git a/Projectiles/Rogue/GreenDonkeyKongReference.cs b/Projectiles/Rogue/GreenDonkeyKongReference.cs index 823eb0199d..2f77058a5e 100644 --- a/Projectiles/Rogue/GreenDonkeyKongReference.cs +++ b/Projectiles/Rogue/GreenDonkeyKongReference.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class GreenDonkeyKongReference : ModProjectile + public class GreenDonkeyKongReference : ModProjectile { public float cooldown = 0f; public float oldVelocityX = 0f; @@ -63,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue { bool stealthS = projectile.Calamity().stealthStrike; int projectileCount = 8; - Main.PlaySound(2, projectile.Center, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); if (stealthS) { projectileCount += 5; //more shit the closer we are to death diff --git a/Projectiles/Rogue/HeavenfallenEnergy.cs b/Projectiles/Rogue/HeavenfallenEnergy.cs index fedd5dce3b..e538815554 100644 --- a/Projectiles/Rogue/HeavenfallenEnergy.cs +++ b/Projectiles/Rogue/HeavenfallenEnergy.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index f9aa1d1df2..cfcb4c1237 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/HellsSunProj.cs b/Projectiles/Rogue/HellsSunProj.cs index 46594ae965..7b0eae84f3 100644 --- a/Projectiles/Rogue/HellsSunProj.cs +++ b/Projectiles/Rogue/HellsSunProj.cs @@ -1,15 +1,12 @@ -using System; using Terraria; -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria.ModLoader; -using CalamityMod.Projectiles.Typeless; using CalamityMod.CalPlayer; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class HellsSunProj : ModProjectile + public class HellsSunProj : ModProjectile { public override void SetStaticDefaults() diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs index f1bf30e1bd..375de85006 100644 --- a/Projectiles/Rogue/Honeycomb.cs +++ b/Projectiles/Rogue/Honeycomb.cs @@ -1,6 +1,5 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,7 +7,7 @@ using CalamityMod.Items.Weapons.Rogue; namespace CalamityMod.Projectiles.Rogue { - public class Honeycomb : ModProjectile + public class Honeycomb : ModProjectile { private const float radius = 15f; @@ -141,7 +140,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); + Main.PlaySound(SoundID.NPCDeath1, projectile.position); //Dust on impact int dust_splash = 0; while (dust_splash < 9) diff --git a/Projectiles/Rogue/HoneycombFragment.cs b/Projectiles/Rogue/HoneycombFragment.cs index 00f6d5121b..76793b5595 100644 --- a/Projectiles/Rogue/HoneycombFragment.cs +++ b/Projectiles/Rogue/HoneycombFragment.cs @@ -2,11 +2,10 @@ using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; namespace CalamityMod.Projectiles.Rogue { - public class HoneycombFragment : ModProjectile + public class HoneycombFragment : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index b65047b181..f52bc2a2b0 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -3,11 +3,10 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; namespace CalamityMod.Projectiles.Rogue { - public class HypothermiaChunk : ModProjectile + public class HypothermiaChunk : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/IceStarProjectile.cs b/Projectiles/Rogue/IceStarProjectile.cs index 2b9181510a..ed89e83139 100644 --- a/Projectiles/Rogue/IceStarProjectile.cs +++ b/Projectiles/Rogue/IceStarProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 638cd3ffbd..0f3852fee3 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -93,8 +93,9 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxPlayers; i++) { + Player owner = Main.player[projectile.owner]; Player player = Main.player[i]; - if ((Main.player[projectile.owner].team != player.team || player.team == 0) && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(projectile.Center, player.Center) <= radius) + if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(projectile.Center, player.Center) <= radius) { if (player.FindBuffIndex(buffType) == -1) player.AddBuff(buffType, 180, false); diff --git a/Projectiles/Rogue/IchorSpearProj.cs b/Projectiles/Rogue/IchorSpearProj.cs index a71171b3c5..aa53d53619 100644 --- a/Projectiles/Rogue/IchorSpearProj.cs +++ b/Projectiles/Rogue/IchorSpearProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/InfernalFireball.cs b/Projectiles/Rogue/InfernalFireball.cs index e8eafb6620..13d408154d 100644 --- a/Projectiles/Rogue/InfernalFireball.cs +++ b/Projectiles/Rogue/InfernalFireball.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - if (CalamityMod.CalamityConfig.Afterimages) + if (CalamityConfig.Instance.Afterimages) { for (int i = 0; i < projectile.oldPos.Length; i++) { diff --git a/Projectiles/Rogue/InfernalFireballEruption.cs b/Projectiles/Rogue/InfernalFireballEruption.cs index 0e2826378a..8ba12f9a3e 100644 --- a/Projectiles/Rogue/InfernalFireballEruption.cs +++ b/Projectiles/Rogue/InfernalFireballEruption.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14, 0.5f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14, 0.5f, 0f); projectile.position = projectile.Center; projectile.width = projectile.height = 144; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Rogue/InfernalKrisCinder.cs b/Projectiles/Rogue/InfernalKrisCinder.cs index 841488275a..dd57e95b48 100644 --- a/Projectiles/Rogue/InfernalKrisCinder.cs +++ b/Projectiles/Rogue/InfernalKrisCinder.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/InfernalKrisExplosion.cs b/Projectiles/Rogue/InfernalKrisExplosion.cs index b09ece65db..eaf64b8bd0 100644 --- a/Projectiles/Rogue/InfernalKrisExplosion.cs +++ b/Projectiles/Rogue/InfernalKrisExplosion.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 4b61e06f97..fe3c273a31 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); } Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); - Main.PlaySound(2, projectile.position, 74); + Main.PlaySound(SoundID.Item74, projectile.position); } } @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); } Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); - Main.PlaySound(2, projectile.position, 74); + Main.PlaySound(SoundID.Item74, projectile.position); } } @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Rogue } } - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Item74, projectile.position); projectile.Kill(); return false; } @@ -193,7 +193,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); } Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.4f), 0, projectile.owner, 0, 0); - Main.PlaySound(2, projectile.position, 74); + Main.PlaySound(SoundID.Item74, projectile.position); } } } diff --git a/Projectiles/Rogue/InfernalSpearProjectile.cs b/Projectiles/Rogue/InfernalSpearProjectile.cs index dabca0111b..a6fdd83cd6 100644 --- a/Projectiles/Rogue/InfernalSpearProjectile.cs +++ b/Projectiles/Rogue/InfernalSpearProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index e6822b154a..dcef0a1e9a 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -52,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue private void CreateInk() { Player player = Main.player[projectile.owner]; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int i = 0; i < 20; i++) { int projType = Main.rand.Next(0, 3); diff --git a/Projectiles/Rogue/InkCloud.cs b/Projectiles/Rogue/InkCloud.cs index 8695c1ff9d..639fb85145 100644 --- a/Projectiles/Rogue/InkCloud.cs +++ b/Projectiles/Rogue/InkCloud.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/InkCloud2.cs b/Projectiles/Rogue/InkCloud2.cs index 3355a4778f..fb36ca7334 100644 --- a/Projectiles/Rogue/InkCloud2.cs +++ b/Projectiles/Rogue/InkCloud2.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/InkCloud3.cs b/Projectiles/Rogue/InkCloud3.cs index 21f67db423..bb8d519e44 100644 --- a/Projectiles/Rogue/InkCloud3.cs +++ b/Projectiles/Rogue/InkCloud3.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/IronFranciscaProj.cs b/Projectiles/Rogue/IronFranciscaProj.cs index 8dfdb8f30b..d06cf86b74 100644 --- a/Projectiles/Rogue/IronFranciscaProj.cs +++ b/Projectiles/Rogue/IronFranciscaProj.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/JawsProjectile.cs b/Projectiles/Rogue/JawsProjectile.cs index 97bceff3e1..97a677283b 100644 --- a/Projectiles/Rogue/JawsProjectile.cs +++ b/Projectiles/Rogue/JawsProjectile.cs @@ -1,17 +1,15 @@ -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class JawsProjectile : ModProjectile + public class JawsProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -99,7 +97,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/JawsShockwave.cs b/Projectiles/Rogue/JawsShockwave.cs index 60e41af77f..10b2b5e885 100644 --- a/Projectiles/Rogue/JawsShockwave.cs +++ b/Projectiles/Rogue/JawsShockwave.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/JewelSpike.cs b/Projectiles/Rogue/JewelSpike.cs index ae26e5a0c6..eef21832c8 100644 --- a/Projectiles/Rogue/JewelSpike.cs +++ b/Projectiles/Rogue/JewelSpike.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/KylieBoomerang.cs b/Projectiles/Rogue/KylieBoomerang.cs index 645a6ec9c7..7263d41f16 100644 --- a/Projectiles/Rogue/KylieBoomerang.cs +++ b/Projectiles/Rogue/KylieBoomerang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using System; using Terraria; @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Rogue { //Bounce off tiles and start homing on player if it hits a tile Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); if (projectile.velocity.X != oldVelocity.X) { projectile.velocity.X = -oldVelocity.X; diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs index 360eb8cd87..ffbf73bc8b 100644 --- a/Projectiles/Rogue/LatcherMineProjectile.cs +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -1,14 +1,11 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LatcherMineProjectile : ModProjectile + public class LatcherMineProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -121,8 +118,9 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < Main.npc.Length; i++) { + // TODO -- replace the 318 here with whatever projectileID that is if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) @@ -202,7 +200,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, projectile.Center); projectile.position = projectile.Center; projectile.width = projectile.height = (projectile.Calamity().stealthStrike ? 240 : 100); projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Rogue/LeadTomahawkProj.cs b/Projectiles/Rogue/LeadTomahawkProj.cs index f0200a1e2d..0b75959f64 100644 --- a/Projectiles/Rogue/LeadTomahawkProj.cs +++ b/Projectiles/Rogue/LeadTomahawkProj.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/LeonidCometBig.cs b/Projectiles/Rogue/LeonidCometBig.cs index 346244dd41..a2109daa19 100644 --- a/Projectiles/Rogue/LeonidCometBig.cs +++ b/Projectiles/Rogue/LeonidCometBig.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -8,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LeonidCometBig : ModProjectile + public class LeonidCometBig : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index c3ec4a99e9..8e916906c0 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -4,14 +4,13 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LeonidProgenitorBombshell : ModProjectile + public class LeonidProgenitorBombshell : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/LeonidStar.cs b/Projectiles/Rogue/LeonidStar.cs index a601774acf..bf86eb0194 100644 --- a/Projectiles/Rogue/LeonidStar.cs +++ b/Projectiles/Rogue/LeonidStar.cs @@ -40,8 +40,13 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0]++; if (projectile.ai[0] > 120f) { - projectile.alpha -= 15; - if (projectile.alpha <= 0) + projectile.scale *= 0.98f; + projectile.position = projectile.Center; + projectile.width = (int)(projectile.width * projectile.scale); + projectile.height = (int)(projectile.height * projectile.scale); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + if (projectile.scale <= 0.05f) projectile.Kill(); } projectile.rotation += projectile.direction * 0.05f; diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index b57da30fe1..72eebe6551 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -1,15 +1,13 @@ -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LeviathanTooth : ModProjectile + public class LeviathanTooth : ModProjectile { public override void SetStaticDefaults() { @@ -83,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 28b76d92c0..237c3334f8 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 72; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 069cf54644..cb510d3ae1 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LostSoulFriendly : ModProjectile + public class LostSoulFriendly : ModProjectile { public override void SetStaticDefaults() { @@ -25,12 +24,14 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 1; projectile.timeLeft = 240; projectile.Calamity().rogue = true; + projectile.extraUpdates = 1; + projectile.alpha = 150; } public override void AI() { projectile.frameCounter++; - if (projectile.frameCounter > 4) + if (projectile.frameCounter > 8) { projectile.frame++; projectile.frameCounter = 0; @@ -47,13 +48,14 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 43); for (int j = 0; j <= 10; j++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); } } + public override Color? GetAlpha(Color lightColor) => new Color(150, 150, 150, 150); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Rogue/LuminousShard.cs b/Projectiles/Rogue/LuminousShard.cs index 4ca9b6a511..042fbcfec3 100644 --- a/Projectiles/Rogue/LuminousShard.cs +++ b/Projectiles/Rogue/LuminousShard.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; +using System; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class LuminousShard : ModProjectile + public class LuminousShard : ModProjectile { bool gravity = false; diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 96343e5dd8..4901678780 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -9,7 +8,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Rogue { - public class LuminousStrikerProj : ModProjectile + public class LuminousStrikerProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/LunarKunaiProj.cs b/Projectiles/Rogue/LunarKunaiProj.cs index 9408b4c5e6..1cff899d34 100644 --- a/Projectiles/Rogue/LunarKunaiProj.cs +++ b/Projectiles/Rogue/LunarKunaiProj.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -9,7 +8,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Rogue { - public class LunarKunaiProj : ModProjectile + public class LunarKunaiProj : ModProjectile { bool lunarEnhance = false; @@ -55,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue { if (lunarEnhance) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); projectile.position = projectile.Center; projectile.width = projectile.height = 28; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Rogue/LuxorsGiftRogue.cs b/Projectiles/Rogue/LuxorsGiftRogue.cs index 22fa047714..045a593822 100644 --- a/Projectiles/Rogue/LuxorsGiftRogue.cs +++ b/Projectiles/Rogue/LuxorsGiftRogue.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/MalachiteBolt.cs b/Projectiles/Rogue/MalachiteBolt.cs index 4133705f6f..ac0e718b95 100644 --- a/Projectiles/Rogue/MalachiteBolt.cs +++ b/Projectiles/Rogue/MalachiteBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/MalachiteProj.cs b/Projectiles/Rogue/MalachiteProj.cs index 2d12ee803e..9bcfb4aa6e 100644 --- a/Projectiles/Rogue/MalachiteProj.cs +++ b/Projectiles/Rogue/MalachiteProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/MetalChunk.cs b/Projectiles/Rogue/MetalChunk.cs index d38844aedf..a8f4cf8e4c 100644 --- a/Projectiles/Rogue/MetalChunk.cs +++ b/Projectiles/Rogue/MetalChunk.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; diff --git a/Projectiles/Rogue/MetalShard.cs b/Projectiles/Rogue/MetalShard.cs index dd4a9a59e8..c497aa702c 100644 --- a/Projectiles/Rogue/MetalShard.cs +++ b/Projectiles/Rogue/MetalShard.cs @@ -1,14 +1,13 @@ - + using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; -using System; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue { - public class MetalShard : ModProjectile + public class MetalShard : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index f97b62824a..6b32988f1a 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 40; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Rogue/MoltenAmputatorProj.cs b/Projectiles/Rogue/MoltenAmputatorProj.cs index f6b823de35..47995b561b 100644 --- a/Projectiles/Rogue/MoltenAmputatorProj.cs +++ b/Projectiles/Rogue/MoltenAmputatorProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue { fireInTheBlob(projectile.Calamity().stealthStrike ? Main.rand.Next(3, 5) : Main.rand.Next(1, 3)); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Rogue { fireInTheBlob(projectile.Calamity().stealthStrike ? Main.rand.Next(3, 5) : Main.rand.Next(1, 3)); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/MoltenBlobThrown.cs b/Projectiles/Rogue/MoltenBlobThrown.cs index 05e337d493..bbd1a40ca0 100644 --- a/Projectiles/Rogue/MoltenBlobThrown.cs +++ b/Projectiles/Rogue/MoltenBlobThrown.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -66,7 +67,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 10; diff --git a/Projectiles/Rogue/MonkeyDart.cs b/Projectiles/Rogue/MonkeyDart.cs index 947417084e..b603cf425a 100644 --- a/Projectiles/Rogue/MonkeyDart.cs +++ b/Projectiles/Rogue/MonkeyDart.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y); + Main.PlaySound(SoundID.Dig, projectile.position); //Dust splash int dustsplash = 0; while (dustsplash < 4) @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Rogue { //Code for bouncing Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); if (projectile.velocity.X != oldVelocity.X) { projectile.velocity.X = -oldVelocity.X; diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs index b60308be26..8011116e47 100644 --- a/Projectiles/Rogue/MoonSigil.cs +++ b/Projectiles/Rogue/MoonSigil.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class MoonSigil : ModProjectile + public class MoonSigil : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/MycorootProj.cs b/Projectiles/Rogue/MycorootProj.cs index efe3933d3c..d429476e14 100644 --- a/Projectiles/Rogue/MycorootProj.cs +++ b/Projectiles/Rogue/MycorootProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/MythrilKnifeProjectile.cs b/Projectiles/Rogue/MythrilKnifeProjectile.cs index 76e38e5a82..df31e12117 100644 --- a/Projectiles/Rogue/MythrilKnifeProjectile.cs +++ b/Projectiles/Rogue/MythrilKnifeProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; diff --git a/Projectiles/Rogue/NastyChollaBol.cs b/Projectiles/Rogue/NastyChollaBol.cs index 0a25dad545..e40b858041 100644 --- a/Projectiles/Rogue/NastyChollaBol.cs +++ b/Projectiles/Rogue/NastyChollaBol.cs @@ -1,12 +1,11 @@ using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class NastyChollaBol : ModProjectile + public class NastyChollaBol : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/NastyChollaNeedle.cs b/Projectiles/Rogue/NastyChollaNeedle.cs index 9c9bef00b1..7842d97452 100644 --- a/Projectiles/Rogue/NastyChollaNeedle.cs +++ b/Projectiles/Rogue/NastyChollaNeedle.cs @@ -1,13 +1,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue { - public class NastyChollaNeedle : ModProjectile + public class NastyChollaNeedle : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/NightsGazeProjectile.cs b/Projectiles/Rogue/NightsGazeProjectile.cs index eb5b37206e..61af3eff00 100644 --- a/Projectiles/Rogue/NightsGazeProjectile.cs +++ b/Projectiles/Rogue/NightsGazeProjectile.cs @@ -70,9 +70,9 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, velocity * speed, projectileType, projectileDamage, 5f, projectile.owner, 0f, moveDuration); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -97,15 +97,15 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.Center, velocity * speed, projectileType, projectileDamage, 5f, projectile.owner, 0f, moveDuration); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 62, 0.6f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 68, 0.2f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 122, 0.4f); } public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/NightsGazeStar.cs b/Projectiles/Rogue/NightsGazeStar.cs index ed77c8d2ff..13f2cfa801 100644 --- a/Projectiles/Rogue/NightsGazeStar.cs +++ b/Projectiles/Rogue/NightsGazeStar.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } } diff --git a/Projectiles/Rogue/NychthemeronProjectile.cs b/Projectiles/Rogue/NychthemeronProjectile.cs index bfaa6e74f4..4c1bf56c47 100644 --- a/Projectiles/Rogue/NychthemeronProjectile.cs +++ b/Projectiles/Rogue/NychthemeronProjectile.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Projectiles.Rogue { @@ -70,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); float minScale = 0.9f; float maxScale = 1.1f; diff --git a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs index 27243954bc..ca65813395 100644 --- a/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs +++ b/Projectiles/Rogue/OrichalcumSpikedGemstoneProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.velocity.Y != velocity.Y && (velocity.Y < -3f || velocity.Y > 3f)) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.Center.X, (int)projectile.Center.Y, 1); + Main.PlaySound(SoundID.Dig, projectile.Center); } if (projectile.velocity.X != velocity.X) { diff --git a/Projectiles/Rogue/PalladiumJavelinProjectile.cs b/Projectiles/Rogue/PalladiumJavelinProjectile.cs index 2b23890cda..a5ef1bc4fa 100644 --- a/Projectiles/Rogue/PalladiumJavelinProjectile.cs +++ b/Projectiles/Rogue/PalladiumJavelinProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/PartisanExplosion.cs b/Projectiles/Rogue/PartisanExplosion.cs index fb25ff52a8..34a94d9c83 100644 --- a/Projectiles/Rogue/PartisanExplosion.cs +++ b/Projectiles/Rogue/PartisanExplosion.cs @@ -1,12 +1,11 @@ -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class PartisanExplosion : ModProjectile + public class PartisanExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/PenumbraBomb.cs b/Projectiles/Rogue/PenumbraBomb.cs index 93b0785dc0..dfd806d74b 100644 --- a/Projectiles/Rogue/PenumbraBomb.cs +++ b/Projectiles/Rogue/PenumbraBomb.cs @@ -1,13 +1,12 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using CalamityMod.Projectiles.Melee; namespace CalamityMod.Projectiles.Rogue { - public class PenumbraBomb : ModProjectile + public class PenumbraBomb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index ce7b0f3c88..1d9c5b7aa4 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/PhantasmalRuinGhost.cs b/Projectiles/Rogue/PhantasmalRuinGhost.cs index 87a20a8a60..c1f640c736 100644 --- a/Projectiles/Rogue/PhantasmalRuinGhost.cs +++ b/Projectiles/Rogue/PhantasmalRuinGhost.cs @@ -1,14 +1,12 @@ -using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PhantasmalRuinGhost : ModProjectile + public class PhantasmalRuinGhost : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/PhantasmalRuinProj.cs b/Projectiles/Rogue/PhantasmalRuinProj.cs index 5ff968f089..c5abeb7eb9 100644 --- a/Projectiles/Rogue/PhantasmalRuinProj.cs +++ b/Projectiles/Rogue/PhantasmalRuinProj.cs @@ -1,4 +1,3 @@ -using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PhantasmalRuinProj : ModProjectile + public class PhantasmalRuinProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/PhantasmalSoul.cs b/Projectiles/Rogue/PhantasmalSoul.cs index 692c26b81c..15696f1831 100644 --- a/Projectiles/Rogue/PhantasmalSoul.cs +++ b/Projectiles/Rogue/PhantasmalSoul.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -7,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PhantasmalSoul : ModProjectile + public class PhantasmalSoul : ModProjectile { private int originDamage; private int divider = 10; @@ -142,8 +141,8 @@ namespace CalamityMod.Projectiles.Rogue } if (Main.rand.NextBool(6)) { - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 39, 1f, 0f); - } + Main.PlaySound(SoundID.NPCDeath39, projectile.position); + } } // Cannot deal damage for the first several frames of existence. diff --git a/Projectiles/Rogue/PlaguedFuelPackCloud.cs b/Projectiles/Rogue/PlaguedFuelPackCloud.cs index 5097d841f6..f81a17753e 100644 --- a/Projectiles/Rogue/PlaguedFuelPackCloud.cs +++ b/Projectiles/Rogue/PlaguedFuelPackCloud.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace CalamityMod.Projectiles.Rogue { - public class PlaguedFuelPackCloud : ModProjectile + public class PlaguedFuelPackCloud : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/PlaguenadeBee.cs b/Projectiles/Rogue/PlaguenadeBee.cs index 1eb275eb94..f08bcae8a1 100644 --- a/Projectiles/Rogue/PlaguenadeBee.cs +++ b/Projectiles/Rogue/PlaguenadeBee.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index c57af6db44..904eaf1d33 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -78,8 +79,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(projectile.position.X, projectile.position.Y, speedX, speedY, ModContent.ProjectileType(), Main.player[projectile.owner].beeDamage(projectile.damage), Main.player[projectile.owner].beeKB(0f), Main.myPlayer, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - if (projectile.Calamity().stealthStrike) + Main.PlaySound(SoundID.Item14, projectile.position); + if (projectile.Calamity().stealthStrike) { projectile.position = projectile.Center; projectile.width = projectile.height = 75; diff --git a/Projectiles/Rogue/Prismalline2.cs b/Projectiles/Rogue/Prismalline2.cs index 3bfd414c05..a9e4662186 100644 --- a/Projectiles/Rogue/Prismalline2.cs +++ b/Projectiles/Rogue/Prismalline2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/Prismalline3.cs b/Projectiles/Rogue/Prismalline3.cs index 1a36b0f7d2..1c4eeb32e2 100644 --- a/Projectiles/Rogue/Prismalline3.cs +++ b/Projectiles/Rogue/Prismalline3.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/PrismallineProj.cs b/Projectiles/Rogue/PrismallineProj.cs index 35b1aeb0e2..280539286c 100644 --- a/Projectiles/Rogue/PrismallineProj.cs +++ b/Projectiles/Rogue/PrismallineProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -107,9 +107,9 @@ namespace CalamityMod.Projectiles.Rogue } public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); - for (int k = 0; k < 5; k++) + { + Main.PlaySound(SoundID.Item27, projectile.position); + for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 154, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); } diff --git a/Projectiles/Rogue/ProfanedPartisanproj.cs b/Projectiles/Rogue/ProfanedPartisanproj.cs index aec928321c..992f348aa5 100644 --- a/Projectiles/Rogue/ProfanedPartisanproj.cs +++ b/Projectiles/Rogue/ProfanedPartisanproj.cs @@ -1,14 +1,13 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class ProfanedPartisanproj : ModProjectile + public class ProfanedPartisanproj : ModProjectile { public int stealthStrikeTimer = 0; @@ -93,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 50, default(Color), 2.6f); } - Main.PlaySound(2, projectile.position, 45); + Main.PlaySound(SoundID.Item45, projectile.position); Vector2 explode = new Vector2(0f, 0f); Projectile.NewProjectile(projectile.Center, explode, ModContent.ProjectileType(), projectile.damage/2, projectile.knockBack * 1.3f, projectile.owner); } diff --git a/Projectiles/Rogue/ProfanedPartisanspear.cs b/Projectiles/Rogue/ProfanedPartisanspear.cs index 44f713f455..d69ca6b7e3 100644 --- a/Projectiles/Rogue/ProfanedPartisanspear.cs +++ b/Projectiles/Rogue/ProfanedPartisanspear.cs @@ -1,14 +1,12 @@ -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class ProfanedPartisanspear : ModProjectile + public class ProfanedPartisanspear : ModProjectile { public int timer = 0; diff --git a/Projectiles/Rogue/Quasar2.cs b/Projectiles/Rogue/Quasar2.cs index 4d8b87ad05..fc219c5d6f 100644 --- a/Projectiles/Rogue/Quasar2.cs +++ b/Projectiles/Rogue/Quasar2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; diff --git a/Projectiles/Rogue/QuasarKnife.cs b/Projectiles/Rogue/QuasarKnife.cs index a23f7dd363..d6b214fab5 100644 --- a/Projectiles/Rogue/QuasarKnife.cs +++ b/Projectiles/Rogue/QuasarKnife.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[knife].timeLeft = 120; } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); projectile.active = false; } @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/RadiantExplosion.cs b/Projectiles/Rogue/RadiantExplosion.cs index 76fac37912..4099775005 100644 --- a/Projectiles/Rogue/RadiantExplosion.cs +++ b/Projectiles/Rogue/RadiantExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Projectiles.Ranged; diff --git a/Projectiles/Rogue/RadiantStar2.cs b/Projectiles/Rogue/RadiantStar2.cs index 9bf3f81f5a..e161cf92fd 100644 --- a/Projectiles/Rogue/RadiantStar2.cs +++ b/Projectiles/Rogue/RadiantStar2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; diff --git a/Projectiles/Rogue/RadiantStarKnife.cs b/Projectiles/Rogue/RadiantStarKnife.cs index a8b48b7ae7..1a3d5b515e 100644 --- a/Projectiles/Rogue/RadiantStarKnife.cs +++ b/Projectiles/Rogue/RadiantStarKnife.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] == 1f ? 1f : 0f, 0f); Main.projectile[stabber2].Calamity().stealthStrike = projectile.Calamity().stealthStrike; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int boomer = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.75f), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[boomer].Calamity().stealthStrike = projectile.Calamity().stealthStrike; if (projectile.Calamity().stealthStrike) @@ -123,7 +123,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 93ab84cc8c..d58a4244c1 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ReaperProjectile : ModProjectile + public class ReaperProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -153,7 +152,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 100; diff --git a/Projectiles/Rogue/RegulusEnergy.cs b/Projectiles/Rogue/RegulusEnergy.cs index 5aed541a88..082a1c488b 100644 --- a/Projectiles/Rogue/RegulusEnergy.cs +++ b/Projectiles/Rogue/RegulusEnergy.cs @@ -1,15 +1,12 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class RegulusEnergy : ModProjectile + public class RegulusEnergy : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/RotBallProjectile.cs b/Projectiles/Rogue/RotBallProjectile.cs index 8e35b70f23..d9e11daa8f 100644 --- a/Projectiles/Rogue/RotBallProjectile.cs +++ b/Projectiles/Rogue/RotBallProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/SandDollarProj.cs b/Projectiles/Rogue/SandDollarProj.cs index f5d2ec5048..5f2f5ce92f 100644 --- a/Projectiles/Rogue/SandDollarProj.cs +++ b/Projectiles/Rogue/SandDollarProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/SandDollarStealth.cs b/Projectiles/Rogue/SandDollarStealth.cs index 7eb1499c78..d92e588b1d 100644 --- a/Projectiles/Rogue/SandDollarStealth.cs +++ b/Projectiles/Rogue/SandDollarStealth.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/SandslasherProj.cs b/Projectiles/Rogue/SandslasherProj.cs index 2eacb292f5..289d265cd0 100644 --- a/Projectiles/Rogue/SandslasherProj.cs +++ b/Projectiles/Rogue/SandslasherProj.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -8,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class SandslasherProj : ModProjectile + public class SandslasherProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ScarletBlast.cs b/Projectiles/Rogue/ScarletBlast.cs index 66a66e47e6..ef6c1943bb 100644 --- a/Projectiles/Rogue/ScarletBlast.cs +++ b/Projectiles/Rogue/ScarletBlast.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -30,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(projectile.Center, 0.55f, 0.25f, 0f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Rogue/ScarletDevilBullet.cs b/Projectiles/Rogue/ScarletDevilBullet.cs index 9d21e151bf..c896663b37 100644 --- a/Projectiles/Rogue/ScarletDevilBullet.cs +++ b/Projectiles/Rogue/ScarletDevilBullet.cs @@ -1,10 +1,9 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ScarletDevilBullet : ModProjectile + public class ScarletDevilBullet : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 104c5466d0..4c03adf672 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); - if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike) + if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index ab85cbb7e8..58bb1eeed1 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs index 2c35249d53..f2563bde7e 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int dustIndex = 0; dustIndex < 8; dustIndex++) { int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Rogue/SeafoamBombProj.cs b/Projectiles/Rogue/SeafoamBombProj.cs index f34983bc94..5faa863b09 100644 --- a/Projectiles/Rogue/SeafoamBombProj.cs +++ b/Projectiles/Rogue/SeafoamBombProj.cs @@ -1,9 +1,9 @@ -using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class SeafoamBombProj : ModProjectile + public class SeafoamBombProj : ModProjectile { public override void SetStaticDefaults() { @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.Center); for (int i = 0; i < (projectile.Calamity().stealthStrike ? 5 : 1); i++) { diff --git a/Projectiles/Rogue/SeafoamBubble.cs b/Projectiles/Rogue/SeafoamBubble.cs index df67dceecf..27d2607c8e 100644 --- a/Projectiles/Rogue/SeafoamBubble.cs +++ b/Projectiles/Rogue/SeafoamBubble.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/SealedSingularityBlackhole.cs b/Projectiles/Rogue/SealedSingularityBlackhole.cs index 6239e3f145..6f23733ccd 100644 --- a/Projectiles/Rogue/SealedSingularityBlackhole.cs +++ b/Projectiles/Rogue/SealedSingularityBlackhole.cs @@ -1,15 +1,13 @@ using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class SealedSingularityBlackhole : ModProjectile + public class SealedSingularityBlackhole : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/SealedSingularityGore.cs b/Projectiles/Rogue/SealedSingularityGore.cs index 1dad8cd775..5b1f906bc4 100644 --- a/Projectiles/Rogue/SealedSingularityGore.cs +++ b/Projectiles/Rogue/SealedSingularityGore.cs @@ -14,21 +14,20 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { projectile.friendly = true; - projectile.width = 25; - projectile.height = 25; + projectile.width = projectile.height = 25; projectile.Calamity().rogue = true; + projectile.timeLeft = 300; } public override void AI() { //Rotation and gravity projectile.rotation += 0.6f * projectile.direction; - projectile.velocity.Y = projectile.velocity.Y + 0.27f; + projectile.velocity.Y += 0.27f; if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; } - } public override void Kill(int timeLeft) @@ -48,10 +47,9 @@ namespace CalamityMod.Projectiles.Rogue Texture2D texture; switch (projectile.ai[0]) { - - case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore2"); + case 1f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore2"); break; - case 3f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore3"); + case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore3"); break; default: texture = Main.projectileTexture[projectile.type]; break; diff --git a/Projectiles/Rogue/SealedSingularityProj.cs b/Projectiles/Rogue/SealedSingularityProj.cs index c085fe1261..7c405c617d 100644 --- a/Projectiles/Rogue/SealedSingularityProj.cs +++ b/Projectiles/Rogue/SealedSingularityProj.cs @@ -1,15 +1,10 @@ -using System; using Terraria; -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria.ModLoader; -using CalamityMod.Projectiles.Typeless; -using CalamityMod.CalPlayer; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class SealedSingularityProj : ModProjectile + public class SealedSingularityProj : ModProjectile { public override string Texture => "CalamityMod/Items/Weapons/Rogue/SealedSingularity"; diff --git a/Projectiles/Rogue/ShadowBlackhole.cs b/Projectiles/Rogue/ShadowBlackhole.cs index adee13f4bf..e514896ada 100644 --- a/Projectiles/Rogue/ShadowBlackhole.cs +++ b/Projectiles/Rogue/ShadowBlackhole.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ShadowBlackhole : ModProjectile + public class ShadowBlackhole : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ShatteredExplosion.cs b/Projectiles/Rogue/ShatteredExplosion.cs index a8f40ad148..bfcf956607 100644 --- a/Projectiles/Rogue/ShatteredExplosion.cs +++ b/Projectiles/Rogue/ShatteredExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index 4071598e2d..c61db514c9 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[proj].Calamity().stealthStrike = projectile.Calamity().stealthStrike; spread -= Main.rand.Next(2, 6); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); projectile.active = false; for (int num621 = 0; num621 < 8; num621++) { @@ -95,25 +95,25 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int) ((double) damage * 0.15), projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); } public override void OnHitPvp(Player target, int damage, bool crit) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)damage * 0.15), projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); } public override bool OnTileCollide(Vector2 oldVelocity) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.15), projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); return true; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 688957ea94..6227275058 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -183,8 +183,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 200; diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index af1ab201fa..dbbbb3c1d5 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -1,14 +1,13 @@ using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ShinobiBladeProjectile : ModProjectile + public class ShinobiBladeProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -42,7 +41,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/ShockGrenadeBolt.cs b/Projectiles/Rogue/ShockGrenadeBolt.cs index 37b47c3a44..218514c34c 100644 --- a/Projectiles/Rogue/ShockGrenadeBolt.cs +++ b/Projectiles/Rogue/ShockGrenadeBolt.cs @@ -1,17 +1,13 @@ -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ShockGrenadeBolt : ModProjectile + public class ShockGrenadeBolt : ModProjectile { public static int frameWidth = 12; public static int frameHeight = 26; @@ -113,7 +109,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.25f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.25f, 0f); for (int i = 0; i < 5; i++) { diff --git a/Projectiles/Rogue/ShockGrenadeExplosion.cs b/Projectiles/Rogue/ShockGrenadeExplosion.cs index 1ff1ac7f1d..ca46d9e5fe 100644 --- a/Projectiles/Rogue/ShockGrenadeExplosion.cs +++ b/Projectiles/Rogue/ShockGrenadeExplosion.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ShockGrenadeExplosion : ModProjectile + public class ShockGrenadeExplosion : ModProjectile { private const float radius = 100f; diff --git a/Projectiles/Rogue/ShockGrenadeProjectile.cs b/Projectiles/Rogue/ShockGrenadeProjectile.cs index c258d532a1..5f5369025f 100644 --- a/Projectiles/Rogue/ShockGrenadeProjectile.cs +++ b/Projectiles/Rogue/ShockGrenadeProjectile.cs @@ -1,8 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -88,7 +85,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 94, 0.75f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 94, 0.75f, 0f); int boltCount = Main.rand.Next(5, 11); for (int i = 0; i < boltCount; i++) @@ -125,7 +122,7 @@ namespace CalamityMod.Projectiles.Rogue int auraDamage = projectile.damage / 4; Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), auraDamage, 1, projectile.owner, 0, 0); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.5f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 93, 0.5f, 0f); } Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 3, projectile.owner, 0, 0); } diff --git a/Projectiles/Rogue/ShockTeslaAura.cs b/Projectiles/Rogue/ShockTeslaAura.cs index 120724c3b2..d853466fba 100644 --- a/Projectiles/Rogue/ShockTeslaAura.cs +++ b/Projectiles/Rogue/ShockTeslaAura.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/ShroomerangSpore.cs b/Projectiles/Rogue/ShroomerangSpore.cs index 0f95816462..66cf5ec7b6 100644 --- a/Projectiles/Rogue/ShroomerangSpore.cs +++ b/Projectiles/Rogue/ShroomerangSpore.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ShroomerangSpore : ModProjectile + public class ShroomerangSpore : ModProjectile { private int scaleFactor = 0; private bool initialized = false; diff --git a/Projectiles/Rogue/SkyBomberGas.cs b/Projectiles/Rogue/SkyBomberGas.cs index 929298a464..379d6623b5 100644 --- a/Projectiles/Rogue/SkyBomberGas.cs +++ b/Projectiles/Rogue/SkyBomberGas.cs @@ -1,12 +1,11 @@ using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Dusts; using CalamityMod.Buffs.StatDebuffs; namespace CalamityMod.Projectiles.Rogue { - public class SkyBomberGas : ModProjectile + public class SkyBomberGas : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/SkyStabberProj.cs b/Projectiles/Rogue/SkyStabberProj.cs index 29bf4dc1e3..20df737d5f 100644 --- a/Projectiles/Rogue/SkyStabberProj.cs +++ b/Projectiles/Rogue/SkyStabberProj.cs @@ -1,6 +1,5 @@ -using System; +using System; using Terraria; -using Terraria.ID; using Microsoft.Xna.Framework; using Terraria.ModLoader; using CalamityMod.Projectiles.Typeless; @@ -8,7 +7,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Rogue { - public class SkyStabberProj : ModProjectile + public class SkyStabberProj : ModProjectile { private static int Lifetime = 1200; diff --git a/Projectiles/Rogue/SkyfinNuke.cs b/Projectiles/Rogue/SkyfinNuke.cs index 19a76e6d64..b0a90ee668 100644 --- a/Projectiles/Rogue/SkyfinNuke.cs +++ b/Projectiles/Rogue/SkyfinNuke.cs @@ -1,15 +1,13 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.World.Generation; namespace CalamityMod.Projectiles.Rogue { - public class SkyfinNuke : ModProjectile + public class SkyfinNuke : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index 03447e0bfa..279e0b333b 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/SludgeSplotchProj1.cs b/Projectiles/Rogue/SludgeSplotchProj1.cs index eec4f79aa1..ed1b70f1d2 100644 --- a/Projectiles/Rogue/SludgeSplotchProj1.cs +++ b/Projectiles/Rogue/SludgeSplotchProj1.cs @@ -1,14 +1,12 @@ -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.Rogue { - public class SludgeSplotchProj1 : ModProjectile + public class SludgeSplotchProj1 : ModProjectile { public override void SetStaticDefaults() { @@ -77,8 +75,8 @@ namespace CalamityMod.Projectiles.Rogue } Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); + Main.PlaySound(SoundID.Dig, projectile.position); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); projectile.Kill(); return false; } @@ -93,13 +91,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.Slow, 240); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(BuffID.Slow, 240); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 9, 2, 0); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/SludgeSplotchProj2.cs b/Projectiles/Rogue/SludgeSplotchProj2.cs index aa1eef6a54..69e0e6b79d 100644 --- a/Projectiles/Rogue/SludgeSplotchProj2.cs +++ b/Projectiles/Rogue/SludgeSplotchProj2.cs @@ -1,14 +1,12 @@ -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.Rogue { - public class SludgeSplotchProj2 : ModProjectile + public class SludgeSplotchProj2 : ModProjectile { public override void SetStaticDefaults() { @@ -46,8 +44,8 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 28, 0.3f, 0); + Main.PlaySound(SoundID.Dig, projectile.position); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.position.X, (int)projectile.position.Y, 28, 0.3f, 0); projectile.Kill(); return false; } diff --git a/Projectiles/Rogue/SnapClamProj.cs b/Projectiles/Rogue/SnapClamProj.cs index 6ec23fb9d6..1a50dbc8f0 100644 --- a/Projectiles/Rogue/SnapClamProj.cs +++ b/Projectiles/Rogue/SnapClamProj.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -76,7 +77,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 13; diff --git a/Projectiles/Rogue/SnapClamStealth.cs b/Projectiles/Rogue/SnapClamStealth.cs index d9abdaa989..c7b893f59c 100644 --- a/Projectiles/Rogue/SnapClamStealth.cs +++ b/Projectiles/Rogue/SnapClamStealth.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -80,7 +81,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 13; diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 14da5b83bd..685c5a4dc3 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Rogue/SpearofPaleolithProj.cs b/Projectiles/Rogue/SpearofPaleolithProj.cs index 346463ddb8..c7a80c8a2f 100644 --- a/Projectiles/Rogue/SpearofPaleolithProj.cs +++ b/Projectiles/Rogue/SpearofPaleolithProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/SpentFuelContainerProjectile.cs b/Projectiles/Rogue/SpentFuelContainerProjectile.cs index 7ae1cdaeee..fa7b73db3e 100644 --- a/Projectiles/Rogue/SpentFuelContainerProjectile.cs +++ b/Projectiles/Rogue/SpentFuelContainerProjectile.cs @@ -1,5 +1,4 @@ -using CalamityMod.Dusts; -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -8,7 +7,7 @@ using Terraria.World.Generation; namespace CalamityMod.Projectiles.Rogue { - public class SpentFuelContainerProjectile : ModProjectile + public class SpentFuelContainerProjectile : ModProjectile { public override string Texture => "CalamityMod/Items/Weapons/Rogue/SpentFuelContainer"; diff --git a/Projectiles/Rogue/SphereBladed.cs b/Projectiles/Rogue/SphereBladed.cs index 32c85f80c0..4845cc80a0 100644 --- a/Projectiles/Rogue/SphereBladed.cs +++ b/Projectiles/Rogue/SphereBladed.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + Main.PlaySound(SoundID.NPCHit34, projectile.position); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/SphereBlue.cs b/Projectiles/Rogue/SphereBlue.cs index 7448e97c94..071e99e826 100644 --- a/Projectiles/Rogue/SphereBlue.cs +++ b/Projectiles/Rogue/SphereBlue.cs @@ -3,10 +3,9 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; namespace CalamityMod.Projectiles.Rogue { - public class SphereBlue : ModProjectile + public class SphereBlue : ModProjectile { public override void SetStaticDefaults() { @@ -56,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 37); + Main.PlaySound(SoundID.NPCDeath37, projectile.position); for (int num625 = 0; num625 < 3; num625++) { float scaleFactor10 = 0.33f; diff --git a/Projectiles/Rogue/SphereSpiked.cs b/Projectiles/Rogue/SphereSpiked.cs index 7808ab9153..f49ed67b44 100644 --- a/Projectiles/Rogue/SphereSpiked.cs +++ b/Projectiles/Rogue/SphereSpiked.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + Main.PlaySound(SoundID.NPCHit34, projectile.position); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/SphereYellow.cs b/Projectiles/Rogue/SphereYellow.cs index 9ef1d54930..b6995efcd1 100644 --- a/Projectiles/Rogue/SphereYellow.cs +++ b/Projectiles/Rogue/SphereYellow.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34); + Main.PlaySound(SoundID.NPCHit34, projectile.position); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/StellarKnifeProj.cs b/Projectiles/Rogue/StellarKnifeProj.cs index c5eebf5606..23ee2f5efa 100644 --- a/Projectiles/Rogue/StellarKnifeProj.cs +++ b/Projectiles/Rogue/StellarKnifeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index 543ee8489d..047cbe81ff 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class StickyBol : ModProjectile + public class StickyBol : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/StormfrontRazorProjectile.cs b/Projectiles/Rogue/StormfrontRazorProjectile.cs index 88d66c8908..265d0021e4 100644 --- a/Projectiles/Rogue/StormfrontRazorProjectile.cs +++ b/Projectiles/Rogue/StormfrontRazorProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); return true; } diff --git a/Projectiles/Rogue/Stormfrontspark.cs b/Projectiles/Rogue/Stormfrontspark.cs index c169a3b711..f108f67a61 100644 --- a/Projectiles/Rogue/Stormfrontspark.cs +++ b/Projectiles/Rogue/Stormfrontspark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue diff --git a/Projectiles/Rogue/SulphuricNukesplosion.cs b/Projectiles/Rogue/SulphuricNukesplosion.cs index 7299485a6e..446aeae4fd 100644 --- a/Projectiles/Rogue/SulphuricNukesplosion.cs +++ b/Projectiles/Rogue/SulphuricNukesplosion.cs @@ -1,5 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; -using Terraria.ID; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -9,7 +8,7 @@ using CalamityMod.Dusts; namespace CalamityMod.Projectiles.Rogue { - public class SulphuricNukesplosion : ModProjectile + public class SulphuricNukesplosion : ModProjectile { public int frameX = 0; public int frameY = 0; diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 47aa2b6774..09f49bc211 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); - //spawn projectiles + //spawn projectiles int num251 = Main.rand.Next(3, 5); if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs index 16123f4924..6af43f0920 100644 --- a/Projectiles/Rogue/SupernovaBoom.cs +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs index e3daa514b1..98c15fc61a 100644 --- a/Projectiles/Rogue/SupernovaHoming.cs +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -1,6 +1,4 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +7,7 @@ using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class SupernovaHoming : ModProjectile + public class SupernovaHoming : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs index b0bc23a851..512e8781ab 100644 --- a/Projectiles/Rogue/SupernovaSpike.cs +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Rogue/SupernovaSpike.png b/Projectiles/Rogue/SupernovaSpike.png index 586b8e6639..156ae21160 100644 Binary files a/Projectiles/Rogue/SupernovaSpike.png and b/Projectiles/Rogue/SupernovaSpike.png differ diff --git a/Projectiles/Rogue/SylvanSlash.cs b/Projectiles/Rogue/SylvanSlash.cs index 0961220586..b4ee547382 100644 --- a/Projectiles/Rogue/SylvanSlash.cs +++ b/Projectiles/Rogue/SylvanSlash.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class SylvanSlash : ModProjectile + public class SylvanSlash : ModProjectile { public override void SetStaticDefaults() { @@ -36,7 +35,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 92); + Main.PlaySound(SoundID.Item92, projectile.position); projectile.localAI[0] += 1f; } Lighting.AddLight(projectile.Center, 0.1f, 1f, 2f); diff --git a/Projectiles/Rogue/TalonLargeProj.cs b/Projectiles/Rogue/TalonLargeProj.cs index 69cee8ed1b..33802c7687 100644 --- a/Projectiles/Rogue/TalonLargeProj.cs +++ b/Projectiles/Rogue/TalonLargeProj.cs @@ -1,13 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TalonLargeProj : ModProjectile + public class TalonLargeProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TarraThornRight.cs b/Projectiles/Rogue/TarraThornRight.cs index e49b640379..ebbd9cc68a 100644 --- a/Projectiles/Rogue/TarraThornRight.cs +++ b/Projectiles/Rogue/TarraThornRight.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TarraThornRight : ModProjectile + public class TarraThornRight : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TarraThornTip.cs b/Projectiles/Rogue/TarraThornTip.cs index f76f80d293..22d3cdb81c 100644 --- a/Projectiles/Rogue/TarraThornTip.cs +++ b/Projectiles/Rogue/TarraThornTip.cs @@ -1,9 +1,8 @@ -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TarraThornTip : ModProjectile + public class TarraThornTip : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs index 016a71ea26..8e849da80a 100644 --- a/Projectiles/Rogue/TarragonThrowingDartProjectile.cs +++ b/Projectiles/Rogue/TarragonThrowingDartProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index e62b56ae28..8564f3c43b 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); + Main.PlaySound(SoundID.Item107, projectile.position); for (int k = 0; k < 7; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 89, projectile.oldVelocity.X, projectile.oldVelocity.Y); diff --git a/Projectiles/Rogue/TheSyringeS1.cs b/Projectiles/Rogue/TheSyringeS1.cs index 9b785666e5..22a3e0d5e5 100644 --- a/Projectiles/Rogue/TheSyringeS1.cs +++ b/Projectiles/Rogue/TheSyringeS1.cs @@ -2,12 +2,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -using Terraria.ID; using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class TheSyringeS1 : ModProjectile + public class TheSyringeS1 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TimeBoltKnife.cs b/Projectiles/Rogue/TimeBoltKnife.cs index 434a30df09..89e88d0d0b 100644 --- a/Projectiles/Rogue/TimeBoltKnife.cs +++ b/Projectiles/Rogue/TimeBoltKnife.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/TitaniumClone.cs b/Projectiles/Rogue/TitaniumClone.cs index 508f8a3e9c..5fba2a737d 100644 --- a/Projectiles/Rogue/TitaniumClone.cs +++ b/Projectiles/Rogue/TitaniumClone.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TitaniumClone : ModProjectile + public class TitaniumClone : ModProjectile { private static float RotationIncrement = 0.22f; public override void SetStaticDefaults() diff --git a/Projectiles/Rogue/TitaniumShurikenProjectile.cs b/Projectiles/Rogue/TitaniumShurikenProjectile.cs index 074e6712e5..094d8ce6f8 100644 --- a/Projectiles/Rogue/TitaniumShurikenProjectile.cs +++ b/Projectiles/Rogue/TitaniumShurikenProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Rogue/ToothBallProjectile.cs b/Projectiles/Rogue/ToothBallProjectile.cs index 637c6881e4..3d0aaa83db 100644 --- a/Projectiles/Rogue/ToothBallProjectile.cs +++ b/Projectiles/Rogue/ToothBallProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/TotalMeltdown.cs b/Projectiles/Rogue/TotalMeltdown.cs index f233a23838..8ddf1cc711 100644 --- a/Projectiles/Rogue/TotalMeltdown.cs +++ b/Projectiles/Rogue/TotalMeltdown.cs @@ -1,12 +1,9 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TotalMeltdown : ModProjectile + public class TotalMeltdown : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TotalityFire.cs b/Projectiles/Rogue/TotalityFire.cs index 10efec023b..22e8b7f468 100644 --- a/Projectiles/Rogue/TotalityFire.cs +++ b/Projectiles/Rogue/TotalityFire.cs @@ -1,5 +1,4 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TotalityFire : ModProjectile + public class TotalityFire : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 148a07c262..6336f8aac1 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TotalityFlask : ModProjectile + public class TotalityFlask : ModProjectile { public override void SetStaticDefaults() { @@ -57,7 +56,7 @@ namespace CalamityMod.Projectiles.Rogue return; //glass-pot break sound - Main.PlaySound(13, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Shatter, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0f); int meltdown = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[meltdown].Center = projectile.Center; //makes it centered because it's not without this diff --git a/Projectiles/Rogue/TotalityTar.cs b/Projectiles/Rogue/TotalityTar.cs index 103b13c6ea..6ea14ec9df 100644 --- a/Projectiles/Rogue/TotalityTar.cs +++ b/Projectiles/Rogue/TotalityTar.cs @@ -2,11 +2,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { - public class TotalityTar : ModProjectile + public class TotalityTar : ModProjectile { public override void SetStaticDefaults() { @@ -83,8 +82,8 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); - Vector2 vector2 = new Vector2(20f, 20f); + Main.PlaySound(SoundID.Item74, projectile.position); + Vector2 vector2 = new Vector2(20f, 20f); for (int index = 0; index < 3; ++index) Dust.NewDust(projectile.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 191, 0.0f, 0.0f, 0, Color.Red, 1f); for (int index1 = 0; index1 < 5; ++index1) diff --git a/Projectiles/Rogue/ToxicantTwisterDust.cs b/Projectiles/Rogue/ToxicantTwisterDust.cs index d5a0d84512..de95a1526a 100644 --- a/Projectiles/Rogue/ToxicantTwisterDust.cs +++ b/Projectiles/Rogue/ToxicantTwisterDust.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using CalamityMod.Buffs.DamageOverTime; diff --git a/Projectiles/Rogue/ToxicantTwisterProjectile.cs b/Projectiles/Rogue/ToxicantTwisterProjectile.cs index e9d2b1ed81..5904b04214 100644 --- a/Projectiles/Rogue/ToxicantTwisterProjectile.cs +++ b/Projectiles/Rogue/ToxicantTwisterProjectile.cs @@ -1,14 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ToxicantTwisterProjectile : ModProjectile + public class ToxicantTwisterProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -50,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 180); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, @@ -62,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 180); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index 1de61c3dd4..e49e7434ed 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class ToxicantTwisterTwoPointZero : ModProjectile + public class ToxicantTwisterTwoPointZero : ModProjectile { private int lifeTime = 300; @@ -58,52 +57,50 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item7, projectile.position); } - // Returns after some number of frames in the air - if (projectile.timeLeft < lifeTime - 180) + // Returns after 2.5 seconds in the air + if (projectile.timeLeft < lifeTime - 150) projectile.ai[0] = 1f; if (projectile.ai[0] != 0f) { - float returnSpeed = 18f * 1.6f; + float returnSpeed = 30f; float acceleration = 1.4f; Player owner = Main.player[projectile.owner]; // Delete the projectile 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((double)(xDist * xDist + yDist * yDist)); + Vector2 projVector = owner.Center - projectile.Center; + float dist = projVector.Length(); if (dist > 3000f) projectile.Kill(); dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; + projVector.X *= dist; + projVector.Y *= dist; // Home back in on the player. - if (projectile.velocity.X < xDist) + if (projectile.velocity.X < projVector.X) { - projectile.velocity.X = projectile.velocity.X + acceleration; - if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + if (projectile.velocity.X < 0f && projVector.X > 0f) projectile.velocity.X += acceleration; } - else if (projectile.velocity.X > xDist) + else if (projectile.velocity.X > projVector.X) { - projectile.velocity.X = projectile.velocity.X - acceleration; - if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + if (projectile.velocity.X > 0f && projVector.X < 0f) projectile.velocity.X -= acceleration; } - if (projectile.velocity.Y < yDist) + if (projectile.velocity.Y < projVector.Y) { - projectile.velocity.Y = projectile.velocity.Y + acceleration; - if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + if (projectile.velocity.Y < 0f && projVector.Y > 0f) projectile.velocity.Y += acceleration; } - else if (projectile.velocity.Y > yDist) + else if (projectile.velocity.Y > projVector.Y) { - projectile.velocity.Y = projectile.velocity.Y - acceleration; - if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + if (projectile.velocity.Y > 0f && projVector.Y < 0f) projectile.velocity.Y -= acceleration; } @@ -120,8 +117,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + if (projectile.penetrate < 3) + projectile.ai[0] = 1f; target.AddBuff(ModContent.BuffType(), 180); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, @@ -132,8 +131,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { + if (projectile.penetrate < 3) + projectile.ai[0] = 1f; target.AddBuff(ModContent.BuffType(), 180); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int k = 0; k < 10; k++) { Dust.NewDust(projectile.position + projectile.velocity, diff --git a/Projectiles/Rogue/TurbulanceWindSlash.cs b/Projectiles/Rogue/TurbulanceWindSlash.cs index 7e247ad5d3..6b7d5a1db6 100644 --- a/Projectiles/Rogue/TurbulanceWindSlash.cs +++ b/Projectiles/Rogue/TurbulanceWindSlash.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class TurbulanceWindSlash : ModProjectile + public class TurbulanceWindSlash : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/UmbraphileBoom.cs b/Projectiles/Rogue/UmbraphileBoom.cs index d7ae0e87ae..d06797acad 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Rogue/UrchinStingerProj.cs b/Projectiles/Rogue/UrchinStingerProj.cs index 07e320c7be..950f535ec0 100644 --- a/Projectiles/Rogue/UrchinStingerProj.cs +++ b/Projectiles/Rogue/UrchinStingerProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 15eb040599..c112d88487 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Rogue { //Bounce off tiles and start homing on player if it hits a tile Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, projectile.position); + Main.PlaySound(SoundID.Dig, projectile.position); if (projectile.velocity.X != oldVelocity.X) { projectile.velocity.X = -oldVelocity.X; diff --git a/Projectiles/Rogue/Valaricicle.cs b/Projectiles/Rogue/Valaricicle.cs index c6c1eb26cb..3baa99dce9 100644 --- a/Projectiles/Rogue/Valaricicle.cs +++ b/Projectiles/Rogue/Valaricicle.cs @@ -1,13 +1,10 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue { - public class Valaricicle : ModProjectile + public class Valaricicle : ModProjectile { public override void SetStaticDefaults() { @@ -34,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/Valaricicle2.cs b/Projectiles/Rogue/Valaricicle2.cs index 9269977e2a..12051d82de 100644 --- a/Projectiles/Rogue/Valaricicle2.cs +++ b/Projectiles/Rogue/Valaricicle2.cs @@ -1,13 +1,10 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Rogue { - public class Valaricicle2 : ModProjectile + public class Valaricicle2 : ModProjectile { public override void SetStaticDefaults() { @@ -34,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Rogue/ValedictionBoomerang.cs b/Projectiles/Rogue/ValedictionBoomerang.cs index c67c0ecb4c..1e2e86dba7 100644 --- a/Projectiles/Rogue/ValedictionBoomerang.cs +++ b/Projectiles/Rogue/ValedictionBoomerang.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -125,8 +125,8 @@ namespace CalamityMod.Projectiles.Rogue int typhoonAmt = 3; if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84); - for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) + Main.PlaySound(SoundID.Item84, projectile.position); + for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) { Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); while (value15.X == 0f && value15.Y == 0f) @@ -149,8 +149,8 @@ namespace CalamityMod.Projectiles.Rogue int typhoonAmt = 3; if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84); - for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) + Main.PlaySound(SoundID.Item84, projectile.position); + for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++) { Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); while (value15.X == 0f && value15.Y == 0f) @@ -169,7 +169,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 100; diff --git a/Projectiles/Rogue/VeneratedKnife.cs b/Projectiles/Rogue/VeneratedKnife.cs index c52cb33635..a0eb63fc6e 100644 --- a/Projectiles/Rogue/VeneratedKnife.cs +++ b/Projectiles/Rogue/VeneratedKnife.cs @@ -1,6 +1,3 @@ -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -10,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class VeneratedKnife : ModProjectile + public class VeneratedKnife : ModProjectile { int lifetime = 150; diff --git a/Projectiles/Rogue/WebBallBol.cs b/Projectiles/Rogue/WebBallBol.cs index e93beaa2cb..db16285d15 100644 --- a/Projectiles/Rogue/WebBallBol.cs +++ b/Projectiles/Rogue/WebBallBol.cs @@ -1,12 +1,10 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class WebBallBol : ModProjectile + public class WebBallBol : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 4b7589f20c..d85df228ae 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Rogue/XerocPitchforkProjectile.cs b/Projectiles/Rogue/XerocPitchforkProjectile.cs index 425d9234ec..710588bed7 100644 --- a/Projectiles/Rogue/XerocPitchforkProjectile.cs +++ b/Projectiles/Rogue/XerocPitchforkProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -76,7 +76,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.damage = 1; } target.immune[projectile.owner] = 2; - target.AddBuff(BuffID.CursedInferno, 300); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -86,7 +85,6 @@ namespace CalamityMod.Projectiles.Rogue { projectile.damage = 1; } - target.AddBuff(BuffID.CursedInferno, 300); } } } diff --git a/Projectiles/Summon/AndromedaDeathRay.cs b/Projectiles/Summon/AndromedaDeathRay.cs index a6b476148f..d92b816cd2 100644 --- a/Projectiles/Summon/AndromedaDeathRay.cs +++ b/Projectiles/Summon/AndromedaDeathRay.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs b/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs index af57cc96ee..c291945ba9 100644 --- a/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs +++ b/Projectiles/Summon/AndromedaUI/AndromedaUI_Background.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.Cooldowns; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon.AndromedaUI { - public class AndromedaUI_Background : ModProjectile + public class AndromedaUI_Background : ModProjectile { public int FadeoutTime = -1; public Vector2 PlayerOffset = Vector2.Zero; diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index 4dc9adf1cd..3a062aa18b 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -1,8 +1,7 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class ApexShark : ModProjectile + public class ApexShark : ModProjectile { private int HitCooldown = 0; public override void SetStaticDefaults() @@ -95,31 +94,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); bool flag24 = false; if (projectile.ai[0] == 2f) { @@ -276,7 +251,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 70, 0.5f); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 70, 0.5f); projectile.velocity = new Vector2(0f, 5f).RotatedBy(projectile.velocity.ToRotation() + 1.5f); int sand = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), (int)(projectile.knockBack * 0.7f), projectile.owner, 0f, 0f); Main.projectile[sand].Center = projectile.Center; diff --git a/Projectiles/Summon/ApparatusExplosion.cs b/Projectiles/Summon/ApparatusExplosion.cs index 1f5ffacb1d..26930ec5f2 100644 --- a/Projectiles/Summon/ApparatusExplosion.cs +++ b/Projectiles/Summon/ApparatusExplosion.cs @@ -1,12 +1,9 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class ApparatusExplosion : ModProjectile + public class ApparatusExplosion : ModProjectile { public override void SetStaticDefaults() { @@ -23,7 +20,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 012c839454..0fd44c83fc 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class AquaticStarMinion : ModProjectile + public class AquaticStarMinion : ModProjectile { public override void SetStaticDefaults() { @@ -64,185 +63,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += projectile.velocity.X * 0.04f; - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float SAIMovement = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X -= SAIMovement; - } - else - { - projectile.velocity.X += SAIMovement; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y -= SAIMovement; - } - else - { - projectile.velocity.Y += SAIMovement; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - projectile.tileCollide = true; - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - projectile.tileCollide = false; - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 9.5f, false, false); } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Summon/AstrageldonLaser.cs b/Projectiles/Summon/AstrageldonLaser.cs index aaf681ac73..26cd5201d7 100644 --- a/Projectiles/Summon/AstrageldonLaser.cs +++ b/Projectiles/Summon/AstrageldonLaser.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[0] == 0f) { projectile.ai[0] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12); } if (projectile.alpha > 0) { diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index 60a8f6e587..f399ab6542 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -2,18 +2,16 @@ using CalamityMod.Buffs.Summon; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Projectiles.Boss; namespace CalamityMod.Projectiles.Summon { - public class AstrageldonSummon : ModProjectile + public class AstrageldonSummon : ModProjectile { public bool dust = false; private int attackCounter = 1; diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index dda1f3d67f..85e23d5049 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 10); for (int k = 0; k < 5; k++) { int randomDust = Main.rand.Next(2); diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index fccd980aeb..7277e5b73d 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -1,5 +1,4 @@ using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Ranged; using CalamityMod.Dusts; using CalamityMod.Buffs.Summon; using Microsoft.Xna.Framework; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class AstralProbeSummon : ModProjectile + public class AstralProbeSummon : ModProjectile { private double rotation = 0; @@ -170,7 +169,7 @@ namespace CalamityMod.Projectiles.Summon int num658 = ModContent.ProjectileType(); if (flag25 && projectile.ai[1] == 0f && vector46 != projectile.position) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12, 0.5f, 0f); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12, 0.5f, 0f); projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/Summon/AureusBomber.cs b/Projectiles/Summon/AureusBomber.cs index 2d84e4dd2c..a4be169099 100644 --- a/Projectiles/Summon/AureusBomber.cs +++ b/Projectiles/Summon/AureusBomber.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class AureusBomber : ModProjectile + public class AureusBomber : ModProjectile { public override void SetStaticDefaults() { @@ -71,32 +70,7 @@ namespace CalamityMod.Projectiles.Summon } //anti sticking movement - float SAImovement = 0.05f; - float width = (float) projectile.width; - for (int indexNPC = 0; indexNPC < Main.projectile.Length; indexNPC++) - { - Projectile proj = Main.projectile[indexNPC]; - bool myType = proj.type == ModContent.ProjectileType(); - if (indexNPC != projectile.whoAmI && proj.active && proj.owner == projectile.owner && myType && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAImovement; - } - else - { - projectile.velocity.X += SAImovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAImovement; - } - else - { - projectile.velocity.Y += SAImovement; - } - } - } + projectile.MinionAntiClump(); //get in a line Vector2 idlePosition = player.Center; @@ -272,7 +246,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.Center.X, (int)projectile.Center.Y, 14); for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 50, default, 1f); diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index f5b91bd9d2..f0d3a1b2d4 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -51,7 +51,10 @@ namespace CalamityMod.Projectiles.Summon for (int j = 0; j < Main.maxProjectiles; j++) { Projectile proj = Main.projectile[j]; - if (proj.active && proj.owner == projectile.owner && proj.type == ModContent.ProjectileType() && proj.Calamity().lineColor == 0) + // Short circuits to make the loop as fast as possible + if (!proj.active || proj.owner != projectile.owner || !proj.minion || proj.Calamity().lineColor != 0) + continue; + if (proj.type == projectile.type) { spiderCount += (int)proj.minionSlots; proj.Calamity().lineColor = 1; diff --git a/Projectiles/Summon/BelladonnaSpirit.cs b/Projectiles/Summon/BelladonnaSpirit.cs index 870ad46109..fcc0f64794 100644 --- a/Projectiles/Summon/BelladonnaSpirit.cs +++ b/Projectiles/Summon/BelladonnaSpirit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -142,32 +142,7 @@ namespace CalamityMod.Projectiles.Summon } projectile.velocity.Y = (targetPosition.Y - projectile.Center.Y + potentialTarget.spriteDirection * 75f) / 90f; } - float SAImovement = 0.05f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && - proj.active && proj.owner == projectile.owner && - proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAImovement; - } - else - { - projectile.velocity.X += SAImovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAImovement; - } - else - { - projectile.velocity.Y += SAImovement; - } - } - } + projectile.MinionAntiClump(); } } } diff --git a/Projectiles/Summon/BlackHawkGlow.png b/Projectiles/Summon/BlackHawkGlow.png new file mode 100644 index 0000000000..24479cb839 Binary files /dev/null and b/Projectiles/Summon/BlackHawkGlow.png differ diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 3478ec1a8c..c0974c50fd 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -1,259 +1,298 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; +using CalamityMod.Projectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class BlackHawkSummon : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Black Hawk"); - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - Main.projFrames[projectile.type] = 3; - } + public class BlackHawkSummon : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Black Hawk"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + Main.projFrames[projectile.type] = 3; + } - public override void SetDefaults() - { - projectile.width = 36; - projectile.height = 36; - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.aiStyle = 66; - projectile.minionSlots = 1f; - projectile.timeLeft = 18000; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.timeLeft *= 5; - projectile.minion = true; - } + public override void SetDefaults() + { + projectile.width = 36; + projectile.height = 36; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.aiStyle = 66; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.timeLeft *= 5; + projectile.minion = true; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (projectile.localAI[0] == 0f) - { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); - projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 258, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); - Main.dust[num228].noGravity = true; - Main.dust[num228].velocity = vector7; - } - projectile.localAI[0] += 1f; - } - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) - { - int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); - projectile.damage = damage2; - } - projectile.frameCounter++; - if (projectile.frameCounter >= 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 3) - { - projectile.frame = 0; - } - float num633 = 700f; - float num634 = 1300f; - float num635 = 2600f; - float num636 = 600f; - bool flag64 = projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) - { - if (player.dead) - { - modPlayer.blackhawk = false; - } - if (modPlayer.blackhawk) - { - projectile.timeLeft = 2; - } - } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 18f; //12 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 9f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 12f; - if (flag26) - { - num650 = 30f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 16f) - { - num650 = 16f; - } - if (num651 < num636 && flag26) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (flag25) - { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; - } - else - { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 90f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - float scaleFactor3 = 6f; - int num658 = ModContent.ProjectileType(); - if (flag25 && projectile.ai[1] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - projectile.ai[1] += 2f; - if (Main.myPlayer == projectile.owner) - { - Vector2 value19 = vector46 - projectile.Center; - value19.Normalize(); - value19 *= scaleFactor3; - int bullet = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - projectile.netUpdate = true; - } - } - } - } + public override void AI() + { + //Set namespaces + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + CalamityGlobalProjectile modProj = projectile.Calamity(); - public override bool CanDamage() - { - return false; - } - } + //On spawn effects + if (projectile.localAI[0] == 0f) + { + //Set constants + modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); + modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; + //Spawn dust + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) + { + Vector2 direction = Vector2.Normalize(projectile.velocity) * new Vector2(projectile.width / 2f, projectile.height) * 0.75f; + direction = direction.RotatedBy((double)((dustIndex - (dustAmt / 2f - 1f)) * MathHelper.TwoPi / dustAmt), default) + projectile.Center; + Vector2 dustVel = direction - projectile.Center; + int fire = Dust.NewDust(direction + dustVel, 0, 0, 258, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity = dustVel; + } + projectile.localAI[0] += 1f; + } + + //Flexible minion damage update + if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / + modProj.spawnedPlayerMinionDamageValue * player.MinionDamage()); + projectile.damage = damage2; + } + + //Update frames + projectile.frameCounter++; + if (projectile.frameCounter >= 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + //Set up buff and timeLeft + bool flag64 = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.blackhawk = false; + } + if (modPlayer.blackhawk) + { + projectile.timeLeft = 2; + } + } + + //Anti sticky movement to prevent overlapping minions + projectile.MinionAntiClump(); + + float maxDistance = 700f; + Vector2 targetVec = projectile.position; + Vector2 half = new Vector2(0.5f); + bool foundTarget = false; + //If targeting something, prioritize that enemy + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + //Adding a check on the NPC's size allows it to target big things like Providence + Vector2 sizeCheck = npc.position + npc.Size * half; + //Calculate distance between target and the projectile to know if it's too far or not + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < maxDistance) + { + maxDistance = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + else + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(projectile, false)) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < maxDistance) + { + maxDistance = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + } + + //If too far, make the minion start returning to the player. + float separationAnxietyDist = 1300f; + if (foundTarget) + { + //Max travel distance increases if targeting something + separationAnxietyDist = 2600f; + } + if (Vector2.Distance(player.Center, projectile.Center) > separationAnxietyDist) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + + //If a target is found, move toward it + if (foundTarget && projectile.ai[0] == 0f) + { + Vector2 vecToTarget = targetVec - projectile.Center; + float targetDist = vecToTarget.Length(); + vecToTarget.Normalize(); + //If farther than 200 pixels, move toward it + if (targetDist > 200f) + { + float speedMult = 18f; + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + //Otherwise, back it up slowly + else + { + float speedMult = -9f; + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + } + + //If not targeting something, act passively + else + { + bool returningToPlayer = false; + if (!returningToPlayer) + { + returningToPlayer = projectile.ai[0] == 1f; + } + //Move faster if actively returning to the player + float speedMult = 12f; + if (returningToPlayer) + { + speedMult = 30f; + } + Vector2 vecToPlayer = player.Center - projectile.Center + new Vector2(0f, -120f); + float playerDist = vecToPlayer.Length(); + //Speed up if near the player + if (playerDist < 200f && speedMult < 16f) + { + speedMult = 16f; + } + //If close enough to the player, return to normal + if (playerDist < 600f && returningToPlayer) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + //If abnormally far, teleport to the player + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + //Move toward player if more than 70 pixels away + if (playerDist > 70f) + { + vecToPlayer.Normalize(); + vecToPlayer *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToPlayer) / 41f; + } + //Move if still + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + + //Update rotation + if (foundTarget) + { + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + MathHelper.Pi, 0.1f); + } + else + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; + } + + //Increment attack cooldown + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += Main.rand.Next(1, 4); + } + //Set the minion to be ready for attack + if (projectile.ai[1] > 90f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + + //Return if on attack cooldown, has no target, or returning to the player + if (projectile.ai[0] != 0f || !foundTarget || projectile.ai[1] != 0f) + return; + + //Shoot a bullet + if (Main.myPlayer == projectile.owner) + { + float projSpeed = 6f; + int projType = ModContent.ProjectileType(); + Main.PlaySound(SoundID.Item20, projectile.Center); + projectile.ai[1] += 2f; + Vector2 velocity = targetVec - projectile.Center; + velocity.Normalize(); + velocity *= projSpeed; + Projectile.NewProjectile(projectile.Center, velocity, projType, projectile.damage, projectile.knockBack, projectile.owner); + projectile.netUpdate = true; + } + } + + //Does no contact damage + public override bool CanDamage() => false; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int y6 = frameHeight * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f); + return false; + } + + //Pretty glowmask + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/BlackHawkGlow"); + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int y6 = frameHeight * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f); + } + } } diff --git a/Projectiles/Summon/BloodBreath.cs b/Projectiles/Summon/BloodBreath.cs index 66441b8dcd..2773d0d8e0 100644 --- a/Projectiles/Summon/BloodBreath.cs +++ b/Projectiles/Summon/BloodBreath.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class BloodBreath : ModProjectile + public class BloodBreath : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index 94916bc43c..982d7bd55b 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -89,30 +89,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - for (int num534 = 0; num534 < Main.maxProjectiles; num534++) - { - if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && - Main.projectile[num534].type == ModContent.ProjectileType() && - Math.Abs(projectile.position.X - Main.projectile[num534].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num534].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num534].position.X) - { - projectile.velocity.X = projectile.velocity.X - 0.05f; - } - else - { - projectile.velocity.X = projectile.velocity.X + 0.05f; - } - if (projectile.position.Y < Main.projectile[num534].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - 0.05f; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + 0.05f; - } - } - } + projectile.MinionAntiClump(); float num535 = projectile.position.X; float num536 = projectile.position.Y; float num537 = 1300f; @@ -259,13 +236,13 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) { bool flag3; - if (Main.npc[i].type == 414) + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) { Rectangle rect = Main.npc[i].getRect(); int num5 = 8; diff --git a/Projectiles/Summon/BloodRain.cs b/Projectiles/Summon/BloodRain.cs index 26cbf83ae0..1fb9337783 100644 --- a/Projectiles/Summon/BloodRain.cs +++ b/Projectiles/Summon/BloodRain.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index e9601a6e31..7098d04b80 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/BoneMatter.cs b/Projectiles/Summon/BoneMatter.cs index 97953ad490..0e55090b48 100644 --- a/Projectiles/Summon/BoneMatter.cs +++ b/Projectiles/Summon/BoneMatter.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon diff --git a/Projectiles/Summon/BoneMatter2.cs b/Projectiles/Summon/BoneMatter2.cs index 4b584e8c19..57dd02dbd8 100644 --- a/Projectiles/Summon/BoneMatter2.cs +++ b/Projectiles/Summon/BoneMatter2.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon diff --git a/Projectiles/Summon/BrimseekerAuraBall.cs b/Projectiles/Summon/BrimseekerAuraBall.cs index 76cac58488..6a446eb6ed 100644 --- a/Projectiles/Summon/BrimseekerAuraBall.cs +++ b/Projectiles/Summon/BrimseekerAuraBall.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class BrimseekerAuraBall : ModProjectile + public class BrimseekerAuraBall : ModProjectile { public static float MovementSpeed = 4f; public static float RotationalSpeed = 0.08f; diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 612a21234c..a80580b3e7 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -102,30 +102,7 @@ namespace CalamityMod.Projectiles.Summon } float num633 = 700f; float num636 = 400f; //150 - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); Vector2 vector46 = projectile.position; bool flag25 = false; if (projectile.ai[0] != 1f) diff --git a/Projectiles/Summon/BrimstoneExplosionMinion.cs b/Projectiles/Summon/BrimstoneExplosionMinion.cs index 58fad20d40..86152658e6 100644 --- a/Projectiles/Summon/BrimstoneExplosionMinion.cs +++ b/Projectiles/Summon/BrimstoneExplosionMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(projectile.Center, 0.9f, 0f, 0f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } float num461 = 25f; diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 94a4b2e578..6cd17482e8 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Summon/BrimstoneFireballMinion.cs b/Projectiles/Summon/BrimstoneFireballMinion.cs index 7faee65129..d4d3396abb 100644 --- a/Projectiles/Summon/BrimstoneFireballMinion.cs +++ b/Projectiles/Summon/BrimstoneFireballMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 4b0623567a..c21ef216ac 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index d59bdd29a8..29acb7e416 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class BrittleStarMinion : ModProjectile + public class BrittleStarMinion : ModProjectile { public override void SetStaticDefaults() { @@ -64,185 +63,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += projectile.velocity.X * 0.04f; - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - projectile.tileCollide = true; - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - projectile.tileCollide = false; - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 9.5f, false, false); } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs index 371b9bffd1..c0c366f779 100644 --- a/Projectiles/Summon/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon projectile.width = projectile.height = 48; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 28); + Main.PlaySound(SoundID.NPCKilled, (int)projectile.Center.X, (int)projectile.Center.Y, 28); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index c5e05a9744..e7d201fed8 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -94,14 +94,14 @@ namespace CalamityMod.Projectiles.Summon } if (Main.rand.NextBool(600)) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 35); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 35); } if (projectile.ai[0] == 2f) { projectile.ai[1] -= 1f; if (projectile.ai[1] > 3f) { - Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 34); + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 34); int num = Dust.NewDust(projectile.Center, 0, 0, 109, projectile.velocity.X, projectile.velocity.Y, 100, default, 1.4f); Main.dust[num].scale = 0.5f + (float)Main.rand.NextDouble() * 0.3f; Main.dust[num].velocity /= 2.5f; @@ -134,32 +134,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.localAI[0] -= 1f; } - int num3; - for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) - { - if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && - Main.projectile[num534].type == ModContent.ProjectileType() && - Math.Abs(projectile.position.X - Main.projectile[num534].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num534].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num534].position.X) - { - projectile.velocity.X = projectile.velocity.X - 0.05f; - } - else - { - projectile.velocity.X = projectile.velocity.X + 0.05f; - } - if (projectile.position.Y < Main.projectile[num534].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - 0.05f; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + 0.05f; - } - } - num3 = num534; - } + projectile.MinionAntiClump(); Vector2 vector = projectile.position; float num10 = 3000f; //300 bool flag = false; @@ -342,7 +317,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 111); + Main.PlaySound(SoundID.Item111, (int)projectile.position.X, (int)projectile.position.Y); Vector2 vector7 = vector - projectile.Center; vector7.Normalize(); vector7 *= scaleFactor4; diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 8ee9315bf7..7ac5313243 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; @@ -78,30 +78,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); bool flag24 = false; if (flag24) { @@ -117,15 +94,17 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = false; } + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -134,14 +113,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index b8372875eb..c3dfac0236 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -77,30 +77,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); bool flag24 = false; if (flag24) { @@ -116,11 +93,13 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = false; } + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { @@ -133,14 +112,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 86a4b27f9e..3232dff49a 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -61,10 +61,6 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - float num633 = 700f; - float num634 = 1100f; - float num635 = 2400f; - float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); if (flag64) { @@ -77,178 +73,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; - projectile.frameCounter++; - if (projectile.frameCounter > 1) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 2) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (projectile.ai[0] != 1f) - { - projectile.tileCollide = false; - } - if (projectile.tileCollide && WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16))) - { - projectile.tileCollide = false; - } - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.tileCollide = false; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; projectile.frameCounter++; - if (projectile.frameCounter > 3) + if (projectile.frameCounter > (projectile.ai[0] == 2f ? 1 : 3)) { projectile.frame++; projectile.frameCounter = 0; @@ -257,30 +85,8 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(700f, 1100f, 2400f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 8a691e51c9..6b8c0ea620 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -82,22 +82,7 @@ namespace CalamityMod.Projectiles.Summon } //Anti sticky movement to prevent minions from stacking - float antiStickyFloat = 0.05f; - for (int index = 0; index < Main.maxProjectiles; ++index) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && proj.active && (proj.owner == projectile.owner && proj.type == projectile.type) && (double) Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - projectile.velocity.X -= antiStickyFloat; - else - projectile.velocity.X += antiStickyFloat; - if (projectile.position.Y < proj.position.Y) - projectile.velocity.Y -= antiStickyFloat; - else - projectile.velocity.Y += antiStickyFloat; - } - } + projectile.MinionAntiClump(); //Set tile collision for only when trying to return to the player projectile.tileCollide = projectile.ai[0] != 1f; diff --git a/Projectiles/Summon/ChaosFlame.cs b/Projectiles/Summon/ChaosFlame.cs index 7c89003494..0fbd4ef2c0 100644 --- a/Projectiles/Summon/ChaosFlame.cs +++ b/Projectiles/Summon/ChaosFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 5; num457++) diff --git a/Projectiles/Summon/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs index 5bb40663fb..d5f5a683f7 100644 --- a/Projectiles/Summon/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/Cinder.cs b/Projectiles/Summon/Cinder.cs index be0deb981e..19ce727b89 100644 --- a/Projectiles/Summon/Cinder.cs +++ b/Projectiles/Summon/Cinder.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index 56731a1626..07467a2734 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -1,13 +1,12 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CinderBlossom : ModProjectile + public class CinderBlossom : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 027ceff01d..757990b8bf 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -82,210 +82,26 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 500f; //700 - float num634 = 800f; - float num635 = 1200f; - float num636 = 400f; //150 - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 0.25f * num, 0.55f * num, 0.75f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; - projectile.frameCounter++; - if (projectile.frameCounter > 16) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 7) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < 200; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 100f) //200 - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; //6 - if (flag26) - { - num650 = 15f; //15 - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(500f, -60f); //-60 - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) //200 and 8 - { - num650 = 8f; //8 - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - projectile.frameCounter++; - if (projectile.frameCounter > 16) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 7) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 0.25f * lightScalar, 0.55f * lightScalar, 0.75f * lightScalar); + + projectile.frameCounter++; + if (projectile.frameCounter > 16) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 7) + { + projectile.frame = 0; + } + + projectile.ChargingMinionAI(500f, 800f, 1200f, 400f, 0, 30f, 8f, -4f, 40f, 8f, false, true); } } } diff --git a/Projectiles/Summon/ColdDivinityPointyThing.cs b/Projectiles/Summon/ColdDivinityPointyThing.cs index 6ac2976b82..552ad4b40c 100644 --- a/Projectiles/Summon/ColdDivinityPointyThing.cs +++ b/Projectiles/Summon/ColdDivinityPointyThing.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index e7eb26e4ed..1a634da6ab 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/CorruptionSlimeGodMinion.cs index d040cf3128..8048b833d3 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/CorruptionSlimeGodMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 12b5af5f63..ed589327a3 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(29, (int)projectile.Center.X, (int)projectile.Center.Y, 103); + Main.PlaySound(SoundID.Zombie, (int)projectile.Center.X, (int)projectile.Center.Y, 103); for (int num193 = 0; num193 < 3; num193++) { int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index 3ada1c4ee6..fb140b945c 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using System; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Summon projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y); } } projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction; @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(29, (int)projectile.Center.X, (int)projectile.Center.Y, 103); + Main.PlaySound(SoundID.Zombie, (int)projectile.Center.X, (int)projectile.Center.Y, 103); for (int num193 = 0; num193 < 3; num193++) { int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index 42eecccdfa..64fe2da558 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -70,30 +70,6 @@ namespace CalamityMod.Projectiles.Summon float num634 = 1600f; //800 float num635 = 2400f; //1200 float num636 = 800f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } projectile.rotation += projectile.velocity.X * 0.1f; Vector2 vector46 = projectile.position; bool flag25 = false; @@ -237,7 +213,7 @@ namespace CalamityMod.Projectiles.Summon } if (flag11) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); + Main.PlaySound(SoundID.Item105, (int)projectile.position.X, (int)projectile.position.Y); int num251 = Main.rand.Next(5, 8); for (int num252 = 0; num252 < num251; num252++) { diff --git a/Projectiles/Summon/CosmicViperConcussionMissile.cs b/Projectiles/Summon/CosmicViperConcussionMissile.cs index d0c7acf751..c34a69b30f 100644 --- a/Projectiles/Summon/CosmicViperConcussionMissile.cs +++ b/Projectiles/Summon/CosmicViperConcussionMissile.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Summon/CosmicViperGlow.png b/Projectiles/Summon/CosmicViperGlow.png new file mode 100644 index 0000000000..4f35f5fc00 Binary files /dev/null and b/Projectiles/Summon/CosmicViperGlow.png differ diff --git a/Projectiles/Summon/CosmicViperHomingRocket.cs b/Projectiles/Summon/CosmicViperHomingRocket.cs index 993bbfba3d..0c7f58939b 100644 --- a/Projectiles/Summon/CosmicViperHomingRocket.cs +++ b/Projectiles/Summon/CosmicViperHomingRocket.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Summon/CosmicViperSplittingRocket.cs b/Projectiles/Summon/CosmicViperSplittingRocket.cs index 04ff3334ee..c02d45b6e2 100644 --- a/Projectiles/Summon/CosmicViperSplittingRocket.cs +++ b/Projectiles/Summon/CosmicViperSplittingRocket.cs @@ -1,13 +1,12 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CosmicViperSplittingRocket : ModProjectile + public class CosmicViperSplittingRocket : ModProjectile { public override void SetStaticDefaults() { @@ -65,9 +64,9 @@ namespace CalamityMod.Projectiles.Summon speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f); } - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.Kill(); + } + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + projectile.Kill(); return; } else if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) @@ -102,9 +101,9 @@ namespace CalamityMod.Projectiles.Summon speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2f; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.25f), projectile.knockBack, projectile.owner, Main.rand.Next(2), 0f); } - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.Kill(); + } + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); + projectile.Kill(); return; } else if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 54747653c6..48d29995ab 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -92,31 +92,7 @@ namespace CalamityMod.Projectiles.Summon float colorScale = (float)projectile.alpha / 255f; Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, 1f * colorScale, 0.1f * colorScale, 1f * colorScale); - float antiStickyFloat = 0.05f; - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) - { - Projectile proj = Main.projectile[projIndex]; - bool flag23 = proj.type == ModContent.ProjectileType(); - if (projIndex != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= antiStickyFloat; - } - else - { - projectile.velocity.X += antiStickyFloat; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= antiStickyFloat; - } - else - { - projectile.velocity.Y += antiStickyFloat; - } - } - } + projectile.MinionAntiClump(); float detectRange = 700f; Vector2 targetVec = projectile.position; @@ -222,7 +198,7 @@ namespace CalamityMod.Projectiles.Summon } if (foundTarget) { - projectile.rotation = (targetVec - projectile.Center).ToRotation() + MathHelper.Pi; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + MathHelper.Pi, 0.1f); } else { @@ -254,8 +230,8 @@ namespace CalamityMod.Projectiles.Summon float speedMult = 6f; if (foundTarget && projectile.ai[1] == 0f) { - //play cool sound - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + //play cool sound + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); projectile.ai[1] += 2f; if (Main.myPlayer == projectile.owner) { @@ -292,19 +268,31 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool CanDamage() => false; + public override bool CanDamage() => false; - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { Texture2D texture = Main.projectileTexture[projectile.type]; - int frameHeight = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int frameHeight = texture.Height / Main.projFrames[projectile.type]; int y6 = frameHeight * projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f); - return false; + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/CosmicViperGlow"); + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int y6 = frameHeight * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f); } } } diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 48797d4acf..17203f10dc 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -83,32 +83,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - int num3; - for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) - { - if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && - Main.projectile[num534].type == ModContent.ProjectileType() && - Math.Abs(projectile.position.X - Main.projectile[num534].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num534].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num534].position.X) - { - projectile.velocity.X = projectile.velocity.X - 0.05f; - } - else - { - projectile.velocity.X = projectile.velocity.X + 0.05f; - } - if (projectile.position.Y < Main.projectile[num534].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - 0.05f; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + 0.05f; - } - } - num3 = num534; - } + projectile.MinionAntiClump(); float num535 = projectile.position.X; float num536 = projectile.position.Y; float num537 = 3000f; @@ -142,7 +117,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542++) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { @@ -157,7 +132,6 @@ namespace CalamityMod.Projectiles.Summon flag19 = true; } } - num3 = num542; } } } @@ -168,9 +142,9 @@ namespace CalamityMod.Projectiles.Summon { num546 = 18f; } - Vector2 vector42 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num547 = Main.player[projectile.owner].Center.X - vector42.X; - float num548 = Main.player[projectile.owner].Center.Y - vector42.Y - 60f; + Vector2 vector42 = projectile.Center; + float num547 = player.Center.X - vector42.X; + float num548 = player.Center.Y - vector42.Y - 60f; float num549 = (float)Math.Sqrt((double)(num547 * num547 + num548 * num548)); if (num549 < 400f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -240,7 +214,7 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation = projectile.velocity.X * 0.05f; - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; return; @@ -256,13 +230,13 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < 200; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) { bool flag3; - if (Main.npc[i].type == 414) + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) { Rectangle rect = Main.npc[i].getRect(); int num5 = 8; diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 50c2dc6a16..97de782c29 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.cs b/Projectiles/Summon/CrimsonSlimeGodMinion.cs index a359d10fba..fac39b6bf0 100644 --- a/Projectiles/Summon/CrimsonSlimeGodMinion.cs +++ b/Projectiles/Summon/CrimsonSlimeGodMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index eaf0cd193d..fe02d3ce27 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/DaedalusCrystalShot.cs b/Projectiles/Summon/DaedalusCrystalShot.cs index 98a44bb4fe..f75f3d3f12 100644 --- a/Projectiles/Summon/DaedalusCrystalShot.cs +++ b/Projectiles/Summon/DaedalusCrystalShot.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Summon { if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 5; num457++) @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item74, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index b64d8d7166..0b171bea53 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -75,32 +75,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - int num3; - for (int num534 = 0; num534 < Main.maxProjectiles; num534 = num3 + 1) - { - if (num534 != projectile.whoAmI && Main.projectile[num534].active && Main.projectile[num534].owner == projectile.owner && - Main.projectile[num534].type == ModContent.ProjectileType() && - Math.Abs(projectile.position.X - Main.projectile[num534].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num534].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num534].position.X) - { - projectile.velocity.X = projectile.velocity.X - 0.05f; - } - else - { - projectile.velocity.X = projectile.velocity.X + 0.05f; - } - if (projectile.position.Y < Main.projectile[num534].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - 0.05f; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + 0.05f; - } - } - num3 = num534; - } + projectile.MinionAntiClump(); float num535 = projectile.position.X; float num536 = projectile.position.Y; float num537 = 1300f; @@ -134,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num542 = 0; num542 < Main.maxNPCs; num542 = num3 + 1) + for (int num542 = 0; num542 < Main.maxNPCs; num542++) { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { @@ -149,7 +124,6 @@ namespace CalamityMod.Projectiles.Summon flag19 = true; } } - num3 = num542; } } } @@ -248,13 +222,13 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) { bool flag3; - if (Main.npc[i].type == 414) + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) { Rectangle rect = Main.npc[i].getRect(); int num5 = 8; diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 61b40dcac9..c79554f416 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -3,14 +3,13 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class DazzlingStabber : ModProjectile + public class DazzlingStabber : ModProjectile { public const float DistanceToCheck = 1500f; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index c0ff7bb1b1..ff9228c5b2 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -110,32 +110,7 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = (projectile.localAI[1] == 1f).ToInt() * 4; } - float acceleration = 0.1f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && - proj.active && proj.owner == projectile.owner && - proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= acceleration; - } - else - { - projectile.velocity.X += acceleration; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= acceleration; - } - else - { - projectile.velocity.Y += acceleration; - } - } - } + projectile.MinionAntiClump(0.1f); if (projectile.Distance(player.Center) > 2700f) { projectile.Center = player.Center; diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 385a1963e8..8fc84be450 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); for (int num621 = 0; num621 < 20; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Summon/Dreadmine.png b/Projectiles/Summon/Dreadmine.png index 2ebb9113cf..a5767d22dd 100644 Binary files a/Projectiles/Summon/Dreadmine.png and b/Projectiles/Summon/Dreadmine.png differ diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index e317b7de9c..eac916c79e 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Dreadmine Turret"); - Main.projFrames[projectile.type] = 2; + Main.projFrames[projectile.type] = 4; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 1) + if (projectile.frame >= Main.projFrames[projectile.type]) { projectile.frame = 0; } diff --git a/Projectiles/Summon/DreadmineTurret.png b/Projectiles/Summon/DreadmineTurret.png index caa6bf6b69..ee780cbe3c 100644 Binary files a/Projectiles/Summon/DreadmineTurret.png and b/Projectiles/Summon/DreadmineTurret.png differ diff --git a/Projectiles/Summon/EXPLODINGFROG.cs b/Projectiles/Summon/EXPLODINGFROG.cs index ddc34c7c99..05e0a97089 100644 --- a/Projectiles/Summon/EXPLODINGFROG.cs +++ b/Projectiles/Summon/EXPLODINGFROG.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index 3899f354c9..d1b0e7c858 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; @@ -69,183 +69,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += 0.075f; - float num633 = 1600f; //range - float num634 = 1800f; - float num635 = 2500f; - float num636 = 400f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 1; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 24f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 12f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 16f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(1600f, 1800f, 2500f, 400f, 1, 30f, 24f, -12f, 30f, 16f, true, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/EndoBeam.cs b/Projectiles/Summon/EndoBeam.cs index f258ba8d45..b35201bca1 100644 --- a/Projectiles/Summon/EndoBeam.cs +++ b/Projectiles/Summon/EndoBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 33fc6dfed2..17e694bac3 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class EndoCooperBody : ModProjectile + public class EndoCooperBody : ModProjectile { private int AttackMode = 0; private int LimbID = 0; @@ -111,7 +110,6 @@ namespace CalamityMod.Projectiles.Summon float longdistance = AttackMode != 2 ? 1300f : 1200f; float longestdistance = AttackMode != 2 ? 2600f : 2500f; float idledistance = AttackMode != 2 ? 600f : 400f; - float SAImovement = 0.05f; float chasespeed1 = 30f; float chasespeed2 = 18f; float firerate = 30f; @@ -141,32 +139,8 @@ namespace CalamityMod.Projectiles.Summon if (limbs.type != ModContent.ProjectileType() || !limbs.active) projectile.Kill(); - - for (int num638 = 0; num638 < Main.projectile.Length; num638++) - { - Projectile proj = Main.projectile[num638]; - bool flag23 = proj.type == ModContent.ProjectileType(); - bool limbsfind = proj.type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X -= SAImovement; - } - else - { - projectile.velocity.X += SAImovement; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y -= SAImovement; - } - else - { - projectile.velocity.Y += SAImovement; - } - } - } + + projectile.MinionAntiClump(); bool flag24 = false; if (projectile.ai[0] == 2f) { @@ -315,7 +289,7 @@ namespace CalamityMod.Projectiles.Summon switch (AttackMode) { case 0: - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 15); + Main.PlaySound(SoundID.Item15, (int)projectile.position.X, (int)projectile.position.Y); Vector2 aimlaser = objectivepos - projectile.Center; aimlaser.Normalize(); aimlaser = aimlaser.RotatedBy(MathHelper.ToRadians(30 * -laserdirection)); diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 414002c2f4..3457d54020 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -1,7 +1,6 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class EndoCooperLimbs : ModProjectile + public class EndoCooperLimbs : ModProjectile { private int AttackMode = 0; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs index f37ed57865..11cbebd619 100644 --- a/Projectiles/Summon/EndoFire.cs +++ b/Projectiles/Summon/EndoFire.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class EndoFire : ModProjectile + public class EndoFire : ModProjectile { public bool speedXChoice = false; public bool speedYChoice = false; diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index b6f73ea9a8..3c5837deba 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -1,6 +1,3 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -11,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class EndoHydraHead : ModProjectile + public class EndoHydraHead : ModProjectile { public Vector2 DeltaPosition; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs index 59d4c26914..90f8f87571 100644 --- a/Projectiles/Summon/EndoIceShard.cs +++ b/Projectiles/Summon/EndoIceShard.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Summon/EndoRay.cs b/Projectiles/Summon/EndoRay.cs index 80136b0fff..9ca295f9cf 100644 --- a/Projectiles/Summon/EndoRay.cs +++ b/Projectiles/Summon/EndoRay.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/EnergyOrb.cs b/Projectiles/Summon/EnergyOrb.cs index d1c0086ef2..419c224307 100644 --- a/Projectiles/Summon/EnergyOrb.cs +++ b/Projectiles/Summon/EnergyOrb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/FlameBlast.cs b/Projectiles/Summon/FlameBlast.cs index a73c8cde16..8f2869d03f 100644 --- a/Projectiles/Summon/FlameBlast.cs +++ b/Projectiles/Summon/FlameBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon { if (count == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Summon/FlameBurst.cs b/Projectiles/Summon/FlameBurst.cs index a546d95aa8..e544b740bf 100644 --- a/Projectiles/Summon/FlameBurst.cs +++ b/Projectiles/Summon/FlameBurst.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Summon { if (count == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Summon/FlyingOrthocera.cs b/Projectiles/Summon/FlyingOrthocera.cs index 1738303fb1..423efb030a 100644 --- a/Projectiles/Summon/FlyingOrthocera.cs +++ b/Projectiles/Summon/FlyingOrthocera.cs @@ -1,12 +1,11 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class FlyingOrthocera : ModProjectile + public class FlyingOrthocera : ModProjectile { public const float SearchDistance = 850f; diff --git a/Projectiles/Summon/FlyingOrthoceraStream.cs b/Projectiles/Summon/FlyingOrthoceraStream.cs index 963ede9828..05c7530ecd 100644 --- a/Projectiles/Summon/FlyingOrthoceraStream.cs +++ b/Projectiles/Summon/FlyingOrthoceraStream.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -6,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class FlyingOrthoceraStream : ModProjectile + public class FlyingOrthoceraStream : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/ForbiddenCircletEater.cs b/Projectiles/Summon/ForbiddenCircletEater.cs index 7b444099d2..dc793f422f 100644 --- a/Projectiles/Summon/ForbiddenCircletEater.cs +++ b/Projectiles/Summon/ForbiddenCircletEater.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class ForbiddenCircletEater : ModProjectile + public class ForbiddenCircletEater : ModProjectile { private int bounce = 3; diff --git a/Projectiles/Summon/FrostBeam.cs b/Projectiles/Summon/FrostBeam.cs index a1be22b25f..2f5caea681 100644 --- a/Projectiles/Summon/FrostBeam.cs +++ b/Projectiles/Summon/FrostBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/FrostBlossom.cs b/Projectiles/Summon/FrostBlossom.cs index 062dd898d3..5b560e459e 100644 --- a/Projectiles/Summon/FrostBlossom.cs +++ b/Projectiles/Summon/FrostBlossom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index 45f25ae473..b80a01a5a3 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Summon } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 30); + Main.PlaySound(SoundID.Item30, projectile.position); } if (projectile.localAI[0] == 0f) { diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 04f6c10f2b..56c2114325 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -95,38 +95,16 @@ namespace CalamityMod.Projectiles.Summon } //Anti-sticky movement failsafe - float SAIMovement = 0.05f; - for (int i = 0; i < Main.maxProjectiles; i++) - { - Projectile proj = Main.projectile[i]; - bool typeCheck = proj.type == ModContent.ProjectileType(); - if (i != projectile.whoAmI && proj.active && proj.owner == projectile.owner && typeCheck && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAIMovement; - } - else - { - projectile.velocity.X += SAIMovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAIMovement; - } - else - { - projectile.velocity.Y += SAIMovement; - } - } - } + projectile.MinionAntiClump(); //If summoned by Amalgam, trail poisonous seawater if (Math.Abs(projectile.velocity.X) > 0.1f || Math.Abs(projectile.velocity.Y) > 0.1f) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && amalgam) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 1f, 0f); + int water = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 1f, 0f); + Main.projectile[water].usesIDStaticNPCImmunity = true; + Main.projectile[water].usesLocalNPCImmunity = false; } } @@ -139,35 +117,45 @@ namespace CalamityMod.Projectiles.Summon returnToPlayer = true; //Find an npc to target, or if minion targetting is used, choose that npc - Vector2 center = projectile.Center; + Vector2 targetVec = projectile.Center; float range = 900f; bool npcFound = false; + Vector2 half = new Vector2(0.5f); if (!returnToPlayer) { - projectile.tileCollide = true; - NPC target = projectile.OwnerMinionAttackTargetNPC; - if (target != null && target.CanBeChasedBy(projectile, false)) + if (player.HasMinionAttackTargetNPC) { - float extraDistance = (target.width / 2) + (target.height / 2); - - if (Vector2.Distance(target.Center, projectile.Center) < (range + extraDistance) && Collision.CanHit(projectile.position, projectile.width, projectile.height, target.position, target.width, target.height)) + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) { - center = target.Center; - npcFound = true; + //Check the size of the target to make it easier to hit fat targets like Levi + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + //Some minions will ignore tiles when choosing a target like Ice Claspers, others will not + bool canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!npcFound && targetDist < range && canHit) + { + range = targetDist; + targetVec = sizeCheck; + npcFound = true; + } } } - if (!npcFound) + //If no npc is specifically targetted, check through the entire array + else { - for (int index = 0; index < Main.maxNPCs; ++index) + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { - NPC npc = Main.npc[index]; + NPC npc = Main.npc[npcIndex]; if (npc.CanBeChasedBy(projectile, false)) { - float extraDistance = (npc.width / 2) + (npc.height / 2); - - if (Vector2.Distance(npc.Center, projectile.Center) < (range + extraDistance) && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + bool canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!npcFound && targetDist < range && canHit) { - center = npc.Center; + range = targetDist; + targetVec = sizeCheck; npcFound = true; } } @@ -185,35 +173,33 @@ namespace CalamityMod.Projectiles.Summon float turnSpeed = 20f; if (returnToPlayer) //move faster if returning to the player homingSpeed = amalgam ? 30f : 12f; - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = player.Center.X - projPos.X; - float yDist = player.Center.Y - projPos.Y - 60f; - Vector2 playerVector = new Vector2(xDist, yDist); + Vector2 playerVector = player.Center - projectile.Center; + playerVector.Y -= 60f; float playerDist = playerVector.Length(); - if (playerDist < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - projectile.ai[0] = 0f; + if (playerDist < 100f && returnToPlayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + returnToPlayer = false; if (playerDist > 2000f) { projectile.position.X = player.Center.X - projectile.width / 2; projectile.position.Y = player.Center.Y - projectile.width / 2; } - if (playerDist > 70f) - { - Vector2 homeInVector = projectile.DirectionTo(playerVector); - if (homeInVector.HasNaNs()) - homeInVector = Vector2.UnitY; - - projectile.velocity = (projectile.velocity * turnSpeed + homeInVector * homingSpeed) / (turnSpeed + 1f); - } - else - { + //If more than 70 pixels away, move toward the player + if (playerDist > 70f) + { + playerVector.Normalize(); + playerVector *= homingSpeed; + projectile.velocity = (projectile.velocity * turnSpeed + playerVector) / (turnSpeed + 1f); + } + //Minions never stay still + else + { if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) { projectile.velocity.X = -0.15f; projectile.velocity.Y = -0.05f; } projectile.velocity *= 1.01f; - } + } projectile.friendly = false; projectile.rotation = projectile.velocity.X * 0.05f; if (Math.Abs(projectile.velocity.X) <= 0f) @@ -233,19 +219,18 @@ namespace CalamityMod.Projectiles.Summon projectile.friendly = true; float minionSpeed = amalgam ? 20f : 8f; float turnSpeed = 14f; - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = center.X - projPos.X; - float yDist = center.Y - projPos.Y - 60f; - Vector2 targetVector = new Vector2(xDist, yDist); - float targetDist = targetVector.Length(); + Vector2 targetLocation = targetVec - projectile.Center; + float targetDist = targetLocation.Length(); if (targetDist < 100f) minionSpeed = amalgam ? 25f : 10f; - Vector2 homeInVector = projectile.DirectionTo(targetVector); + Vector2 homeInVector = projectile.DirectionTo(targetLocation); if (homeInVector.HasNaNs()) homeInVector = Vector2.UnitY; - projectile.velocity = (projectile.velocity * turnSpeed + homeInVector * minionSpeed) / (turnSpeed + 1f); + targetLocation.Normalize(); + targetLocation *= minionSpeed; + projectile.velocity = (projectile.velocity * turnSpeed + targetLocation) / (turnSpeed + 1f); } else { @@ -277,5 +262,7 @@ namespace CalamityMod.Projectiles.Summon } CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/GammaBullet.cs b/Projectiles/Summon/GammaBullet.cs index f9356ec004..ead4b2300a 100644 --- a/Projectiles/Summon/GammaBullet.cs +++ b/Projectiles/Summon/GammaBullet.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Summon/GammaCanister.cs b/Projectiles/Summon/GammaCanister.cs index 625bcd770f..c997d37fc3 100644 --- a/Projectiles/Summon/GammaCanister.cs +++ b/Projectiles/Summon/GammaCanister.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Summon/GammaDeathray.cs b/Projectiles/Summon/GammaDeathray.cs index 1d09b78568..d7b1961d43 100644 --- a/Projectiles/Summon/GammaDeathray.cs +++ b/Projectiles/Summon/GammaDeathray.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Summon/GammaHead.cs b/Projectiles/Summon/GammaHead.cs index efd665a5b9..759fe64824 100644 --- a/Projectiles/Summon/GammaHead.cs +++ b/Projectiles/Summon/GammaHead.cs @@ -5,14 +5,13 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; -using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class GammaHead : ModProjectile + public class GammaHead : ModProjectile { public Vector2 DeltaPosition; public int BulletShootCounter; diff --git a/Projectiles/Summon/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs new file mode 100644 index 0000000000..e189e999c6 --- /dev/null +++ b/Projectiles/Summon/GastricBelcher.cs @@ -0,0 +1,328 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class GastricBelcher : ModProjectile + { + private bool initialized = false; + private int bubbleCounter = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gastric Belcher"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 40; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } + + public override void AI() + { + //Set namespaces + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + CalamityGlobalProjectile modProj = projectile.Calamity(); + + //On spawn effects + if (!initialized) + { + //Set constants + modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); + modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; + //Spawn dust + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) + { + int randomDust = Utils.SelectRandom(Main.rand, new int[] + { + 33, + 89 + }); + Vector2 direction = Vector2.Normalize(projectile.velocity) * new Vector2(projectile.width / 2f, projectile.height) * 0.75f; + direction = direction.RotatedBy((double)((dustIndex - (dustAmt / 2f - 1f)) * MathHelper.TwoPi / dustAmt), default) + projectile.Center; + Vector2 dustVel = direction - projectile.Center; + int water = Dust.NewDust(direction + dustVel, 0, 0, randomDust, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); + Main.dust[water].noGravity = true; + Main.dust[water].velocity = dustVel; + } + initialized = true; + } + + //Flexible minion damage update + if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(modProj.spawnedPlayerMinionProjectileDamageValue / + modProj.spawnedPlayerMinionDamageValue * player.MinionDamage()); + projectile.damage = damage2; + } + + //Update frames + if (projectile.frameCounter++ % 6 == 0) + { + projectile.frame++; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + //Set up buff and timeLeft + bool typeCheck = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (typeCheck) + { + if (player.dead) + { + modPlayer.gastricBelcher = false; + } + if (modPlayer.gastricBelcher) + { + projectile.timeLeft = 2; + } + } + + //Anti sticky movement to prevent overlapping minions + projectile.MinionAntiClump(); + + //Find a target + float maxDistance = 700f; + Vector2 targetVec = projectile.position; + Vector2 half = new Vector2(0.5f); + bool foundTarget = false; + //If targeting something, prioritize that enemy + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + //Adding a check on the NPC's size allows it to target big things like Providence + Vector2 sizeCheck = npc.position + npc.Size * half; + //Check if blocks are in the way + bool collisionCheck = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + //Calculate distance between target and the projectile to know if it's too far or not + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < maxDistance && collisionCheck) + { + maxDistance = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + else + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(projectile, false)) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + bool collisionCheck = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < maxDistance && collisionCheck) + { + maxDistance = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + } + + //If too far, make the minion start returning to the player. + float returnDist = 1000f; + if (foundTarget) + { + //Max travel distance increases if targeting something + returnDist = 2200f; + } + if (Vector2.Distance(player.Center, projectile.Center) > returnDist) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + + //If a target is found, move toward it + if (foundTarget && projectile.ai[0] == 0f) + { + Vector2 vecToTarget = targetVec - projectile.Center; + float targetDist = vecToTarget.Length(); + vecToTarget.Normalize(); + //If farther than 200 pixels, move toward it + if (targetDist > 200f) + { + float speedMult = (targetDist > 400f) ? 12f : (targetDist > 250) ? 6f : 3f; + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + //Otherwise, back it up slowly + else + { + float speedMult = -3f; + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + } + + //If not targeting something, act passively + else + { + bool returningToPlayer = false; + if (!returningToPlayer) + { + returningToPlayer = projectile.ai[0] == 1f; + } + //Move faster if actively returning to the player + float speedMult = 10f; + if (returningToPlayer) + { + speedMult = 21f; + } + Vector2 vecToPlayer = player.Center - projectile.Center + new Vector2(0f, -60f); + float playerDist = vecToPlayer.Length(); + //Slow down if near the player + if (playerDist < 200f && speedMult > 8f) + { + speedMult = 1f; + } + //If close enough to the player, return to normal + if (playerDist < 150f && returningToPlayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + //If abnormally far, teleport to the player + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - (projectile.width / 2f); + projectile.position.Y = player.Center.Y - (projectile.height / 2f); + projectile.netUpdate = true; + } + //Move toward player if more than 70 pixels away + if (playerDist > 70f) + { + vecToPlayer.Normalize(); + vecToPlayer *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToPlayer) / 41f; + } + //Move if still + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + + //Update sprite direction and rotation + if (foundTarget) + { + projectile.spriteDirection = projectile.direction = ((targetVec.X - projectile.Center.X) > 0).ToDirectionInt(); + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi), 0.1f); + } + else + { + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + } + + //Increment attack cooldown + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += Main.rand.Next(1, 4); + } + //Set the minion to be ready for attack + if (projectile.ai[1] > 90f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + + //Return if on attack cooldown, has no target, or returning to the player + if (projectile.ai[0] != 0f || !foundTarget || projectile.ai[1] != 0f) + return; + + if (Main.myPlayer == projectile.owner) + { + //Play vomit sound + if (modPlayer.soundCooldown <= 0) + { + Main.PlaySound(SoundID.NPCKilled, (int)projectile.Center.X, (int)projectile.Center.Y, 13, 0.5f, 0f); + modPlayer.soundCooldown = Main.rand.Next(120, 180); + } + + //Increment the attack counter + projectile.ai[1]++; + + int projType = ModContent.ProjectileType(); + + //Calculate the general velocity + Vector2 velocity = targetVec - projectile.Center; + velocity.Normalize(); + + //Add some inaccuracy for the vomit projectiles + float vomitSpeedMult = 16f; + Vector2 vomitVel = velocity * vomitSpeedMult; + vomitVel.Y += Main.rand.NextFloat(-30f, 30f) * 0.05f; + vomitVel.X += Main.rand.NextFloat(-30f, 30f) * 0.05f; + + //Fire the vomit projectile + Projectile.NewProjectile(projectile.Center, vomitVel, projType, projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(3), 0f); + + //Fire 5 bubbles for every three attacks + if (bubbleCounter++ % 3 == 2) + { + for (int projCount = 0; projCount < 5; projCount++) + { + //Add a shotgun spread to the bubbles + float bubbleSpeedMult = 14f; + Vector2 bubbleVel = velocity * bubbleSpeedMult; + bubbleVel.Y += Main.rand.NextFloat(-50f, 50f) * 0.05f; + bubbleVel.X += Main.rand.NextFloat(-50f, 50f) * 0.05f; + + Projectile.NewProjectile(projectile.Center, bubbleVel, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } + + projectile.netUpdate = true; + } + } + + //This minion does no contact damage + public override bool CanDamage() => false; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int frameHeight = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = frameHeight * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), projectile.scale, spriteEffects, 0f); + return false; + } + } +} diff --git a/Projectiles/Summon/GastricBelcher.png b/Projectiles/Summon/GastricBelcher.png new file mode 100644 index 0000000000..f5fd2d0d20 Binary files /dev/null and b/Projectiles/Summon/GastricBelcher.png differ diff --git a/Projectiles/Summon/GastricBelcherBubble.cs b/Projectiles/Summon/GastricBelcherBubble.cs new file mode 100644 index 0000000000..786a429c28 --- /dev/null +++ b/Projectiles/Summon/GastricBelcherBubble.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class GastricBelcherBubble : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gastric Bubble"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = projectile.height = 18; + projectile.minion = true; + projectile.timeLeft = 180; + projectile.aiStyle = 72; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item54, projectile.position); + Vector2 center = projectile.Center; + for (int dustIndex = 0; dustIndex < 10; ++dustIndex) + { + int scalar = (int)(10 * projectile.ai[1]); + int bubble = Dust.NewDust(projectile.Center - Vector2.One * scalar, scalar * 2, scalar * 2, 212, 0.0f, 0.0f, 0, new Color(), 1f); + Dust dust = Main.dust[bubble]; + Vector2 dustVec = Vector2.Normalize(dust.position - projectile.Center); + dust.position = projectile.Center + dustVec * scalar * projectile.scale; + dust.velocity = dustIndex >= 30 ? dustVec * Main.rand.Next(45, 91) / 10f : dustVec * dust.velocity.Length(); + dust.color = Main.hslToRgb(0.4f + Main.rand.NextFloat() * 0.2f, 0.9f, 0.5f); + dust.color = Color.Lerp(dust.color, Color.White, 0.3f); + dust.noGravity = true; + dust.scale = 0.7f; + } + } + } +} diff --git a/Projectiles/Summon/GastricBelcherBubble.png b/Projectiles/Summon/GastricBelcherBubble.png new file mode 100644 index 0000000000..c919f9c2d5 Binary files /dev/null and b/Projectiles/Summon/GastricBelcherBubble.png differ diff --git a/Projectiles/Summon/GastricBelcherVomit.cs b/Projectiles/Summon/GastricBelcherVomit.cs new file mode 100644 index 0000000000..bb9909b9cf --- /dev/null +++ b/Projectiles/Summon/GastricBelcherVomit.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class GastricBelcherVomit : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gastric Vomit"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = projectile.height = 18; + projectile.minion = true; + projectile.timeLeft = 300; + projectile.penetrate = 3; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } + + public override void AI() + { + //Rotation and gravity + projectile.rotation += 0.6f * projectile.direction; + projectile.velocity.Y += 0.27f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y); + //Dust effect + int splash = 0; + while (splash < 4) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 233, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 150, default, 0.9f); + splash += 1; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture; + switch (projectile.ai[0]) + { + case 1f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/GastricBelcherVomit2"); + break; + case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/GastricBelcherVomit3"); + break; + default: texture = Main.projectileTexture[projectile.type]; + break; + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Summon/GastricBelcherVomit.png b/Projectiles/Summon/GastricBelcherVomit.png new file mode 100644 index 0000000000..6e22f7d039 Binary files /dev/null and b/Projectiles/Summon/GastricBelcherVomit.png differ diff --git a/Projectiles/Summon/GastricBelcherVomit2.png b/Projectiles/Summon/GastricBelcherVomit2.png new file mode 100644 index 0000000000..717b9e9ebe Binary files /dev/null and b/Projectiles/Summon/GastricBelcherVomit2.png differ diff --git a/Projectiles/Summon/GastricBelcherVomit3.png b/Projectiles/Summon/GastricBelcherVomit3.png new file mode 100644 index 0000000000..83ec95521f Binary files /dev/null and b/Projectiles/Summon/GastricBelcherVomit3.png differ diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index 0a1b4c5577..63785476a1 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index ad409440c7..7653515597 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Summon projectile.width = projectile.height = 160; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 30; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1.2f); diff --git a/Projectiles/Summon/GiantIbanRobotOfDoom.cs b/Projectiles/Summon/GiantIbanRobotOfDoom.cs index 024a04af96..97bf416ef4 100644 --- a/Projectiles/Summon/GiantIbanRobotOfDoom.cs +++ b/Projectiles/Summon/GiantIbanRobotOfDoom.cs @@ -1,20 +1,17 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Buffs.Mounts; using CalamityMod.Items; using CalamityMod.Projectiles.Summon.AndromedaUI; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; using System; -using System.Collections.Generic; -using CalamityMod.Buffs.Cooldowns; namespace CalamityMod.Projectiles.Summon { - public class AndromedaHead : EquipTexture + public class AndromedaHead : EquipTexture { public override bool DrawHead() => false; } diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index 24b3c68232..6b99b1aa30 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { @@ -102,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 100; diff --git a/Projectiles/Summon/HallowedStarSummon.cs b/Projectiles/Summon/HallowedStarSummon.cs index 96015a9d80..05788a4298 100644 --- a/Projectiles/Summon/HallowedStarSummon.cs +++ b/Projectiles/Summon/HallowedStarSummon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item9, projectile.position); } } projectile.alpha -= 15; diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index 02123535bb..d02acf13f2 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class HauntedDishes : ModProjectile + public class HauntedDishes : ModProjectile { public float dust = 0f; diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index 2be4d195da..6e7e375163 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 6ce24ae4d3..36d87f9dba 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = projectile.direction; } @@ -78,10 +78,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - float num633 = 600f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; + bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) @@ -95,180 +92,8 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 7f; //8 - projectile.netUpdate = true; - } - } - } + + projectile.ChargingMinionAI(600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 7f, false, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index a4ed1d9953..a5ef59097b 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/Hiveling.cs b/Projectiles/Summon/Hiveling.cs index aea3b638f1..018f06728e 100644 --- a/Projectiles/Summon/Hiveling.cs +++ b/Projectiles/Summon/Hiveling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/HowlsHeartCalcifer.cs b/Projectiles/Summon/HowlsHeartCalcifer.cs index f45b5650b8..1cf16cd768 100644 --- a/Projectiles/Summon/HowlsHeartCalcifer.cs +++ b/Projectiles/Summon/HowlsHeartCalcifer.cs @@ -1,13 +1,10 @@ using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class HowlsHeartCalcifer : ModProjectile + public class HowlsHeartCalcifer : ModProjectile { public override void SetStaticDefaults() { @@ -49,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon } } Lighting.AddLight(projectile.Center, 0.75f, 0.485f, 0f); - CalamityGlobalProjectile.FloatingPetAI(projectile, false, 0.04f, true); + projectile.FloatingPetAI(false, 0.04f, true); projectile.frameCounter++; if (projectile.frameCounter > 6) { diff --git a/Projectiles/Summon/HowlsHeartFireball.cs b/Projectiles/Summon/HowlsHeartFireball.cs index bc1acf984e..6c640d5fd7 100644 --- a/Projectiles/Summon/HowlsHeartFireball.cs +++ b/Projectiles/Summon/HowlsHeartFireball.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class HowlsHeartFireball : ModProjectile + public class HowlsHeartFireball : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/HowlsHeartHowl.cs b/Projectiles/Summon/HowlsHeartHowl.cs index 1c063c2e31..caf409d2de 100644 --- a/Projectiles/Summon/HowlsHeartHowl.cs +++ b/Projectiles/Summon/HowlsHeartHowl.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -7,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class HowlsHeartHowl : ModProjectile + public class HowlsHeartHowl : ModProjectile { public bool initialized = false; @@ -25,7 +24,7 @@ namespace CalamityMod.Projectiles.Summon projectile.height = 54; projectile.netImportant = true; projectile.friendly = true; - projectile.minionSlots = 1f; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.timeLeft *= 5; @@ -86,22 +85,6 @@ namespace CalamityMod.Projectiles.Summon } //Anti sticky movement although there should only be one - float antiStickyFloat = 0.05f; - for (int index = 0; index < Main.maxProjectiles; ++index) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && proj.active && (proj.owner == projectile.owner && proj.type == projectile.type) && (double)Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - projectile.velocity.X -= antiStickyFloat; - else - projectile.velocity.X += antiStickyFloat; - if (projectile.position.Y < proj.position.Y) - projectile.velocity.Y -= antiStickyFloat; - else - projectile.velocity.Y += antiStickyFloat; - } - } //Set tile collision for only when trying to return to the player projectile.tileCollide = projectile.ai[0] != 1f; diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 3d20d0f0be..b50e92bebc 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -75,10 +75,6 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0.05f, 0.15f, 0.2f); - float num633 = 700f; - float num634 = 1000f; - float num635 = 2200f; - float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) @@ -92,182 +88,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() - 1.57f; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 9f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + projectile.ChargingMinionAI(700f, 1000f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); + projectile.rotation = projectile.velocity.ToRotation() - 1.57f; - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 9f; //8 - projectile.netUpdate = true; - } - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/IceSentryFrostBolt.cs b/Projectiles/Summon/IceSentryFrostBolt.cs index 39f88c650e..baaa3e9518 100644 --- a/Projectiles/Summon/IceSentryFrostBolt.cs +++ b/Projectiles/Summon/IceSentryFrostBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -83,14 +83,14 @@ namespace CalamityMod.Projectiles.Summon { projectile.velocity.Y = -oldVelocity.Y; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + Main.PlaySound(SoundID.Item10, projectile.position); } return false; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 27); for (int k = 0; k < 5; k++) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); diff --git a/Projectiles/Summon/IceSentryShard.cs b/Projectiles/Summon/IceSentryShard.cs index 379392a9e5..7a1f1de402 100644 --- a/Projectiles/Summon/IceSentryShard.cs +++ b/Projectiles/Summon/IceSentryShard.cs @@ -22,22 +22,11 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Frost Shard"); - Main.projFrames[projectile.type] = 5; ProjectileID.Sets.SentryShot[projectile.type] = true; } public override void AI() { - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frameCounter = 0; - projectile.frame++; - } - - if (projectile.frame >= 5) - projectile.frame = 0; - projectile.velocity.Y += 0.2f; if (projectile.localAI[0] == 0f || projectile.localAI[0] == 2f) { diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 45bd0759f1..4f16f3ef5f 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -2,7 +2,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.ID; @@ -10,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class IgneousBlade : ModProjectile + public class IgneousBlade : ModProjectile { public bool Firing = false; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/IrradiatedAura.cs b/Projectiles/Summon/IrradiatedAura.cs index 9d1d68a9ab..9887357c79 100644 --- a/Projectiles/Summon/IrradiatedAura.cs +++ b/Projectiles/Summon/IrradiatedAura.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; namespace CalamityMod.Projectiles.Summon { - public class IrradiatedAura : ModProjectile + public class IrradiatedAura : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index 61f464b669..6605f77c63 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -140,9 +140,9 @@ namespace CalamityMod.Projectiles.Summon { target.AddBuff(ModContent.BuffType(), 180); if (playSound) - { - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); - } + { + Main.PlaySound(SoundID.Item74, projectile.position); + } playSound = false; } } diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs index d73074b8a1..77bf181500 100644 --- a/Projectiles/Summon/LanternSoul.cs +++ b/Projectiles/Summon/LanternSoul.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index dbbf55d8b7..29066770e9 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -84,10 +84,7 @@ namespace CalamityMod.Projectiles.Summon projectile.localAI[0] = 0f; } } - float num633 = 700f; - float num634 = 1000f; - float num635 = 2200f; - float num636 = 150f; + bool flag64 = projectile.type == ModContent.ProjectileType(); if (flag64) { @@ -96,182 +93,10 @@ namespace CalamityMod.Projectiles.Summon projectile.Kill(); } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() + 1.57f; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 9f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + projectile.ChargingMinionAI(700f, 1000f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); + projectile.rotation = projectile.velocity.ToRotation() + 1.57f; - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 9f; //8 - projectile.netUpdate = true; - } - } - } } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/MagicAxe.cs b/Projectiles/Summon/MagicAxe.cs index fa1a5f2f3a..c1c75c88fd 100644 --- a/Projectiles/Summon/MagicAxe.cs +++ b/Projectiles/Summon/MagicAxe.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MagicAxe : ModProjectile + public class MagicAxe : ModProjectile { private int counter = 0; public override void SetStaticDefaults() @@ -49,30 +48,7 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha -= 50; float num634 = 1200f; float num635 = 2500f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.projectile.Length; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); if (projectile.ai[1] <= 30) { projectile.ai[1]++; diff --git a/Projectiles/Summon/MagicBird.cs b/Projectiles/Summon/MagicBird.cs index 0368314b90..60d1c89402 100644 --- a/Projectiles/Summon/MagicBird.cs +++ b/Projectiles/Summon/MagicBird.cs @@ -1,4 +1,3 @@ -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MagicBird : ModProjectile + public class MagicBird : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/MagicBullet.cs b/Projectiles/Summon/MagicBullet.cs index cf7d5502ea..5e92de59ea 100644 --- a/Projectiles/Summon/MagicBullet.cs +++ b/Projectiles/Summon/MagicBullet.cs @@ -1,58 +1,64 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MagicBullet : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bullet"); - ProjectileID.Sets.MinionShot[projectile.type] = true; - } + public class MagicBullet : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bullet"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.light = 0.5f; - projectile.alpha = 255; - projectile.extraUpdates = 7; - projectile.scale = 1.18f; - projectile.friendly = true; - projectile.minion = true; - projectile.ignoreWater = true; - projectile.aiStyle = 1; - aiType = 242; - projectile.penetrate = 1; - projectile.timeLeft = 600; + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.extraUpdates = 7; + projectile.scale = 1.18f; + projectile.friendly = true; + projectile.minion = true; + projectile.ignoreWater = true; + projectile.aiStyle = 1; + aiType = ProjectileID.BulletHighVelocity; + projectile.penetrate = 1; + projectile.timeLeft = 600; projectile.tileCollide = false; - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.BetsysCurse, 180); - target.AddBuff(BuffID.Ichor, 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (!target.betsysCurse) + target.AddBuff(BuffID.BetsysCurse, 180); + if (!target.ichor) + target.AddBuff(BuffID.Ichor, 180); + if (target.Calamity().marked <= 0) + target.AddBuff(ModContent.BuffType(), 180); + if (target.Calamity().aCrunch <= 0) + target.AddBuff(ModContent.BuffType(), 180); + if (target.Calamity().wCleave <= 0) + target.AddBuff(ModContent.BuffType(), 180); + if (target.Calamity().wDeath <= 0) + target.AddBuff(ModContent.BuffType(), 180); + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.BetsysCurse, 180); - target.AddBuff(BuffID.Ichor, 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + } - public override Color? GetAlpha(Color lightColor) - { - return new Color(189, 51, 164, projectile.alpha); - } - } + public override Color? GetAlpha(Color lightColor) + { + return new Color(189, 51, 164, projectile.alpha); + } + } } diff --git a/Projectiles/Summon/MagicHammer.cs b/Projectiles/Summon/MagicHammer.cs index 8169471b2e..afddf9d1a4 100644 --- a/Projectiles/Summon/MagicHammer.cs +++ b/Projectiles/Summon/MagicHammer.cs @@ -1,5 +1,3 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -8,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MagicHammer : ModProjectile + public class MagicHammer : ModProjectile { private int counter = 0; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/MagicRifle.cs b/Projectiles/Summon/MagicRifle.cs index 001b0945c4..e59667cb4c 100644 --- a/Projectiles/Summon/MagicRifle.cs +++ b/Projectiles/Summon/MagicRifle.cs @@ -1,5 +1,4 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -7,230 +6,231 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MagicRifle : ModProjectile - { + public class MagicRifle : ModProjectile + { private int counter = 0; private bool canHome = false; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rifle"); - ProjectileID.Sets.MinionShot[projectile.type] = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rifle"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minionSlots = 0f; - projectile.timeLeft = 180; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.minion = true; - } + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 180; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.projectile.Length; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + public override void AI() + { + //Set player namespace + Player player = Main.player[projectile.owner]; + + //Anti sticky movement to prevent overlapping minions + projectile.MinionAntiClump(); + + //Try not to do anything at first if (counter <= 30) { counter++; canHome = true; } - float homingRange = MagicHat.Range; - float num634 = 1600f; - float num635 = 2600f; - float num636 = 600f; - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false) && canHome) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < homingRange) - { - homingRange = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.npc.Length; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false) && canHome) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < homingRange) - { - homingRange = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 18f; //12 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 9f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 12f; - if (flag26) - { - num650 = 30f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 16f) - { - num650 = 16f; - } - if (num651 < num636 && flag26) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (flag25) - { - projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = (vector46 - projectile.Center).ToRotation() + (projectile.spriteDirection == 1 ? MathHelper.ToRadians(315) : MathHelper.ToRadians(135)); - } - else - { - projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? MathHelper.ToRadians(315) : MathHelper.ToRadians(135)); - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 90f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - float scaleFactor3 = 6f; - int projType = ModContent.ProjectileType(); - if (flag25 && projectile.ai[1] == 0f) - { - if (Main.rand.NextBool(6)) + float homingRange = MagicHat.Range; + Vector2 targetVec = projectile.position; + Vector2 half = new Vector2(0.5f); + bool foundTarget = false; + //If targeting something, prioritize that enemy + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false) && canHome) + { + //Adding a check on the NPC's size allows it to target big things like Providence + Vector2 sizeCheck = npc.position + npc.Size * half; + //Calculate distance between target and the projectile to know if it's too far or not + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < homingRange) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20, 0.1f); + homingRange = targetDist; + targetVec = sizeCheck; + foundTarget = true; } - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - Vector2 value19 = vector46 - projectile.Center; - value19.Normalize(); - value19 *= scaleFactor3; - Main.PlaySound(SoundID.Item40, projectile.position); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, projType, projectile.damage, 0f, Main.myPlayer, 0f, 0f); - projectile.netUpdate = true; - } - } - } - } + } + } + else + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(projectile, false) && canHome) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && targetDist < homingRange) + { + homingRange = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + } - public override Color? GetAlpha(Color lightColor) - { - return new Color(148, 0, 211, projectile.alpha); - } + //If too far, make the minion start returning to the player. + float separationAnxietyDist = 1600f; + if (foundTarget) + { + //Max travel distance increases if targeting something + separationAnxietyDist = 2600f; + } + if (Vector2.Distance(player.Center, projectile.Center) > separationAnxietyDist) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } - public override bool CanDamage() - { - return false; - } + //If a target is found, move toward it + if (foundTarget && projectile.ai[0] == 0f) + { + Vector2 vecToTarget = targetVec - projectile.Center; + float targetDist = vecToTarget.Length(); + vecToTarget.Normalize(); + //If farther than 200 pixels, move toward it + if (targetDist > 200f) + { + float speedMult = 18f; //12 + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + //Otherwise, back it up slowly + else + { + float speedMult = -9f; + vecToTarget *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToTarget) / 41f; + } + } - public override void Kill(int timeLeft) - { - for (int i = 0; i < 10; i++) - { - Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f)); - int dust = Dust.NewDust(projectile.Center, 1, 1, 66, dspeed.X, dspeed.Y, 160, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); - Main.dust[dust].noGravity = true; - } - } - } + //If not targeting something, act passively + else + { + bool returningToPlayer = false; + if (!returningToPlayer) + { + returningToPlayer = projectile.ai[0] == 1f; + } + //Move faster if actively returning to the player + float speedMult = 12f; + if (returningToPlayer) + { + speedMult = 30f; + } + Vector2 vecToPlayer = player.Center - projectile.Center + new Vector2(0f, -120f); + float playerDist = vecToPlayer.Length(); + //Speed up if near the player + if (playerDist < 200f && speedMult < 16f) + { + speedMult = 16f; + } + //If close enough to the player, return to normal + if (playerDist < 600f && returningToPlayer) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + //If abnormally far, teleport to the player + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + //Move toward player if more than 70 pixels away + if (playerDist > 70f) + { + vecToPlayer.Normalize(); + vecToPlayer *= speedMult; + projectile.velocity = (projectile.velocity * 40f + vecToPlayer) / 41f; + } + //Move if still + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + + //Update rotation + if (foundTarget) + { + projectile.spriteDirection = projectile.direction = ((targetVec.X - projectile.Center.X) > 0).ToDirectionInt(); + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + (projectile.spriteDirection == 1 ? MathHelper.ToRadians(45) : MathHelper.ToRadians(135)), 0.1f); + } + else + { + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? MathHelper.ToRadians(45) : MathHelper.ToRadians(135)); + } + + //Increment attack cooldown + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += Main.rand.Next(1, 4); + } + //Set the minion to be ready for attack + if (projectile.ai[1] > 90f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + + //Return if on attack cooldown, has no target, or returning to the player + if (projectile.ai[0] != 0f || !foundTarget || projectile.ai[1] != 0f) + return; + + //Shoot a bullet + if (Main.myPlayer == projectile.owner) + { + float projSpeed = 6f; + int projType = ModContent.ProjectileType(); + if (Main.rand.NextBool(6)) + { + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20, 0.1f); + } + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + Vector2 velocity = targetVec - projectile.Center; + velocity.Normalize(); + velocity *= projSpeed; + Main.PlaySound(SoundID.Item40, projectile.position); + Projectile.NewProjectile(projectile.Center, velocity, projType, projectile.damage, 0f, projectile.owner); + projectile.netUpdate = true; + } + } + } + + public override Color? GetAlpha(Color lightColor) => new Color(148, 0, 211, projectile.alpha); + + public override bool CanDamage() => false; + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 10; i++) + { + Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f)); + int dust = Dust.NewDust(projectile.Center, 1, 1, 66, dspeed.X, dspeed.Y, 160, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); + Main.dust[dust].noGravity = true; + } + } + } } diff --git a/Projectiles/Summon/MagicUmbrella.cs b/Projectiles/Summon/MagicUmbrella.cs index ed47093b0a..6ee1a99dbe 100644 --- a/Projectiles/Summon/MagicUmbrella.cs +++ b/Projectiles/Summon/MagicUmbrella.cs @@ -45,31 +45,7 @@ namespace CalamityMod.Projectiles.Summon float num634 = 1600f; float num635 = 2200f; float num636 = 150f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.projectile.Length; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); if (counter <= 30) { counter++; diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index 9316b05b0c..d2f81ece1d 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Summon/MechwormBody2.cs b/Projectiles/Summon/MechwormBody2.cs index 592f260996..7b80be9216 100644 --- a/Projectiles/Summon/MechwormBody2.cs +++ b/Projectiles/Summon/MechwormBody2.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index 94229ff581..b3c30b126c 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index e51919da9c..7da8598496 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Summon/MidnightSunBeaconProj.cs b/Projectiles/Summon/MidnightSunBeaconProj.cs index 4d53573ea8..a5bc92c304 100644 --- a/Projectiles/Summon/MidnightSunBeaconProj.cs +++ b/Projectiles/Summon/MidnightSunBeaconProj.cs @@ -1,4 +1,3 @@ -using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; @@ -6,7 +5,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MidnightSunBeaconProj : ModProjectile + public class MidnightSunBeaconProj : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/MidnightSunBeam.cs b/Projectiles/Summon/MidnightSunBeam.cs index 6de9189653..9bbc978cb7 100644 --- a/Projectiles/Summon/MidnightSunBeam.cs +++ b/Projectiles/Summon/MidnightSunBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Summon/MidnightSunSkyBeam.cs b/Projectiles/Summon/MidnightSunSkyBeam.cs index 12f930e0dd..6c3d5b5132 100644 --- a/Projectiles/Summon/MidnightSunSkyBeam.cs +++ b/Projectiles/Summon/MidnightSunSkyBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index db71e85737..e7ee1b1540 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,7 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class MidnightSunUFO : ModProjectile + public class MidnightSunUFO : ModProjectile { public const float DistanceToCheck = 2600f; public override void SetStaticDefaults() @@ -103,30 +102,7 @@ namespace CalamityMod.Projectiles.Summon ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } - float acceleration = 0.35f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= acceleration; - } - else - { - projectile.velocity.X += acceleration; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= acceleration; - } - else - { - projectile.velocity.Y += acceleration; - } - } - } + projectile.MinionAntiClump(0.35f); } else { @@ -163,30 +139,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.velocity = (projectile.velocity * 15f + projectile.DirectionTo(player.Center - new Vector2(player.direction * -80f, 160f)) * 19f) / 16f; - float acceleration = 0.35f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= acceleration; - } - else - { - projectile.velocity.X += acceleration; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= acceleration; - } - else - { - projectile.velocity.Y += acceleration; - } - } - } + projectile.MinionAntiClump(0.35f); projectile.rotation = projectile.velocity.X * 0.03f; } } diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 2ff98774ae..33161fc7c2 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -285,16 +285,16 @@ namespace CalamityMod.Projectiles.Summon else AI(1, num535, num536, player); } - if ((double)projectile.velocity.X > 0.25) + if (projectile.velocity.X > 0.25f) { projectile.direction = -1; } - else if ((double)projectile.velocity.X < -0.25) + else if (projectile.velocity.X < -0.25f) { projectile.direction = 1; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index 4177d8de6e..1adb554fc5 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -283,16 +283,16 @@ namespace CalamityMod.Projectiles.Summon else AI(1, num535, num536, player); } - if ((double)projectile.velocity.X > 0.25) + if (projectile.velocity.X > 0.25f) { projectile.direction = -1; } - else if ((double)projectile.velocity.X < -0.25) + else if (projectile.velocity.X < -0.25f) { projectile.direction = 1; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Summon/MiniGuardianHealer.cs b/Projectiles/Summon/MiniGuardianHealer.cs index 555088e8b8..1ab9ca526e 100644 --- a/Projectiles/Summon/MiniGuardianHealer.cs +++ b/Projectiles/Summon/MiniGuardianHealer.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index dd3378cb13..6add2fa1fc 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 19, 1f, 0f); + Main.PlaySound(SoundID.NPCDeath19, projectile.position); } if (projectile.ai[0] >= 45f) { @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon projectile.localNPCHitCooldown = 10; projectile.damage /= 2; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Summon/OldDukeHeadCorpse.cs b/Projectiles/Summon/OldDukeHeadCorpse.cs index 0cc1569751..c46a72e220 100644 --- a/Projectiles/Summon/OldDukeHeadCorpse.cs +++ b/Projectiles/Summon/OldDukeHeadCorpse.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 42c0e72143..4f1247aec7 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; @@ -72,30 +72,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); float num633 = 3000f; float num634 = 3500f; float num635 = 4000f; @@ -187,8 +164,8 @@ namespace CalamityMod.Projectiles.Summon } if (num651 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); projectile.netUpdate = true; } if (num651 > 70f) @@ -205,11 +182,11 @@ namespace CalamityMod.Projectiles.Summon } if (flag25) { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(vector46) + MathHelper.Pi, 0.1f); } else { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } if (projectile.ai[1] > 0f) { @@ -226,7 +203,7 @@ namespace CalamityMod.Projectiles.Summon int num658 = ModContent.ProjectileType(); if (flag25 && projectile.ai[1] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/Summon/PhoenixFireFriendly.cs b/Projectiles/Summon/PhoenixFireFriendly.cs index 4638dd68e1..a2eae68f58 100644 --- a/Projectiles/Summon/PhoenixFireFriendly.cs +++ b/Projectiles/Summon/PhoenixFireFriendly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index befeee5326..7f9af97df4 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -92,30 +92,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); bool flag24 = false; if (flag24) { @@ -249,7 +226,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 8); + Main.PlaySound(SoundID.Item8, projectile.position); Vector2 value19 = vector46 - projectile.Center; value19.Normalize(); value19 *= velocity; diff --git a/Projectiles/Summon/PlagueBeeSmall.cs b/Projectiles/Summon/PlagueBeeSmall.cs index 9d8a34765e..8ae6a5c1c7 100644 --- a/Projectiles/Summon/PlagueBeeSmall.cs +++ b/Projectiles/Summon/PlagueBeeSmall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Summon/PlaguePrincess.cs b/Projectiles/Summon/PlaguePrincess.cs index da7e5be419..b8fd4170ea 100644 --- a/Projectiles/Summon/PlaguePrincess.cs +++ b/Projectiles/Summon/PlaguePrincess.cs @@ -120,47 +120,24 @@ namespace CalamityMod.Projectiles.Summon } //anti sticking movement - float antiStickFloat = 0.05f; - for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) - { - Projectile proj = Main.projectile[projIndex]; - bool projCheck = proj.type == ModContent.ProjectileType(); - if (projIndex != projectile.whoAmI && proj.active && proj.owner == projectile.owner && projCheck && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X = projectile.velocity.X - antiStickFloat; - } - else - { - projectile.velocity.X = projectile.velocity.X + antiStickFloat; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - antiStickFloat; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + antiStickFloat; - } - } - } + projectile.MinionAntiClump(); //anti-sticking also applies to the player + float antiStickFloat = 0.05f; if (projectile.position.X < player.position.X) { - projectile.velocity.X = projectile.velocity.X - antiStickFloat; + projectile.velocity.X -= antiStickFloat; } else { - projectile.velocity.X = projectile.velocity.X + antiStickFloat; + projectile.velocity.X += antiStickFloat; } if (projectile.position.Y < player.position.Y) { - projectile.velocity.Y = projectile.velocity.Y - antiStickFloat; + projectile.velocity.Y -= antiStickFloat; } else { - projectile.velocity.Y = projectile.velocity.Y + antiStickFloat; + projectile.velocity.Y += antiStickFloat; } bool cancelAttack = false; diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index c064f0dbc9..0f5a496e48 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -3,7 +3,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class PlaguebringerSummon : ModProjectile + public class PlaguebringerSummon : ModProjectile { public const float auraRange = 960f; private int auraCounter = 0; @@ -83,31 +82,7 @@ namespace CalamityMod.Projectiles.Summon if (!modPlayer.plaguebringerPatronSet) projectile.Kill(); - float SAIMovement = 0.05f; - for (int i = 0; i < Main.maxProjectiles; i++) - { - Projectile proj = Main.projectile[i]; - bool minionTypeCheck = proj.type == ModContent.ProjectileType() || Main.projPet[proj.type]; - if (i != projectile.whoAmI && proj.active && proj.owner == projectile.owner && minionTypeCheck && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAIMovement; - } - else - { - projectile.velocity.X += SAIMovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAIMovement; - } - else - { - projectile.velocity.Y += SAIMovement; - } - } - } + projectile.MinionAntiClump(); int buffType = ModContent.BuffType(); float range = auraRange; diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index e54d51b734..6c790344dc 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -119,32 +119,9 @@ namespace CalamityMod.Projectiles.Summon float num634 = 1300f; float num635 = 2600f; float num636 = 600f; - float num637 = 0.05f; //idle movement - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); if (!enraged) { @@ -152,16 +129,18 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] = 0f; Vector2 vector46 = projectile.position; bool flag25 = false; + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -170,14 +149,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } @@ -255,11 +235,11 @@ namespace CalamityMod.Projectiles.Summon } if (flag25) { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(vector46) + MathHelper.Pi, 0.1f); } else { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } if (projectile.ai[1] > 0f) { @@ -273,28 +253,28 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[0] == 0f) { float scaleFactor3 = 6f; - int num658 = (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); + int projType = (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); int projDmg = (int)(projectile.damage * 0.7f); float speedMult = 1f; if (Main.rand.NextBool(4)) { - num658 = ModContent.ProjectileType(); + projType = ModContent.ProjectileType(); } - if (num658 == ModContent.ProjectileType()) + if (projType == ModContent.ProjectileType()) { speedMult = 2f; projDmg = (int)(projectile.damage * 1.2f); } if (projectile.ai[1] == 0f && flag25 && num633 < 500f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner) { Vector2 value19 = vector46 - projectile.Center; value19.Normalize(); value19 *= scaleFactor3; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X * speedMult, value19.Y * speedMult, num658, projDmg, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X * speedMult, value19.Y * speedMult, projType, projDmg, 0f, projectile.owner, 0f, 0f); projectile.netUpdate = true; } } @@ -326,16 +306,18 @@ namespace CalamityMod.Projectiles.Summon } Vector2 vector46 = projectile.position; bool flag25 = false; + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -344,14 +326,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/PlantThornBall.cs b/Projectiles/Summon/PlantThornBall.cs index 2a7ae2d49a..76e3d07270 100644 --- a/Projectiles/Summon/PlantThornBall.cs +++ b/Projectiles/Summon/PlantThornBall.cs @@ -1,4 +1,3 @@ -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class PlantThornBall : ModProjectile + public class PlantThornBall : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/PlateProjectile.cs b/Projectiles/Summon/PlateProjectile.cs index 30dcdae957..cbdac97176 100644 --- a/Projectiles/Summon/PlateProjectile.cs +++ b/Projectiles/Summon/PlateProjectile.cs @@ -1,11 +1,10 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; namespace CalamityMod.Projectiles.Summon { - public class PlateProjectile : ModProjectile + public class PlateProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -44,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(13, (int)projectile.Center.X, (int)projectile.Center.Y); + Main.PlaySound(SoundID.Shatter, (int)projectile.Center.X, (int)projectile.Center.Y); if (projectile.owner == Main.myPlayer) { for (int index = 0; index < 3; ++index) diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index e497365010..c04550dbc3 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class PowerfulRaven : ModProjectile + public class PowerfulRaven : ModProjectile { public const float DistanceToCheck = 3200f; public const float TeleportDistance = 2700f; diff --git a/Projectiles/Summon/PrincessMissile.cs b/Projectiles/Summon/PrincessMissile.cs index df6199ac5e..43765b9c89 100644 --- a/Projectiles/Summon/PrincessMissile.cs +++ b/Projectiles/Summon/PrincessMissile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int num621 = 0; num621 < 8; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index a93f7fbc6d..7896ddc29c 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.Center.X, projectile.Center.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 3a1804d6c9..905d11af2a 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SupremeCalamitas; @@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles.Summon { Split(false, false); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num193 = 0; num193 < 6; num193++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f); @@ -336,7 +336,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 200; @@ -736,7 +736,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 200; @@ -850,7 +850,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); if (!Main.rand.NextBool(3)) //1 in 3 chance for dust return; projectile.position.X = projectile.position.X + (float)(projectile.width / 2); @@ -1133,7 +1133,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 27); Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(3.1415927410125732); float num69 = (float)Main.rand.Next(7, 13); Vector2 value5 = new Vector2(2.1f, 2f); @@ -1305,7 +1305,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); if (Main.rand.NextBool(3)) { projectile.position.X = projectile.position.X + (float)(projectile.width / 2); diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index fd26f604bf..0927822a9d 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -8,281 +8,104 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class PurpleButterfly : ModProjectile - { - public int dust = 3; + public class PurpleButterfly : ModProjectile + { + public int dust = 3; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Butterfly"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Butterfly"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minionSlots = 1f; - projectile.timeLeft = 18000; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft *= 5; - projectile.minion = true; - } + public override void SetDefaults() + { + projectile.width = 30; + projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust > 0) - { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); - projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.5f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X, vector7.Y, 100, default, 1.8f); - Main.dust[num228].noGravity = true; - } - dust--; - } - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) - { - int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); - projectile.damage = damage2; - } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) - { - projectile.spriteDirection = -projectile.direction; - } - projectile.rotation = projectile.velocity.X * 0.02f; - projectile.frameCounter++; - if (projectile.frameCounter > 6) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - Lighting.AddLight(projectile.Center, 0.3f, 0f, 0.5f); - float num633 = 1200f; - float num634 = 1500f; - float num635 = 2400f; - float num636 = 150f; - bool flag64 = projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) - { - if (player.dead) - { - modPlayer.resButterfly = false; - } - if (modPlayer.resButterfly) - { - projectile.timeLeft = 2; - } - } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if ((npc.CanBeChasedBy(projectile, false) || npc.type == NPCID.DukeFishron) && npc.active) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if ((nPC2.CanBeChasedBy(projectile, false) || nPC2.type == NPCID.DukeFishron) && nPC2.active) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 18f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 9f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 10f; - if (flag26) - { - num650 = 24f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(40f, -40f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 12f) - { - num650 = 12f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 3); - } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 300f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 12f; - projectile.netUpdate = true; - } - } - } - } + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + if (dust > 0) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.5f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 173, vector7.X, vector7.Y, 100, default, 1.8f); + Main.dust[num228].noGravity = true; + } + dust--; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = damage2; + } + if (Math.Abs(projectile.velocity.X) > 0.2f) + { + projectile.spriteDirection = -projectile.direction; + } + projectile.rotation = projectile.velocity.X * 0.02f; + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + Lighting.AddLight(projectile.Center, 0.3f, 0f, 0.5f); + projectile.ChargingMinionAI(1200f, 1500f, 2400f, 150f, 0, 30f, 18f, -9f, 30f, 12f, true, true); + bool flag64 = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.resButterfly = false; + } + if (modPlayer.resButterfly) + { + projectile.timeLeft = 2; + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture2D13 = Main.projectileTexture[projectile.type]; + int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); + return false; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 6; - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 6; + } + } } diff --git a/Projectiles/Summon/RadiantResolutionFire.cs b/Projectiles/Summon/RadiantResolutionFire.cs index cdf928db0a..e069758014 100644 --- a/Projectiles/Summon/RadiantResolutionFire.cs +++ b/Projectiles/Summon/RadiantResolutionFire.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); for (int i = 0; i < 20; i++) { Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.ProfanedFire); diff --git a/Projectiles/Summon/RadiantResolutionOrb.cs b/Projectiles/Summon/RadiantResolutionOrb.cs index 75964c08f9..3fb5706260 100644 --- a/Projectiles/Summon/RadiantResolutionOrb.cs +++ b/Projectiles/Summon/RadiantResolutionOrb.cs @@ -1,12 +1,9 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class RadiantResolutionOrb : ModProjectile + public class RadiantResolutionOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index 91300cd59f..4ccf243923 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Summon Main.projectile[spore].usesLocalNPCImmunity = true; Main.projectile[spore].localNPCHitCooldown = 30; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 77); + Main.PlaySound(SoundID.Item77, projectile.position); projectile.ai[0] = 50f; } } diff --git a/Projectiles/Summon/RustShrapnel.cs b/Projectiles/Summon/RustShrapnel.cs index b6ec7cbe6e..336e16ce96 100644 --- a/Projectiles/Summon/RustShrapnel.cs +++ b/Projectiles/Summon/RustShrapnel.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Summon/RustyDrone.cs b/Projectiles/Summon/RustyDrone.cs index 20ee399b79..042137dfe4 100644 --- a/Projectiles/Summon/RustyDrone.cs +++ b/Projectiles/Summon/RustyDrone.cs @@ -1,5 +1,4 @@ using CalamityMod.Buffs.Summon; -using CalamityMod.Buffs.Cooldowns; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class RustyDrone : ModProjectile + public class RustyDrone : ModProjectile { public const float PlayerHomingInertia = 32f; public const float PlayerHomingSpeed = 11f; @@ -16,9 +15,9 @@ namespace CalamityMod.Projectiles.Summon public const float NPCHomingInertia = 20f; public const float NPCHomingSpeed = 14f; - public const float AttackRate = 110f; + public const float AttackRate = 140f; - public const float DistanceToCheck = 750f; + public const float DistanceToCheck = 585f; public const int ExplosionShrapnelBaseDamage = 16; // Uses player.MinionDamage @@ -139,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon Utils.PoofOfSmoke(projectile.Center); for (int i = 0; i < 4; i++) { - Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 8f, ModContent.ProjectileType(), + Projectile.NewProjectile(projectile.Center, Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * 8f, ModContent.ProjectileType(), (int)(ExplosionShrapnelBaseDamage * player.MinionDamage()), 2f, projectile.owner); } projectile.Kill(); diff --git a/Projectiles/Summon/SakuraBullet.cs b/Projectiles/Summon/SakuraBullet.cs index 78c2034756..d742786f82 100644 --- a/Projectiles/Summon/SakuraBullet.cs +++ b/Projectiles/Summon/SakuraBullet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Summon public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25); + Main.PlaySound(SoundID.Item25, projectile.position); int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 73, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 0.5f; if (Main.rand.NextBool(2)) diff --git a/Projectiles/Summon/SandBolt.cs b/Projectiles/Summon/SandBolt.cs index 5daeba3b35..9a76b93e71 100644 --- a/Projectiles/Summon/SandBolt.cs +++ b/Projectiles/Summon/SandBolt.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index 3a900d64de..ffa5c68efd 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Healing; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -101,30 +101,7 @@ namespace CalamityMod.Projectiles.Summon float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight(projectile.Center, 0.7f * num, 0.6f * num, 0f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); if (Vector2.Distance(player.Center, projectile.Center) > 400f) { projectile.ai[0] = 1f; @@ -201,7 +178,7 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] += 1f; if (Main.myPlayer == projectile.owner && player.statLife < player.statLifeMax2) { - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 6); + Main.PlaySound(SoundID.Dig, (int)projectile.position.X, (int)projectile.position.Y, 6); int num226 = 36; for (int num227 = 0; num227 < num226; num227++) { diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 59d3979ce8..2f60590d2d 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -93,30 +93,7 @@ namespace CalamityMod.Projectiles.Summon float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight(projectile.Center, 0.7f * num, 0.6f * num, 0f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } + projectile.MinionAntiClump(); Vector2 vector46 = projectile.position; bool flag25 = false; if (projectile.ai[0] != 1f) diff --git a/Projectiles/Summon/SandMark.cs b/Projectiles/Summon/SandMark.cs index dc2d685e63..15aef08a1d 100644 --- a/Projectiles/Summon/SandMark.cs +++ b/Projectiles/Summon/SandMark.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 60); + Main.PlaySound(SoundID.Item60, projectile.Center); } if (projectile.localAI[1] < 30f) { diff --git a/Projectiles/Summon/SandTornado.cs b/Projectiles/Summon/SandTornado.cs index b31e4f0d78..620285019e 100644 --- a/Projectiles/Summon/SandTornado.cs +++ b/Projectiles/Summon/SandTornado.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 122); + Main.PlaySound(SoundID.Item122, projectile.position); } projectile.ai[0] += 1f; if (projectile.ai[0] >= num1125) diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index edfc16bd79..059388b415 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -77,33 +77,9 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num8 = 0.1f; - float num9 = (float)projectile.width * 2f; - for (int j = 0; j < Main.maxProjectiles; j++) - { - if (j != projectile.whoAmI && Main.projectile[j].active && Main.projectile[j].owner == projectile.owner && Main.projectile[j].type == projectile.type && - Math.Abs(projectile.position.X - Main.projectile[j].position.X) + Math.Abs(projectile.position.Y - Main.projectile[j].position.Y) < num9) - { - if (projectile.position.X < Main.projectile[j].position.X) - { - projectile.velocity.X = projectile.velocity.X - num8; - } - else - { - projectile.velocity.X = projectile.velocity.X + num8; - } - if (projectile.position.Y < Main.projectile[j].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num8; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num8; - } - } - } + projectile.MinionAntiClump(0.1f); Vector2 vector = projectile.position; - float num10 = 900f; + float num10 = 1200f; bool flag = false; if (Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { @@ -157,12 +133,12 @@ namespace CalamityMod.Projectiles.Summon } } } - int num16 = 750; + float num16 = 1000f; if (flag) { - num16 = 2000; + num16 = 2500f; } - if (Vector2.Distance(player.Center, projectile.Center) > (float)num16) + if (Vector2.Distance(player.Center, projectile.Center) > num16) { projectile.ai[0] = 1f; projectile.netUpdate = true; diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index d6d76c956e..8f0f6249e4 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -1,14 +1,13 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class Shellfish : ModProjectile + public class Shellfish : ModProjectile { private int playerStill = 0; private bool fly = false; @@ -397,13 +396,13 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && Main.npc[i].defense < 9999 && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) { bool flag3; - if (Main.npc[i].type == 414) + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) { Rectangle rect = Main.npc[i].getRect(); int num5 = 8; diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index 697cbdc758..c5282b01c8 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index 963ddc0347..a9c0ebf248 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/SirenSongFriendly.cs b/Projectiles/Summon/SirenSongFriendly.cs index e6c8bb0d5a..60bb725ded 100644 --- a/Projectiles/Summon/SirenSongFriendly.cs +++ b/Projectiles/Summon/SirenSongFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/SkeletalDragonChild.cs b/Projectiles/Summon/SkeletalDragonChild.cs index 372511e4ec..e36f826882 100644 --- a/Projectiles/Summon/SkeletalDragonChild.cs +++ b/Projectiles/Summon/SkeletalDragonChild.cs @@ -1,14 +1,11 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class SkeletalDragonChild : ModProjectile + public class SkeletalDragonChild : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 2936adf730..99e696e153 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -1,14 +1,12 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class SkeletalDragonMother : ModProjectile + public class SkeletalDragonMother : ModProjectile { public const float DistanceToCheck = 1100f; public override void SetStaticDefaults() diff --git a/Projectiles/Summon/SolarBeam.cs b/Projectiles/Summon/SolarBeam.cs index 29af5bc873..27d6c29e48 100644 --- a/Projectiles/Summon/SolarBeam.cs +++ b/Projectiles/Summon/SolarBeam.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 242828bf03..af68240636 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index eda14913e8..8a253d29cc 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index 361eac8190..4a2c8758ab 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -60,20 +60,16 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 1000f; - float num634 = 2000f; - float num635 = 3000f; - float num636 = 500f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 1.2f * num, 0.8f * num, 0f * num); - bool flag64 = projectile.type == ModContent.ProjectileType(); + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 1.2f * lightScalar, 0.8f * lightScalar, 0f * lightScalar); + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -84,35 +80,8 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; if (projectile.ai[0] == 2f) { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -123,160 +92,22 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 1; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - projectile.frameCounter++; - if (projectile.frameCounter > 12) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + } + else + { + projectile.frameCounter++; + if (projectile.frameCounter > 12) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + + projectile.ChargingMinionAI(1000f, 2000f, 3000f, 500f, 1, 30f, 8f, -4f, 40f, 8f, true, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index b8118d738a..c047fb1e4f 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class Spikecrag : ModProjectile + public class Spikecrag : ModProjectile { public override void SetStaticDefaults() @@ -29,6 +28,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Player player = Main.player[projectile.owner]; + if (projectile.localAI[0] == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon } if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { - int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + int damage2 = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; @@ -53,13 +53,19 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - projectile.velocity.Y += 0.5f; + projectile.velocity.Y += 0.5f; if (projectile.velocity.Y > 10f) { projectile.velocity.Y = 10f; } + if (projectile.ai[0] > 0f) + { + projectile.ai[0] -= 1f; + return; + } + float maxDistance = 1000f; bool homeIn = false; @@ -75,13 +81,9 @@ namespace CalamityMod.Projectiles.Summon } } } - if (projectile.owner == Main.myPlayer && homeIn) + + if (projectile.owner == Main.myPlayer && homeIn) { - if (projectile.ai[0] != 0f) - { - projectile.ai[0] -= 1f; - return; - } projectile.ai[1] += 1f; if ((projectile.ai[1] % 10f) == 0f) { @@ -90,7 +92,7 @@ namespace CalamityMod.Projectiles.Summon { float velocityX = Main.rand.NextFloat(-10f, 10f); float velocityY = Main.rand.NextFloat(-15f, -8f); - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), velocityX, velocityY, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), velocityX, velocityY, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Summon/SpikecragSpike.cs b/Projectiles/Summon/SpikecragSpike.cs index 56d968d5c7..431048eb23 100644 --- a/Projectiles/Summon/SpikecragSpike.cs +++ b/Projectiles/Summon/SpikecragSpike.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon diff --git a/Projectiles/Summon/SquirrelSquireAcorn.cs b/Projectiles/Summon/SquirrelSquireAcorn.cs index dec73cfc81..8e312d4e7f 100644 --- a/Projectiles/Summon/SquirrelSquireAcorn.cs +++ b/Projectiles/Summon/SquirrelSquireAcorn.cs @@ -1,11 +1,10 @@ -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; namespace CalamityMod.Projectiles.Summon { - public class SquirrelSquireAcorn : ModProjectile + public class SquirrelSquireAcorn : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/SquirrelSquireMinion.cs b/Projectiles/Summon/SquirrelSquireMinion.cs index 5c369530e3..0e7023830d 100644 --- a/Projectiles/Summon/SquirrelSquireMinion.cs +++ b/Projectiles/Summon/SquirrelSquireMinion.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class SquirrelSquireMinion : ModProjectile + public class SquirrelSquireMinion : ModProjectile { public float dust = 0f; diff --git a/Projectiles/Summon/StormMarkSummon.cs b/Projectiles/Summon/StormMarkSummon.cs index cd9ece354a..a37881fbb2 100644 --- a/Projectiles/Summon/StormMarkSummon.cs +++ b/Projectiles/Summon/StormMarkSummon.cs @@ -1,8 +1,9 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.soundDelay == 0) { projectile.soundDelay = -1; - Main.PlaySound(2, projectile.Center, 60); + Main.PlaySound(SoundID.Item60, projectile.position); } if (projectile.localAI[1] < 30f) { diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index fcaad65b60..c60dbd44f6 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -3,7 +3,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Melee; using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; @@ -11,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class StormjawBaby : ModProjectile + public class StormjawBaby : ModProjectile { public float dust = 0f; private int sparkCounter = 0; diff --git a/Projectiles/Summon/SummonAstralExplosion.cs b/Projectiles/Summon/SummonAstralExplosion.cs index ee2bc6fffc..f647791e2b 100644 --- a/Projectiles/Summon/SummonAstralExplosion.cs +++ b/Projectiles/Summon/SummonAstralExplosion.cs @@ -1,12 +1,9 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class SummonAstralExplosion : ModProjectile + public class SummonAstralExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/TacticalPlagueEngineSummon.cs b/Projectiles/Summon/TacticalPlagueEngineSummon.cs index 6c9cefda9f..253acc9c81 100644 --- a/Projectiles/Summon/TacticalPlagueEngineSummon.cs +++ b/Projectiles/Summon/TacticalPlagueEngineSummon.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.CalPlayer; @@ -168,32 +168,7 @@ namespace CalamityMod.Projectiles.Summon } } } - float SAImovement = 0.25f; - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && - proj.active && proj.owner == projectile.owner && - proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= SAImovement; - } - else - { - projectile.velocity.X += SAImovement; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= SAImovement; - } - else - { - projectile.velocity.Y += SAImovement; - } - } - } + projectile.MinionAntiClump(0.25f); } } diff --git a/Projectiles/Summon/TundraFlameBlossom.cs b/Projectiles/Summon/TundraFlameBlossom.cs index 3833bfeb96..d591e44bc9 100644 --- a/Projectiles/Summon/TundraFlameBlossom.cs +++ b/Projectiles/Summon/TundraFlameBlossom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Summon; +using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index b2dcc7b2dc..225bfe34ea 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon Main.projectile[spore].minion = true; Main.projectile[spore].minionSlots = 0f; } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); + Main.PlaySound(SoundID.Item42, projectile.position); projectile.ai[0] = 60f; } } diff --git a/Projectiles/Summon/UrchinSpike.cs b/Projectiles/Summon/UrchinSpike.cs index b5cde9e756..3052ef049a 100644 --- a/Projectiles/Summon/UrchinSpike.cs +++ b/Projectiles/Summon/UrchinSpike.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 746ecdfc04..0c492c0bc0 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.valkyrie) @@ -45,7 +44,8 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } - if (flag64) + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -76,175 +76,21 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + + //Adjust sprite direction so it faces correctly + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 0f * num, 0.2f * num, 0.45f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (projectile.ai[0] != 1f) - { - projectile.tileCollide = false; - } - if (projectile.tileCollide && WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16))) - { - projectile.tileCollide = false; - } - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.tileCollide = false; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + projectile.ChargingMinionAI(700f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, true); + + //Give off some light + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 0f * lightScalar, 0.2f * lightScalar, 0.45f * lightScalar); + + //Frames projectile.frameCounter++; if (projectile.frameCounter > 7) { @@ -255,30 +101,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/VileFeederProjectile.cs b/Projectiles/Summon/VileFeederProjectile.cs index ab7a7be023..1cc1503570 100644 --- a/Projectiles/Summon/VileFeederProjectile.cs +++ b/Projectiles/Summon/VileFeederProjectile.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class VileFeederProjectile : ModProjectile + public class VileFeederProjectile : ModProjectile { private int bounce = 3; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 33c56c7099..f226988dca 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -90,31 +90,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - float antiStickyFloat = 0.05f; - for (int index = 0; index < Main.maxProjectiles; index++) - { - Projectile proj = Main.projectile[index]; - bool flag23 = proj.type == ModContent.ProjectileType(); - if (index != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X = projectile.velocity.X - antiStickyFloat; - } - else - { - projectile.velocity.X = projectile.velocity.X + antiStickyFloat; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - antiStickyFloat; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + antiStickyFloat; - } - } - } + projectile.MinionAntiClump(); projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -351,12 +327,12 @@ namespace CalamityMod.Projectiles.Summon { NPC npc = Main.npc[i]; if (npc.active && !npc.dontTakeDamage && npc.defense < 9999 && - ((projectile.friendly && (!npc.friendly || (npc.type == 22 && projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == 54 && projectile.owner < Main.maxPlayers && player.killClothier))) && (projectile.owner < 0 || npc.immune[projectile.owner] == 0 || projectile.maxPenetrate == 1))) + ((projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && projectile.owner < Main.maxPlayers && player.killClothier))) && (projectile.owner < 0 || npc.immune[projectile.owner] == 0 || projectile.maxPenetrate == 1))) { if (npc.noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(npc)) { bool flag3; - if (npc.type == 414) + if (npc.type == NPCID.SolarCrawltipedeTail) { Rectangle rect = npc.getRect(); int num5 = 8; diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index c680438b0d..e306f656ce 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Summon/WaterSpearFriendly.cs b/Projectiles/Summon/WaterSpearFriendly.cs index 7d750f174f..465acd66a3 100644 --- a/Projectiles/Summon/WaterSpearFriendly.cs +++ b/Projectiles/Summon/WaterSpearFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon } } projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 21); + Main.PlaySound(SoundID.Item21, projectile.position); } if (projectile.localAI[0] == 0f) { diff --git a/Projectiles/Summon/WulfrumBoltMinion.cs b/Projectiles/Summon/WulfrumBoltMinion.cs index 3ace303fb9..2d3c30e3ae 100644 --- a/Projectiles/Summon/WulfrumBoltMinion.cs +++ b/Projectiles/Summon/WulfrumBoltMinion.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 13aabe4831..cbc19cb5d6 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -1,6 +1,5 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; using Terraria; @@ -9,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class WulfrumDroid : ModProjectile + public class WulfrumDroid : ModProjectile { public float dust = 0f; @@ -88,22 +87,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num6 = 0.05f; - float width = (float) projectile.width; - for (int index = 0; index < Main.maxProjectiles; ++index) - { - if (index != projectile.whoAmI && Main.projectile[index].active && (Main.projectile[index].owner == projectile.owner && Main.projectile[index].type == projectile.type) && (double) Math.Abs(projectile.position.X - Main.projectile[index].position.X) + (double) Math.Abs(projectile.position.Y - Main.projectile[index].position.Y) < (double) width) - { - if ((double) projectile.position.X < (double) Main.projectile[index].position.X) - projectile.velocity.X -= num6; - else - projectile.velocity.X += num6; - if ((double) projectile.position.Y < (double) Main.projectile[index].position.Y) - projectile.velocity.Y -= num6; - else - projectile.velocity.Y += num6; - } - } + projectile.MinionAntiClump(); Vector2 vector2_3 = projectile.position; float num7 = 450f; bool flag = false; diff --git a/Projectiles/Summon/YoungDuke.cs b/Projectiles/Summon/YoungDuke.cs index e392105886..b33f6107c1 100644 --- a/Projectiles/Summon/YoungDuke.cs +++ b/Projectiles/Summon/YoungDuke.cs @@ -1,15 +1,12 @@ -using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class YoungDuke : ModProjectile + public class YoungDuke : ModProjectile { public const float DistanceBeforeCharge = 420f; diff --git a/Projectiles/Typeless/ArtifactOfResilienceShards.cs b/Projectiles/Typeless/ArtifactOfResilienceShards.cs index edd9c4e2c1..39d8212372 100644 --- a/Projectiles/Typeless/ArtifactOfResilienceShards.cs +++ b/Projectiles/Typeless/ArtifactOfResilienceShards.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Projectiles.Damageable; using Microsoft.Xna.Framework; diff --git a/Projectiles/Typeless/AstralFallingSand.cs b/Projectiles/Typeless/AstralFallingSand.cs index abe47c9030..86a3288bff 100644 --- a/Projectiles/Typeless/AstralFallingSand.cs +++ b/Projectiles/Typeless/AstralFallingSand.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralDesert; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Typeless/AstralSpray.cs b/Projectiles/Typeless/AstralSpray.cs index 8db6f3107f..cde6a93d77 100644 --- a/Projectiles/Typeless/AstralSpray.cs +++ b/Projectiles/Typeless/AstralSpray.cs @@ -1,4 +1,4 @@ - + using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 5f5a69cad3..525c749cd1 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.soundDelay = 20 + Main.rand.Next(40); if (Main.rand.NextBool(5)) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 9); } } projectile.alpha -= 15; diff --git a/Projectiles/Typeless/AtaxiaOrb.cs b/Projectiles/Typeless/AtaxiaOrb.cs index 1da5fe5d56..f59f33e26f 100644 --- a/Projectiles/Typeless/AtaxiaOrb.cs +++ b/Projectiles/Typeless/AtaxiaOrb.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/BallisticPoisonCloud.cs b/Projectiles/Typeless/BallisticPoisonCloud.cs index d2a0a701dd..b7f33c99e9 100644 --- a/Projectiles/Typeless/BallisticPoisonCloud.cs +++ b/Projectiles/Typeless/BallisticPoisonCloud.cs @@ -1,4 +1,5 @@ -using Terraria; +using System; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +10,7 @@ namespace CalamityMod.Projectiles.Typeless public override void SetStaticDefaults() { DisplayName.SetDefault("Cloud"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 10; } public override void SetDefaults() @@ -28,34 +29,26 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + projectile.ai[0] += 1f; projectile.frameCounter++; - if (projectile.frameCounter > 9) + if (projectile.frameCounter > 6) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) - { - projectile.frame = 0; - } + if (projectile.ai[0] < 219f) //255 - frameCounter tick * number of disippation frames + { + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + else if (projectile.owner == Main.myPlayer && projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.Kill(); + } projectile.velocity *= 0.98f; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 120f) - { - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else if (projectile.alpha > 80) + if (projectile.alpha > 80) { projectile.alpha -= 30; if (projectile.alpha < 80) @@ -63,6 +56,10 @@ namespace CalamityMod.Projectiles.Typeless projectile.alpha = 80; } } + if (Math.Abs(projectile.velocity.X) > 0.1f) + { + projectile.spriteDirection = -projectile.direction; + } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Typeless/BallisticPoisonCloud.png b/Projectiles/Typeless/BallisticPoisonCloud.png index 65fcbd400d..f9a1139c25 100644 Binary files a/Projectiles/Typeless/BallisticPoisonCloud.png and b/Projectiles/Typeless/BallisticPoisonCloud.png differ diff --git a/Projectiles/Typeless/BallisticPoisonCloud2.cs b/Projectiles/Typeless/BallisticPoisonCloud2.cs deleted file mode 100644 index 06e12c4d98..0000000000 --- a/Projectiles/Typeless/BallisticPoisonCloud2.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class BallisticPoisonCloud2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cloud"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 32; - projectile.height = 32; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.timeLeft = 3600; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 40; - } - - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 9) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - projectile.velocity *= 0.99f; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 150f) - { - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else if (projectile.alpha > 80) - { - projectile.alpha -= 30; - if (projectile.alpha < 80) - { - projectile.alpha = 80; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Venom, 240); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Venom, 240); - } - } -} diff --git a/Projectiles/Typeless/BallisticPoisonCloud2.png b/Projectiles/Typeless/BallisticPoisonCloud2.png deleted file mode 100644 index 9c040a1165..0000000000 Binary files a/Projectiles/Typeless/BallisticPoisonCloud2.png and /dev/null differ diff --git a/Projectiles/Typeless/BallisticPoisonCloud3.cs b/Projectiles/Typeless/BallisticPoisonCloud3.cs deleted file mode 100644 index 29ff512173..0000000000 --- a/Projectiles/Typeless/BallisticPoisonCloud3.cs +++ /dev/null @@ -1,78 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class BallisticPoisonCloud3 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cloud"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 32; - projectile.height = 32; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.timeLeft = 3600; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 40; - } - - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 9) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - projectile.velocity *= 0.97f; - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 90f) - { - if (projectile.alpha < 255) - { - projectile.alpha += 5; - if (projectile.alpha > 255) - { - projectile.alpha = 255; - } - } - else if (projectile.owner == Main.myPlayer) - { - projectile.Kill(); - } - } - else if (projectile.alpha > 80) - { - projectile.alpha -= 30; - if (projectile.alpha < 80) - { - projectile.alpha = 80; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Venom, 240); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Venom, 240); - } - } -} diff --git a/Projectiles/Typeless/BallisticPoisonCloud3.png b/Projectiles/Typeless/BallisticPoisonCloud3.png deleted file mode 100644 index 49ca5a9c3e..0000000000 Binary files a/Projectiles/Typeless/BallisticPoisonCloud3.png and /dev/null differ diff --git a/Projectiles/Typeless/BlazingSun.cs b/Projectiles/Typeless/BlazingSun.cs index 6f4b1f5ec9..43e9f34d17 100644 --- a/Projectiles/Typeless/BlazingSun.cs +++ b/Projectiles/Typeless/BlazingSun.cs @@ -1,5 +1,4 @@ -using Terraria; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework; using System; @@ -8,7 +7,7 @@ using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Typeless { - public class BlazingSun : ModProjectile + public class BlazingSun : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/BlazingSun2.cs b/Projectiles/Typeless/BlazingSun2.cs index dc995153eb..a2ab4860ea 100644 --- a/Projectiles/Typeless/BlazingSun2.cs +++ b/Projectiles/Typeless/BlazingSun2.cs @@ -1,10 +1,8 @@ -using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class BlazingSun2 : ModProjectile + public class BlazingSun2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/BloodBomb.cs b/Projectiles/Typeless/BloodBomb.cs index b74c429de6..c0f6ef183a 100644 --- a/Projectiles/Typeless/BloodBomb.cs +++ b/Projectiles/Typeless/BloodBomb.cs @@ -1,6 +1,8 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Typeless { public class BloodBomb : ModProjectile @@ -25,7 +27,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.4f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 73); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 3; num457++) diff --git a/Projectiles/Typeless/BloodBombExplosion.cs b/Projectiles/Typeless/BloodBombExplosion.cs index 246613730b..a6811338ea 100644 --- a/Projectiles/Typeless/BloodBombExplosion.cs +++ b/Projectiles/Typeless/BloodBombExplosion.cs @@ -1,7 +1,9 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Typeless { public class BloodBombExplosion : ModProjectile @@ -29,7 +31,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 74); projectile.localAI[0] += 1f; } bool flag15 = false; diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index b3c8b056e6..4db065b94e 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -1,18 +1,14 @@ -using CalamityMod.CalPlayer; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Potions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class BlunderBoosterAura : ModProjectile + public class BlunderBoosterAura : ModProjectile { private const float radius = 98f; private const int framesX = 3; diff --git a/Projectiles/Typeless/BrimstoneHellfireballFriendly2.cs b/Projectiles/Typeless/BrimstoneHellfireballFriendly2.cs index e93d34d612..76f0e61b44 100644 --- a/Projectiles/Typeless/BrimstoneHellfireballFriendly2.cs +++ b/Projectiles/Typeless/BrimstoneHellfireballFriendly2.cs @@ -1,8 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Typeless { public class BrimstoneHellfireballFriendly2 : ModProjectile @@ -30,7 +32,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 5; num457++) diff --git a/Projectiles/Typeless/BrokenWaterFilterSpewer.cs b/Projectiles/Typeless/BrokenWaterFilterSpewer.cs index 6ea1e653dd..847b4e8cc2 100644 --- a/Projectiles/Typeless/BrokenWaterFilterSpewer.cs +++ b/Projectiles/Typeless/BrokenWaterFilterSpewer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.SummonItems.Invasion; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Typeless/ChaosBlaze.cs b/Projectiles/Typeless/ChaosBlaze.cs index 1f9a7d908e..c49d1bb392 100644 --- a/Projectiles/Typeless/ChaosBlaze.cs +++ b/Projectiles/Typeless/ChaosBlaze.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/ChaosFlare.cs b/Projectiles/Typeless/ChaosFlare.cs index 356419787f..c348dcd45a 100644 --- a/Projectiles/Typeless/ChaosFlare.cs +++ b/Projectiles/Typeless/ChaosFlare.cs @@ -1,12 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class ChaosFlare : ModProjectile + public class ChaosFlare : ModProjectile { public override void SetStaticDefaults() { @@ -29,7 +28,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 6; num457++) diff --git a/Projectiles/Typeless/ChaosFlare2.cs b/Projectiles/Typeless/ChaosFlare2.cs index c24df2ffe4..d29c4f3896 100644 --- a/Projectiles/Typeless/ChaosFlare2.cs +++ b/Projectiles/Typeless/ChaosFlare2.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class ChaosFlare2 : ModProjectile + public class ChaosFlare2 : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/ChaosGeyser.cs b/Projectiles/Typeless/ChaosGeyser.cs index 8e069d2f09..834b23401e 100644 --- a/Projectiles/Typeless/ChaosGeyser.cs +++ b/Projectiles/Typeless/ChaosGeyser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.ai[1] == 0f) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); } projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Typeless/ChaoticSpreadBobber.cs b/Projectiles/Typeless/ChaoticSpreadBobber.cs index a84b12c3a0..8f9d2d97b8 100644 --- a/Projectiles/Typeless/ChaoticSpreadBobber.cs +++ b/Projectiles/Typeless/ChaoticSpreadBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class ChaoticSpreadBobber : ModProjectile + public class ChaoticSpreadBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/CoralBubble.cs b/Projectiles/Typeless/CoralBubble.cs index 3bfa3cead7..9802478afc 100644 --- a/Projectiles/Typeless/CoralBubble.cs +++ b/Projectiles/Typeless/CoralBubble.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/CoralBubbleSmall.cs b/Projectiles/Typeless/CoralBubbleSmall.cs index 7e120267fd..cacf6eee29 100644 --- a/Projectiles/Typeless/CoralBubbleSmall.cs +++ b/Projectiles/Typeless/CoralBubbleSmall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/CursorProj.cs b/Projectiles/Typeless/CursorProj.cs index b725fbae1d..aef6539f04 100644 --- a/Projectiles/Typeless/CursorProj.cs +++ b/Projectiles/Typeless/CursorProj.cs @@ -1,4 +1,4 @@ -using System; +using System; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Typeless/CursorProjSplit.cs b/Projectiles/Typeless/CursorProjSplit.cs index e2b459467c..f6762606db 100644 --- a/Projectiles/Typeless/CursorProjSplit.cs +++ b/Projectiles/Typeless/CursorProjSplit.cs @@ -1,4 +1,4 @@ -using System; +using System; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Typeless/DemonshadeRedDevil.cs b/Projectiles/Typeless/DemonshadeRedDevil.cs index 426d63fc79..e9d1b1ceaf 100644 --- a/Projectiles/Typeless/DemonshadeRedDevil.cs +++ b/Projectiles/Typeless/DemonshadeRedDevil.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/Projectiles/Typeless/DevourerofCodsBobber.cs b/Projectiles/Typeless/DevourerofCodsBobber.cs index 0bed41f22b..7cd14689c6 100644 --- a/Projectiles/Typeless/DevourerofCodsBobber.cs +++ b/Projectiles/Typeless/DevourerofCodsBobber.cs @@ -1,14 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class DevourerofCodsBobber : ModProjectile + public class DevourerofCodsBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/DirectStrike.cs b/Projectiles/Typeless/DirectStrike.cs index 127b2cd62a..b8fa9e0cc3 100644 --- a/Projectiles/Typeless/DirectStrike.cs +++ b/Projectiles/Typeless/DirectStrike.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless diff --git a/Projectiles/Typeless/DragonDust.cs b/Projectiles/Typeless/DragonDust.cs index ce2bf96961..bec93ad532 100644 --- a/Projectiles/Typeless/DragonDust.cs +++ b/Projectiles/Typeless/DragonDust.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/Typeless/EarlyBloomBobber.cs b/Projectiles/Typeless/EarlyBloomBobber.cs index 5429a2b98b..0abbb3823d 100644 --- a/Projectiles/Typeless/EarlyBloomBobber.cs +++ b/Projectiles/Typeless/EarlyBloomBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class EarlyBloomBobber : ModProjectile + public class EarlyBloomBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/EnergyShell.cs b/Projectiles/Typeless/EnergyShell.cs index 8fbc89e969..2ff97177bc 100644 --- a/Projectiles/Typeless/EnergyShell.cs +++ b/Projectiles/Typeless/EnergyShell.cs @@ -1,14 +1,12 @@ using CalamityMod.Buffs.Cooldowns; using CalamityMod.Items.Weapons.Melee; -using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class EnergyShell : ModProjectile + public class EnergyShell : ModProjectile { private bool playedSound = false; diff --git a/Projectiles/Typeless/FabsolDust.cs b/Projectiles/Typeless/FabsolDust.cs index 5a3967ae72..1a8c1f94fa 100644 --- a/Projectiles/Typeless/FabsolDust.cs +++ b/Projectiles/Typeless/FabsolDust.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless diff --git a/Projectiles/Typeless/FeralDoubleBobber.cs b/Projectiles/Typeless/FeralDoubleBobber.cs index 672b7fd802..8bc790de17 100644 --- a/Projectiles/Typeless/FeralDoubleBobber.cs +++ b/Projectiles/Typeless/FeralDoubleBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class FeralDoubleBobber : ModProjectile + public class FeralDoubleBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs b/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs index 6428d063f1..d2b7e7a4f0 100644 --- a/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs +++ b/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs @@ -1,6 +1,7 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless.FiniteUse { @@ -36,13 +37,13 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override bool OnTileCollide(Vector2 oldVelocity) { Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height); - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + Main.PlaySound(SoundID.Dig, projectile.position); return true; } public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 32; projectile.position.X = projectile.position.X - projectile.width / 2; diff --git a/Projectiles/Typeless/FiniteUse/GrenadeRound.cs b/Projectiles/Typeless/FiniteUse/GrenadeRound.cs index 1c57ad224b..a4c1a88fbf 100644 --- a/Projectiles/Typeless/FiniteUse/GrenadeRound.cs +++ b/Projectiles/Typeless/FiniteUse/GrenadeRound.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using System; using Terraria; @@ -61,19 +61,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && - target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && - target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && - target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && - target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && - target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && - target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && - target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && - target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && - target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && - target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && - target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && - target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57) + if (target.Inorganic()) { damage += target.lifeMax / 20; //500 + 200 = 700 + (100000 / 20 = 5000) = 5700 * 2 (explosion) = 11400 = 11.4% of boss HP } @@ -83,7 +71,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + Main.PlaySound(SoundID.Item62, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 96; projectile.position.X = projectile.position.X - projectile.width / 2; diff --git a/Projectiles/Typeless/FiniteUse/MagnumRound.cs b/Projectiles/Typeless/FiniteUse/MagnumRound.cs index 5dd0cc59a4..42422f79ae 100644 --- a/Projectiles/Typeless/FiniteUse/MagnumRound.cs +++ b/Projectiles/Typeless/FiniteUse/MagnumRound.cs @@ -1,6 +1,4 @@ -using CalamityMod.CalPlayer; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.Providence; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,12 +29,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - if ((target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 && - target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 && - target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && - target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && - target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == ModContent.NPCType() || - target.type == ModContent.NPCType() || target.type == ModContent.NPCType()) + if (target.Organic()) { damage += target.lifeMax / 25; //400 + 80 = 480 + (100000 / 25 = 4000) = 4480, if crit = 5600 = 5.6% of boss HP } diff --git a/Projectiles/Typeless/FlareExplosion.cs b/Projectiles/Typeless/FlareExplosion.cs index 8f5636b1b3..7fa406c06e 100644 --- a/Projectiles/Typeless/FlareExplosion.cs +++ b/Projectiles/Typeless/FlareExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/FuckYou.cs b/Projectiles/Typeless/FuckYou.cs index 724fd95c92..be379d8bc5 100644 --- a/Projectiles/Typeless/FuckYou.cs +++ b/Projectiles/Typeless/FuckYou.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Typeless/GhostlyBolt.cs b/Projectiles/Typeless/GhostlyBolt.cs index 76d6fe8980..a17b1f5866 100644 --- a/Projectiles/Typeless/GhostlyBolt.cs +++ b/Projectiles/Typeless/GhostlyBolt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/GladiatorSword.cs b/Projectiles/Typeless/GladiatorSword.cs index 499371303c..b55bdd2e6b 100644 --- a/Projectiles/Typeless/GladiatorSword.cs +++ b/Projectiles/Typeless/GladiatorSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Typeless/GladiatorSword2.cs b/Projectiles/Typeless/GladiatorSword2.cs index 2202f4aa67..7ce5080fa2 100644 --- a/Projectiles/Typeless/GladiatorSword2.cs +++ b/Projectiles/Typeless/GladiatorSword2.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Typeless/GodKiller.cs b/Projectiles/Typeless/GodKiller.cs index 6c43ecf126..96fee4d9c6 100644 --- a/Projectiles/Typeless/GodKiller.cs +++ b/Projectiles/Typeless/GodKiller.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 89); + Main.PlaySound(SoundID.Item89, projectile.position); for (int num621 = 0; num621 < 5; num621++) { int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 199, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Typeless/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs index c4411a03e1..a1bfd834fc 100644 --- a/Projectiles/Typeless/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; diff --git a/Projectiles/Typeless/GodSlayerOrb.cs b/Projectiles/Typeless/GodSlayerOrb.cs index 244d15a8e8..96c53f1ede 100644 --- a/Projectiles/Typeless/GodSlayerOrb.cs +++ b/Projectiles/Typeless/GodSlayerOrb.cs @@ -1,11 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class GodSlayerOrb : ModProjectile + public class GodSlayerOrb : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/GodSlayerPhantom.cs b/Projectiles/Typeless/GodSlayerPhantom.cs index aa3da5f3c9..ce10466e68 100644 --- a/Projectiles/Typeless/GodSlayerPhantom.cs +++ b/Projectiles/Typeless/GodSlayerPhantom.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Typeless/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs index ca8fa650df..d1540d85c0 100644 --- a/Projectiles/Typeless/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -52,7 +53,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.ai[1] == 0f && projectile.type >= 326 && projectile.type <= 328) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); + Main.PlaySound(SoundID.Item13, projectile.position); } int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); Dust dust = Main.dust[num199]; diff --git a/Projectiles/Typeless/GodSlayerShrapnelRound.cs b/Projectiles/Typeless/GodSlayerShrapnelRound.cs index e95b59ee92..c5384e4247 100644 --- a/Projectiles/Typeless/GodSlayerShrapnelRound.cs +++ b/Projectiles/Typeless/GodSlayerShrapnelRound.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -24,7 +25,7 @@ namespace CalamityMod.Projectiles.Typeless { if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 73); + Main.PlaySound(SoundID.Item73, projectile.position); projectile.localAI[0] += 1f; } for (int num457 = 0; num457 < 3; num457++) diff --git a/Projectiles/Typeless/GoldenGunProj.cs b/Projectiles/Typeless/GoldenGunProj.cs index d83e70b9d2..60404e6db7 100644 --- a/Projectiles/Typeless/GoldenGunProj.cs +++ b/Projectiles/Typeless/GoldenGunProj.cs @@ -116,12 +116,12 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 600); + target.AddBuff(BuffID.Ichor, 480); } public override void OnHitPvp(Player target, int damage, bool crit) { - target.AddBuff(BuffID.Ichor, 600); + target.AddBuff(BuffID.Ichor, 480); } } } diff --git a/Projectiles/Typeless/HellfireExplosionFriendly2.cs b/Projectiles/Typeless/HellfireExplosionFriendly2.cs index b5c0d52d8d..a74ca74e37 100644 --- a/Projectiles/Typeless/HellfireExplosionFriendly2.cs +++ b/Projectiles/Typeless/HellfireExplosionFriendly2.cs @@ -1,8 +1,9 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -31,7 +32,7 @@ namespace CalamityMod.Projectiles.Typeless Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.localAI[0] += 1f; } float num461 = 25f; diff --git a/Projectiles/Typeless/HeronBobber.cs b/Projectiles/Typeless/HeronBobber.cs index 980bbef40d..7e3e696563 100644 --- a/Projectiles/Typeless/HeronBobber.cs +++ b/Projectiles/Typeless/HeronBobber.cs @@ -1,13 +1,10 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class HeronBobber : ModProjectile + public class HeronBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/HolyEruption.cs b/Projectiles/Typeless/HolyEruption.cs index f86a0170cf..2c7be1d463 100644 --- a/Projectiles/Typeless/HolyEruption.cs +++ b/Projectiles/Typeless/HolyEruption.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/HolyExplosion.cs b/Projectiles/Typeless/HolyExplosion.cs index 77d888034e..904f6c550d 100644 --- a/Projectiles/Typeless/HolyExplosion.cs +++ b/Projectiles/Typeless/HolyExplosion.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 20; diff --git a/Projectiles/Typeless/HolyExplosionSupreme.cs b/Projectiles/Typeless/HolyExplosionSupreme.cs index 1873fda4a3..ff67d7bed8 100644 --- a/Projectiles/Typeless/HolyExplosionSupreme.cs +++ b/Projectiles/Typeless/HolyExplosionSupreme.cs @@ -1,5 +1,6 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 60; diff --git a/Projectiles/Typeless/HolyFlameBomb.cs b/Projectiles/Typeless/HolyFlameBomb.cs index 3624ca77a2..72c1d79c03 100644 --- a/Projectiles/Typeless/HolyFlameBomb.cs +++ b/Projectiles/Typeless/HolyFlameBomb.cs @@ -1,6 +1,7 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -45,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Main.PlaySound(SoundID.Item20, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs index c74a89c390..ad8570c1c9 100644 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ b/Projectiles/Typeless/HydrothermalSmoke.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class HydrothermalSmoke : ModProjectile + public class HydrothermalSmoke : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/KelvinCatalystStar.cs b/Projectiles/Typeless/KelvinCatalystStar.cs index 39f3192aad..72092691cf 100644 --- a/Projectiles/Typeless/KelvinCatalystStar.cs +++ b/Projectiles/Typeless/KelvinCatalystStar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + Main.PlaySound(SoundID.Item27, projectile.position); projectile.position = projectile.Center; projectile.width = projectile.height = 24; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); diff --git a/Projectiles/Typeless/LunicBeam.cs b/Projectiles/Typeless/LunicBeam.cs index b6bd3c32bb..db6d22ab19 100644 --- a/Projectiles/Typeless/LunicBeam.cs +++ b/Projectiles/Typeless/LunicBeam.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Typeless/MageHammerBoom.cs b/Projectiles/Typeless/MageHammerBoom.cs index d2b858948a..4142e9f277 100644 --- a/Projectiles/Typeless/MageHammerBoom.cs +++ b/Projectiles/Typeless/MageHammerBoom.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { public class MageHammerBoom : ModProjectile diff --git a/Projectiles/Typeless/MarkRound.cs b/Projectiles/Typeless/MarkRound.cs index d1517e81a3..3e6ca65fbb 100644 --- a/Projectiles/Typeless/MarkRound.cs +++ b/Projectiles/Typeless/MarkRound.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Typeless/MomentumCapacitorOrb.cs b/Projectiles/Typeless/MomentumCapacitorOrb.cs index 921f117cc6..3eca89eb47 100644 --- a/Projectiles/Typeless/MomentumCapacitorOrb.cs +++ b/Projectiles/Typeless/MomentumCapacitorOrb.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; diff --git a/Projectiles/Typeless/NanoFlare.cs b/Projectiles/Typeless/NanoFlare.cs index 6b2e5521ca..0641e04831 100644 --- a/Projectiles/Typeless/NanoFlare.cs +++ b/Projectiles/Typeless/NanoFlare.cs @@ -1,7 +1,7 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace CalamityMod.Projectiles.Typeless { @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless dust.color = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f); dust.color = Color.Lerp(dust.color, Color.White, 0.3f); } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y,14); + Main.PlaySound(SoundID.Item14, projectile.Center); projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.width = 60; diff --git a/Projectiles/Typeless/Nanotech.cs b/Projectiles/Typeless/Nanotech.cs index f98338a08f..0f9e7064c4 100644 --- a/Projectiles/Typeless/Nanotech.cs +++ b/Projectiles/Typeless/Nanotech.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/NebulaDust.cs b/Projectiles/Typeless/NebulaDust.cs index 9a1d482cd8..2e8ff2dc7b 100644 --- a/Projectiles/Typeless/NebulaDust.cs +++ b/Projectiles/Typeless/NebulaDust.cs @@ -1,4 +1,4 @@ -using System; +using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless diff --git a/Projectiles/Typeless/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs index 3186fed573..a2d726d91e 100644 --- a/Projectiles/Typeless/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; diff --git a/Projectiles/Typeless/NobodyKnows.cs b/Projectiles/Typeless/NobodyKnows.cs index db275d6137..b302886136 100644 --- a/Projectiles/Typeless/NobodyKnows.cs +++ b/Projectiles/Typeless/NobodyKnows.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { public class NobodyKnows : ModProjectile diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 029e62f3b8..c855387dae 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[0] = 10 + Main.rand.Next(10); float maxDistance = hentai ? 900f : 600f; int target = -1; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile)) @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && target.type != NPCID.TargetDummy) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && target.type != NPCID.TargetDummy && !Main.player[projectile.owner].moonLeech) { int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR if (healAmount > 0) @@ -213,7 +213,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitPvp(Player target, int damage, bool crit) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && !Main.player[projectile.owner].moonLeech) { int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR if (healAmount > 0) diff --git a/Projectiles/Typeless/PendantProjectile1.cs b/Projectiles/Typeless/PendantProjectile1.cs index 6898d48be8..788a79bf13 100644 --- a/Projectiles/Typeless/PendantProjectile1.cs +++ b/Projectiles/Typeless/PendantProjectile1.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; diff --git a/Projectiles/Typeless/PendantProjectile2.cs b/Projectiles/Typeless/PendantProjectile2.cs index 278eff68a7..9e4b19b4c1 100644 --- a/Projectiles/Typeless/PendantProjectile2.cs +++ b/Projectiles/Typeless/PendantProjectile2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; diff --git a/Projectiles/Typeless/PendantProjectile3.cs b/Projectiles/Typeless/PendantProjectile3.cs index c9e8e042bb..694f423348 100644 --- a/Projectiles/Typeless/PendantProjectile3.cs +++ b/Projectiles/Typeless/PendantProjectile3.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; diff --git a/Projectiles/Typeless/PoisonousSeawater.cs b/Projectiles/Typeless/PoisonousSeawater.cs index 619dcb6611..216f5a153a 100644 --- a/Projectiles/Typeless/PoisonousSeawater.cs +++ b/Projectiles/Typeless/PoisonousSeawater.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.timeLeft = 6; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Typeless/ReaverBlast.cs b/Projectiles/Typeless/ReaverBlast.cs index 6627f85652..929e6d7207 100644 --- a/Projectiles/Typeless/ReaverBlast.cs +++ b/Projectiles/Typeless/ReaverBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/RelicOfConvergenceCrystal.cs b/Projectiles/Typeless/RelicOfConvergenceCrystal.cs index 3d773bd0f9..dce1ce17b3 100644 --- a/Projectiles/Typeless/RelicOfConvergenceCrystal.cs +++ b/Projectiles/Typeless/RelicOfConvergenceCrystal.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs index 6044b01d8e..c6fab199e7 100644 --- a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs +++ b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Typeless; using Microsoft.Xna.Framework; diff --git a/Projectiles/Typeless/SabatonSlam.cs b/Projectiles/Typeless/SabatonSlam.cs index 84f6a3cc25..d3706be6c3 100644 --- a/Projectiles/Typeless/SabatonSlam.cs +++ b/Projectiles/Typeless/SabatonSlam.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using CalamityMod.Dusts; +using Terraria.ID; + namespace CalamityMod.Projectiles.Typeless { public class SabatonSlam : ModProjectile @@ -31,7 +33,7 @@ namespace CalamityMod.Projectiles.Typeless { //Spawns the shockwave Projectile.NewProjectile(projectile.position.X + 25, projectile.position.Y + 25, 0f, 0f, ModContent.ProjectileType(), 300, 12, projectile.owner); - Main.PlaySound(2, projectile.position, 14); + Main.PlaySound(SoundID.Item14, projectile.position); Player player = Main.player[projectile.owner]; player.Calamity().gSabatonFall = 0; projectile.Kill(); diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index 41e02e54fe..bbd9ad770e 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -1,16 +1,11 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; using CalamityMod.NPCs; -using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class SandCloakVeil : ModProjectile + public class SandCloakVeil : ModProjectile { private const float radius = 225f; private const int duration = 900; diff --git a/Projectiles/Typeless/SandExplosion.cs b/Projectiles/Typeless/SandExplosion.cs index 6c016942cd..1a5af9741b 100644 --- a/Projectiles/Typeless/SandExplosion.cs +++ b/Projectiles/Typeless/SandExplosion.cs @@ -1,11 +1,10 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class SandExplosion : ModProjectile + public class SandExplosion : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/Seashell.cs b/Projectiles/Typeless/Seashell.cs index db49fe3bbb..7ca2b090d1 100644 --- a/Projectiles/Typeless/Seashell.cs +++ b/Projectiles/Typeless/Seashell.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { diff --git a/Projectiles/Typeless/ShadowflameExplosion.cs b/Projectiles/Typeless/ShadowflameExplosion.cs index 629485379d..6eabe62f99 100644 --- a/Projectiles/Typeless/ShadowflameExplosion.cs +++ b/Projectiles/Typeless/ShadowflameExplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/ShadowflameExplosionBig.cs b/Projectiles/Typeless/ShadowflameExplosionBig.cs index 60ffd632c6..25f859886b 100644 --- a/Projectiles/Typeless/ShadowflameExplosionBig.cs +++ b/Projectiles/Typeless/ShadowflameExplosionBig.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index e87da2163b..c96538d061 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = projectile.height = 200; diff --git a/Projectiles/Typeless/SlurperBobber.cs b/Projectiles/Typeless/SlurperBobber.cs index d61e5a265a..026126015c 100644 --- a/Projectiles/Typeless/SlurperBobber.cs +++ b/Projectiles/Typeless/SlurperBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class SlurperBobber : ModProjectile + public class SlurperBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index bd11ee8a89..6514f32fbb 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -1,7 +1,8 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -56,7 +57,7 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.ai[1] == 0f && projectile.type >= 326 && projectile.type <= 328) { projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); + Main.PlaySound(SoundID.Item13, projectile.position); } int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); Dust dust = Main.dust[num199]; diff --git a/Projectiles/Typeless/StarStruckWaterBottle.cs b/Projectiles/Typeless/StarStruckWaterBottle.cs index 1b73e061d7..c68aca2b40 100644 --- a/Projectiles/Typeless/StarStruckWaterBottle.cs +++ b/Projectiles/Typeless/StarStruckWaterBottle.cs @@ -1,7 +1,9 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Projectiles.Typeless { public class StarStruckWaterBottle : ModProjectile @@ -34,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless { if (projectile.owner == Main.myPlayer) { - Main.PlaySound(13, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); + Main.PlaySound(SoundID.Shatter, (int) projectile.position.X, (int) projectile.position.Y, 1, 1f, 0.0f); for (int index = 0; index < 5; ++index) Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 13, 0f, 0f, 0, new Color(), 1f); for (int index1 = 0; index1 < 30; ++index1) diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index e4bf1f1714..759e899d89 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -67,7 +68,7 @@ namespace CalamityMod.Projectiles.Typeless public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Main.PlaySound(SoundID.Item14, projectile.position); projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 50; diff --git a/Projectiles/Typeless/StormBolt.cs b/Projectiles/Typeless/StormBolt.cs index c117cd1918..856f61f10e 100644 --- a/Projectiles/Typeless/StormBolt.cs +++ b/Projectiles/Typeless/StormBolt.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless diff --git a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs index a03c1e4e18..cd5464b843 100644 --- a/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs +++ b/Projectiles/Typeless/SulphuricAcidBubbleFriendly.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 0c0605e01f..36832c2751 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -1,18 +1,16 @@ -using CalamityMod.CalPlayer; using CalamityMod.NPCs; using CalamityMod.NPCs.AcidRain; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Potions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class TeslaAura : ModProjectile + public class TeslaAura : ModProjectile { private const float radius = 98f; private const int framesX = 3; diff --git a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs index 303b0059bd..2882484679 100644 --- a/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs +++ b/Projectiles/Typeless/TheDeadlyMicrobeProjectile.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; diff --git a/Projectiles/Typeless/UnstableSpark.cs b/Projectiles/Typeless/UnstableSpark.cs index c5cc444bff..96ccb95791 100644 --- a/Projectiles/Typeless/UnstableSpark.cs +++ b/Projectiles/Typeless/UnstableSpark.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless diff --git a/Projectiles/Typeless/VanquisherArrowSplit.cs b/Projectiles/Typeless/VanquisherArrowSplit.cs index 6b54a6e74d..21bfe65747 100644 --- a/Projectiles/Typeless/VanquisherArrowSplit.cs +++ b/Projectiles/Typeless/VanquisherArrowSplit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Typeless/VerstaltiteBobber.cs b/Projectiles/Typeless/VerstaltiteBobber.cs index 851bd094d6..6343baff03 100644 --- a/Projectiles/Typeless/VerstaltiteBobber.cs +++ b/Projectiles/Typeless/VerstaltiteBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class VerstaltiteBobber : ModProjectile + public class VerstaltiteBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/WulfrumBobber.cs b/Projectiles/Typeless/WulfrumBobber.cs index 7c577b843d..2668a7b540 100644 --- a/Projectiles/Typeless/WulfrumBobber.cs +++ b/Projectiles/Typeless/WulfrumBobber.cs @@ -1,13 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Fishing.FishingRods; namespace CalamityMod.Projectiles.Typeless { - public class WulfrumBobber : ModProjectile + public class WulfrumBobber : ModProjectile { public override void SetStaticDefaults() { diff --git a/Projectiles/Typeless/XerocBlast.cs b/Projectiles/Typeless/XerocBlast.cs index 9c037b04e8..498481348e 100644 --- a/Projectiles/Typeless/XerocBlast.cs +++ b/Projectiles/Typeless/XerocBlast.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -83,17 +83,5 @@ namespace CalamityMod.Projectiles.Typeless num462++; } } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } } } diff --git a/Projectiles/Typeless/XerocBubble.cs b/Projectiles/Typeless/XerocBubble.cs index 96f4d26459..4503b2e48d 100644 --- a/Projectiles/Typeless/XerocBubble.cs +++ b/Projectiles/Typeless/XerocBubble.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class XerocBubble : ModProjectile + public class XerocBubble : ModProjectile { public override void SetStaticDefaults() { @@ -38,17 +37,5 @@ namespace CalamityMod.Projectiles.Typeless } CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 8f, 20f); } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.CursedInferno, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } } } diff --git a/Projectiles/Typeless/XerocFire.cs b/Projectiles/Typeless/XerocFire.cs index db4ca95f9a..1cb3dbfa08 100644 --- a/Projectiles/Typeless/XerocFire.cs +++ b/Projectiles/Typeless/XerocFire.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -87,17 +87,5 @@ namespace CalamityMod.Projectiles.Typeless } return false; } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.CursedInferno, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } } } diff --git a/Projectiles/Typeless/XerocOrb.cs b/Projectiles/Typeless/XerocOrb.cs index e7f46125c1..5a7607f9da 100644 --- a/Projectiles/Typeless/XerocOrb.cs +++ b/Projectiles/Typeless/XerocOrb.cs @@ -1,12 +1,11 @@ -using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class XerocOrb : ModProjectile + public class XerocOrb : ModProjectile { public override void SetStaticDefaults() { @@ -30,17 +29,5 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[num469].velocity *= 0f; CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 7f, 20f); } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.CursedInferno, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } } } diff --git a/Projectiles/Typeless/XerocStar.cs b/Projectiles/Typeless/XerocStar.cs index aced66d767..285ed3a9b2 100644 --- a/Projectiles/Typeless/XerocStar.cs +++ b/Projectiles/Typeless/XerocStar.cs @@ -1,13 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class XerocStar : ModProjectile + public class XerocStar : ModProjectile { public override void SetStaticDefaults() { @@ -47,17 +46,5 @@ namespace CalamityMod.Projectiles.Typeless spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); return false; } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 120); - target.AddBuff(BuffID.CursedInferno, 120); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.CursedInferno, 120); - target.AddBuff(BuffID.OnFire, 120); - } } } diff --git a/Skies/AstralScreenShaderData.cs b/Skies/AstralScreenShaderData.cs index daec3689d2..58bfa3aba6 100644 --- a/Skies/AstralScreenShaderData.cs +++ b/Skies/AstralScreenShaderData.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index 8838b21646..565823082e 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Graphics.Effects; diff --git a/Sounds/Custom/AtlasIdle0.cs b/Sounds/Custom/AtlasIdle0.cs index d28487510c..0e415fb714 100644 --- a/Sounds/Custom/AtlasIdle0.cs +++ b/Sounds/Custom/AtlasIdle0.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/Custom/AtlasIdle1.cs b/Sounds/Custom/AtlasIdle1.cs index d56baef018..9cd12705b4 100644 --- a/Sounds/Custom/AtlasIdle1.cs +++ b/Sounds/Custom/AtlasIdle1.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/Custom/AtlasSad0.cs b/Sounds/Custom/AtlasSad0.cs index 92af198143..02dde2a23f 100644 --- a/Sounds/Custom/AtlasSad0.cs +++ b/Sounds/Custom/AtlasSad0.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/Custom/AtlasSad1.cs b/Sounds/Custom/AtlasSad1.cs index a536066a5d..fb8262a184 100644 --- a/Sounds/Custom/AtlasSad1.cs +++ b/Sounds/Custom/AtlasSad1.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/Custom/AtlasSwing.cs b/Sounds/Custom/AtlasSwing.cs index c25870d303..244d79c49b 100644 --- a/Sounds/Custom/AtlasSwing.cs +++ b/Sounds/Custom/AtlasSwing.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/Custom/MicrowaveBeep.cs b/Sounds/Custom/MicrowaveBeep.cs new file mode 100644 index 0000000000..4e13043f45 --- /dev/null +++ b/Sounds/Custom/MicrowaveBeep.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class MicrowaveBeep : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/MicrowaveBeep.ogg b/Sounds/Custom/MicrowaveBeep.ogg new file mode 100644 index 0000000000..30e6018102 Binary files /dev/null and b/Sounds/Custom/MicrowaveBeep.ogg differ diff --git a/Sounds/Item/IceBarrageCast.cs b/Sounds/Item/IceBarrageCast.cs index e049fa0553..377d846ab1 100644 --- a/Sounds/Item/IceBarrageCast.cs +++ b/Sounds/Item/IceBarrageCast.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Terraria.ModLoader; using Microsoft.Xna.Framework.Audio; diff --git a/Sounds/Item/PlasmaBolt.cs b/Sounds/Item/PlasmaBolt.cs index 93f5d801f7..edc0c184ca 100644 --- a/Sounds/Item/PlasmaBolt.cs +++ b/Sounds/Item/PlasmaBolt.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework.Audio; -using ReLogic.Utilities; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Sounds.Item { - public class PlasmaBolt : ModSound + public class PlasmaBolt : ModSound { public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) { diff --git a/Sounds/NPCHit/AstralEnemyHit.cs b/Sounds/NPCHit/AstralEnemyHit.cs index 819f63bd08..236fbce138 100644 --- a/Sounds/NPCHit/AstralEnemyHit.cs +++ b/Sounds/NPCHit/AstralEnemyHit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/AstralEnemyHit2.cs b/Sounds/NPCHit/AstralEnemyHit2.cs index 93472c3d2e..6c959f5574 100644 --- a/Sounds/NPCHit/AstralEnemyHit2.cs +++ b/Sounds/NPCHit/AstralEnemyHit2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/AstralEnemyHit3.cs b/Sounds/NPCHit/AstralEnemyHit3.cs index 9b9c4559d0..1982c1dc28 100644 --- a/Sounds/NPCHit/AstralEnemyHit3.cs +++ b/Sounds/NPCHit/AstralEnemyHit3.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/AtlasHurt0.cs b/Sounds/NPCHit/AtlasHurt0.cs index 04db56771f..0b343486f0 100644 --- a/Sounds/NPCHit/AtlasHurt0.cs +++ b/Sounds/NPCHit/AtlasHurt0.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/AtlasHurt1.cs b/Sounds/NPCHit/AtlasHurt1.cs index 9a4fd2a64c..a5f7ff4368 100644 --- a/Sounds/NPCHit/AtlasHurt1.cs +++ b/Sounds/NPCHit/AtlasHurt1.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/AtlasHurt2.cs b/Sounds/NPCHit/AtlasHurt2.cs index 7e25955b01..95cda75ab9 100644 --- a/Sounds/NPCHit/AtlasHurt2.cs +++ b/Sounds/NPCHit/AtlasHurt2.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/OtherworldlyHit.cs b/Sounds/NPCHit/OtherworldlyHit.cs index 01f595436e..aef187b9c8 100644 --- a/Sounds/NPCHit/OtherworldlyHit.cs +++ b/Sounds/NPCHit/OtherworldlyHit.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/ProvidenceHurt.cs b/Sounds/NPCHit/ProvidenceHurt.cs index b41c763c47..55deb88fb9 100644 --- a/Sounds/NPCHit/ProvidenceHurt.cs +++ b/Sounds/NPCHit/ProvidenceHurt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCHit/ScornHurt.cs b/Sounds/NPCHit/ScornHurt.cs index 70c80394a6..3e06fd67d5 100644 --- a/Sounds/NPCHit/ScornHurt.cs +++ b/Sounds/NPCHit/ScornHurt.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCKilled/AstralEnemyDeath.cs b/Sounds/NPCKilled/AstralEnemyDeath.cs index 87ed76a1f3..512be0b8b6 100644 --- a/Sounds/NPCKilled/AstralEnemyDeath.cs +++ b/Sounds/NPCKilled/AstralEnemyDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCKilled/AtlasDeath.cs b/Sounds/NPCKilled/AtlasDeath.cs index b2854be375..474b159ce3 100644 --- a/Sounds/NPCKilled/AtlasDeath.cs +++ b/Sounds/NPCKilled/AtlasDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCKilled/EidolistDeath.cs b/Sounds/NPCKilled/EidolistDeath.cs index 69bd631850..0fe0436ad2 100644 --- a/Sounds/NPCKilled/EidolistDeath.cs +++ b/Sounds/NPCKilled/EidolistDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCKilled/ProvidenceDeath.cs b/Sounds/NPCKilled/ProvidenceDeath.cs index 284e3b1c4e..2e0e8da65d 100644 --- a/Sounds/NPCKilled/ProvidenceDeath.cs +++ b/Sounds/NPCKilled/ProvidenceDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Sounds/NPCKilled/ScornDeath.cs b/Sounds/NPCKilled/ScornDeath.cs index 283f7e9f81..794a76f3a7 100644 --- a/Sounds/NPCKilled/ScornDeath.cs +++ b/Sounds/NPCKilled/ScornDeath.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Audio; +using Microsoft.Xna.Framework.Audio; using Terraria; using Terraria.ModLoader; diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 1d9026137e..db97053347 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(0, 0, 0)); mineResist = 10f; minPick = 65; - soundType = 21; + soundType = SoundID.Tink; dustType = 33; } diff --git a/Tiles/Abyss/AbyssalCrateTile.cs b/Tiles/Abyss/AbyssalCrateTile.cs index 179a23c690..95f8ae7797 100644 --- a/Tiles/Abyss/AbyssalCrateTile.cs +++ b/Tiles/Abyss/AbyssalCrateTile.cs @@ -1,14 +1,12 @@ -using CalamityMod.Dusts; using CalamityMod.Items.Fishing.SulphurCatches; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.Abyss { - public class AbyssalCrateTile : ModTile + public class AbyssalCrateTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index bdf58de74b..cbbd85d45e 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; diff --git a/Tiles/Abyss/AcidWoodTreeSapling.cs b/Tiles/Abyss/AcidWoodTreeSapling.cs index b943ee4eb7..23515c0b65 100644 --- a/Tiles/Abyss/AcidWoodTreeSapling.cs +++ b/Tiles/Abyss/AcidWoodTreeSapling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Tiles/Abyss/HardenedSulphurousSandstone.cs b/Tiles/Abyss/HardenedSulphurousSandstone.cs index d8a786d4c1..96246262f5 100644 --- a/Tiles/Abyss/HardenedSulphurousSandstone.cs +++ b/Tiles/Abyss/HardenedSulphurousSandstone.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(76, 58, 59)); mineResist = 1f; minPick = 55; - soundType = 0; + soundType = SoundID.Dig; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -86,7 +86,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[num53, num54].type = (ushort)ModContent.TileType(); Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); } diff --git a/Tiles/Abyss/LumenylCrystals.cs b/Tiles/Abyss/LumenylCrystals.cs index 16ccfeb9e6..f4cc95c989 100644 --- a/Tiles/Abyss/LumenylCrystals.cs +++ b/Tiles/Abyss/LumenylCrystals.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.Abyss name.SetDefault("Lumenyl"); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(0, 150, 200), name); - soundType = 2; + soundType = SoundID.Item; soundStyle = 27; dustType = 67; drop = ModContent.ItemType(); diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 3790232a14..1d8446915f 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Tiles.Abyss name.SetDefault("Planty Mush"); AddMapEntry(new Color(0, 120, 0), name); mineResist = 1f; - soundType = 0; + soundType = SoundID.Dig; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -76,7 +76,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[num53, num54].type = (ushort)ModContent.TileType(); Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); } diff --git a/Tiles/Abyss/RustyChestLocked.cs b/Tiles/Abyss/RustyChestLocked.cs deleted file mode 100644 index 9391ea2eb8..0000000000 --- a/Tiles/Abyss/RustyChestLocked.cs +++ /dev/null @@ -1,124 +0,0 @@ -using CalamityMod.Dusts; -using CalamityMod.Items; -using CalamityMod.Items.Placeables.Furniture; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles.Abyss -{ - public class RustyChestLocked : ModTile - { - public override void SetDefaults() - { - this.SetUpChest(); - ModTranslation name = CreateMapEntryName("chestRusty"); - name.SetDefault("Rusty Chest"); - AddMapEntry(new Color(57, 48, 83), name, MapChestName); - dustType = ModContent.DustType(); - disableSmartCursor = true; - adjTiles = new int[] { TileID.Containers }; - chest = "Rusty Chest"; - chestDrop = ModContent.ItemType(); - } - - public override bool HasSmartInteract() => true; - - public override bool IsLockedChest(int i, int j) => Main.tile[i, j].frameX / 36 == 1; - - public override bool UnlockChest(int i, int j, ref short frameXAdjustment, ref int dustType, ref bool manual) - { - Player closest = Main.player[Player.FindClosest(new Vector2(i, j) * 16f, 1, 1)]; - if (!closest.InventoryHas(ModContent.ItemType())) - return false; - - for (int k = 0; k < closest.inventory.Length; k++) - { - if (closest.inventory[k].type == ModContent.ItemType()) - { - if (ItemLoader.ConsumeItem(closest.inventory[k], closest)) - { - closest.inventory[k].stack--; - } - if (closest.inventory[k].stack <= 0) - { - closest.inventory[k] = new Item(); - } - break; - } - } - - dustType = this.dustType; - - return true; - } - - public string MapChestName(string name, int i, int j) - { - // Bounds check - if (i < 0 || i >= Main.maxTilesX || j < 0 || j >= Main.maxTilesY) - return name; - - // Tile null check - Tile tile = Main.tile[i, j]; - if (tile is null) - return name; - - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - left--; - if (tile.frameY != 0) - top--; - - int chest = Chest.FindChest(left, top); - return name + (Main.chest[chest].name != "" ? ": " + Main.chest[chest].name : ""); - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = 1; - } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); - Chest.DestroyChest(i, j); - } - - public override bool NewRightClick(int i, int j) - { - Tile tile = Main.tile[i, j]; - - int left = i; - int top = j; - - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - return CalamityUtils.LockedChestRightClick(IsLockedChest(left, top), left, top, i, j); - } - - public override void MouseOver(int i, int j) - { - if (IsLockedChest(i, j)) - CalamityUtils.ChestMouseOver("Rusty Chest", i, j); - else - CalamityUtils.ChestMouseOver("Rusty Chest", i, j); - } - - public override void MouseOverFar(int i, int j) - { - if (IsLockedChest(i, j)) - CalamityUtils.ChestMouseFar("Rusty Chest", i, j); - else - CalamityUtils.ChestMouseFar("Rusty Chest", i, j); - } - } -} diff --git a/Tiles/Abyss/RustyChestLocked.png b/Tiles/Abyss/RustyChestLocked.png deleted file mode 100644 index e88cc3af08..0000000000 Binary files a/Tiles/Abyss/RustyChestLocked.png and /dev/null differ diff --git a/Tiles/Abyss/RustyChestLocked_Highlight.png b/Tiles/Abyss/RustyChestLocked_Highlight.png deleted file mode 100644 index 94e49a2c3d..0000000000 Binary files a/Tiles/Abyss/RustyChestLocked_Highlight.png and /dev/null differ diff --git a/Tiles/Abyss/RustyChestTile.cs b/Tiles/Abyss/RustyChestTile.cs new file mode 100644 index 0000000000..4111461e82 --- /dev/null +++ b/Tiles/Abyss/RustyChestTile.cs @@ -0,0 +1,81 @@ +using CalamityMod.Items.Placeables.Furniture; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Abyss +{ + public class RustyChestTile : ModTile + { + public override void SetDefaults() + { + this.SetUpChest(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Rusty Chest"); + AddMapEntry(new Color(191, 142, 111), name, MapChestName); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Rusty Chest"; + chestDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 180, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract() => true; + + public string MapChestName(string name, int i, int j) + { + // Bounds check + if (i < 0 || i >= Main.maxTilesX || j < 0 || j >= Main.maxTilesY) + return name; + + // Tile null check + Tile tile = Main.tile[i, j]; + if (tile is null) + return name; + + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + left--; + if (tile.frameY != 0) + top--; + + int chest = Chest.FindChest(left, top); + if (chest == -1) + return name; + return name + (Main.chest[chest].name != "" ? ": " + Main.chest[chest].name : ""); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, chestDrop); + Chest.DestroyChest(i, j); + } + + public override bool NewRightClick(int i, int j) + { + return CalamityUtils.ChestRightClick(i, j); + } + + public override void MouseOver(int i, int j) + { + CalamityUtils.ChestMouseOver("Rusty Chest", i, j); + } + + public override void MouseOverFar(int i, int j) + { + CalamityUtils.ChestMouseFar("Rusty Chest", i, j); + } + } +} diff --git a/Tiles/Abyss/RustyChestTile.png b/Tiles/Abyss/RustyChestTile.png new file mode 100644 index 0000000000..56fa385bc1 Binary files /dev/null and b/Tiles/Abyss/RustyChestTile.png differ diff --git a/Tiles/Abyss/RustyChestTile_Highlight.png b/Tiles/Abyss/RustyChestTile_Highlight.png new file mode 100644 index 0000000000..e530745085 Binary files /dev/null and b/Tiles/Abyss/RustyChestTile_Highlight.png differ diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite1.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite1.cs index 062ba57029..f493fb19c7 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite1.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite2.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite2.cs index 658e69ab75..86a7bc67cb 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite2.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite3.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite3.cs index 93947597cf..f8eaf5faf7 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite3.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite4.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite4.cs index 2e528711ca..d9179447e0 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite4.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite5.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite5.cs index a5b9195e2b..717095abd1 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite5.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite5.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalacmite6.cs b/Tiles/Abyss/Stalactite/SulphurousStalacmite6.cs index 44e7679268..14473333d9 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalacmite6.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalacmite6.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite1.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite1.cs index 6196c4010d..b2e78e9eca 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite1.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite2.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite2.cs index 17435e8c29..15e77505a2 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite2.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite3.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite3.cs index b7c9616506..5dee77e334 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite3.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite4.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite4.cs index f5a8117c35..5eecdf57fb 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite4.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite5.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite5.cs index 26b4eb84fb..0902142cd8 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite5.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite5.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/Stalactite/SulphurousStalactite6.cs b/Tiles/Abyss/Stalactite/SulphurousStalactite6.cs index e102c63cdf..913d7117ae 100644 --- a/Tiles/Abyss/Stalactite/SulphurousStalactite6.cs +++ b/Tiles/Abyss/Stalactite/SulphurousStalactite6.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SteamGeyser.cs b/Tiles/Abyss/SteamGeyser.cs index 3275265a58..52c62cb7e5 100644 --- a/Tiles/Abyss/SteamGeyser.cs +++ b/Tiles/Abyss/SteamGeyser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Environment; using Microsoft.Xna.Framework; using System; diff --git a/Tiles/Abyss/SulphurousColumn.cs b/Tiles/Abyss/SulphurousColumn.cs index 6e8482262b..6396cfe4bf 100644 --- a/Tiles/Abyss/SulphurousColumn.cs +++ b/Tiles/Abyss/SulphurousColumn.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousRib1.cs b/Tiles/Abyss/SulphurousRib1.cs index 9e254f7762..3afa1a24d0 100644 --- a/Tiles/Abyss/SulphurousRib1.cs +++ b/Tiles/Abyss/SulphurousRib1.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousRib2.cs b/Tiles/Abyss/SulphurousRib2.cs index 453c193cda..7fd43d1493 100644 --- a/Tiles/Abyss/SulphurousRib2.cs +++ b/Tiles/Abyss/SulphurousRib2.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousRib3.cs b/Tiles/Abyss/SulphurousRib3.cs index 2f1e4d3514..a667bf2aed 100644 --- a/Tiles/Abyss/SulphurousRib3.cs +++ b/Tiles/Abyss/SulphurousRib3.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousRib4.cs b/Tiles/Abyss/SulphurousRib4.cs index 3362214509..d2f36f5f54 100644 --- a/Tiles/Abyss/SulphurousRib4.cs +++ b/Tiles/Abyss/SulphurousRib4.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousRib5.cs b/Tiles/Abyss/SulphurousRib5.cs index 147743daf5..7677f76700 100644 --- a/Tiles/Abyss/SulphurousRib5.cs +++ b/Tiles/Abyss/SulphurousRib5.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index 5e3b428401..8b64748158 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(150, 100, 50)); mineResist = 1f; minPick = 55; - soundType = 0; + soundType = SoundID.Dig; SetModPalmTree(new AcidWoodTree()); } @@ -130,7 +130,7 @@ namespace CalamityMod.Tiles.Abyss if (!Main.tile[i, tileLocationY].active()) { if (!CalamityPlayer.areThereAnyDamnBosses && Main.tile[i, tileLocationY].liquid == 255 && Main.tile[i, tileLocationY - 1].liquid == 255 && - Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != 1) + Main.tile[i, tileLocationY - 2].liquid == 255 && Main.netMode != NetmodeID.MultiplayerClient) { Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType(), 0, 2f, Main.myPlayer, 0f, 0f); } @@ -158,7 +158,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[i, tileLocationY - 4].liquid == 255) { WorldGen.PlaceTile(i, tileLocationY, 81, true, false, -1, 0); - if (Main.netMode == 2 && Main.tile[i, tileLocationY].active()) + if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].active()) { NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } @@ -182,7 +182,7 @@ namespace CalamityMod.Tiles.Abyss if (num15 < num14) { WorldGen.PlaceTile(i, tileLocationY, 324, true, false, -1, Main.rand.Next(2)); - if (Main.netMode == 2 && Main.tile[i, tileLocationY].active()) + if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].active()) { NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } @@ -237,7 +237,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[num53, num54].type = (ushort)ModContent.TileType(); Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); } diff --git a/Tiles/Abyss/SulphurousSandNoWater.cs b/Tiles/Abyss/SulphurousSandNoWater.cs index 06bacbc2f6..f760ff8e59 100644 --- a/Tiles/Abyss/SulphurousSandNoWater.cs +++ b/Tiles/Abyss/SulphurousSandNoWater.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.Abyss { @@ -19,7 +20,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(150, 100, 50)); mineResist = 1f; minPick = 55; - soundType = 0; + soundType = SoundID.Dig; SetModPalmTree(new AcidWoodTree()); } diff --git a/Tiles/Abyss/SulphurousSandstone.cs b/Tiles/Abyss/SulphurousSandstone.cs index b56db9b99b..4427a0dd15 100644 --- a/Tiles/Abyss/SulphurousSandstone.cs +++ b/Tiles/Abyss/SulphurousSandstone.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(113, 90, 71)); mineResist = 1f; minPick = 55; - soundType = 0; + soundType = SoundID.Dig; } public override void NumDust(int i, int j, bool fail, ref int num) @@ -86,7 +86,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[num53, num54].type = (ushort)ModContent.TileType(); Main.tile[num53, num54].active(true); WorldGen.SquareTileFrame(num53, num54, true); - if (Main.netMode == 2) + if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); } diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index 0c016b583e..f8e00d88c2 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.Abyss ModTranslation name = CreateMapEntryName(); name.SetDefault("Sulphurous Vines"); AddMapEntry(new Color(0, 50, 0), name); - soundType = 6; + soundType = SoundID.Grass; dustType = 2; } @@ -42,7 +42,7 @@ namespace CalamityMod.Tiles.Abyss WorldGen.KillTile(i, j + 1, false, false, false); if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); } } } diff --git a/Tiles/Abyss/Tenebris.cs b/Tiles/Abyss/Tenebris.cs index 40fa30d268..8a1297511f 100644 --- a/Tiles/Abyss/Tenebris.cs +++ b/Tiles/Abyss/Tenebris.cs @@ -1,4 +1,3 @@ - using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -25,7 +24,7 @@ namespace CalamityMod.Tiles.Abyss AddMapEntry(new Color(0, 100, 100), name); mineResist = 3f; minPick = 200; - soundType = 21; + soundType = SoundID.Tink; } public override bool CanExplode(int i, int j) @@ -50,48 +49,6 @@ namespace CalamityMod.Tiles.Abyss } } - public override void RandomUpdate(int i, int j) - { - if (Main.rand.NextBool(5)) - { - if (CalamityWorld.downedCalamitas) - { - int random = WorldGen.genRand.Next(4); - if (random == 0) - { - i++; - } - if (random == 1) - { - i--; - } - if (random == 2) - { - j++; - } - if (random == 3) - { - j--; - } - if (Main.tile[i, j] != null) - { - if (Main.tile[i, j].active()) - { - if (Main.tile[i, j].type == ModContent.TileType() && !Main.tile[i, j].lava()) - { - Main.tile[i, j].type = (ushort)ModContent.TileType(); - WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); - } - } - } - } - } - } - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); diff --git a/Tiles/Abyss/ViperVines.cs b/Tiles/Abyss/ViperVines.cs index 7a2fe75d8b..4143805eb9 100644 --- a/Tiles/Abyss/ViperVines.cs +++ b/Tiles/Abyss/ViperVines.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Tiles.Abyss ModTranslation name = CreateMapEntryName(); name.SetDefault("Viper Vines"); AddMapEntry(new Color(0, 50, 0), name); - soundType = 6; + soundType = SoundID.Grass; dustType = 2; } @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Abyss WorldGen.KillTile(i, j + 1, false, false, false); if (!Main.tile[i, j + 1].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j + 1, 0f, 0, 0, 0); } } } diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 04aee3d2d2..e01b0df50c 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Tiles.Abyss CalamityUtils.MergeWithAbyss(Type); TileID.Sets.ChecksForMerge[Type] = true; - soundType = 21; + soundType = SoundID.Tink; mineResist = 10f; minPick = 180; drop = ModContent.ItemType(); diff --git a/Tiles/AerialiteBrick.cs b/Tiles/AerialiteBrick.cs index 64e48a6a35..4fc755fe89 100644 --- a/Tiles/AerialiteBrick.cs +++ b/Tiles/AerialiteBrick.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class AerialiteBrick : ModTile @@ -9,7 +11,7 @@ namespace CalamityMod.Tiles { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; minPick = 50; drop = ModContent.ItemType(); AddMapEntry(new Color(68, 58, 145)); diff --git a/Tiles/ArenaTile.cs b/Tiles/ArenaTile.cs index 783a7ff417..d5fb99356a 100644 --- a/Tiles/ArenaTile.cs +++ b/Tiles/ArenaTile.cs @@ -2,6 +2,8 @@ using CalamityMod.NPCs.SupremeCalamitas; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class ArenaTile : ModTile @@ -33,9 +35,9 @@ namespace CalamityMod.Tiles if (!NPC.AnyNPCs(ModContent.NPCType())) { WorldGen.KillTile(i, j, false, false, false); - if (!Main.tile[i, j].active() && Main.netMode != 0) + if (!Main.tile[i, j].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0); } } } diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index a5669e8cc4..ef60b9f0bc 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -1,5 +1,3 @@ - -using CalamityMod.Tiles.Astral; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralGrass : ModTile + public class AstralGrass : ModTile { public override void SetDefaults() { diff --git a/Tiles/Astral/AstralNormalLargePiles.cs b/Tiles/Astral/AstralNormalLargePiles.cs index 8ee94c5653..6305c78522 100644 --- a/Tiles/Astral/AstralNormalLargePiles.cs +++ b/Tiles/Astral/AstralNormalLargePiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/Astral/AstralNormalMediumPiles.cs b/Tiles/Astral/AstralNormalMediumPiles.cs index 7d9f275cac..13c9ad7197 100644 --- a/Tiles/Astral/AstralNormalMediumPiles.cs +++ b/Tiles/Astral/AstralNormalMediumPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/Astral/AstralNormalSmallPiles.cs b/Tiles/Astral/AstralNormalSmallPiles.cs index b9dc596817..7e38372873 100644 --- a/Tiles/Astral/AstralNormalSmallPiles.cs +++ b/Tiles/Astral/AstralNormalSmallPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/Astral/AstralNormalStalactite.cs b/Tiles/Astral/AstralNormalStalactite.cs index 0cb449b570..8b27115871 100644 --- a/Tiles/Astral/AstralNormalStalactite.cs +++ b/Tiles/Astral/AstralNormalStalactite.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/Astral/AstralShortPlants.cs b/Tiles/Astral/AstralShortPlants.cs index 217f7b12ad..d27e3e6627 100644 --- a/Tiles/Astral/AstralShortPlants.cs +++ b/Tiles/Astral/AstralShortPlants.cs @@ -1,8 +1,9 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.Astral { @@ -21,7 +22,7 @@ namespace CalamityMod.Tiles.Astral dustType = ModContent.DustType(); soundStyle = 1; - soundType = 6; + soundType = SoundID.Grass; AddMapEntry(new Color(127, 111, 144)); diff --git a/Tiles/Astral/AstralStone.cs b/Tiles/Astral/AstralStone.cs index b37d924ccd..170fbdc0f1 100644 --- a/Tiles/Astral/AstralStone.cs +++ b/Tiles/Astral/AstralStone.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.Astral dustType = ModContent.DustType(); drop = ModContent.ItemType(); - soundType = 21; + soundType = SoundID.Tink; AddMapEntry(new Color(45, 36, 63)); diff --git a/Tiles/Astral/AstralTallPlants.cs b/Tiles/Astral/AstralTallPlants.cs index d89541dd5a..0335b5bc86 100644 --- a/Tiles/Astral/AstralTallPlants.cs +++ b/Tiles/Astral/AstralTallPlants.cs @@ -1,8 +1,9 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.Astral { @@ -21,7 +22,7 @@ namespace CalamityMod.Tiles.Astral dustType = ModContent.DustType(); soundStyle = 1; - soundType = 6; + soundType = SoundID.Grass; AddMapEntry(new Color(127, 111, 144)); diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index 93e9b6d296..1357ebc013 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral diff --git a/Tiles/Astral/AstralTreeSapling.cs b/Tiles/Astral/AstralTreeSapling.cs index b52702b9eb..1261d8e4fc 100644 --- a/Tiles/Astral/AstralTreeSapling.cs +++ b/Tiles/Astral/AstralTreeSapling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/Astral/AstralVines.cs b/Tiles/Astral/AstralVines.cs index 06934898d5..7b2d1fc82f 100644 --- a/Tiles/Astral/AstralVines.cs +++ b/Tiles/Astral/AstralVines.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.Astral dustType = ModContent.DustType(); - soundType = 6; + soundType = SoundID.Grass; soundStyle = 1; AddMapEntry(new Color(65, 56, 83)); diff --git a/Tiles/AstralBar.cs b/Tiles/AstralBar.cs index 38711e3b1e..f7bcedc5c9 100644 --- a/Tiles/AstralBar.cs +++ b/Tiles/AstralBar.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Tiles/AstralBrick.cs b/Tiles/AstralBrick.cs index bb34563cd8..01c81403f5 100644 --- a/Tiles/AstralBrick.cs +++ b/Tiles/AstralBrick.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles { @@ -16,7 +17,7 @@ namespace CalamityMod.Tiles { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; minPick = 150; drop = ModContent.ItemType(); AddMapEntry(new Color(128, 128, 158)); diff --git a/Tiles/AstralDesert/AstralDesertLargePiles.cs b/Tiles/AstralDesert/AstralDesertLargePiles.cs index 71a18d1542..e603c336da 100644 --- a/Tiles/AstralDesert/AstralDesertLargePiles.cs +++ b/Tiles/AstralDesert/AstralDesertLargePiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralDesert/AstralDesertMediumPiles.cs b/Tiles/AstralDesert/AstralDesertMediumPiles.cs index 78db07b980..af498e69c0 100644 --- a/Tiles/AstralDesert/AstralDesertMediumPiles.cs +++ b/Tiles/AstralDesert/AstralDesertMediumPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralDesert/AstralDesertSmallPiles.cs b/Tiles/AstralDesert/AstralDesertSmallPiles.cs index cc18366160..1247a89797 100644 --- a/Tiles/AstralDesert/AstralDesertSmallPiles.cs +++ b/Tiles/AstralDesert/AstralDesertSmallPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralDesert/AstralDesertStalactite.cs b/Tiles/AstralDesert/AstralDesertStalactite.cs index e0175a1dd9..d2f72a8089 100644 --- a/Tiles/AstralDesert/AstralDesertStalactite.cs +++ b/Tiles/AstralDesert/AstralDesertStalactite.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralDesert/AstralPalmSapling.cs b/Tiles/AstralDesert/AstralPalmSapling.cs index 46b1a0e45c..a063e2d644 100644 --- a/Tiles/AstralDesert/AstralPalmSapling.cs +++ b/Tiles/AstralDesert/AstralPalmSapling.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index a48b85c300..4d7cb94fd6 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert diff --git a/Tiles/AstralSnow/AstralIce.cs b/Tiles/AstralSnow/AstralIce.cs index d840ba687e..350b1120d3 100644 --- a/Tiles/AstralSnow/AstralIce.cs +++ b/Tiles/AstralSnow/AstralIce.cs @@ -1,5 +1,3 @@ - -using CalamityMod.Tiles.Astral; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralIce : ModTile + public class AstralIce : ModTile { public override void SetDefaults() { @@ -22,7 +20,7 @@ namespace CalamityMod.Tiles.AstralSnow dustType = 173; drop = ModContent.ItemType(); - soundType = 2; + soundType = SoundID.Item; soundStyle = 50; AddMapEntry(new Color(153, 143, 168)); diff --git a/Tiles/AstralSnow/AstralIceLargePiles.cs b/Tiles/AstralSnow/AstralIceLargePiles.cs index 0352bb700e..c67751a01a 100644 --- a/Tiles/AstralSnow/AstralIceLargePiles.cs +++ b/Tiles/AstralSnow/AstralIceLargePiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralSnow/AstralIceMediumPiles.cs b/Tiles/AstralSnow/AstralIceMediumPiles.cs index 56c2943b30..8478a1731b 100644 --- a/Tiles/AstralSnow/AstralIceMediumPiles.cs +++ b/Tiles/AstralSnow/AstralIceMediumPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralSnow/AstralIceSmallPiles.cs b/Tiles/AstralSnow/AstralIceSmallPiles.cs index b94e209d0b..d0b65efc19 100644 --- a/Tiles/AstralSnow/AstralIceSmallPiles.cs +++ b/Tiles/AstralSnow/AstralIceSmallPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralSnow/AstralIceStalactite.cs b/Tiles/AstralSnow/AstralIceStalactite.cs index 1b197346ad..51f0974bf2 100644 --- a/Tiles/AstralSnow/AstralIceStalactite.cs +++ b/Tiles/AstralSnow/AstralIceStalactite.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index 83c0920d73..c3a455775a 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.AstralSnow dustType = 173; drop = ModContent.ItemType(); - soundType = 2; + soundType = SoundID.Item; soundStyle = 48; AddMapEntry(new Color(189, 211, 221)); diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index 0a3fa157ed..1d3c22882a 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Tiles diff --git a/Tiles/AstralSnow/AstralSnowTreeSapling.cs b/Tiles/AstralSnow/AstralSnowTreeSapling.cs index 8b51531c58..8eaa8b4515 100644 --- a/Tiles/AstralSnow/AstralSnowTreeSapling.cs +++ b/Tiles/AstralSnow/AstralSnowTreeSapling.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 507235a53a..1137bed448 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Tiles public class CalamityGlobalTile : GlobalTile { public static IList WaterStyles => (IList)typeof(WaterStyleLoader).GetField("waterStyles", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); - public static ushort[] PlantTypes = new ushort[] + + public static ushort[] PlantTypes = new ushort[] { TileID.Plants, TileID.CorruptPlants, @@ -33,9 +34,16 @@ namespace CalamityMod.Tiles TileID.HallowedPlants2, TileID.FleshWeeds, (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), + (ushort)ModContent.TileType() }; + public static List GrowthTiles = new List + { + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType() + }; + public override bool PreHitWire(int i, int j, int type) { return !CalamityWorld.bossRushActive; @@ -127,7 +135,7 @@ namespace CalamityMod.Tiles { WorldGen.KillTile(xPos, yPos, false, false, false); if (!Main.tile[xPos, yPos].active() && Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(17, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, xPos, yPos, 0f, 0, 0, 0); } } @@ -492,7 +500,7 @@ namespace CalamityMod.Tiles if (type == ModContent.TileType() || type == ModContent.TileType()) ai0 = 1f; int projectileType = ModContent.ProjectileType(); - int proj = Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, 0f, projectileType, 0, 0f, Main.myPlayer, ai0, 0f); + int proj = Projectile.NewProjectile(i * 16, j * 16, 0f, 0f, projectileType, 0, 0f, Main.myPlayer, ai0, 0f); Main.projectile[proj].netUpdate = true; } } diff --git a/Tiles/ChaoticBrick.cs b/Tiles/ChaoticBrick.cs index fe0edc6ee5..ff5cdb4f55 100644 --- a/Tiles/ChaoticBrick.cs +++ b/Tiles/ChaoticBrick.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class ChaoticBrick : ModTile @@ -15,7 +17,7 @@ namespace CalamityMod.Tiles ModTranslation name = CreateMapEntryName(); name.SetDefault("Chaotic Brick"); AddMapEntry(new Color(255, 0, 0), name); - soundType = 21; + soundType = SoundID.Tink; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/Cinderplate.cs b/Tiles/Cinderplate.cs index 5b034e95c6..d3d9126417 100644 --- a/Tiles/Cinderplate.cs +++ b/Tiles/Cinderplate.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class Cinderplate : ModTile @@ -15,7 +17,7 @@ namespace CalamityMod.Tiles CalamityUtils.MergeWithGeneral(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 1f; minPick = 65; drop = ModContent.ItemType(); diff --git a/Tiles/Crags/BrimstoneCrateTile.cs b/Tiles/Crags/BrimstoneCrateTile.cs index e9cd895a98..74958ff9ac 100644 --- a/Tiles/Crags/BrimstoneCrateTile.cs +++ b/Tiles/Crags/BrimstoneCrateTile.cs @@ -1,4 +1,3 @@ -using CalamityMod.Dusts; using CalamityMod.Items.Fishing.BrimstoneCragCatches; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.Crags { - public class BrimstoneCrateTile : ModTile + public class BrimstoneCrateTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/Crags/BrimstoneSlag.cs b/Tiles/Crags/BrimstoneSlag.cs index 0a000e9658..b90e364131 100644 --- a/Tiles/Crags/BrimstoneSlag.cs +++ b/Tiles/Crags/BrimstoneSlag.cs @@ -1,11 +1,12 @@ using CalamityMod.Tiles.Ores; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Crags { - public class BrimstoneSlag : ModTile + public class BrimstoneSlag : ModTile { private const short subsheetWidth = 450; private const short subsheetHeight = 198; @@ -19,7 +20,7 @@ namespace CalamityMod.Tiles.Crags CalamityUtils.MergeWithHell(Type); CalamityUtils.SetMerge(Type, ModContent.TileType()); - soundType = 21; + soundType = SoundID.Tink; mineResist = 3f; minPick = 180; drop = ModContent.ItemType(); diff --git a/Tiles/CryonicBrick.cs b/Tiles/CryonicBrick.cs index 4d83c033e9..f126caf6f3 100644 --- a/Tiles/CryonicBrick.cs +++ b/Tiles/CryonicBrick.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class CryonicBrick : ModTile @@ -16,7 +18,7 @@ namespace CalamityMod.Tiles CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeDecorativeTiles(Type); - soundType = 21; + soundType = SoundID.Tink; minPick = 100; drop = ModContent.ItemType(); AddMapEntry(new Color(99, 131, 199)); diff --git a/Tiles/Furniture/AuricToiletTile.cs b/Tiles/Furniture/AuricToiletTile.cs index dfadd9a8e3..648cd8eab0 100644 --- a/Tiles/Furniture/AuricToiletTile.cs +++ b/Tiles/Furniture/AuricToiletTile.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.Origin = new Point16(1, 1); TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 4, 0); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); TileObjectData.newTile.LavaDeath = false; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; diff --git a/Tiles/Furniture/BabyFlakHermitCageTile.cs b/Tiles/Furniture/BabyFlakHermitCageTile.cs index a49db62094..062d5a9337 100644 --- a/Tiles/Furniture/BabyFlakHermitCageTile.cs +++ b/Tiles/Furniture/BabyFlakHermitCageTile.cs @@ -1,13 +1,12 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class BabyFlakHermitCageTile : ModTile + public class BabyFlakHermitCageTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/Furniture/ChaosCandle.cs b/Tiles/Furniture/ChaosCandle.cs index d7fc99c61b..2a6c8aaae9 100644 --- a/Tiles/Furniture/ChaosCandle.cs +++ b/Tiles/Furniture/ChaosCandle.cs @@ -1,15 +1,13 @@ using CalamityMod.Buffs.Placeables; -using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class ChaosCandle : ModTile + public class ChaosCandle : ModTile { public override void SetDefaults() { diff --git a/Tiles/Furniture/CraftingStations/AncientAltar.cs b/Tiles/Furniture/CraftingStations/AncientAltar.cs index f8306aadad..f4ccf63e90 100644 --- a/Tiles/Furniture/CraftingStations/AncientAltar.cs +++ b/Tiles/Furniture/CraftingStations/AncientAltar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Tiles/Furniture/CraftingStations/AshenAltar.cs b/Tiles/Furniture/CraftingStations/AshenAltar.cs index 77a368f614..aafc37e040 100644 --- a/Tiles/Furniture/CraftingStations/AshenAltar.cs +++ b/Tiles/Furniture/CraftingStations/AshenAltar.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Tiles/Furniture/CraftingStations/BotanicPlanter.cs b/Tiles/Furniture/CraftingStations/BotanicPlanter.cs index 4f0edb4072..559fee4265 100644 --- a/Tiles/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Tiles/Furniture/CraftingStations/BotanicPlanter.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs b/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs index e6995b91ea..b976098f64 100644 --- a/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs +++ b/Tiles/Furniture/CraftingStations/EutrophicCrafting.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.Enums; diff --git a/Tiles/Furniture/CraftingStations/PlagueInfuser.cs b/Tiles/Furniture/CraftingStations/PlagueInfuser.cs index 8e53a4b8a4..26b9986987 100644 --- a/Tiles/Furniture/CraftingStations/PlagueInfuser.cs +++ b/Tiles/Furniture/CraftingStations/PlagueInfuser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.Enums; diff --git a/Tiles/Furniture/CraftingStations/ProfanedBasin.cs b/Tiles/Furniture/CraftingStations/ProfanedBasin.cs index b2f07f4b01..2fe608cb69 100644 --- a/Tiles/Furniture/CraftingStations/ProfanedBasin.cs +++ b/Tiles/Furniture/CraftingStations/ProfanedBasin.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin.cs b/Tiles/Furniture/CraftingStations/SilvaBasin.cs index fc056c2d02..890557fb4a 100644 --- a/Tiles/Furniture/CraftingStations/SilvaBasin.cs +++ b/Tiles/Furniture/CraftingStations/SilvaBasin.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.cs b/Tiles/Furniture/CraftingStations/StaticRefiner.cs index 820d169c47..7329f743c6 100644 --- a/Tiles/Furniture/CraftingStations/StaticRefiner.cs +++ b/Tiles/Furniture/CraftingStations/StaticRefiner.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/Furniture/CraftingStations/VoidCondenser.cs b/Tiles/Furniture/CraftingStations/VoidCondenser.cs index 7f7edd2cc4..b32a0abd58 100644 --- a/Tiles/Furniture/CraftingStations/VoidCondenser.cs +++ b/Tiles/Furniture/CraftingStations/VoidCondenser.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/Furniture/PiggyCageTile.cs b/Tiles/Furniture/PiggyCageTile.cs index d666dcbff6..900468a087 100644 --- a/Tiles/Furniture/PiggyCageTile.cs +++ b/Tiles/Furniture/PiggyCageTile.cs @@ -1,13 +1,12 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class PiggyCageTile : ModTile + public class PiggyCageTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/Furniture/SeaMinnowJarTile.cs b/Tiles/Furniture/SeaMinnowJarTile.cs index 242e9b45d0..a23495f777 100644 --- a/Tiles/Furniture/SeaMinnowJarTile.cs +++ b/Tiles/Furniture/SeaMinnowJarTile.cs @@ -1,13 +1,12 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class SeaMinnowJarTile : ModTile + public class SeaMinnowJarTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/Furniture/TranquilityCandle.cs b/Tiles/Furniture/TranquilityCandle.cs index 15bd7d7c3d..f1c55286d4 100644 --- a/Tiles/Furniture/TranquilityCandle.cs +++ b/Tiles/Furniture/TranquilityCandle.cs @@ -4,11 +4,10 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class TranquilityCandle : ModTile + public class TranquilityCandle : ModTile { public override void SetDefaults() { diff --git a/Tiles/Furniture/TwinklerInABottleTile.cs b/Tiles/Furniture/TwinklerInABottleTile.cs index ad308d7f45..d544ce5e11 100644 --- a/Tiles/Furniture/TwinklerInABottleTile.cs +++ b/Tiles/Furniture/TwinklerInABottleTile.cs @@ -3,11 +3,10 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture { - public class TwinklerInABottleTile : ModTile + public class TwinklerInABottleTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureAbyss/AbyssCandle.cs b/Tiles/FurnitureAbyss/AbyssCandle.cs index b32dc35b25..11d9a3c077 100644 --- a/Tiles/FurnitureAbyss/AbyssCandle.cs +++ b/Tiles/FurnitureAbyss/AbyssCandle.cs @@ -1,5 +1,4 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -7,7 +6,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureAbyss { - public class AbyssCandle : ModTile + public class AbyssCandle : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs index 4908935f52..ed68af1592 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravel.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureAbyss { public class SmoothAbyssGravel : ModTile @@ -17,7 +19,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeWithAbyss(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 2f; minPick = 65; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs index 7c7794f71f..63af8d5bc3 100644 --- a/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs +++ b/Tiles/FurnitureAbyss/SmoothAbyssGravelPlatform.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss public override void SetDefaults() { this.SetUpPlatform(); - soundType = 21; + soundType = SoundID.Tink; AddMapEntry(new Color(191, 142, 111)); drop = ModContent.ItemType(); disableSmartCursor = true; diff --git a/Tiles/FurnitureAncient/AncientBasin.cs b/Tiles/FurnitureAncient/AncientBasin.cs index c937c4458b..5c59623ee5 100644 --- a/Tiles/FurnitureAncient/AncientBasin.cs +++ b/Tiles/FurnitureAncient/AncientBasin.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Tiles/FurnitureAncient/AncientSink.cs b/Tiles/FurnitureAncient/AncientSink.cs index c5ceb69487..3eabd4c90b 100644 --- a/Tiles/FurnitureAncient/AncientSink.cs +++ b/Tiles/FurnitureAncient/AncientSink.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAncient { - public class AncientSink : ModTile + public class AncientSink : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureAshen/AshenBasin.cs b/Tiles/FurnitureAshen/AshenBasin.cs index 05410badd8..24f777d1e1 100644 --- a/Tiles/FurnitureAshen/AshenBasin.cs +++ b/Tiles/FurnitureAshen/AshenBasin.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; diff --git a/Tiles/FurnitureAshen/AshenSink.cs b/Tiles/FurnitureAshen/AshenSink.cs index 160f4d3b07..0df0e27185 100644 --- a/Tiles/FurnitureAshen/AshenSink.cs +++ b/Tiles/FurnitureAshen/AshenSink.cs @@ -1,11 +1,10 @@ using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAshen { - public class AshenSink : ModTile + public class AshenSink : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureAshen/AshenSlab.cs b/Tiles/FurnitureAshen/AshenSlab.cs index 3e1acf5a47..93e9d4bf63 100644 --- a/Tiles/FurnitureAshen/AshenSlab.cs +++ b/Tiles/FurnitureAshen/AshenSlab.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureAshen { public class AshenSlab : ModTile @@ -12,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; drop = ModContent.ItemType(); - soundType = 21; + soundType = SoundID.Tink; mineResist = 5f; minPick = 180; AddMapEntry(new Color(40, 24, 48)); diff --git a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs index f260f2e062..2dcc063aa7 100644 --- a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs +++ b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureAshen { public class SmoothBrimstoneSlag : ModTile @@ -18,7 +20,7 @@ namespace CalamityMod.Tiles.FurnitureAshen CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeWithHell(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 5f; minPick = 180; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureAstral/MonolithChest.cs b/Tiles/FurnitureAstral/MonolithChest.cs index ce698812ab..f0270e566e 100644 --- a/Tiles/FurnitureAstral/MonolithChest.cs +++ b/Tiles/FurnitureAstral/MonolithChest.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Tiles.FurnitureAstral { if (player.chest < 0) { - Main.PlaySound(4, Style: 22, volumeScale: 0.5f); + Main.PlaySound(SoundID.NPCKilled, Style: 22, volumeScale: 0.5f); } } } diff --git a/Tiles/FurnitureAstral/MonolithPlatform.cs b/Tiles/FurnitureAstral/MonolithPlatform.cs index 61fc144349..a4e1588348 100644 --- a/Tiles/FurnitureAstral/MonolithPlatform.cs +++ b/Tiles/FurnitureAstral/MonolithPlatform.cs @@ -1,13 +1,12 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAstral { - public class MonolithPlatform : ModTile + public class MonolithPlatform : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureBotanic/BotanicSink.cs b/Tiles/FurnitureBotanic/BotanicSink.cs index df4a13930a..149e861c74 100644 --- a/Tiles/FurnitureBotanic/BotanicSink.cs +++ b/Tiles/FurnitureBotanic/BotanicSink.cs @@ -1,12 +1,11 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureBotanic { - public class BotanicSink : ModTile + public class BotanicSink : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs index fef56b81c4..a76b519ecc 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBasinTile.cs @@ -1,7 +1,5 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs index c391a8a0e4..a183059c13 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureCosmilite { public class CosmiliteBrick : ModTile @@ -11,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; mineResist = 5f; minPick = 275; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureEutrophic/SmoothNavystone.cs index b354a98f67..5a15bb089c 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureEutrophic/SmoothNavystone.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic CalamityUtils.MergeWithDesert(Type); TileID.Sets.ChecksForMerge[Type] = true; - soundType = 21; + soundType = SoundID.Tink; minPick = 55; drop = ModContent.ItemType(); AddMapEntry(new Color(39, 48, 53)); diff --git a/Tiles/FurnitureOccult/OccultCandle.cs b/Tiles/FurnitureOccult/OccultCandle.cs index 4db9eb9353..41ee78a185 100644 --- a/Tiles/FurnitureOccult/OccultCandle.cs +++ b/Tiles/FurnitureOccult/OccultCandle.cs @@ -1,13 +1,12 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOccult { - public class OccultCandle : ModTile + public class OccultCandle : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureOccult/OccultStone.cs b/Tiles/FurnitureOccult/OccultStone.cs index e25dbcad83..e7170e7e3a 100644 --- a/Tiles/FurnitureOccult/OccultStone.cs +++ b/Tiles/FurnitureOccult/OccultStone.cs @@ -1,8 +1,10 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureOccult { public class OccultStone : ModTile @@ -20,7 +22,7 @@ namespace CalamityMod.Tiles.FurnitureOccult CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeSmoothTiles(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 10f; minPick = 200; drop = ModContent.ItemType(); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs index 377e26ef99..d920da9a36 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurniturePlaguedPlate { public class PlaguedPlate : ModTile @@ -11,7 +13,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; mineResist = 3f; minPick = 210; drop = ModContent.ItemType(); diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBasin.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBasin.cs index 27593f00db..715a6364c9 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBasin.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBasin.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Tiles/FurnitureProfaned/ProfanedCrystal.cs b/Tiles/FurnitureProfaned/ProfanedCrystal.cs index 418edb3b5c..578d4dacfc 100644 --- a/Tiles/FurnitureProfaned/ProfanedCrystal.cs +++ b/Tiles/FurnitureProfaned/ProfanedCrystal.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureProfaned { public class ProfanedCrystal : ModTile @@ -18,7 +20,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeSmoothTiles(Type); - soundType = 13; + soundType = SoundID.Shatter; mineResist = 1f; minPick = 225; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureProfaned/ProfanedRock.cs b/Tiles/FurnitureProfaned/ProfanedRock.cs index 0b28736693..75737dcea3 100644 --- a/Tiles/FurnitureProfaned/ProfanedRock.cs +++ b/Tiles/FurnitureProfaned/ProfanedRock.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.FurnitureProfaned { @@ -19,7 +20,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeSmoothTiles(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 4f; minPick = 225; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureProfaned/ProfanedSink.cs b/Tiles/FurnitureProfaned/ProfanedSink.cs index e2ce877be9..67b47521e9 100644 --- a/Tiles/FurnitureProfaned/ProfanedSink.cs +++ b/Tiles/FurnitureProfaned/ProfanedSink.cs @@ -1,12 +1,11 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureProfaned { - public class ProfanedSink : ModTile + public class ProfanedSink : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureProfaned/ProfanedSlab.cs b/Tiles/FurnitureProfaned/ProfanedSlab.cs index 08b7de818c..cf993d76fb 100644 --- a/Tiles/FurnitureProfaned/ProfanedSlab.cs +++ b/Tiles/FurnitureProfaned/ProfanedSlab.cs @@ -3,6 +3,7 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.FurnitureProfaned { @@ -18,7 +19,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned CalamityUtils.MergeSmoothTiles(Type); CalamityUtils.SetMerge(Type, ModContent.TileType()); - soundType = 21; + soundType = SoundID.Tink; mineResist = 4f; minPick = 225; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs index 455f53665c..351f4b5da1 100644 --- a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs +++ b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.FurnitureProfaned { @@ -18,7 +19,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeSmoothTiles(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 4f; minPick = 225; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureSilva/SilvaCrystal.cs b/Tiles/FurnitureSilva/SilvaCrystal.cs index 88cdd34d8b..e45e25040e 100644 --- a/Tiles/FurnitureSilva/SilvaCrystal.cs +++ b/Tiles/FurnitureSilva/SilvaCrystal.cs @@ -3,6 +3,7 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Tiles.FurnitureSilva { @@ -13,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureSilva Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; mineResist = 2f; minPick = 275; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureStratus/StratusBricks.cs b/Tiles/FurnitureStratus/StratusBricks.cs index c6ab8105f1..b3db9584b8 100644 --- a/Tiles/FurnitureStratus/StratusBricks.cs +++ b/Tiles/FurnitureStratus/StratusBricks.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.FurnitureStratus CalamityUtils.MergeWithGeneral(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 5f; minPick = 225; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureStratus/StratusCandle.cs b/Tiles/FurnitureStratus/StratusCandle.cs index 1da7ba53e1..e990975b06 100644 --- a/Tiles/FurnitureStratus/StratusCandle.cs +++ b/Tiles/FurnitureStratus/StratusCandle.cs @@ -1,12 +1,11 @@ using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureStratus { - public class StratusCandle : ModTile + public class StratusCandle : ModTile { public override void SetDefaults() { diff --git a/Tiles/FurnitureVoid/SmoothVoidstone.cs b/Tiles/FurnitureVoid/SmoothVoidstone.cs index 3c141139fd..d430b4a72e 100644 --- a/Tiles/FurnitureVoid/SmoothVoidstone.cs +++ b/Tiles/FurnitureVoid/SmoothVoidstone.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureVoid { public class SmoothVoidstone : ModTile @@ -18,7 +20,7 @@ namespace CalamityMod.Tiles.FurnitureVoid CalamityUtils.MergeDecorativeTiles(Type); CalamityUtils.MergeWithAbyss(Type); - soundType = 21; + soundType = SoundID.Tink; mineResist = 7f; minPick = 180; drop = ModContent.ItemType(); diff --git a/Tiles/FurnitureVoid/VoidstoneSlab.cs b/Tiles/FurnitureVoid/VoidstoneSlab.cs index cb3753725a..9ca593cd3e 100644 --- a/Tiles/FurnitureVoid/VoidstoneSlab.cs +++ b/Tiles/FurnitureVoid/VoidstoneSlab.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.FurnitureVoid { public class VoidstoneSlab : ModTile @@ -11,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureVoid Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; - soundType = 21; + soundType = SoundID.Tink; mineResist = 7f; minPick = 180; drop = ModContent.ItemType(); diff --git a/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs b/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs index 49e4b83c8e..e7a37e66cc 100644 --- a/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs +++ b/Tiles/LivingFire/LivingBrimstoneFireBlockTile.cs @@ -1,6 +1,8 @@ using CalamityMod.Dusts; using CalamityMod.Items.Placeables.LivingFire; using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -9,38 +11,88 @@ using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.LivingFire { - public class LivingBrimstoneFireBlockTile : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - soundType = SoundID.Dig; - drop = ModContent.ItemType(); - AddMapEntry(new Color(178, 34, 34)); - animationFrameHeight = 90; - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = false; - } + public class LivingBrimstoneFireBlockTile : ModTile + { + //Thank you to Seraph for getting living fire blocks to work properly. + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + soundType = SoundID.Dig; + drop = ModContent.ItemType(); + AddMapEntry(new Color(178, 34, 34)); + animationFrameHeight = 90; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = false; + Main.tileFrameImportant[Type] = false; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 1; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.HookCheck = new PlacementHook(CanPlaceAlter, -1, 0, true ); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - public override void AnimateTile(ref int frame, ref int frameCounter) - { + TileObjectData.addTile(Type); + } + + public int CanPlaceAlter(int i, int j, int type, int style, int direction) => 1; + + public static int AfterPlacement(int i, int j, int type, int style, int direction) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendTileRange(Main.myPlayer, i, j, 1, 1); + } + return 1; + } + + public override bool CanPlace(int i, int j) + { + List> around = new List> + { + new List() {i, j-1 }, + new List() {i-1, j }, + new List() {i+1, j }, + new List() {i, j+1 } + }; + //if (Main.tile[i, j]) || tile.type == Type + + //return true; //temporary for testing purposes + + if (Main.tile[i, j].wall != WallID.None) + { + return true; + } + + for (int k = 0; k < around.Count; ++k) + { + Tile tile = Main.tile[around[k][0], around[k][1]]; + if (tile.active() && (Main.tileSolid[tile.type] || CalamityMod.livingFireBlockList.Contains(tile.type))) + { + return true; + } + } + return false; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { frame = Main.tileFrame[TileID.LivingFire]; - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { r = 1f; g = 0f; b = 0f; - } + } - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.Brimstone, 0f, 0f, 1, default, 1f); - return false; - } - } + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.Brimstone, 0f, 0f, 1, default, 1f); + return false; + } + } } diff --git a/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs b/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs index f2bfffc8ef..039532b093 100644 --- a/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs +++ b/Tiles/LivingFire/LivingGodSlayerFireBlockTile.cs @@ -1,6 +1,8 @@ using CalamityMod.Dusts; using CalamityMod.Items.Placeables.LivingFire; using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -9,37 +11,87 @@ using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.LivingFire { - public class LivingGodSlayerFireBlockTile : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - soundType = SoundID.Dig; - drop = ModContent.ItemType(); - AddMapEntry(new Color(186, 85, 211)); - animationFrameHeight = 90; - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - } + public class LivingGodSlayerFireBlockTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + soundType = SoundID.Dig; + drop = ModContent.ItemType(); + AddMapEntry(new Color(186, 85, 211)); + animationFrameHeight = 90; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = false; + Main.tileFrameImportant[Type] = false; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 1; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.HookCheck = new PlacementHook(CanPlaceAlter, -1, 0, true ); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - public override void AnimateTile(ref int frame, ref int frameCounter) - { + TileObjectData.addTile(Type); + } + + public int CanPlaceAlter(int i, int j, int type, int style, int direction) => 1; + + public static int AfterPlacement(int i, int j, int type, int style, int direction) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendTileRange(Main.myPlayer, i, j, 1, 1); + } + return 1; + } + + public override bool CanPlace(int i, int j) + { + List> around = new List> + { + new List() {i, j-1 }, + new List() {i-1, j }, + new List() {i+1, j }, + new List() {i, j+1 } + }; + //if (Main.tile[i, j]) || tile.type == Type + + //return true; //temporary for testing purposes + + if (Main.tile[i, j].wall != WallID.None) + { + return true; + } + + for (int k = 0; k < around.Count; ++k) + { + Tile tile = Main.tile[around[k][0], around[k][1]]; + if (tile.active() && (Main.tileSolid[tile.type] || CalamityMod.livingFireBlockList.Contains(tile.type))) + { + return true; + } + } + return false; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { frame = Main.tileFrame[TileID.LivingFire]; - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { r = 1f; g = 0f; b = 1f; - } + } - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 1, default, 1f); - return false; - } - } + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 1, default, 1f); + return false; + } + } } diff --git a/Tiles/LivingFire/LivingHolyFireBlockTile.cs b/Tiles/LivingFire/LivingHolyFireBlockTile.cs index 0e593e3cff..6d334a5e41 100644 --- a/Tiles/LivingFire/LivingHolyFireBlockTile.cs +++ b/Tiles/LivingFire/LivingHolyFireBlockTile.cs @@ -1,6 +1,8 @@ using CalamityMod.Dusts; using CalamityMod.Items.Placeables.LivingFire; using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; using Terraria; using Terraria.DataStructures; using Terraria.Enums; @@ -9,38 +11,87 @@ using Terraria.ModLoader; using Terraria.ObjectData; namespace CalamityMod.Tiles.LivingFire { - public class LivingHolyFireBlockTile : ModTile - { - public override void SetDefaults() - { - Main.tileLighted[Type] = true; - soundType = SoundID.Dig; - drop = ModContent.ItemType(); - AddMapEntry(new Color(255, 215, 0)); - animationFrameHeight = 90; - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = false; - } + public class LivingHolyFireBlockTile : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + soundType = SoundID.Dig; + drop = ModContent.ItemType(); + AddMapEntry(new Color(255, 215, 0)); + animationFrameHeight = 90; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = false; + Main.tileFrameImportant[Type] = false; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 1; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.HookCheck = new PlacementHook(CanPlaceAlter, -1, 0, true ); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); - public override void AnimateTile(ref int frame, ref int frameCounter) - { + TileObjectData.addTile(Type); + } + + public int CanPlaceAlter(int i, int j, int type, int style, int direction) => 1; + + public static int AfterPlacement(int i, int j, int type, int style, int direction) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendTileRange(Main.myPlayer, i, j, 1, 1); + } + return 1; + } + + public override bool CanPlace(int i, int j) + { + List> around = new List> + { + new List() {i, j-1 }, + new List() {i-1, j }, + new List() {i+1, j }, + new List() {i, j+1 } + }; + //if (Main.tile[i, j]) || tile.type == Type + + //return true; //temporary for testing purposes + + if (Main.tile[i, j].wall != WallID.None) + { + return true; + } + + for (int k = 0; k < around.Count; ++k) + { + Tile tile = Main.tile[around[k][0], around[k][1]]; + if (tile.active() && (Main.tileSolid[tile.type] || CalamityMod.livingFireBlockList.Contains(tile.type))) + { + return true; + } + } + return false; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { frame = Main.tileFrame[TileID.LivingFire]; - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { r = 1f; g = 1f; b = 0f; - } + } - public override bool CreateDust(int i, int j, ref int type) - { - Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.ProfanedFire, 0f, 0f, 1, default, 1f); - return false; - } - } + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.ProfanedFire, 0f, 0f, 1, default, 1f); + return false; + } + } } diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index 283a487eb5..eb0efe86ad 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Ores { public class AerialiteOre : ModTile @@ -20,7 +22,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(0, 255, 255), name); mineResist = 2f; minPick = 65; - soundType = 21; + soundType = SoundID.Tink; Main.tileSpelunker[Type] = true; } diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index c08d18c8e7..0d6ea46047 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Ores name.SetDefault("Astral Ore"); AddMapEntry(new Color(255, 153, 255), name); mineResist = 5f; - soundType = 21; + soundType = SoundID.Tink; TileID.Sets.Ore[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs index f740c52870..cdde9877c3 100644 --- a/Tiles/Ores/AuricOre.cs +++ b/Tiles/Ores/AuricOre.cs @@ -3,6 +3,8 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Ores { public class AuricOre : ModTile @@ -25,7 +27,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(255, 200, 0), name); mineResist = 10f; minPick = 275; - soundType = 21; + soundType = SoundID.Tink; } public override bool CanExplode(int i, int j) diff --git a/Tiles/Ores/ChaoticOre.cs b/Tiles/Ores/ChaoticOre.cs index b98a848824..605c9cdfcd 100644 --- a/Tiles/Ores/ChaoticOre.cs +++ b/Tiles/Ores/ChaoticOre.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(255, 0, 0), name); mineResist = 4f; minPick = 210; - soundType = 21; + soundType = SoundID.Tink; } public override void NearbyEffects(int i, int j, bool closer) diff --git a/Tiles/Ores/CharredOre.cs b/Tiles/Ores/CharredOre.cs index 9f642b8b1b..413aef9b9f 100644 --- a/Tiles/Ores/CharredOre.cs +++ b/Tiles/Ores/CharredOre.cs @@ -3,6 +3,8 @@ using CalamityMod.Tiles.Crags; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Ores { public class CharredOre : ModTile @@ -26,7 +28,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(17, 16, 26), name); mineResist = 6f; minPick = 180; - soundType = 21; + soundType = SoundID.Tink; dustType = 235; Main.tileSpelunker[Type] = true; } diff --git a/Tiles/Ores/CryonicOre.cs b/Tiles/Ores/CryonicOre.cs index 8ffa13280f..d16ea586ab 100644 --- a/Tiles/Ores/CryonicOre.cs +++ b/Tiles/Ores/CryonicOre.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(0, 0, 150), name); mineResist = 3f; minPick = 180; - soundType = 21; + soundType = SoundID.Tink; Main.tileSpelunker[Type] = true; } diff --git a/Tiles/Ores/ExodiumOre.cs b/Tiles/Ores/ExodiumOre.cs index 9c08ce117c..d77178885a 100644 --- a/Tiles/Ores/ExodiumOre.cs +++ b/Tiles/Ores/ExodiumOre.cs @@ -1,8 +1,10 @@ - + using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Ores { public class ExodiumOre : ModTile @@ -19,7 +21,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(51, 48, 68), name); mineResist = 5f; minPick = 225; - soundType = 21; + soundType = SoundID.Tink; Main.tileValue[Type] = 760; Main.tileSpelunker[Type] = true; drop = ModContent.ItemType(); diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index 37974a382c..ac1c95fe97 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles.Ores { public class PerennialOre : ModTile @@ -22,7 +24,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(200, 250, 100), name); mineResist = 3f; minPick = 200; - soundType = 21; + soundType = SoundID.Tink; Main.tileSpelunker[Type] = true; } diff --git a/Tiles/Ores/UelibloomOre.cs b/Tiles/Ores/UelibloomOre.cs index 0b42d74c35..070d71d91f 100644 --- a/Tiles/Ores/UelibloomOre.cs +++ b/Tiles/Ores/UelibloomOre.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.Ores AddMapEntry(new Color(0, 255, 0), name); mineResist = 5f; minPick = 225; - soundType = 21; + soundType = SoundID.Tink; Main.tileSpelunker[Type] = true; } diff --git a/Tiles/PerennialBrick.cs b/Tiles/PerennialBrick.cs index c9e10b5008..297566b394 100644 --- a/Tiles/PerennialBrick.cs +++ b/Tiles/PerennialBrick.cs @@ -2,6 +2,8 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class PerennialBrick : ModTile @@ -16,7 +18,7 @@ namespace CalamityMod.Tiles CalamityUtils.MergeDecorativeTiles(Type); drop = ModContent.ItemType(); - soundType = 21; + soundType = SoundID.Tink; minPick = 150; AddMapEntry(new Color(17, 133, 46)); animationFrameHeight = 90; diff --git a/Tiles/RoxTile.cs b/Tiles/RoxTile.cs index 56e45e585d..79f0272927 100644 --- a/Tiles/RoxTile.cs +++ b/Tiles/RoxTile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; diff --git a/Tiles/SunkenSea/BrainCoral.cs b/Tiles/SunkenSea/BrainCoral.cs index 6fdd80e54f..cb986aeae3 100644 --- a/Tiles/SunkenSea/BrainCoral.cs +++ b/Tiles/SunkenSea/BrainCoral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/SunkenSea/FanCoral.cs b/Tiles/SunkenSea/FanCoral.cs index b983df6440..108cf62bf7 100644 --- a/Tiles/SunkenSea/FanCoral.cs +++ b/Tiles/SunkenSea/FanCoral.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Enums; using Terraria.ModLoader; diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 70fc9a618f..657024ec36 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.SunkenSea AddMapEntry(new Color(0, 50, 50), name); mineResist = 2f; minPick = 55; - soundType = 21; + soundType = SoundID.Tink; } public override bool CanKillTile(int i, int j, ref bool blockDamaged) @@ -43,63 +43,6 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } - public override void RandomUpdate(int i, int j) - { - if (Main.rand.NextBool(100)) - { - int random = WorldGen.genRand.Next(4); - if (random == 0) - { - i++; - } - if (random == 1) - { - i--; - } - if (random == 2) - { - j++; - } - if (random == 3) - { - j--; - } - if (Main.tile[i, j] != null) - { - if (!Main.tile[i, j].active()) - { - if (!Main.tile[i, j].lava() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick()) - { - Main.tile[i, j].type = (ushort)ModContent.TileType(); - Main.tile[i, j].active(true); - if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) - { - Main.tile[i, j].frameY = (short)(0 * 18); - } - else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) - { - Main.tile[i, j].frameY = (short)(1 * 18); - } - else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) - { - Main.tile[i, j].frameY = (short)(2 * 18); - } - else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) - { - Main.tile[i, j].frameY = (short)(3 * 18); - } - Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); - WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); - } - } - } - } - } - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType()); diff --git a/Tiles/SunkenSea/SeaAnemone.cs b/Tiles/SunkenSea/SeaAnemone.cs index ad390269f4..79170af7aa 100644 --- a/Tiles/SunkenSea/SeaAnemone.cs +++ b/Tiles/SunkenSea/SeaAnemone.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 3b0eb761fb..03acfe7ddd 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -1,4 +1,3 @@ - using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -25,7 +24,7 @@ namespace CalamityMod.Tiles.SunkenSea AddMapEntry(new Color(0, 150, 200), name); mineResist = 3f; minPick = 55; - soundType = 21; + soundType = SoundID.Tink; Main.tileSpelunker[Type] = true; } @@ -44,63 +43,6 @@ namespace CalamityMod.Tiles.SunkenSea num = fail ? 1 : 3; } - public override void RandomUpdate(int i, int j) - { - if (Main.rand.NextBool(25)) - { - int random = WorldGen.genRand.Next(4); - if (random == 0) - { - i++; - } - if (random == 1) - { - i--; - } - if (random == 2) - { - j++; - } - if (random == 3) - { - j--; - } - if (Main.tile[i, j] != null) - { - if (!Main.tile[i, j].active()) - { - if (!Main.tile[i, j].lava() && Main.tile[i, j].slope() == 0 && !Main.tile[i, j].halfBrick()) - { - Main.tile[i, j].type = (ushort)ModContent.TileType(); - Main.tile[i, j].active(true); - if (Main.tile[i, j + 1].active() && Main.tileSolid[Main.tile[i, j + 1].type] && Main.tile[i, j + 1].slope() == 0 && !Main.tile[i, j + 1].halfBrick()) - { - Main.tile[i, j].frameY = (short)(0 * 18); - } - else if (Main.tile[i, j - 1].active() && Main.tileSolid[Main.tile[i, j - 1].type] && Main.tile[i, j - 1].slope() == 0 && !Main.tile[i, j - 1].halfBrick()) - { - Main.tile[i, j].frameY = (short)(1 * 18); - } - else if (Main.tile[i + 1, j].active() && Main.tileSolid[Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == 0 && !Main.tile[i + 1, j].halfBrick()) - { - Main.tile[i, j].frameY = (short)(2 * 18); - } - else if (Main.tile[i - 1, j].active() && Main.tileSolid[Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == 0 && !Main.tile[i - 1, j].halfBrick()) - { - Main.tile[i, j].frameY = (short)(3 * 18); - } - Main.tile[i, j].frameX = (short)(WorldGen.genRand.Next(18) * 18); - WorldGen.SquareTileFrame(i, j, true); - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, j, 1, TileChangeType.None); - } - } - } - } - } - } - public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index f6bd9bf85c..789244a49e 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Tiles.SunkenSea name.SetDefault("Sea Prism Crystal"); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(0, 150, 200), name); - soundType = 2; + soundType = SoundID.Item; soundStyle = 27; dustType = 67; drop = ModContent.ItemType(); diff --git a/Tiles/SunkenSea/SmallBrainCoral.cs b/Tiles/SunkenSea/SmallBrainCoral.cs index aab74c8501..000f914a56 100644 --- a/Tiles/SunkenSea/SmallBrainCoral.cs +++ b/Tiles/SunkenSea/SmallBrainCoral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Tiles/SunkenSea/SmallTubeCoral.cs b/Tiles/SunkenSea/SmallTubeCoral.cs index 38054a0c3a..b055d0dcaa 100644 --- a/Tiles/SunkenSea/SmallTubeCoral.cs +++ b/Tiles/SunkenSea/SmallTubeCoral.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/SunkenSea/SunkenCrateTile.cs b/Tiles/SunkenSea/SunkenCrateTile.cs index 598ad12280..35b5edabd5 100644 --- a/Tiles/SunkenSea/SunkenCrateTile.cs +++ b/Tiles/SunkenSea/SunkenCrateTile.cs @@ -1,4 +1,3 @@ -using CalamityMod.Dusts; using CalamityMod.Items.Fishing.SunkenSeaCatches; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +6,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.SunkenSea { - public class SunkenCrateTile : ModTile + public class SunkenCrateTile : ModTile { public override void SetDefaults() { diff --git a/Tiles/SunkenSea/SunkenSeaStalactite.cs b/Tiles/SunkenSea/SunkenSeaStalactite.cs index a024434b34..1df118cef9 100644 --- a/Tiles/SunkenSea/SunkenSeaStalactite.cs +++ b/Tiles/SunkenSea/SunkenSeaStalactite.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea diff --git a/Tiles/SunkenSea/TableCoral.cs b/Tiles/SunkenSea/TableCoral.cs index c48902dd77..d90b3f0d9f 100644 --- a/Tiles/SunkenSea/TableCoral.cs +++ b/Tiles/SunkenSea/TableCoral.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.Enums; diff --git a/Tiles/SunkenSea/TubeCoral.cs b/Tiles/SunkenSea/TubeCoral.cs index ff2b12befa..7a48e7e4bc 100644 --- a/Tiles/SunkenSea/TubeCoral.cs +++ b/Tiles/SunkenSea/TubeCoral.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ObjectData; diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index 7a672a1688..f0997a6249 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -1,9 +1,11 @@ - + using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; +using Terraria.ID; + namespace CalamityMod.Tiles { public class UelibloomBrick : ModTile @@ -20,7 +22,7 @@ namespace CalamityMod.Tiles CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeDecorativeTiles(Type); - soundType = 21; + soundType = SoundID.Tink; minPick = 200; drop = ModContent.ItemType(); AddMapEntry(new Color(174, 108, 46)); diff --git a/UI/AcidRainUI.cs b/UI/AcidRainUI.cs index 300b6563a9..474e066518 100644 --- a/UI/AcidRainUI.cs +++ b/UI/AcidRainUI.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; diff --git a/UI/AstralArcanumUI.cs b/UI/AstralArcanumUI.cs index f55defae90..508605e955 100644 --- a/UI/AstralArcanumUI.cs +++ b/UI/AstralArcanumUI.cs @@ -1,4 +1,4 @@ - + using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -134,7 +134,7 @@ namespace CalamityMod.UI { LastHovered = selectedCircle; if (LastHovered != -1) - Main.PlaySound(12, -1, -1, 1, 1f, 0f); + Main.PlaySound(SoundID.MenuTick, -1, -1, 1, 1f, 0f); } string text = "Select"; @@ -158,11 +158,11 @@ namespace CalamityMod.UI if (Main.netMode == NetmodeID.SinglePlayer) { p.TeleportationPotion(); - Main.PlaySound(2, (int)p.position.X, (int)p.position.Y, 6, 1f, 0f); + Main.PlaySound(SoundID.Item, (int)p.position.X, (int)p.position.Y, 6, 1f, 0f); } else if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(73, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TeleportationPotion, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } else diff --git a/UI/BossHealthBarManager.cs b/UI/BossHealthBarManager.cs index a92be8d623..a82d9af324 100644 --- a/UI/BossHealthBarManager.cs +++ b/UI/BossHealthBarManager.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumDeus; @@ -10,7 +10,6 @@ using CalamityMod.NPCs.GreatSandShark; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Perforator; using CalamityMod.NPCs.PlaguebringerGoliath; -using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.SlimeGod; @@ -31,7 +30,7 @@ using Terraria.ModLoader; namespace CalamityMod.UI { - /* + /* Heyo! Here's some things you might need to know about this class and where to change things: In the "Load" method is where the "OneToMany" dictionary is updated. @@ -54,7 +53,7 @@ namespace CalamityMod.UI That should be it -- ask if you have any questions! */ - internal static class BossHealthBarManager + internal static class BossHealthBarManager { private static readonly int MAX_BARS = 4; @@ -134,10 +133,6 @@ namespace CalamityMod.UI OneToMany[NPCID.MoonLordHand] = MoonLord; OneToMany[NPCID.MoonLordCore] = MoonLord; - int[] StarWorm = new int[] { ModContent.NPCType(), ModContent.NPCType() }; - OneToMany[ModContent.NPCType()] = StarWorm; - OneToMany[ModContent.NPCType()] = StarWorm; - int[] Void = new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }; OneToMany[ModContent.NPCType()] = Void; OneToMany[ModContent.NPCType()] = Void; @@ -312,10 +307,6 @@ namespace CalamityMod.UI { AttemptAddBar(i, NPCID.PirateShip); } - else if (Main.npc[i].type == ModContent.NPCType()) - { - AttemptAddBar(i, ModContent.NPCType()); - } else if (Main.npc[i].type == ModContent.NPCType()) { AttemptAddBar(i, ModContent.NPCType()); @@ -441,8 +432,7 @@ namespace CalamityMod.UI Skelet, SkeletPrime, MartSaucer, - PirShip, - Astrum + PirShip } enum SpecialType2 : byte @@ -491,10 +481,6 @@ namespace CalamityMod.UI { _special2 = SpecialType2.Ceaseless; } - else if (type == ModContent.NPCType()) - { - _special = SpecialType.Astrum; - } else { switch (type) @@ -675,10 +661,6 @@ namespace CalamityMod.UI int count6 = NPC.CountNPCS(NPCID.PirateShipCannon); _specialData[5] = count6; break; - case SpecialType.Astrum: - int count7 = NPC.CountNPCS(ModContent.NPCType()); - _specialData[6] = count7; - break; } switch (_special2) @@ -804,12 +786,6 @@ namespace CalamityMod.UI float countX6 = Math.Max(x, x + mainBarWidth - countSize6.X); DrawBorderStringEightWay(sb, Main.fontItemStack, count6, new Vector2(countX6, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale); return; - case SpecialType.Astrum: - string count7 = "(Small Worms left: " + _specialData[6] + ")"; - Vector2 countSize7 = Main.fontItemStack.MeasureString(count7) * textScale; - float countX7 = Math.Max(x, x + mainBarWidth - countSize7.X); - DrawBorderStringEightWay(sb, Main.fontItemStack, count7, new Vector2(countX7, y + MainBarYOffset + 17), Color.White, Color.Black * 0.24f, textScale); - return; } switch (_special2) @@ -923,13 +899,6 @@ namespace CalamityMod.UI DrawBorderStringEightWay(sb, Main.fontItemStack, count6, new Vector2(countX6, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale); _openAnimCounter--; return; - case SpecialType.Astrum: - string count7 = "(Small Worms left: " + _specialData[6] + ")"; - Vector2 countSize7 = Main.fontItemStack.MeasureString(count7) * textScale; - float countX7 = Math.Max(x, x + mainBarWidth - countSize7.X); - DrawBorderStringEightWay(sb, Main.fontItemStack, count7, new Vector2(countX7, y + MainBarYOffset + 17), Color.White * flickerValue, Color.Black * 0.24f * flickerValue, textScale); - _openAnimCounter--; - return; } switch (_special2) diff --git a/UI/RipperUI.cs b/UI/RipperUI.cs index d8ead9eb62..5e260a66c7 100644 --- a/UI/RipperUI.cs +++ b/UI/RipperUI.cs @@ -1,15 +1,14 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; using CalamityMod.World; using Microsoft.Xna.Framework.Input; -using System.Collections.Generic; namespace CalamityMod.UI { - public class RipperUI + public class RipperUI { public const float DefaultRagePosX = 500f; public const float DefaultRagePosY = 30f; @@ -33,10 +32,10 @@ namespace CalamityMod.UI public static void Reset() { - bool configExists = CalamityMod.CalamityConfig != null; + bool configExists = CalamityConfig.Instance != null; - rageDrawPos = configExists ? new Vector2(CalamityMod.CalamityConfig.RageMeterPosX, CalamityMod.CalamityConfig.RageMeterPosY) : Vector2.Zero; - adrenDrawPos = configExists ? new Vector2(CalamityMod.CalamityConfig.AdrenalineMeterPosX, CalamityMod.CalamityConfig.AdrenalineMeterPosY) : Vector2.Zero; + rageDrawPos = configExists ? new Vector2(CalamityConfig.Instance.RageMeterPosX, CalamityConfig.Instance.RageMeterPosY) : Vector2.Zero; + adrenDrawPos = configExists ? new Vector2(CalamityConfig.Instance.AdrenalineMeterPosX, CalamityConfig.Instance.AdrenalineMeterPosY) : Vector2.Zero; rageDragOffset = null; adrenDragOffset = null; rageAnimFrame = -1; @@ -48,7 +47,7 @@ namespace CalamityMod.UI public static void Draw(SpriteBatch spriteBatch, Player player) { // If Revengeance isn't on, or Rage and Adrenaline are turned off, don't draw anything. - if (!CalamityWorld.revenge || !CalamityMod.CalamityConfig.AdrenalineAndRage) + if (!CalamityWorld.revenge || !CalamityConfig.Instance.Rippers) return; // If for some reason either of the bars has been thrown into the corner (likely to 0,0 by default), put them at their default positions @@ -188,7 +187,7 @@ namespace CalamityMod.UI Main.instance.MouseText($"Rage: {(int)modPlayer.rage} / {(int)modPlayer.rageMax}"); // The bar is draggable if enabled in config. - if (!CalamityMod.CalamityConfig.MeterPosLock && mouseInput.LeftButton == ButtonState.Pressed) + if (!CalamityConfig.Instance.MeterPosLock && mouseInput.LeftButton == ButtonState.Pressed) { // On the first frame new mouse input comes in, set the offset. Otherwise do nothing. if (rageDragOffset is null) @@ -202,7 +201,7 @@ namespace CalamityMod.UI Main.instance.MouseText($"Adrenaline: {(int)modPlayer.adrenaline} / {(int)modPlayer.adrenalineMax}"); // The bar is draggable if enabled in config. - if (!CalamityMod.CalamityConfig.MeterPosLock && mouseInput.LeftButton == ButtonState.Pressed) + if (!CalamityConfig.Instance.MeterPosLock && mouseInput.LeftButton == ButtonState.Pressed) { // On the first frame new mouse input comes in, set the offset. Otherwise do nothing. if (adrenDragOffset is null) @@ -226,33 +225,33 @@ namespace CalamityMod.UI if (rageDragOffset.HasValue) { rageDragOffset = null; - if (CalamityMod.CalamityConfig.RageMeterPosX != rageDrawPos.X) + if (CalamityConfig.Instance.RageMeterPosX != rageDrawPos.X) { - CalamityMod.CalamityConfig.RageMeterPosX = rageDrawPos.X; + CalamityConfig.Instance.RageMeterPosX = rageDrawPos.X; updateCfg = true; } - if (CalamityMod.CalamityConfig.RageMeterPosY != rageDrawPos.Y) + if (CalamityConfig.Instance.RageMeterPosY != rageDrawPos.Y) { - CalamityMod.CalamityConfig.RageMeterPosY = rageDrawPos.Y; + CalamityConfig.Instance.RageMeterPosY = rageDrawPos.Y; updateCfg = true; } } if (adrenDragOffset.HasValue) { adrenDragOffset = null; - if (CalamityMod.CalamityConfig.AdrenalineMeterPosX != adrenDrawPos.X) + if (CalamityConfig.Instance.AdrenalineMeterPosX != adrenDrawPos.X) { - CalamityMod.CalamityConfig.AdrenalineMeterPosX = adrenDrawPos.X; + CalamityConfig.Instance.AdrenalineMeterPosX = adrenDrawPos.X; updateCfg = true; } - if (CalamityMod.CalamityConfig.AdrenalineMeterPosY != adrenDrawPos.Y) + if (CalamityConfig.Instance.AdrenalineMeterPosY != adrenDrawPos.Y) { - CalamityMod.CalamityConfig.AdrenalineMeterPosY = adrenDrawPos.Y; + CalamityConfig.Instance.AdrenalineMeterPosY = adrenDrawPos.Y; updateCfg = true; } } if (updateCfg) - CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + CalamityMod.SaveConfig(CalamityConfig.Instance); } } @@ -270,7 +269,7 @@ namespace CalamityMod.UI private static Vector2 GetShakeOffset() { - float shake = CalamityMod.CalamityConfig.MeterShake; + float shake = CalamityConfig.Instance.MeterShake; float shakeX = Main.rand.NextFloat(-shake, shake); float shakeY = Main.rand.NextFloat(-shake, shake); return new Vector2(shakeX, shakeY); diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 0dc77fd126..84ae2c116c 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -1,16 +1,16 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using System; using Terraria; using Terraria.ModLoader; -using System; namespace CalamityMod.UI { public class StealthUI { - public static Vector2 DrawPosition = new Vector2(CalamityMod.CalamityConfig.StealthMeterPosX, CalamityMod.CalamityConfig.StealthMeterPosY); + public static Vector2 DrawPosition = new Vector2(CalamityConfig.Instance.StealthMeterPosX, CalamityConfig.Instance.StealthMeterPosY); public static Vector2 Offset = DrawPosition; public static void Draw(SpriteBatch spriteBatch, Player player) { @@ -20,17 +20,17 @@ namespace CalamityMod.UI DrawPosition.Y = Main.screenHeight / 2 + Main.LocalPlayer.height / 2f + 24f; } CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.stealthUIAlpha <= 0f || !CalamityMod.CalamityConfig.StealthBar || modPlayer.rogueStealthMax <= 0) + if (modPlayer.stealthUIAlpha <= 0f || !CalamityConfig.Instance.StealthBar || modPlayer.rogueStealthMax <= 0) { - if (CalamityMod.CalamityConfig.StealthMeterPosX != DrawPosition.X) + if (CalamityConfig.Instance.StealthMeterPosX != DrawPosition.X) { - CalamityMod.CalamityConfig.StealthMeterPosX = DrawPosition.X; - CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + CalamityConfig.Instance.StealthMeterPosX = DrawPosition.X; + CalamityMod.SaveConfig(CalamityConfig.Instance); } - if (CalamityMod.CalamityConfig.StealthMeterPosY != DrawPosition.Y) + if (CalamityConfig.Instance.StealthMeterPosY != DrawPosition.Y) { - CalamityMod.CalamityConfig.StealthMeterPosY = DrawPosition.Y; - CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + CalamityConfig.Instance.StealthMeterPosY = DrawPosition.Y; + CalamityMod.SaveConfig(CalamityConfig.Instance); } return; } @@ -57,11 +57,11 @@ namespace CalamityMod.UI int stealthInt = (int)Math.Round(modPlayer.rogueStealth * 100f); int maxStealthInt = (int)Math.Round(modPlayer.rogueStealthMax * 100f); //only way I got this to show up consistently, otherwise it fucked up and showed up anywhere onscreen lol. - Main.instance.MouseText("Stealth: " + stealthInt + "/" + maxStealthInt + "", 0, 0, -1, -1, -1, -1); + Main.instance.MouseText("Stealth: " + stealthInt + "/" + maxStealthInt + "", 0, 0, -1, -1, -1, -1); modPlayer.stealthUIAlpha = MathHelper.Lerp(modPlayer.stealthUIAlpha, 0.25f, 0.035f); } } - if (!CalamityMod.CalamityConfig.MeterPosLock) + if (!CalamityConfig.Instance.MeterPosLock) { if (new Rectangle((int)(DrawPosition.X + Main.screenPosition.X - 26), (int)(DrawPosition.Y + Main.screenPosition.Y - 9), 52, 18).Intersects( new Rectangle((int)Main.MouseWorld.X, (int)Main.MouseWorld.Y, 8, 8))) @@ -79,15 +79,15 @@ namespace CalamityMod.UI } } - if (CalamityMod.CalamityConfig.StealthMeterPosX != DrawPosition.X) + if (CalamityConfig.Instance.StealthMeterPosX != DrawPosition.X) { - CalamityMod.CalamityConfig.StealthMeterPosX = DrawPosition.X; - CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + CalamityConfig.Instance.StealthMeterPosX = DrawPosition.X; + CalamityMod.SaveConfig(CalamityConfig.Instance); } - if (CalamityMod.CalamityConfig.StealthMeterPosY != DrawPosition.Y) + if (CalamityConfig.Instance.StealthMeterPosY != DrawPosition.Y) { - CalamityMod.CalamityConfig.StealthMeterPosY = DrawPosition.Y; - CalamityMod.SaveConfig(CalamityMod.CalamityConfig); + CalamityConfig.Instance.StealthMeterPosY = DrawPosition.Y; + CalamityMod.SaveConfig(CalamityConfig.Instance); } } } diff --git a/Utilities/BezierCurve.cs b/Utilities/BezierCurve.cs index 3a78bf0d9c..0076f82598 100644 --- a/Utilities/BezierCurve.cs +++ b/Utilities/BezierCurve.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.Collections.Generic; namespace CalamityMod diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 65b1349c2e..5ce5fa184c 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items; +using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Critters; @@ -220,7 +220,8 @@ namespace CalamityMod ItemID.SonarPotion, ItemID.GenderChangePotion, ItemID.LovePotion, - ItemID.StinkPotion + ItemID.StinkPotion, + ItemID.RecallPotion }; ModRecipe r; diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 745f611edf..c45913f70b 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1,8 +1,11 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.NPCs; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Providence; using CalamityMod.Projectiles; +using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; @@ -142,13 +145,36 @@ namespace CalamityMod npc.lifeMax = revengeance.Value; } } - /// - /// Detects nearby hostile NPCs from a given point - /// - /// The position where we wish to check for nearby NPCs - /// Maximum amount of pixels to check around the origin - /// Whether bosses should be prioritized in targetting or not - public static NPC ClosestNPCAt(this Vector2 origin, float maxDistanceToCheck, bool bossPriority = false) + /// + /// Allows you to set the DR value of a NPC to different values based on the mode. + /// + /// The NPC whose DR value you are trying to set. + /// The value DR will be set to in normal mode. + /// The value DR will be set to in Revegeneance mode. + /// The value DR will be set to during the Boss Rush. + public static void DR_NERD(this NPC npc, float normal, float? revengeance = null, float? death = null, float? bossRush = null, bool? customDR = null) + { + npc.Calamity().DR = normal; + + if (bossRush.HasValue && CalamityWorld.bossRushActive) + { + npc.Calamity().DR = bossRush.Value; + } + else if (revengeance.HasValue && CalamityWorld.revenge) + { + npc.Calamity().DR = CalamityWorld.death ? death.Value : revengeance.Value; + } + + if (customDR.HasValue) + npc.Calamity().customDR = true; + } + /// + /// Detects nearby hostile NPCs from a given point + /// + /// The position where we wish to check for nearby NPCs + /// Maximum amount of pixels to check around the origin + /// Whether bosses should be prioritized in targetting or not + public static NPC ClosestNPCAt(this Vector2 origin, float maxDistanceToCheck, bool bossPriority = false) { NPC closestTarget = null; float distance = maxDistanceToCheck; @@ -216,6 +242,52 @@ namespace CalamityMod damage = 0D; return true; } + + /// + /// Check if an NPC is organic + /// + /// The NPC attacked. + /// Whether or not the NPC is organic. + public static bool Organic(this NPC target) + { + if ((target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 && + target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 && + target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && + target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && + target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == ModContent.NPCType() || + target.type == ModContent.NPCType()) + { + return true; + } + return false; + } + + /// + /// Check if an NPC is inorganic + /// + /// The NPC attacked. + /// Whether or not the NPC is inorganic. + public static bool Inorganic(this NPC target) + { + if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && + target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && + target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && + target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && + target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && + target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && + target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && + target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && + target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && + target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && + target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && + target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && + target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57 && target.type != ModContent.NPCType() && + target.type != ModContent.NPCType() && target.type != ModContent.NPCType()) + { + return true; + } + return false; + } #endregion #region Item Utilities @@ -382,7 +454,7 @@ namespace CalamityMod // Hitbox size adjustments Rectangle hitbox = new Rectangle((int)hitbox_X, (int)hitbox_Y, 32, 32); - if (item.damage >= 0 && item.type > 0 && !item.noMelee && player.itemAnimation > 0) + if (item.damage >= 0 && item.type > ItemID.None && !item.noMelee && player.itemAnimation > 0) { if (!Main.dedServ) { @@ -400,7 +472,7 @@ namespace CalamityMod } // Broadsword use style - if (item.useStyle == 1) + if (item.useStyle == ItemUseStyleID.SwingThrow) { // Third hitbox size adjustments if (player.itemAnimation < player.itemAnimationMax * 0.333) @@ -653,6 +725,414 @@ namespace CalamityMod } return newDamage; } + + public static void MinionAntiClump(this Projectile projectile, float pushForce = 0.05f) + { + for (int k = 0; k < Main.maxProjectiles; k++) + { + Projectile otherProj = Main.projectile[k]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || otherProj.owner != projectile.owner || !otherProj.minion || k == projectile.whoAmI) + continue; + + // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. + bool sameProjType = otherProj.type == projectile.type; + float taxicabDist = Math.Abs(projectile.position.X - otherProj.position.X) + Math.Abs(projectile.position.Y - otherProj.position.Y); + if (sameProjType && taxicabDist < projectile.width) + { + if (projectile.position.X < otherProj.position.X) + projectile.velocity.X -= pushForce; + else + projectile.velocity.X += pushForce; + + if (projectile.position.Y < otherProj.position.Y) + projectile.velocity.Y -= pushForce; + else + projectile.velocity.Y += pushForce; + } + } + } + + public static void ChargingMinionAI(this Projectile projectile, float range, float maxPlayerDist, float extraMaxPlayerDist, float safeDist, int initialUpdates, float chargeDelayTime, float goToSpeed, float goBackSpeed, float chargeCounterMax, float chargeSpeed, bool tileVision, bool ignoreTilesWhenCharging) + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + + //Anti sticky movement to prevent stacking + projectile.MinionAntiClump(); + + //Breather time between charges as like a reset + bool chargeDelay = false; + if (projectile.ai[0] == 2f) + { + projectile.ai[1] += 1f; + projectile.extraUpdates = initialUpdates + (projectile.type == ModContent.ProjectileType() ? 2 : 1); + if (projectile.ai[1] > chargeDelayTime) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.extraUpdates = initialUpdates; + projectile.numUpdates = 0; + projectile.netUpdate = true; + } + else + { + chargeDelay = true; + } + } + if (chargeDelay) + { + return; + } + + //Find a target + float maxDist = range; + Vector2 targetVec = projectile.position; + bool foundTarget = false; + Vector2 half = new Vector2(0.5f); + bool isButterfly = projectile.type == ModContent.ProjectileType(); + //Prioritize the targeted enemy if possible + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + bool fishronCheck = npc.type == NPCID.DukeFishron && npc.active && isButterfly; + if (npc.CanBeChasedBy(projectile, false) || fishronCheck) + { + //Check the size of the target to make it easier to hit fat targets like Levi + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + //Some minions will ignore tiles when choosing a target like Ice Claspers, others will not + bool canHit = true; + if (!tileVision) + canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!foundTarget && targetDist < maxDist && canHit) + { + maxDist = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + //If no npc is specifically targetted, check through the entire array + else + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + bool fishronCheck = npc.type == NPCID.DukeFishron && npc.active && isButterfly; + if (npc.CanBeChasedBy(projectile, false) || fishronCheck) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + bool canHit = true; + if (!tileVision) + canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!foundTarget && targetDist < maxDist && canHit) + { + maxDist = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + } + + //If the player is too far, return to the player. Range is increased while attacking something. + float distBeforeForcedReturn = maxPlayerDist; + if (foundTarget) + { + distBeforeForcedReturn = extraMaxPlayerDist; + } + if (Vector2.Distance(player.Center, projectile.Center) > distBeforeForcedReturn) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + + //Go to the target if you found one + if (foundTarget && projectile.ai[0] == 0f) + { + //Some minions don't ignore tiles while charging like brittle stars + projectile.tileCollide = !ignoreTilesWhenCharging; + Vector2 targetSpot = targetVec - projectile.Center; + float targetDist = targetSpot.Length(); + targetSpot.Normalize(); + //Tries to get the minion in the sweet spot of 200 pixels away but the minion also charges so idk what good it does + if (targetDist > 200f) + { + float speed = goToSpeed; //8 + targetSpot *= speed; + projectile.velocity = (projectile.velocity * 40f + targetSpot) / 41f; + } + else + { + float speed = -goBackSpeed; //-4 + targetSpot *= speed; + projectile.velocity = (projectile.velocity * 40f + targetSpot) / 41f; //41 + } + } + + //Movement for idle or returning to the player + else + { + //Ignore tiles so they don't get stuck everywhere like Optic Staff + projectile.tileCollide = false; + + bool returningToPlayer = false; + if (!returningToPlayer) + { + returningToPlayer = projectile.ai[0] == 1f; + } + + //Player distance calculations + Vector2 playerVec = player.Center - projectile.Center + new Vector2(0f, -60f); + float playerDist = playerVec.Length(); + + //If the minion is actively returning, move faster + float playerHomeSpeed = 6f; + if (returningToPlayer) + { + playerHomeSpeed = 15f; + } + //Move somewhat faster if the player is kinda far~ish + if (playerDist > 200f && playerHomeSpeed < 8f) + { + playerHomeSpeed = 8f; + } + //Return to normal if close enough to the player + if (playerDist < safeDist && returningToPlayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + //Teleport to the player if abnormally far + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + //If more than 70 pixels away, move toward the player + if (playerDist > 70f) + { + playerVec.Normalize(); + playerVec *= playerHomeSpeed; + projectile.velocity = (projectile.velocity * 40f + playerVec) / 41f; + } + //Minions never stay still + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + + //Increment attack counter randomly + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + //If high enough, prepare to attack + if (projectile.ai[1] > chargeCounterMax) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + + //Charge at an enemy if not on cooldown + if (projectile.ai[0] == 0f) + { + if (projectile.ai[1] == 0f && foundTarget && maxDist < 500f) + { + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + projectile.ai[0] = 2f; + Vector2 targetPos = targetVec - projectile.Center; + targetPos.Normalize(); + projectile.velocity = targetPos * chargeSpeed; //8 + projectile.netUpdate = true; + } + } + } + } + + public static void FloatingPetAI(this Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false) + { + Player player = Main.player[projectile.owner]; + + //anti sticking movement as a failsafe + float SAImovement = 0.05f; + for (int k = 0; k < Main.maxProjectiles; k++) + { + Projectile otherProj = Main.projectile[k]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || otherProj.owner != projectile.owner || !Main.projPet[otherProj.type] || k == projectile.whoAmI) + continue; + + // If the other projectile is indeed another pet owned by the same player and they're too close, nudge them away. + bool isPet = Main.projPet[otherProj.type]; + float taxicabDist = Math.Abs(projectile.position.X - otherProj.position.X) + Math.Abs(projectile.position.Y - otherProj.position.Y); + if (isPet && taxicabDist < projectile.width) + { + if (projectile.position.X < otherProj.position.X) + projectile.velocity.X -= SAImovement; + else + projectile.velocity.X += SAImovement; + + if (projectile.position.Y < otherProj.position.Y) + projectile.velocity.Y -= SAImovement; + else + projectile.velocity.Y += SAImovement; + } + } + + float passiveMvtFloat = 0.5f; + projectile.tileCollide = false; + float range = 100f; + Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); + float xDist = player.Center.X - projPos.X; + float yDist = player.Center.Y - projPos.Y; + yDist += Main.rand.NextFloat(-10, 20); + xDist += Main.rand.NextFloat(-10, 20); + //Light pets lead the player, normal pets trail the player + xDist += 60f * (lightPet ? (float)player.direction : -(float)player.direction); + yDist -= 60f; + Vector2 playerVector = new Vector2(xDist, yDist); + float playerDist = playerVector.Length(); + float returnSpeed = 18f; + + //If player is close enough, resume normal + if (playerDist < range && player.velocity.Y == 0f && + projectile.position.Y + projectile.height <= player.position.Y + player.height && + !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + if (projectile.velocity.Y < -6f) + { + projectile.velocity.Y = -6f; + } + } + + //Teleport to player if too far + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - projectile.width / 2; + projectile.position.Y = player.Center.Y - projectile.height / 2; + projectile.netUpdate = true; + } + + if (playerDist < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.99f; + } + passiveMvtFloat = 0.01f; + } + else + { + if (playerDist < 100f) + { + passiveMvtFloat = 0.1f; + } + if (playerDist > 300f) + { + passiveMvtFloat = 1f; + } + playerDist = returnSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + } + if (projectile.velocity.X < playerVector.X) + { + projectile.velocity.X += passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X += passiveMvtFloat; + } + } + if (projectile.velocity.X > playerVector.X) + { + projectile.velocity.X -= passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X -= passiveMvtFloat; + } + } + if (projectile.velocity.Y < playerVector.Y) + { + projectile.velocity.Y += passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y += passiveMvtFloat * 2f; + } + } + if (projectile.velocity.Y > playerVector.Y) + { + projectile.velocity.Y -= passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y -= passiveMvtFloat * 2f; + } + } + if (projectile.velocity.X >= 0.25f) + { + projectile.direction = faceRight ? 1 : -1; + } + else if (projectile.velocity.X < -0.25f) + { + projectile.direction = faceRight ? -1 : 1; + } + //Tilting and change directions + projectile.spriteDirection = projectile.direction; + projectile.rotation = projectile.velocity.X * tiltFloat; + } + + public static void HealingProjectile(this Projectile projectile, int healing, int playerToHeal, float homingVelocity, float N, bool autoHomes = true, int timeCheck = 120) + { + int target = playerToHeal; + Player player = Main.player[target]; + float homingSpeed = homingVelocity; + if (player.lifeMagnet) + homingSpeed *= 1.5f; + + Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); + float xDist = player.Center.X - projPos.X; + float yDist = player.Center.Y - projPos.Y; + Vector2 playerVector = new Vector2(xDist, yDist); + float playerDist = playerVector.Length(); + if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) + { + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) + { + int healAmt = healing; + player.HealEffect(healAmt, false); + player.statLife += healAmt; + if (player.statLife > player.statLifeMax2) + { + player.statLife = player.statLifeMax2; + } + NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0); + } + projectile.Kill(); + } + if (autoHomes) + { + playerDist = homingSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); + projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); + } + else if (player.lifeMagnet && projectile.timeLeft < timeCheck) + { + playerDist = homingVelocity / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); + projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); + } + } #endregion #region Tile Utilities @@ -1069,7 +1549,7 @@ namespace CalamityMod WorldGen.KillTile(i, j, false, false, false); if (!Main.tile[i, j].active() && Main.netMode != NetmodeID.SinglePlayer) { - NetMessage.SendData(17, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)i, (float)j, 0f, 0, 0, 0); } } } @@ -1129,7 +1609,7 @@ namespace CalamityMod } if (player.editedChestName) { - NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncPlayerChest, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } @@ -1143,7 +1623,7 @@ namespace CalamityMod } else { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.RequestChestOpen, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); Main.stackSplit = 600; } } @@ -1470,7 +1950,7 @@ namespace CalamityMod NetMessage.SendData(MessageID.SyncPlayerChest, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); player.editedChestName = false; } - if (Main.netMode == 1 && !isLocked) + if (Main.netMode == NetmodeID.MultiplayerClient && !isLocked) { // Right clicking the chest you currently have open closes it. This counts as interaction. if (left == player.chestX && top == player.chestY && player.chest >= 0) @@ -1496,7 +1976,7 @@ namespace CalamityMod // If you right click the locked chest and you can unlock it, it unlocks itself but does not open. This counts as interaction. if (Chest.Unlock(left, top)) { - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { NetMessage.SendData(MessageID.Unlock, -1, -1, null, player.whoAmI, 1f, (float)left, (float)top); } @@ -2419,6 +2899,19 @@ namespace CalamityMod float colorMePurple = (float)((Math.Sin(timeMult * Main.GlobalTime) + 1) * 0.5f); return Color.Lerp(firstColor, secondColor, colorMePurple); } + /// + /// Returns a color lerp that supports multiple colors. + /// + /// The 0-1 incremental value used when interpolating. + /// The various colors to interpolate across. + /// + public static Color MulticolorLerp(float increment, params Color[] colors) + { + int currentColorIndex = (int)(increment * colors.Length); + Color currentColor = colors[currentColorIndex]; + Color nextColor = colors[(currentColorIndex + 1) % colors.Length]; + return Color.Lerp(currentColor, nextColor, increment * colors.Length % 1f); + } #endregion #region Miscellaneous Utilities @@ -2611,6 +3104,47 @@ namespace CalamityMod } public static int SecondsToFrames(float seconds) => (int)(seconds * 60); - #endregion - } + + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 Main.cs function + public static float GetLerpValue(float from, float to, float t, bool clamped = false) + { + if (clamped) + { + if (from < to) + { + if (t < from) + { + return 0f; + } + if (t > to) + { + return 1f; + } + } + else + { + if (t < to) + { + return 1f; + } + if (t > from) + { + return 0f; + } + } + } + return (t - from) / (to - from); + } + + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 World.cs function + public static Rectangle ClampToWorld(Rectangle tileRectangle) + { + int num = Math.Max(0, Math.Min(tileRectangle.Left, Main.maxTilesX)); + int num2 = Math.Max(0, Math.Min(tileRectangle.Top, Main.maxTilesY)); + int num3 = Math.Max(0, Math.Min(tileRectangle.Right, Main.maxTilesX)); + int num4 = Math.Max(0, Math.Min(tileRectangle.Bottom, Main.maxTilesY)); + return new Rectangle(num, num2, num3 - num, num4 - num2); + } + #endregion + } } diff --git a/Utilities/Circle.cs b/Utilities/Circle.cs index be30166bc9..d918e9edda 100644 --- a/Utilities/Circle.cs +++ b/Utilities/Circle.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Utilities/Downed.cs b/Utilities/Downed.cs index bc3043b175..298afa28ae 100644 --- a/Utilities/Downed.cs +++ b/Utilities/Downed.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using System; namespace CalamityMod diff --git a/Utilities/Enums.cs b/Utilities/Enums.cs index 4401d332ab..ee589e1ee3 100644 --- a/Utilities/Enums.cs +++ b/Utilities/Enums.cs @@ -1,4 +1,4 @@ -namespace CalamityMod +namespace CalamityMod { public enum ConvertType { diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 1ccf5a7cc1..e7d21ef6ff 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; diff --git a/Walls/AstralDirtWall.cs b/Walls/AstralDirtWall.cs index cf6d5ee9b8..c43513f7d7 100644 --- a/Walls/AstralDirtWall.cs +++ b/Walls/AstralDirtWall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralDirtWallSafe.cs b/Walls/AstralDirtWallSafe.cs index 359c28624e..6d15ef8f86 100644 --- a/Walls/AstralDirtWallSafe.cs +++ b/Walls/AstralDirtWallSafe.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralFossilWall.cs b/Walls/AstralFossilWall.cs index e3cd022f03..2ba1694056 100644 --- a/Walls/AstralFossilWall.cs +++ b/Walls/AstralFossilWall.cs @@ -1,10 +1,9 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { - public class AstralFossilWall : ModWall + public class AstralFossilWall : ModWall { public override void SetDefaults() diff --git a/Walls/AstralGrassWall.cs b/Walls/AstralGrassWall.cs index c3c63c3fb0..b835a060d5 100644 --- a/Walls/AstralGrassWall.cs +++ b/Walls/AstralGrassWall.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralIceWall.cs b/Walls/AstralIceWall.cs index 0b10b48a97..ad86e235ad 100644 --- a/Walls/AstralIceWall.cs +++ b/Walls/AstralIceWall.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralIceWallSafe.cs b/Walls/AstralIceWallSafe.cs index 4f73846aca..6c60031a30 100644 --- a/Walls/AstralIceWallSafe.cs +++ b/Walls/AstralIceWallSafe.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralSandstoneWall.cs b/Walls/AstralSandstoneWall.cs index ae0e642820..579c5a2592 100644 --- a/Walls/AstralSandstoneWall.cs +++ b/Walls/AstralSandstoneWall.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralSandstoneWallSafe.cs b/Walls/AstralSandstoneWallSafe.cs index 339c3a2764..3aeb1022cf 100644 --- a/Walls/AstralSandstoneWallSafe.cs +++ b/Walls/AstralSandstoneWallSafe.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralSnowWall.cs b/Walls/AstralSnowWall.cs index 85f1a29158..59f42ead99 100644 --- a/Walls/AstralSnowWall.cs +++ b/Walls/AstralSnowWall.cs @@ -1,10 +1,9 @@ - + using Microsoft.Xna.Framework; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { - public class AstralSnowWall : ModWall + public class AstralSnowWall : ModWall { public override void SetDefaults() { diff --git a/Walls/AstralSnowWallSafe.cs b/Walls/AstralSnowWallSafe.cs index cb250532ce..6ef65e1f9a 100644 --- a/Walls/AstralSnowWallSafe.cs +++ b/Walls/AstralSnowWallSafe.cs @@ -1,10 +1,9 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { - public class AstralSnowWallSafe : ModWall + public class AstralSnowWallSafe : ModWall { public override void SetDefaults() diff --git a/Walls/AstralStoneWall.cs b/Walls/AstralStoneWall.cs index bb06206db2..c9f22fb2f4 100644 --- a/Walls/AstralStoneWall.cs +++ b/Walls/AstralStoneWall.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/AstralStoneWallSafe.cs b/Walls/AstralStoneWallSafe.cs index 37669c60c3..cfc4f105c6 100644 --- a/Walls/AstralStoneWallSafe.cs +++ b/Walls/AstralStoneWallSafe.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/HardenedAstralSandWall.cs b/Walls/HardenedAstralSandWall.cs index 2638ca92cd..ebcfced2bd 100644 --- a/Walls/HardenedAstralSandWall.cs +++ b/Walls/HardenedAstralSandWall.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/Walls/HardenedAstralSandWallSafe.cs b/Walls/HardenedAstralSandWallSafe.cs index 9a8046ce2e..a7edb7df12 100644 --- a/Walls/HardenedAstralSandWallSafe.cs +++ b/Walls/HardenedAstralSandWallSafe.cs @@ -1,4 +1,4 @@ -using Terraria; +using Terraria; using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; diff --git a/World/Abyss.cs b/World/Abyss.cs index e63c4a6171..742014926b 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1,4 +1,3 @@ -using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Abyss; @@ -13,7 +12,7 @@ using Terraria.ModLoader; namespace CalamityMod.World { - public class Abyss : ModWorld + public class Abyss : ModWorld { public static int BiomeWidth { @@ -72,6 +71,7 @@ namespace CalamityMod.World GenerateUpperSea(); CreateWater(); GenerateHardenedSandstone(); + RemoveStupidTilesAboveSea(); SettleWater(); // The island Y spawn position calculations are relative to water. Settling the water before doing these calculations is ideal. GenerateIslands(); GenerateVentsAndFossils(); @@ -326,13 +326,6 @@ namespace CalamityMod.World } } } - else if (WorldGen.genRand.NextBool(10)) - { - for (int i = 0; i < 20; i++) - { - TileLoader.RandomUpdate(trueX, y, Main.tile[trueX, y].type); - } - } } } } @@ -627,10 +620,10 @@ namespace CalamityMod.World int type = WorldGen.genRand.Next(6); type++; int height = heightFromType(type); - PlaceStalactite(trueX, y, height, (ushort)CalamityMod.instance.TileType($"SulphurousStalactite{type}")); + PlaceStalactite(trueX, y, height, (ushort)CalamityMod.Instance.TileType($"SulphurousStalactite{type}")); if (WorldGen.SolidTile(trueX, y + dy + 1)) { - PlaceStalacmite(trueX, y + dy, height, (ushort)CalamityMod.instance.TileType($"SulphurousStalacmite{type}")); + PlaceStalacmite(trueX, y + dy, height, (ushort)CalamityMod.Instance.TileType($"SulphurousStalacmite{type}")); } // Reset the slope/half brick variables for the tiles below/above the pairs, so that it doesn't look like there's an @@ -743,7 +736,7 @@ namespace CalamityMod.World SulphSeaTiles.Contains(CalamityUtils.ParanoidTileRetrieval(x, y + 1).type) && CalamityUtils.ParanoidTileRetrieval(x, y + 1).active()) { - chest = WorldGenerationMethods.AddChestWithLoot(x, y, (ushort)ModContent.TileType(), tileStyle: 1); + chest = WorldGenerationMethods.AddChestWithLoot(x, y, (ushort)ModContent.TileType()); } } } @@ -758,9 +751,30 @@ namespace CalamityMod.World } #endregion + #region Removal of stupid Tiles above the Sea + public static void RemoveStupidTilesAboveSea() + { + for (int x = 0; x < BiomeWidth; x++) + { + int trueX = CalamityWorld.abyssSide ? x : Main.maxTilesX - x; + for (int y = YStart - 100; y < YStart + 60; y++) + { + if (YStartWhitelist.Contains(CalamityUtils.ParanoidTileRetrieval(trueX, y).type)) + { + if (Main.tile[trueX, y] == null) + Main.tile[trueX, y] = new Tile(); + Main.tile[trueX, y].active(false); + } + } + } + } + #endregion + #region Misc Functions public static List YStartWhitelist = new List() { + TileID.Stone, + TileID.Dirt, TileID.Sand, TileID.Ebonsand, TileID.Crimsand, @@ -777,12 +791,26 @@ namespace CalamityMod.World TileID.Tungsten, TileID.Crimstone, TileID.Ebonstone, + TileID.HardenedSand, + TileID.CorruptHardenedSand, + TileID.CrimsonHardenedSand, + TileID.Coral, + TileID.BeachPiles, + TileID.Plants, + TileID.Plants2, + TileID.SmallPiles, + TileID.LargePiles, + TileID.LargePiles2, + TileID.Trees, + TileID.Vines, + TileID.CrimsonVines, + TileID.Containers, TileID.JungleGrass // Yes, this can happen on rare occasion }; public static void DetermineYStart() { int maxHeight = 0; - for (int i = 0; i < BiomeWidth; i++) + for (int i = 0; i < BiomeWidth - 18; i++) { int xCheck = CalamityWorld.abyssSide ? BiomeWidth - i : diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index b2adc93dff..a98ff26869 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1,4 +1,3 @@ -using CalamityMod; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Events; @@ -31,6 +30,7 @@ using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; +using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; @@ -49,12 +49,11 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.ModLoader.Config; using Terraria.World.Generation; namespace CalamityMod.World { - public class CalamityWorld : ModWorld + public class CalamityWorld : ModWorld { #region Vars public static int DoGSecondStageCountdown = 0; @@ -112,6 +111,8 @@ namespace CalamityMod.World public static bool forcedRainAlready = false; public static bool forcedDownpourWithTear = false; public static int forceRainTimer = 0; + public static int timeSinceAcidRainKill = 0; + public static int timeSinceAcidStarted = 0; public static float AcidRainCompletionRatio { get @@ -179,7 +180,7 @@ namespace CalamityMod.World #region Initialize public override void Initialize() { - if (CalamityMod.CalamityConfig.ExpertPillarEnemyKillCountReduction) + if (CalamityConfig.Instance.NerfExpertPillars) { NPC.LunarShieldPowerExpert = 100; } @@ -924,7 +925,7 @@ namespace CalamityMod.World WorldGen.UndergroundDesertLocation.Width, WorldGen.UndergroundDesertLocation.Height / 2); // Player variable, always finds the closest player relative to the center of the map - int closestPlayer = (int)Player.FindClosest(new Vector2((float)(Main.maxTilesX / 2), (float)Main.worldSurface / 2f) * 16f, 0, 0); + int closestPlayer = Player.FindClosest(new Vector2(Main.maxTilesX / 2, (float)Main.worldSurface / 2f) * 16f, 0, 0); Player player = Main.player[closestPlayer]; CalamityPlayer modPlayer = player.Calamity(); @@ -968,6 +969,17 @@ namespace CalamityMod.World if (rainingAcid) { + timeSinceAcidRainKill++; + timeSinceAcidStarted++; + + // If enough time has passed, and no enemy has been killed, end the invasion early. + // The player almost certainly does not want to deal with it. + if (timeSinceAcidRainKill >= AcidRainEvent.InvasionNoKillPersistTime) + { + acidRainPoints = 0; + triedToSummonOldDuke = false; + AcidRainEvent.UpdateInvasion(false); + } if (!startAcidicDownpour) { int sulphSeaWidth = Abyss.BiomeWidth; @@ -985,6 +997,8 @@ namespace CalamityMod.World (player2.Center.X >= (Main.maxTilesX - (sulphSeaWidth + 60f)) * 16f && !abyssSide)) && player2.Calamity().ZoneSulphur) { + // Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea) + // You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!! startAcidicDownpour = true; CalamityMod.UpdateServerBoolean(); break; @@ -993,22 +1007,37 @@ namespace CalamityMod.World } } - // Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea) - // You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!! - if ((startAcidicDownpour || forcedDownpourWithTear) && !NPC.AnyNPCs(ModContent.NPCType())) + // Stop the rain if the Old Duke is present for visibility during the fight. + if (Main.raining && NPC.AnyNPCs(ModContent.NPCType())) { - Main.raining = true; - Main.cloudBGActive = 1f; - Main.numCloudsTemp = Main.cloudLimit; - Main.numClouds = Main.numCloudsTemp; - Main.windSpeedTemp = 0.72f; - Main.windSpeedSet = Main.windSpeedTemp; - Main.weatherCounter = 600; - Main.maxRaining = 0.89f; - } + Main.raining = false; + CalamityMod.UpdateServerBoolean(); + } + + // If the rain stops for whatever reason, end the invasion. + // This is primarily done for compatibility, so that if another mod wants to manipulate the weather, + // they can without having to deal with endless rain. + if (!Main.raining && !NPC.AnyNPCs(ModContent.NPCType()) && timeSinceAcidStarted > 20) + { + acidRainPoints = 0; + triedToSummonOldDuke = false; + AcidRainEvent.UpdateInvasion(false); + } + else if (timeSinceAcidStarted < 20) + { + Main.raining = true; + Main.cloudBGActive = 1f; + Main.numCloudsTemp = Main.cloudLimit; + Main.numClouds = Main.numCloudsTemp; + Main.windSpeedTemp = 0.72f; + Main.windSpeedSet = Main.windSpeedTemp; + Main.weatherCounter = 60 * 60 * 10; // 10 minutes of rain. Remember, once the rain goes away, so does the invasion. + Main.rainTime = Main.weatherCounter; + Main.maxRaining = 0.89f; + } // Summon Old Duke tornado post-Polter as needed - if (downedPolterghast && acidRainPoints == 2) + if (downedPolterghast && acidRainPoints == 1) { if (!NPC.AnyNPCs(ModContent.NPCType()) && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) <= 0) @@ -1034,11 +1063,185 @@ namespace CalamityMod.World } else { - startAcidicDownpour = false; + if (timeSinceAcidStarted != 0) + timeSinceAcidStarted = 0; + startAcidicDownpour = false; } - // Boss Rush shit - if (bossRushActive) + // Lumenyl crystal, tenebris spread and sea prism crystal spawn rates + int l = 0; + float mult2 = 1.5E-05f * Main.worldRate; + while (l < Main.maxTilesX * Main.maxTilesY * mult2) + { + int x = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int y = WorldGen.genRand.Next((int)Main.worldSurface - 1, Main.maxTilesY - 20); + + int y2 = y - 1; + if (y2 < 10) + y2 = 10; + + if (Main.tile[x, y] != null) + { + if (Main.tile[x, y].nactive()) + { + if (Main.tile[x, y].liquid <= 32) + { + if (Main.tile[x, y].type == TileID.JungleGrass) + { + if (Main.tile[x, y2].liquid == 0) + { + // Plantera Bulbs pre-mech + if (WorldGen.genRand.Next(1500) == 0) + { + if (Main.hardMode && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3)) + { + bool placeBulb = true; + int minDistanceFromOtherBulbs = 150; + for (int i = x - minDistanceFromOtherBulbs; i < x + minDistanceFromOtherBulbs; i += 2) + { + for (int j = y - minDistanceFromOtherBulbs; j < y + minDistanceFromOtherBulbs; j += 2) + { + if (i > 1 && i < Main.maxTilesX - 2 && j > 1 && j < Main.maxTilesY - 2 && Main.tile[i, j].active() && Main.tile[i, j].type == TileID.PlanteraBulb) + { + placeBulb = false; + break; + } + } + } + + if (placeBulb) + { + WorldGen.PlaceJunglePlant(x, y2, TileID.PlanteraBulb, 0, 0); + WorldGen.SquareTileFrame(x, y2); + WorldGen.SquareTileFrame(x + 2, y2); + WorldGen.SquareTileFrame(x - 1, y2); + if (Main.tile[x, y2].type == TileID.PlanteraBulb && Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, x, y2, 5); + } + } + } + } + + // Life Fruit pre-mech + int random = Main.expertMode ? 30 : 40; + if (WorldGen.genRand.Next(random) == 0) + { + if (Main.hardMode && !NPC.downedMechBossAny) + { + bool placeFruit = true; + int minDistanceFromOtherFruit = Main.expertMode ? 50 : 60; + for (int i = x - minDistanceFromOtherFruit; i < x + minDistanceFromOtherFruit; i += 2) + { + for (int j = y - minDistanceFromOtherFruit; j < y + minDistanceFromOtherFruit; j += 2) + { + if (i > 1 && i < Main.maxTilesX - 2 && j > 1 && j < Main.maxTilesY - 2 && Main.tile[i, j].active() && Main.tile[i, j].type == TileID.LifeFruit) + { + placeFruit = false; + break; + } + } + } + + if (placeFruit) + { + WorldGen.PlaceJunglePlant(x, y2, TileID.LifeFruit, WorldGen.genRand.Next(3), 0); + WorldGen.SquareTileFrame(x, y2); + WorldGen.SquareTileFrame(x + 1, y2 + 1); + if (Main.tile[x, y2].type == TileID.LifeFruit && Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, x, y2, 4); + } + } + } + } + } + } + } + + int tileType = Main.tile[x, y].type; + bool tenebris = tileType == ModContent.TileType() && downedCalamitas; + + if (CalamityGlobalTile.GrowthTiles.Contains(tileType) || tenebris) + { + int growthChance = tenebris ? 4 : 2; + if (tileType == ModContent.TileType()) + growthChance *= 5; + + if (Main.rand.NextBool(growthChance)) + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + x++; + break; + case 1: + x--; + break; + case 2: + y++; + break; + case 3: + y--; + break; + default: + break; + } + + if (Main.tile[x, y] != null) + { + Tile tile = Main.tile[x, y]; + bool growTile = tenebris ? (tile.active() && tile.type == ModContent.TileType()) : (!tile.active() && tile.liquid >= 128); + bool meetsAdditionalGrowConditions = tile.slope() == 0 && !tile.halfBrick() && !tile.lava(); + if (growTile && meetsAdditionalGrowConditions) + { + int tileType2 = ModContent.TileType(); + + if (tileType == ModContent.TileType()) + tileType2 = ModContent.TileType(); + + if (CanPlaceBasedOnProximity(x, y, tileType2) || tenebris) + { + tile.type = tenebris ? (ushort)tileType : (ushort)tileType2; + + if (!tenebris) + { + tile.active(true); + if (Main.tile[x, y + 1].active() && Main.tileSolid[Main.tile[x, y + 1].type] && Main.tile[x, y + 1].slope() == 0 && !Main.tile[x, y + 1].halfBrick()) + { + tile.frameY = 0; + } + else if (Main.tile[x, y - 1].active() && Main.tileSolid[Main.tile[x, y - 1].type] && Main.tile[x, y - 1].slope() == 0 && !Main.tile[x, y - 1].halfBrick()) + { + tile.frameY = 18; + } + else if (Main.tile[x + 1, y].active() && Main.tileSolid[Main.tile[x + 1, y].type] && Main.tile[x + 1, y].slope() == 0 && !Main.tile[x + 1, y].halfBrick()) + { + tile.frameY = 36; + } + else if (Main.tile[x - 1, y].active() && Main.tileSolid[Main.tile[x - 1, y].type] && Main.tile[x - 1, y].slope() == 0 && !Main.tile[x - 1, y].halfBrick()) + { + tile.frameY = 54; + } + tile.frameX = (short)(WorldGen.genRand.Next(18) * 18); + } + + WorldGen.SquareTileFrame(x, y, true); + + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); + } + } + } + } + } + } + } + l++; + } + + // Boss Rush shit + if (bossRushActive) { // Prevent Moon Lord from spawning naturally if (NPC.MoonLordCountdown > 0) @@ -1234,8 +1437,9 @@ namespace CalamityMod.World case 19: for (int doom = 0; doom < Main.maxNPCs; doom++) { - if (Main.npc[doom].active && (Main.npc[doom].type == 493 || Main.npc[doom].type == 422 || Main.npc[doom].type == 507 || - Main.npc[doom].type == 517)) + bool isPillar = Main.npc[doom].type == NPCID.LunarTowerStardust || Main.npc[doom].type == NPCID.LunarTowerVortex || + Main.npc[doom].type == NPCID.LunarTowerNebula || Main.npc[doom].type == NPCID.LunarTowerSolar; + if (Main.npc[doom].active && isPillar) { Main.npc[doom].active = false; Main.npc[doom].netUpdate = true; @@ -1272,10 +1476,6 @@ namespace CalamityMod.World break; case 29: ChangeTime(false); - for (int x = 0; x < 10; x++) - { - NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); - } NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); break; case 30: @@ -1415,7 +1615,7 @@ namespace CalamityMod.World if (modPlayer.bossZen || DoGSecondStageCountdown > 0) spawnRate *= 50D; - if (modPlayer.zen || (CalamityMod.CalamityConfig.DisableExpertEnemySpawnsNearHouse && player.townNPCs > 1f && Main.expertMode)) + if (modPlayer.zen || (CalamityConfig.Instance.DisableExpertTownSpawns && player.townNPCs > 1f && Main.expertMode)) spawnRate *= 2D; if (modPlayer.tranquilityCandle) spawnRate *= 1.67D; @@ -1827,7 +2027,7 @@ namespace CalamityMod.World } } - if (!downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient) + if (!downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient && !Main.hardMode) CalamityUtils.StopSandstorm(); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1844,10 +2044,35 @@ namespace CalamityMod.World } } } - #endregion + #endregion - #region ChangeTime - public static void ChangeTime(bool day) + #region Check Placement Proximity + private bool CanPlaceBasedOnProximity(int x, int y, int tileType) + { + if (tileType == ModContent.TileType() && !downedCalamitas) + return false; + + int minDistanceFromOtherTiles = 6; + int sameTilesNearby = 0; + for (int i = x - minDistanceFromOtherTiles; i < x + minDistanceFromOtherTiles; i++) + { + for (int j = y - minDistanceFromOtherTiles; j < y + minDistanceFromOtherTiles; j++) + { + if (Main.tile[i, j].active() && Main.tile[i, j].type == tileType) + { + sameTilesNearby++; + if (sameTilesNearby > 1) + return false; + } + } + } + + return true; + } + #endregion + + #region ChangeTime + public static void ChangeTime(bool day) { Main.time = 0.0; Main.dayTime = day; diff --git a/World/CustomActions.cs b/World/CustomActions.cs index a2b42eb335..6f21af366a 100644 --- a/World/CustomActions.cs +++ b/World/CustomActions.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria; diff --git a/World/CustomConditions.cs b/World/CustomConditions.cs index 2fb8f97739..786fb031a8 100644 --- a/World/CustomConditions.cs +++ b/World/CustomConditions.cs @@ -1,4 +1,4 @@ - + using Terraria; using Terraria.World.Generation; diff --git a/World/Planets/GrassPlanet.cs b/World/Planets/GrassPlanet.cs index 54c1ba147f..7a6c000dca 100644 --- a/World/Planets/GrassPlanet.cs +++ b/World/Planets/GrassPlanet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using Terraria; diff --git a/World/Planets/HeartPlanet.cs b/World/Planets/HeartPlanet.cs index 498288fe28..9138468659 100644 --- a/World/Planets/HeartPlanet.cs +++ b/World/Planets/HeartPlanet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.World.Generation; diff --git a/World/Planets/MainPlanet.cs b/World/Planets/MainPlanet.cs index f808d58a7b..6e10274be9 100644 --- a/World/Planets/MainPlanet.cs +++ b/World/Planets/MainPlanet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 5ec3afd48a..0fb1bbd85b 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -1,4 +1,4 @@ - + using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Generation; diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index dbda167d2c..5d5043a34f 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; using Terraria.ID; diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index bf28a2fea5..72f0cbac25 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -17,12 +17,12 @@ namespace CalamityMod.World public Hub(Vector2 position) { - this.Position = position; + Position = position; } public Hub(float x, float y) { - this.Position = new Vector2(x, y); + Position = new Vector2(x, y); } } @@ -47,19 +47,19 @@ namespace CalamityMod.World } if (x > 0 && hubMap[x - 1, y]) { - this.SearchForCluster(hubMap, pointCluster, x - 1, y, level); + SearchForCluster(hubMap, pointCluster, x - 1, y, level); } if (x < hubMap.GetLength(0) - 1 && hubMap[x + 1, y]) { - this.SearchForCluster(hubMap, pointCluster, x + 1, y, level); + SearchForCluster(hubMap, pointCluster, x + 1, y, level); } if (y > 0 && hubMap[x, y - 1]) { - this.SearchForCluster(hubMap, pointCluster, x, y - 1, level); + SearchForCluster(hubMap, pointCluster, x, y - 1, level); } if (y < hubMap.GetLength(1) - 1 && hubMap[x, y + 1]) { - this.SearchForCluster(hubMap, pointCluster, x, y + 1, level); + SearchForCluster(hubMap, pointCluster, x, y + 1, level); } } @@ -78,9 +78,9 @@ namespace CalamityMod.World public void Generate(int width, int height) //Creates clusters for cluster group { - this.Width = width; - this.Height = height; - base.Clear(); + Width = width; + Height = height; + Clear(); bool[,] array = new bool[width, height]; int num = (width >> 1) - 1; int num2 = (height >> 1) - 1; @@ -89,7 +89,7 @@ namespace CalamityMod.World for (int i = point.Y - num2; i <= point.Y + num2; i++) { float num4 = (float)num / (float)num2 * (float)(i - point.Y); - int num5 = Math.Min(num, (int)Math.Sqrt((double)((float)num3 - num4 * num4))); + int num5 = Math.Min(num, (int)Math.Sqrt((float)num3 - num4 * num4)); for (int j = point.X - num5; j <= point.X + num5; j++) { array[j, i] = WorldGen.genRand.Next(2) == 0; @@ -103,7 +103,7 @@ namespace CalamityMod.World if (array[k, l] && WorldGen.genRand.Next(2) == 0) { List list2 = new List(); - this.SearchForCluster(array, list2, k, l, 2); + SearchForCluster(array, list2, k, l, 2); if (list2.Count > 2) { list.Add(list2); @@ -139,19 +139,19 @@ namespace CalamityMod.World int index = array2[x, y]; if (x > 0) { - this.AttemptClaim(x - 1, y, array2, list, index); + AttemptClaim(x - 1, y, array2, list, index); } if (x < array2.GetLength(0) - 1) { - this.AttemptClaim(x + 1, y, array2, list, index); + AttemptClaim(x + 1, y, array2, list, index); } if (y > 0) { - this.AttemptClaim(x, y - 1, array2, list, index); + AttemptClaim(x, y - 1, array2, list, index); } if (y < array2.GetLength(1) - 1) { - this.AttemptClaim(x, y + 1, array2, list, index); + AttemptClaim(x, y + 1, array2, list, index); } } } @@ -188,7 +188,7 @@ namespace CalamityMod.World { cluster.Add(new Hub((float)current4.X + (WorldGen.genRand.NextFloat() - 0.5f) * 0.5f, (float)current4.Y + (WorldGen.genRand.NextFloat() - 0.5f) * 0.5f)); } - base.Add(cluster); + Add(cluster); } } } @@ -196,11 +196,11 @@ namespace CalamityMod.World private static void PlaceClusters(ClusterGroup clusters, Point start, Vector2 scale) //Places tile/wall clusters in Sunken Sea area { - int num = (int)(scale.X * (float)clusters.Width); - int num2 = (int)(scale.Y * (float)clusters.Height); - Vector2 value = new Vector2((float)num, (float)num2); - Vector2 value2 = new Vector2((float)clusters.Width, (float)clusters.Height); - for (int i = -20; i < num + 20; i++) + int num = (int)(scale.X * (float)clusters.Width); + int num2 = (int)(scale.Y * (float)clusters.Height); + Vector2 value = new Vector2((float)num, (float)num2); + Vector2 value2 = new Vector2((float)clusters.Width, (float)clusters.Height); + for (int i = -20; i < num + 20; i++) { for (int j = -20; j < num2 + 20; j++) { @@ -209,9 +209,9 @@ namespace CalamityMod.World float num5 = 0f; int num6 = i + start.X; int num7 = j + start.Y; - Vector2 vector = new Vector2((float)i, (float)j) / value * value2; - float num8 = (new Vector2((float)i, (float)j) / value * 2f - Vector2.One).Length(); - for (int k = 0; k < clusters.Count; k++) + Vector2 vector = new Vector2((float)i, (float)j) / value * value2; + float num8 = (new Vector2((float)i, (float)j) / value * 2f - Vector2.One).Length(); + for (int k = 0; k < clusters.Count; k++) { Cluster cluster = clusters[k]; if (Math.Abs(cluster[0].Position.X - vector.X) <= 10f && Math.Abs(cluster[0].Position.Y - vector.Y) <= 10f) @@ -303,18 +303,18 @@ namespace CalamityMod.World private static void AddTileVariance(ClusterGroup clusters, Point start, Vector2 scale, float size) /*Adds tile variation to the generated tile clusters and generates open areas with sea prism ore; Generates sea prism crystals on prism ore and occasionally on navystone*/ { - int num = (int)(scale.X * (float)clusters.Width); - int num2 = (int)(scale.Y * (float)clusters.Height); - bool genCentalHole = true; + int num = (int)(scale.X * (float)clusters.Width); + int num2 = (int)(scale.Y * (float)clusters.Height); + bool genCentalHole = true; Rectangle rectangle = default; - int radius = (int)(((float)WorldGen.genRand.Next(24, 28)) * size); //Radius of the generated hole - int diameter = radius * 2; + int radius = (int)(((float)WorldGen.genRand.Next(24, 28)) * size); //Radius of the generated hole + int diameter = radius * 2; Point point = new Point(WorldGen.UndergroundDesertLocation.Left + (WorldGen.UndergroundDesertLocation.Width / 2), WorldGen.UndergroundDesertLocation.Bottom + (WorldGen.UndergroundDesertLocation.Height / 3)); //Around the center of the Sunken Sea area ShapeData holeShape = new ShapeData(); - float outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(40, 56) * 0.01); //Small radius for ore patch to fit inside holes - int sunkenSeaBottom = WorldGen.UndergroundDesertLocation.Bottom + (int)((double)WorldGen.UndergroundDesertLocation.Height * 0.7); - int smallHoles = 0; + float outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(40, 56) * 0.01); //Small radius for ore patch to fit inside holes + int sunkenSeaBottom = WorldGen.UndergroundDesertLocation.Bottom + (int)((double)WorldGen.UndergroundDesertLocation.Height * 0.7); + int smallHoles = 0; int amt = (int)(4f * size); //Scale amount of holes with world size for (int i = -20; i < num + 20; i++) { @@ -381,8 +381,8 @@ namespace CalamityMod.World if (smallHoles < amt && WorldGen.genRand.Next(3) == 0 && !rectangle.Contains(point)) { smallHoles++; - int radiusSmall = (int)(((float)WorldGen.genRand.Next(8, 11)) * size); - WorldUtils.Gen(point, new Shapes.Circle(radiusSmall), Actions.Chain(new GenAction[] + int radiusSmall = (int)(((float)WorldGen.genRand.Next(8, 11)) * size); + WorldUtils.Gen(point, new Shapes.Circle(radiusSmall), Actions.Chain(new GenAction[] { new Modifiers.Blotches(2, 0.45).Output(holeShape), new Actions.ClearTile(true), @@ -397,8 +397,8 @@ namespace CalamityMod.World new Actions.SetFrames(true) })); - outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(65, 81) * 0.01); - WorldUtils.Gen(point, new Shapes.Circle((int)((float)radiusSmall * outerRadiusPercentage)), Actions.Chain(new GenAction[] //Smallest is 4 + outerRadiusPercentage = (float)((double)WorldGen.genRand.Next(65, 81) * 0.01); + WorldUtils.Gen(point, new Shapes.Circle((int)((float)radiusSmall * outerRadiusPercentage)), Actions.Chain(new GenAction[] //Smallest is 4 { new Modifiers.Blotches(2, 0.3).Output(holeShape), new Actions.SetTile((ushort)ModContent.TileType(), true) //Place outer shell @@ -501,12 +501,12 @@ namespace CalamityMod.World tile3.type = (ushort)ModContent.TileType(); if (Main.tile[num5 - 1, num6].type == ModContent.TileType()) { - Main.tile[num5 - 1, num6].frameY = (short)(2 * 18); - } + Main.tile[num5 - 1, num6].frameY = (short)(2 * 18); + } else if (Main.tile[num5 + 1, num6].type == ModContent.TileType()) { - Main.tile[num5 + 1, num6].frameY = (short)(3 * 18); - } + Main.tile[num5 + 1, num6].frameY = (short)(3 * 18); + } tile3.frameX = (short)(WorldGen.genRand.Next(18) * 18); tile3.active(true); } @@ -519,12 +519,12 @@ namespace CalamityMod.World tile3.type = (ushort)ModContent.TileType(); if (Main.tile[num5, num6 - 1].type == ModContent.TileType()) { - Main.tile[num5, num6 - 1].frameY = (short)(0 * 18); - } + Main.tile[num5, num6 - 1].frameY = (short)(0 * 18); + } else if (Main.tile[num5, num6 + 1].type == ModContent.TileType()) { - Main.tile[num5, num6 + 1].frameY = (short)(1 * 18); - } + Main.tile[num5, num6 + 1].frameY = (short)(1 * 18); + } tile3.frameX = (short)(WorldGen.genRand.Next(18) * 18); tile3.active(true); } @@ -585,8 +585,8 @@ namespace CalamityMod.World Vector2 vector = new Vector2(4f, 2f); //4, 2 ClusterGroup clusterGroup = new ClusterGroup(); clusterGroup.Generate(sunkenSeaAreaX, sunkenSeaAreaY); - SunkenSea.PlaceClusters(clusterGroup, origin, vector); - SunkenSea.AddTileVariance(clusterGroup, origin, vector, scale); + PlaceClusters(clusterGroup, origin, vector); + AddTileVariance(clusterGroup, origin, vector, scale); int num4 = (int)(vector.X * (float)clusterGroup.Width); int num5 = (int)(vector.Y * (float)clusterGroup.Height); for (int i = -40; i < num4 + 40; i++) //40 diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 6cf3b5a228..d4de0fd404 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Pets; @@ -139,7 +139,7 @@ namespace CalamityMod.World } PutItemInChest(ref chest, ItemID.GoldCoin, goldCoins); } - else if (type == ModContent.TileType()) + else if (type == ModContent.TileType()) { // 15-29 torches (in accordence with vanilla) PutItemInChest(ref chest, ItemID.Torch, 15, 29); @@ -1770,9 +1770,9 @@ namespace CalamityMod.World break; case TileID.LeafBlock: WorldGen.KillTile(x, y); - if (Main.netMode == 1) + if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(17, -1, -1, null, 0, x, y); + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, x, y); } break; case TileID.LargePiles: