merge agony
No files matched your search
@@ -52,6 +52,7 @@ using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Skies;
|
||||
using CalamityMod.Tiles;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.World;
|
||||
|
||||
@@ -2546,7 +2546,7 @@ namespace CalamityMod
|
||||
NPCType<ThanatosBody1>(),
|
||||
NPCType<ThanatosBody2>(),
|
||||
NPCType<ThanatosTail>(),
|
||||
NPCType<SCalWormHeart>()
|
||||
NPCType<BrimstoneHeart>()
|
||||
};
|
||||
|
||||
bossMinionList = new List<int>()
|
||||
|
||||
|
After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 490 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 448 B |
|
After Width: | Height: | Size: 300 B |
|
After Width: | Height: | Size: 551 B |
|
After Width: | Height: | Size: 669 B |
|
After Width: | Height: | Size: 558 B |
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 616 B |
|
After Width: | Height: | Size: 550 B |
|
After Width: | Height: | Size: 348 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 260 B |
|
After Width: | Height: | Size: 292 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 304 B |
|
After Width: | Height: | Size: 423 B |
|
After Width: | Height: | Size: 222 B |
|
After Width: | Height: | Size: 592 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 416 B |
|
After Width: | Height: | Size: 530 B |
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 266 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 546 B |
|
After Width: | Height: | Size: 277 B |
|
After Width: | Height: | Size: 212 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 314 B |
@@ -3204,7 +3204,7 @@ namespace CalamityMod.NPCs
|
||||
if (npc.type != NPCType<SupremeCalamitas.SupremeCalamitas>() && npc.type != NPCType<SCalWormBody>() &&
|
||||
npc.type != NPCType<SCalWormBodyWeak>() && npc.type != NPCType<SCalWormHead>() &&
|
||||
npc.type != NPCType<SCalWormTail>() && npc.type != NPCType<SoulSeekerSupreme>() &&
|
||||
npc.type != NPCType<SCalWormHeart>() && npc.type != NPCType<SupremeCataclysm>() &&
|
||||
npc.type != NPCType<BrimstoneHeart>() && npc.type != NPCType<SupremeCataclysm>() &&
|
||||
npc.type != NPCType<SupremeCatastrophe>())
|
||||
{
|
||||
npc.active = false;
|
||||
@@ -3789,7 +3789,7 @@ namespace CalamityMod.NPCs
|
||||
else if (projectile.type == ProjectileType<SakuraBullet>() || projectile.type == ProjectileType<PurpleButterfly>())
|
||||
damage = (int)(damage * 0.75);
|
||||
}
|
||||
else if (npc.type == NPCType<SCalWormHeart>())
|
||||
else if (npc.type == NPCType<BrimstoneHeart>())
|
||||
{
|
||||
// 30% resist to Surge Driver's alt click comets.
|
||||
if (projectile.type == ProjectileType<PrismComet>())
|
||||
|
||||
@@ -10,7 +10,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
public class SCalWormHeart : ModNPC
|
||||
public class BrimstoneHeart : ModNPC
|
||||
{
|
||||
public PrimitiveTrail ChainDrawer = null;
|
||||
public int ChainHeartIndex => (int)npc.ai[0];
|
||||
@@ -18,6 +18,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Brimstone Heart");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -49,7 +50,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
ChainEndpoints.Clear();
|
||||
for (int i = 0; i < reader.ReadInt32(); i++)
|
||||
int endpointCount = reader.ReadInt32();
|
||||
for (int i = 0; i < endpointCount; i++)
|
||||
ChainEndpoints.Add(reader.ReadVector2());
|
||||
}
|
||||
|
||||
@@ -72,7 +74,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float widthInterpolant = Utils.InverseLerp(0f, 0.16f, completionRatio, true) * Utils.InverseLerp(1f, 0.84f, completionRatio, true);
|
||||
widthInterpolant = (float)Math.Pow(widthInterpolant, 8D);
|
||||
float baseWidth = MathHelper.Lerp(4f, 1f, widthInterpolant);
|
||||
float pulseWidth = MathHelper.Lerp(0f, 3.2f, (float)Math.Pow(Math.Sin(Main.GlobalTime * 4.4f + npc.whoAmI * 1.3f + completionRatio), 16D));
|
||||
float pulseWidth = MathHelper.Lerp(0f, 3.2f, (float)Math.Pow(Math.Sin(Main.GlobalTime * 2.6f + npc.whoAmI * 1.3f + completionRatio), 16D));
|
||||
return baseWidth + pulseWidth;
|
||||
}
|
||||
|
||||
@@ -82,6 +84,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
return Color.Lerp(Color.DarkRed * 0.7f, Color.Red, colorInterpolant) * 0.425f;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
int frame = (int)Math.Round((float)Math.Pow(Math.Sin(Main.GlobalTime * 2.6f + npc.whoAmI * 1.3f), 6D) * Main.npcFrameCount[npc.type]);
|
||||
if (frame >= Main.npcFrameCount[npc.type])
|
||||
frame = Main.npcFrameCount[npc.type] - 1;
|
||||
npc.frame.Y = frame * frameHeight;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
if (ChainDrawer is null)
|
||||
@@ -114,6 +124,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
for (int i = 1; i <= 2; i++)
|
||||
{
|
||||
Vector2 heartGoreVelocity = new Vector2((i == 1).ToDirectionInt() * 3f, Main.rand.NextFloat(-2f, 0f));
|
||||
Gore.NewGorePerfect(npc.Center, heartGoreVelocity, mod.GetGoreSlot($"Gores/SupremeCalamitas/BrimstoneHeart_Gore{i}"), npc.scale);
|
||||
}
|
||||
for (int i = 0; i < ChainEndpoints.Count; i++)
|
||||
TendrilDestructionEffects(i);
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -1,107 +0,0 @@
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
public class SCalSky : CustomSky
|
||||
{
|
||||
private bool isActive = false;
|
||||
private float intensity = 0f;
|
||||
private int SCalIndex = -1;
|
||||
public static float OverridingIntensity = 0f;
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (isActive && intensity < 1f)
|
||||
{
|
||||
intensity += 0.01f;
|
||||
}
|
||||
else if (!isActive && intensity > 0f)
|
||||
{
|
||||
intensity -= 0.01f;
|
||||
}
|
||||
}
|
||||
|
||||
private float GetIntensity()
|
||||
{
|
||||
if (CalamityUtils.CountProjectiles(ModContent.ProjectileType<SCalRitualDrama>()) > 0)
|
||||
return OverridingIntensity;
|
||||
|
||||
OverridingIntensity = 0f;
|
||||
if (this.UpdateSCalIndex())
|
||||
{
|
||||
float x = 0f;
|
||||
if (this.SCalIndex != -1)
|
||||
{
|
||||
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.SCalIndex].Center);
|
||||
}
|
||||
return 1f - Utils.SmoothStep(3000f, 6000f, x);
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override Color OnTileColor(Color inColor)
|
||||
{
|
||||
float intensity = this.GetIntensity();
|
||||
return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
|
||||
}
|
||||
|
||||
private bool UpdateSCalIndex()
|
||||
{
|
||||
int SCalType = ModContent.NPCType<SupremeCalamitas>();
|
||||
if (SCalIndex >= 0 && Main.npc[SCalIndex].active && Main.npc[SCalIndex].type == SCalType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
SCalIndex = -1;
|
||||
for (int i = 0; i < Main.npc.Length; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].type == SCalType)
|
||||
{
|
||||
SCalIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//this.DoGIndex = DoGIndex;
|
||||
return SCalIndex != -1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (maxDepth >= 0 && minDepth < 0)
|
||||
{
|
||||
float intensity = this.GetIntensity();
|
||||
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity);
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetCloudAlpha()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void Activate(Vector2 position, params object[] args)
|
||||
{
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
public override void Deactivate(params object[] args)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override bool IsActive()
|
||||
{
|
||||
return isActive || intensity > 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
public class SCalWormArm : ModNPC
|
||||
{
|
||||
public class SepulcherArmLimb
|
||||
{
|
||||
public Vector2 Center;
|
||||
public float Rotation;
|
||||
|
||||
public SepulcherArmLimb(Vector2 center, float rotation)
|
||||
{
|
||||
Center = center;
|
||||
Rotation = rotation;
|
||||
}
|
||||
|
||||
public void SendData(BinaryWriter writer)
|
||||
{
|
||||
writer.WritePackedVector2(Center);
|
||||
writer.Write(Rotation);
|
||||
}
|
||||
|
||||
public void ReceiveData(BinaryReader reader)
|
||||
{
|
||||
Center = reader.ReadPackedVector2();
|
||||
Rotation = reader.ReadSingle();
|
||||
}
|
||||
}
|
||||
|
||||
public NPC SegmentToAttachTo => Main.npc[(int)npc.ai[0]];
|
||||
public bool CurrentlyMoving
|
||||
{
|
||||
get => npc.ai[1] == 1f;
|
||||
set => npc.ai[1] = value.ToInt();
|
||||
}
|
||||
public Vector2 MoveDestination
|
||||
{
|
||||
get => new Vector2(npc.ai[2], npc.ai[3]);
|
||||
set
|
||||
{
|
||||
npc.ai[2] = value.X;
|
||||
npc.ai[3] = value.Y;
|
||||
}
|
||||
}
|
||||
public ref float Time => ref npc.localAI[0];
|
||||
public bool ReelingBack
|
||||
{
|
||||
get => npc.localAI[1] == 0f;
|
||||
set => npc.localAI[1] = 1f - value.ToInt();
|
||||
}
|
||||
public Player Target => Main.player[npc.target];
|
||||
public SepulcherArmLimb[] Limbs = new SepulcherArmLimb[4];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sepulcher");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.damage = 0;
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 34;
|
||||
npc.height = 48;
|
||||
npc.defense = 0;
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
global.unbreakableDR = true;
|
||||
npc.lifeMax = CalamityWorld.revenge ? 345000 : 300000;
|
||||
npc.aiStyle = aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = Main.expertMode ? 1.35f : 1.2f;
|
||||
npc.dontTakeDamage = true;
|
||||
npc.alpha = 255;
|
||||
npc.chaseable = false;
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.netAlways = true;
|
||||
npc.dontCountMe = true;
|
||||
|
||||
for (int i = 0; i < Limbs.Length; i++)
|
||||
Limbs[i] = new SepulcherArmLimb(npc.Center, 0f);
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
for (int i = 0; i < Limbs.Length; i++)
|
||||
Limbs[i].SendData(writer);
|
||||
writer.Write(npc.rotation);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
for (int i = 0; i < Limbs.Length; i++)
|
||||
Limbs[i].ReceiveData(reader);
|
||||
npc.rotation = reader.ReadSingle();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Die if the segment is not present.
|
||||
if (!Main.npc.IndexInRange((int)npc.ai[0]) || !Main.npc[(int)npc.ai[0]].active)
|
||||
{
|
||||
npc.life = 0;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
return;
|
||||
}
|
||||
|
||||
npc.Opacity = SegmentToAttachTo.Opacity;
|
||||
npc.TargetClosest(false);
|
||||
|
||||
Vector2 idealMovePosition = SegmentToAttachTo.Center;
|
||||
float sideFactor = MathHelper.Lerp(200f, 18f, Utils.InverseLerp(-0.51f, -0.06f, npc.rotation, true));
|
||||
float aheadFactor = MathHelper.Lerp(284f, 680f, Utils.InverseLerp(-0.51f, -0.06f, npc.rotation, true));
|
||||
idealMovePosition += (SegmentToAttachTo.rotation + npc.rotation * npc.direction - MathHelper.PiOver2).ToRotationVector2() * npc.scale * aheadFactor;
|
||||
idealMovePosition += (SegmentToAttachTo.rotation + npc.rotation * npc.direction - MathHelper.PiOver2 + MathHelper.PiOver2 * npc.direction).ToRotationVector2() * npc.scale * sideFactor;
|
||||
npc.Center = idealMovePosition;
|
||||
UpdateLimbs();
|
||||
|
||||
if (ReelingBack)
|
||||
{
|
||||
npc.rotation -= 0.066f;
|
||||
if (npc.rotation < -0.55f)
|
||||
ReelingBack = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.rotation += 0.029f;
|
||||
if (npc.rotation > 0.77f)
|
||||
ReelingBack = true;
|
||||
}
|
||||
|
||||
Time++;
|
||||
}
|
||||
|
||||
public void MoveToDestination()
|
||||
{
|
||||
npc.Center = Vector2.Lerp(npc.Center, MoveDestination, 0.05f);
|
||||
npc.Center = npc.Center.MoveTowards(MoveDestination, 10f);
|
||||
|
||||
// Stop moving if sufficiently close to the desired destination.
|
||||
if (npc.WithinRange(MoveDestination, 15f))
|
||||
{
|
||||
npc.Center = MoveDestination;
|
||||
MoveDestination = Vector2.Zero;
|
||||
CurrentlyMoving = false;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateLimbs()
|
||||
{
|
||||
Vector2 offsetFromSegment = Vector2.Zero;
|
||||
|
||||
offsetFromSegment += new Vector2(npc.direction * 60f, 55f).RotatedBy(SegmentToAttachTo.rotation - (MathHelper.PiOver2 - npc.rotation * 1.7f - 0.77f) * npc.direction).SafeNormalize(Vector2.UnitY) * 92f;
|
||||
Limbs[0].Center = SegmentToAttachTo.Center + offsetFromSegment;
|
||||
Limbs[0].Rotation = offsetFromSegment.ToRotation();
|
||||
|
||||
Limbs[1].Rotation = npc.AngleFrom(Limbs[0].Center);
|
||||
Limbs[1].Center = Limbs[0].Center + offsetFromSegment * 0.5f + (npc.Center - Limbs[0].Center).SafeNormalize(Vector2.UnitY) * 84f;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D armTexture = Main.npcTexture[npc.type];
|
||||
Texture2D foreArmTexture = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormForeArm");
|
||||
Texture2D handTexture = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormHand");
|
||||
|
||||
Vector2 forearmDrawPosition = Limbs[0].Center - Main.screenPosition;
|
||||
Color drawColor = Lighting.GetColor((int)(Limbs[0].Center.X / 16), (int)(Limbs[0].Center.Y / 16));
|
||||
spriteBatch.Draw(foreArmTexture, forearmDrawPosition, null, drawColor, Limbs[0].Rotation + MathHelper.PiOver2, foreArmTexture.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
|
||||
|
||||
Vector2 armDrawPosition = Limbs[1].Center - Main.screenPosition;
|
||||
drawColor = Lighting.GetColor((int)(Limbs[1].Center.X / 16), (int)(Limbs[1].Center.Y / 16));
|
||||
spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), npc.scale, SpriteEffects.FlipVertically, 0f);
|
||||
|
||||
Vector2 handDrawPosition = armDrawPosition;
|
||||
SpriteEffects handDirection = npc.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
|
||||
spriteBatch.Draw(handTexture, handDrawPosition, null, drawColor, Limbs[1].Rotation - MathHelper.PiOver2, handTexture.Size() * new Vector2(0.5f, 0f), npc.scale, handDirection, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
Vector2 forearmGoreSpawnPosition = Limbs[0].Center + Main.rand.NextVector2Circular(6f, 6f);
|
||||
Vector2 armGoreSpawnPosition = Limbs[1].Center + Main.rand.NextVector2Circular(6f, 6f);
|
||||
Vector2 handGoreSpawnPosition = armGoreSpawnPosition + Main.rand.NextVector2Circular(6f, 6f);
|
||||
|
||||
Gore.NewGorePerfect(armGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherArm_Gore"), npc.scale);
|
||||
for (int i = 1; i <= 2; i++)
|
||||
Gore.NewGorePerfect(forearmGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherForearm_Gore{i}"), npc.scale);
|
||||
for (int i = 1; i <= 2; i++)
|
||||
Gore.NewGorePerfect(handGoreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherHand_Gore{i}"), npc.scale);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive() => false;
|
||||
|
||||
public override bool PreNPCLoot() => false;
|
||||
|
||||
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 769 B |
@@ -12,8 +12,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public class SCalWormBody : ModNPC
|
||||
{
|
||||
private bool setAlpha = false;
|
||||
public NPC AheadSegment => Main.npc[(int)npc.ai[1]];
|
||||
public NPC HeadSegment => Main.npc[(int)npc.ai[2]];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sepulcher");
|
||||
}
|
||||
@@ -22,8 +24,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
npc.damage = 0; //70
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 20; //28
|
||||
npc.height = 20; //28
|
||||
npc.width = npc.height = 48;
|
||||
npc.defense = 0;
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
@@ -43,8 +44,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
npc.dontCountMe = true;
|
||||
}
|
||||
@@ -73,85 +72,49 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.realLife = (int)npc.ai[2];
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
if (npc.ai[1] <= 0f)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (Main.npc[(int)npc.ai[1]].life <= 0 || npc.life <= 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
npc.life = 0;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
}
|
||||
bool shouldDie = false;
|
||||
if (npc.ai[1] <= 0f)
|
||||
shouldDie = true;
|
||||
else if (AheadSegment.life <= 0 || !AheadSegment.active || npc.life <= 0)
|
||||
shouldDie = true;
|
||||
|
||||
if (Main.npc[(int)npc.ai[1]].alpha < 128 && !setAlpha)
|
||||
{
|
||||
if (npc.alpha != 0)
|
||||
{
|
||||
for (int num934 = 0; num934 < 2; num934++)
|
||||
{
|
||||
int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num935].noGravity = true;
|
||||
Main.dust[num935].noLight = true;
|
||||
}
|
||||
}
|
||||
npc.alpha -= 42;
|
||||
if (npc.alpha <= 0)
|
||||
{
|
||||
setAlpha = true;
|
||||
npc.alpha = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.alpha = Main.npc[(int)npc.ai[2]].alpha;
|
||||
}
|
||||
if (shouldDie)
|
||||
{
|
||||
npc.life = 0;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
}
|
||||
|
||||
Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2);
|
||||
float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2);
|
||||
num191 = (int)(num191 / 16f) * 16;
|
||||
num192 = (int)(num192 / 16f) * 16;
|
||||
vector18.X = (int)(vector18.X / 16f) * 16;
|
||||
vector18.Y = (int)(vector18.Y / 16f) * 16;
|
||||
num191 -= vector18.X;
|
||||
num192 -= vector18.Y;
|
||||
float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192);
|
||||
if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length)
|
||||
{
|
||||
try
|
||||
{
|
||||
vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X;
|
||||
num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f;
|
||||
num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192);
|
||||
int num194 = npc.width;
|
||||
num193 = (num193 - num194) / num193;
|
||||
num191 *= num193;
|
||||
num192 *= num193;
|
||||
npc.velocity = Vector2.Zero;
|
||||
npc.position.X = npc.position.X + num191;
|
||||
npc.position.Y = npc.position.Y + num192;
|
||||
if (num191 < 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
}
|
||||
else if (num191 > 0f)
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (AheadSegment.alpha < 128 && !setAlpha)
|
||||
{
|
||||
if (npc.alpha != 0)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Dust fire = Dust.NewDustDirect(npc.position, npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
fire.noGravity = true;
|
||||
fire.noLight = true;
|
||||
}
|
||||
}
|
||||
npc.alpha -= 42;
|
||||
if (npc.alpha <= 0)
|
||||
{
|
||||
setAlpha = true;
|
||||
npc.alpha = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.alpha = HeadSegment.alpha;
|
||||
|
||||
if (Main.npc.IndexInRange((int)npc.ai[1]))
|
||||
{
|
||||
Vector2 offsetToAheadSegment = AheadSegment.Center - npc.Center;
|
||||
npc.rotation = offsetToAheadSegment.ToRotation() + MathHelper.PiOver2;
|
||||
npc.velocity = Vector2.Zero;
|
||||
npc.Center = AheadSegment.Center - offsetToAheadSegment.SafeNormalize(Vector2.UnitY) * 52f;
|
||||
npc.spriteDirection = (offsetToAheadSegment.X > 0f).ToDirectionInt();
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
|
||||
{
|
||||
@@ -174,7 +137,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (npc.spriteDirection == 1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = npc.localAI[3] == 1f ? ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormBodyAlt") : Main.npcTexture[npc.type];
|
||||
Texture2D texture2D15 = npc.localAI[3] / 2f % 2f == 0f ? ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormBodyAlt") : Main.npcTexture[npc.type];
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
|
||||
|
||||
Vector2 vector43 = npc.Center - Main.screenPosition;
|
||||
@@ -182,14 +145,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
if (npc.localAI[3] == 1f)
|
||||
{
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormBodyAltGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -207,29 +162,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
int variant = (int)(npc.localAI[3] / 2f % 2f);
|
||||
if (variant == 0)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
for (int i = 1; i <= 9; i++)
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Vector2 goreSpawnPosition = npc.Center;
|
||||
Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(2f, 2f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherBody1_Gore{i}"), npc.scale);
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
else
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
for (int i = 1; i <= 7; i++)
|
||||
{
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Vector2 goreSpawnPosition = npc.Center;
|
||||
Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(2f, 2f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherBody2_Gore{i}"), npc.scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 920 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 249 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.IO;
|
||||
@@ -11,10 +12,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public class SCalWormBodyWeak : ModNPC
|
||||
{
|
||||
private bool setAlpha = false;
|
||||
public NPC AheadSegment => Main.npc[(int)npc.ai[1]];
|
||||
public NPC HeadSegment => Main.npc[(int)npc.ai[2]];
|
||||
public ref float AttackTimer => ref npc.localAI[0];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Brimstone Heart");
|
||||
Main.npcFrameCount[npc.type] = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -27,70 +32,60 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.aiStyle = -1;
|
||||
aiType = -1;
|
||||
npc.knockBackResist = 0f;
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
global.unbreakableDR = true;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
}
|
||||
npc.scale = Main.expertMode ? 1.35f : 1.2f;
|
||||
npc.alpha = 255;
|
||||
npc.chaseable = false;
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit13;
|
||||
npc.DeathSound = SoundID.NPCDeath13;
|
||||
npc.netAlways = true;
|
||||
npc.dontCountMe = true;
|
||||
}
|
||||
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
global.unbreakableDR = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.localAI[0]);
|
||||
writer.Write(AttackTimer);
|
||||
writer.Write(setAlpha);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.localAI[0] = reader.ReadSingle();
|
||||
AttackTimer = reader.ReadSingle();
|
||||
setAlpha = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (npc.ai[2] > 0f)
|
||||
{
|
||||
npc.realLife = (int)npc.ai[2];
|
||||
}
|
||||
|
||||
bool flag = false;
|
||||
bool shouldDie = false;
|
||||
if (npc.ai[1] <= 0f)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
else if (Main.npc[(int)npc.ai[1]].life <= 0 || npc.life <= 0)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
if (flag)
|
||||
shouldDie = true;
|
||||
else if (AheadSegment.life <= 0 || !AheadSegment.active || npc.life <= 0)
|
||||
shouldDie = true;
|
||||
|
||||
if (shouldDie)
|
||||
{
|
||||
npc.life = 0;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
}
|
||||
|
||||
if (Main.npc[(int)npc.ai[1]].alpha < 128 && !setAlpha)
|
||||
if (AheadSegment.alpha < 128 && !setAlpha)
|
||||
{
|
||||
if (npc.alpha != 0)
|
||||
{
|
||||
for (int num934 = 0; num934 < 2; num934++)
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int num935 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num935].noGravity = true;
|
||||
Main.dust[num935].noLight = true;
|
||||
Dust fire = Dust.NewDustDirect(npc.position, npc.width, npc.height, 182, 0f, 0f, 100, default, 2f);
|
||||
fire.noGravity = true;
|
||||
fire.noLight = true;
|
||||
}
|
||||
}
|
||||
npc.alpha -= 42;
|
||||
@@ -101,16 +96,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.alpha = Main.npc[(int)npc.ai[2]].alpha;
|
||||
}
|
||||
npc.alpha = HeadSegment.alpha;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
AttackTimer += CalamityWorld.malice ? 1.5f : 1f;
|
||||
if (AttackTimer >= 900f)
|
||||
{
|
||||
npc.localAI[0] += CalamityWorld.malice ? 1.5f : 1f;
|
||||
if (npc.localAI[0] >= 900f)
|
||||
AttackTimer = 0f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
int type = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
int totalProjectiles = 4;
|
||||
@@ -121,48 +114,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Vector2 velocity = spinningPoint.RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, velocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), npc.Center);
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), npc.Center);
|
||||
}
|
||||
|
||||
Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2);
|
||||
float num192 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2);
|
||||
num191 = (int)(num191 / 16f) * 16;
|
||||
num192 = (int)(num192 / 16f) * 16;
|
||||
vector18.X = (int)(vector18.X / 16f) * 16;
|
||||
vector18.Y = (int)(vector18.Y / 16f) * 16;
|
||||
num191 -= vector18.X;
|
||||
num192 -= vector18.Y;
|
||||
float num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192);
|
||||
if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length)
|
||||
if (Main.npc.IndexInRange((int)npc.ai[1]))
|
||||
{
|
||||
try
|
||||
{
|
||||
vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X;
|
||||
num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
npc.rotation = (float)System.Math.Atan2(num192, num191) + 1.57f;
|
||||
num193 = (float)System.Math.Sqrt(num191 * num191 + num192 * num192);
|
||||
int num194 = npc.width;
|
||||
num193 = (num193 - num194) / num193;
|
||||
num191 *= num193;
|
||||
num192 *= num193;
|
||||
Vector2 offsetToAheadSegment = AheadSegment.Center - npc.Center;
|
||||
npc.rotation = offsetToAheadSegment.ToRotation() + MathHelper.PiOver2;
|
||||
npc.velocity = Vector2.Zero;
|
||||
npc.position.X = npc.position.X + num191;
|
||||
npc.position.Y = npc.position.Y + num192;
|
||||
if (num191 < 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
}
|
||||
else if (num191 > 0f)
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
}
|
||||
npc.Center = AheadSegment.Center - offsetToAheadSegment.SafeNormalize(Vector2.UnitY) * 34f;
|
||||
npc.spriteDirection = (offsetToAheadSegment.X > 0f).ToDirectionInt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,6 +144,27 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
npc.frameCounter++;
|
||||
npc.frame.Y = ((int)(npc.frameCounter / 5) + npc.whoAmI) % Main.npcFrameCount[npc.type] * frameHeight;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.life <= 0)
|
||||
{
|
||||
for (int i = 0; i < Main.rand.Next(1, 3 + 1); i++)
|
||||
{
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Vector2 soulVelocity = -Vector2.UnitY.RotatedByRandom(0.53f) * Main.rand.NextFloat(2.5f, 4f);
|
||||
Projectile.NewProjectile(npc.Center, soulVelocity, ModContent.ProjectileType<SepulcherSoul>(), 0, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
|
||||
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 874 B |
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 839 B |
@@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.damage = 0; //150
|
||||
npc.npcSlots = 5f;
|
||||
npc.width = 62; //324
|
||||
npc.height = 78; //216
|
||||
npc.height = 64; //216
|
||||
npc.defense = 0;
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
@@ -36,20 +36,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.aiStyle = -1; //new
|
||||
aiType = -1; //new
|
||||
npc.knockBackResist = 0f;
|
||||
npc.scale = 1.2f;
|
||||
if (Main.expertMode)
|
||||
{
|
||||
npc.scale = 1.35f;
|
||||
}
|
||||
npc.alpha = 255;
|
||||
npc.scale = Main.expertMode ? 1.35f : 1.2f;
|
||||
npc.scale *= 1.25f;
|
||||
|
||||
npc.alpha = 255;
|
||||
npc.chaseable = false;
|
||||
npc.behindTiles = true;
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
npc.netAlways = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
@@ -81,44 +77,58 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
|
||||
npc.TargetClosest();
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
if (npc.ai[2] > 0f)
|
||||
{
|
||||
npc.realLife = (int)npc.ai[2];
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (!TailSpawned && npc.ai[0] == 0f)
|
||||
{
|
||||
float rotationalOffset = 0f;
|
||||
int Previous = npc.whoAmI;
|
||||
for (int num36 = 0; num36 < maxLength; num36++)
|
||||
for (int i = 0; i < maxLength; i++)
|
||||
{
|
||||
int lol;
|
||||
if (num36 >= 0 && num36 < minLength && num36 % 2 == 0)
|
||||
if (i >= 0 && i < minLength && i % 2 == 1)
|
||||
{
|
||||
lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<SCalWormBodyWeak>(), npc.whoAmI);
|
||||
Main.npc[lol].localAI[0] += passedVar;
|
||||
passedVar += 36f;
|
||||
}
|
||||
else if (num36 >= 0 && num36 < minLength)
|
||||
else if (i >= 0 && i < minLength)
|
||||
{
|
||||
lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<SCalWormBody>(), npc.whoAmI);
|
||||
if (npc.localAI[0] % 2 == 0)
|
||||
{
|
||||
Main.npc[lol].localAI[3] = 1f;
|
||||
npc.localAI[0] = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.localAI[0] = 2f;
|
||||
}
|
||||
}
|
||||
Main.npc[lol].localAI[3] = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.height / 2), ModContent.NPCType<SCalWormTail>(), npc.whoAmI);
|
||||
}
|
||||
|
||||
// Create arms.
|
||||
if (i >= 3 && i % 4 == 0)
|
||||
{
|
||||
NPC segment = Main.npc[lol];
|
||||
int arm = NPC.NewNPC((int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType<SCalWormArm>(), lol);
|
||||
if (Main.npc.IndexInRange(arm))
|
||||
{
|
||||
Main.npc[arm].ai[0] = lol;
|
||||
Main.npc[arm].direction = 1;
|
||||
Main.npc[arm].rotation = rotationalOffset;
|
||||
}
|
||||
|
||||
rotationalOffset += MathHelper.Pi / 6f;
|
||||
|
||||
arm = NPC.NewNPC((int)segment.Center.X, (int)segment.Center.Y, ModContent.NPCType<SCalWormArm>(), lol);
|
||||
if (Main.npc.IndexInRange(arm))
|
||||
{
|
||||
Main.npc[arm].ai[0] = lol;
|
||||
Main.npc[arm].direction = -1;
|
||||
Main.npc[arm].rotation = rotationalOffset + MathHelper.Pi;
|
||||
}
|
||||
|
||||
rotationalOffset += MathHelper.Pi / 6f;
|
||||
rotationalOffset = MathHelper.WrapAngle(rotationalOffset);
|
||||
}
|
||||
|
||||
Main.npc[lol].realLife = npc.whoAmI;
|
||||
Main.npc[lol].ai[2] = npc.whoAmI;
|
||||
Main.npc[lol].ai[1] = Previous;
|
||||
@@ -133,30 +143,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.player[npc.target].dead || !NPC.AnyNPCs(ModContent.NPCType<SCalWormHeart>()) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
npc.alpha += 5;
|
||||
if (npc.alpha >= 255)
|
||||
{
|
||||
npc.alpha = 255;
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].type == npc.type || Main.npc[i].type == ModContent.NPCType<SCalWormBody>() || Main.npc[i].type == ModContent.NPCType<SCalWormBodyWeak>() || Main.npc[i].type == ModContent.NPCType<SCalWormTail>())
|
||||
{
|
||||
Main.npc[i].active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.alpha -= 42;
|
||||
if (npc.alpha < 0)
|
||||
{
|
||||
npc.alpha = 0;
|
||||
}
|
||||
}
|
||||
if (Main.player[npc.target].dead || !NPC.AnyNPCs(ModContent.NPCType<BrimstoneHeart>()) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/SepulcherDeath"), Main.player[npc.target].Center);
|
||||
npc.life = 0;
|
||||
npc.HitEffect();
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
else
|
||||
npc.Opacity = MathHelper.Clamp(npc.Opacity + 0.165f, 0f, 1f);
|
||||
|
||||
Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num191 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2);
|
||||
@@ -304,11 +301,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormHeadGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -334,33 +326,20 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
Vector2 goreSpawnPosition = npc.Center;
|
||||
|
||||
// Spawn at a slight offset when spawning mandibles.
|
||||
if (i == 2)
|
||||
goreSpawnPosition += npc.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver4) * 16f;
|
||||
if (i == 3)
|
||||
goreSpawnPosition += npc.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-MathHelper.PiOver4) * 16f;
|
||||
Gore.NewGorePerfect(goreSpawnPosition, npc.velocity, mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherHead_Gore{i}"), npc.scale);
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 642 B |
|
Before Width: | Height: | Size: 531 B |
@@ -42,8 +42,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.noGravity = true;
|
||||
npc.noTileCollide = true;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.netAlways = true;
|
||||
npc.dontCountMe = true;
|
||||
}
|
||||
@@ -164,11 +162,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
vector43 += vector11 * npc.scale + new Vector2(0f, npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SCalWormTailGlow");
|
||||
Color color37 = Color.Lerp(Color.White, Color.Red, 0.5f);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, npc.frame, color37, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,32 +183,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
{
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = 50;
|
||||
npc.height = 50;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 5; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 10; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
{
|
||||
for (int i = 1; i <= 2; i++)
|
||||
{
|
||||
Vector2 goreSpawnPosition = npc.Center;
|
||||
if (i == 2)
|
||||
goreSpawnPosition -= (npc.rotation - MathHelper.PiOver2).ToRotationVector2() * 20f;
|
||||
Gore.NewGorePerfect(goreSpawnPosition, Main.rand.NextVector2Circular(3f, 3f), mod.GetGoreSlot($"Gores/SupremeCalamitas/SepulcherTail_Gore{i}"), npc.scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 471 B |
@@ -16,11 +16,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
private int timer = 0;
|
||||
private bool start = true;
|
||||
public NPC SCal => Main.npc[CalamityGlobalNPC.SCal];
|
||||
public Player Target => Main.player[npc.target];
|
||||
public Vector2 EyePosition => npc.Center + new Vector2(npc.spriteDirection == -1 ? 40f : -36f, 16f);
|
||||
public ref float RotationalDegreeOffset => ref npc.ai[1];
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Soul Seeker");
|
||||
Main.npcFrameCount[npc.type] = 8;
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
NPCID.Sets.TrailingMode[npc.type] = 1;
|
||||
}
|
||||
|
||||
@@ -37,8 +41,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.defense = 60;
|
||||
npc.DR_NERD(0.25f);
|
||||
npc.LifeMaxNERB(Main.expertMode ? 24000 : 15000, 28000);
|
||||
npc.HitSound = SoundID.NPCHit4;
|
||||
npc.DeathSound = SoundID.NPCDeath14;
|
||||
npc.DeathSound = SoundID.DD2_SkeletonDeath;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
@@ -62,33 +65,35 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
public override bool PreAI()
|
||||
{
|
||||
NPC parent = Main.npc[CalamityGlobalNPC.SCal];
|
||||
bool expertMode = Main.expertMode;
|
||||
// Die if SCal is no longer present.
|
||||
if (CalamityGlobalNPC.SCal < 0 || !SCal.active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (start)
|
||||
{
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
}
|
||||
npc.ai[1] = npc.ai[0];
|
||||
for (int i = 0; i < 10; i++)
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
RotationalDegreeOffset = npc.ai[0];
|
||||
start = false;
|
||||
}
|
||||
|
||||
// Get a target
|
||||
if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
if (npc.target < 0 || npc.target == Main.maxPlayers || Target.dead || !Target.active)
|
||||
npc.TargetClosest();
|
||||
|
||||
// Despawn safety, make sure to target another player if the current player target is too far away
|
||||
if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
|
||||
// Target another player if the current player target is too far away
|
||||
if (!npc.WithinRange(Target.Center, CalamityGlobalNPC.CatchUpDistance200Tiles))
|
||||
npc.TargetClosest();
|
||||
|
||||
Vector2 direction = Main.player[npc.target].Center - npc.Center;
|
||||
direction.Normalize();
|
||||
direction *= 9f;
|
||||
npc.rotation = direction.ToRotation();
|
||||
npc.spriteDirection = (Target.Center.X < npc.Center.X).ToDirectionInt();
|
||||
|
||||
timer++;
|
||||
int timerLimit = CalamityWorld.malice ? 120 : 180;
|
||||
if (timer > timerLimit)
|
||||
int shootRate = CalamityWorld.malice ? 120 : 180;
|
||||
if (timer > shootRate)
|
||||
{
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
@@ -96,7 +101,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (seeker.type == npc.type)
|
||||
{
|
||||
if (seeker == npc)
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), parent.Center);
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), SCal.Center);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -104,24 +109,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
int type = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(npc.Center, direction, type, damage, 1f, Main.myPlayer);
|
||||
Vector2 shootVelocity = (Target.Center - EyePosition).SafeNormalize(Vector2.UnitY) * 9f;
|
||||
Projectile.NewProjectile(EyePosition, shootVelocity, type, damage, 1f, Main.myPlayer);
|
||||
}
|
||||
timer = 0;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
if (CalamityGlobalNPC.SCal < 0 || !parent.active)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
Player player = Main.player[npc.target];
|
||||
double deg = npc.ai[1];
|
||||
double rad = deg * (Math.PI / 180);
|
||||
double dist = 300;
|
||||
npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2;
|
||||
npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2;
|
||||
npc.ai[1] += 0.5f; //2
|
||||
|
||||
npc.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * 300f - npc.Size * 0.5f;
|
||||
RotationalDegreeOffset += 0.5f;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -159,16 +155,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SoulSeekerSupremeGores/SupremeSoulSeeker"), npc.scale);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SoulSeekerSupremeGores/SupremeSoulSeeker2"), npc.scale);
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SoulSeekerSupremeGores/SupremeSoulSeeker3"), npc.scale);
|
||||
|
||||
for (int i = 1; i <= 5; i++)
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot($"Gores/SoulSeekerSupremeGores/SupremeSoulSeeker_Gore{i}"), npc.scale);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckActive()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CheckActive() => false;
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
@@ -180,7 +173,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
|
||||
Color color36 = Color.White;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 5;
|
||||
int num153 = 2;
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -86,8 +86,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
private int spawnY = 0;
|
||||
private int spawnYReset = 0;
|
||||
private int spawnYAdd = 0;
|
||||
private int bulletHellCounter = 0;
|
||||
private int bulletHellCounter2 = 0;
|
||||
public int bulletHellCounter = 0;
|
||||
public int bulletHellCounter2 = 0;
|
||||
private int attackCastDelay = 0;
|
||||
private int hitTimer = 0;
|
||||
|
||||
@@ -415,7 +415,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
|
||||
// Summon a shield if the next attack will be a charge.
|
||||
else if (!npc.dontTakeDamage && ((willCharge && AttackCloseToBeingOver) || npc.ai[1] == 2f))
|
||||
else if (((willCharge && AttackCloseToBeingOver) || npc.ai[1] == 2f) && bulletHellCounter2 % 900 == 0)
|
||||
{
|
||||
if (npc.ai[1] != 2f)
|
||||
{
|
||||
@@ -2543,20 +2543,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
|
||||
// And play a fire-like sound effect.
|
||||
Main.PlaySound(SoundID.DD2_BetsyWindAttack, target.Center);
|
||||
hasSummonedSepulcher1 = true;
|
||||
hasSummonedSepulcher2 = npc.life <= npc.lifeMax * 0.08;
|
||||
|
||||
// TODO: Resprite brimstone hearts a bit.
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
List<int> hearts = new List<int>();
|
||||
for (int x = 0; x < 5; x++)
|
||||
{
|
||||
hearts.Add(NPC.NewNPC(spawnX + 50, tempSpawnY, ModContent.NPCType<SCalWormHeart>(), 0, 0f, 0f, 0f, 0f, 255));
|
||||
hearts.Add(NPC.NewNPC(spawnX + 50, tempSpawnY, ModContent.NPCType<BrimstoneHeart>(), 0, 0f, 0f, 0f, 0f, 255));
|
||||
spawnX += spawnXAdd;
|
||||
|
||||
hearts.Add(NPC.NewNPC(spawnX2 - 50, tempSpawnY, ModContent.NPCType<SCalWormHeart>(), 0, 0f, 0f, 0f, 0f, 255));
|
||||
hearts.Add(NPC.NewNPC(spawnX2 - 50, tempSpawnY, ModContent.NPCType<BrimstoneHeart>(), 0, 0f, 0f, 0f, 0f, 255));
|
||||
spawnX2 -= spawnXAdd;
|
||||
tempSpawnY += spawnYAdd;
|
||||
}
|
||||
@@ -2569,6 +2567,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType<SCalWormHead>());
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/SepulcherSpawn"), target.Center);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2662,7 +2662,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
public void ConnectAllBrimstoneHearts(List<int> heartIndices)
|
||||
{
|
||||
int heartType = ModContent.NPCType<SCalWormHeart>();
|
||||
int heartType = ModContent.NPCType<BrimstoneHeart>();
|
||||
|
||||
// Ensure that the hearts go in order based on the arena.
|
||||
IEnumerable<NPC> hearts = heartIndices.Select(i => Main.npc[i]);
|
||||
@@ -2695,14 +2695,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (tries >= 100)
|
||||
endpoint.X = MathHelper.Clamp(endpoint.X, safeBox.Left, safeBox.Right);
|
||||
|
||||
heart.ModNPC<SCalWormHeart>().ChainEndpoints.Add(endpoint);
|
||||
heart.ModNPC<BrimstoneHeart>().ChainEndpoints.Add(endpoint);
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
endpoint.X = heart.Center.X + Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(45f, 360f);
|
||||
endpoint.X = MathHelper.Clamp(endpoint.X, safeBox.Left, safeBox.Right);
|
||||
heart.ModNPC<SCalWormHeart>().ChainEndpoints.Add(endpoint);
|
||||
heart.ModNPC<BrimstoneHeart>().ChainEndpoints.Add(endpoint);
|
||||
}
|
||||
|
||||
heart.netUpdate = true;
|
||||
@@ -2945,7 +2945,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (lifeRatio < 0.05f)
|
||||
flickerPower += 0.1f;
|
||||
float opacity = forcefieldOpacity;
|
||||
opacity *= MathHelper.Lerp(1f, 1f - flickerPower, (float)Math.Pow(Math.Cos(Main.GlobalTime * MathHelper.Lerp(3f, 9f, flickerPower)), 24D));
|
||||
opacity *= MathHelper.Lerp(1f, MathHelper.Max(1f - flickerPower, 0.56f), (float)Math.Pow(Math.Cos(Main.GlobalTime * MathHelper.Lerp(3f, 5f, flickerPower)), 24D));
|
||||
|
||||
// During/prior to a charge the forcefield is always darker than usual and thus its intensity is also higher.
|
||||
if (!npc.dontTakeDamage && (willCharge || npc.ai[1] == 2f))
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.Skies;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class SepulcherSoul : ModProjectile
|
||||
{
|
||||
public ref float Time => ref projectile.ai[0];
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Tormented Soul");
|
||||
Main.projFrames[projectile.type] = 3;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = projectile.height = 16;
|
||||
projectile.Opacity = 0f;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 120;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.frame = Main.rand.Next(Main.projFrames[projectile.type]);
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
Vector2 idealVelocity = Vector2.Zero;
|
||||
idealVelocity.X = (float)(Math.Sin(Time / 27f + projectile.identity * 1.1f) + (float)Math.Cos(Math.E * (Time / 27f + projectile.identity * 1.1f))) * 4f;
|
||||
idealVelocity.Y = MathHelper.SmoothStep(-3f, -9f, (float)Math.Sin(Time / 23f + projectile.identity * 1.1f) * 0.5f + 0.5f);
|
||||
projectile.velocity = Vector2.Lerp(projectile.velocity, idealVelocity, 0.075f);
|
||||
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true) * Utils.InverseLerp(0f, 25f, projectile.timeLeft, true);
|
||||
Time++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 748 B |
@@ -1,8 +1,9 @@
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
namespace CalamityMod.Skies
|
||||
{
|
||||
public class SCalScreenShaderData : ScreenShaderData
|
||||
{
|
||||
@@ -0,0 +1,246 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.SupremeCalamitas;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Effects;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Skies
|
||||
{
|
||||
public class SCalSky : CustomSky
|
||||
{
|
||||
public class Cinder
|
||||
{
|
||||
public int Time;
|
||||
public int Lifetime;
|
||||
public int IdentityIndex;
|
||||
public float Scale;
|
||||
public float Depth;
|
||||
public Color DrawColor;
|
||||
public Vector2 Velocity;
|
||||
public Vector2 Center;
|
||||
public Cinder(int lifetime, int identity, float depth, Color color, Vector2 startingPosition, Vector2 startingVelocity)
|
||||
{
|
||||
Lifetime = lifetime;
|
||||
IdentityIndex = identity;
|
||||
Depth = depth;
|
||||
DrawColor = color;
|
||||
Center = startingPosition;
|
||||
Velocity = startingVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isActive = false;
|
||||
private float intensity = 0f;
|
||||
private int SCalIndex = -1;
|
||||
public List<Cinder> Cinders = new List<Cinder>();
|
||||
public static int CinderReleaseChance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Main.npc.IndexInRange(CalamityGlobalNPC.SCal) || Main.npc[CalamityGlobalNPC.SCal].type != ModContent.NPCType<SupremeCalamitas>())
|
||||
return int.MaxValue;
|
||||
|
||||
NPC scal = Main.npc[CalamityGlobalNPC.SCal];
|
||||
float lifeRatio = scal.life / (float)scal.lifeMax;
|
||||
|
||||
// Release a good amount of cinders during bullet hells. If this is too distracting this can be
|
||||
// inverted so that less appear than usual instead.
|
||||
if (scal.ModNPC<SupremeCalamitas>().bulletHellCounter2 % 900 != 0)
|
||||
return lifeRatio <= 0.1f ? 8 : 11;
|
||||
|
||||
// Release more and more cinders at the end of the battle until the acceptance phase, where it all slows down dramatically, with just a few ashes.
|
||||
if (lifeRatio < 0.1f)
|
||||
{
|
||||
if (lifeRatio <= 0.01f)
|
||||
return 32;
|
||||
|
||||
return (int)Math.Round(MathHelper.Lerp(2f, 11f, Utils.InverseLerp(0.03f, 0.1f, lifeRatio, true)));
|
||||
}
|
||||
|
||||
// Release a good amount of cinders while brothers or Sepulcher-1 are alive. Sepulcher-2 falls into an above case and does not execute this return.
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<SupremeCataclysm>()) || NPC.AnyNPCs(ModContent.NPCType<SupremeCatastrophe>()) || NPC.AnyNPCs(ModContent.NPCType<SCalWormHead>()))
|
||||
return 10;
|
||||
|
||||
// Release a moderate amount of cinders normally.
|
||||
return 18;
|
||||
}
|
||||
}
|
||||
public static float CinderSpeed
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Main.npc.IndexInRange(CalamityGlobalNPC.SCal) || Main.npc[CalamityGlobalNPC.SCal].type != ModContent.NPCType<SupremeCalamitas>())
|
||||
return 0f;
|
||||
|
||||
NPC scal = Main.npc[CalamityGlobalNPC.SCal];
|
||||
float lifeRatio = scal.life / (float)scal.lifeMax;
|
||||
|
||||
// Move more and more quickly at the end of the battle until the acceptance phase, where it all slows down dramatically.
|
||||
if (lifeRatio < 0.1f)
|
||||
{
|
||||
if (lifeRatio <= 0.01f)
|
||||
return 4.5f;
|
||||
|
||||
return MathHelper.Lerp(10.75f, 6.7f, Utils.InverseLerp(0.03f, 0.1f, lifeRatio, true));
|
||||
}
|
||||
|
||||
// Move a little quickly while brothers or Sepulcher-1 are alive. Sepulcher-2 falls into an above case and does not execute this return.
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<SupremeCataclysm>()) || NPC.AnyNPCs(ModContent.NPCType<SupremeCatastrophe>()) || NPC.AnyNPCs(ModContent.NPCType<SCalWormHead>()))
|
||||
return 7.4f;
|
||||
|
||||
// Move moderately quickly usually.
|
||||
return 5.6f;
|
||||
}
|
||||
}
|
||||
public static float OverridingIntensity = 0f;
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
if (isActive && intensity < 1f)
|
||||
{
|
||||
intensity += 0.01f;
|
||||
}
|
||||
else if (!isActive && intensity > 0f)
|
||||
{
|
||||
intensity -= 0.01f;
|
||||
}
|
||||
|
||||
Color selectCinderColor()
|
||||
{
|
||||
if (!Main.npc.IndexInRange(CalamityGlobalNPC.SCal) || Main.npc[CalamityGlobalNPC.SCal].type != ModContent.NPCType<SupremeCalamitas>())
|
||||
return Color.Transparent;
|
||||
|
||||
NPC scal = Main.npc[CalamityGlobalNPC.SCal];
|
||||
float lifeRatio = scal.life / (float)scal.lifeMax;
|
||||
if (lifeRatio > 0.5f)
|
||||
return Color.Lerp(Color.Red, Color.Orange, Main.rand.NextFloat(0.8f));
|
||||
else if (lifeRatio > 0.3f)
|
||||
return Color.Lerp(Color.DarkRed, Color.Lerp(Color.Blue, Color.DarkBlue, Main.rand.NextFloat() * 0.65f), 0.45f);
|
||||
else if (lifeRatio > 0.01f)
|
||||
return Color.Lerp(Color.Red, Color.Yellow, Main.rand.NextFloat(0.2f, 0.9f));
|
||||
else
|
||||
return Color.Gray;
|
||||
}
|
||||
|
||||
// Randomly add cinders.
|
||||
if (intensity >= 1f && Main.rand.NextBool(CinderReleaseChance))
|
||||
{
|
||||
int lifetime = Main.rand.Next(285, 445);
|
||||
float depth = Main.rand.NextFloat(1.8f, 5f);
|
||||
Vector2 startingPosition = Main.screenPosition + new Vector2(Main.screenWidth * Main.rand.NextFloat(-0.1f, 1.1f), Main.screenHeight * 1.05f);
|
||||
Vector2 startingVelocity = -Vector2.UnitY.RotatedByRandom(0.91f);
|
||||
Cinders.Add(new Cinder(lifetime, Cinders.Count, depth, selectCinderColor(), startingPosition, startingVelocity));
|
||||
}
|
||||
|
||||
// Update all cinders.
|
||||
for (int i = 0; i < Cinders.Count; i++)
|
||||
{
|
||||
Cinders[i].Scale = Utils.InverseLerp(Cinders[i].Lifetime, Cinders[i].Lifetime / 3, Cinders[i].Time, true);
|
||||
Cinders[i].Scale *= MathHelper.Lerp(0.6f, 0.9f, Cinders[i].IdentityIndex % 6f / 6f);
|
||||
|
||||
Vector2 idealVelocity = -Vector2.UnitY.RotatedBy(MathHelper.Lerp(-0.94f, 0.94f, (float)Math.Sin(Cinders[i].Time / 36f + Cinders[i].IdentityIndex) * 0.5f + 0.5f)) * CinderSpeed;
|
||||
float movementInterpolant = MathHelper.Lerp(0.01f, 0.08f, Utils.InverseLerp(45f, 145f, Cinders[i].Time, true));
|
||||
Cinders[i].Velocity = Vector2.Lerp(Cinders[i].Velocity, idealVelocity, movementInterpolant);
|
||||
Cinders[i].Velocity = Cinders[i].Velocity.SafeNormalize(-Vector2.UnitY) * CinderSpeed;
|
||||
Cinders[i].Time++;
|
||||
|
||||
Cinders[i].Center += Cinders[i].Velocity;
|
||||
}
|
||||
|
||||
// Clear away all dead cinders.
|
||||
Cinders.RemoveAll(c => c.Time >= c.Lifetime);
|
||||
}
|
||||
|
||||
private float GetIntensity()
|
||||
{
|
||||
if (CalamityUtils.CountProjectiles(ModContent.ProjectileType<SCalRitualDrama>()) > 0)
|
||||
return OverridingIntensity;
|
||||
|
||||
OverridingIntensity = 0f;
|
||||
if (UpdateSCalIndex())
|
||||
{
|
||||
float x = 0f;
|
||||
if (SCalIndex != -1)
|
||||
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.SCalIndex].Center);
|
||||
|
||||
return 1f - Utils.SmoothStep(3000f, 6000f, x);
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override Color OnTileColor(Color inColor) => new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - GetIntensity()));
|
||||
|
||||
private bool UpdateSCalIndex()
|
||||
{
|
||||
int SCalType = ModContent.NPCType<SupremeCalamitas>();
|
||||
if (SCalIndex >= 0 && Main.npc[SCalIndex].active && Main.npc[SCalIndex].type == SCalType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
SCalIndex = -1;
|
||||
for (int i = 0; i < Main.npc.Length; i++)
|
||||
{
|
||||
if (Main.npc[i].active && Main.npc[i].type == SCalType)
|
||||
{
|
||||
SCalIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return SCalIndex != -1;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
|
||||
{
|
||||
if (maxDepth >= 0 && minDepth < 0)
|
||||
{
|
||||
float intensity = GetIntensity();
|
||||
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity);
|
||||
}
|
||||
|
||||
// Draw cinders.
|
||||
Texture2D cinderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/CalamitasCinder");
|
||||
for (int i = 0; i < Cinders.Count; i++)
|
||||
{
|
||||
Vector2 drawPosition = Cinders[i].Center - Main.screenPosition;
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
Vector2 offsetDrawPosition = drawPosition + (MathHelper.TwoPi * j / 3f).ToRotationVector2() * 1.4f;
|
||||
Color offsetDrawColor = Color.Red * 0.56f;
|
||||
offsetDrawColor.A = 0;
|
||||
spriteBatch.Draw(cinderTexture, offsetDrawPosition, null, offsetDrawColor, 0f, cinderTexture.Size() * 0.5f, Cinders[i].Scale * 1.5f, SpriteEffects.None, 0f);
|
||||
}
|
||||
spriteBatch.Draw(cinderTexture, drawPosition, null, Cinders[i].DrawColor, 0f, cinderTexture.Size() * 0.5f, Cinders[i].Scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetCloudAlpha()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public override void Activate(Vector2 position, params object[] args)
|
||||
{
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
public override void Deactivate(params object[] args)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
public override bool IsActive()
|
||||
{
|
||||
return isActive || intensity > 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Sounds.Custom.SCalSounds
|
||||
{
|
||||
public class SepulcherSpawn : ModSound
|
||||
{
|
||||
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
|
||||
{
|
||||
soundInstance = sound.CreateInstance();
|
||||
soundInstance.Volume = volume;
|
||||
soundInstance.Pan = pan;
|
||||
Main.PlaySoundInstance(soundInstance);
|
||||
return soundInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Sounds.NPCKilled
|
||||
{
|
||||
public class SepulcherDeath : ModSound
|
||||
{
|
||||
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
|
||||
{
|
||||
soundInstance = sound.CreateInstance();
|
||||
soundInstance.Volume = volume;
|
||||
soundInstance.Pan = pan;
|
||||
Main.PlaySoundInstance(soundInstance);
|
||||
return soundInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ namespace CalamityMod
|
||||
{ ModContent.NPCType<SupremeCatastrophe>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SupremeCataclysm>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SoulSeekerSupreme>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SCalWormHeart>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<BrimstoneHeart>(), new Tuple<bool, int[]>(false, CalamityMod.cragEnemyImmunities) },
|
||||
{ ModContent.NPCType<SCalWormHead>(), new Tuple<bool, int[]>(true, new int[] { }) },
|
||||
{ ModContent.NPCType<SCalWormBody>(), new Tuple<bool, int[]>(true, new int[] { }) },
|
||||
{ ModContent.NPCType<SCalWormBodyWeak>(), new Tuple<bool, int[]>(true, new int[] { }) },
|
||||
|
||||