GFB prov colour syncing
this stopped working for whatever reason also negative healing hell is back as intended profaned guardians is a mess rn but hope that can be dealt with later
This commit is contained in:
1 parent
6a3031f890
commit
00b55d026b
29 files changed
+386
-829
No files matched your search
@@ -5954,7 +5954,7 @@ namespace CalamityMod.NPCs
|
||||
modifiers.ScalingBonusDamage += (empowered ? 0.4f : 0.2f) * TagDamageMult;
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
var color = ProvUtils.GetProjectileColor((int)(Main.dayTime ? Providence.Providence.BossMode.Day : Providence.Providence.BossMode.Night), 0);
|
||||
var color = ProvUtils.GetDayNightColor(!Main.dayTime, 0);
|
||||
float power = Math.Min(npc.height / 100f, 3f);
|
||||
var position = new Vector2(Main.rand.NextFloat(npc.Left.X, npc.Right.X), Main.rand.NextFloat(npc.Top.Y, npc.Bottom.Y));
|
||||
var particle = new FlameParticle(position, 50, 0.25f, power, color * (Main.dayTime ? 1f : 1.25f), color * (Main.dayTime ? 1.25f : 1f));
|
||||
|
||||
@@ -1073,12 +1073,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
}
|
||||
}
|
||||
|
||||
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
// Draw laser effects
|
||||
|
||||
@@ -796,9 +796,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
// Draw laser effects
|
||||
|
||||
@@ -514,9 +514,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, overrideColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
@@ -156,12 +156,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
Providence.BossMode mode = Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.BossMode.Night;
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -163,12 +163,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
Providence.BossMode mode = Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.BossMode.Night;
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, violetLerp, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
|
||||
@@ -158,12 +158,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
}
|
||||
|
||||
Providence.BossMode mode = Providence.BossMode.Day;
|
||||
if (!Main.dayTime) mode = Providence.BossMode.Night;
|
||||
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
|
||||
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+170
-200
@@ -78,16 +78,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
Night = -1,
|
||||
Day = 0,
|
||||
Red = 1,
|
||||
Orange = 2,
|
||||
Yellow = 3,
|
||||
Green = 4,
|
||||
Blue = 5,
|
||||
Violet = 6
|
||||
Rainbow = 1,
|
||||
}
|
||||
|
||||
public int colorShiftTimer = -1;
|
||||
|
||||
Color HighFireColor = new Color(255, 191, 73);
|
||||
Color LowFireColor = new Color(116, 45, 23);
|
||||
|
||||
@@ -298,7 +291,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
writer.Write(text);
|
||||
writer.Write(useDefenseFrames);
|
||||
writer.Write(biomeType);
|
||||
writer.Write(colorShiftTimer);
|
||||
writer.Write(phaseChange);
|
||||
writer.Write(frameUsed);
|
||||
writer.Write(healTimer);
|
||||
@@ -324,7 +316,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
text = reader.ReadBoolean();
|
||||
useDefenseFrames = reader.ReadBoolean();
|
||||
biomeType = reader.ReadInt32();
|
||||
colorShiftTimer = reader.ReadInt32();
|
||||
phaseChange = reader.ReadInt32();
|
||||
frameUsed = reader.ReadInt32();
|
||||
healTimer = reader.ReadInt32();
|
||||
@@ -354,9 +345,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Local helper variable to get the current boss mode without having to use the magic number version
|
||||
int currentMode = (int)NPC.localAI[1];
|
||||
|
||||
// Set the border drawing to true if it isn't set to true
|
||||
// Can happen when another mod sets to false for a difficulty and that difficulty is then toggled off.
|
||||
shouldDrawInfernoBorder = true;
|
||||
@@ -384,25 +372,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
bool bossRush = BossRushEvent.BossRushActive;
|
||||
|
||||
bool getFuckedAI = Main.zenithWorld;
|
||||
int timeToShift = 30; //Switches color every half-second
|
||||
if (getFuckedAI)
|
||||
{
|
||||
colorShiftTimer++;
|
||||
|
||||
if (colorShiftTimer == -1) //Initiate
|
||||
{
|
||||
NPC.localAI[1] = (float)BossMode.Red;
|
||||
colorShiftTimer = 0;
|
||||
}
|
||||
else if (colorShiftTimer >= timeToShift)
|
||||
{
|
||||
NPC.localAI[1]++;
|
||||
if (NPC.localAI[1] > (float)BossMode.Violet)
|
||||
NPC.localAI[1] = (float)BossMode.Red;
|
||||
colorShiftTimer = 0;
|
||||
}
|
||||
}
|
||||
else if ((!Main.dayTime && !Main.remixWorld) || bossRush) // Normal Night time activity
|
||||
NPC.localAI[1] = (float)BossMode.Rainbow;
|
||||
else if (!ProvUtils.DayAI()) // Normal Night time activity
|
||||
NPC.localAI[1] = (float)BossMode.Night;
|
||||
else
|
||||
NPC.localAI[1] = (float)BossMode.Day;
|
||||
@@ -453,7 +425,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
// Increase all projectile damage at night, but reduce to 0 for Zenith
|
||||
int projectileDamageMult = 1;
|
||||
if (nightAI)
|
||||
if (getFuckedAI)
|
||||
projectileDamageMult = 0;
|
||||
else if (nightAI)
|
||||
projectileDamageMult = 2;
|
||||
|
||||
NPC.Calamity().CurrentlyEnraged = !bossRush && nightAI;
|
||||
@@ -469,7 +443,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
int holyStarDamage = NPC.GetProjectileDamage(ModContent.ProjectileType<HolyBurnOrb>()) * projectileDamageMult;
|
||||
|
||||
// Change dust type at night
|
||||
int dustType = ProvUtils.GetDustID(NPC.localAI[1]);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
|
||||
// Phase times
|
||||
float phaseTime = nightAI ? (240f - 60f * (1f - lifeRatio)) : 300f;
|
||||
@@ -511,9 +485,9 @@ namespace CalamityMod.NPCs.Providence
|
||||
float burnIntensity = CalculateBurnIntensity(attackDelayAfterCocoon);
|
||||
|
||||
// Color determination
|
||||
Color hiColor = ProvUtils.GetProjectileColor(currentMode, 0);
|
||||
Color medColor = ProvUtils.GetProjectileColor(currentMode, 255);
|
||||
Color loColor = ProvUtils.GetProjectileColor(currentMode, 255, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(0);
|
||||
Color medColor = ProvUtils.GetProjectileColor(255);
|
||||
Color loColor = ProvUtils.GetProjectileColor(255, true);
|
||||
|
||||
if (!player.dead && player.active && !player.creativeGodMode && !Dying)
|
||||
{
|
||||
@@ -857,10 +831,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
// Slowly drift down when spawning
|
||||
if (spawnAnimation)
|
||||
{
|
||||
colorShiftTimer++; // Also double the shift speed in the mean time :)
|
||||
NPC.velocity = Vector2.Zero;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Slows down while firing Holy Rays. It would've not slowed down for the Zenith seed but apparently it was too fast (shockers).
|
||||
@@ -1133,8 +1104,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
CalamityUtils.AddScreenshakeAt(NPC.Center, 10, 2000);
|
||||
|
||||
Color hColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
|
||||
Color lColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
|
||||
Color hColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color lColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
@@ -1852,8 +1823,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
CalamityUtils.AddScreenshakeAt(NPC.Center, 5, 2000);
|
||||
|
||||
Color hiColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor( 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
@@ -1958,7 +1929,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
float shorterDistanceFade = Utils.GetLerpValue(0f, 120f, aiTimer, true);
|
||||
|
||||
// Distance does not get shorter if in GFB / Guardians are alive
|
||||
if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Red)
|
||||
if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Rainbow)
|
||||
{
|
||||
maxDistance = baseDistance;
|
||||
if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon)
|
||||
@@ -2025,8 +1996,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
CalamityUtils.AddScreenshakeAt(NPC.Center, 10, 2000);
|
||||
|
||||
Color hiColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
@@ -2187,7 +2158,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
{
|
||||
int frameY = (int)(NPC.Calamity().newAI[3] / 4) % 4;
|
||||
float sc1 = MathHelper.Lerp(1, 0, sc);
|
||||
Main.EntitySpriteDraw(orbTex.Value, NPC.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(MathHelper.Lerp(0f, 10f, sc)), 0).RotatedByRandom(MathHelper.TwoPi), orbTex.Frame(), ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, false).MultiplyRGBA(new Color(sc * 45f, sc * 11f, sc * 22f, 0f)), 0f, orbTex.Frame().Center(), (sc * 4.4f) + (float)(Math.Cos((float)NPC.Calamity().newAI[3] / 10) * sc), SpriteEffects.None);
|
||||
Main.EntitySpriteDraw(orbTex.Value, NPC.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(MathHelper.Lerp(0f, 10f, sc)), 0).RotatedByRandom(MathHelper.TwoPi), orbTex.Frame(), ProvUtils.GetProjectileColor(0, false).MultiplyRGBA(new Color(sc * 45f, sc * 11f, sc * 22f, 0f)), 0f, orbTex.Frame().Center(), (sc * 4.4f) + (float)(Math.Cos((float)NPC.Calamity().newAI[3] / 10) * sc), SpriteEffects.None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2269,41 +2240,43 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
// Draw the glowmask textures + their afterimages
|
||||
// These are the colors at their strongest point. It'll shift towards white by the brightness value used earlier.
|
||||
Color WingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0); // Default to day
|
||||
Color WingColor = ProvUtils.GetProjectileColor(0); // Default to day
|
||||
Color CrystalColor = Color.Violet;
|
||||
switch (NPC.localAI[1])
|
||||
|
||||
if (NPC.localAI[1] == (float)BossMode.Rainbow)
|
||||
{
|
||||
case (float)BossMode.Red:
|
||||
WingColor = Color.Red;
|
||||
CrystalColor = Color.BlueViolet;
|
||||
break;
|
||||
|
||||
case (float)BossMode.Orange:
|
||||
WingColor = Color.Orange;
|
||||
CrystalColor = Color.HotPink;
|
||||
break;
|
||||
|
||||
case (float)BossMode.Yellow: // Same as day
|
||||
break;
|
||||
|
||||
case (float)BossMode.Green:
|
||||
WingColor = Color.Green;
|
||||
CrystalColor = Color.Gold;
|
||||
break;
|
||||
|
||||
case (float)BossMode.Blue: // Same as night
|
||||
case (float)BossMode.Night:
|
||||
WingColor = Color.Cyan;
|
||||
CrystalColor = Color.BlueViolet;
|
||||
break;
|
||||
|
||||
case (float)BossMode.Violet:
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
{
|
||||
WingColor = Color.Magenta;
|
||||
CrystalColor = Color.GreenYellow;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
{
|
||||
WingColor = Color.Cyan;
|
||||
CrystalColor = Color.BlueViolet;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
{
|
||||
WingColor = Color.Green;
|
||||
CrystalColor = Color.Gold;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
CrystalColor = Color.Violet;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
{
|
||||
WingColor = Color.Orange;
|
||||
CrystalColor = Color.HotPink;
|
||||
}
|
||||
else // Red
|
||||
{
|
||||
WingColor = Color.Red;
|
||||
CrystalColor = Color.BlueViolet;
|
||||
}
|
||||
}
|
||||
else if (NPC.localAI[1] == (float)BossMode.Night)
|
||||
{
|
||||
WingColor = Color.Cyan;
|
||||
CrystalColor = Color.BlueViolet;
|
||||
}
|
||||
|
||||
Color BaseWingColor = Color.Lerp(WingColor, BaseColor, Brightness) * NPC.Opacity;
|
||||
@@ -2314,13 +2287,13 @@ namespace CalamityMod.NPCs.Providence
|
||||
BaseCrystalColor = colorOverride.Value;
|
||||
}
|
||||
|
||||
Color GlowWingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], NPC.GetAlpha(drawColor), true);
|
||||
Color GlowWingColor = ProvUtils.GetProjectileColor(NPC.GetAlpha(drawColor), true);
|
||||
|
||||
if (CalamityConfig.Instance.Afterimages)
|
||||
{
|
||||
for (int j = 1; j < maxAfterimages; j++)
|
||||
{
|
||||
Color AfterimageWingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
|
||||
Color AfterimageWingColor = ProvUtils.GetProjectileColor(0, true);
|
||||
AfterimageWingColor = Color.Lerp(AfterimageWingColor, BaseColor, Brightness);
|
||||
AfterimageWingColor = NPC.GetAlpha(AfterimageWingColor);
|
||||
AfterimageWingColor *= (maxAfterimages - j) / 15f;
|
||||
@@ -2487,7 +2460,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor((int)NPC.localAI[1], drawColor) * NPC.Opacity;
|
||||
return ProvUtils.GetProjectileColor(drawColor) * NPC.Opacity;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
@@ -2514,7 +2487,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
int pr = (int)(progress * 30f);
|
||||
|
||||
Color col = ProvUtils.GetProjectileColor((int)NPC.localAI[1], Color.DarkGray, true);
|
||||
Color col = ProvUtils.GetProjectileColor(Color.DarkGray, true);
|
||||
col.A = 255;
|
||||
|
||||
Main.EntitySpriteDraw(tex, NPC.Center + vec + new Vector2(0, 310) - Main.screenPosition + new Vector2(Main.rand.Next(-pr, pr) * 2, outset), new Rectangle(0, i * 2, tex.Width, 2), Color.Lerp(col, Color.White, progress * 2f).MultiplyRGBA(new Color(255, 255, 255, MathHelper.Lerp(progress, 1f, 0.2f) * 2f)), 0f, tex.Size() / 2f, 1f, SpriteEffects.None);
|
||||
@@ -2700,7 +2673,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
SoundEngine.PlaySound(HurtSound, NPC.Center);
|
||||
}
|
||||
|
||||
int dustType = ProvUtils.GetDustID(NPC.localAI[1]);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
for (int k = 0; k < 15; k++)
|
||||
{
|
||||
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, hit.HitDirection, -1f, 0, default, 1f);
|
||||
@@ -2853,11 +2826,26 @@ namespace CalamityMod.NPCs.Providence
|
||||
// These will be used for almost every single one of her projectiles, so it's useful to have.
|
||||
public static class ProvUtils
|
||||
{
|
||||
public static Color GetProjectileColor(int Mode, Color givenLightColor, bool Outline = false)
|
||||
public static bool DayAI() => (Main.IsItDay() || Main.remixWorld) && !Main.zenithWorld && !BossRushEvent.BossRushActive;
|
||||
|
||||
// Simplified to day/night only. For PSC and Profaned Guardians
|
||||
public static Color GetDayNightColor(int Alpha, bool Outline = false) => GetDayNightColor(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline);
|
||||
public static Color GetDayNightColor(bool Night, int Alpha, bool Outline = false)
|
||||
{
|
||||
Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day
|
||||
|
||||
if (Night)
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
|
||||
|
||||
return FinalColor;
|
||||
}
|
||||
|
||||
public static Color GetProjectileColor(Color givenLightColor, bool Outline = false)
|
||||
{
|
||||
int alpha = 0;
|
||||
|
||||
if (!Outline && Mode == (int)Providence.BossMode.Yellow)
|
||||
// Custom set alpha for GFB Yellow Mode
|
||||
if (!Outline && Main.zenithWorld && Main.GlobalTimeWrappedHourly % 6f >= 2f && Main.GlobalTimeWrappedHourly % 6f < 3f)
|
||||
{
|
||||
float colorBrightness = (givenLightColor.R + givenLightColor.G + givenLightColor.B / 3) / 255f;
|
||||
alpha = (int)MathHelper.Lerp(0f, 155f, colorBrightness);
|
||||
@@ -2868,35 +2856,24 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
|
||||
Color FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha); // Default to day
|
||||
switch (Mode)
|
||||
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
case (int)Providence.BossMode.Red:
|
||||
FinalColor = new Color(250, 100, Outline ? 200 : 100, alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Orange:
|
||||
FinalColor = new Color(250, 150, Outline ? 150 : 100, alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Yellow: // Same as day
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Green:
|
||||
FinalColor = new Color(Outline ? 200 : 100, 250, 100, alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Blue: // Same as night
|
||||
case (int)Providence.BossMode.Night:
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Violet:
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
FinalColor = new Color(Outline ? 100 : 150, Outline ? 150 : 100, 250, alpha);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
FinalColor = new Color(Outline ? 200 : 100, 250, 100, alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
FinalColor = new Color(250, 150, Outline ? 150 : 100, alpha);
|
||||
else // Red
|
||||
FinalColor = new Color(250, 100, Outline ? 200 : 100, alpha);
|
||||
}
|
||||
else if (!DayAI())
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
|
||||
|
||||
if (Outline)
|
||||
FinalColor *= 0.1f;
|
||||
@@ -2904,38 +2881,27 @@ namespace CalamityMod.NPCs.Providence
|
||||
return FinalColor;
|
||||
}
|
||||
|
||||
public static Color GetProjectileColor(int Mode, int Alpha, bool Outline = false)
|
||||
public static Color GetProjectileColor(int Alpha, bool Outline = false)
|
||||
{
|
||||
Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day
|
||||
switch (Mode)
|
||||
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
case (int)Providence.BossMode.Red:
|
||||
FinalColor = new Color(250, 100, Outline ? 200 : 100, Alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Orange:
|
||||
FinalColor = new Color(250, 150, Outline ? 150 : 100, Alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Yellow: // Same as day
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Green:
|
||||
FinalColor = new Color(Outline ? 200 : 100, 250, 100, Alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Blue: // Same as night
|
||||
case (int)Providence.BossMode.Night:
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Violet:
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
FinalColor = new Color(Outline ? 100 : 150, Outline ? 150 : 100, 250, Alpha);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
FinalColor = new Color(Outline ? 200 : 100, 250, 100, Alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
FinalColor = new Color(250, 150, Outline ? 150 : 100, Alpha);
|
||||
else // Red
|
||||
FinalColor = new Color(250, 100, Outline ? 200 : 100, Alpha);
|
||||
}
|
||||
else if (!DayAI())
|
||||
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
|
||||
|
||||
if (Outline)
|
||||
FinalColor *= 0.1f;
|
||||
@@ -2943,88 +2909,92 @@ namespace CalamityMod.NPCs.Providence
|
||||
return FinalColor;
|
||||
}
|
||||
|
||||
public static int GetDustID(float Mode)
|
||||
// Assign the night bool to turn it into a binary day/night state without accounting for GFB
|
||||
public static int GetDustID(bool? Night = null)
|
||||
{
|
||||
int DustType = (int)CalamityDusts.ProfanedFire; // Default to day
|
||||
switch (Mode)
|
||||
|
||||
if (Night.HasValue)
|
||||
{
|
||||
case (float)Providence.BossMode.Red:
|
||||
DustType = DustID.RedTorch;
|
||||
break;
|
||||
|
||||
case (float)Providence.BossMode.Orange:
|
||||
DustType = DustID.OrangeTorch;
|
||||
break;
|
||||
|
||||
case (float)Providence.BossMode.Yellow: // Same as day
|
||||
break;
|
||||
|
||||
case (float)Providence.BossMode.Green:
|
||||
DustType = DustID.GreenTorch;
|
||||
break;
|
||||
|
||||
case (float)Providence.BossMode.Blue: // Same as night
|
||||
case (float)Providence.BossMode.Night:
|
||||
if (Night.Value)
|
||||
DustType = (int)CalamityDusts.Nightwither;
|
||||
break;
|
||||
|
||||
case (float)Providence.BossMode.Violet:
|
||||
DustType = DustID.PurpleTorch;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
else if (Main.zenithWorld)
|
||||
{
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
DustType = DustID.PurpleTorch;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
DustType = (int)CalamityDusts.Nightwither;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
DustType = DustID.GreenTorch;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
DustType = (int)CalamityDusts.ProfanedFire;
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
DustType = DustID.OrangeTorch;
|
||||
else // Red
|
||||
DustType = DustID.RedTorch;
|
||||
}
|
||||
else if (!DayAI())
|
||||
DustType = (int)CalamityDusts.Nightwither;
|
||||
|
||||
return DustType;
|
||||
}
|
||||
|
||||
// Shortcut function for applying Burden Breaker-like negative healing to GFB Providence
|
||||
public static void ApplyGFBDamage(Projectile proj, int BaseDuration, int NegativeHealValue)
|
||||
{
|
||||
int index = Player.FindClosest(proj.position, proj.width, proj.height);
|
||||
Player player = Main.player[index];
|
||||
if (player is null)
|
||||
return;
|
||||
if (proj.Colliding(proj.Hitbox, player.Hitbox))
|
||||
ApplyDebuffs(player, BaseDuration, NegativeHealValue);
|
||||
}
|
||||
|
||||
// Include debuffs inflicted by Providence's projectiles for all her forms
|
||||
// In the GFB seed, also includes negative healing
|
||||
public static void ApplyHitEffects(Player Target, int Mode, int BaseDuration, int NegativeHealValue)
|
||||
public static void ApplyDebuffs(Player Target, int BaseDuration, int NegativeHealValue = 0)
|
||||
{
|
||||
int BuffType = ModContent.BuffType<HolyFlames>(); // Default to day
|
||||
float Multiplier = 1f; // Used to counterbalance Cursed Inferno and Shadowflame
|
||||
int BuffType = ModContent.BuffType<HolyFlames>(); // Default to non-GFB
|
||||
|
||||
// Day and Night Providence inflicts 16-80 damage of debuffs depending on attacks
|
||||
// GFB Providence inflicts 24-120 damage (+50%) for half the colors, 26-130 (+62.5%) for another half
|
||||
switch (Mode)
|
||||
// All debuffs are adjusted to be 50% more powerful in GFB
|
||||
float Multiplier = 1f;
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
case (int)Providence.BossMode.Red:
|
||||
BuffType = ModContent.BuffType<BrimstoneFlames>();
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Orange:
|
||||
BuffType = ModContent.BuffType<Dragonfire>();
|
||||
Multiplier = 0.5f;
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Yellow: // Same as day
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Green:
|
||||
BuffType = BuffID.CursedInferno;
|
||||
Multiplier = 0.75f;
|
||||
break;
|
||||
|
||||
case (int)Providence.BossMode.Blue: // Night Providence no longer inflicts a different debuff, but Blue GFB Providence does
|
||||
BuffType = ModContent.BuffType<Nightwither>();
|
||||
break;
|
||||
case (int)Providence.BossMode.Night: //Same as Day, will inflict Holy Flames
|
||||
break;
|
||||
case (int)Providence.BossMode.Violet:
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
{
|
||||
BuffType = ModContent.BuffType<Shadowflame>();
|
||||
Multiplier = 0.60f;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
Multiplier = 2f;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
{
|
||||
BuffType = ModContent.BuffType<Nightwither>();
|
||||
Multiplier = 1.5f;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
{
|
||||
BuffType = BuffID.CursedInferno;
|
||||
Multiplier = 2.5f;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
{
|
||||
BuffType = ModContent.BuffType<HolyFlames>();
|
||||
Multiplier = 1.5f;
|
||||
}
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
BuffType = ModContent.BuffType<Dragonfire>();
|
||||
else // Red
|
||||
{
|
||||
BuffType = ModContent.BuffType<BrimstoneFlames>();
|
||||
Multiplier = 2f;
|
||||
}
|
||||
}
|
||||
|
||||
Target.AddBuff(BuffType, (int)(BaseDuration * Multiplier));
|
||||
|
||||
// A. Specifically inflicts Vaporfied in quirky RGB Mode because it's a colorful debuff
|
||||
// B. Apply the negative healing
|
||||
if (Mode >= (int)Providence.BossMode.Red)
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
// Obligatory offensive guardian boosting negative heals
|
||||
if (CalamityGlobalNPC.holyBossAttacker != -1)
|
||||
|
||||
@@ -71,14 +71,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
float a = (float)Math.Sin(amount2 / 20) + 1;
|
||||
|
||||
int mode = (int)Providence.BossMode.Yellow;
|
||||
|
||||
Color color = Color.Lerp(ProvUtils.GetProjectileColor(mode, 0, true), ProvUtils.GetProjectileColor(mode, 0, false), a);
|
||||
Color color = Color.Lerp(ProvUtils.GetProjectileColor(0, true), ProvUtils.GetProjectileColor(0, false), a);
|
||||
|
||||
bool underworld = Projectile.ai[0] == 2f;
|
||||
if (!Main.zenithWorld)
|
||||
{
|
||||
if (Main.IsItDay())
|
||||
if (Main.IsItDay() || Main.remixWorld)
|
||||
{
|
||||
color.R = 255;
|
||||
if (underworld)
|
||||
|
||||
@@ -64,6 +64,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 320, 20);
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f);
|
||||
|
||||
if (Projectile.timeLeft > TimeLeft - AccelerationTime)
|
||||
@@ -72,26 +74,6 @@ 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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 6)
|
||||
{
|
||||
@@ -105,15 +87,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
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, 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)));
|
||||
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(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(255, false)));
|
||||
}
|
||||
started = true;
|
||||
}
|
||||
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
{
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
|
||||
@@ -131,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Math.Abs(Projectile.velocity.X) > 0.2)
|
||||
Projectile.spriteDirection = -Projectile.direction;
|
||||
|
||||
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 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(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)
|
||||
@@ -142,16 +124,16 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
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/HolyBlastNight").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
|
||||
int framing = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Vector2 sc = Vector2.One;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, sc, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, sc, 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), sc, SpriteEffects.None, 0);
|
||||
return false;
|
||||
@@ -159,8 +141,8 @@ 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);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
@@ -177,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int totalProjectiles = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 8 : 6;
|
||||
int totalProjectiles = !ProvUtils.DayAI() ? 8 : 6;
|
||||
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
|
||||
totalProjectiles *= 2;
|
||||
|
||||
@@ -196,7 +178,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.Center);
|
||||
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 2f);
|
||||
@@ -213,20 +195,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 320, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 320);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,37 +37,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 160, 20);
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
|
||||
|
||||
/*
|
||||
* Day mode by default but syncs with the boss
|
||||
* Uses maxPenetrate because it's kinda pointless for a boss projectile
|
||||
* and it's convenient to copypaste without having to do adjustments
|
||||
* If someone really feels like making a proper int for this purpose they can do it themselves - Iris
|
||||
*/
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
SquishAnimation += 0.06f;
|
||||
|
||||
SquishAnimation = MathHelper.Clamp(SquishAnimation, 0f, 1f);
|
||||
|
||||
Projectile.ai[0] += 1f;
|
||||
@@ -80,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
Vector2 center = Projectile.Center + new Vector2(0, -15);
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(center, new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-4f, 2f)), false, 30, Main.rand.NextFloat(1f, 2.5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(center, new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-4f, 2f)), false, 30, Main.rand.NextFloat(1f, 2.5f), ProvUtils.GetProjectileColor(255)));
|
||||
}
|
||||
|
||||
float velocityY = -2f;
|
||||
@@ -111,25 +85,25 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
float squish = CalamityUtils.SineBumpEasing(SquishAnimation, 1) * 0.25f;
|
||||
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBombNight").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBombNight").Value;
|
||||
int framing = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish))));
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish))));
|
||||
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) + 22), new Vector2(Projectile.scale + squish, Projectile.scale - squish), SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
@@ -149,20 +123,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 160, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 160);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,40 +35,18 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.Calamity().DealsDefenseDamage = true;
|
||||
}
|
||||
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 120, 50);
|
||||
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
|
||||
|
||||
if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive)
|
||||
Projectile.velocity *= 1.25f;
|
||||
|
||||
if (!started)
|
||||
{
|
||||
Color cl = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
|
||||
Color cl = ProvUtils.GetProjectileColor(255);
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, cl, "CalamityMod/Particles/BlastCone", new Vector2(Main.rand.NextFloat(4f, 7f), 1.5f), Vector2.Zero.AngleTo(Projectile.velocity), 1f, 0f, 30));
|
||||
started = true;
|
||||
}
|
||||
@@ -98,7 +76,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
Projectile.localAI[1] += (Projectile.velocity.Length() / 20);
|
||||
|
||||
Color col = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
|
||||
Color col = ProvUtils.GetProjectileColor(255);
|
||||
|
||||
float vel = MathHelper.Clamp(Projectile.velocity.Length() / 5, 0, 1.5f);
|
||||
|
||||
@@ -113,8 +91,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
|
||||
Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
|
||||
Color baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, true) * 4;
|
||||
Color baseColor2 = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
|
||||
Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4;
|
||||
Color baseColor2 = ProvUtils.GetProjectileColor(255);
|
||||
baseColor.A = 0;
|
||||
baseColor *= lerpMult;
|
||||
baseColor2 *= lerpMult;
|
||||
@@ -147,7 +125,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
|
||||
Projectile.ExpandHitboxBy(50);
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
for (int d = 0; d < 5; d++)
|
||||
{
|
||||
int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
|
||||
@@ -170,22 +148,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
|
||||
Projectile.Kill();
|
||||
}
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => Projectile.Kill();
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 50);
|
||||
ProvUtils.ApplyDebuffs(target, 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,36 +35,17 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 80, 20);
|
||||
|
||||
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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
if (Projectile.ai[1] == 0f)
|
||||
{
|
||||
Projectile.ai[1] = 1f;
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
|
||||
}
|
||||
|
||||
Projectile.alpha -= (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 10 : 5;
|
||||
Projectile.alpha -= !ProvUtils.DayAI() ? 10 : 5;
|
||||
if (Projectile.alpha <= 0)
|
||||
Projectile.Kill();
|
||||
|
||||
@@ -80,24 +61,24 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Projectile.scale = 1.5f;
|
||||
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFireNight").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFireNight").Value;
|
||||
int framing = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, new Vector2(Projectile.scale));
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale));
|
||||
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);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
@@ -148,20 +129,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 80);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,29 +35,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 80, 10);
|
||||
|
||||
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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 6)
|
||||
{
|
||||
@@ -82,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Vector2 playerDirection = Main.player[playerTracker].Center - Projectile.Center;
|
||||
playerDirection.Normalize();
|
||||
playerDirection *= projVelocityMult;
|
||||
float inertia = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 20f : 25f;
|
||||
float inertia = !ProvUtils.DayAI() ? 20f : 25f;
|
||||
Projectile.velocity = (Projectile.velocity * (inertia - 1f) + playerDirection) / inertia;
|
||||
Projectile.velocity.Normalize();
|
||||
Projectile.velocity *= projVelocityMult;
|
||||
@@ -90,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
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.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255)));
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
@@ -102,15 +83,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
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/HolyFire2Night").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
|
||||
int framing = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, 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);
|
||||
return false;
|
||||
}
|
||||
@@ -124,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.height = 40;
|
||||
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
|
||||
@@ -144,20 +125,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 10);
|
||||
ProvUtils.ApplyDebuffs(target, 80);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,29 +36,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 120, 20);
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0.35f, 0.275f, 0f);
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Player player = Main.player[Projectile.owner];
|
||||
|
||||
Projectile.frameCounter++;
|
||||
@@ -75,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.velocity.Y > velocityYCap)
|
||||
Projectile.velocity.Y = velocityYCap;
|
||||
|
||||
float velocityX = Projectile.maxPenetrate != (int)Providence.BossMode.Day ? 0.025f : 0.02f;
|
||||
float velocityX = !ProvUtils.DayAI() ? 0.025f : 0.02f;
|
||||
if (Projectile.position.X + Projectile.width < player.position.X)
|
||||
{
|
||||
if (Projectile.velocity.X < 0f)
|
||||
@@ -89,13 +70,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.velocity.X -= velocityX;
|
||||
}
|
||||
|
||||
float velocityXCap = Projectile.maxPenetrate != (int)Providence.BossMode.Day ? 10f : 8f;
|
||||
float velocityXCap = !ProvUtils.DayAI() ? 10f : 8f;
|
||||
if (Projectile.velocity.X > velocityXCap || Projectile.velocity.X < -velocityXCap)
|
||||
Projectile.velocity.X *= 0.97f;
|
||||
|
||||
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)));
|
||||
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(255)));
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
@@ -107,23 +88,23 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
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/HolyFlareNight").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFlareNight").Value;
|
||||
int framing = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = framing * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, 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);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
@@ -142,20 +123,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
+51
-119
@@ -55,26 +55,9 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f);
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 120, 20);
|
||||
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f);
|
||||
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
{
|
||||
@@ -86,14 +69,14 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
bool commanderSpear = Projectile.ai[0] == -1f;
|
||||
bool enragedCommanderSpear = Projectile.ai[0] == -2f;
|
||||
float timeGateValue = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f);
|
||||
float timeGateValue = !ProvUtils.DayAI() ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f);
|
||||
if (Projectile.ai[0] <= 0f)
|
||||
{
|
||||
Projectile.ai[1] += 1f;
|
||||
|
||||
float slowGateValue = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f);
|
||||
float slowGateValue = !ProvUtils.DayAI() ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f);
|
||||
float fastGateValue = 30f;
|
||||
float minVelocity = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f);
|
||||
float minVelocity = !ProvUtils.DayAI() ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f);
|
||||
float maxVelocity = minVelocity * 4f;
|
||||
float extremeVelocity = maxVelocity * 2f;
|
||||
float deceleration = 0.95f;
|
||||
@@ -122,8 +105,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
else
|
||||
{
|
||||
float frequency = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 0.2f : 0.1f;
|
||||
float amplitude = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 4f : 2f;
|
||||
float frequency = !ProvUtils.DayAI() ? 0.2f : 0.1f;
|
||||
float amplitude = !ProvUtils.DayAI() ? 4f : 2f;
|
||||
|
||||
Projectile.ai[1] += frequency;
|
||||
|
||||
@@ -145,49 +128,27 @@ namespace CalamityMod.Projectiles.Boss
|
||||
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);
|
||||
Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day
|
||||
|
||||
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)));
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
baseColor = new Color(aimedSpear ? 125 : 255, aimedSpear ? 0 : 255, 125);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
baseColor = new Color(0, 255, aimedSpear ? 0 : 175);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
baseColor = new Color(255, 125, aimedSpear ? 0 : 175);
|
||||
else // Red
|
||||
baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255);
|
||||
}
|
||||
else if (!ProvUtils.DayAI())
|
||||
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
|
||||
|
||||
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(255, false)));
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -195,53 +156,31 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
|
||||
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 ? 0 : 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);
|
||||
Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day
|
||||
Color baseColor2 = new Color(15, 35, 50, 0);
|
||||
|
||||
if (Main.zenithWorld)
|
||||
{
|
||||
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
|
||||
baseColor = new Color(aimedSpear ? 125 : 255, aimedSpear ? 0 : 255, 125);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
|
||||
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
|
||||
baseColor = new Color(0, 255, aimedSpear ? 0 : 175);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
|
||||
baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125);
|
||||
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
|
||||
baseColor = new Color(255, 125, aimedSpear ? 0 : 175);
|
||||
else // Red
|
||||
baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255);
|
||||
}
|
||||
else if (!ProvUtils.DayAI())
|
||||
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
|
||||
|
||||
if (!aimedSpear)
|
||||
{
|
||||
baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
baseColor2 = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
baseColor = ProvUtils.GetProjectileColor(0);
|
||||
baseColor2 = ProvUtils.GetProjectileColor(0, true);
|
||||
}
|
||||
|
||||
Vector2 projDirection = Main.screenPosition - new Vector2(0f, Projectile.gfxOffY);
|
||||
@@ -274,25 +213,18 @@ namespace CalamityMod.Projectiles.Boss
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 120);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, false);
|
||||
return ProvUtils.GetProjectileColor(0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 160, 20);
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
|
||||
|
||||
if (Projectile.timeLeft > TimeLeft - AccelerationTime)
|
||||
@@ -61,26 +63,6 @@ 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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter > 6)
|
||||
{
|
||||
@@ -90,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.frame > 3)
|
||||
Projectile.frame = 0;
|
||||
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
if (Projectile.localAI[1] == 0f)
|
||||
{
|
||||
for (int d = 0; d < 10; d++)
|
||||
@@ -130,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
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)));
|
||||
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(255)));
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
@@ -140,23 +122,23 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
return ProvUtils.GetProjectileColor(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/MoltenBlastNight").Value;
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlastNight").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);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(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);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
@@ -171,7 +153,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
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;
|
||||
int blobAmt = !ProvUtils.DayAI() ? 9 : 6;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X * 0.1f, Projectile.velocity.Y);
|
||||
@@ -189,20 +171,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 18f, targetHitbox);
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 160, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 160);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,30 +37,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 80, 10);
|
||||
|
||||
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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
Landing += 0.1f;
|
||||
|
||||
Landing = MathHelper.Clamp(Landing, 0f, 1f);
|
||||
|
||||
colliding = Projectile.velocity.Y == 0f;
|
||||
@@ -115,12 +96,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
return ProvUtils.GetProjectileColor(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;
|
||||
Texture2D texture = ProvUtils.DayAI() ? 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 * (1 + Projectile.frame);
|
||||
float squish = CalamityUtils.SineBumpEasing(Landing, 1) * 0.5f;
|
||||
@@ -132,15 +113,15 @@ namespace CalamityMod.Projectiles.Boss
|
||||
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);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(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)
|
||||
{
|
||||
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
|
||||
Color hiColor = ProvUtils.GetProjectileColor(255, false);
|
||||
Color loColor = ProvUtils.GetProjectileColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
@@ -156,20 +137,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
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)
|
||||
{
|
||||
//In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 10);
|
||||
ProvUtils.ApplyDebuffs(target, 80);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,18 +37,6 @@ 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)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
|
||||
if (Projectile.timeLeft < 510)
|
||||
Projectile.tileCollide = true;
|
||||
|
||||
@@ -73,13 +61,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(Projectile.alpha);
|
||||
}
|
||||
|
||||
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/ProfanedSpearNight").Value;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, texture);
|
||||
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value;
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(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, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
|
||||
return false;
|
||||
@@ -87,8 +75,8 @@ 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);
|
||||
Color hiColor = ProvUtils.GetDayNightColor(255, false);
|
||||
Color loColor = ProvUtils.GetDayNightColor(0, true);
|
||||
|
||||
for (int i = 0; i < 25; i++)
|
||||
{
|
||||
|
||||
@@ -91,8 +91,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
Player proviTarget = Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target];
|
||||
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
|
||||
Projectile.position.X = proviTarget.Center.X - (Projectile.width / 2);
|
||||
Projectile.position.Y = proviTarget.Center.Y - (Projectile.height / 2) + proviTarget.gfxOffY - 360f;
|
||||
if (proviTarget.gravDir == -1f)
|
||||
@@ -113,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
if (Projectile.alpha == 0 && Main.rand.NextBool(15))
|
||||
{
|
||||
Color BaseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
Color BaseColor = ProvUtils.GetProjectileColor(0);
|
||||
float Brightness = 0.8f;
|
||||
Color DustColor = Color.Lerp(BaseColor, Color.White, Brightness);
|
||||
Dust crystalDust = Main.dust[Dust.NewDust(Projectile.Top, 0, 0, DustID.RainbowMk2, 0f, 0f, 100, DustColor, 1f)];
|
||||
@@ -132,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
// At day, fires every 300 frames but lasts 1500-3600 frames.
|
||||
// At night, fires every 30 framges but lasts 210 frames.
|
||||
// In GFB, fires at night rate for the first 210 frames, then at day rate for the next 1500.
|
||||
bool dayAI = Projectile.maxPenetrate == (int)Providence.BossMode.Day || (Projectile.maxPenetrate >= (int)Providence.BossMode.Red && Projectile.timeLeft < 1500);
|
||||
bool dayAI = ProvUtils.DayAI() || (Main.zenithWorld && Projectile.timeLeft < 1500);
|
||||
|
||||
if (Projectile.localAI[0] >= (dayAI ? 300f : 30f))
|
||||
{
|
||||
|
||||
@@ -51,23 +51,16 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 0, 10);
|
||||
|
||||
bool healerGuardianAlive = true;
|
||||
if (CalamityGlobalNPC.doughnutBossHealer < 0 || !Main.npc[CalamityGlobalNPC.doughnutBossHealer].active)
|
||||
healerGuardianAlive = false;
|
||||
|
||||
Lighting.AddLight(Projectile.Center, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity);
|
||||
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
// Night AI or Guardian Healer
|
||||
if (Projectile.maxPenetrate != (int)Providence.BossMode.Day || healerGuardianAlive)
|
||||
if (!ProvUtils.DayAI() || healerGuardianAlive)
|
||||
Projectile.extraUpdates = 1;
|
||||
|
||||
if (Projectile.timeLeft < 300)
|
||||
@@ -232,21 +225,5 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(255 * Projectile.Opacity, 255 * Projectile.Opacity, 255 * Projectile.Opacity, 255 * Projectile.Opacity);
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
// In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 0, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,26 +58,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
ExtraWidth = Projectile.ai[2];
|
||||
|
||||
// Day mode by default but syncs with the boss
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
else if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
bool scissorLasers = CalamityWorld.revenge || (Projectile.maxPenetrate != (int)Providence.BossMode.Day);
|
||||
bool scissorLasers = CalamityWorld.revenge || !ProvUtils.DayAI();
|
||||
Vector2? vector78 = null;
|
||||
|
||||
if (Projectile.velocity.HasNaNs() || Projectile.velocity == Vector2.Zero)
|
||||
@@ -103,6 +84,9 @@ namespace CalamityMod.Projectiles.Boss
|
||||
return;
|
||||
}
|
||||
|
||||
if (projScale == 1f)
|
||||
ProvUtils.ApplyGFBDamage(Projectile, 400, 20);
|
||||
|
||||
Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * MathHelper.Pi / (scissorLasers ? 100f : 180f)) * 10f * projScale;
|
||||
if (Projectile.scale > projScale)
|
||||
Projectile.scale = projScale;
|
||||
@@ -131,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (!Collision.CanHitLine(Main.npc[(int)Projectile.ai[1]].Center, 1, 1, Main.player[Main.npc[(int)Projectile.ai[1]].target].Center, 1, 1))
|
||||
rayLength = 2400f;
|
||||
|
||||
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
|
||||
int dustType = ProvUtils.GetDustID();
|
||||
Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], rayLength, 0.5f); // Length of laser, linear interpolation
|
||||
Vector2 dustRotation = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f);
|
||||
for (int j = 0; j < 2; j++)
|
||||
@@ -158,13 +142,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
for (float i = 0; i < Projectile.localAI[1]; i += Main.rand.NextFloat(15, 30))
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(30 * ExtraWidth), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)) + (Projectile.velocity * i), Projectile.velocity * 5, false, 5, Main.rand.NextFloat(0.5f, 1.5f), ProvUtils.GetProjectileColor((int)Projectile.maxPenetrate, 255), false));
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(30 * ExtraWidth), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)) + (Projectile.velocity * i), Projectile.velocity * 5, false, 5, Main.rand.NextFloat(0.5f, 1.5f), ProvUtils.GetProjectileColor(255), false));
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
return ProvUtils.GetProjectileColor(lightColor);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -174,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
Vector2 scale = new Vector2(Projectile.scale * ExtraWidth, Projectile.scale);
|
||||
|
||||
bool dayTime = Projectile.maxPenetrate == (int)Providence.BossMode.Day;
|
||||
bool dayTime = ProvUtils.DayAI();
|
||||
Texture2D texture2D19 = dayTime ? ModContent.Request<Texture2D>(Texture, AssetRequestMode.ImmediateLoad).Value :
|
||||
ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight", AssetRequestMode.ImmediateLoad).Value;
|
||||
Texture2D texture2D20 = dayTime ? ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value :
|
||||
@@ -183,7 +167,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
float rayDrawLength = Projectile.localAI[1]; //length of laser
|
||||
Color baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
|
||||
Color baseColor = ProvUtils.GetProjectileColor(lightColor);
|
||||
Vector2 vector = Projectile.Center - Main.screenPosition;
|
||||
Rectangle? sourceRectangle2 = null;
|
||||
Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, baseColor, Projectile.rotation, texture2D19.Size() / 2f, scale, SpriteEffects.None, 0);
|
||||
@@ -196,7 +180,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
Projectile.localAI[2]++;
|
||||
|
||||
Color glowColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
|
||||
Color glowColor = ProvUtils.GetProjectileColor(0);
|
||||
|
||||
Main.EntitySpriteDraw(GlowBallTexture, Projectile.Center - Main.screenPosition, GlowBallTexture.Frame(), glowColor, 0f, GlowBallTexture.Frame().Center(), Projectile.scale / 1.5f * ExtraWidth, SpriteEffects.None);
|
||||
Main.EntitySpriteDraw(GlowRingTexture, Projectile.Center - Main.screenPosition, GlowRingTexture.Frame(), glowColor, 0f, GlowRingTexture.Frame().Center(), Projectile.scale / MathHelper.Lerp(1.5f, 1f, (float)Math.Sin(Projectile.localAI[2] / 20f) * 0.5f) * ExtraWidth, SpriteEffects.None);
|
||||
@@ -250,20 +234,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
|
||||
{
|
||||
// In GFB, "real damage" is replaced with negative healing
|
||||
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
|
||||
modifiers.SourceDamage *= 0f;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
// If the player is dodging, don't apply debuffs
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
if (info.Damage <= 0 || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 400, 20);
|
||||
ProvUtils.ApplyDebuffs(target, 400);
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f;
|
||||
|
||||
@@ -30,26 +30,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
|
||||
if (CalamityGlobalNPC.holyBoss != -1)
|
||||
{
|
||||
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
|
||||
}
|
||||
|
||||
if (CalamityGlobalNPC.doughnutBoss != -1)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
|
||||
{
|
||||
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
|
||||
else
|
||||
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
|
||||
}
|
||||
}
|
||||
|
||||
Color c = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
|
||||
Color c = ProvUtils.GetProjectileColor(255);
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, Projectile.velocity / 2f, false, 10, 0.5f * Projectile.ai[2], c));
|
||||
GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, 0.5f * Projectile.ai[2], 150, Main.rand.NextFloat(-0.01f, 0.01f)));
|
||||
|
||||
@@ -323,9 +323,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
if (shouldDrawDust)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
var shouldAdjust = !Main.dayTime && buffedAi;
|
||||
int dustId = ProvUtils.GetDustID(pscState);
|
||||
int dustId = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + (Projectile.Size / 2f).RotatedBy(Projectile.rotation), dustId);
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10));
|
||||
Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero);
|
||||
velocity *= (Main.dayTime || !SpawnedFromPSC) ? 3f : 6.9f;
|
||||
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f);
|
||||
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID(!Main.dayTime && SpawnedFromPSC), velocity, 0, default(Color), 2f);
|
||||
if (!Main.dayTime && SpawnedFromPSC)
|
||||
dust.noGravity = true;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (!Main.rand.NextBool(3))
|
||||
continue;
|
||||
|
||||
Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night)));
|
||||
Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, ProvUtils.GetDustID(!Main.dayTime && SpawnedFromPSC));
|
||||
dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
|
||||
dust.velocity.Y -= Main.rand.NextFloat(1f, 3f);
|
||||
dust.scale = Main.rand.NextFloat(1.15f, 1.45f);
|
||||
|
||||
@@ -314,9 +314,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f);
|
||||
Vector2 dustVelocity = (player.Center - spawnPosition) * 0.085f + owner.velocity;
|
||||
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState));
|
||||
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(!Main.dayTime));
|
||||
dust.velocity = dustVelocity;
|
||||
dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f);
|
||||
dust.color = Color.Lerp(Color.LightCoral, Color.White, Projectile.ai[2] / 120 * Main.rand.NextFloat(0.65f, 1f));
|
||||
|
||||
@@ -107,8 +107,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
// Fire laser through walls at max length
|
||||
num807 = 2400f;
|
||||
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dustType = ProvUtils.GetDustID(pscState);
|
||||
int dustType = ProvUtils.GetDustID(!Main.dayTime);
|
||||
float amount = 0.5f;
|
||||
Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], num807, amount); // Length of laser, linear interpolation
|
||||
Vector2 vector79 = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f);
|
||||
@@ -149,8 +148,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value;
|
||||
|
||||
float num223 = Projectile.localAI[1]; //length of laser
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Color color44 = ProvUtils.GetProjectileColor(pscState, 0) * 0.9f;
|
||||
Color color44 = ProvUtils.GetDayNightColor(!Main.dayTime, 0) * 0.9f;
|
||||
Vector2 vector = Projectile.Center - Main.screenPosition;
|
||||
Rectangle? sourceRectangle2 = null;
|
||||
Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, Projectile.rotation, texture2D19.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
|
||||
|
||||
@@ -87,8 +87,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
|
||||
Projectile.ExpandHitboxBy(50);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dustType = ProvUtils.GetDustID(pscState);
|
||||
int dustType = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int d = 0; d < 5; d++)
|
||||
{
|
||||
int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
|
||||
@@ -118,9 +117,6 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
|
||||
return;
|
||||
|
||||
Projectile.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override void AI()
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dustID = ProvUtils.GetDustID(pscState);
|
||||
int dustID = ProvUtils.GetDustID(!Main.dayTime);
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
@@ -137,8 +137,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -146,8 +145,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -180,8 +178,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Split(false, false);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dustID = ProvUtils.GetDustID(pscState);
|
||||
int dustID = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num193 = 0; num193 < 6; num193++)
|
||||
{
|
||||
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, 1.5f);
|
||||
@@ -251,7 +248,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
if (Projectile.timeLeft > 550)
|
||||
Projectile.velocity *= 0.95f;
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), 0f, 0f, 100, default, Main.dayTime ? 1f : 0.75f);
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime), 0f, 0f, 100, default, Main.dayTime ? 1f : 0.75f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
|
||||
@@ -329,17 +326,15 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -380,8 +375,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.width = Projectile.height = 200;
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num621 = 0; num621 < 4; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
|
||||
@@ -507,9 +501,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha), 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -524,8 +517,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.width = Projectile.height = 200;
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num621 = 0; num621 < 4; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
|
||||
@@ -736,8 +728,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
||||
|
||||
Projectile.velocity *= boomerSwarm ? 1.03f : 1.02f;
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
@@ -747,8 +738,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -756,8 +746,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -792,8 +781,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.width = Projectile.height = 200;
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num621 = 0; num621 < 4; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
|
||||
@@ -922,8 +910,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.height = 50;
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num621 = 0; num621 < 10; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
|
||||
@@ -956,16 +943,14 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -1507,9 +1492,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 spawnPosition = Projectile.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f);
|
||||
Vector2 dustVelocity = (Projectile.Center - spawnPosition) * 0.085f + owner.velocity;
|
||||
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState));
|
||||
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(!Main.dayTime));
|
||||
dust.velocity = dustVelocity;
|
||||
dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f);
|
||||
dust.noGravity = true;
|
||||
@@ -1567,7 +1550,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10));
|
||||
Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero);
|
||||
velocity *= Main.dayTime ? 3f : 6.9f;
|
||||
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f);
|
||||
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID(!Main.dayTime), velocity, 0, default(Color), 2f);
|
||||
if (!Main.dayTime)
|
||||
dust.noGravity = true;
|
||||
}
|
||||
@@ -1795,8 +1778,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
//Ensure that psa's spears are not coloured by night
|
||||
var psc = Projectile.ai[0] > 0f;
|
||||
int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day);
|
||||
int num469 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f);
|
||||
int num469 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime && psc), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
handleAI(psc && Projectile.ai[1] > 0f);
|
||||
@@ -1813,9 +1795,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
var psc = Projectile.ai[0] > 0f;
|
||||
int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha), 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1830,9 +1811,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
var psc = Projectile.ai[0] > 0f;
|
||||
var shouldAdjust = !Main.dayTime && psc;
|
||||
int pscState = (int)(shouldAdjust ? Providence.BossMode.Night : Providence.BossMode.Day);
|
||||
int dustID = ProvUtils.GetDustID(pscState);
|
||||
bool shouldAdjust = !Main.dayTime && psc;
|
||||
int dustID = ProvUtils.GetDustID(shouldAdjust);
|
||||
for (int num621 = 0; num621 < 4; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 2f);
|
||||
@@ -1927,16 +1907,14 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.damage = (int)Owner.GetTotalDamage<SummonDamageClass>().ApplyTo(Projectile.originalDamage);
|
||||
Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage);
|
||||
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, 1f);
|
||||
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime), 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
Main.dust[num469].velocity *= 0f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -1944,8 +1922,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -1980,8 +1957,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Split();
|
||||
}
|
||||
SoundEngine.PlaySound(HolyBlast.ImpactSound, Projectile.Center);
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dustID = ProvUtils.GetDustID(pscState);
|
||||
int dustID = ProvUtils.GetDustID(!Main.dayTime);
|
||||
for (int num193 = 0; num193 < 6; num193++)
|
||||
{
|
||||
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, Main.dayTime ? 1.5f : 0.5f);
|
||||
@@ -2077,17 +2053,15 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
|
||||
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
|
||||
int num214 = texture.Height / Main.projFrames[Projectile.type];
|
||||
int y6 = num214 * Projectile.frame;
|
||||
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
|
||||
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, 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, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -2102,8 +2076,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
|
||||
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
|
||||
|
||||
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
|
||||
int dust = ProvUtils.GetDustID(pscState);
|
||||
int dust = ProvUtils.GetDustID(!Main.dayTime);
|
||||
|
||||
for (int num621 = 0; num621 < 4; num621++)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user