beam slash buggy visual replacement

small genesis fix
This commit is contained in:
Xyk committed 2024-05-17 15:01:49 -07:00
1 parent 5e2e8b5b3e
commit 883b910434
6 files changed
+36 -74

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<GenesisHoldout>(), damage, knockback, player.whoAmI, 0, 1);
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<GenesisHoldout>(), damage, knockback, player.whoAmI, 0, 0);
holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter);
return false;
}
+7 -24
View File
@@ -1,4 +1,6 @@
using System;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -34,6 +36,11 @@ namespace CalamityMod.Projectiles.Melee
{
Projectile.rotation = Projectile.velocity.ToRotation();
Projectile.Opacity = Projectile.timeLeft / 35f;
if (Projectile.timeLeft == 34)
{
Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.03f, 0.05f), Main.rand.NextBool() ? Color.Pink : Color.Cyan, new Vector2(2, 0.5f), true);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size());
@@ -44,30 +51,6 @@ namespace CalamityMod.Projectiles.Melee
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft >= 34f)
return false;
Main.spriteBatch.SetBlendState(BlendState.Additive);
float progress = (33f - Projectile.timeLeft) / 33f;
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 origin = texture.Size() * 0.5f;
Vector2 scale = new Vector2(MathHelper.Lerp(0.8f, 1.25f, (float)Math.Pow(progress, 0.45)), MathHelper.Lerp(0.6f, 0.24f, (float)Math.Pow(progress, 0.4))) * Projectile.scale;
// Draw an inner bloom circle to signify power at the center of the strike along with two thinner lines.
Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f);
Vector2 bloomOrigin = bloomTexture.Size() * 0.5f;
Color outerSlashColor = Projectile.ai[2] == 0f ? Color.DarkBlue : Color.DarkRed;
Color innerSlashColor = Projectile.ai[2] == 0f ? Color.Cyan : Color.Pink;
Main.spriteBatch.Draw(bloomTexture, drawPosition, null, outerSlashColor * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, innerSlashColor * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f);
Main.spriteBatch.SetBlendState(BlendState.AlphaBlend);
return false;
}
}
+7 -22
View File
@@ -1,5 +1,7 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -32,6 +34,11 @@ namespace CalamityMod.Projectiles.Melee
{
Projectile.rotation = Projectile.velocity.ToRotation();
Projectile.Opacity = Projectile.timeLeft / 35f;
if (Projectile.timeLeft == 34)
{
Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.05f, 0.09f), (Main.rand.NextBool() ? Color.Cyan : Main.rand.NextBool() ? Color.LightGoldenrodYellow : Color.Lime) * 0.7f, new Vector2(2, 0.5f), true);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
@@ -55,28 +62,6 @@ namespace CalamityMod.Projectiles.Melee
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft > 33)
return false;
Main.spriteBatch.SetBlendState(BlendState.Additive);
float progress = (33 - Projectile.timeLeft) / 33f;
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 origin = texture.Size() * 0.5f;
Vector2 scale = new Vector2(0.5f + 0.7f * (float)Math.Pow(progress, 0.45), 0.55f - 0.3f * (float)Math.Pow(progress, 0.4)) * Projectile.scale;
Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f);
Vector2 bloomOrigin = bloomTexture.Size() * 0.5f;
Main.spriteBatch.Draw(bloomTexture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f);
Main.spriteBatch.SetBlendState(BlendState.AlphaBlend);
return false;
}
}
+4 -3
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee
// Play an explosion sound on the first frame of this projectile's existence.
if (Projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SubsumingVortex.ExplosionSound, Projectile.Center);
SoundEngine.PlaySound(SubsumingVortex.ExplosionSound with { Volume = 0.6f }, Projectile.Center);
Projectile.localAI[0] = 1f;
}
@@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.frameCounter++;
if (Projectile.frameCounter % 5 == 4)
Projectile.frame++;
if (Projectile.frame >= 18)
if (Projectile.frame >= 17)
Projectile.Kill();
// Exponentially accelerate.
@@ -67,7 +67,8 @@ namespace CalamityMod.Projectiles.Melee
lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * Projectile.Opacity * 0.24f;
Main.spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, Projectile.scale * 1.32f, SpriteEffects.None, 0);
}
Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0);
if (Projectile.timeLeft < 149)
Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0);
}
}
}
+7 -22
View File
@@ -1,4 +1,6 @@
using System;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -33,6 +35,11 @@ namespace CalamityMod.Projectiles.Melee
{
Projectile.rotation = Projectile.velocity.ToRotation();
Projectile.Opacity = Projectile.timeLeft / 35f;
if (Projectile.timeLeft == 34)
{
Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.05f, 0.09f), Main.rand.NextBool() ? Terratomere.TerraColor1 : Terratomere.TerraColor2, new Vector2(2, 0.5f), true);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
@@ -46,28 +53,6 @@ namespace CalamityMod.Projectiles.Melee
public override bool PreDraw(ref Color lightColor)
{
if (Projectile.timeLeft >= 34f)
return false;
Main.spriteBatch.SetBlendState(BlendState.Additive);
float progress = (33f - Projectile.timeLeft) / 33f;
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Vector2 origin = texture.Size() * 0.5f;
Vector2 scale = new Vector2(MathHelper.Lerp(0.8f, 1.25f, (float)Math.Pow(progress, 0.45)), MathHelper.Lerp(0.6f, 0.24f, (float)Math.Pow(progress, 0.4))) * Projectile.scale;
// Draw an inner bloom circle to signify power at the center of the strike along with two thinner lines.
Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f);
Vector2 bloomOrigin = bloomTexture.Size() * 0.5f;
Main.spriteBatch.Draw(bloomTexture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f);
Main.spriteBatch.Draw(texture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f);
Main.spriteBatch.SetBlendState(BlendState.AlphaBlend);
return false;
}
}
+10 -2
View File
@@ -39,13 +39,21 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 24f, 20f);
CalamityUtils.HomeInOnNPC(Projectile, true, 400f, 24f, 20f);
Projectile.scale = Utils.GetLerpValue(0f, 8f, Projectile.timeLeft, true);
Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 131 : 294, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.75f, 0.95f);
if (dust.type == 131)
dust.scale = Main.rand.NextFloat(0.55f, 0.75f);
else
dust.fadeIn = 0.5f;
}
public float SlashWidthFunction(float _) => Projectile.width * Projectile.scale * Utils.GetLerpValue(0f, 0.1f, _, true);
public Color SlashColorFunction(float _) => Color.Lime * Projectile.Opacity;
public Color SlashColorFunction(float _) => Color.Turquoise;
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{