Arsenal dusts and colors

Also changed Holofiber Immolator a bit
This commit is contained in:
Xyk committed 2025-03-21 18:40:50 -07:00
1 parent a19349cfbe
commit 1199cd3ac4
12 files changed
+372 -77

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquareDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
dust.rotation = Main.rand.NextFloat(-5, 5);
}
public override bool Update(Dust dust)
{
float fadeSpeed = (dust.fadeIn + 1);
float rotDir = Math.Sign(dust.rotation);
dust.rotation += 0.04f * dust.scale * rotDir;
dust.velocity *= 0.96f * fadeSpeed;
if (dust.noGravity)
dust.scale -= 0.045f * fadeSpeed;
else
{
dust.scale -= 0.03f * fadeSpeed;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSquareParticleThick").Value;
Vector2 squash = Vector2.One;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
}
return false;
}
}
}
+61
View File
@@ -0,0 +1,61 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
float fadeSpeed = (dust.fadeIn + 1);
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f * fadeSpeed;
if (dust.noGravity)
dust.scale -= 0.045f * fadeSpeed;
else
{
dust.scale -= 0.03f * fadeSpeed;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+61
View File
@@ -0,0 +1,61 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDustHollow : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
float fadeSpeed = (dust.fadeIn + 1);
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f * fadeSpeed;
if (dust.noGravity)
dust.scale -= 0.045f * fadeSpeed;
else
{
dust.scale -= 0.03f * fadeSpeed;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRing").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+69
View File
@@ -0,0 +1,69 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDustTileTouch : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
bool touchedTiles = false;
int size = (int)(2);
if (Collision.SolidCollision(dust.position, size, size))
{
touchedTiles = true;
dust.velocity = Vector2.Zero;
}
float fadeSpeed = (dust.fadeIn + 1); // For this dust, fadeIn is used to increase the power of gravity if it's active, otherwise it makes it's lifetime change
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f * (touchedTiles ? 0.4f : 1) * fadeSpeed;
else
{
dust.scale -= 0.03f * (touchedTiles ? 0.4f : 1);
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
if (!touchedTiles)
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using CalamityMod.CustomRecipes;
using CalamityMod.Dusts;
using CalamityMod.Items.Materials;
using CalamityMod.TileEntities;
using CalamityMod.Tiles.DraedonSummoner;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Effects
{
public class ArsenalEffects
{
public static int ArsenalDust = 278; // Colorable firework dust, simple and effective. Most visuals use a mix of the energy respective dust and this
// Plasma
public static int ArsenalPlamaDust = ModContent.DustType<SquashDustTileTouch>();
public static Color ArsenalPlamaColor = Color.Lerp(Color.Green, Color.Chartreuse, 0.35f);
// Laser
public static int ArsenalLaserDust = ModContent.DustType<SquashDust>();
public static Color ArsenalLaserColor = Color.Lerp(Color.Crimson, Color.Firebrick, 0.35f);
// Pulse
public static int ArsenalPulseDust = ModContent.DustType<SquashDustHollow>();
public static Color ArsenalPulseColor = Color.Lerp(Color.DarkOrchid, Color.Magenta, 0.35f);
// Electric
public static int ArsenalElectricDust = ModContent.DustType<LightDust>();
public static Color ArsenalElectricColor = Color.Lerp(Color.Aqua, Color.Aquamarine, 0.35f);
// Gauss
public static int ArsenalGaussDust = ModContent.DustType<SquareDust>();
public static Color ArsenalGaussColor = Color.Lerp(Color.Yellow, Color.Goldenrod, 0.35f);
}
}
@@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.shoot = ModContent.ProjectileType<HolofiberImmolatorHoldout>();
Item.shootSpeed = 12f;
//Item.useAmmo = AmmoID.Arrow;
modItem.UsesCharge = true;
modItem.MaxCharge = 85f;
modItem.ChargePerUse = 0.001f; // Charge depletion is done in the holdout, but it needs a small fee to prevent usage at 0%
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
+3
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
@@ -70,6 +71,8 @@ namespace CalamityMod.Items.Weapons.Ranged
ModContent.ProjectileType<DWArrow>(),
ModContent.ProjectileType<DrataliornusFlame>(),
ModContent.ProjectileType<FlareBat>(),
ModContent.ProjectileType<ImmolationArrow>(),
ModContent.ProjectileType<ImmolationSpray>(),
ModContent.ProjectileType<FeatherLarge>(),
ModContent.ProjectileType<SlimeStream>(), // Not ranged
ModContent.ProjectileType<ExoCrystalArrow>(),
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

@@ -19,12 +19,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public override float OffsetXUpwards => -0f;
public override float BaseOffsetY => -0f;
public override float OffsetYDownwards => 0f;
public override float WeaponTurnSpeed => 0.45f;
public static int FramesPerLoad = 13;
public static int MaxLoadableShots = 15;
public static float BulletSpeed = 12f;
public SlotId ChargeSlot;
public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f);
public int time = 0;
public ref float CurrentChargingFrames => ref Projectile.ai[0];
@@ -80,15 +78,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
for (int i = 0; i <= 25; i++)
{
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 267, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(0.5f, 1.3f));
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, Effects.ArsenalEffects.ArsenalPlamaDust, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(0.5f, 1.3f));
dust.noGravity = true;
dust.color = mainColor;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
CurrentChargingFrames = 0;
if (modItem.Charge > 0)
modItem.Charge -= 0.06f;
else
Projectile.Kill();
}
// Spread Fire mode
else
@@ -105,15 +99,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
for (int i = 0; i <= 4; i++)
{
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, 267, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(0.4f, 1.1f));
dust.noGravity = true;
dust.color = mainColor;
Dust dust = Dust.NewDustPerfect(GunTipPosition - Projectile.velocity * 15, Effects.ArsenalEffects.ArsenalPlamaDust, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(0.8f, 1.3f));
dust.noGravity = false;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
dust.fadeIn = 2;
}
CurrentChargingFrames = 0;
if (modItem.Charge > 0)
modItem.Charge -= 0.025f;
else
Projectile.Kill();
}
}
else if (downtime == 0)
@@ -124,7 +115,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
float particleScale = Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true);
float strength = particleScale;
Vector3 DustLight = mainColor.ToVector3();
Vector3 DustLight = Effects.ArsenalEffects.ArsenalPlamaColor.ToVector3();
Lighting.AddLight(GunTipPosition, DustLight * strength);
}
@@ -134,11 +125,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
ChargeSound?.Stop();
for (int i = 0; i < 20; i++)
{
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278);
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, Effects.ArsenalEffects.ArsenalDust);
chargefull.velocity = (MathHelper.TwoPi * i / 20f).ToRotationVector2() * 4f + Owner.velocity * 0.5f;
chargefull.scale = Main.rand.NextFloat(0.6f, 0.8f);
chargefull.noGravity = false;
chargefull.color = mainColor;
chargefull.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorChargeLoop");
ChargeSlot = SoundEngine.PlaySound(sound with { Volume = 0.7f, IsLooped = true }, Projectile.Center);
@@ -146,11 +137,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
if (CurrentChargingFrames > chargeMax && Main.rand.NextBool())
{
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278);
Dust chargefull = Dust.NewDustPerfect(GunTipPosition, Effects.ArsenalEffects.ArsenalDust);
chargefull.velocity = Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(5, 9);
chargefull.scale = Main.rand.NextFloat(0.2f, 0.4f);
chargefull.noGravity = true;
chargefull.color = mainColor;
chargefull.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
}
@@ -193,10 +184,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
if (CurrentChargingFrames > 0 && downtime == 0)
{
float randSize = Main.rand.NextFloat(0.8f, 1.2f);
Main.EntitySpriteDraw(rechargeTexture, tipPosition - Main.screenPosition, null, mainColor with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.25f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rechargeTexture, tipPosition - Main.screenPosition, null, Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.25f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rechargeTexture, tipPosition - Main.screenPosition, null, Color.White with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.15f * Utils.GetLerpValue(0, chargeMax, CurrentChargingFrames, true) * randSize, SpriteEffects.None, 0);
Main.EntitySpriteDraw(pointTexture, tipPosition - Main.screenPosition + (Projectile.velocity * 15 * fade), null, mainColor with { A = 0 } * fade, Projectile.velocity.RotatedBy(MathHelper.ToRadians(90f)).ToRotation(), pointTexture.Size() * 0.5f, new Vector2(0.5f, 0.9f) * 0.035f * fade * randSize * (CurrentChargingFrames == chargeMax ? 1.5f : 1), flipSprite);
Main.EntitySpriteDraw(pointTexture, tipPosition - Main.screenPosition + (Projectile.velocity * 15 * fade), null, Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 } * fade, Projectile.velocity.RotatedBy(MathHelper.ToRadians(90f)).ToRotation(), pointTexture.Size() * 0.5f, new Vector2(0.5f, 0.9f) * 0.035f * fade * randSize * (CurrentChargingFrames == chargeMax ? 1.5f : 1), flipSprite);
}
return false;
}
+45 -35
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -15,7 +16,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public new string LocalizationCategory => "Projectiles.Misc";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float time => ref Projectile.ai[0];
public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f);
public NPC chosenTarget;
public bool stuckInTarget = false;
@@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
Projectile.timeLeft = 180;
Projectile.extraUpdates = 2;
Projectile.extraUpdates = 4;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
@@ -70,6 +70,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
if (stuckInGround)
{
Projectile.extraUpdates = 2;
Projectile.rotation = storedVelocity.ToRotation() + MathHelper.PiOver2;
stuckTimer--;
@@ -86,38 +87,31 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
if (Main.rand.NextBool(3) && canStick)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? Effects.ArsenalEffects.ArsenalDust : Effects.ArsenalEffects.ArsenalPlamaDust, -Projectile.velocity);
dust.scale = dust.type == Effects.ArsenalEffects.ArsenalDust ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
dust.velocity = -Projectile.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.7f);
dust.noGravity = true;
dust.color = mainColor;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
if (targetDist < 1400f)
{
Particle spark = new SparkParticle(Projectile.Center, -Projectile.velocity, false, 6, 1.3f, mainColor * 0.7f);
Particle spark = new SparkParticle(Projectile.Center, -Projectile.velocity, false, 13, 1.3f, Effects.ArsenalEffects.ArsenalPlamaColor * 0.7f);
GeneralParticleHandler.SpawnParticle(spark);
if (Main.rand.NextBool(6))
{
Vector2 placement = Projectile.Center + Main.rand.NextVector2Circular(12, 12);
float speed = Main.rand.NextFloat(0.2f, 0.7f);
Particle spark2 = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), mainColor);
Particle spark2 = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), Effects.ArsenalEffects.ArsenalPlamaColor);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
if (closestTarget != null && Projectile.numHits < 1 && closestTarget.CanBeChasedBy(Projectile))
{
Vector2 moveTotarget = (closestTarget.Center - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 20)
Projectile.velocity = Projectile.velocity * 0.95f + moveTotarget * 0.28f;
else
Projectile.velocity *= 0.8f;
}
}
}
else if (stuckInTarget)
{
Projectile.extraUpdates = 2;
Projectile.rotation = (storedVelocity).SafeNormalize(Vector2.UnitX).ToRotation() + MathHelper.PiOver2;
placementCenter = chosenTarget.Center + placementVelocity * placementDistance;
@@ -139,16 +133,16 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
if (Main.rand.NextBool(8))
{
float speed = Main.rand.NextFloat(0.2f, 1.5f);
Particle spark = new SparkParticle(Projectile.Center, -storedVelocity * speed, false, 23, 0.7f * speed, mainColor * 0.7f);
Particle spark = new SparkParticle(Projectile.Center, -storedVelocity * speed, false, 23, 0.7f * speed, Effects.ArsenalEffects.ArsenalPlamaColor * 0.7f);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Main.rand.NextBool())
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? Effects.ArsenalEffects.ArsenalDust : ModContent.DustType<SquashDust>(), -Projectile.velocity);
dust.scale = dust.type == Effects.ArsenalEffects.ArsenalDust ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.6f, 1.4f);
dust.velocity = (new Vector2(35, 35).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.7f)) * Utils.GetLerpValue(90, 0, stuckTimer);
dust.noGravity = true;
dust.color = mainColor;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
}
time++;
@@ -189,14 +183,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
stuckInTarget = true;
storedVelocity = Projectile.velocity;
Projectile.velocity = Vector2.Zero;
for (int i = 0; i <= 11; i++)
for (int i = 0; i < 12; i++)
{
int dustStyle = Main.rand.NextBool() ? 66 : 263;
int dustStyle = Effects.ArsenalEffects.ArsenalPlamaDust;
Dust dust = Dust.NewDustPerfect(Projectile.Center + storedVelocity.SafeNormalize(Vector2.UnitX) * 38 + Main.rand.NextVector2Circular(12, 12), dustStyle, Projectile.velocity);
dust.scale = Main.rand.NextFloat(0.7f, 1.1f);
dust.velocity = storedVelocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.8f, 2.1f);
dust.noGravity = true;
dust.color = mainColor;
dust.scale = Main.rand.NextFloat(0.7f, 1.3f);
dust.velocity = storedVelocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.4f, 1.5f);
dust.noGravity = false;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
dust.fadeIn = 1.5f;
}
SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorPreExplode");
SoundEngine.PlaySound(sound with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center);
@@ -205,15 +200,27 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
public override void OnKill(int timeLeft)
{
float bonus = (stuckInGround ? 2f : 1);
float bonus = (stuckInGround ? 3f : 1.5f);
float explosionDamage = (stuckInGround ? 2.3f : 0.5f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<ImmolationBurst>(), (int)(Projectile.damage * explosionDamage), Projectile.knockBack * 2, Projectile.owner, 0, bonus != 1 ? 1 : 0);
Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * 0.75f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1.2f * bonus, 26);
Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<ImmolationBurst>(), (int)(Projectile.damage * explosionDamage), Projectile.knockBack * 2, Projectile.owner, 0, stuckInGround ? 1 : 0);
blast.scale = (stuckInGround ? 2 : 1);
Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalPlamaColor * 0.75f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1.2f * bonus, 26);
GeneralParticleHandler.SpawnParticle(bolt2);
Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor * 0.75f, "CalamityMod/Particles/PlasmaExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.07f * bonus, 14);
Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalPlamaColor * 0.75f, "CalamityMod/Particles/WaterFoam", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.77f * bonus, 16);
GeneralParticleHandler.SpawnParticle(bolt3);
for (int i = 0; i < (int)(15 * bonus); i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? Effects.ArsenalEffects.ArsenalDust : stuckInGround ? ModContent.DustType<SquashDust>() : Effects.ArsenalEffects.ArsenalPlamaDust, -Projectile.velocity);
dust.scale = dust.type == Effects.ArsenalEffects.ArsenalDust ? Main.rand.NextFloat(0.3f, 0.6f) : Main.rand.NextFloat(0.9f, 1.8f);
dust.velocity = (new Vector2(35, 35).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.7f)) * Utils.GetLerpValue(90, 0, stuckTimer);
dust.noGravity = false;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
if (dust.type == Effects.ArsenalEffects.ArsenalPlamaDust)
dust.fadeIn = 2f;
}
SoundStyle sound = new("CalamityMod/Sounds/Item/PlasmaBig");
SoundEngine.PlaySound(sound with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center);
}
@@ -226,14 +233,17 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/Projectiles/DraedonsArsenal/ImmolationArrow");
if (!stuckInGround && !stuckInTarget && false)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], mainColor with { A = 0 }, 1, tex.Value);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 }, 1, tex.Value);
float randSize = Main.rand.NextFloat(0.7f, 1.2f);
for (int i = 0; i < 3; i++)
float randSize = Main.rand.NextFloat(0.8f, 1.1f);
for (int i = 0; i < 20; i++)
{
Vector2 scale = Projectile.scale * new Vector2(0.5f * (1 - i * 0.25f), 1) * 1.5f * (1 - i * 0.3f) * randSize;
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * 0.5f, Projectile.rotation, tex.Size() * 0.5f, scale, SpriteEffects.None);
Vector2 scale = Projectile.scale * new Vector2(0.5f, 1) * 1.5f * randSize;
Vector2 drawOffset = (MathHelper.TwoPi * i / 20f).ToRotationVector2() * 3;
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + drawOffset, null, Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 } * 0.2f, Projectile.rotation, tex.Size() * 0.5f, scale, SpriteEffects.None);
}
Vector2 scale2 = 1.1f * new Vector2(0.5f, 1) * 1.5f * randSize;
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 } * 0.5f, Projectile.rotation, tex.Size() * 0.5f, scale2, SpriteEffects.None);
if (stuckInTarget || stuckInGround)
{
Vector2 scale = 1.1f * new Vector2(0.5f, 1) * 1.5f * randSize;
@@ -10,7 +10,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = Projectile.height = 150;
Projectile.width = Projectile.height = 235;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
@@ -26,10 +26,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
Projectile.damage = (int)(Projectile.damage * 0.88f);
if (Projectile.damage < 1)
Projectile.damage = 1;
float minMult = 0.25f;
int hitsToMinMult = (int)(5 * Projectile.scale);
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
modifiers.SourceDamage *= damageMult;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox);
}
+15 -9
View File
@@ -15,7 +15,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public new string LocalizationCategory => "Projectiles.Misc";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float time => ref Projectile.ai[0];
public Color mainColor = Color.Lerp(Color.Chartreuse, Color.White, 0.35f);
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
@@ -47,14 +46,14 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
{
Vector2 placement = Projectile.Center + Main.rand.NextVector2Circular(8, 8);
float speed = Main.rand.NextFloat(0.2f, 0.7f);
Particle spark = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), mainColor);
Particle spark = new GlowOrbParticle(placement, -Projectile.velocity * speed, false, 7, Main.rand.NextFloat(0.4f, 0.7f), Effects.ArsenalEffects.ArsenalPlamaColor);
GeneralParticleHandler.SpawnParticle(spark);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 278 : 263, -Projectile.velocity);
dust.scale = dust.type == 278 ? Main.rand.NextFloat(0.2f, 0.5f) : Main.rand.NextFloat(0.4f, 1.1f);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? Effects.ArsenalEffects.ArsenalDust : Effects.ArsenalEffects.ArsenalPlamaDust, -Projectile.velocity);
dust.scale = dust.type == Effects.ArsenalEffects.ArsenalDust ? Main.rand.NextFloat(0.2f, 0.5f) : Main.rand.NextFloat(0.4f, 1.1f);
dust.velocity = (new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.7f));
dust.noGravity = true;
dust.color = mainColor;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
}
}
time++;
@@ -74,8 +73,16 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
if (targetDist < 1400)
{
Particle spark = new GlowOrbParticle(Projectile.Center + oldVelocity.SafeNormalize(Vector2.UnitX) * 11, Projectile.velocity * 0.001f, false, 60, 1.6f, mainColor);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 vel = oldVelocity.SafeNormalize(Vector2.UnitX);
int dustStyle = Effects.ArsenalEffects.ArsenalPlamaDust;
for (int i = 0; i < 6; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + vel * 5, dustStyle, (-vel * Main.rand.NextFloat(5, 8)).RotatedByRandom(0.7f));
dust.scale = Main.rand.NextFloat(0.7f, 1.3f);
dust.noGravity = false;
dust.color = Effects.ArsenalEffects.ArsenalPlamaColor;
dust.fadeIn = 1.2f;
}
}
return true;
}
@@ -86,10 +93,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSpark");
//CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], mainColor with { A = 0 } * 0.3f, 1, tex.Value);
float squash = Utils.GetLerpValue(-3, 10, Projectile.velocity.Length(), true);
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * 0.6f, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, squash) * 0.045f * (i == 0 ? 0.6f : 1), SpriteEffects.None);
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, null, Effects.ArsenalEffects.ArsenalPlamaColor with { A = 0 } * 0.6f, Projectile.rotation, tex.Size() * 0.5f, new Vector2(0.4f, squash) * 0.045f * (i == 0 ? 0.6f : 1), SpriteEffects.None);
return false;
}
}