let's not give these 600 tiles of range either

they still have like 120 it's probably enough
This commit is contained in:
Altixal committed 2023-10-16 09:08:41 +07:00
1 parent d4af8fef1d
commit 45be810abc
5 files changed
+38 -41

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.useTime = Item.useAnimation = 39;
Item.autoReuse = true;
Item.useAmmo = AmmoID.Gel;
Item.shootSpeed = 14.6f;
Item.shootSpeed = 12f;
Item.shoot = ModContent.ProjectileType<HalleysComet>();
Item.width = 84;
+22 -23
View File
@@ -14,40 +14,39 @@ namespace CalamityMod.Projectiles.Ranged
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref int HitCount => ref Main.player[Projectile.owner].Calamity().deadSunCounter;
public int Time = 0;
public int bounceKill = 0;
public bool Homing = false;
public Color color1 = Color.Turquoise;
public Color color2 = Color.Indigo;
public ref float Time => ref Projectile.ai[0];
public ref float BounceHits => ref Projectile.ai[1];
public Color InnerColor = Color.Turquoise;
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.width = Projectile.height = 16;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = 1;
Projectile.extraUpdates = 9;
Projectile.timeLeft = 440;
Projectile.MaxUpdates = 10;
Projectile.timeLeft = 15 * Projectile.MaxUpdates;
}
public override void AI()
{
Time++;
Lighting.AddLight(Projectile.Center, 0.117f, 0.155f, 0.159f);
Lighting.AddLight(Projectile.Center, InnerColor.ToVector3() * 0.2f);
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); //used for some drawing prevention for when it's offscreen since it makes a fuck load of particles
if (Projectile.timeLeft % 3 == 0 && Time > 12 && targetDist < 1400f)
if (Projectile.timeLeft % 3 == 0 && Time > 12f && targetDist < 1400f)
{
AltSparkParticle spark = new AltSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 2.3f, Color.Black);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Projectile.timeLeft % 2 == 0 && Time > 12 && targetDist < 1400f)
if (Projectile.timeLeft % 2 == 0 && Time > 12f && targetDist < 1400f)
{
SparkParticle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 0.9f, color1);
SparkParticle spark2 = new SparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 20, 0.9f, InnerColor);
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Time == 7)
if (Time == 7f)
{
for (int i = 0; i <= 18; i++)
{
@@ -57,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged
dust.noGravity = true;
}
}
if (Homing)
if (BounceHits > 0f)
{
for (int i = 0; i <= 2; i++)
{
@@ -73,7 +72,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
SoundEngine.PlaySound(DeadSunsWind.Explosion with { Pitch = HitCount * 0.05f }, Projectile.Center);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<DeadSunExplosion>(), Projectile.damage / 2, 4f, Projectile.owner, HitCount * 10, Homing ? 5 : 0);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<DeadSunExplosion>(), Projectile.damage / 2, 4f, Projectile.owner, HitCount * 10, BounceHits > 0f ? 5 : 0);
if (HitCount >= 15)
HitCount = 6;
else
@@ -82,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged
public override bool OnTileCollide(Vector2 oldVelocity)
{
Projectile.timeLeft = 440;
Projectile.timeLeft = 15 * Projectile.MaxUpdates;
float numberOfDusts = 25;
float rotFactor = 360f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
@@ -96,15 +95,15 @@ namespace CalamityMod.Projectiles.Ranged
dust.velocity = dust.type == 191 ? velOffset * 2.5f : velOffset;
dust.scale = dust.type == 191 ? Main.rand.NextFloat(0.9f, 1.9f) : Main.rand.NextFloat(2.6f, 3.2f);
}
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, color1, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (bounceKill * 0.25f), 25);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, InnerColor, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.1f, 0.9f - (BounceHits * 0.25f), 25);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.MediumSpringGreen, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.05f, 0.75f - (bounceKill * 0.25f), 25);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.MediumSpringGreen, new Vector2(1f, 1f), Main.rand.NextFloat(5, -5), 0.05f, 0.75f - (BounceHits * 0.25f), 25);
GeneralParticleHandler.SpawnParticle(pulse2);
Homing = true;
if (bounceKill == 0)
if (BounceHits == 0f)
SoundEngine.PlaySound(DeadSunsWind.Ricochet, Projectile.Center);
bounceKill++;
BounceHits++;
if (Projectile.velocity.X != oldVelocity.X)
{
Projectile.velocity.X = -oldVelocity.X;
@@ -113,7 +112,7 @@ namespace CalamityMod.Projectiles.Ranged
{
Projectile.velocity.Y = -oldVelocity.Y;
}
if (bounceKill == 4)
if (BounceHits >= 4f)
Projectile.Kill();
return false;
}
+12 -14
View File
@@ -13,7 +13,8 @@ namespace CalamityMod.Projectiles.Ranged
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public int Time = 0;
public ref float Time => ref Projectile.ai[0];
public override void SetDefaults()
{
Projectile.width = Projectile.height = 12;
@@ -21,29 +22,28 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = 5;
Projectile.extraUpdates = 10;
Projectile.timeLeft = 600;
Projectile.MaxUpdates = 10;
Projectile.timeLeft = 15 * Projectile.MaxUpdates;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation();
Time++;
if (Projectile.scale <= 1.5f)
{
Projectile.scale *= 1.01f;
}
if (Time > 6 && Time < 180)
if (Time > 6f)
{
SparkParticle spark = new SparkParticle(Projectile.Center, Projectile.velocity, false, 11, 1.9f, Color.MediumBlue);
GeneralParticleHandler.SpawnParticle(spark);
SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity, false, 11, 1f, Color.Aqua);
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Time == 5)
else if (Time == 5f)
{
Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.75f, Color.Aqua, new Vector2(1f, 2.5f), Projectile.velocity.ToRotation(), 0.4f, 0.05f, 20);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.75f, Color.Aqua, new Vector2(1f, 2.5f), Projectile.rotation, 0.4f, 0.05f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.4f, Color.DodgerBlue, new Vector2(1f, 2.5f), Projectile.velocity.ToRotation(), 0.2f, 0.05f, 35);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Projectile.velocity * 0.4f, Color.DodgerBlue, new Vector2(1f, 2.5f), Projectile.rotation, 0.2f, 0.05f, 35);
GeneralParticleHandler.SpawnParticle(pulse2);
for (int i = 0; i <= 25; i++)
{
@@ -54,9 +54,7 @@ namespace CalamityMod.Projectiles.Ranged
}
}
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.45f / 255f);
Projectile.rotation += 0.3f * (float)Projectile.direction;
Lighting.AddLight(Projectile.Center, Color.MediumBlue.ToVector3() * 0.4f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+2 -2
View File
@@ -46,10 +46,10 @@ namespace CalamityMod.Projectiles.Ranged
Particle smoke = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * 0.5f, smokeColor, 12, Projectile.scale * Main.rand.NextFloat(0.6f, 1.2f), 0.3f, smokeRot, true, required: true);
GeneralParticleHandler.SpawnParticle(smoke);
// Overlay the glow on top, shifted toward yellow
// Overlay a gold glow on top
if (Main.rand.NextBool(5))
{
Color glowColor = Color.Lerp(smokeColor, Color.Yellow, 0.5f);
Color glowColor = Color.Gold;
Particle smokeGlow = new HeavySmokeParticle(Projectile.Center, Projectile.velocity * 0.5f, glowColor, 9, Projectile.scale * Main.rand.NextFloat(0.4f, 0.7f), 0.2f, smokeRot, true, 0.005f);
GeneralParticleHandler.SpawnParticle(smokeGlow);
}
+1 -1
View File
@@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged
Color color = Color.Lerp(Color.Lime, Color.Cyan, colorInterpolation);
Vector2 drawPosition = Projectile.oldPos[i] + lightTexture.Size() * 0.5f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY) + new Vector2(-15f, -15f);
Color outerColor = color;
Color innerColor = Color.Lerp(color, Color.Yellow, 0.3f) * 0.5f;
Color innerColor = Color.Lerp(color, Color.Gold, 0.8f) * 0.5f;
float intensity = 0.9f + 0.15f * MathF.Cos(Main.GlobalTimeWrappedHourly % 60f * MathHelper.TwoPi);
// Become smaller the futher along the old positions we are.