Vanquisher Arrows Start

This commit is contained in:
Xyk committed 2024-02-26 16:51:11 -08:00
1 parent d464a31e38
commit b5b541f5cb
13 files changed
+197 -144

No files matched your search

+2 -2
View File
@@ -28,8 +28,8 @@ namespace CalamityMod.Items.Ammo
Item.consumable = true;
Item.knockBack = 3.5f;
Item.value = Item.sellPrice(copper: 28);
Item.shoot = ModContent.ProjectileType<VanquisherArrowMain>();
Item.shootSpeed = 10f;
Item.shoot = ModContent.ProjectileType<VanquisherArrowProj>();
Item.shootSpeed = 0.1f;
Item.ammo = AmmoID.Arrow;
Item.rare = ModContent.RarityType<DarkBlue>();
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 558 B

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -157,15 +157,16 @@ TerraArrow: {
TerraBullet: {
DisplayName: Terra Bullet
Tooltip: Explodes and splits into homing terra shards on death
Tooltip: Explodes and splits into homing terra shards on impact
}
VanquisherArrow: {
DisplayName: Vanquisher Arrow
Tooltip:
'''
Pierces through tiles
Spawns extra homing arrows as it travels
Powerful arrows forged with cosmic steel
Pierces through tiles and homes in on enemies
Creates a large explosion upon experation
'''
}
@@ -245,3 +245,4 @@ DragonsBreathFlames.DisplayName: Draconic Flames
DragonsBreathMag.DisplayName: Dragons Breath Cartridge
FlakKrakenProjectile.DisplayName: Flak Kraken
FlakToxicannonProjectile.DisplayName: Flak Toxicannon
VanquisherArrowProj.DisplayName: Vanquisher Arrow Proj
@@ -121,7 +121,6 @@ SulphurousSandBallGun.DisplayName: Sulphurous Sand
TarraEnergy.DisplayName: Tarra Energy
TarragonAura.DisplayName: Tarragon Aura
TeslaAura.DisplayName: Tesla's Electricity
VanquisherArrowSplit.DisplayName: Arrow
VerstaltiteBobber.DisplayName: Verstaltite Bobber
VoidFieldGenerator.DisplayName: Void Field Generator
WaterConvertor.DisplayName: Water Convertor
+5 -2
View File
@@ -13,6 +13,7 @@ namespace CalamityMod.Particles
public bool UseAltVisual = true;
public float fadeOut = 1;
public bool imporant;
public bool glowCenter;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public override bool UseAdditiveBlend => UseAltVisual;
@@ -20,7 +21,7 @@ namespace CalamityMod.Particles
public override string Texture => "CalamityMod/Particles/GlowOrbParticle";
public GlowOrbParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, bool AddativeBlend = true, bool needed = false)
public GlowOrbParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color, bool AddativeBlend = true, bool needed = false, bool GlowCenter = true)
{
Position = relativePosition;
Velocity = velocity;
@@ -30,6 +31,7 @@ namespace CalamityMod.Particles
Color = InitialColor = color;
UseAltVisual = AddativeBlend;
imporant = needed;
glowCenter = GlowCenter;
}
public override void Update()
@@ -52,7 +54,8 @@ namespace CalamityMod.Particles
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.5f, 0.5f), 0, 0f);
if (glowCenter)
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.5f, 0.5f), 0, 0f);
}
}
}
+55
View File
@@ -0,0 +1,55 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Particles
{
public class PlasmaExplosion : Particle
{
public override string Texture => "CalamityMod/Particles/PlasmaExplosion";
public override bool UseAdditiveBlend => true;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
private float OriginalScale;
private float FinalScale;
private float opacity;
private Vector2 Squish;
private Color BaseColor;
public PlasmaExplosion(Vector2 position, Vector2 velocity, Color color, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime)
{
Position = position;
Velocity = velocity;
BaseColor = color;
OriginalScale = originalScale;
FinalScale = finalScale;
Scale = originalScale;
Lifetime = lifeTime;
Squish = squish;
Rotation = rotation;
}
public override void Update()
{
float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) });
Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress);
opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2);
Color = BaseColor * opacity;
Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f);
Velocity *= 0.95f;
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D tex = ModContent.Request<Texture2D>(Texture).Value;
spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color * opacity, Rotation, tex.Size() / 2f, Scale * Squish, SpriteEffects.None, 0);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

