Several changes based on feedback

* Reverted Earthen Tides shockwave color to be water-themed again
* Removed passive attunements from Galaxia
* Monoliths from BB Heaven's Might and TBB Swordsmith's Pride now scale in size based on the target's size and follow their targets
* TBB Swordsmith's Pride monoliths now spawn on hit instead of at the peak of the sword throw, and always rise upwards instead of being based on sword throw direction
This commit is contained in:
CongratsIsTrash committed 2024-09-01 18:25:38 -04:00
1 parent 71f7727064
commit a6ef9743ff
13 files changed
+72 -237

No files matched your search

-40
View File
@@ -599,16 +599,6 @@ namespace CalamityMod.DataStructures
item.UseSound = null;
item.noMelee = true;
}
public override void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null)
{
if (UseTimer % 500 == 449)
{
SoundEngine.PlaySound(SoundID.Item78);
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
UseTimer++;
}
}
}
public class AriesAttunement : Attunement
@@ -633,16 +623,6 @@ namespace CalamityMod.DataStructures
item.UseSound = null;
item.noMelee = true;
}
public override void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null)
{
if (UseTimer % 500 == 449)
{
SoundEngine.PlaySound(SoundID.Item78);
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), 0, 0f, player.whoAmI, 1f);
UseTimer++;
}
}
}
public class PolarisAttunement : Attunement
@@ -667,16 +647,6 @@ namespace CalamityMod.DataStructures
item.UseSound = null;
item.noMelee = true;
}
public override void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null)
{
if (UseTimer % 500 == 449)
{
SoundEngine.PlaySound(SoundID.Item78);
Projectile.NewProjectile(source, player.Center, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), FourSeasonsGalaxia.CancerPassiveDamage, 0f, player.whoAmI, 0f);
UseTimer++;
}
}
}
public class AndromedaAttunement : Attunement
@@ -702,16 +672,6 @@ namespace CalamityMod.DataStructures
item.UseSound = null;
item.noMelee = true;
}
public override void PassiveEffect(Player player, IEntitySource source, ref int UseTimer, ref bool Procced, Projectile projectile = null)
{
if (UseTimer % 500 == 449)
{
SoundEngine.PlaySound(SoundID.Item78);
Projectile.NewProjectile(source, player.Center, Vector2.Zero, ProjectileType<GalaxiaTropicRing>(), FourSeasonsGalaxia.CancerPassiveDamage, 0f, player.whoAmI, 0f);
UseTimer++;
}
}
}
#endregion
+1 -22
View File
@@ -86,9 +86,7 @@ namespace CalamityMod.Items.Weapons.Melee
return;
var effectDescTooltip = list.FirstOrDefault(x => x.Text.Contains("[FUNC]") && x.Mod == "Terraria");
var passiveDescTooltip = list.FirstOrDefault(x => x.Text.Contains("[PASS]") && x.Mod == "Terraria");
var mainAttunementTooltip = list.FirstOrDefault(x => x.Text.Contains("[ATT]") && x.Mod == "Terraria");
var blessingTooltip = list.FirstOrDefault(x => x.Text.Contains("[BLE]") && x.Mod == "Terraria");
//Default stuff gets skipped here. MainAttunement is set to true in SafeCheckAttunements() above
@@ -105,23 +103,11 @@ namespace CalamityMod.Items.Weapons.Melee
effectDescTooltip.OverrideColor = mainAttunement.tooltipColor;
}
if (passiveDescTooltip != null)
{
passiveDescTooltip.Text = mainAttunement.PassiveDesc.ToString();
passiveDescTooltip.OverrideColor = mainAttunement.tooltipPassiveColor;
}
if (mainAttunementTooltip != null)
{
mainAttunementTooltip.Text = mainAttunementTooltip.Text.Replace("ATT", mainAttunement.AttunementName.ToString());
mainAttunementTooltip.OverrideColor = Color.Lerp(mainAttunement.tooltipColor, mainAttunement.tooltipColor2, 0.5f + (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.5f);
}
if (blessingTooltip != null)
{
blessingTooltip.Text = blessingTooltip.Text.Replace("BLE", mainAttunement.PassiveName.ToString());
blessingTooltip.OverrideColor = mainAttunement.tooltipPassiveColor;
}
}
#endregion
@@ -222,22 +208,15 @@ namespace CalamityMod.Items.Weapons.Melee
}
SafeCheckAttunements();
mainAttunement.ApplyStats(Item);
//Passive effects only jappen player side haha
if (player.whoAmI != Main.myPlayer)
return;
var source = player.GetSource_ItemUse(Item);
mainAttunement.PassiveEffect(player, source, ref UseTimer, ref OnHitProc);
if (player.Calamity().mouseRight && CanUseItem(player) && player.whoAmI == Main.myPlayer && !Main.mapFullscreen)
{
//Don't shoot out a visual blade if you already have one out
if (Main.projectile.Any(n => n.active && n.type == ProjectileType<GalaxiaHoldout>() && n.owner == player.whoAmI))
return;
var source = player.GetSource_ItemUse(Item);
Projectile.NewProjectile(source, player.Top, Vector2.Zero, ProjectileType<GalaxiaHoldout>(), 0, 0, player.whoAmI, 0, Math.Sign(player.position.X - Main.MouseWorld.X));
}
}
@@ -146,12 +146,6 @@ PhoenixAttunement: {
The swirling nebula constantly emits homing cosmic bolts
Release to hurl the sword toward the cursor alongside 6 gigantic cosmic bolts
'''
PassiveName: Capricorn's Blessing
PassiveDesc:
'''
Periodically releases a ring of weakening stars around your cursor when attacking
The ring moves away from you, but slows down over time
'''
}
AriesAttunement: {
@@ -161,12 +155,6 @@ AriesAttunement: {
Binds the sword to your cursor through a chain of constellations
Striking enemies causes nebulous explosions which spawn homing cosmic bolts
'''
PassiveName: Capricorn's Blessing
PassiveDesc:
'''
Periodically releases a ring of weakening stars around your cursor when attacking
The ring moves away from you, but slows down over time
'''
}
PolarisAttunement: {
@@ -178,12 +166,6 @@ PolarisAttunement: {
Release to fire a powerful star directly at your cursor
Attacking immediately after firing the star launches you toward it, damaging enemies
'''
PassiveName: Cancer's Blessing
PassiveDesc:
'''
Periodically releases a ring of lifestealing stars around you when attacking
The ring moves toward you, but slows down over time
'''
}
AndromedaAttunement: {
@@ -194,10 +176,4 @@ AndromedaAttunement: {
Charging the sword periodically emits homing bolts
Lunging into enemies rains large homing stars from the heavens
'''
PassiveName: Cancer's Blessing
PassiveDesc:
'''
Periodically releases a ring of lifestealing stars around you when attacking
The ring moves toward you, but slows down over time
'''
}
@@ -544,12 +544,10 @@ FourSeasonsGalaxia: {
Tooltip:
'''
[FUNC]
[PASS]
Freed from earthly shackles and coursing with cosmic power
Has access to all of the attunements at all times
Press <right> to cycle the sword's attunement depending on the cursor's position
Active Attunement : [ATT]
Passive Blessing : [BLE]
'''
}
@@ -130,7 +130,6 @@ GaelSkull2.DisplayName: No Longer Ark of the Cosmos' Superior Cousin
GalacticaComet.DisplayName: Galactus Comet
GalaxiaBolt.DisplayName: Galaxia Bolt
GalaxiaHoldout.DisplayName: Galactic Formation
GalaxiaTropicRing.DisplayName: Star Ring
GalaxyBlast.DisplayName: Galaxy Blast
GalaxyBlastType2.DisplayName: Galaxy Blast
GalaxyBlastType3.DisplayName: Galaxy Blast
-112
View File
@@ -1,112 +0,0 @@
using System;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Weapons.Melee;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Projectiles.Melee
{
public class GalaxiaTropicRing : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public Player Owner => Main.player[Projectile.owner];
public ref float Mode => ref Projectile.ai[0];
public ref float Fade => ref Projectile.ai[1];
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = Projectile.height = 30;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 300;
Projectile.DamageType = DamageClass.Melee;
Projectile.tileCollide = false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Mode == 0f && Main.rand.NextFloat() < FourSeasonsGalaxia.CancerPassiveLifeStealProc)
{
Owner.statLife += FourSeasonsGalaxia.CancerPassiveLifeSteal;
Owner.HealEffect(FourSeasonsGalaxia.CancerPassiveLifeSteal);
}
else
{
target.AddBuff(BuffType<ArmorCrunch>(), FourSeasonsGalaxia.CapricornPassiveDebuffTime);
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
return Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.One * 95 * Projectile.scale, Vector2.One * 190 * Projectile.scale);
}
public override void AI()
{
Projectile.velocity *= 0.95f;
if (Mode == 0f)
Projectile.Center = Vector2.Lerp(Projectile.Center, Owner.Center, 0.4f * MathHelper.Clamp((Projectile.timeLeft - 150) / 150f, 0, 1));
else
Projectile.velocity = Utils.SafeNormalize(Projectile.Center - Owner.Center, Vector2.Zero) * MathHelper.Clamp((Projectile.timeLeft - 150) / 150f, 0, 1) * 3f * (5f - MathHelper.Clamp((Projectile.Center - Owner.Center).Length() / 150f, 0, 4f));
Fade = Projectile.timeLeft > 250 ? (float)Math.Sin((300 - Projectile.timeLeft) / 50f * MathHelper.PiOver2) * 0.6f + 0.4f : Projectile.timeLeft > 50 ? 1f : (float)Math.Sin((Projectile.timeLeft) / 50f * MathHelper.PiOver2);
Lighting.AddLight(Projectile.Center, 0.75f, 1f, 0.24f);
}
public Vector2 starPosition(int MaxStars, int StarIndex, float diameter)
{
float starHeight = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 + StarIndex * MathHelper.TwoPi / (float)MaxStars);
float starWidth = (float)Math.Cos(Main.GlobalTimeWrappedHourly * 3 + StarIndex * MathHelper.TwoPi / (float)MaxStars);
return Projectile.Center + Projectile.rotation.ToRotationVector2() * starWidth * (Projectile.scale * diameter * 0.4f) + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * starHeight * (Projectile.scale * diameter * 0.4f);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D sigil = Request<Texture2D>(Mode == 0 ? "CalamityMod/Projectiles/Melee/GalaxiaCancer" : "CalamityMod/Projectiles/Melee/GalaxiaCapricorn").Value; //OMG Karkat and Gamzee from homestuck i am a big fan
Texture2D ring = Request<Texture2D>("CalamityMod/Particles/BloomRing").Value;
Texture2D starTexture = Request<Texture2D>("CalamityMod/Particles/Sparkle").Value;
Texture2D lineTexture = Request<Texture2D>("CalamityMod/Particles/BloomLine").Value;
Texture2D bloomTexture = Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Color ringColor = Mode == 0 ? new Color(255, 0, 0) * Fade : new Color(66, 0, 176) * Fade;
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
Main.EntitySpriteDraw(bloomTexture, Projectile.Center - Main.screenPosition, null, ringColor * 0.5f, 0, bloomTexture.Size() / 2f, 2.5f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(ring, Projectile.Center - Main.screenPosition, null, ringColor * 0.8f, 0f, ring.Size() / 2f, Projectile.scale, 0f, 0);
Main.EntitySpriteDraw(sigil, Projectile.Center - Main.screenPosition, null, ringColor * MathHelper.Lerp(0.7f, 0f, ((Main.GlobalTimeWrappedHourly * 5f) % 10) / 10f), 0f, sigil.Size() / 2f, Projectile.scale + ((Main.GlobalTimeWrappedHourly * 5f) % 10) / 10f * 2f, 0f, 0);
Main.EntitySpriteDraw(sigil, Projectile.Center - Main.screenPosition, null, Color.White * Fade, 0f, sigil.Size() / 2f, Projectile.scale, 0f, 0);
for (int i = 0; i < 5; i++)
{
Vector2 starPos = starPosition(5, i, ring.Width);
Vector2 LineVector = starPosition(5, i + 1, ring.Width) - starPos;
float rot = LineVector.ToRotation() + MathHelper.PiOver2;
Vector2 origin = new Vector2(lineTexture.Width / 2f, lineTexture.Height);
Vector2 scale = new Vector2(0.3f, LineVector.Length() / lineTexture.Height);
Main.EntitySpriteDraw(lineTexture, starPos - Main.screenPosition, null, Color.White * Fade * 0.7f, rot, origin, scale, SpriteEffects.None, 0);
Main.EntitySpriteDraw(bloomTexture, starPos - Main.screenPosition, null, ringColor * 0.5f, 0, bloomTexture.Size() / 2f, 0.1f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(starTexture, starPos - Main.screenPosition, null, ringColor * 0.5f, Main.GlobalTimeWrappedHourly * 5 + MathHelper.PiOver4 * i, starTexture.Size() / 2f, 1f, SpriteEffects.None, 0);
Main.EntitySpriteDraw(starTexture, starPos - Main.screenPosition, null, Color.White * Fade, Main.GlobalTimeWrappedHourly * 5, starTexture.Size() / 2f, 1.4f, SpriteEffects.None, 0);
}
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
return false;
}
}
}
@@ -41,7 +41,14 @@ namespace CalamityMod.Projectiles.Melee
}
// Constantly follow its target
Projectile.Center = Target.Center;
// Die if the target is no longer active
if (!Target.active)
{
Projectile.Kill();
return;
}
else
Projectile.Center = Target.Center;
// Spawn smoke
if (Projectile.timeLeft < 59)
@@ -98,7 +98,6 @@ namespace CalamityMod.Projectiles.Melee
else if (CurrentState == 0f)
{
CurrentState = 1f;
Projectile.numHits = 0;
SoundEngine.PlaySound(SoundID.Item80, Projectile.Center);
direction = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld, Vector2.Zero);
//PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES
@@ -205,11 +204,14 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
// Spawn a monolith on max power sword throws
if (!(CurrentState == 1f && Projectile.numHits <= 0))
if (!(CurrentState == 1f && !CalamityUtils.AnyProjectiles(ProjectileType<HeavensMonolith>())))
return;
if (Empowerment >= maxEmpowerment)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10), ProjectileType<HeavensMonolith>(), (int)(Projectile.damage * TrueBiomeBlade.HolyAttunement_MonolithDamage), 10f, Owner.whoAmI, Main.rand.Next(4));
{
float monolithScale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10f), ProjectileType<HeavensMonolith>(), (int)(Projectile.damage * TrueBiomeBlade.HolyAttunement_MonolithDamage), 10f, Owner.whoAmI, Main.rand.Next(4), monolithScale, target.whoAmI);
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
@@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Melee
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith";
public Player Owner => Main.player[Projectile.owner];
public NPC Target => Main.npc[(int)Projectile.ai[2]];
public float Timer => (100f - Projectile.timeLeft) / 100f;
public ref float Variant => ref Projectile.ai[0]; //Yes
public ref float WaitTimer => ref Projectile.ai[1]; //How long till it appears fr
public ref float Variant => ref Projectile.ai[0];
public ref float Scale => ref Projectile.ai[1];
public const float BaseWidth = 90f;
public const float BaseHeight = 420f;
@@ -37,9 +38,6 @@ namespace CalamityMod.Projectiles.Melee
public CurveSegment Hold = new CurveSegment(EasingType.ExpOut, 0.70f, 1f, -0.1f);
internal float Height() => PiecewiseAnimation(Timer, new CurveSegment[] { Anticipate, Overextend, Unextend, Hold }) * BaseHeight;
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Melee;
@@ -48,6 +46,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 102;
Projectile.scale = Scale;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
Projectile.hide = true;
@@ -78,6 +77,16 @@ namespace CalamityMod.Projectiles.Melee
}
}
// Constantly follow its target
// Die if its target is no longer active
if (!Target.active)
{
Projectile.Kill();
return;
}
else
Projectile.Center = Target.Center;
if (Projectile.timeLeft == 80)
{
Vector2 particleDirection = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2();
@@ -108,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee
float drawAngle = Projectile.rotation;
Rectangle frame = new Rectangle(0 + (int)Variant * 94, 0, 94, 420);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight) * Scale;
Vector2 drawPosition = Projectile.Center - Main.screenPosition - (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 26f;
Vector2 drawOrigin = new Vector2(frame.Width / 2f, frame.Height);
@@ -125,7 +134,7 @@ namespace CalamityMod.Projectiles.Melee
float drawAngle = Projectile.rotation;
Rectangle frame = new Rectangle(0 + (int)Variant * 94, 0, 94, 420);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight) * Scale;
Vector2 drawPosition = Projectile.Center - Main.screenPosition - (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 26f;
Vector2 drawOrigin = new Vector2(frame.Width / 2f, frame.Height);
@@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Melee
if (Projectile.timeLeft == 60)
{
SoundEngine.PlaySound(SoundID.Item79, Projectile.Center);
Particle Sparkle = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.White, Main.rand.NextBool() ? Color.BurlyWood : Color.Brown, Projectile.scale, 20, 0.2f, 2);
Particle Sparkle = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.White, Main.rand.NextBool() ? Color.Aqua : Color.SpringGreen, Projectile.scale, 20, 0.2f, 2);
GeneralParticleHandler.SpawnParticle(Sparkle);
}
@@ -62,21 +62,21 @@ namespace CalamityMod.Projectiles.Melee
{
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, Projectile.Center);
BloomRing = new BloomRing(Projectile.Center, Vector2.Zero, Color.Brown, Projectile.scale, 40);
BloomRing = new BloomRing(Projectile.Center, Vector2.Zero, Color.Aqua, Projectile.scale, 40);
GeneralParticleHandler.SpawnParticle(BloomRing);
Particle Bloom = new StrongBloom(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.BurlyWood * 0.6f : Color.Brown * 0.6f, Projectile.scale * (1f + Main.rand.NextFloat(0f, 1.5f)), 20);
Particle Bloom = new StrongBloom(Projectile.Center, Vector2.Zero, Main.rand.NextBool() ? Color.Aqua * 0.6f : Color.SpringGreen * 0.6f, Projectile.scale * (1f + Main.rand.NextFloat(0f, 1.5f)), 20);
GeneralParticleHandler.SpawnParticle(Bloom);
for (int i = 0; i < 10; i++)
{
Particle Sparkle = new CritSpark(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f) * Main.rand.NextFloat(17.5f, 25f) * Projectile.scale, Color.White, Main.rand.NextBool() ? Color.SandyBrown : Color.LimeGreen, 0.1f + Main.rand.NextFloat(0f, 1.5f), 20 + Main.rand.Next(30), 1, 3f);
Particle Sparkle = new CritSpark(Projectile.Center, Main.rand.NextVector2Circular(1f, 1f) * Main.rand.NextFloat(17.5f, 25f) * Projectile.scale, Color.White, Main.rand.NextBool() ? Color.DarkSlateBlue : Color.Chocolate, 0.1f + Main.rand.NextFloat(0f, 1.5f), 20 + Main.rand.Next(30), 1, 3f);
GeneralParticleHandler.SpawnParticle(Sparkle);
}
for (float i = 0f; i < 1; i += 0.05f)
{
float rotation = i * MathHelper.TwoPi;
Particle Sparkle = new CritSpark(Projectile.Center + rotation.ToRotationVector2() * 65f * Projectile.scale, rotation.ToRotationVector2() * 10f, Color.White, Main.rand.NextBool() ? Color.SaddleBrown : Color.Brown, 0.1f + Main.rand.NextFloat(0f, 1.5f), 20 + Main.rand.Next(30), 1, 3f);
Particle Sparkle = new CritSpark(Projectile.Center + rotation.ToRotationVector2() * 65f * Projectile.scale, rotation.ToRotationVector2() * 10f, Color.White, Main.rand.NextBool() ? Color.Aqua : Color.SpringGreen, 0.1f + Main.rand.NextFloat(0f, 1.5f), 20 + Main.rand.Next(30), 1, 3f);
GeneralParticleHandler.SpawnParticle(Sparkle);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

@@ -198,16 +198,6 @@ namespace CalamityMod.Projectiles.Melee
{
Projectile.Center = Owner.Center + (direction * Projectile.scale * 10) + (direction * throwOutDistance * ThrowCurve());
Projectile.scale = (1 + Empowerment / maxEmpowerment * 1.5f) * MathHelper.Clamp(1 - retractionTimer, 0.3f, 1f);
if (snapTimer > 0f && snapTimer < 0.04f)
{
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, direction, ProjectileType<SwordsmithsPrideMonolith>(), (int)(Projectile.damage * OmegaBiomeBlade.WhirlwindAttunement_MonolithDamageMult), Projectile.knockBack, Owner.whoAmI, Main.rand.Next(4), 1f, hasMadeChargeSound);
if (proj.ModProjectile is SwordsmithsPrideMonolith monolith)
{
monolith.OriginDirection = direction;
monolith.Facing = 0f;
}
}
}
//Make the owner look like theyre holding the sword bla bla
@@ -223,6 +213,23 @@ namespace CalamityMod.Projectiles.Melee
Owner.itemAnimation = 2;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (CurrentState == 1f && !CalamityUtils.AnyProjectiles(ProjectileType<SwordsmithsPrideMonolith>()))
{
float monolithScale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f);
Vector2 monolithDirection = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10f);
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, monolithDirection, ProjectileType<SwordsmithsPrideMonolith>(), (int)(Projectile.damage * OmegaBiomeBlade.WhirlwindAttunement_MonolithDamageMult), Projectile.knockBack, Owner.whoAmI, Main.rand.Next(4), 1f, hasMadeChargeSound);
if (proj.ModProjectile is SwordsmithsPrideMonolith monolith)
{
monolith.Scale = monolithScale;
monolith.OriginDirection = monolithDirection;
monolith.Facing = 0f;
monolith.Target = target;
}
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (CurrentState == 1f)
@@ -21,10 +21,12 @@ namespace CalamityMod.Projectiles.Melee
public override string Texture => "CalamityMod/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPrideMonolith";
public Player Owner => Main.player[Projectile.owner];
public float Timer => (100f - Projectile.timeLeft) / 100f;
public ref float Variant => ref Projectile.ai[0]; //Yes
public ref float Size => ref Projectile.ai[1]; //Yes
public Vector2 OriginDirection; //The direction of the original strike
public float Facing; //The direction of the original strike
public ref float Variant => ref Projectile.ai[0];
public ref float Size => ref Projectile.ai[1];
public float Scale; // The scale multiplier based on the target's size
public Vector2 OriginDirection; // The direction of the original strike
public float Facing; // The direction of the original strike
public NPC Target; // The NPC to stick on top of
public const float BaseWidth = 90f;
public const float BaseHeight = 420f;
@@ -41,9 +43,6 @@ namespace CalamityMod.Projectiles.Melee
public CurveSegment Hold = new CurveSegment(EasingType.ExpOut, 0.70f, 1f, -0.1f);
internal float Height() => PiecewiseAnimation(Timer, new CurveSegment[] { Anticipate, Overextend, Unextend, Hold }) * BaseHeight * Size;
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Melee;
@@ -52,6 +51,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.timeLeft = 102;
Projectile.scale = Scale;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 20;
Projectile.hide = true;
@@ -76,6 +76,14 @@ namespace CalamityMod.Projectiles.Melee
Projectile.velocity = Vector2.Zero;
}
if (!Target.active)
{
Projectile.Kill();
return;
}
else
Projectile.Center = Target.Center;
if (Projectile.timeLeft == 100)
{
if (Size >= 1) //Big monoliths create sparkles even before sprouting up
@@ -128,12 +136,14 @@ namespace CalamityMod.Projectiles.Melee
public void SideSprouts(float facing, float projSize)
{
Vector2 monolithRotation = OriginDirection.RotatedBy((MathHelper.Pi / 6f) * facing);
Vector2 monolithRotation = OriginDirection.RotatedBy(MathHelper.Pi / 9.5f * facing);
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, monolithRotation, ProjectileType<SwordsmithsPrideMonolith>(), Projectile.damage, 10f, Owner.whoAmI, Main.rand.Next(4), projSize, Projectile.ai[2] - 1f);
if (proj.ModProjectile is SwordsmithsPrideMonolith monolith)
{
monolith.Scale = Scale;
monolith.OriginDirection = monolithRotation;
monolith.Facing = facing;
monolith.Target = Target;
}
}
@@ -152,7 +162,7 @@ namespace CalamityMod.Projectiles.Melee
float drawAngle = Projectile.rotation;
Rectangle frame = new Rectangle(0 + (int)Variant * 94, 0, 94, 420);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight) * Scale;
Vector2 drawPosition = Projectile.Center - Main.screenPosition - (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 26f;
Vector2 drawOrigin = new Vector2(frame.Width / 2f, frame.Height);
@@ -169,7 +179,7 @@ namespace CalamityMod.Projectiles.Melee
float drawAngle = Projectile.rotation;
Rectangle frame = new Rectangle(0 + (int)Variant * 94, 0, 94, 420);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight);
Vector2 drawScale = new Vector2(Width() / BaseWidth, Height() / BaseHeight) * Scale;
Vector2 drawPosition = Projectile.Center - Main.screenPosition - (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 26f;
Vector2 drawOrigin = new Vector2(frame.Width / 2f, frame.Height);