More projectile changes
This commit is contained in:
1 parent
d747d3938e
commit
a2e7eabb55
10 files changed
+202
-108
No files matched your search
@@ -1250,6 +1250,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
case (int)Phase.FlameCocoon:
|
||||
|
||||
Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30);
|
||||
if (!targetDead && !getFuckedAI)
|
||||
{
|
||||
if (NPC.velocity.Length() <= 2f)
|
||||
@@ -1291,10 +1292,10 @@ namespace CalamityMod.NPCs.Providence
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt);
|
||||
}
|
||||
else if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer);
|
||||
}
|
||||
|
||||
// Radial offset
|
||||
@@ -1332,29 +1333,10 @@ namespace CalamityMod.NPCs.Providence
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt);
|
||||
}
|
||||
else if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer);
|
||||
|
||||
Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : (projectileType == ModContent.ProjectileType<HolyBurnOrb>() ? Color.Orange : Color.Green)).X, 1f, 0.5f);
|
||||
dustColor.A = 255;
|
||||
int maxDust = 3;
|
||||
for (int j = 0; j < maxDust; j++)
|
||||
{
|
||||
int dust = Dust.NewDust(fireFrom, 0, 0, DustID.RainbowMk2, 0f, 0f, 0, dustColor, 1f);
|
||||
Main.dust[dust].position = fireFrom;
|
||||
Main.dust[dust].velocity = vector2 * cocoonProjVelocity * (j * 0.5f + 1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].scale = 1f + j;
|
||||
Main.dust[dust].fadeIn = Main.rand.NextFloat() * 2f;
|
||||
Dust dust2 = Dust.CloneDust(dust);
|
||||
Dust dust3 = dust2;
|
||||
dust3.scale /= 2f;
|
||||
dust3 = dust2;
|
||||
dust3.fadeIn /= 2f;
|
||||
dust2.color = new Color(255, 255, 255, 255);
|
||||
}
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1373,10 +1355,10 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
foreach (int t in targets)
|
||||
{
|
||||
Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - fireFrom) * cocoonProjVelocity * 1.5f;
|
||||
Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - fireSparklesFrom) * cocoonProjVelocity * 1.5f;
|
||||
int type = ModContent.ProjectileType<HolyBurnOrb>();
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer);
|
||||
|
||||
Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : Color.Orange).X, 1f, 0.5f);
|
||||
dustColor.A = 255;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.Particles
|
||||
|
||||
if (AffectedByLight)
|
||||
{
|
||||
col = Lighting.GetColor((Position / 16).ToPoint()).MultiplyRGBA(col);
|
||||
col = col.MultiplyRGBA(Lighting.GetColor((Position / 16).ToPoint()));
|
||||
}
|
||||
|
||||
spriteBatch.Draw(tex, Position - Main.screenPosition, frame, col, Rotation, frame.Size() / 2f, Scale, SpriteEffects.None, 0);
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using CalamityMod.Graphics.Primitives;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.NPCs.TownNPCs;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -95,10 +96,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
if (!started)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
for (int i = 0; i < 13; i++)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-30f, 30f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 30, Main.rand.NextFloat(3f, 6f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-50f, 50f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 30, Main.rand.NextFloat(2f, 5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-30f, 30f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(3f, 6f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-50f, 50f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(2f, 5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
}
|
||||
started = true;
|
||||
}
|
||||
@@ -120,14 +121,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.localAI[0] = 1f;
|
||||
SoundEngine.PlaySound(ShootSound, Projectile.Center);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(3))
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + Projectile.velocity + new Vector2(Main.rand.NextFloat(-40, 40), 0).RotatedBy(Vector2.Zero.AngleTo(Projectile.velocity.RotatedBy(MathHelper.PiOver2))), Projectile.velocity * Main.rand.NextFloat(-3f, -1f), false, 10, Main.rand.NextFloat(1f, 1.5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
|
||||
if (Math.Abs(Projectile.velocity.X) > 0.2)
|
||||
Projectile.spriteDirection = -Projectile.direction;
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(35), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 1.6f, false, 10, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(50), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, false, 20, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
|
||||
GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center + new Vector2(40, 0).RotatedBy(Vector2.Zero.AngleTo(-Projectile.velocity)) + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(1f, 3f), 150f));
|
||||
|
||||
if (Projectile.velocity.X < 0f)
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X);
|
||||
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -16,11 +17,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public class HolySpear : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
|
||||
Vector2 velocity = Vector2.Zero;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 2;
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
}
|
||||
|
||||
@@ -141,6 +143,51 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.Opacity = MathHelper.Lerp(240f, 220f, Projectile.timeLeft);
|
||||
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
bool aimedSpear = Projectile.ai[0] > 0f;
|
||||
|
||||
int red = 255;
|
||||
int green = 255;
|
||||
int blue = 0;
|
||||
switch (Projectile.maxPenetrate)
|
||||
{
|
||||
case (int)Providence.BossMode.Red:
|
||||
red = 255;
|
||||
green = aimedSpear ? 0 : 125;
|
||||
blue = aimedSpear ? 0 : 255;
|
||||
break;
|
||||
case (int)Providence.BossMode.Orange:
|
||||
red = 255;
|
||||
green = 125;
|
||||
blue = aimedSpear ? 0 : 175;
|
||||
break;
|
||||
case (int)Providence.BossMode.Yellow: //Same as day
|
||||
case (int)Providence.BossMode.Day:
|
||||
red = 255;
|
||||
green = aimedSpear ? 255 : 125;
|
||||
blue = aimedSpear ? 25 : 125;
|
||||
break;
|
||||
case (int)Providence.BossMode.Green:
|
||||
red = 0;
|
||||
green = 255;
|
||||
blue = aimedSpear ? 0 : 175;
|
||||
break;
|
||||
case (int)Providence.BossMode.Blue: //Same as night
|
||||
case (int)Providence.BossMode.Night:
|
||||
red = aimedSpear ? 100 : 175;
|
||||
green = aimedSpear ? 255 : 175;
|
||||
blue = 255;
|
||||
break;
|
||||
case (int)Providence.BossMode.Violet:
|
||||
red = aimedSpear ? 125 : 255;
|
||||
green = aimedSpear ? 0 : 255;
|
||||
blue = 125;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Color baseColor = new Color(red, green, blue, 0);
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity, false, 15, Main.rand.NextFloat(0.5f, 1.5f) * MathHelper.Clamp(Projectile.velocity.Length() / 15, 0f, 2f), aimedSpear ? baseColor : ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -189,16 +236,21 @@ namespace CalamityMod.Projectiles.Boss
|
||||
break;
|
||||
}
|
||||
Color baseColor = new Color(red, green, blue, 0);
|
||||
Color baseColor2 = new Color(15, 35, 50, 0);
|
||||
|
||||
Color baseColor2 = baseColor;
|
||||
Vector2 projDirection = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
|
||||
if (!aimedSpear)
|
||||
{
|
||||
baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
baseColor2 = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
}
|
||||
|
||||
Vector2 projDirection = Main.screenPosition - new Vector2(0f, Projectile.gfxOffY);
|
||||
Vector2 halfTextureSize = drawTexture.Size() / 2f;
|
||||
Color halfOfHalfBaseColor = baseColor2 * 0.5f;
|
||||
float timeLeftColorScale = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f;
|
||||
Vector2 timeLeftDrawEffect = new Vector2(1f, 1.5f) * timeLeftColorScale;
|
||||
Vector2 timeLeftDrawEffect2 = new Vector2(0.5f, 1f) * timeLeftColorScale;
|
||||
baseColor2 *= timeLeftColorScale;
|
||||
halfOfHalfBaseColor *= timeLeftColorScale;
|
||||
|
||||
float squish = MathHelper.Clamp(Projectile.velocity.Length() / 20, -0.3f, 0.3f);
|
||||
|
||||
Vector2 sc = new Vector2(1 - squish, 1 + squish);
|
||||
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (Projectile.spriteDirection == -1)
|
||||
@@ -208,21 +260,16 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
for (int i = 0; i < Projectile.oldPos.Length; i++)
|
||||
{
|
||||
Vector2 drawPos = Projectile.oldPos[i] + projDirection;
|
||||
Color baseColorAlpha = Projectile.GetAlpha(baseColor2) * ((Projectile.oldPos.Length - i) / Projectile.oldPos.Length);
|
||||
Main.spriteBatch.Draw(drawTexture, drawPos, null, baseColorAlpha, Projectile.rotation, halfTextureSize, timeLeftDrawEffect, SpriteEffects.None, 0);
|
||||
Main.spriteBatch.Draw(drawTexture, drawPos, null, baseColorAlpha, Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, SpriteEffects.None, 0);
|
||||
|
||||
baseColorAlpha = Projectile.GetAlpha(halfOfHalfBaseColor) * ((Projectile.oldPos.Length - i) / Projectile.oldPos.Length);
|
||||
Main.spriteBatch.Draw(drawTexture, drawPos, null, baseColorAlpha, Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, SpriteEffects.None, 0);
|
||||
Main.spriteBatch.Draw(drawTexture, drawPos, null, baseColorAlpha, Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, SpriteEffects.None, 0);
|
||||
Main.EntitySpriteDraw(drawTexture, Projectile.oldPos[i] - projDirection + (Projectile.Size / 2), null, Color.Lerp(baseColor, baseColor2, MathHelper.Lerp((float)i / (float)Projectile.oldPos.Length, 1f, 0.5f)), Projectile.rotation, halfTextureSize, sc * MathHelper.Lerp(1, 0, (float)((float)i / Projectile.oldPos.Length)), spriteEffects, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Main.EntitySpriteDraw(drawTexture, projDirection, null, baseColor2, Projectile.rotation, halfTextureSize, timeLeftDrawEffect, spriteEffects, 0);
|
||||
Main.EntitySpriteDraw(drawTexture, projDirection, null, baseColor2, Projectile.rotation, halfTextureSize, timeLeftDrawEffect2, spriteEffects, 0);
|
||||
Main.EntitySpriteDraw(drawTexture, projDirection, null, halfOfHalfBaseColor, Projectile.rotation, halfTextureSize, timeLeftDrawEffect * 0.6f, spriteEffects, 0);
|
||||
Main.EntitySpriteDraw(drawTexture, projDirection, null, halfOfHalfBaseColor, Projectile.rotation, halfTextureSize, timeLeftDrawEffect2 * 0.6f, spriteEffects, 0);
|
||||
for (float i = 0; i < 360; i += 90)
|
||||
{
|
||||
Main.EntitySpriteDraw(drawTexture, Projectile.Center + new Vector2(4, 0).RotatedBy(MathHelper.ToRadians(i)) - projDirection, null, Color.Lerp(baseColor, baseColor2, 0.75f), Projectile.rotation, halfTextureSize, sc, spriteEffects, 0);
|
||||
}
|
||||
|
||||
Main.EntitySpriteDraw(drawTexture, Projectile.Center - projDirection, null, baseColor, Projectile.rotation, halfTextureSize, sc, spriteEffects, 0);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -242,5 +289,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 20);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -52,6 +53,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.Hitbox.Intersects(new Rectangle((int)Projectile.ai[0], (int)Projectile.ai[1], Player.defaultWidth, Player.defaultHeight)))
|
||||
Projectile.tileCollide = true;
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
@@ -117,11 +119,20 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
|
||||
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f);
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f))));
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha);
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -136,6 +147,22 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor));
|
||||
}
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4));
|
||||
|
||||
for (float i = 0; i < 1; i += 0.25f)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.125f * i, 8));
|
||||
}
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 5));
|
||||
|
||||
int blobAmt = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 9 : 6;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
@@ -149,22 +176,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item74, Projectile.Center);
|
||||
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
}
|
||||
for (int j = 0; j < 40; j++)
|
||||
{
|
||||
int killHolyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
|
||||
Main.dust[killHolyDust].noGravity = true;
|
||||
Main.dust[killHolyDust].velocity *= 3f;
|
||||
killHolyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
|
||||
Main.dust[killHolyDust].velocity *= 2f;
|
||||
Main.dust[killHolyDust].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 18f, targetHitbox);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -11,10 +12,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
public class MoltenBlob : ModProjectile, ILocalizedModType
|
||||
{
|
||||
float Landing = 1f;
|
||||
bool colliding = false;
|
||||
|
||||
bool inLava = false;
|
||||
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.projFrames[Projectile.type] = 2;
|
||||
Main.projFrames[Projectile.type] = 3;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -33,6 +39,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
@@ -52,22 +59,40 @@ namespace CalamityMod.Projectiles.Boss
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Landing += 0.1f;
|
||||
|
||||
Landing = MathHelper.Clamp(Landing, 0f, 1f);
|
||||
|
||||
colliding = Projectile.velocity.Y == 0f;
|
||||
|
||||
if (colliding)
|
||||
{
|
||||
Landing = 0f;
|
||||
Projectile.localAI[2] = 5;
|
||||
|
||||
Projectile.velocity.X *= 0.8f;
|
||||
}
|
||||
|
||||
Projectile.velocity.X *= 0.95f;
|
||||
|
||||
if (Projectile.wet || Projectile.lavaWet)
|
||||
{
|
||||
Projectile.velocity.Y -= 0.2f;
|
||||
if (Projectile.velocity.Y < -10f)
|
||||
Projectile.velocity.Y = -10f;
|
||||
if (!inLava)
|
||||
{
|
||||
Projectile.position.Y -= Projectile.velocity.Y;
|
||||
Projectile.velocity.Y = 0f;
|
||||
inLava = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Projectile.velocity.Y < 0f)
|
||||
Projectile.velocity.Y = 0f;
|
||||
if (!inLava)
|
||||
{
|
||||
if (Projectile.velocity.Y < 0f)
|
||||
Projectile.velocity.Y = 0f;
|
||||
|
||||
Projectile.velocity.Y += 0.1f;
|
||||
if (Projectile.velocity.Y > 5f)
|
||||
Projectile.velocity.Y = 5f;
|
||||
Projectile.velocity.Y += 0.15f;
|
||||
}
|
||||
}
|
||||
|
||||
Projectile.frameCounter++;
|
||||
@@ -90,46 +115,45 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha);
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value;
|
||||
int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, texture);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
int y6 = framing * (1 + Projectile.frame);
|
||||
float squish = CalamityUtils.SineBumpEasing(Landing, 1) * 0.5f;
|
||||
Projectile.rotation = 0f;
|
||||
if (!colliding)
|
||||
{
|
||||
y6 = 0;
|
||||
squish = -MathHelper.Clamp(Projectile.velocity.Length() / 15, 0, 0.5f);
|
||||
Projectile.rotation = Vector2.Zero.AngleTo(Projectile.velocity) + MathHelper.PiOver2;
|
||||
}
|
||||
Vector2 vec = new Vector2(0, framing * squish);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, new Vector2(1 + squish, 1 - squish), texture, offset: vec);
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center + vec - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), new Vector2(1 + squish, 1 - squish), SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
|
||||
Projectile.position.X = Projectile.position.X + (Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y + (Projectile.height / 2);
|
||||
Projectile.width = 10;
|
||||
Projectile.height = 10;
|
||||
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
for (int i = 0; i < 3; i++)
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[holyDust].noGravity = true;
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
Main.dust[holyDust].scale = 0.5f;
|
||||
Main.dust[holyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(3), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.1f, 0.4f), hiColor));
|
||||
}
|
||||
for (int j = 0; j < 5; j++)
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4));
|
||||
|
||||
for (float i = 0; i < 1; i += 0.25f)
|
||||
{
|
||||
int holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[holyDust2].noGravity = true;
|
||||
holyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[holyDust2].noGravity = true;
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.002f * i, 0.0125f * i, 8));
|
||||
}
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.002f, 0.015f, 5));
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 261 B |
Binary file not shown.
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 261 B |
@@ -2,9 +2,11 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -35,6 +37,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
@@ -82,6 +85,29 @@ namespace CalamityMod.Projectiles.Boss
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor));
|
||||
}
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4));
|
||||
|
||||
for (float i = 0; i < 1; i += 0.25f)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.075f * i, 24));
|
||||
}
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 16));
|
||||
|
||||
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact.WithPitchOffset(0.6f), Projectile.Center);
|
||||
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
|
||||
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if (info.Damage <= 0)
|
||||
|
||||
@@ -14,11 +14,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.projFrames[Projectile.type] = 2;
|
||||
Main.projFrames[Projectile.type] = 3;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.frame = 1;
|
||||
Projectile.width = 12;
|
||||
Projectile.height = 12;
|
||||
Projectile.friendly = true;
|
||||
@@ -48,9 +49,9 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.frame++;
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
if (Projectile.frame > 1)
|
||||
if (Projectile.frame > 2)
|
||||
{
|
||||
Projectile.frame = 0;
|
||||
Projectile.frame = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user