+6 -6
View File
@@ -55,13 +55,13 @@ namespace CalamityMod.Projectiles.Ranged
altSpawn = Projectile.Center;
if (Projectile.timeLeft <= 5)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(9, 9) - Projectile.velocity * 2, Main.rand.NextBool() ? 262 : 87, Projectile.velocity * Main.rand.NextFloat(0.1f, 0.95f));
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(9, 9) - Projectile.velocity * 5, Main.rand.NextBool() ? 262 : 87, (Projectile.velocity * 30) * Main.rand.NextFloat(0.1f, 0.95f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.9f, 1.45f);
dust.alpha = 235;
}
if (Projectile.timeLeft <= 13)
Projectile.velocity *= 0.985f;
if (Projectile.timeLeft <= 80)
Projectile.velocity *= 0.96f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
@@ -71,13 +71,13 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 90);
Projectile.timeLeft = 13;
Projectile.timeLeft = 80;
}
private float PrimitiveWidthFunction(float completionRatio)
{
float arrowheadCutoff = 0.36f;
float width = 34f;
float width = 24f;
float minHeadWidth = 0.03f;
float maxHeadWidth = width;
if (completionRatio <= arrowheadCutoff)
@@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Ranged
GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Trails/FabstaffStreak"));
Vector2 overallOffset = Projectile.Size * 0.5f - Main.screenPosition;
overallOffset += Projectile.velocity * 1.4f;
TrailDrawer.Draw(Projectile.oldPos, overallOffset, 92); // 58
TrailDrawer.Draw(Projectile.oldPos, overallOffset, 10); // 58
return false;
}
-67
View File
@@ -1,67 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class VanquisherArrowMain : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Items/Ammo/VanquisherArrow";
public override void SetDefaults()
{
Projectile.width = 22;
Projectile.height = 22;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.tileCollide = false;
Projectile.arrow = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 90;
Projectile.extraUpdates = 1;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
if (Projectile.timeLeft % 45 == 0)
{
if (Projectile.owner == Main.myPlayer && Main.player[Projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<VanquisherArrowSplit>()] < 6)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0.25f, ModContent.ProjectileType<VanquisherArrowSplit>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner);
}
}
public override void PostDraw(Color lightColor)
{
Color color = Color.White;
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * (b2 / 255f));
color = new Color(b2, b2, b2, a2);
}
Rectangle frame = new Rectangle(0, 0, ModContent.Request<Texture2D>(Texture).Value.Width, ModContent.Request<Texture2D>(Texture).Value.Height);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Ammo/VanquisherArrowGlow").Value, Projectile.Center - Main.screenPosition, frame, color, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0);
}
public override Color? GetAlpha(Color lightColor)
{
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * (b2 / 255f));
return new Color(b2, b2, b2, a2);
}
return new Color(255, 255, 255, 100);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
}
}
}
+124
View File
@@ -0,0 +1,124 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Ammo;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Typeless;
using Humanizer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class VanquisherArrowProj : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Items/Ammo/VanquisherArrow";
public ref float Time => ref Projectile.ai[0];
public ref float ProjectileSpeed => ref Projectile.ai[1];
public bool Phase2 = false;
public float HomingTime = 0;
public Color MainColor;
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 20;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
Projectile.width = 22;
Projectile.height = 22;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.tileCollide = false;
Projectile.arrow = true;
Projectile.penetrate = 2;
Projectile.timeLeft = 1200;
Projectile.extraUpdates = 8;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 15 * Projectile.extraUpdates;
}
public override void AI()
{
if (Time == 0)
{
Projectile.velocity *= 0.4f;
ProjectileSpeed = 30;
MainColor = Main.rand.NextBool() ? Color.Cyan : Color.Magenta;
}
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
if (Time > 4f && Main.rand.NextBool(4))
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 226 : 272, -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.8f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.15f, 0.35f);
}
NPC target = Projectile.Center.ClosestNPCAt(65);
if (target != null)
{
//Projectile.velocity = Projectile.velocity.RotatedByRandom(0.1f);
Phase2 = true;
HomingTime = 1;
}
if (HomingTime == 1)
CalamityUtils.HomeInOnNPC(Projectile, true, 2000f, 12, 200f);
Time++;
}
public override void PostDraw(Color lightColor)
{
Color color = Color.White;
Rectangle frame = new Rectangle(0, 0, ModContent.Request<Texture2D>(Texture).Value.Width, ModContent.Request<Texture2D>(Texture).Value.Height);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Ammo/VanquisherArrowGlow").Value, Projectile.Center - Main.screenPosition, frame, color, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0);
}
public override Color? GetAlpha(Color lightColor)
{
return lightColor;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.damage > 1 && Projectile.numHits < 1)
Projectile.damage = (int)(Projectile.damage * 0.6f);
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 180);
}
public override void OnKill(int timeLeft)
{
for (int i = 0; i <= 2; i++)
{
Particle pulse = new Particles.PlasmaExplosion(Projectile.Center + Main.rand.NextVector2Circular(60, 60), Vector2.Zero, Main.rand.NextBool() ? Color.Magenta : Color.Cyan, new Vector2(1f, 1f), Main.rand.NextFloat(-2f, 2f), 0f, Main.rand.NextFloat(0.05f, 0.065f), 15);
GeneralParticleHandler.SpawnParticle(pulse);
}
if (Projectile.owner == Main.myPlayer)
{
Projectile.damage = (int)(Projectile.damage * 0.4f);
Projectile.penetrate = -1;
Projectile.ExpandHitboxBy(170);
Projectile.Damage();
}
SoundStyle onKill = new("CalamityMod/Sounds/Item/ScorpioHit");
SoundEngine.PlaySound(onKill with { Volume = 0.25f, Pitch = 0.1f, PitchVariance = 0.3f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.DD2_FlameburstTowerShot with { Volume = 0.8f, Pitch = -0.5f, PitchVariance = 0.3f }, Projectile.Center);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/StarProj").Value;
if (Time > 6)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], MainColor * 0.3f, 1, texture);
return true;
}
}
}
@@ -1,63 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class VanquisherArrowSplit : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Items/Ammo/VanquisherArrow";
public override void SetDefaults()
{
Projectile.width = 22;
Projectile.height = 22;
Projectile.friendly = true;
Projectile.arrow = true;
Projectile.timeLeft = 90;
Projectile.penetrate = 1;
Projectile.extraUpdates = 1;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 12f, 20f);
}
public override void PostDraw(Color lightColor)
{
if (Projectile.timeLeft < 90)
{
Vector2 origin = new Vector2(0f, 0f);
Color color = Color.White;
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * (b2 / 255f));
color = new Color(b2, b2, b2, a2);
}
Texture2D baseTexture = ModContent.Request<Texture2D>(Texture).Value;
Rectangle frame = new Rectangle(0, 0, baseTexture.Width, baseTexture.Height);
Main.EntitySpriteDraw(ModContent.Request<Texture2D>("CalamityMod/Items/Ammo/VanquisherArrowGlow").Value, Projectile.Center - Main.screenPosition, frame, color, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0);
}
}
public override Color? GetAlpha(Color lightColor)
{
if (Projectile.timeLeft < 85)
{
byte b2 = (byte)(Projectile.timeLeft * 3);
byte a2 = (byte)(100f * (b2 / 255f));
return new Color(b2, b2, b2, a2);
}
return new Color(0, 0, 0, 0);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120);
}
}