Enraged Providence is now FTW Providence
Also features a few minor AI changes to account for this
This commit is contained in:
1 parent
fc82e6b04d
commit
1d9b602f36
9 files changed
+43
-97
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Events;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.Providence;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
@@ -36,28 +38,27 @@ namespace CalamityMod.Items.SummonItems
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
var Prov = CalamityGlobalNPC.holyBoss;
|
||||
bool canPissOffProvi = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged;
|
||||
return ((!NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHallow || player.ZoneUnderworldHeight)) || canPissOffProvi) && !BossRushEvent.BossRushActive;
|
||||
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive;
|
||||
}
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
var Prov = CalamityGlobalNPC.holyBoss;
|
||||
bool usingToMakeProviPissedOff = Prov != -1 && Main.npc[Prov].life >= (Main.npc[Prov].lifeMax * 0.95f) && Main.npc[Prov].Calamity().newAI[3] >= 180f && !Main.npc[Prov].Calamity().CurrentlyEnraged;
|
||||
if (usingToMakeProviPissedOff)
|
||||
int posX = (int)player.position.X;
|
||||
int posY = (int)(player.position.Y - 100f);
|
||||
int bossToSpawn = ModContent.NPCType<Providence>();
|
||||
NPC prov = CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound);
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
(Main.npc[Prov].ModNPC as Providence).hasBeenGivenFullPower = true;
|
||||
(prov.ModNPC as Providence).hasBeenGivenFullPower = true;
|
||||
Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center, Vector2.Zero, ModContent.ProjectileType<HolyProfanedCore>(), 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
int posX = (int)player.position.X;
|
||||
int posY = (int)(player.position.Y - 100f);
|
||||
int bossToSpawn = ModContent.NPCType<Providence>();
|
||||
CalamityUtils.SpawnBossOnPosUsingItem(player, bossToSpawn, posX, posY, Providence.SpawnSound);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
string enrageTooltip = Main.getGoodWorld ? "\n" + this.GetLocalizedValue("EnrageText") : "";
|
||||
tooltips.FindAndReplace("[ENRAGE]", enrageTooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,11 +226,11 @@ ProfanedCore: {
|
||||
DisplayName: Profaned Core
|
||||
Tooltip:
|
||||
'''
|
||||
Summons Providence when used in the Hallow or Underworld
|
||||
Use again while Providence is at high health to unleash Her perfect fury
|
||||
Summons Providence when used in the Hallow or Underworld[ENRAGE]
|
||||
{$Common.NotConsumable}
|
||||
'The heart of Her Guardians, Her wicked wrath shall burn upon whoever now wields it.'
|
||||
'''
|
||||
EnrageText: "[c/64c8fa:The nature of this world will unleash Her perfect fury, beware!]"
|
||||
}
|
||||
|
||||
ProfanedShard: {
|
||||
|
||||
@@ -598,7 +598,7 @@ TownPiggy: {
|
||||
Techno: Techno
|
||||
JohnPork: John Pork
|
||||
Piglet: Piglet
|
||||
Poogie: Poogie
|
||||
Poogie: Poogie
|
||||
}
|
||||
|
||||
Chat: {
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
NPC.Calamity().VulnerableToSickness = false;
|
||||
NPC.Calamity().VulnerableToWater = true;
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
if (Main.zenithWorld)
|
||||
NPC.scale *= 0.25f;
|
||||
}
|
||||
|
||||
@@ -400,8 +400,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
Player player = Main.player[NPC.target];
|
||||
|
||||
// Enraged bool and Color shifting
|
||||
bool getFuckedAI = Main.zenithWorld;
|
||||
if (getFuckedAI)
|
||||
if (Main.zenithWorld)
|
||||
NPC.localAI[1] = (float)BossMode.Rainbow;
|
||||
else if (hasBeenGivenFullPower) // Enraged behavior
|
||||
NPC.localAI[1] = (float)BossMode.Enraged;
|
||||
@@ -426,29 +425,15 @@ namespace CalamityMod.NPCs.Providence
|
||||
// Is in spawning animation
|
||||
float spawnAnimationTime = 180f;
|
||||
bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime;
|
||||
|
||||
if (!spawnAnimation)
|
||||
{
|
||||
NPC.Opacity = 1f;
|
||||
}
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = NPC.life / (float)NPC.lifeMax;
|
||||
|
||||
// Play enrage animation if she gets angy
|
||||
if (!getFuckedAI && fullPowerAI && calamityGlobalNPC.newAI[3] == spawnAnimationTime)
|
||||
// Sync "enrage" status in FTW
|
||||
if (NPC.localAI[1] == (float)BossMode.Enraged && calamityGlobalNPC.newAI[3] == 0f)
|
||||
{
|
||||
AIState = (int)Phase.HolyBlast;
|
||||
NPC.ai[1] = 0f;
|
||||
NPC.ai[2] = 0f;
|
||||
NPC.ai[3] = 0f;
|
||||
calamityGlobalNPC.newAI[1] = 0f;
|
||||
calamityGlobalNPC.newAI[2] = 0f;
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
|
||||
// Despawn existing projectiles and summon the aura again
|
||||
DespawnSpecificProjectiles(true);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<HolyAura>(), 0, 0f, -1);
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
ProvidenceDyeConditionSyncPacket.Send(this);
|
||||
NPC.ForceNetUpdate(false);
|
||||
@@ -811,7 +796,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon || AIState == (int)Phase.Laser || spawnAnimation;
|
||||
|
||||
// Movement
|
||||
if (getFuckedAI || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon))
|
||||
if (Main.zenithWorld || (AIState != (int)Phase.FlameCocoon && AIState != (int)Phase.SpearCocoon))
|
||||
{
|
||||
// Slowly drift down when spawning
|
||||
if (spawnAnimation)
|
||||
@@ -878,14 +863,8 @@ namespace CalamityMod.NPCs.Providence
|
||||
}
|
||||
if (laserPhaseSlow)
|
||||
{
|
||||
acceleration *= getFuckedAI ? 0.6f : 0.2f;
|
||||
velocity *= getFuckedAI ? 0.6f : 0.2f;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
velocity *= 1.2f;
|
||||
acceleration *= 1.2f;
|
||||
acceleration *= Main.zenithWorld ? 0.6f : 0.2f;
|
||||
velocity *= Main.zenithWorld ? 0.6f : 0.2f;
|
||||
}
|
||||
|
||||
if (!targetDead)
|
||||
@@ -898,14 +877,11 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height);
|
||||
if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150
|
||||
NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f;
|
||||
NPC.velocity.Y -= fullPowerAI ? 0.4f : 0.2f;
|
||||
if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200
|
||||
NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f;
|
||||
NPC.velocity.Y += fullPowerAI ? 0.4f : 0.2f;
|
||||
|
||||
float speedCap = laserPhaseSlow ? 2f : 6f;
|
||||
if (Main.getGoodWorld)
|
||||
speedCap *= 1.5f;
|
||||
|
||||
if (NPC.velocity.Y > speedCap)
|
||||
NPC.velocity.Y = speedCap;
|
||||
if (NPC.velocity.Y < -speedCap)
|
||||
@@ -1121,29 +1097,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
GeneralParticleHandler.SpawnParticle(new SparkParticle(startPos, startPos.DirectionTo(destination) * (startPos.Distance(destination) / 10), false, 10, Main.rand.NextFloat(0.2f, 0.5f) * (sc * 2), medColor));
|
||||
}
|
||||
|
||||
// Used to heal her back to full HP during enrage animation
|
||||
if (fullPowerAI && calamityGlobalNPC.newAI[3] % 9f == 0f)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int healAmt = NPC.lifeMax / 400;
|
||||
if (healAmt > NPC.lifeMax - NPC.life)
|
||||
healAmt = NPC.lifeMax - NPC.life;
|
||||
|
||||
if (healAmt > 0)
|
||||
{
|
||||
NPC.life += healAmt;
|
||||
NPC.HealEffect(healAmt, true);
|
||||
NPC.ForceNetUpdate(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
|
||||
if (fullPowerAI && calamityGlobalNPC.newAI[3] >= spawnAnimationTime)
|
||||
calamityGlobalNPC.newAI[3] += 1f;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1238,7 +1192,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
borderPosition ??= NPC.Center;
|
||||
borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f);
|
||||
Vector2 fireSparklesFrom = fireFrom + new Vector2(0, -30);
|
||||
if (!targetDead && !getFuckedAI)
|
||||
if (!targetDead && !Main.zenithWorld)
|
||||
{
|
||||
if (NPC.velocity.Length() <= 2f)
|
||||
NPC.velocity = Vector2.Zero;
|
||||
@@ -1509,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
borderPosition ??= NPC.Center;
|
||||
borderPosition = Vector2.Lerp(borderPosition.Value, NPC.Center, 0.02f);
|
||||
|
||||
if (!targetDead && !getFuckedAI)
|
||||
if (!targetDead && !Main.zenithWorld)
|
||||
{
|
||||
if (NPC.velocity.Length() <= 2f)
|
||||
NPC.velocity = Vector2.Zero;
|
||||
@@ -1554,9 +1508,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1581,9 +1532,6 @@ namespace CalamityMod.NPCs.Providence
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1601,7 +1549,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
case (int)Phase.Crystal:
|
||||
|
||||
if (!targetDead && !getFuckedAI)
|
||||
if (!targetDead && !Main.zenithWorld)
|
||||
NPC.velocity *= 0.9f;
|
||||
|
||||
NPC.ai[1] += 1f;
|
||||
@@ -1673,7 +1621,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f;
|
||||
float timeLeft = fullPowerAI ? (float)(Main.zenithWorld ? gfbCrystalTime : enragedCrystalTime) : 0f;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType<ProvidenceCrystal>(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft);
|
||||
}
|
||||
}
|
||||
@@ -2094,7 +2042,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
{
|
||||
bool offColor = NPC.localAI[1] != (float)BossMode.Normal && (NPC.Calamity().newAI[3] >= 180f || Main.zenithWorld);
|
||||
bool offColor = NPC.localAI[1] != (float)BossMode.Normal;
|
||||
|
||||
Texture2D texture = offColor ? TextureNight.Value : TextureAssets.Npc[Type].Value;
|
||||
Texture2D textureGlow = offColor ? TextureNight_Glow.Value : Texture_Glow.Value;
|
||||
|
||||
@@ -161,9 +161,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6;
|
||||
if (Main.getGoodWorld)
|
||||
totalProjectiles *= 2;
|
||||
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int type = ModContent.ProjectileType<HolyBlastFrags>();
|
||||
float velocity = 5f;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.timeLeft = 160;
|
||||
}
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
{
|
||||
if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f)
|
||||
{
|
||||
@@ -74,8 +74,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.ai[1] += 0.05f;
|
||||
Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(Projectile.ai[1])));
|
||||
Projectile.ai[1] += 0.075f;
|
||||
Projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, MathF.Abs(MathF.Sin(Projectile.ai[1])));
|
||||
}
|
||||
}
|
||||
else if (Projectile.velocity.Length() < 16f)
|
||||
|
||||
@@ -90,12 +90,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Vector2 velocity = new Vector2(0.01f, 0f);
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
velocity *= Main.rand.NextFloat(1f, 2f);
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
velocity *= Main.rand.NextFloat(1f, 2f);
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
|
||||
@@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Vector2 velocity = new Vector2(0.05f, 0f);
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
velocity *= Main.rand.NextFloat(1f, 2f);
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
velocity *= Main.rand.NextFloat(1f, 2f);
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType<HolyFire2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f);
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity;
|
||||
velocity.Y = -Math.Abs(velocity.Y);
|
||||
if (Main.getGoodWorld)
|
||||
if (!ProvUtils.StandardAI())
|
||||
velocity *= 2f;
|
||||
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<MoltenBlob>(), BlobDamage, 0f, Projectile.owner);
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace CalamityMod.Systems
|
||||
public override int NPCType => ModContent.NPCType<Providence>();
|
||||
public static int ProvidenceTrack => (int)CalamityMod.Instance.GetMusicFromMusicMod("Providence");
|
||||
public static int SilenceTrack => MusicLoader.GetMusicSlot(CalamityMod.Instance, "Sounds/Music/Silence");
|
||||
public override int? MusicModMusic => ProvidenceSpawnState() < 180f && ProvUtils.StandardAI() ? SilenceTrack : ProvidenceTrack;
|
||||
public override int? MusicModMusic => ProvidenceSpawnState() < 180f ? SilenceTrack : ProvidenceTrack;
|
||||
public override int VanillaMusic => MusicID.LunarBoss;
|
||||
public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss;
|
||||
public override void SpecialVisuals(Player player, bool isActive)
|
||||
{
|
||||
if (ProvidenceSpawnState() == 180f && ProvUtils.StandardAI())
|
||||
if (ProvidenceSpawnState() == 180f)
|
||||
Main.musicFade[ProvidenceTrack] = 1f;
|
||||
}
|
||||
public static float ProvidenceSpawnState()
|
||||
|
||||
Reference in new issue
Block a user