Another Grab Bag of Various Changes and Fixes

Functional Changes:
- Ontological Despoiler Negative charge 2 takes longer and deals more damage
- Polaris Parrotfish's fire rate now scales with distance to the enemy and is not capped at two shots on screen at a time. various stats like range and damage were adjusted
- Sprouting arrows velocity is now unaffected by bow shoot velocity, this fixes some issues high velocity bows has with these arrows
- Cinder arrow shards fly out further and the arrow itself now inflicts brimflames

Fixed The first dash hitbox of Slagsplitter dealing less damage than intended
Fixed Telluric Glare firing normal arrows from far behind it
(Hopefully) Fixed Holy Collider being able to fit spawned flares as they spawn when you have low melee speed.

Non-functional Changes:
- Visuals for Polaris Parrotfish, Sprouting Arrows, Hyperius Bullets, Holy Collider, Slagsplitter Pauldron, and Cinder Arrows. tiny visual change for Earth Meteors and screenshake for artifact of resilience. new Sounds for Slagsplitter Pauldron and sound overhaul for Ontological Despoiler.
This commit is contained in:
Xyk committed 2025-01-04 21:06:23 -08:00
1 parent 0cc6724ebf
commit becf7b3d59
22 files changed
+179 -120

No files matched your search

+3 -4
View File
@@ -287,13 +287,13 @@ namespace CalamityMod.CalPlayer
{
if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal)
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(170);
Player.endurance += 0.1f;
if (!HasReducedDashFirstFrame) // Dash isn't reduced, this is used to determine the first frame of dashing
{
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f, PitchVariance = 0.4f }, Player.Center);
int damage = (int)Player.GetBestClassDamage().ApplyTo(67);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 16f, Player.whoAmI);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 0, Player.whoAmI);
HasReducedDashFirstFrame = true;
}
float numberOfDusts = 10f;
@@ -319,8 +319,7 @@ namespace CalamityMod.CalPlayer
if (Player.miscCounter % 6 == 0 && Player.velocity != Vector2.Zero)
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(170);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 10f, Player.whoAmI);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 0, Player.whoAmI);
}
}
else
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged
internal static readonly int ChargeLoopSoundFrames = 151;
public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot");
public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot");
public static readonly SoundStyle BigShot2 = new("CalamityMod/Sounds/Item/OntologicalDespoilerLargeShot");
public static readonly SoundStyle SmallImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1");
public static readonly SoundStyle LargeImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2");
+12 -18
View File
@@ -14,10 +14,9 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public int SetUseTime = 6;
public int SetUseAnimation = 6;
public int ShotNumber = 0;
public bool Happy = false;
public float fireSpeed = 1;
public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/PolarisShot") { Volume = 0.6f };
public static readonly SoundStyle Squeak = new("CalamityMod/Sounds/Custom/CuteSqueak") { Volume = 0.75f };
@@ -31,11 +30,11 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Item.width = 38;
Item.height = 34;
Item.damage = 46;
Item.damage = 35;
Item.DamageType = DamageClass.Ranged;
Item.useTime = SetUseTime;
Item.useAnimation = SetUseAnimation;
Item.useTime = 9;
Item.useAnimation = 9;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
@@ -48,7 +47,6 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.shootSpeed = 10f;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 2; // Max of 2 shots on screen at once, get closer to fire faster
public override bool AltFunctionUse(Player player) => Main.zenithWorld ? true : false;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
@@ -116,17 +114,6 @@ namespace CalamityMod.Items.Weapons.Ranged
}
else
{
if (Happy) // If she's happy, fire much faster
{
Item.useTime = (int)(SetUseTime * 0.5f);
Item.useAnimation = (int)(SetUseAnimation * 0.5f);
}
else // Otherwise reset usetime
{
Item.useTime = SetUseTime;
Item.useAnimation = SetUseAnimation;
}
if (Main.zenithWorld) // 1% chance to get tired when firing a projectile
{
if (Happy && Main.rand.NextBool(100))
@@ -141,7 +128,8 @@ namespace CalamityMod.Items.Weapons.Ranged
else
SoundEngine.PlaySound(Shot, player.Center);
Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f), ModContent.ProjectileType<PolarStar>(), damage, knockback, player.whoAmI, 0f, ShotNumber);
for (int i = 0; i < (Happy ? 3 : 1); i++)
Projectile.NewProjectile(source, position + velocity * 5f, velocity.RotatedByRandom(0.05f * (i != 0 ? 6 : 1)), ModContent.ProjectileType<PolarStar>(), damage, knockback, player.whoAmI, 0f, ShotNumber);
if (ShotNumber >= 2) // Cycle the shot color
ShotNumber = 0;
@@ -150,5 +138,11 @@ namespace CalamityMod.Items.Weapons.Ranged
}
return false;
}
public override float UseSpeedMultiplier(Player player)
{
NPC target = player.Center.ClosestNPCAt(400);
fireSpeed = (target == null ? 1 : Utils.Remap(Utils.Distance(player.Center, target.Center), 100, 400, 2, 1, true));
return (Happy ? fireSpeed * 2 : fireSpeed);
}
}
}
+1 -4
View File
@@ -74,9 +74,6 @@ namespace CalamityMod.Items.Weapons.Ranged
}
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
// Always fires Radiant Arrows regardless of ammo used
//type = Item.shoot;
// The arrow appears from a random location "on the bow".
// They are also moved backwards so that they have some time to build up past positions. This helps make them not appear out of thin air.
@@ -95,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Ranged
SoundEngine.PlaySound(sound with { Volume = 0.25f, Pitch = Main.rand.NextFloat(-0.3f, -0.8f), MaxInstances = -1 }, player.Center);
type = Item.shoot;
}
Projectile.NewProjectile(source, position, velocity, type, (isHolyArrow ? (int)(damage * 1.2f) : damage), knockback, player.whoAmI);
Projectile.NewProjectile(source, (isHolyArrow || shots % 2 == 0) ? position : player.Center + velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90)) * Main.rand.NextFloat(-15, 15), velocity, type, (isHolyArrow ? (int)(damage * 1.2f) : damage), knockback, player.whoAmI);
shots++;
return false;
}
@@ -954,14 +954,14 @@ PolarisParrotfish: {
Tooltip: "[GFB]"
TooltipNormal:
'''
Rapidly fires an array of colorful star shots that bounce off tiles
However, only two shots can exist at once
Rapidly fires an array of colorful star shots
Firing speed increases the closer you are to an enemy
'It carries the mark of the Northern Star'
'''
TooltipGFB:
'''
Rapidly fires an array of colorful star shots that bounce off tiles
However, only two shots can exist at once
Rapidly fires an array of colorful star shots
Firing speed increases the closer you are to an enemy
Right click to give the little girl some attention
'She is a happy girl'
'''
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

+11 -2
View File
@@ -11,6 +11,7 @@ using CalamityMod.Items.Weapons.Ranged;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Particles;
using Terraria.Graphics.Renderers;
using CalamityMod.Dusts;
namespace CalamityMod.Projectiles.Melee
{
@@ -89,6 +90,14 @@ namespace CalamityMod.Projectiles.Melee
}
if (time == fallTime)
{
for (int i = 0; i < 2; i++)
{
Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), 0, 0.8f, 0f, 27);
GeneralParticleHandler.SpawnParticle(bloom);
}
Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), 0, 0.65f, 0f, 27);
GeneralParticleHandler.SpawnParticle(bloom3);
Projectile.extraUpdates = 15;
Vector2 mouse = Owner.ClampedMouseWorld();
@@ -121,10 +130,10 @@ namespace CalamityMod.Projectiles.Melee
float randSize = Main.rand.NextFloat(0.8f, 1.2f);
for (int i = 0; i < 2; i++)
{
Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * Utils.Remap(time, 0, fallTime, 0, 0.65f), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 3), Utils.Remap(time, fallTime * 0.7f, fallTime, 1, 2)), 0, 0.8f * randSize, 0f, 3);
Particle bloom = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * (float)Math.Pow(Utils.Remap(time, 0, fallTime, 0f, 1f), 3), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 4), Utils.Remap(time, fallTime * 0.6f, fallTime, 1, 4)), 0, 0.8f * randSize, 0f, 3);
GeneralParticleHandler.SpawnParticle(bloom);
}
Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * Utils.Remap(time, 0, fallTime, 0f, 0.65f), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 3), Utils.Remap(time, fallTime * 0.7f, fallTime, 1, 2)), 0, 0.65f * randSize, 0f, 3);
Particle bloom3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * (float)Math.Pow(Utils.Remap(time, 0, fallTime, 0f, 1f), 3), "CalamityMod/Particles/LargeBloom", new Vector2(Utils.Remap(time, 0, fallTime, 0.3f, 4), Utils.Remap(time, fallTime * 0.6f, fallTime, 1, 4)), 0, 0.65f * randSize, 0f, 3);
GeneralParticleHandler.SpawnParticle(bloom3);
}
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
+3 -3
View File
@@ -400,14 +400,14 @@ namespace CalamityMod.Projectiles.Melee
for (int i = 0; i < 4; i++)
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 278);
Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2().RotatedBy(starAngle) * 8f;
Vector2 vel = (MathHelper.TwoPi * i / 4f).ToRotationVector2().RotatedBy(starAngle) * 4f;
Particle pulse = new GlowSparkParticle(target.Center, vel, false, 12, 0.1f, Color.Orange, new Vector2(3.2f, 0.9f), true, true, 0.85f);
Particle pulse = new CustomSpark(target.Center, vel, "CalamityMod/Particles/BloomCircle", false, 12, 1.2f, Color.Orange, new Vector2(3.2f, 0.9f), true, true, shrinkSpeed: 0.95f);
GeneralParticleHandler.SpawnParticle(pulse);
}
for (int i = 0; i < 4; i++)
{
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -13).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType<HolyColliderHolyFire>(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI);
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType<HolyColliderHolyFire>(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI);
}
}
}
+5 -1
View File
@@ -125,7 +125,11 @@ namespace CalamityMod.Projectiles.Melee
dust.color = Color.Goldenrod;
dust.noLightEmittence = true;
}
Projectile.velocity *= 0.965f;
if (Projectile.velocity.Length() > 8)
Projectile.velocity *= 0.88f;
else
Projectile.velocity *= 0.965f;
}
Projectile.frameCounter++;
+18 -19
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -51,14 +52,15 @@ namespace CalamityMod.Projectiles.Ranged
if (splitShot)
{
Projectile.scale = 0.01f;
Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.15f);
if (Main.rand.NextBool(4))
if (Main.rand.NextBool(9))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f));
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType<LightDust>(), -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.65f, 0.85f);
dust.noLight = true;
dust.scale = Main.rand.NextFloat(0.35f, 0.85f);
dust.noLightEmittence = true;
dust.color = Color.Lerp(Color.Red, Color.Crimson, Main.rand.NextFloat(0.3f, 0.8f));
}
}
else
@@ -66,17 +68,17 @@ namespace CalamityMod.Projectiles.Ranged
Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.3f);
if (Time > 4f && Main.rand.NextBool(3))
{
float velMulti = Main.rand.NextFloat(0.1f, 0.75f);
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(0.45) * velMulti);
float velMulti = Main.rand.NextFloat(0.05f, 0.35f);
Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType<LightDust>(), -Projectile.velocity.RotatedBy(0.45) * velMulti);
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.45f, 0.75f);
dust.noLight = true;
dust.color = Color.Crimson;
dust.noLightEmittence = true;
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity.RotatedBy(-0.45) * velMulti);
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, ModContent.DustType<LightDust>(), -Projectile.velocity.RotatedBy(-0.45) * velMulti);
dust2.noGravity = true;
dust2.scale = Main.rand.NextFloat(0.45f, 0.75f);
dust2.noLight = true;
dust2.noLightEmittence = true;
dust2.color = Color.Crimson;
}
}
}
@@ -91,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged
for (int i = 0; i < Dusts; i++)
{
Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i).RotatedBy(0.5f) * 6.5f;
Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f),Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-1, 1), true);
Particle smoke = new HeavySmokeParticle(Projectile.Center, dustVelocity * Main.rand.NextFloat(1f, 2.6f), Color.Crimson, 18, Main.rand.NextFloat(0.9f, 1.6f), 0.35f, Main.rand.NextFloat(-0.3f, 0.3f), true);
GeneralParticleHandler.SpawnParticle(smoke);
}
SoundEngine.PlaySound(SoundID.Item69 with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center);
@@ -101,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged
for (int b = 0; b < 3; b++)
{
Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-3.5f, -3f);
Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-5.5f, -4.5f);
Projectile shrapnel = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<CinderArrowProj>(), (int)(Projectile.damage * 0.06f), 0f, Projectile.owner, ai2: 1f);
shrapnel.timeLeft = 300;
shrapnel.arrow = false;
@@ -116,24 +118,21 @@ namespace CalamityMod.Projectiles.Ranged
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (splitShot)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
}
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), splitShot ? 180 : 90);
}
public override bool PreDraw(ref Color lightColor)
{
if (splitShot)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/DrainLine").Value;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson * 0.3f, 1, texture);
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSpark").Value;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson with { A = 0 } * 0.6f, 1, texture, true, true);
return false;
}
else
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/BloodfireBulletProj").Value;
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/DrainLineBloom").Value;
if (Time > 6f)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White * 0.3f, 1, texture);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Crimson with { A = 0 } * 0.4f, 1, texture, true, true);
return true;
}
}
+23 -9
View File
@@ -1,7 +1,9 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,7 +16,8 @@ namespace CalamityMod.Projectiles.Ranged
public float dustAngle = 0f;
public bool growing = false;
public bool dustWave = false;
public float variance;
public float variance = 0.8f;
public Vector2 lastPos;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 10;
@@ -41,12 +44,13 @@ namespace CalamityMod.Projectiles.Ranged
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
variance = Main.rand.NextFloat(0.3f, 1.7f);
if (currentColor == Color.Black)
{
variance = Main.rand.NextFloat(0.7f, 1f);
dustWave = Main.rand.NextBool();
Projectile.scale = 1.5f;
Projectile.velocity *= 0.3f;
lastPos = Projectile.velocity;
switch (Main.rand.Next(0, 4 +1))
{
case 4: // Yellow shot
@@ -77,14 +81,22 @@ namespace CalamityMod.Projectiles.Ranged
dustAngle += (growing ? 0.07f * variance : -0.07f * variance);
Projectile.localAI[0] += 1f;
Vector2 orbPos = Projectile.Center + (Projectile.velocity.RotatedBy((dustWave ? 1 : -1) * dustAngle) * 4.5f - Projectile.velocity * 5);
if (Projectile.localAI[0] > 12f && targetDist < 1200f)
{
GlowOrbParticle orb = new GlowOrbParticle((Projectile.Center + Projectile.velocity.RotatedBy((dustWave ? 1 : -1) * dustAngle) * 4.5f) - Projectile.velocity * 5, Vector2.Zero, false, 5, 0.55f + MathF.Abs(dustAngle * 0.5f), currentColor, true, true);
CustomSpark orb = new CustomSpark(orbPos, Utils.DirectionTo(lastPos, orbPos), "CalamityMod/Particles/BloomCircle", false, 5, (0.55f + MathF.Abs(dustAngle * 0.65f)) * 0.2f, currentColor, new Vector2(1 + MathF.Abs(dustAngle * 0.6f), 1), true, true, 0, false, false, 0.8f - MathF.Abs(dustAngle * 0.7f), 0.7f, 0.8f);
GeneralParticleHandler.SpawnParticle(orb);
PointParticle spark = new PointParticle(Projectile.Center + Projectile.velocity * 3.5f, Projectile.velocity, false, 2, 0.6f, currentColor);
GeneralParticleHandler.SpawnParticle(spark);
if (Main.rand.NextBool(7))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<LightDust>(), Projectile.velocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 1.3f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.5f, 0.8f);
dust.color = currentColor;
dust.noLightEmittence = true;
}
}
lastPos = orbPos;
}
// This projectile is always fullbright.
@@ -108,7 +120,8 @@ namespace CalamityMod.Projectiles.Ranged
{
for (int b = 0; b < 3; b++)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -oldVelocity.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType<HyperiusSplit>(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1));
Vector2 vel = (-oldVelocity.SafeNormalize(Vector2.UnitX) * 5);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType<HyperiusSplit>(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1));
}
}
return true;
@@ -129,7 +142,7 @@ namespace CalamityMod.Projectiles.Ranged
{
for (int b = 0; b < 3; b++)
{
Vector2 velocity = Projectile.velocity.RotatedByRandom(0.5f);
Vector2 velocity = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5).RotatedByRandom(0.5f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType<HyperiusSplit>(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 2f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1));
}
}
@@ -137,13 +150,14 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/ShadowboltWallHit") with { Volume = 0.25f, Pitch = Main.rand.NextFloat(0.6f, 1f), MaxInstances = -1 }, Projectile.Center);
for (int b = 0; b < 4; b++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 66, new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f));
Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType<LightDust>(), new Vector2(4, 4).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.7f, 1.4f);
dust.color = currentColor;
dust.fadeIn = 0;
dust.noLightEmittence = true;
}
}
}
+3 -13
View File
@@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.localAI[0]++;
if (currentColor == Color.Black)
{
Projectile.scale = 0.025f;
Projectile.scale = 0.015f;
Projectile.alpha = 255;
rotDirection = Main.rand.NextBool() ? 1 : -1;
rotIntensity = Main.rand.NextFloat(0.5f, 1.5f);
@@ -87,13 +87,6 @@ namespace CalamityMod.Projectiles.Ranged
{
for (int b = 0; b < 2; b++)
{
/*
Dust dust = Dust.NewDustPerfect(Projectile.Center, 66, new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.5f, 1.1f);
dust.color = currentColor;
dust.fadeIn = 0;
*/
GlowOrbParticle orb = new GlowOrbParticle(Projectile.Center, new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.5f), false, 5, Main.rand.NextFloat(0.35f, 0.45f), currentColor, true, true);
GeneralParticleHandler.SpawnParticle(orb);
}
@@ -101,12 +94,9 @@ namespace CalamityMod.Projectiles.Ranged
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 12, targetHitbox);
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/LargeBloom").Value;
Texture2D texture2 = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSpark").Value;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(currentColor, Color.White, 0.15f), 1, texture);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.White with { A = 0 }, 1, texture2);
//Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, Color.White, 0, texture.Size() * 0.5f, Projectile.scale * 1.5f, 0, 0f);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(currentColor, Color.White, 0.15f) with { A = 0 }, 1, texture, true, true);
return false;
}
public override bool? CanDamage() => Projectile.localAI[0] < 20 ? false : null;
@@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged
public int MaxLoadableShots = 23;
public float BulletSpeed = 6.5f;
public SlotId OntologicalChargeSlot;
public SlotId OntologicalChargeSlotDeep;
public int Time = 0;
public ref float CurrentChargingFrames => ref Projectile.ai[0];
@@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Ranged
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying)
ChargeSound.Position = Projectile.Center;
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound6) && ChargeSound6.IsPlaying)
ChargeSound6.Position = Projectile.Center;
if (Owner.shirtColor != Color.White)
{
@@ -188,6 +191,8 @@ namespace CalamityMod.Projectiles.Ranged
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound3))
ChargeSound3?.Stop();
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound4))
ChargeSound4?.Stop();
KeepRefreshingLifetime = false;
@@ -203,18 +208,20 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed;
int charge2DamagePos = Projectile.damage; // Most of the damage comes from the explosion
int charge2DamageNeg = Projectile.damage * 28;
int charge2DamageNeg = Projectile.damage * 40; // Big charge time? Check. No pierce? Check. 40x damage? Yes!
if (Positive)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 2.5f, ModContent.ProjectileType<OntologicalDespoilerGrenade>(), charge2DamagePos, Projectile.knockBack, Projectile.owner);
SoundEngine.PlaySound(OntologicalDespoiler.BigShot, Projectile.Center);
}
else
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * 0.6f, ModContent.ProjectileType<OntologicalDespoilerBeam>(), charge2DamageNeg, Projectile.knockBack * 3, Projectile.owner);
Owner.Calamity().GeneralScreenShakePower = 12f;
SoundEngine.PlaySound(OntologicalDespoiler.BigShot2 with { Pitch = 0.2f }, Projectile.Center);
SoundEngine.PlaySound(OntologicalDespoiler.BigShot with { Pitch = -0.3f }, Projectile.Center);
}
SoundEngine.PlaySound(OntologicalDespoiler.BigShot, Projectile.position);
// Setting stats for the flash visual effect so it doesn't stick to the gun
flashPos = GunTipPosition + Projectile.velocity * 90;
@@ -271,7 +278,9 @@ namespace CalamityMod.Projectiles.Ranged
}
}
SoundEngine.PlaySound(OntologicalDespoiler.SmallShot, Projectile.position);
SoundEngine.PlaySound(OntologicalDespoiler.SmallShot with { Pitch = Positive ? 0 : -0.2f, MaxInstances = Positive ? 1 : -1, Volume = Positive ? 1 : 0.5f }, Projectile.Center);
if (!Positive)
SoundEngine.PlaySound(MagnaCannon.Fire with { Pitch = 0.3f, Volume = 0.5f }, Projectile.Center);
for (int i = 0; i < 3; i++)
{
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, !Positive ? (Main.rand.NextBool() ? ModContent.DustType<VoidDustInverted>() : ModContent.DustType<VoidDust>()) : ModContent.DustType<LightDust>(), shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.3f, 2.3f));
@@ -296,7 +305,7 @@ namespace CalamityMod.Projectiles.Ranged
if (ChargeLV1)
ShotsLoaded = MaxLoadableShots;
CurrentChargingFrames += ((ChargeLV1 && !Positive) ? 1f : 2) * (Owner.Calamity().despoilerNerf ? 0.4f : 1); // Charges slower if nerfed, charge LV2 for Negative is slower
CurrentChargingFrames += ((ChargeLV1 && !Positive) ? 0.5f : 2) * (Owner.Calamity().despoilerNerf ? 0.4f : 1); // Charges slower if nerfed, charge LV2 for Negative is slower
// Sounds
if (!hasBegunFiring)
@@ -308,6 +317,14 @@ namespace CalamityMod.Projectiles.Ranged
}
else
OntologicalChargeSlot = SoundEngine.PlaySound(OntologicalDespoiler.ChargeLoop with { Volume = 0.01f, Pitch = 0f, IsLooped = true }, Projectile.Center);
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound5))
{
ChargeSound5.Volume = Positive ? 0 : Utils.Remap(CurrentChargingFrames, Charge1Frames, Charge2Frames, 0, 1.8f, true) * 100;
ChargeSound5.Pitch = Utils.Remap(CurrentChargingFrames, Charge2Frames * 0.9f, Charge2Frames, 1f, (CurrentChargingFrames >= Charge2Frames ? -0.1f : 0.2f), true);
}
else
OntologicalChargeSlotDeep = SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MagnaCannonChargeLoop") with { Volume = 0.01f, Pitch = 0f, IsLooped = true }, Projectile.Center);
}
// Charge-up visuals
@@ -400,6 +417,8 @@ namespace CalamityMod.Projectiles.Ranged
{
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlot, out var ChargeSound))
ChargeSound?.Stop();
if (SoundEngine.TryGetActiveSound(OntologicalChargeSlotDeep, out var ChargeSound2))
ChargeSound2?.Stop();
}
public Color GetRandomColor()
{
@@ -189,8 +189,8 @@ namespace CalamityMod.Projectiles.Ranged
GeneralParticleHandler.SpawnParticle(orb2);
}
}
SoundStyle fire = OntologicalDespoiler.SmallImpact;
SoundEngine.PlaySound(fire with { Volume = (!Positive ? 1 : 0.7f), Pitch = Main.rand.NextFloat(0, 0.1f) * (!Positive ? 3 : 1) }, Projectile.Center);
SoundStyle fire = Positive ? new SoundStyle("CalamityMod/Sounds/Item/OntologicalDespoilerSmallImpact") : OntologicalDespoiler.SmallImpact; // Yes these are two different sounds...
SoundEngine.PlaySound(fire with { Volume = (!Positive ? 1 : 0.3f), Pitch = Main.rand.NextFloat(0.05f, 0.15f) * (!Positive ? 3 : 5), MaxInstances = !Positive ? 1 : 6 }, Projectile.Center);
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
+10 -7
View File
@@ -29,11 +29,12 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.friendly = true;
Projectile.penetrate = -1; // Only hits once, "pierces" so that it can last a bit after hitting
Projectile.extraUpdates = 2;
Projectile.timeLeft = 40;
Projectile.timeLeft = 60;
Projectile.DamageType = DamageClass.Ranged;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.tileCollide = true;
Projectile.ArmorPenetration = 15;
}
public override void AI()
@@ -84,15 +85,15 @@ namespace CalamityMod.Projectiles.Ranged
dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.01f, 0.045f);
}
if (Projectile.timeLeft % 2 == 0 && Time > 4 && DoSlowdown) // Particle trail
if (Time > 4 && DoSlowdown) // Particle trail
{
PointParticle spark = new PointParticle(Projectile.Center - Projectile.velocity * 1f, -Projectile.velocity * 0.01f, false, 7, 2f, EffectsColor * 0.6f);
Particle spark = new CustomSpark(Projectile.Center - Projectile.velocity * 3f, -Projectile.velocity * 0.01f, "CalamityMod/Particles/BloomLineFade", false, 6, 0.04f, EffectsColor * 0.8f, new Vector2(0.8f, 1), shrinkSpeed: 0.4f);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Projectile.timeLeft <= 2 && DoSlowdown)
{
Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close
Projectile.timeLeft = 7;
Projectile.velocity = Vector2.Zero;
DoSlowdown = false;
}
@@ -109,7 +110,7 @@ namespace CalamityMod.Projectiles.Ranged
{
if (DoSlowdown)
{
Projectile.timeLeft = Main.zenithWorld ? 3 : 7; // Adds extra projectile time on hit so that you can only fire faster if you're quite close
Projectile.timeLeft = 7;
Projectile.velocity = Vector2.Zero;
DoSlowdown = false;
}
@@ -123,8 +124,10 @@ namespace CalamityMod.Projectiles.Ranged
for (int k = 0; k < points; k++)
{
Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f);
PointParticle spark = new PointParticle((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, false, 13, 1.2f, EffectsColor);
GeneralParticleHandler.SpawnParticle(spark);
//PointParticle spark = new PointParticle((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, false, 13, 1.2f, EffectsColor);
//GeneralParticleHandler.SpawnParticle(spark);
Particle spark3 = new CustomSpark((Projectile.Center + velocity * 7.5f) + addedPlacement, velocity * 2.5f, "CalamityMod/Particles/BloomLineFade", false, 13, 0.02f, EffectsColor * 0.8f, new Vector2(2.8f, 1), shrinkSpeed: 0.5f);
GeneralParticleHandler.SpawnParticle(spark3);
}
}
public override bool? CanDamage() => Projectile.numHits > 1 ? false : null;
+11 -11
View File
@@ -1,9 +1,11 @@
using CalamityMod.Particles;
using System;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.GameContent.Animations.IL_Actions.Sprites;
namespace CalamityMod.Projectiles.Ranged
{
@@ -22,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.arrow = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 35;
Projectile.extraUpdates = 8;
Projectile.extraUpdates = 80;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
@@ -35,9 +37,10 @@ namespace CalamityMod.Projectiles.Ranged
if (Projectile.ai[0] == 0)
{
Projectile.damage = (int)(Projectile.damage * 0.3f);
Projectile.velocity *= 0.25f;
LineParticle spark = new LineParticle(Projectile.Center + Projectile.velocity * 4, Projectile.velocity * 4.95f, false, 9, 2.4f, Color.LimeGreen);
GeneralParticleHandler.SpawnParticle(spark);
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5;
Particle orb2 = new CustomSpark(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 86, Projectile.velocity * 0.1f, "CalamityMod/Particles/BloomArrow", false, 9, 0.7f, Main.rand.NextBool() ? Color.LimeGreen : Color.Lime, new Vector2(0.5f, 4f), true, true, shrinkSpeed: Main.rand.NextFloat(0.1f, 0.3f), glowCenterScale: 0.95f, glowOpacity: 0.8f);
GeneralParticleHandler.SpawnParticle(orb2);
}
Projectile.ai[0]++;
@@ -51,6 +54,8 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 vel1 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(0.015f, 0.04f));
Vector2 vel2 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(-0.015f, -0.04f));
Particle sparker = new CustomSpark(Projectile.Center, Projectile.velocity.RotatedByRandom(0.9f) * 0.01f, "CalamityMod/Particles/FullStar", false, 10, Main.rand.NextFloat(0.8f, 1.1f) * (hitDirect ? 4 : 2), Color.LimeGreen, new Vector2(1f, 0.5f), true, true, shrinkSpeed: 1f, glowCenterScale: 0.8f, glowOpacity: 0.8f);
GeneralParticleHandler.SpawnParticle(sparker);
Projectile split1 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel1 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType<SproutingArrowSplit>(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f);
Projectile split2 = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel2 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType<SproutingArrowSplit>(), Projectile.damage * 2, 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f);
if (Projectile.Calamity().conditionalHomingRange > 0f) // Allows the split arrows to home when using Arterial Assault as well
@@ -58,16 +63,11 @@ namespace CalamityMod.Projectiles.Ranged
split1.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange;
split2.Calamity().conditionalHomingRange = Projectile.Calamity().conditionalHomingRange;
}
PointParticle spark = new PointParticle(Projectile.Center - Projectile.velocity + Projectile.velocity.RotatedBy(2.3f), Projectile.velocity.RotatedBy(2.3f) * 0.5f, false, 5, 1.1f, Color.LimeGreen);
GeneralParticleHandler.SpawnParticle(spark);
PointParticle spark2 = new PointParticle(Projectile.Center - Projectile.velocity + Projectile.velocity.RotatedBy(-2.3f), Projectile.velocity.RotatedBy(-2.3f) * 0.5f, false, 5, 1.1f, Color.LimeGreen);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.timeLeft <= 4)
if (Projectile.timeLeft <= 6)
{
hitDirect = true;
SoundEngine.PlaySound(SoundID.Item53 with { Pitch = 0.9f, Volume = 0.4f }, Projectile.Center);
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Ranged
Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.25f);
if (Projectile.alpha > 0)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 264, Projectile.velocity.RotatedByRandom(0.4) * Main.rand.NextFloat(0.05f, 0.3f));
Dust dust = Dust.NewDustPerfect(Projectile.Center, 264, Projectile.velocity.RotatedByRandom(0.6) * Main.rand.NextFloat(0.05f, 1.5f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.8f, 1.3f);
dust.color = Main.rand.NextBool(3) ? Color.MediumAquamarine : Color.Lime;
@@ -135,7 +135,8 @@ namespace CalamityMod.Projectiles.Typeless
int projNum = Owner.ownedProjectileCounts[ModContent.ProjectileType<ArtifactOfResilienceShards>()] - 4;
Projectile.velocity = ((MathHelper.TwoPi * Projectile.ai[2] / projNum).ToRotationVector2()) * 15 * speedMult;
Owner.Calamity().GeneralScreenShakePower = 5f;
if (Projectile.ai[2] == 1)
{
SoundStyle boom = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianShieldDeactivate");
+36 -11
View File
@@ -1,5 +1,6 @@
using System;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -35,29 +36,53 @@ namespace CalamityMod.Projectiles.Typeless
{
target.AddBuff(BuffID.OnFire3, 240);
target.AddBuff(ModContent.BuffType<Buffs.StatDebuffs.ArmorCrunch>(), 300);
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 0.6f, PitchVariance = 0.4f }, Projectile.Center);
for (int i = 0; i <= 8; i++)
SoundStyle sound = new("CalamityMod/Sounds/Item/HolyColliderProjectileHit");
SoundEngine.PlaySound(sound with { Volume = 0.4f, Pitch = 0.15f }, Projectile.Center);
SoundStyle sound2 = new("CalamityMod/Sounds/Item/MagicRockImpact");
SoundEngine.PlaySound(sound2 with { Volume = 0.6f, Pitch = 0.35f }, Projectile.Center);
for (int i = 0; i <= 12; i++)
{
Dust dust = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -2).RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(2f, 4.5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f));
dust.noGravity = false;
}
for (int i = 0; i <= 5; i++)
{
Dust dust2 = Dust.NewDustPerfect(target.Center, Main.rand.NextBool() ? 174 : 127, new Vector2(0, -3).RotatedByRandom(MathHelper.ToRadians(8f)) * Main.rand.NextFloat(1f, 5f), 0, default, Main.rand.NextFloat(2.8f, 3.4f));
float variance = Main.rand.NextFloat(-0.7f, 0.7f);
int dustStyle = ModContent.DustType<LightDust>();
Dust dust2 = Dust.NewDustPerfect(target.Center, dustStyle, Projectile.velocity);
dust2.scale = (Main.rand.NextFloat(1.1f, 1.3f) - Math.Abs(variance)) * 2.5f;
dust2.velocity = (Vector2.UnitY * -18).RotatedBy(variance) * Main.rand.NextFloat(0.7f, 1f) * (1 - Math.Abs(variance) * 1.3f);
dust2.color = Main.rand.NextBool() ? Color.Orange : Color.OrangeRed;
dust2.noGravity = false;
Particle spark = new SparkParticle(Projectile.Center, new Vector2(17, 17).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 1f), true, 55, 0.85f, Main.rand.NextBool() ? Color.Orange : Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark);
}
float baseRot = Main.rand.NextFloat(-9f, 9f);
for (int i = 0; i < 5; i++)
{
float rot = Main.rand.NextFloat(-0.3f, 0.3f);
for (int b = 0; b < 2; b++)
{
Vector2 pulseVel = new Vector2(0, Main.rand.NextFloat(-7, -9)).RotatedBy(i * (MathHelper.ToRadians(360f) / 5)).RotatedBy(rot + baseRot + 0.9f);
Particle orb = new CustomPulse(target.Center, pulseVel, (Main.rand.NextBool() ? Color.Orange : Color.OrangeRed) * 0.9f, "CalamityMod/Projectiles/Summon/RustyBeaconPulse", Vector2.One, pulseVel.ToRotation(), 0.2f, Main.rand.NextFloat(0.55f, 0.85f) * 3f, Main.rand.Next(14, 19 + 1));
GeneralParticleHandler.SpawnParticle(orb);
}
Particle orb2 = new CustomSpark(target.Center, new Vector2(0, -7).RotatedBy(i * (MathHelper.ToRadians(360f) / 5)).RotatedBy(rot + baseRot), "CalamityMod/Particles/BloomLineFade", false, 13, 0.095f, Main.rand.NextBool() ? Color.Orange : Color.OrangeRed, new Vector2(2.9f, 0.5f), shrinkSpeed: 0.9f);
GeneralParticleHandler.SpawnParticle(orb2);
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<PauldronExplosion>(), Projectile.damage / 2, 15f, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<PauldronExplosion>(), Projectile.damage / 2, 0, Projectile.owner);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
public override bool? CanDamage() => base.CanDamage();
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.HitDirectionOverride = Math.Sign(Owner.direction);
Owner.Calamity().GeneralScreenShakePower = 4f;
for (int i = 0; i < 2; i++)
{
Particle bloom = new CustomSpark(target.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 20, 1.2f, Color.OrangeRed, new Vector2(1, 1), true, true, glowCenterScale: 0.7f, glowOpacity: 0.8f);
GeneralParticleHandler.SpawnParticle(bloom);
}
}
public override bool? CanCutTiles() => false;
}
}
+10 -6
View File
@@ -30,24 +30,28 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.timeLeft = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 240);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20);
GeneralParticleHandler.SpawnParticle(pulse2);
//Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.OrangeRed, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.8f, 1.1f), 20);
//GeneralParticleHandler.SpawnParticle(pulse);
//Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.DarkOrange, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0f, Main.rand.NextFloat(0.6f, 0.9f), 20);
//GeneralParticleHandler.SpawnParticle(pulse2);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
public override bool? CanDamage() => base.CanDamage();
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.HitDirectionOverride = Math.Sign(Owner.direction);
if (target.CanBeMoved(true))
{
// Custom knockback
Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 15;
target.velocity = launchVel * (target.knockBackResist == 0 ? 0.5f : 1f);
}
}
public override bool? CanCutTiles() => false;
Binary file not shown.
Binary file not shown.