From df0e245f4b5c4331b7544501360e8f083ba72eae Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 17 Mar 2025 20:56:47 -0700 Subject: [PATCH] Some fixes for Ion/Array --- Items/CalamityGlobalItem.cs | 8 +++++++- Items/Weapons/Magic/ApoctosisArray.cs | 4 ++-- ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 2 ++ Projectiles/Magic/ApoctosisArrayHoldout.cs | 20 +++++++++++-------- Projectiles/Magic/ApoctosisBlast.cs | 6 ++---- Projectiles/Magic/IonBlasterHoldout.cs | 2 +- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 603f41df6c..49c79cc472 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; @@ -545,7 +546,7 @@ namespace CalamityMod.Items #region Pickup Item Changes public override bool OnPickup(Item item, Player player) { - if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) + if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) // On heart pickup { bool boostedHeart = player.Calamity().photosynthesis; if (boostedHeart) @@ -553,6 +554,11 @@ namespace CalamityMod.Items player.HealPlayer(PhotosynthesisPotion.IncreasedHeartHeal); } } + if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum) // On star pickup + { + if (player.ActiveItem().type == ModContent.ItemType() || player.ActiveItem().type == ModContent.ItemType()) + return false; + } return true; } #endregion diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index 546322c187..079f04f32a 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -15,9 +15,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 130; Item.height = 58; - Item.damage = 85; + Item.damage = 69; Item.DamageType = DamageClass.Magic; - Item.mana = 5; + Item.mana = 7; Item.useAnimation = 5; Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 4d8c01dc8c..9ec613963a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -64,6 +64,7 @@ ApoctosisArray: { Press to charge the blaster, restoring your mana until it reaches max The more mana you restore, the stronger the arrow is when you release it Charging for 90% of your max mana or more will reach max power +Holding this weapon disables the pickup of stars ''' } @@ -500,6 +501,7 @@ IonBlaster: { Press to charge the blaster, restoring your mana until it reaches max The more mana you restore, the stronger the burst is when you release it Charging for 90% of your max mana or more will reach max power +Holding this weapon disables the pickup of stars ''' } diff --git a/Projectiles/Magic/ApoctosisArrayHoldout.cs b/Projectiles/Magic/ApoctosisArrayHoldout.cs index 98168b8405..6e4ab6c4d4 100644 --- a/Projectiles/Magic/ApoctosisArrayHoldout.cs +++ b/Projectiles/Magic/ApoctosisArrayHoldout.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic else { SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); - shootingTimer = -20; + shootingTimer = -40; } } else // Charging mode @@ -216,7 +216,7 @@ namespace CalamityMod.Projectiles.Magic float manaPercent = ((float)Owner.statMana / (float)Owner.statManaMax2); Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); Vector2 firingVelocity = (shootDirection * 4); - float damageBoost = Math.Max((manaPower * 40) * (manaPower >= 1 ? 1.3f : 1f), 1); + float damageBoost = Math.Max((manaPower * 55) * (manaPower >= 1 ? 1.3f : 1f), 1); if (big) { @@ -226,12 +226,13 @@ namespace CalamityMod.Projectiles.Magic } SoundStyle fire = new("CalamityMod/Sounds/Item/ImpalerLaunch"); - SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = -0.6f }, Projectile.Center); + for (int i = 0; i < (manaPower >= 1 ? 2 : 1); i++) + SoundEngine.PlaySound(fire with { Volume = 0.9f, Pitch = -0.7f, MaxInstances = 2 }, Projectile.Center); - SoundStyle fire2 = new("CalamityMod/Sounds/Item/MagnaCannonShot"); - SoundEngine.PlaySound(fire2 with { Volume = 0.8f, Pitch = (manaPower >= 1 ? 0.5f : 0.4f) }, Projectile.Center); + SoundStyle fire2 = new("CalamityMod/Sounds/Item/PulseRifleFire"); + SoundEngine.PlaySound(fire2 with { Volume = 0.75f, Pitch = (manaPower >= 1 ? 0.7f : 0.5f) }, Projectile.Center); - Owner.Calamity().GeneralScreenShakePower = 13f * manaPower; + Owner.Calamity().GeneralScreenShakePower = 12f * manaPower; float projSpeedMult = (manaPower + 0.4f) * (manaPower >= 1 ? 3f : 2f); float variance = Main.rand.NextFloat(-0.8f, 0.8f); @@ -240,15 +241,18 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, vel, ModContent.ProjectileType(), (int)(Projectile.damage * damageBoost), Projectile.knockBack * 4, Projectile.owner, 0, 0, 5); OffsetLengthFromArm -= 24f * manaPower; - Owner.velocity -= Projectile.velocity * 12f * manaPower; + Owner.velocity -= Projectile.velocity * 14f * manaPower; + Projectile.rotation += 0.5f * Projectile.direction; for (int i = 0; i < Math.Max(3, 30 * manaPower); i++) { Particle sparks = new SparkParticle(GunTipPosition, Projectile.velocity.RotatedByRandom(0.7f) * Main.rand.NextFloat(7, 25), false, 35, Main.rand.NextFloat(0.5f, 0.9f), Main.rand.NextBool() ? Color.Lerp(effectsColor, Color.White, 0.5f) : effectsColor); GeneralParticleHandler.SpawnParticle(sparks); } - Particle pulse3 = new CustomSpark(GunTipPosition, shootDirection * 9, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 17, 0.06f, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); + Particle pulse3 = new CustomSpark(GunTipPosition, shootDirection * 7, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 23, 0.085f * manaPower, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); GeneralParticleHandler.SpawnParticle(pulse3); + Particle pulse4 = new CustomSpark(GunTipPosition, shootDirection * 13, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 18, 0.06f * manaPower, effectsColor, new Vector2(2f, 0.7f), shrinkSpeed: 0.1f); + GeneralParticleHandler.SpawnParticle(pulse4); } else { diff --git a/Projectiles/Magic/ApoctosisBlast.cs b/Projectiles/Magic/ApoctosisBlast.cs index cc0be0466b..55327155f1 100644 --- a/Projectiles/Magic/ApoctosisBlast.cs +++ b/Projectiles/Magic/ApoctosisBlast.cs @@ -13,12 +13,10 @@ namespace CalamityMod.Projectiles.Magic public ref float time => ref Projectile.ai[0]; public bool chargeShot => Projectile.ai[2] == 5; public bool onSpawn = true; - public Vector2 storedVel; - public int stopTime = 0; public float sine = 0; public override void SetDefaults() { - Projectile.width = Projectile.height = 14; + Projectile.width = Projectile.height = 40; Projectile.friendly = true; Projectile.penetrate = 1; Projectile.extraUpdates = 7; @@ -80,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { Player Owner = Main.player[Projectile.owner]; - if (time == 0) + if (time <= 1) { float _ = float.NaN; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Owner.Center, Projectile.width, ref _); diff --git a/Projectiles/Magic/IonBlasterHoldout.cs b/Projectiles/Magic/IonBlasterHoldout.cs index 69f2a622ee..a49602f0fe 100644 --- a/Projectiles/Magic/IonBlasterHoldout.cs +++ b/Projectiles/Magic/IonBlasterHoldout.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Magic else { SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); - shootingTimer = -20; + shootingTimer = -40; } } else // Charging mode