diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3f9033b817..cc2eb87e58 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2758,7 +2758,7 @@ namespace CalamityMod.CalPlayer if (gravityNormalizer) { Player.buffImmune[BuffID.VortexDebuff] = true; - if (Player.InSpace()) + if (Player.ReducedSpaceGravity()) { Player.gravity = Player.defaultGravity; if (Player.wet) diff --git a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs index 94c0a5ef7c..98871deb15 100644 --- a/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs +++ b/Graphics/Renderers/CalamityRenderers/MiracleBlightRenderer.cs @@ -30,10 +30,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers // Breaks with being behind tiles, and causes a funny interaction where his head goes behind his neck. NPCID.MoonLordCore, NPCID.MoonLordHand, - NPCID.MoonLordHead, - - // Crashes the fucking game when killed - NPCID.WallofFlesh + NPCID.MoonLordHead }; /// @@ -63,24 +60,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers if (!npc.active || npc.type <= NPCID.None) return false; - // Do not draw other mod's bosses. - if (npc.ModNPC != null && npc.ModNPC.Mod != CalamityMod.Instance && npc.boss) - return false; - - // Don't draw excluded NPCs, or if the npc is a bestiary dummy. - if (ExcludedNPCs.Contains(npc.type) || npc.IsABestiaryIconDummy) - return false; - - // Safety check for weird MP bug when getting global npcs. - if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) - return false; - - // Do not draw if the npc does not have miracle blight, or has the polarity effect. - if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) - return false; - - // Do not draw if the current player has the trippy effect. - if (Main.LocalPlayer.Calamity().trippy) + if (!CalamityDrawParameterNPC.DrawingMiracleBlight[npc.whoAmI]) return false; return true; diff --git a/Items/Weapons/Melee/SeashineSword.cs b/Items/Weapons/Melee/SeashineSword.cs index 465fa48b07..358b10aa53 100644 --- a/Items/Weapons/Melee/SeashineSword.cs +++ b/Items/Weapons/Melee/SeashineSword.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -27,7 +28,14 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; Item.shoot = ModContent.ProjectileType(); } - + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 120); + } + public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) + { + target.AddBuff(ModContent.BuffType(), 120); + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Ranged/ReedBlowgun.cs b/Items/Weapons/Ranged/ReedBlowgun.cs index 34a55c9613..12c7774d84 100644 --- a/Items/Weapons/Ranged/ReedBlowgun.cs +++ b/Items/Weapons/Ranged/ReedBlowgun.cs @@ -12,8 +12,6 @@ namespace CalamityMod.Items.Weapons.Ranged public class ReedBlowgun : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public static readonly SoundStyle BubbleBurstSound = new("CalamityMod/Sounds/Custom/PistolShrimpBubbleBurst") { PitchVariance = 0.15f, Volume = 0.2f }; - public override void SetStaticDefaults() { ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; @@ -23,10 +21,10 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 22; Item.height = 46; - Item.damage = 21; + Item.damage = 25; Item.DamageType = DamageClass.Ranged; - Item.useTime = 25; - Item.useAnimation = 25; + Item.useTime = 32; + Item.useAnimation = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.holdStyle = 16; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/Seadragon.cs b/Items/Weapons/Ranged/Seadragon.cs index 1e47e455af..31b9ce3d5b 100644 --- a/Items/Weapons/Ranged/Seadragon.cs +++ b/Items/Weapons/Ranged/Seadragon.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Item11; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 16f; Item.useAmmo = AmmoID.Bullet; Item.Calamity().canFirePointBlankShots = true; diff --git a/NPCs/CalamityDrawParameterNPC.cs b/NPCs/CalamityDrawParameterNPC.cs new file mode 100644 index 0000000000..ca630f4f02 --- /dev/null +++ b/NPCs/CalamityDrawParameterNPC.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.NPCs.ExoMechs.Ares; +using Steamworks; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs +{ + // Why this class is exist? + // It because we want to avoid Threading Issues while We using NPC's properties on Draw Thread + public sealed class CalamityDrawParameterNPC : GlobalNPC + { + public override bool InstancePerEntity => false; + + #region Draw Parameters + public static bool[] DrawingMiracleBlight { get; private set; } + public static bool[] DrawingPolarity { get; private set; } + #endregion + + #region Filtering Fields + public static List MiracleBlightExcludedNPCs => new() + { + // List the reason why the NPC(s) are excluded :) + + // The particle sets break with the visuals and this is the easiest way to fix this that isn't stupidly complex. + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + + // Breaks with being behind tiles, and causes a funny interaction where his head goes behind his neck. + NPCID.MoonLordCore, + NPCID.MoonLordHand, + NPCID.MoonLordHead + }; + #endregion + + #region Load / Unload + public override void Load() + { + DrawingMiracleBlight = new bool[Main.maxNPCs]; + DrawingPolarity = new bool[Main.maxNPCs]; + } + + public override void Unload() + { + DrawingMiracleBlight = null; + DrawingPolarity = null; + } + #endregion + + public override void SetDefaults(NPC entity) => ResetParameters(entity); + public override bool PreAI(NPC npc) + { + if (npc is null) + return true; + + var whoAmI = npc.whoAmI; + DrawingMiracleBlight[whoAmI] = ShouldDrawMiracleBlight(npc); + DrawingPolarity[whoAmI] = ShouldDrawPolarity(npc); + + return true; + } + + public static void ResetParameters(NPC npc) + { + if (npc is null) + return; + + var whoAmI = npc.whoAmI; + DrawingMiracleBlight[whoAmI] = false; + DrawingPolarity[whoAmI] = false; + } + + public static bool ShouldDrawMiracleBlight(NPC npc) + { + if (npc is null || !npc.active) + return false; + + // Do not draw weird MP types less than or equal to 0. + if (npc.type <= NPCID.None) + return false; + + // Do not draw other mod's bosses. + if (npc.ModNPC != null && npc.ModNPC.Mod != CalamityMod.Instance && npc.boss) + return false; + + // Don't draw excluded NPCs, or if the npc is a bestiary dummy. + if (MiracleBlightExcludedNPCs.Contains(npc.type) || npc.IsABestiaryIconDummy) + return false; + + // Safety check for weird MP bug when getting global npcs. + if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) + return false; + + // Do not draw if the npc does not have miracle blight, or has the polarity effect. + if (calNPC.miracleBlight <= 0 || polNPC.CurPolarity > 0f) + return false; + + // Do not draw if the current player has the trippy effect. + if (Main.LocalPlayer.Calamity().trippy) + return false; + + return true; + } + + public static bool ShouldDrawPolarity(NPC npc) + { + if (npc is null || !npc.active) + return false; + + // Safety check for weird MP bug when getting global npcs. + if (!npc.TryGetGlobalNPCSafer(out var calNPC) || !npc.TryGetGlobalNPCSafer(out var polNPC)) + return false; + + // I don't know who would be using this while also inflicting miracle blight, but in that rare case, do not draw these. + if (calNPC.miracleBlight > 0) + return false; + + // Do not draw if the npc doesn't have the polarity effect. + if (polNPC.CurPolarity <= 0f) + return false; + + return true; + } + } +} diff --git a/NPCs/CalamityPolarityNPC.cs b/NPCs/CalamityPolarityNPC.cs index b414c40154..62389ac49f 100644 --- a/NPCs/CalamityPolarityNPC.cs +++ b/NPCs/CalamityPolarityNPC.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { // I don't know who would be using this while also inflicting miracle blight, but in that rare case, do not draw these. - if (npc.Calamity().miracleBlight > 0) + if (CalamityDrawParameterNPC.DrawingMiracleBlight[npc.whoAmI]) return; Main.spriteBatch.End(); diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index aa774c226c..5645ec3df9 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Projectiles.Boss public class MushBombFall : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override string Texture => "CalamityMod/Projectiles/Boss/MushBomb"; public override void SetStaticDefaults() { diff --git a/Projectiles/Boss/MushBombFall.png b/Projectiles/Boss/MushBombFall.png deleted file mode 100644 index 279f8aa2b9..0000000000 Binary files a/Projectiles/Boss/MushBombFall.png and /dev/null differ diff --git a/Projectiles/Magic/AquamarineBolt.cs b/Projectiles/Magic/AquamarineBolt.cs index 886ec7cabc..f426b89a09 100644 --- a/Projectiles/Magic/AquamarineBolt.cs +++ b/Projectiles/Magic/AquamarineBolt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,7 +40,8 @@ namespace CalamityMod.Projectiles.Magic } Projectile.rotation += 0.3f * (float)Projectile.direction; } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/CosmicRainbowFront.cs b/Projectiles/Magic/CosmicRainbowFront.cs index 707cdc9bbd..3f6a2c3f1a 100644 --- a/Projectiles/Magic/CosmicRainbowFront.cs +++ b/Projectiles/Magic/CosmicRainbowFront.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Magic public class CosmicRainbowFront : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { diff --git a/Projectiles/Magic/CosmicRainbowTrail.cs b/Projectiles/Magic/CosmicRainbowTrail.cs index e48af16b3f..ceedd2c90b 100644 --- a/Projectiles/Magic/CosmicRainbowTrail.cs +++ b/Projectiles/Magic/CosmicRainbowTrail.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic public class CosmicRainbowTrail : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public const int Lifetime = 25; public override void SetDefaults() diff --git a/Projectiles/Magic/PartySparkle.cs b/Projectiles/Magic/PartySparkle.cs index 5eafa1cce4..f2a5df1a09 100644 --- a/Projectiles/Magic/PartySparkle.cs +++ b/Projectiles/Magic/PartySparkle.cs @@ -10,6 +10,9 @@ namespace CalamityMod.Projectiles.Magic public class PartySparkle : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; + + public override string Texture => "CalamityMod/Projectiles/StarProj"; + public float Time { get => Projectile.ai[0]; diff --git a/Projectiles/Magic/PartySparkle.png b/Projectiles/Magic/PartySparkle.png deleted file mode 100644 index 0968156e79..0000000000 Binary files a/Projectiles/Magic/PartySparkle.png and /dev/null differ diff --git a/Projectiles/Magic/VeeringWindFrostWave.cs b/Projectiles/Magic/VeeringWindFrostWave.cs index 1e8e76e209..4716b8c50c 100644 --- a/Projectiles/Magic/VeeringWindFrostWave.cs +++ b/Projectiles/Magic/VeeringWindFrostWave.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Magic public class VeeringWindFrostWave : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "Terraria/Images/Projectile_348"; public override void SetStaticDefaults() { diff --git a/Projectiles/Magic/VeeringWindFrostWave.png b/Projectiles/Magic/VeeringWindFrostWave.png deleted file mode 100644 index 8246150f12..0000000000 Binary files a/Projectiles/Magic/VeeringWindFrostWave.png and /dev/null differ diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index 4815d4d045..a381b0710a 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -139,7 +140,8 @@ namespace CalamityMod.Projectiles.Melee { return new Color(30, 255, 253); } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.position); diff --git a/Projectiles/Melee/BrinyTyphoonBubble.cs b/Projectiles/Melee/BrinyTyphoonBubble.cs index cd4332d625..3fbd52fcf1 100644 --- a/Projectiles/Melee/BrinyTyphoonBubble.cs +++ b/Projectiles/Melee/BrinyTyphoonBubble.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Projectiles.Melee public class BrinyTyphoonBubble : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "Terraria/Images/Projectile_385"; + public override void SetStaticDefaults() { Main.projFrames[Type] = 3; diff --git a/Projectiles/Melee/BrinyTyphoonBubble.png b/Projectiles/Melee/BrinyTyphoonBubble.png deleted file mode 100644 index 90a422dbd8..0000000000 Binary files a/Projectiles/Melee/BrinyTyphoonBubble.png and /dev/null differ diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 1922176180..42d3b112e9 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -54,7 +55,8 @@ namespace CalamityMod.Projectiles.Melee return false; } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.NPCDeath19, Projectile.position); diff --git a/Projectiles/Melee/SeashineSwordProj.cs b/Projectiles/Melee/SeashineSwordProj.cs index 12e6aa9d77..00272dd585 100644 --- a/Projectiles/Melee/SeashineSwordProj.cs +++ b/Projectiles/Melee/SeashineSwordProj.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -92,9 +93,9 @@ namespace CalamityMod.Projectiles.Melee CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); return false; } - public override Color? GetAlpha(Color lightColor) => new Color(128, byte.MaxValue, byte.MaxValue); - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); diff --git a/Projectiles/Melee/YinYoDark.cs b/Projectiles/Melee/YinYoDark.cs index 5574b74854..51cdfe150d 100644 --- a/Projectiles/Melee/YinYoDark.cs +++ b/Projectiles/Melee/YinYoDark.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; private const int speedTimerMax = 30; private int speedTimer = speedTimerMax; + public override string Texture => "Terraria/Images/Item_527"; public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/YinYoDark.png b/Projectiles/Melee/YinYoDark.png deleted file mode 100644 index 7f62b3dfe7..0000000000 Binary files a/Projectiles/Melee/YinYoDark.png and /dev/null differ diff --git a/Projectiles/Melee/YinYoLight.cs b/Projectiles/Melee/YinYoLight.cs index a9b585e130..57610ed4d3 100644 --- a/Projectiles/Melee/YinYoLight.cs +++ b/Projectiles/Melee/YinYoLight.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; private const int speedTimerMax = 30; private int speedTimer = 0; + public override string Texture => "Terraria/Images/Item_528"; public override void SetStaticDefaults() { diff --git a/Projectiles/Melee/YinYoLight.png b/Projectiles/Melee/YinYoLight.png deleted file mode 100644 index 90c73a1903..0000000000 Binary files a/Projectiles/Melee/YinYoLight.png and /dev/null differ diff --git a/Projectiles/Ranged/ArcherfishShot.cs b/Projectiles/Ranged/ArcherfishShot.cs index 7b82e11a0f..918ebc8a95 100644 --- a/Projectiles/Ranged/ArcherfishShot.cs +++ b/Projectiles/Ranged/ArcherfishShot.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -59,6 +60,15 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Wet, 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Wet, 120); + target.AddBuff(ModContent.BuffType(), 120); + } + public override void OnHitPlayer(Player target, Player.HurtInfo info) + { + target.AddBuff(BuffID.Wet, 120); + target.AddBuff(ModContent.BuffType(), 120); + } } } diff --git a/Projectiles/Ranged/FeatherLarge.cs b/Projectiles/Ranged/FeatherLarge.cs index 54bafbc9f1..db3737de73 100644 --- a/Projectiles/Ranged/FeatherLarge.cs +++ b/Projectiles/Ranged/FeatherLarge.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Ranged public class FeatherLarge : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Item_1516"; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 6; diff --git a/Projectiles/Ranged/FeatherLarge.png b/Projectiles/Ranged/FeatherLarge.png deleted file mode 100644 index add436a025..0000000000 Binary files a/Projectiles/Ranged/FeatherLarge.png and /dev/null differ diff --git a/Projectiles/Ranged/FlakKrakenProj.png b/Projectiles/Ranged/FlakKrakenProj.png deleted file mode 100644 index ebffc498ad..0000000000 Binary files a/Projectiles/Ranged/FlakKrakenProj.png and /dev/null differ diff --git a/Projectiles/Ranged/MegalodonShot.cs b/Projectiles/Ranged/MegalodonShot.cs index 9d5fba397e..9ecee22bea 100644 --- a/Projectiles/Ranged/MegalodonShot.cs +++ b/Projectiles/Ranged/MegalodonShot.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged bubble.type = Main.rand.NextBool(3) ? 412 : 411; } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); } } diff --git a/Projectiles/Ranged/PressurizedBubbleStream.cs b/Projectiles/Ranged/PressurizedBubbleStream.cs index 54b78cc3e1..4b593181e5 100644 --- a/Projectiles/Ranged/PressurizedBubbleStream.cs +++ b/Projectiles/Ranged/PressurizedBubbleStream.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -32,9 +33,11 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; - Projectile.penetrate = 1; + Projectile.penetrate = 3; Projectile.extraUpdates = 4; Projectile.timeLeft = FireTime + ChargeupTime; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 10; } public override bool ShouldUpdatePosition() @@ -80,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 bubblePosition = Owner.MountedCenter - Vector2.UnitY * 4f + bubbleRotation.ToRotationVector2() * 55f; - SoundEngine.PlaySound(ReedBlowgun.BubbleBurstSound, bubblePosition); + SoundEngine.PlaySound(SoundID.Item64, bubblePosition); } Projectile.velocity *= 0.985f; @@ -130,7 +133,8 @@ namespace CalamityMod.Projectiles.Ranged waterDust.velocity -= Projectile.velocity * 0.1f; } } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item21, Projectile.position); diff --git a/Projectiles/Ranged/RainbowFront.cs b/Projectiles/Ranged/RainbowFront.cs index b8154deb06..0a4305437a 100644 --- a/Projectiles/Ranged/RainbowFront.cs +++ b/Projectiles/Ranged/RainbowFront.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Ranged public class RainbowFront : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { Projectile.width = 12; diff --git a/Projectiles/Ranged/RainbowFront.png b/Projectiles/Ranged/RainbowFront.png deleted file mode 100644 index 5ee9d346d1..0000000000 Binary files a/Projectiles/Ranged/RainbowFront.png and /dev/null differ diff --git a/Projectiles/Ranged/RainbowTrail.cs b/Projectiles/Ranged/RainbowTrail.cs index 20abe41bb0..b785e78402 100644 --- a/Projectiles/Ranged/RainbowTrail.cs +++ b/Projectiles/Ranged/RainbowTrail.cs @@ -6,7 +6,7 @@ namespace CalamityMod.Projectiles.Ranged public class RainbowTrail : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Ranged/RainbowFront"; + public override string Texture => "Terraria/Images/Projectile_251"; public override void SetDefaults() { diff --git a/Projectiles/Ranged/Shroom.cs b/Projectiles/Ranged/Shroom.cs index 60082e80d0..0adf02657b 100644 --- a/Projectiles/Ranged/Shroom.cs +++ b/Projectiles/Ranged/Shroom.cs @@ -8,6 +8,8 @@ namespace CalamityMod.Projectiles.Ranged public class Shroom : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override string Texture => "Terraria/Images/Item_183"; + public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Projectiles/Ranged/Shroom.png b/Projectiles/Ranged/Shroom.png deleted file mode 100644 index a6cd029b87..0000000000 Binary files a/Projectiles/Ranged/Shroom.png and /dev/null differ diff --git a/Projectiles/Ranged/TyphoonBubble.cs b/Projectiles/Ranged/TyphoonBubble.cs index c0915367a7..08be6cba30 100644 --- a/Projectiles/Ranged/TyphoonBubble.cs +++ b/Projectiles/Ranged/TyphoonBubble.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Ranged public class TyphoonBubble : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override string Texture => "CalamityMod/Projectiles/Melee/BrinyTyphoonBubble"; + public override string Texture => "Terraria/Images/Projectile_385"; public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/DuststormInABottleProj.png b/Projectiles/Rogue/DuststormInABottleProj.png deleted file mode 100644 index 1e049812e3..0000000000 Binary files a/Projectiles/Rogue/DuststormInABottleProj.png and /dev/null differ diff --git a/Projectiles/Rogue/SeafoamBubble.cs b/Projectiles/Rogue/SeafoamBubble.cs index d33e0aa2b0..31a35ff41b 100644 --- a/Projectiles/Rogue/SeafoamBubble.cs +++ b/Projectiles/Rogue/SeafoamBubble.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -42,7 +43,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage *= 2; } } - + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item54, Projectile.position); diff --git a/Projectiles/Summon/BelladonnaPetal.cs b/Projectiles/Summon/BelladonnaPetal.cs index 427ed5680b..4c2cc34c04 100644 --- a/Projectiles/Summon/BelladonnaPetal.cs +++ b/Projectiles/Summon/BelladonnaPetal.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Summon public class BelladonnaPetal : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "Terraria/Images/Projectile_276"; public Player Owner => Main.player[Projectile.owner]; // The timer for the AI to do it's actions. @@ -27,6 +28,7 @@ namespace CalamityMod.Projectiles.Summon ProjectileID.Sets.CultistIsResistantTo[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 5; ProjectileID.Sets.TrailingMode[Type] = 0; + Main.projFrames[Type] = 2; } public override void SetDefaults() @@ -55,6 +57,14 @@ namespace CalamityMod.Projectiles.Summon // Gives it a jungl-y green color. Lighting.AddLight(Projectile.Center, 0.5f, 1f, 0.3f); + // Animation + Projectile.frameCounter++; + if (Projectile.frameCounter >= 8) + { + Projectile.frameCounter = 0; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; + } + Projectile.netUpdate = true; } diff --git a/Projectiles/Summon/BelladonnaPetal.png b/Projectiles/Summon/BelladonnaPetal.png deleted file mode 100644 index 43bc9ac92d..0000000000 Binary files a/Projectiles/Summon/BelladonnaPetal.png and /dev/null differ diff --git a/Projectiles/Summon/IceClasperSummonProjectile.cs b/Projectiles/Summon/IceClasperSummonProjectile.cs index c7c6c17af1..f82d96de31 100644 --- a/Projectiles/Summon/IceClasperSummonProjectile.cs +++ b/Projectiles/Summon/IceClasperSummonProjectile.cs @@ -8,6 +8,7 @@ namespace CalamityMod.Projectiles.Summon public class IceClasperSummonProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/Melee/DarkIceZero"; public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/IceClasperSummonProjectile.png b/Projectiles/Summon/IceClasperSummonProjectile.png deleted file mode 100644 index 98bedb5a00..0000000000 Binary files a/Projectiles/Summon/IceClasperSummonProjectile.png and /dev/null differ diff --git a/Projectiles/Summon/MutatedTruffleToothball.cs b/Projectiles/Summon/MutatedTruffleToothball.cs index e9e60f2538..7e2866795c 100644 --- a/Projectiles/Summon/MutatedTruffleToothball.cs +++ b/Projectiles/Summon/MutatedTruffleToothball.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/NPCs/OldDuke/OldDukeToothBall"; + public ref float TargetShotID => ref Projectile.ai[0]; public override void SetStaticDefaults() => ProjectileID.Sets.MinionShot[Type] = true; diff --git a/Projectiles/Summon/MutatedTruffleToothball.png b/Projectiles/Summon/MutatedTruffleToothball.png deleted file mode 100644 index dfed859377..0000000000 Binary files a/Projectiles/Summon/MutatedTruffleToothball.png and /dev/null differ diff --git a/Projectiles/Summon/WitherBolt.cs b/Projectiles/Summon/WitherBolt.cs index 1d05ddf020..6711988904 100644 --- a/Projectiles/Summon/WitherBolt.cs +++ b/Projectiles/Summon/WitherBolt.cs @@ -11,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; diff --git a/Projectiles/Summon/WitherBolt.png b/Projectiles/Summon/WitherBolt.png deleted file mode 100644 index 0968156e79..0000000000 Binary files a/Projectiles/Summon/WitherBolt.png and /dev/null differ diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index f0b03502e3..df0c716d35 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -317,11 +317,11 @@ namespace CalamityMod #region Location and Biomes public static bool IsUnderwater(this Player player) => Collision.DrownCollision(player.position, player.width, player.height, player.gravDir); - public static bool InSpace(this Player player) + public static bool ReducedSpaceGravity(this Player player) { float x = Main.maxTilesX / 4200f; x *= x; - float spaceGravityMult = (float)((player.position.Y / 16f - (60f + 10f * x)) / (Main.worldSurface / 6.0)); + float spaceGravityMult = (float)((player.position.Y / 16f - (60f + 10f * x)) / (Main.worldSurface / (Main.remixWorld ? 1.0 : 6.0))); return spaceGravityMult < 1f; } diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index ce63323792..5bb14468dc 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -295,7 +295,7 @@ namespace CalamityMod.World break; } } - while (tries <= 20000); + while (tries <= 50000); } #endregion