Some fixes for Ion/Array

This commit is contained in:
Xyk committed 2025-03-17 20:56:47 -07:00
1 parent 39287a5622
commit df0e245f4b
6 files changed
+26 -16

No files matched your search

+7 -1
View File
@@ -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<IonBlaster>() || player.ActiveItem().type == ModContent.ItemType<ApoctosisArray>())
return false;
}
return true;
}
#endregion
+2 -2
View File
@@ -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;
@@ -64,6 +64,7 @@ ApoctosisArray: {
Press <right> 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 <right> 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
'''
}
+12 -8
View File
@@ -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<ApoctosisBlast>(), (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
{
+2 -4
View File
@@ -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 _);
+1 -1
View File
@@ -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