Merge branch 'master' into rogue-prefixes

This commit is contained in:
termigator1359 committed 2020-05-29 10:02:45 -04:00
commit e1d6c045cf
119 files changed
+2622 -2619

No files matched your search

+25 -5
View File
@@ -9,9 +9,7 @@ using CalamityMod.Items.Armor;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.DifficultyItems;
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
using CalamityMod.Items.Mounts;
using CalamityMod.Items.Pets;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
@@ -54,8 +52,6 @@ using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.ModLoader.Config;
using System.Linq;
namespace CalamityMod.CalPlayer
{
@@ -5753,12 +5749,35 @@ namespace CalamityMod.CalPlayer
if (damage < bossRushDamage)
damage = bossRushDamage;
}
if (areThereAnyDamnBosses && CalamityMod.bossVelocityDamageScaleValues.ContainsKey(npc.type))
{
CalamityMod.bossVelocityDamageScaleValues.TryGetValue(npc.type, out float velocityScalar);
if (((npc.type == NPCID.EyeofCthulhu || npc.type == NPCID.Spazmatism) && npc.ai[0] >= 2f) || (npc.type == NPCID.Plantera && npc.life / (float)npc.lifeMax <= 0.5f))
velocityScalar = CalamityMod.bitingEnemeyVelocityScale;
if (npc.velocity == Vector2.Zero)
{
damage = (int)(damage * velocityScalar);
}
else
{
float amount = npc.velocity.Length() / npc.Calamity().maxVelocity;
if (amount > 1f)
amount = 1f;
damage = (int)(damage * MathHelper.Lerp(velocityScalar, 1.1f, amount));
}
}
if (triumph)
{
double HPMultiplier = 0.15 * (1.0 - ((double)npc.life / (double)npc.lifeMax));
double HPMultiplier = 0.15 * (1.0 - (npc.life / (double)npc.lifeMax));
int damageReduction = (int)(damage * HPMultiplier);
damage -= damageReduction;
}
if (aSparkRare)
{
if (npc.type == NPCID.BlueJellyfish || npc.type == NPCID.PinkJellyfish || npc.type == NPCID.GreenJellyfish ||
@@ -5766,6 +5785,7 @@ namespace CalamityMod.CalPlayer
npc.type == NPCID.MartianTurret || npc.type == ModContent.NPCType<StormlionCharger>() || npc.type == ModContent.NPCType<GhostBell>() || npc.type == ModContent.NPCType<BoxJellyfish>())
damage /= 2;
}
if (fleshTotem && !fleshTotemCooldown)
{
player.AddBuff(ModContent.BuffType<FleshTotemCooldown>(), 1200, false); //20 seconds
+148 -4
View File
@@ -124,8 +124,15 @@ namespace CalamityMod
// DR data structure
public static SortedDictionary<int, float> DRValues;
// Boss Kill Time data structure
public static SortedDictionary<int, int> bossKillTimes;
// Boss velocity scaling data structure
public static SortedDictionary<int, float> bossVelocityDamageScaleValues;
public const float velocityScaleMin = 0.5f;
public const float bitingEnemeyVelocityScale = 0.8f;
// Lists
public static IList<string> donatorList;
public static List<int> rangedProjectileExceptionList;
@@ -240,6 +247,7 @@ namespace CalamityMod
SetupLists();
SetupVanillaDR();
SetupBossKillTimes();
SetupBossVelocityScalingValues();
SetupThoriumBossDR(thorium);
CalamityLocalization.AddLocalizations();
@@ -345,6 +353,8 @@ namespace CalamityMod
DRValues = null;
bossKillTimes?.Clear();
bossKillTimes = null;
bossVelocityDamageScaleValues?.Clear();
bossVelocityDamageScaleValues = null;
donatorList = null;
rangedProjectileExceptionList = null;
@@ -2695,6 +2705,8 @@ namespace CalamityMod
#region Boss Kill Times
private void SetupBossKillTimes()
{
// 3600 = 1 minute
bossKillTimes = new SortedDictionary<int, int> {
{ NPCID.KingSlime, 3600 },
{ NPCID.EyeofCthulhu, 5400 },
@@ -2702,6 +2714,7 @@ namespace CalamityMod
{ NPCID.EaterofWorldsBody, 7200 },
{ NPCID.EaterofWorldsTail, 7200 },
{ NPCID.BrainofCthulhu, 5400 },
{ NPCID.Creeper, 1800 },
{ NPCID.QueenBee, 7200 },
{ NPCID.SkeletronHead, 9000 },
{ NPCID.WallofFlesh, 10800 },
@@ -2713,7 +2726,7 @@ namespace CalamityMod
{ NPCID.TheDestroyerTail, 10800 },
{ NPCID.SkeletronPrime, 10800 },
{ NPCID.Plantera, 10800 },
{ NPCID.Golem, 10800 },
{ NPCID.Golem, 9000 },
{ NPCID.GolemHead, 3600 },
{ NPCID.DukeFishron, 9000 },
{ NPCID.CultistBoss, 9000 },
@@ -2740,8 +2753,8 @@ namespace CalamityMod
{ ModContent.NPCType<BrimstoneElemental>(), 10800 },
{ ModContent.NPCType<Calamitas>(), 1200 },
{ ModContent.NPCType<CalamitasRun3>(), 11400 },
{ ModContent.NPCType<Leviathan>(), 9000 },
{ ModContent.NPCType<Siren>(), 9000 },
{ ModContent.NPCType<Leviathan>(), 10800 },
{ ModContent.NPCType<Siren>(), 10800 },
{ ModContent.NPCType<AstrumAureus>(), 10800 },
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), 10800 },
{ ModContent.NPCType<AstrumDeusBodySpectral>(), 10800 },
@@ -2770,7 +2783,138 @@ namespace CalamityMod
{ ModContent.NPCType<DevourerofGodsBodyS>(), 10800 },
{ ModContent.NPCType<DevourerofGodsTailS>(), 10800 },
{ ModContent.NPCType<Yharon>(), 10800 },
{ ModContent.NPCType<SupremeCalamitas>(), 14400 }
{ ModContent.NPCType<SupremeCalamitas>(), 18000 }
};
}
#endregion
#region Boss Velocity Contact Damage Scale Values
private void SetupBossVelocityScalingValues()
{
bossVelocityDamageScaleValues = new SortedDictionary<int, float> {
{ NPCID.KingSlime, velocityScaleMin },
{ NPCID.EyeofCthulhu, velocityScaleMin }, // Increases in phase 2
{ NPCID.EaterofWorldsHead, bitingEnemeyVelocityScale },
{ NPCID.EaterofWorldsBody, velocityScaleMin },
{ NPCID.EaterofWorldsTail, velocityScaleMin },
{ NPCID.Creeper, velocityScaleMin },
{ NPCID.BrainofCthulhu, velocityScaleMin },
{ NPCID.QueenBee, velocityScaleMin },
{ NPCID.SkeletronHead, velocityScaleMin },
{ NPCID.SkeletronHand, velocityScaleMin },
{ NPCID.TheHungry, bitingEnemeyVelocityScale },
{ NPCID.TheHungryII, bitingEnemeyVelocityScale },
{ NPCID.LeechHead, bitingEnemeyVelocityScale },
{ NPCID.LeechBody, velocityScaleMin },
{ NPCID.LeechTail, velocityScaleMin },
{ NPCID.Spazmatism, velocityScaleMin }, // Increases in phase 2
{ NPCID.Retinazer, velocityScaleMin },
{ NPCID.TheDestroyer, bitingEnemeyVelocityScale },
{ NPCID.TheDestroyerBody, velocityScaleMin },
{ NPCID.TheDestroyerTail, velocityScaleMin },
{ NPCID.Probe, velocityScaleMin },
{ NPCID.SkeletronPrime, velocityScaleMin },
{ NPCID.PrimeCannon, velocityScaleMin },
{ NPCID.PrimeLaser, velocityScaleMin },
{ NPCID.PrimeSaw, velocityScaleMin },
{ NPCID.PrimeVice, velocityScaleMin },
{ NPCID.Plantera, velocityScaleMin }, // Increases in phase 2
{ NPCID.PlanterasTentacle, bitingEnemeyVelocityScale },
{ NPCID.Golem, velocityScaleMin },
{ NPCID.GolemFistLeft, velocityScaleMin },
{ NPCID.GolemFistRight, velocityScaleMin },
{ NPCID.GolemHead, velocityScaleMin },
{ NPCID.DukeFishron, velocityScaleMin },
{ ModContent.NPCType<DesertScourgeHead>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<DesertScourgeBody>(), velocityScaleMin },
{ ModContent.NPCType<DesertScourgeTail>(), velocityScaleMin },
{ ModContent.NPCType<DesertScourgeHeadSmall>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<DesertScourgeBodySmall>(), velocityScaleMin },
{ ModContent.NPCType<DesertScourgeTailSmall>(), velocityScaleMin },
{ ModContent.NPCType<CrabulonIdle>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<HiveMindP2>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorHive>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorHeadLarge>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<PerforatorBodyLarge>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorTailLarge>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorHeadMedium>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<PerforatorBodyMedium>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorTailMedium>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorHeadSmall>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<PerforatorBodySmall>(), velocityScaleMin },
{ ModContent.NPCType<PerforatorTailSmall>(), velocityScaleMin },
{ ModContent.NPCType<SlimeGodCore>(), velocityScaleMin },
{ ModContent.NPCType<SlimeGod>(), velocityScaleMin },
{ ModContent.NPCType<SlimeGodRun>(), velocityScaleMin },
{ ModContent.NPCType<SlimeGodSplit>(), velocityScaleMin },
{ ModContent.NPCType<SlimeGodRunSplit>(), velocityScaleMin },
{ ModContent.NPCType<SlimeSpawnCorrupt>(), velocityScaleMin },
{ ModContent.NPCType<Cryogen>(), velocityScaleMin },
{ ModContent.NPCType<Cryocore>(), velocityScaleMin },
{ ModContent.NPCType<Cryocore2>(), velocityScaleMin },
{ ModContent.NPCType<IceMass>(), velocityScaleMin },
{ ModContent.NPCType<AquaticScourgeHead>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<AquaticScourgeBody>(), velocityScaleMin },
{ ModContent.NPCType<AquaticScourgeBodyAlt>(), velocityScaleMin },
{ ModContent.NPCType<AquaticScourgeTail>(), velocityScaleMin },
{ ModContent.NPCType<BrimstoneElemental>(), velocityScaleMin },
{ ModContent.NPCType<Calamitas>(), velocityScaleMin },
{ ModContent.NPCType<CalamitasRun3>(), velocityScaleMin },
{ ModContent.NPCType<Leviathan>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<Siren>(), velocityScaleMin },
{ ModContent.NPCType<AstrumAureus>(), velocityScaleMin },
{ ModContent.NPCType<AstrumDeusHeadSpectral>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<AstrumDeusBodySpectral>(), velocityScaleMin },
{ ModContent.NPCType<AstrumDeusTailSpectral>(), velocityScaleMin },
{ ModContent.NPCType<AstrumDeusHead>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<AstrumDeusBody>(), velocityScaleMin },
{ ModContent.NPCType<AstrumDeusTail>(), velocityScaleMin },
{ ModContent.NPCType<AstrumDeusProbe3>(), velocityScaleMin },
{ ModContent.NPCType<PlaguebringerGoliath>(), velocityScaleMin },
{ ModContent.NPCType<PlaguebringerShade>(), velocityScaleMin },
{ ModContent.NPCType<PlagueBeeG>(), velocityScaleMin },
{ ModContent.NPCType<PlagueBeeLargeG>(), velocityScaleMin },
{ ModContent.NPCType<RavagerBody>(), velocityScaleMin },
{ ModContent.NPCType<RavagerClawLeft>(), velocityScaleMin },
{ ModContent.NPCType<RavagerClawRight>(), velocityScaleMin },
{ ModContent.NPCType<RavagerLegLeft>(), velocityScaleMin },
{ ModContent.NPCType<RavagerLegRight>(), velocityScaleMin },
{ ModContent.NPCType<RockPillar>(), velocityScaleMin },
{ ModContent.NPCType<ProfanedGuardianBoss>(), velocityScaleMin },
{ ModContent.NPCType<ProfanedGuardianBoss2>(), velocityScaleMin },
{ ModContent.NPCType<ProfanedGuardianBoss3>(), velocityScaleMin },
{ ModContent.NPCType<Bumblefuck>(), velocityScaleMin },
{ ModContent.NPCType<Bumblefuck2>(), velocityScaleMin },
{ ModContent.NPCType<CeaselessVoid>(), velocityScaleMin },
{ ModContent.NPCType<DarkEnergy>(), velocityScaleMin },
{ ModContent.NPCType<DarkEnergy2>(), velocityScaleMin },
{ ModContent.NPCType<DarkEnergy3>(), velocityScaleMin },
{ ModContent.NPCType<StormWeaverHead>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<StormWeaverBody>(), velocityScaleMin },
{ ModContent.NPCType<StormWeaverTail>(), velocityScaleMin },
{ ModContent.NPCType<StormWeaverHeadNaked>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<StormWeaverBodyNaked>(), velocityScaleMin },
{ ModContent.NPCType<StormWeaverTailNaked>(), velocityScaleMin },
{ ModContent.NPCType<StasisProbe>(), velocityScaleMin },
{ ModContent.NPCType<StasisProbeNaked>(), velocityScaleMin },
{ ModContent.NPCType<Signus>(), velocityScaleMin },
{ ModContent.NPCType<CosmicLantern>(), velocityScaleMin },
{ ModContent.NPCType<Polterghast>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<PolterPhantom>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<OldDuke>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsHead>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<DevourerofGodsBody>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsTail>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsHead2>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<DevourerofGodsBody2>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsTail2>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsHeadS>(), bitingEnemeyVelocityScale },
{ ModContent.NPCType<DevourerofGodsBodyS>(), velocityScaleMin },
{ ModContent.NPCType<DevourerofGodsTailS>(), velocityScaleMin },
{ ModContent.NPCType<Yharon>(), velocityScaleMin },
{ ModContent.NPCType<DetonatingFlare>(), velocityScaleMin },
{ ModContent.NPCType<DetonatingFlare2>(), velocityScaleMin },
{ ModContent.NPCType<SupremeCalamitas>(), velocityScaleMin }
};
}
#endregion
+1
View File
@@ -12,6 +12,7 @@
Phantoplasm = 60,
Plague = 46,
ProfanedFire = 244,
Nightwither = 185,
PurpleCosmolite = 173
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.SummonItems
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.NewNPC((int)(player.position.X + (float)Main.rand.Next(-50, 51)), (int)(player.position.Y - 50f), ModContent.NPCType<CrabulonIdle>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC((int)(player.position.X + Main.rand.Next(-50, 51)), (int)(player.position.Y - 50f), ModContent.NPCType<CrabulonIdle>(), 0, 0f, 0f, 0f, 0f, 255);
Main.PlaySound(SoundID.Roar, player.position, 0);
}
return true;
+7 -4
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.SummonItems
DisplayName.SetDefault("Profaned Core");
Tooltip.SetDefault("The core of the unholy flame\n" +
"Summons Providence\n" +
"Can only be used during daytime");
"Should be used during daytime");
}
public override void SetDefaults()
@@ -30,13 +30,16 @@ namespace CalamityMod.Items.SummonItems
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny;
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny;
}
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Providence>());
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType<Providence>(), 0, 0f, 0f, 0f, 0f, 255);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y);
}
return true;
}
}
+7 -4
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems
DisplayName.SetDefault("Profaned Core");
Tooltip.SetDefault("The core of the unholy flame\n" +
"Summons Providence\n" +
"Can only be used during daytime\n" +
"Should be used during daytime\n" +
"Not consumable");
}
@@ -32,13 +32,16 @@ namespace CalamityMod.Items.SummonItems
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny;
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny;
}
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Providence>());
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType<Providence>(), 0, 0f, 0f, 0f, 0f, 255);
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y);
}
return true;
}
+2 -2
View File
@@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.Abyss
npc.noTileCollide = true;
npc.collideX = false;
npc.collideY = false;
float num663 = 11f;
float num663 = 16f;
Vector2 vector80 = new Vector2(npc.Center.X, npc.Center.Y);
float num664 = Main.player[npc.target].Center.X - vector80.X;
float num665 = Main.player[npc.target].Center.Y - vector80.Y;
@@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.Abyss
else if (npc.ai[0] == 3f)
{
npc.noTileCollide = true;
float num671 = 11f;
float num671 = 16f;
float num672 = 0.25f;
Vector2 vector82 = new Vector2(npc.Center.X, npc.Center.Y);
float num673 = Main.player[npc.target].Center.X - vector82.X;
+4 -4
View File
@@ -21,11 +21,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.noGravity = true;
npc.damage = 22;
npc.damage = 44;
npc.width = 30;
npc.height = 33;
npc.defense = 5;
npc.lifeMax = 45;
npc.lifeMax = 90;
npc.alpha = 20;
npc.aiStyle = -1;
aiType = -1;
@@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.Abyss
if (npc.velocity.Y == 0f)
{
npc.velocity.X = npc.velocity.X * 0.98f;
if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01)
if (npc.velocity.X > -0.01 && npc.velocity.X < 0.01)
{
npc.velocity.X = 0f;
}
@@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Abyss
}
bool flag16 = false;
npc.TargetClosest(false);
if (Main.player[npc.target].wet && !Main.player[npc.target].dead)
if (Main.player[npc.target].wet && !Main.player[npc.target].dead && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
{
flag16 = true;
}
+3 -3
View File
@@ -26,11 +26,11 @@ namespace CalamityMod.NPCs.Abyss
{
npc.noGravity = true;
npc.chaseable = false;
npc.damage = 17;
npc.damage = 34;
npc.width = 50;
npc.height = 28;
npc.defense = 12;
npc.lifeMax = 55;
npc.lifeMax = 110;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
@@ -56,7 +56,7 @@ namespace CalamityMod.NPCs.Abyss
{
npc.ai[2] = -16f;
}
if (npc.velocity.X != 0f || npc.velocity.Y < 0f || npc.velocity.Y > 2f || npc.justHit || npc.localAI[0] >= 420f)
if (npc.justHit)
{
npc.ai[2] = -16f;
}
+3 -3
View File
@@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.Abyss
{
npc.noGravity = true;
npc.lavaImmune = true;
npc.damage = 60;
npc.damage = 90;
npc.width = 126;
npc.height = 66;
npc.defense = 999999;
npc.lifeMax = 200;
npc.lifeMax = 400;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
@@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Abyss
{
flag14 = true;
}
if ((!player.wet || player.dead) && flag14)
if ((!player.wet || player.dead || !Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) && flag14)
{
flag14 = false;
}
+3 -3
View File
@@ -29,11 +29,11 @@ namespace CalamityMod.NPCs.Abyss
{
npc.noGravity = true;
npc.lavaImmune = true;
npc.damage = 60;
npc.damage = 90;
npc.width = 126;
npc.height = 66;
npc.defense = 999999;
npc.lifeMax = 200;
npc.lifeMax = 400;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
@@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.Abyss
{
flag14 = true;
}
if ((!player.wet || player.dead) && flag14)
if ((!player.wet || player.dead || !Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) && flag14)
{
flag14 = false;
}
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
+16 -74
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.Abyss
public override void AI()
{
if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
{
detectsPlayer = true;
npc.damage = Main.expertMode ? 340 : 170;
@@ -106,7 +106,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!TailSpawned && npc.ai[0] == 0f)
@@ -237,44 +236,21 @@ namespace CalamityMod.NPCs.Abyss
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 600); //800
if (!detectsPlayer)
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 500f; //600
}
else
{
num191 = Main.player[npc.target].Center.X - 500f; //600
}
}
}
}
if (!detectsPlayer)
{
num192 += 800;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 500f; //600
}
else
{
num191 = Main.player[npc.target].Center.X - 500f; //600
}
}
}
if (detectsPlayer)
{
num188 = 7.5f;
@@ -301,40 +277,6 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity *= num49;
}
}
if (!detectsPlayer)
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
+16 -74
View File
@@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.Abyss
{
npc.TargetClosest(true);
}
if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState)
{
if (!detectsPlayer)
{
@@ -111,7 +111,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
npc.velocity.Length();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!TailSpawned && npc.ai[0] == 0f)
@@ -240,44 +239,21 @@ namespace CalamityMod.NPCs.Abyss
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 600); //800
if (!detectsPlayer)
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 500f; //600
}
else
{
num191 = Main.player[npc.target].Center.X - 500f; //600
}
}
}
}
if (!detectsPlayer)
{
num192 += 800;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 400f) //500
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 500f; //600
}
else
{
num191 = Main.player[npc.target].Center.X - 500f; //600
}
}
}
if (detectsPlayer)
{
num188 = 10f;
@@ -304,40 +280,6 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity *= num49;
}
}
if (!detectsPlayer)
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
-17
View File
@@ -52,19 +52,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -92,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -52,19 +52,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -92,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
+3 -3
View File
@@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.noGravity = true;
npc.damage = 80;
npc.damage = 100;
npc.width = 50;
npc.height = 220;
npc.defense = 25;
npc.lifeMax = 400;
npc.lifeMax = 800;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
@@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.Abyss
if (npc.velocity.Y == 0f)
{
npc.velocity.X = npc.velocity.X * 0.98f;
if ((double)npc.velocity.X > -0.01 && (double)npc.velocity.X < 0.01)
if (npc.velocity.X > -0.01 && npc.velocity.X < 0.01)
{
npc.velocity.X = 0f;
}
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
+20 -73
View File
@@ -84,7 +84,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!TailSpawned && npc.ai[0] == 0f)
@@ -144,44 +143,26 @@ namespace CalamityMod.NPCs.Abyss
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 400); //800
if (!detectsPlayer)
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 300f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 400f;
}
else
{
num191 = Main.player[npc.target].Center.X - 400f;
}
}
}
}
if (!detectsPlayer)
{
num192 += 500;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 300f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 400f;
}
else
{
num191 = Main.player[npc.target].Center.X - 400f;
}
}
}
else
{
num188 *= 1.5f;
num189 *= 1.5f;
}
float num48 = num188 * 1.3f;
float num49 = num188 * 0.7f;
float num50 = npc.velocity.Length();
@@ -198,40 +179,6 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity *= num49;
}
}
if (!detectsPlayer)
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
-17
View File
@@ -53,19 +53,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -93,10 +80,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
+2 -2
View File
@@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.noGravity = true;
npc.damage = 20;
npc.damage = 40;
npc.width = 60;
npc.height = 26;
npc.defense = 25;
npc.lifeMax = 240;
npc.lifeMax = 480;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
+8 -5
View File
@@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Abyss
{
npc.noGravity = true;
npc.noTileCollide = true;
npc.damage = 80;
npc.damage = 100;
npc.width = 70;
npc.height = 162;
npc.defense = 10;
@@ -100,15 +100,18 @@ namespace CalamityMod.NPCs.Abyss
num1250 = (int)player.Center.X / 16;
num1251 = (int)player.Center.Y / 16;
int min = 9;
int max = 16;
int min = 6;
int max = 9;
if (Main.rand.NextBool(2))
num1250 += Main.rand.Next(min, max);
else
num1250 -= Main.rand.Next(min, max);
num1251 += Main.rand.Next(min, max);
min = 11;
max = 26;
num1251 += Main.rand.Next(min, max);
if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, player.position, player.width, player.height) &&
Main.tile[num1250, num1251].liquid > 204)
@@ -149,7 +152,7 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha -= 5;
if (npc.alpha <= 0)
{
npc.damage = Main.expertMode ? 160 : 80;
npc.damage = Main.expertMode ? 200 : 100;
npc.chaseable = true;
npc.dontTakeDamage = false;
npc.alpha = 0;
+2 -2
View File
@@ -23,11 +23,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.noGravity = true;
npc.damage = 45;
npc.damage = 55;
npc.width = 136;
npc.height = 40;
npc.defense = 8;
npc.lifeMax = 180;
npc.lifeMax = 360;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
+4 -21
View File
@@ -15,11 +15,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.damage = 20; //70
npc.damage = 30; //70
npc.width = 16; //28
npc.height = 16; //28
npc.defense = 20;
npc.lifeMax = 2000;
npc.lifeMax = 4000;
npc.aiStyle = -1; //new
aiType = -1; //new
npc.knockBackResist = 0f;
@@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
/*if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}*/
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
@@ -124,14 +107,14 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity = Vector2.Zero;
npc.position.X = npc.position.X + num191;
npc.position.Y = npc.position.Y + num192;
/*if (num191 < 0f)
if (num191 < 0f)
{
npc.spriteDirection = -1;
}
else if (num191 > 0f)
{
npc.spriteDirection = 1;
}*/
}
}
}
+57 -86
View File
@@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,7 +14,8 @@ namespace CalamityMod.NPCs.Abyss
{
public class OarfishHead : ModNPC
{
public const int minLength = 40;
public bool detectsPlayer = false;
public const int minLength = 40;
public const int maxLength = 41;
public float speed = 3f; //10
public float turnSpeed = 0.05f; //0.15
@@ -26,11 +28,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.damage = 30;
npc.width = 59; //36
npc.height = 38; //20
npc.damage = 60;
npc.width = 59;
npc.height = 38;
npc.defense = 10;
npc.lifeMax = 2000;
npc.lifeMax = 4000;
npc.aiStyle = -1;
aiType = -1;
for (int k = 0; k < npc.buffImmune.Length; k++)
@@ -49,9 +51,27 @@ namespace CalamityMod.NPCs.Abyss
bannerItem = ModContent.ItemType<OarfishBanner>();
}
public override void AI()
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(detectsPlayer);
writer.Write(npc.chaseable);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
detectsPlayer = reader.ReadBoolean();
npc.chaseable = reader.ReadBoolean();
}
public override void AI()
{
if (npc.ai[3] > 0f)
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f) ||
npc.justHit)
{
detectsPlayer = true;
}
npc.chaseable = detectsPlayer;
if (npc.ai[3] > 0f)
{
npc.realLife = (int)npc.ai[3];
}
@@ -86,14 +106,14 @@ namespace CalamityMod.NPCs.Abyss
TailSpawned = true;
}
}
/*if (npc.velocity.X < 0f)
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}*/
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
@@ -112,47 +132,26 @@ namespace CalamityMod.NPCs.Abyss
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
if (!detectsPlayer)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 200); //800
//if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
// (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f))
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
num192 += 300;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
else
{
num188 *= 1.5f;
num189 *= 1.5f;
}
float num48 = num188 * 1.3f;
float num49 = num188 * 0.7f;
float num50 = npc.velocity.Length();
@@ -169,43 +168,6 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity *= num49;
}
}
//if ((Main.player[npc.target].Center - npc.Center).Length() > ((Main.player[npc.target].GetCalamityPlayer().anechoicPlating ||
// Main.player[npc.target].GetCalamityPlayer().anechoicCoating) ? 150f : 250f) *
// (Main.player[npc.target].GetCalamityPlayer().fishAlert ? 3f : 1f))
if ((Main.player[npc.target].Center - npc.Center).Length() < Main.player[npc.target].Calamity().GetAbyssAggro(250f, 150f))
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
@@ -315,7 +277,16 @@ namespace CalamityMod.NPCs.Abyss
npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
public override bool? CanBeHitByProjectile(Projectile projectile)
{
if (projectile.minion && !projectile.Calamity().overridesMinionDamagePrevention)
{
return detectsPlayer;
}
return null;
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (spawnInfo.player.Calamity().ZoneAbyssLayer2 && spawnInfo.water && !NPC.AnyNPCs(ModContent.NPCType<OarfishHead>()))
{
+4 -20
View File
@@ -15,11 +15,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.damage = 10; //70
npc.damage = 15; //70
npc.width = 14; //28
npc.height = 16; //28
npc.defense = 30;
npc.lifeMax = 2000;
npc.lifeMax = 4000;
npc.aiStyle = -1; //new
aiType = -1; //new
npc.knockBackResist = 0f;
@@ -51,19 +51,7 @@ namespace CalamityMod.NPCs.Abyss
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
/*if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}*/
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -91,10 +79,6 @@ namespace CalamityMod.NPCs.Abyss
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
@@ -124,14 +108,14 @@ namespace CalamityMod.NPCs.Abyss
npc.velocity = Vector2.Zero;
npc.position.X = npc.position.X + num191;
npc.position.Y = npc.position.Y + num192;
/*if (num191 < 0f)
if (num191 < 0f)
{
npc.spriteDirection = -1;
}
else if (num191 > 0f)
{
npc.spriteDirection = 1;
}*/
}
}
}
+2 -2
View File
@@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.Abyss
public override void SetDefaults()
{
npc.noGravity = true;
npc.damage = 60;
npc.damage = 75;
npc.width = 72;
npc.height = 30;
npc.defense = 15;
npc.lifeMax = 160;
npc.lifeMax = 320;
npc.aiStyle = -1;
aiType = -1;
npc.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
+1 -1
View File
@@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void AI()
{
if (npc.justHit || (double)npc.life <= (double)npc.lifeMax * 0.99 || CalamityWorld.bossRushActive)
if (npc.justHit || npc.life <= npc.lifeMax * 0.99 || CalamityWorld.bossRushActive)
{
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
if (calamityModMusic != null)
+15 -72
View File
@@ -114,44 +114,21 @@ namespace CalamityMod.NPCs.AquaticScourge
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 200); //800
if ((Main.player[npc.target].Center - npc.Center).Length() > 200f)
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
}
if ((Main.player[npc.target].Center - npc.Center).Length() > 200f)
{
num192 -= 160;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
float num48 = num188 * 1.3f;
float num49 = num188 * 0.7f;
float num50 = npc.velocity.Length();
@@ -168,40 +145,6 @@ namespace CalamityMod.NPCs.AquaticScourge
npc.velocity *= num49;
}
}
if ((Main.player[npc.target].Center - npc.Center).Length() > 200f)
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
+14 -36
View File
@@ -359,40 +359,18 @@ namespace CalamityMod.NPCs
Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
float num191 = player.position.X + (player.width / 2);
float num192 = player.position.Y + (player.height / 2);
int num42 = -1;
int num43 = (int)(player.Center.X / 16f);
int num44 = (int)(player.Center.Y / 16f);
if (head && !doSpiral)
{
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
if (calamityGlobalNPC.newAI[0] != 1f)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
num192 += 400;
if (Math.Abs(npc.Center.X - player.Center.X) < 500f)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
break;
}
if (num42 > 0)
{
num42 *= 16;
float num47 = num42 + (notOcean ? 800 : 400); //800
if (calamityGlobalNPC.newAI[0] != 1f)
{
num192 = num47;
if (Math.Abs(npc.Center.X - player.Center.X) < (notOcean ? 500f : 400f)) //500
{
if (npc.velocity.X > 0f)
num191 = player.Center.X + (notOcean ? 600f : 480f); //600
else
num191 = player.Center.X - (notOcean ? 600f : 480f); //600
}
if (npc.velocity.X > 0f)
num191 = player.Center.X + 600f;
else
num191 = player.Center.X - 600f;
}
}
@@ -5173,7 +5151,7 @@ namespace CalamityMod.NPCs
Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Projectile.NewProjectile(vortexSpawn.X, vortexSpawn.Y, 0f, 0f, ModContent.ProjectileType<OldDukeVortex>(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y);
Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType<OldDukeVortex>(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y);
}
}
@@ -5580,7 +5558,7 @@ namespace CalamityMod.NPCs
Vector2 vortexSpawn = vector + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi;
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Projectile.NewProjectile(vortexSpawn.X, vortexSpawn.Y, 0f, 0f, ModContent.ProjectileType<OldDukeVortex>(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y);
Projectile.NewProjectile(vortexSpawn, Vector2.Zero, ModContent.ProjectileType<OldDukeVortex>(), damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y);
}
}
@@ -6714,7 +6692,7 @@ namespace CalamityMod.NPCs
}
}
}
if (Main.player[npc.target].dead && flag14)
if ((Main.player[npc.target].dead || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) && flag14)
{
flag14 = false;
}
@@ -6778,10 +6756,10 @@ namespace CalamityMod.NPCs
num8 = speed / num8;
num6 *= num8;
num7 *= num8;
int damage = 40;
int damage = 50;
if (Main.expertMode)
{
damage = 30;
damage = 40;
}
int beam = Projectile.NewProjectile(npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (Main.player[npc.target].position.Y > npc.Center.Y ? 5f : -5f), num6, num7, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer, 0f, 0f);
Main.projectile[beam].tileCollide = true;
@@ -6806,10 +6784,10 @@ namespace CalamityMod.NPCs
num8 = speed / num8;
num6 *= num8;
num7 *= num8;
int damage = 25;
int damage = 35;
if (Main.expertMode)
{
damage = 19;
damage = 25;
}
int beam = Projectile.NewProjectile(npc.Center.X + (npc.spriteDirection == 1 ? 10f : -10f), npc.Center.Y, num6, num7, ModContent.ProjectileType<SulphuricAcidMist>(), damage, 0f, Main.myPlayer, 0f, 0f);
}
+3 -3
View File
@@ -8135,7 +8135,7 @@ namespace CalamityMod.NPCs
{
velocity = 10f;
acceleration = 0.1f;
if (tentaclesDead)
if (tentaclesDead || spawnMoreTentacles)
{
velocity = 12f;
acceleration = 0.12f;
@@ -8425,7 +8425,7 @@ namespace CalamityMod.NPCs
// If tentacles are alive, gain high defense
if (!tentaclesDead)
npc.defense = 9999;
npc.defense = spawnMoreTentacles ? 99 : 9999;
npc.chaseable = tentaclesDead;
// Spawn gore
@@ -8516,7 +8516,7 @@ namespace CalamityMod.NPCs
}
// Fire spread of spore clouds
if (tentaclesDead)
if (tentaclesDead || spawnMoreTentacles)
{
float shootBoost = death ? 1f : 2f * (0.5f - lifeRatio);
calamityGlobalNPC.newAI[0] += 1f + shootBoost;
+17 -21
View File
@@ -1,10 +1,7 @@
using CalamityMod;
using CalamityMod.Buffs;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Potions;
using CalamityMod.CalPlayer;
using CalamityMod.Dusts;
using CalamityMod.Events;
@@ -39,7 +36,6 @@ using CalamityMod.NPCs.DevourerofGods;
using CalamityMod.NPCs.HiveMind;
using CalamityMod.NPCs.Leviathan;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.Perforator;
using CalamityMod.NPCs.PlaguebringerGoliath;
using CalamityMod.NPCs.Polterghast;
@@ -65,13 +61,11 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.NPCs
@@ -99,6 +93,9 @@ namespace CalamityMod.NPCs
// Iron Heart (currently unimplemented)
// private int ironHeartDamage = 0;
// Max velocity used in contact damage scaling
public float maxVelocity = 0f;
// Town NPC shop alert animation variables
private int shopAlertAnimTimer = 0;
private int shopAlertAnimFrame = 0;
@@ -1041,19 +1038,6 @@ namespace CalamityMod.NPCs
npc.width = npc.height = 36;
}
//Reduce damage in Death Mode by the Beach
if (CalamityWorld.death && !CalamityPlayer.areThereAnyDamnBosses)
{
if (npc.type == NPCID.Sharkron)
{
npc.damage = 25;
}
if (npc.type == NPCID.Sharkron2)
{
npc.damage = 50;
}
}
if (npc.type == NPCID.CultistBoss)
{
npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.revenge ? 2 : 1.2));
@@ -1532,8 +1516,14 @@ namespace CalamityMod.NPCs
// Calculate extra DR based on kill time, similar to the Hush boss from The Binding of Isaac
if (KillTime > 0 && AITimer < KillTime && !CalamityWorld.bossRushActive)
{
float DRScalar = !GetDownedBossVariable(npc.type) || CalamityMod.CalamityConfig.ExtraBossDR ? 1.5f : 1f;
// Boost Providence timed DR during the night
if (npc.type == NPCType<Providence.Providence>() && !Main.dayTime)
DRScalar = 10f;
// The limit for how much extra DR the boss can have
float extraDRLimit = (1f - DR) * (!GetDownedBossVariable(npc.type) || CalamityMod.CalamityConfig.ExtraBossDR ? 1.5f : 1f);
float extraDRLimit = (1f - DR) * DRScalar;
// Ranges from 1 to 0
float currentHPRatio = npc.life / (float)npc.lifeMax;
@@ -1662,6 +1652,12 @@ namespace CalamityMod.NPCs
{
SetPatreonTownNPCName(npc);
if (CalamityPlayer.areThereAnyDamnBosses)
{
if (npc.velocity.Length() > maxVelocity)
maxVelocity = npc.velocity.Length();
}
if (KillTime > 0 && AITimer < KillTime)
AITimer++;
@@ -3592,7 +3588,7 @@ namespace CalamityMod.NPCs
}
else if (DestroyerIDs.Contains(npc.type))
{
if (((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion))
if ((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)
{
damage = (int)(damage * 0.5);
}
@@ -24,8 +24,6 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using CalamityMod;
namespace CalamityMod.NPCs.DevourerofGods
{
+6 -6
View File
@@ -27,12 +27,12 @@ namespace CalamityMod.NPCs.DevourerofGods
private float GetIntensity()
{
if (this.UpdateDoGIndex())
if (UpdateDoGIndex())
{
float x = 0f;
if (this.DoGIndex != -1)
if (DoGIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.DoGIndex].Center);
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[DoGIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * 0.5f;
}
@@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.DevourerofGods
public override Color OnTileColor(Color inColor)
{
float intensity = this.GetIntensity();
float intensity = GetIntensity();
return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
}
@@ -70,8 +70,8 @@ namespace CalamityMod.NPCs.DevourerofGods
{
if (Main.npc[CalamityGlobalNPC.DoGHead].active)
{
float intensity = this.GetIntensity();
if ((double)Main.npc[CalamityGlobalNPC.DoGHead].life < (double)Main.npc[CalamityGlobalNPC.DoGHead].lifeMax * 0.15 || CalamityWorld.death)
float intensity = GetIntensity();
if (Main.npc[CalamityGlobalNPC.DoGHead].life < Main.npc[CalamityGlobalNPC.DoGHead].lifeMax * 0.15 || CalamityWorld.death)
{
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight),
Color.Black * (intensity + 0.5f));
+7 -7
View File
@@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.Polterghast
}
// Percent life remaining, Polter
float lifeRatio = (float)Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax;
float lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].life / Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax;
npc.TargetClosest(true);
@@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Polterghast
}
Player player = Main.player[npc.target];
double deg = (double)npc.ai[1];
double deg = npc.ai[1];
double rad = deg * (Math.PI / 180);
double dist = 500;
npc.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2;
@@ -125,7 +125,7 @@ namespace CalamityMod.NPCs.Polterghast
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture2D15 = Main.npcTexture[npc.type];
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / 2));
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
@@ -137,16 +137,16 @@ namespace CalamityMod.NPCs.Polterghast
Color color38 = lightColor;
color38 = Color.Lerp(color38, color36, amount9);
color38 = npc.GetAlpha(color38);
color38 *= (float)(num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
color38 *= (num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
}
}
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height)) * npc.scale / 2f;
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height) * npc.scale / 2f;
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
File renamed without changes.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

+14 -7
View File
@@ -26,21 +26,27 @@ namespace CalamityMod.NPCs.Providence
private float GetIntensity()
{
if (this.UpdatePIndex())
if (UpdatePIndex())
{
float x = 0f;
if (this.ProvIndex != -1)
if (ProvIndex != -1)
{
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.ProvIndex].Center);
x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[ProvIndex].Center);
}
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * 0.25f;
float spawnAnimationTimer = 180f;
float intensityScalar = Main.dayTime ? 0.25f : 0.2f;
if (Main.npc[CalamityGlobalNPC.holyBoss].Calamity().newAI[3] < spawnAnimationTimer)
intensityScalar = MathHelper.Lerp(0f, intensityScalar, Main.npc[CalamityGlobalNPC.holyBoss].Calamity().newAI[3] / spawnAnimationTimer);
return (1f - Utils.SmoothStep(3000f, 6000f, x)) * intensityScalar;
}
return 0f; //0.5
}
public override Color OnTileColor(Color inColor)
{
float intensity = this.GetIntensity();
float intensity = GetIntensity();
return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity));
}
@@ -67,8 +73,9 @@ namespace CalamityMod.NPCs.Providence
{
if (maxDepth >= 0 && minDepth < 0)
{
float intensity = this.GetIntensity();
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(255, 200, 100) * intensity);
float intensity = GetIntensity();
Color color = Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255);
spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity);
}
}
+282 -150
View File
@@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.Providence
[AutoloadBossHead]
public class Providence : ModNPC
{
private bool hasTakenDaytimeDamage = false;
private bool text = false;
private bool useDefenseFrames = false;
private float bossLife;
@@ -76,6 +77,7 @@ namespace CalamityMod.NPCs.Providence
aiType = -1;
npc.value = Item.buyPrice(0, 50, 0, 0);
npc.boss = true;
npc.Opacity = 0f;
for (int k = 0; k < npc.buffImmune.Length; k++)
{
npc.buffImmune[k] = true;
@@ -155,11 +157,6 @@ namespace CalamityMod.NPCs.Providence
Player player = Main.player[npc.target];
Vector2 vector = npc.Center;
// Difficulty bools
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive;
// Target's current biome
bool isHoly = player.ZoneHoly;
bool isHell = player.ZoneUnderworldHeight;
@@ -167,12 +164,60 @@ namespace CalamityMod.NPCs.Providence
// Fire projectiles at normal rate or not
bool normalAttackRate = true;
// Percent life remaining
float lifeRatio = npc.life / (float)npc.lifeMax;
// Is in spawning animation
float spawnAnimationTime = 180f;
bool spawnAnimation = calamityGlobalNPC.newAI[3] < spawnAnimationTime;
// Phases
bool ignoreGuardianAmt = lifeRatio < (death ? 0.2f : 0.15f);
bool phase2 = lifeRatio < 0.75f || death;
// Percent life remaining
float lifeRatio = npc.life / (float)npc.lifeMax;
// Night bool
bool nightTime = !Main.dayTime;
// Play enrage animation if night starts
if (nightTime && calamityGlobalNPC.newAI[3] == spawnAnimationTime)
{
npc.ai[0] = 0f;
npc.ai[1] = 0f;
npc.ai[2] = 0f;
npc.ai[3] = 0f;
calamityGlobalNPC.newAI[1] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
calamityGlobalNPC.newAI[3] = 0f;
}
// Difficulty bools
bool death = CalamityWorld.death || CalamityWorld.bossRushActive || nightTime;
bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive || nightTime;
bool expertMode = Main.expertMode || CalamityWorld.bossRushActive || nightTime;
// Projectile damage values
bool scaleExpertProjectileDamage = Main.expertMode && !nightTime;
int holyLaserDamage = 100;
int crystalDamage = scaleExpertProjectileDamage ? 57 : 70;
int holySpearDamage = scaleExpertProjectileDamage ? 52 : 65;
int holyBombDamage = scaleExpertProjectileDamage ? 48 : 60;
int moltenBlastDamage = scaleExpertProjectileDamage ? 42 : 55;
int holyFireDamage = scaleExpertProjectileDamage ? 48 : 60;
int holyBlastDamage = scaleExpertProjectileDamage ? 52 : 65;
// Increase all projectile damage at night
int projectileDamageNight = 100;
if (nightTime)
{
holyLaserDamage = crystalDamage = holySpearDamage = holyBombDamage = moltenBlastDamage = holyFireDamage = holyBlastDamage = projectileDamageNight;
}
// Change dust type at night
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
// Phase times
float phaseTime = nightTime ? 240f : 300f;
float crystalPhaseTime = nightTime ? 60f : 120f;
// Phases
bool ignoreGuardianAmt = lifeRatio < (death ? 0.2f : 0.15f);
bool phase2 = (lifeRatio < 0.75f || death) && !nightTime;
// Projectile fire rate multiplier
double attackRateMult = 1D;
@@ -300,14 +345,14 @@ namespace CalamityMod.NPCs.Providence
// Despawn
bool targetDead = false;
if ((!Main.dayTime && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f) || !player.active || player.dead)
if (!player.active || player.dead)
{
if (!player.active || player.dead)
{
npc.TargetClosest(false);
player = Main.player[npc.target];
}
if ((!Main.dayTime && npc.ai[0] != 2f && npc.ai[0] != 5f && npc.ai[0] != 7f) || !player.active || player.dead)
if (!player.active || player.dead)
{
targetDead = true;
@@ -325,28 +370,31 @@ namespace CalamityMod.NPCs.Providence
else if (npc.timeLeft < 1800)
npc.timeLeft = 1800;
// Guardian spawn
if (bossLife == 0f && npc.life > 0)
bossLife = npc.lifeMax;
if (npc.life > 0)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num660 = (int)(npc.lifeMax * 0.66);
if ((npc.life + num660) < bossLife)
{
bossLife = npc.life;
int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32));
NPC.NewNPC(x - 100, y - 100, ModContent.NPCType<ProvSpawnDefense>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC(x + 100, y - 100, ModContent.NPCType<ProvSpawnHealer>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC(x, y + 100, ModContent.NPCType<ProvSpawnOffense>(), 0, 0f, 0f, 0f, 0f, 255);
}
}
}
// Guardian spawn
if (!nightTime)
{
if (bossLife == 0f && npc.life > 0)
bossLife = npc.lifeMax;
if (npc.life > 0)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int num660 = (int)(npc.lifeMax * 0.66);
if ((npc.life + num660) < bossLife)
{
bossLife = npc.life;
int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32));
int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32));
NPC.NewNPC(x - 100, y - 100, ModContent.NPCType<ProvSpawnDefense>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC(x + 100, y - 100, ModContent.NPCType<ProvSpawnHealer>(), 0, 0f, 0f, 0f, 0f, 255);
NPC.NewNPC(x, y + 100, ModContent.NPCType<ProvSpawnOffense>(), 0, 0f, 0f, 0f, 0f, 255);
}
}
}
}
// Set DR based on current attack phase
npc.Calamity().DR = (npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f) ? cocoonDR : normalDR;
npc.Calamity().DR = (npc.ai[0] == 2f || npc.ai[0] == 5f || npc.ai[0] == 7f || spawnAnimation) ? cocoonDR : normalDR;
// Movement
if (npc.ai[0] != 2f && npc.ai[0] != 5f)
@@ -398,7 +446,7 @@ namespace CalamityMod.NPCs.Providence
float velocityBoost = death ? 4f : 4f * (1f - lifeRatio);
float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost;
float velocity = (expertMode ? 16f : 15f) + velocityBoost;
if (CalamityWorld.bossRushActive)
if (CalamityWorld.bossRushActive || nightTime)
{
acceleration = 1.3f;
velocity = 20f;
@@ -435,7 +483,16 @@ namespace CalamityMod.NPCs.Providence
if (npc.velocity.Y < (firingLaser ? -speedVariance : -6f))
npc.velocity.Y = firingLaser ? -speedVariance : -6f;
}
}
// Slowly drift down when spawning
if (spawnAnimation)
{
float minSpawnVelocity = 0.4f;
float maxSpawnVelocity = 4f;
float velocityY = maxSpawnVelocity - MathHelper.Lerp(minSpawnVelocity, maxSpawnVelocity, calamityGlobalNPC.newAI[3] / spawnAnimationTime);
npc.velocity = new Vector2(0f, velocityY);
}
}
// Phase switch
if (npc.ai[0] == -1f)
@@ -476,7 +533,7 @@ namespace CalamityMod.NPCs.Providence
phase = 0;
break; // 2175 or 2100
case 3:
phase = useCrystal ? 6 : 3;
phase = (useCrystal || nightTime) ? 6 : 3;
break;
case 4:
phase = useCrystal ? 3 : 2;
@@ -485,8 +542,8 @@ namespace CalamityMod.NPCs.Providence
phase = useCrystal ? 2 : 1;
break; // 900
case 6:
phase = useLaser ? 7 : 4; // 1875 or 1800
if (useLaser)
phase = (useLaser || nightTime) ? 7 : 4; // 1875 or 1800
if (useLaser || nightTime)
{
npc.TargetClosest(false);
Vector2 v3 = player.Center - vector - new Vector2(0f, -22f);
@@ -503,23 +560,23 @@ namespace CalamityMod.NPCs.Providence
}
break; // 1200
case 7:
phase = useLaser ? 4 : 3;
phase = (useLaser || nightTime) ? 4 : 3;
break; // 1500
case 8:
phase = useLaser ? 3 : 5;
phase = (useLaser || nightTime) ? 3 : 5;
break;
case 9:
phase = 0;
break; // 2175 or 2100
case 10:
phase = useCrystal ? 6 : 2;
phase = (useCrystal || nightTime) ? 6 : 2;
break;
case 11:
phase = 3;
phase = nightTime ? 2 : 3;
break; // 300
case 12:
phase = useLaser ? 7 : 4; // 675 or 600
if (useLaser)
phase = (useLaser || nightTime) ? 7 : 4; // 675 or 600
if (useLaser || nightTime)
{
npc.TargetClosest(false);
Vector2 v3 = player.Center - vector - new Vector2(0f, -22f);
@@ -539,7 +596,7 @@ namespace CalamityMod.NPCs.Providence
phase = 5;
break; // 975 or 900
case 14:
phase = useLaser ? 4 : 0;
phase = (useLaser || nightTime) ? 4 : 0;
break; // 1275 or 1200
default:
break;
@@ -642,6 +699,7 @@ namespace CalamityMod.NPCs.Providence
npc.ai[2] = 0f;
npc.ai[3] = 0f;
calamityGlobalNPC.newAI[1] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
}
// Holy blasts
@@ -650,6 +708,65 @@ namespace CalamityMod.NPCs.Providence
npc.noGravity = true;
npc.noTileCollide = true;
if (spawnAnimation)
{
if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[3] == 0f)
Projectile.NewProjectile(vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType<HolyAura>(), 0, 0f, Main.myPlayer, biomeType, 0f);
if (calamityGlobalNPC.newAI[3] == 10f && nightTime)
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyRay"), (int)npc.position.X, (int)npc.position.Y);
if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < 150f)
{
int dustAmt = (int)MathHelper.Lerp(4f, 8f, calamityGlobalNPC.newAI[3] / spawnAnimationTime);
for (int m = 0; m < dustAmt; m++)
{
float fade = MathHelper.Lerp(1.3f, 0.7f, npc.Opacity) * CalamityUtils.GetLerpValue(0f, 120f, calamityGlobalNPC.newAI[3], clamped: true);
Color newColor = Main.hslToRgb(calamityGlobalNPC.newAI[3] / 180f, 1f, 0.5f);
if (!nightTime)
{
newColor.R = 255;
if (biomeType == 2)
newColor.B = 0;
}
else
{
newColor.B = 255;
if (biomeType == 2)
newColor.G = 0;
else
newColor.R = 0;
}
int dust = Dust.NewDust(npc.position, npc.width, npc.height, 267, 0f, 0f, 0, newColor);
Main.dust[dust].position = npc.Center + Main.rand.NextVector2Circular(npc.width * 2f, npc.height * 2f) + new Vector2(0f, -150f);
Main.dust[dust].velocity *= Main.rand.NextFloat() * 0.8f;
Main.dust[dust].noGravity = true;
Main.dust[dust].fadeIn = 0.6f + Main.rand.NextFloat() * 0.7f * fade;
Main.dust[dust].velocity += Vector2.UnitY * 3f;
Main.dust[dust].scale = 1.2f;
if (dust != 6000)
{
Dust dust2 = Dust.CloneDust(dust);
dust2.scale /= 2f;
dust2.fadeIn *= 0.85f;
dust2.color = new Color(255, 255, 0, 255);
}
}
}
npc.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f);
calamityGlobalNPC.newAI[3] += 1f;
if (nightTime && calamityGlobalNPC.newAI[3] >= spawnAnimationTime)
calamityGlobalNPC.newAI[3] += 1f;
return;
}
float num852 = Math.Abs(vector.X - player.Center.X);
if (num852 > distanceNeededToShoot && npc.position.Y < player.position.Y)
{
@@ -684,15 +801,14 @@ namespace CalamityMod.NPCs.Providence
num857 *= num859;
num858 *= num859;
int holyDamage = expertMode ? 52 : 65;
Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType<HolyBlast>(), holyDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector.X, vector.Y, num857, num858, ModContent.ProjectileType<HolyBlast>(), holyBlastDamage, 0f, Main.myPlayer, 0f, 0f);
}
}
else if (npc.ai[3] < 0f)
npc.ai[3] += 1f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 300f)
if (npc.ai[1] >= phaseTime)
npc.ai[0] = -1f;
}
@@ -725,13 +841,12 @@ namespace CalamityMod.NPCs.Providence
num865 += expertMode ? 4f : 3f;
int fireDamage = expertMode ? 48 : 60;
Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType<HolyFire>(), fireDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType<HolyFire>(), holyFireDamage, 0f, Main.myPlayer, 0f, 0f);
}
}
npc.ai[1] += 1f;
if (npc.ai[1] >= 300f)
if (npc.ai[1] >= phaseTime)
npc.ai[0] = -1f;
}
@@ -809,23 +924,11 @@ namespace CalamityMod.NPCs.Providence
}
if (npc.ai[3] == 0f)
{
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile projectile = Main.projectile[x];
if (projectile.active)
{
if (projectile.type == ModContent.ProjectileType<HolyFire2>() || projectile.type == ModContent.ProjectileType<HolyFlare>())
{
projectile.Kill();
}
}
}
}
DespawnSpecificProjectiles();
// Air is burning text
npc.ai[3] += 1f;
if (npc.ai[3] >= 450f && !text)
if (npc.ai[3] >= (phaseTime * 1.5f) && !text)
{
text = true;
string key = "Mods.CalamityMod.ProfanedBossText";
@@ -838,7 +941,7 @@ namespace CalamityMod.NPCs.Providence
}
// Inflict Icarus Folly
if (npc.ai[3] >= 600f)
if (npc.ai[3] >= (phaseTime * 2f))
{
if (Main.netMode != NetmodeID.Server)
{
@@ -853,7 +956,7 @@ namespace CalamityMod.NPCs.Providence
for (int num621 = 0; num621 < 40; num621++)
{
int num622 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y),
player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f);
player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -865,11 +968,11 @@ namespace CalamityMod.NPCs.Providence
for (int num623 = 0; num623 < 60; num623++)
{
int num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y),
player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f);
player2.width, player2.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(player2.position.X, player2.position.Y),
player2.width, player2.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f);
player2.width, player2.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
@@ -920,15 +1023,14 @@ namespace CalamityMod.NPCs.Providence
num857 *= num859;
num858 *= num859;
int holyDamage = expertMode ? 42 : 55;
Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType<MoltenBlast>(), holyDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector.X, vector.Y, num857 * 0.1f, num858, ModContent.ProjectileType<MoltenBlast>(), moltenBlastDamage, 0f, Main.myPlayer, 0f, 0f);
}
}
else if (npc.ai[3] < 0f)
npc.ai[3] += 1f;
npc.ai[1] += 1f;
if (npc.ai[1] >= 300f)
if (npc.ai[1] >= phaseTime)
npc.ai[0] = -1f;
}
@@ -961,13 +1063,12 @@ namespace CalamityMod.NPCs.Providence
num865 += expertMode ? 4f : 3f;
int fireDamage = expertMode ? 48 : 60;
Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType<HolyBomb>(), fireDamage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector113.X, vector113.Y, npc.velocity.X * 0.25f, num865, ModContent.ProjectileType<HolyBomb>(), holyBombDamage, 0f, Main.myPlayer, 0f, 0f);
}
}
npc.ai[1] += 1f;
if (npc.ai[1] >= 300f)
if (npc.ai[1] >= phaseTime)
npc.ai[0] = -1f;
}
@@ -991,19 +1092,7 @@ namespace CalamityMod.NPCs.Providence
}
if (npc.ai[1] == 0f)
{
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile projectile = Main.projectile[x];
if (projectile.active)
{
if (projectile.type == ModContent.ProjectileType<HolyFire2>() || projectile.type == ModContent.ProjectileType<HolyFlare>())
{
projectile.Kill();
}
}
}
}
DespawnSpecificProjectiles();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
@@ -1019,7 +1108,6 @@ namespace CalamityMod.NPCs.Providence
npc.ai[2] = 0f;
float velocity = 3f;
int damage = expertMode ? 52 : 65;
int projectileType = ModContent.ProjectileType<HolySpear>();
if (calamityGlobalNPC.newAI[2] % 2f == 0f)
@@ -1031,7 +1119,7 @@ namespace CalamityMod.NPCs.Providence
for (int i = 0; i < totalProjectiles; i++)
{
Vector2 vector2 = spinningPoint.RotatedBy(radians * i);
Projectile.NewProjectile(vector, vector2, projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(vector, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer, 0f, 0f);
}
calamityGlobalNPC.newAI[1] += 0.2f;
@@ -1041,12 +1129,12 @@ namespace CalamityMod.NPCs.Providence
velocity = expertMode ? 12f : 10f;
Vector2 velocity2 = Vector2.Normalize(player.Center - vector) * velocity;
Projectile.NewProjectile(vector, velocity2, projectileType, damage, 0f, Main.myPlayer, 1f, 0f);
Projectile.NewProjectile(vector, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f);
}
}
npc.ai[1] += 1f;
if (npc.ai[1] >= 300f)
if (npc.ai[1] >= phaseTime)
npc.ai[0] = -1f;
}
@@ -1064,11 +1152,13 @@ namespace CalamityMod.NPCs.Providence
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.ai[1] += 1f;
if (npc.ai[1] >= 120f)
if (npc.ai[1] >= crystalPhaseTime)
{
int damage = expertMode ? 57 : 70;
Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType<ProvidenceCrystal>(), damage, 0f, player.whoAmI, 0f, 0f);
npc.ai[0] = -1f;
if (npc.ai[1] == crystalPhaseTime)
Projectile.NewProjectile(player.Center.X, player.Center.Y - 360f, 0f, 0f, ModContent.ProjectileType<ProvidenceCrystal>(), crystalDamage, 0f, player.whoAmI, 0f, 0f);
if (npc.ai[1] >= crystalPhaseTime + 210f || !nightTime)
npc.ai[0] = -1f;
}
}
}
@@ -1098,13 +1188,12 @@ namespace CalamityMod.NPCs.Providence
for (int num1221 = 0; num1221 < 1 + num1220; num1221++)
{
int num1222 = (int)CalamityDusts.ProfanedFire;
float num1223 = 1.2f;
if (num1221 % 2 == 1)
num1223 = 2.8f;
Vector2 vector199 = vector + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f;
int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, num1222, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f);
Vector2 vector199 = new Vector2(vector.X, vector.Y + 32f) + ((float)Main.rand.NextDouble() * MathHelper.TwoPi).ToRotationVector2() * value19 / 2f;
int num1224 = Dust.NewDust(vector199 - Vector2.One * 8f, 16, 16, dustType, npc.velocity.X / 2f, npc.velocity.Y / 2f, 0, default, 1f);
Main.dust[num1224].velocity = Vector2.Normalize(vector - vector199) * 3.5f * (10f - num1220 * 2f) / 10f;
Main.dust[num1224].noGravity = true;
Main.dust[num1224].scale = num1223;
@@ -1133,10 +1222,10 @@ namespace CalamityMod.NPCs.Providence
num1225 = 1f;
vector200 = vector200.RotatedBy(-(double)num1225 * MathHelper.TwoPi / 6f, default);
Projectile.NewProjectile(vector.X, vector.Y - 32f, vector200.X, vector200.Y, ModContent.ProjectileType<ProvidenceHolyRay>(), 100, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI);
Projectile.NewProjectile(vector.X, vector.Y + 32f, vector200.X, vector200.Y, ModContent.ProjectileType<ProvidenceHolyRay>(), holyLaserDamage, 0f, Main.myPlayer, num1225 * MathHelper.TwoPi / rotation, npc.whoAmI);
if (revenge)
Projectile.NewProjectile(vector.X, vector.Y - 32f, -vector200.X, -vector200.Y, ModContent.ProjectileType<ProvidenceHolyRay>(), 100, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI);
Projectile.NewProjectile(vector.X, vector.Y + 32f, -vector200.X, -vector200.Y, ModContent.ProjectileType<ProvidenceHolyRay>(), holyLaserDamage, 0f, Main.myPlayer, -num1225 * MathHelper.TwoPi / rotation, npc.whoAmI);
npc.ai[3] = (vector200.ToRotation() + MathHelper.TwoPi + MathHelper.Pi) * num1225;
npc.netUpdate = true;
@@ -1169,6 +1258,23 @@ namespace CalamityMod.NPCs.Providence
}
}
private void DespawnSpecificProjectiles()
{
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile projectile = Main.projectile[x];
if (projectile.active)
{
if (projectile.type == ModContent.ProjectileType<HolyFire2>() || projectile.type == ModContent.ProjectileType<HolyFlare>())
{
projectile.Kill();
}
else if (projectile.type == ModContent.ProjectileType<MoltenBlast>())
projectile.active = false;
}
}
}
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
{
return false;
@@ -1185,12 +1291,17 @@ namespace CalamityMod.NPCs.Providence
npc.Calamity().SetNewShopVariable(new int[] { ModContent.NPCType<THIEF>() }, CalamityWorld.downedProvidence);
//Accessories clientside only in Expert
// Accessories clientside only in Expert
DropHelper.DropItemCondition(npc, ModContent.ItemType<ElysianWings>(), true, biomeType != 2 && Main.expertMode);
DropHelper.DropItemCondition(npc, ModContent.ItemType<ElysianAegis>(), true, biomeType == 2 && Main.expertMode);
//drops pre-scal, cannot be sold, does nothing aka purely vanity. Requires at least expert for consistency with other post scal dev items.
// Drops pre-scal, cannot be sold, does nothing aka purely vanity. Requires at least expert for consistency with other post scal dev items.
bool shouldDrop = challenge || (Main.expertMode && Main.rand.NextBool(CalamityWorld.downedSCal ? 10 : 200));
DropHelper.DropItemCondition(npc, ModContent.ItemType<ProfanedSoulCrystal>(), true, shouldDrop);
// Special drop for defeating her at night
//DropHelper.DropItemCondition(npc, ModContent.ItemType<SpecialItem>(), true, !hasTakenDaytimeDamage);
// All other drops are contained in the bag, so they only drop directly on Normal
if (!Main.expertMode)
{
@@ -1258,8 +1369,8 @@ namespace CalamityMod.NPCs.Providence
private void SpawnLootBox()
{
int tileCenterX = (int)(npc.position.X + (float)(npc.width / 2)) / 16;
int tileCenterY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16;
int tileCenterX = (int)(npc.position.X + (npc.width / 2)) / 16;
int tileCenterY = (int)(npc.position.Y + (npc.height / 2)) / 16;
int halfBox = npc.width / 2 / 16 + 1;
for (int x = tileCenterX - halfBox; x <= tileCenterX + halfBox; x++)
{
@@ -1289,58 +1400,73 @@ namespace CalamityMod.NPCs.Providence
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = Main.npcTexture[npc.type];
Texture2D textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow");
Texture2D textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2");
bool nightTime = !Main.dayTime;
string baseTextureString = "CalamityMod/NPCs/Providence/";
string baseGlowTextureString = baseTextureString + "Glowmasks/";
string getTextureString = baseTextureString + "Providence";
string getTextureGlowString = baseGlowTextureString + "ProvidenceGlow";
string getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2";
if (npc.ai[0] == 2f || npc.ai[0] == 5f)
{
if (!useDefenseFrames)
{
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefense");
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseGlow2");
getTextureString = baseTextureString + "ProvidenceDefense";
getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseGlow2";
}
else
{
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAlt");
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceDefenseAltGlow2");
getTextureString = baseTextureString + "ProvidenceDefenseAlt";
getTextureGlowString = baseGlowTextureString + "ProvidenceDefenseAltGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceDefenseAltGlow2";
}
}
else
{
if (frameUsed == 0)
{
texture = Main.npcTexture[npc.type];
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceGlow2");
getTextureGlowString = baseGlowTextureString + "ProvidenceGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceGlow2";
}
else if (frameUsed == 1)
{
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAlt");
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAltGlow2");
getTextureString = baseTextureString + "ProvidenceAlt";
getTextureGlowString = baseGlowTextureString + "ProvidenceAltGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceAltGlow2";
}
else if (frameUsed == 2)
{
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttack");
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackGlow2");
getTextureString = baseTextureString + "ProvidenceAttack";
getTextureGlowString = baseGlowTextureString + "ProvidenceAttackGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackGlow2";
}
else
{
texture = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAlt");
textureGlow = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow");
textureGlow2 = ModContent.GetTexture("CalamityMod/NPCs/Providence/ProvidenceAttackAltGlow2");
getTextureString = baseTextureString + "ProvidenceAttackAlt";
getTextureGlowString = baseGlowTextureString + "ProvidenceAttackAltGlow";
getTextureGlow2String = baseGlowTextureString + "ProvidenceAttackAltGlow2";
}
}
if (nightTime)
{
getTextureString += "Night";
getTextureGlowString += "Night";
getTextureGlow2String += "Night";
}
Texture2D texture = ModContent.GetTexture(getTextureString);
Texture2D textureGlow = ModContent.GetTexture(getTextureGlowString);
Texture2D textureGlow2 = ModContent.GetTexture(getTextureGlow2String);
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2));
Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2);
Color color36 = Color.White;
float amount9 = 0.5f;
int num153 = 5;
@@ -1352,21 +1478,21 @@ namespace CalamityMod.NPCs.Providence
Color color38 = lightColor;
color38 = Color.Lerp(color38, color36, amount9);
color38 = npc.GetAlpha(color38);
color38 *= (float)(num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
color38 *= (num153 - num155) / 15f;
Vector2 vector41 = npc.oldPos[num155] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
vector41 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
vector41 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture, vector41, npc.frame, color38, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
}
}
Vector2 vector43 = npc.Center - Main.screenPosition;
vector43 -= new Vector2((float)texture.Width, (float)(texture.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
vector43 -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(texture, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Color color37 = Color.Lerp(Color.White, Color.Yellow, 0.5f);
Color color42 = Color.Lerp(Color.White, Color.Violet, 0.5f);
Color color37 = Color.Lerp(Color.White, Main.dayTime ? Color.Yellow : Color.Cyan, 0.5f) * npc.Opacity;
Color color42 = Color.Lerp(Color.White, Main.dayTime ? Color.Violet : Color.BlueViolet, 0.5f) * npc.Opacity;
if (CalamityMod.CalamityConfig.Afterimages)
{
@@ -1375,16 +1501,16 @@ namespace CalamityMod.NPCs.Providence
Color color41 = color37;
color41 = Color.Lerp(color41, color36, amount9);
color41 = npc.GetAlpha(color41);
color41 *= (float)(num153 - num163) / 15f;
Vector2 vector44 = npc.oldPos[num163] + new Vector2((float)npc.width, (float)npc.height) / 2f - Main.screenPosition;
vector44 -= new Vector2((float)textureGlow.Width, (float)(textureGlow.Height / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
color41 *= (num153 - num163) / 15f;
Vector2 vector44 = npc.oldPos[num163] + new Vector2(npc.width, npc.height) / 2f - Main.screenPosition;
vector44 -= new Vector2(textureGlow.Width, textureGlow.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
spriteBatch.Draw(textureGlow, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
Color color43 = color42;
color43 = Color.Lerp(color43, color36, amount9);
color43 = npc.GetAlpha(color43);
color43 *= (float)(num153 - num163) / 15f;
color43 *= (num153 - num163) / 15f;
spriteBatch.Draw(textureGlow2, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
}
}
@@ -1403,7 +1529,7 @@ namespace CalamityMod.NPCs.Providence
if (!useDefenseFrames)
{
npc.frameCounter += 1.0;
if (npc.frameCounter > 5.0)
if (npc.frameCounter > 8.0)
{
npc.frame.Y = npc.frame.Y + frameHeight;
npc.frameCounter = 0.0;
@@ -1417,7 +1543,7 @@ namespace CalamityMod.NPCs.Providence
else
{
npc.frameCounter += 1.0;
if (npc.frameCounter > 5.0)
if (npc.frameCounter > 8.0)
{
npc.frame.Y = npc.frame.Y + frameHeight;
npc.frameCounter = 0.0;
@@ -1432,7 +1558,7 @@ namespace CalamityMod.NPCs.Providence
useDefenseFrames = false;
npc.frameCounter += 1.0;
if (npc.frameCounter > 5.0)
if (npc.frameCounter > (npc.Calamity().newAI[3] < 180f ? 8.0 : 5.0))
{
npc.frameCounter = 0.0;
npc.frame.Y = npc.frame.Y + frameHeight;
@@ -1461,6 +1587,8 @@ namespace CalamityMod.NPCs.Providence
public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit)
{
hasTakenDaytimeDamage = Main.dayTime;
if (challenge)
{
bool goldenGun = projectile.type == ModContent.ProjectileType<GoldenGunProj>();
@@ -1476,6 +1604,8 @@ namespace CalamityMod.NPCs.Providence
public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit)
{
hasTakenDaytimeDamage = Main.dayTime;
if (challenge)
challenge = false;
}
@@ -1487,38 +1617,40 @@ namespace CalamityMod.NPCs.Providence
npc.soundDelay = 8;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt"), npc.Center);
}
for (int k = 0; k < 15; k++)
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int k = 0; k < 15; k++)
Dust.NewDust(npc.position, npc.width, npc.height, dustType, hitDirection, -1f, 0, default, 1f);
if (npc.life <= 0)
{
float randomSpread = (float)(Main.rand.Next(-50, 50) / 100);
float randomSpread = Main.rand.Next(-50, 50) / 100;
Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence2"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence3"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/Providence4"), 1f);
npc.position.X = npc.position.X + (float)(npc.width / 2);
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
npc.position.X = npc.position.X + (npc.width / 2);
npc.position.Y = npc.position.Y + (npc.height / 2);
npc.width = 400;
npc.height = 350;
npc.position.X = npc.position.X - (float)(npc.width / 2);
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
npc.position.X = npc.position.X - (npc.width / 2);
npc.position.Y = npc.position.Y - (npc.height / 2);
for (int num621 = 0; num621 < 60; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 90; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

+20 -73
View File
@@ -55,7 +55,6 @@ namespace CalamityMod.NPCs.SunkenSea
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (Main.netMode != NetmodeID.MultiplayerClient)
{
if (!TailSpawned && npc.ai[0] == 0f)
@@ -116,44 +115,26 @@ namespace CalamityMod.NPCs.SunkenSea
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
int num42 = -1;
int num43 = (int)(Main.player[npc.target].Center.X / 16f);
int num44 = (int)(Main.player[npc.target].Center.Y / 16f);
for (int num45 = num43 - 2; num45 <= num43 + 2; num45++)
{
for (int num46 = num44; num46 <= num44 + 15; num46++)
{
if (WorldGen.SolidTile2(num45, num46))
{
num42 = num46;
break;
}
}
if (num42 > 0)
{
break;
}
}
if (num42 > 0)
{
num42 *= 16;
float num47 = (float)(num42 - 200); //800
if ((Main.player[npc.target].Center - npc.Center).Length() > 250f)
{
num192 = num47;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
}
if (npc.life > npc.lifeMax * 0.99)
{
num192 += 300;
if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 250f)
{
if (npc.velocity.X > 0f)
{
num191 = Main.player[npc.target].Center.X + 300f;
}
else
{
num191 = Main.player[npc.target].Center.X - 300f;
}
}
}
else
{
num188 *= 1.5f;
num189 *= 1.5f;
}
float num48 = num188 * 1.3f;
float num49 = num188 * 0.7f;
float num50 = npc.velocity.Length();
@@ -170,40 +151,6 @@ namespace CalamityMod.NPCs.SunkenSea
npc.velocity *= num49;
}
}
if ((Main.player[npc.target].Center - npc.Center).Length() > 250f)
{
for (int num51 = 0; num51 < 200; num51++)
{
if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI)
{
Vector2 vector3 = Main.npc[num51].Center - npc.Center;
if (vector3.Length() < 400f)
{
vector3.Normalize();
vector3 *= 1000f;
num191 -= vector3.X;
num192 -= vector3.Y;
}
}
}
}
else
{
for (int num52 = 0; num52 < 200; num52++)
{
if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI)
{
Vector2 vector4 = Main.npc[num52].Center - npc.Center;
if (vector4.Length() < 60f)
{
vector4.Normalize();
vector4 *= 200f;
num191 -= vector4.X;
num192 -= vector4.Y;
}
}
}
}
num191 = (float)((int)(num191 / 16f) * 16);
num192 = (float)((int)(num192 / 16f) * 16);
vector18.X = (float)((int)(vector18.X / 16f) * 16);
-17
View File
@@ -54,19 +54,6 @@ namespace CalamityMod.NPCs.SunkenSea
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -94,10 +81,6 @@ namespace CalamityMod.NPCs.SunkenSea
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
-17
View File
@@ -51,19 +51,6 @@ namespace CalamityMod.NPCs.SunkenSea
{
npc.realLife = (int)npc.ai[3];
}
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead)
{
npc.TargetClosest(true);
}
npc.velocity.Length();
if (npc.velocity.X < 0f)
{
npc.spriteDirection = -1;
}
else if (npc.velocity.X > 0f)
{
npc.spriteDirection = 1;
}
bool flag = false;
if (npc.ai[1] <= 0f)
{
@@ -91,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea
npc.alpha = 0;
}
}
if (Main.player[npc.target].dead)
{
npc.TargetClosest(false);
}
Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2);
float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2);
+790 -998
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Boss
}
// Fly away from other brimstone monsters
float velocity = 0.1f;
float velocity = 0.05f;
for (int i = 0; i < Main.maxProjectiles; i++)
{
if (Main.projectile[i].active)
+2
View File
@@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.alpha = 255;
projectile.penetrate = -1;
projectile.timeLeft = 600;
projectile.extraUpdates = 1;
}
public override void SendExtraAI(BinaryWriter writer)
@@ -59,6 +60,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.ai[0] += 1f;
num632 = (float)(Math.Cos((double)(num630 * projectile.ai[0])) - 0.5) * num631;
projectile.velocity.Y = projectile.velocity.Y + num632;
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > 10f)
{
+1 -1
View File
@@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Boss
}
Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f);
float num953 = revenge ? 110f : 100f; //100
float scaleFactor12 = revenge ? 27f : 25f; //5
float scaleFactor12 = revenge ? 35f : 30f; //5
float num954 = 40f;
if (projectile.timeLeft > 30 && projectile.alpha > 0)
{
+73 -8
View File
@@ -1,12 +1,19 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class FlareDust : ModProjectile
{
public override void SetStaticDefaults()
private bool start = true;
private Vector2 center = Vector2.Zero;
private Vector2 velocity = Vector2.Zero;
private double distance = 0D;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Flare Dust");
Main.projFrames[projectile.type] = 4;
@@ -21,11 +28,29 @@ namespace CalamityMod.Projectiles.Boss
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.timeLeft = 120;
projectile.timeLeft = 840;
cooldownSlot = 1;
}
public override void AI()
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(projectile.localAI[0]);
writer.Write(start);
writer.WriteVector2(center);
writer.Write(distance);
writer.WriteVector2(velocity);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
projectile.localAI[0] = reader.ReadSingle();
start = reader.ReadBoolean();
center = reader.ReadVector2();
distance = reader.ReadDouble();
velocity = reader.ReadVector2();
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 4)
@@ -37,9 +62,49 @@ namespace CalamityMod.Projectiles.Boss
{
projectile.frame = 0;
}
projectile.velocity *= 0.975f;
Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f);
}
if (projectile.ai[0] == 2f)
{
projectile.ai[1] += 0.05f;
projectile.velocity *= MathHelper.Lerp(0.95f, 1.05f, (float)Math.Abs(Math.Sin(projectile.ai[1])));
return;
}
if (start)
{
center = projectile.Center;
velocity = Vector2.Normalize(Main.player[Player.FindClosest(projectile.Center, 1, 1)].Center - projectile.Center) * 2f;
start = false;
}
center += velocity;
double rad = MathHelper.ToRadians(projectile.ai[1]);
float amount = 1f - projectile.localAI[0] / 180f;
if (amount < 0f)
amount = 0f;
distance += MathHelper.Lerp(1f, 3f, amount);
if (projectile.ai[0] == 0f)
{
projectile.position.X = center.X - (int)(Math.Sin(rad) * distance) - projectile.width / 2;
projectile.position.Y = center.Y - (int)(Math.Cos(rad) * distance) - projectile.height / 2;
}
else
{
projectile.position.X = center.X - (int)(Math.Cos(rad) * distance) - projectile.width / 2;
projectile.position.Y = center.Y - (int)(Math.Sin(rad) * distance) - projectile.height / 2;
}
projectile.ai[1] += (0.25f + amount) * 0.5f;
projectile.localAI[0] += 1f;
}
public override Color? GetAlpha(Color lightColor)
{
@@ -59,10 +124,10 @@ namespace CalamityMod.Projectiles.Boss
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position = projectile.Center;
projectile.width = projectile.height = 80;
projectile.width = projectile.height = 48;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
for (int num621 = 0; num621 < 2; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f);
Main.dust[num622].velocity *= 3f;
@@ -72,7 +137,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 8; num623++)
for (int num623 = 0; num623 < 4; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num624].noGravity = true;
+71 -15
View File
@@ -1,13 +1,17 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class FlareDust2 : ModProjectile
{
public override void SetStaticDefaults()
private bool start = true;
private Vector2 velocity = Vector2.Zero;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Flare Bomb");
Main.projFrames[projectile.type] = 4;
@@ -26,7 +30,19 @@ namespace CalamityMod.Projectiles.Boss
cooldownSlot = 1;
}
public override void AI()
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(start);
writer.WriteVector2(velocity);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
start = reader.ReadBoolean();
velocity = reader.ReadVector2();
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 4)
@@ -38,20 +54,60 @@ namespace CalamityMod.Projectiles.Boss
{
projectile.frame = 0;
}
if (projectile.ai[0] == 1f)
{
if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 8f && projectile.timeLeft < 630)
{
projectile.velocity *= 1.025f;
}
if (projectile.timeLeft < 630)
{
if (projectile.velocity.Length() < 6f)
{
projectile.velocity *= 1.025f;
}
else
{
if (start)
{
velocity = projectile.velocity;
start = false;
}
projectile.ai[1] += 0.1f;
float amplitude = velocity.Length();
float wavyVelocity = (float)Math.Cos(projectile.ai[1]);
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude;
}
}
}
else
{
if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 16f && projectile.timeLeft < 420)
{
projectile.velocity *= 1.05f;
}
if (projectile.timeLeft < 420)
{
if (projectile.velocity.Length() < 12f)
{
projectile.velocity *= 1.05f;
}
else
{
if (start)
{
velocity = projectile.velocity;
start = false;
}
projectile.ai[1] += 0.1f;
float amplitude = velocity.Length();
float wavyVelocity = (float)Math.Sin(projectile.ai[1]);
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude;
}
}
}
Lighting.AddLight(projectile.Center, 0.5f, 0.25f, 0f);
}
@@ -74,20 +130,20 @@ namespace CalamityMod.Projectiles.Boss
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position = projectile.Center;
projectile.width = projectile.height = 48;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
projectile.Damage();
for (int num621 = 0; num621 < 5; num621++)
for (int num621 = 0; num621 < 2; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 8; num623++)
for (int num623 = 0; num623 < 4; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num624].noGravity = true;
+110
View File
@@ -0,0 +1,110 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class HolyAura : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Holy Aura");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.hostile = true;
projectile.aiStyle = -1;
aiType = -1;
projectile.alpha = 255;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.timeLeft = 210;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D value = Main.projectileTexture[projectile.type];
Vector2 origin = value.Size() / 2f;
float num = Main.GlobalTime % 10f / 10f;
Vector2 value2 = projectile.Center - Main.screenPosition;
float[] array = new float[15];
float[] array2 = new float[15];
float[] array3 = new float[15];
float[] array4 = new float[15];
float num2 = 0.5f;
int num3 = 210;
num2 = CalamityUtils.GetLerpValue(0f, 60f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(num3, num3 - 60, projectile.timeLeft, clamped: true);
float amount = CalamityUtils.GetLerpValue(0f, 60f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(num3, 90f, projectile.timeLeft, clamped: true);
amount = CalamityUtils.GetLerpValue(0.2f, 0.5f, amount, clamped: true);
float num4 = 800f / value.Width;
float num5 = num4 * 0.8f;
float num6 = (num4 - num5) / 15f;
float num7 = 30f;
float num8 = 300f;
Vector2 value3 = new Vector2(6f, 6f);
for (int i = 0; i < 15; i++)
{
float num9 = (float)Math.Sin(num * ((float)Math.PI * 2f) + (float)Math.PI / 2f + i / 2f);
array[i] = num9 * (num8 - i * 3f);
array2[i] = (float)Math.Sin(num * ((float)Math.PI * 2f) * 2f + (float)Math.PI / 3f + i) * num7;
array2[i] -= i * 3f;
array3[i] = i / 15f * 2f + num;
array3[i] = (num9 * 0.5f + 0.5f) * 0.6f + num;
array4[i] = num5 + (i + 1) * num6;
array4[i] *= 0.3f;
Color color = Main.hslToRgb(array3[i] % 1f, 1f, 0.5f) * num2 * amount;
bool underworld = projectile.ai[0] == 2f;
if (Main.dayTime)
{
color.R = 255;
if (underworld)
color.B = 0;
}
else
{
color.B = 255;
if (underworld)
color.G = 0;
else
color.R = 0;
}
color.A /= 4;
int fadeTime = 30;
if (projectile.timeLeft < fadeTime)
{
float amount2 = projectile.timeLeft / (float)fadeTime;
if (color.R > 0)
color.R = (byte)MathHelper.Lerp(0, color.R, amount2);
if (color.G > 0)
color.G = (byte)MathHelper.Lerp(0, color.G, amount2);
if (color.B > 0)
color.B = (byte)MathHelper.Lerp(0, color.B, amount2);
color.A = (byte)MathHelper.Lerp(0, color.A, amount2);
}
float rotation = (float)Math.PI / 2f + num9 * ((float)Math.PI / 4f) * -0.3f + (float)Math.PI * i;
spriteBatch.Draw(value, value2 + new Vector2(array[i], array2[i]), null, color, rotation, origin, new Vector2(array4[i], array4[i]) * value3, SpriteEffects.None, 0);
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

+19 -15
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -42,44 +43,45 @@ namespace CalamityMod.Projectiles.Boss
}
if (projectile.ai[1] == 0f)
{
for (int num621 = 0; num621 < 10; num621++)
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
projectile.ai[1] = 1f;
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
}
if ((double)Math.Abs(projectile.velocity.X) > 0.2)
if (Math.Abs(projectile.velocity.X) > 0.2)
{
projectile.spriteDirection = -projectile.direction;
}
if (projectile.velocity.X < 0f)
{
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X);
}
else
{
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X);
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X);
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(0, 150, 250, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyBlastNight");
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int y6 = num214 * projectile.frame;
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
@@ -101,16 +103,17 @@ namespace CalamityMod.Projectiles.Boss
}
}
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
for (int num193 = 0; num193 < 6; num193++)
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num193 = 0; num193 < 6; num193++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f);
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
}
for (int num194 = 0; num194 < 60; num194++)
{
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f);
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
Main.dust[num195].noGravity = true;
Main.dust[num195].velocity *= 3f;
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f);
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
Main.dust[num195].velocity *= 2f;
Main.dust[num195].noGravity = true;
}
@@ -118,8 +121,9 @@ namespace CalamityMod.Projectiles.Boss
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 240);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 240);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+25 -22
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
@@ -44,12 +45,12 @@ namespace CalamityMod.Projectiles.Boss
if (flareShootTimer <= 0)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 50;
projectile.height = 50;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -2f, ModContent.ProjectileType<HolyFlare>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
@@ -74,39 +75,40 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override Color? GetAlpha(Color lightColor)
{
return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(0, 150, 250, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyBombNight");
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int y6 = num214 * projectile.frame;
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 150;
projectile.height = 150;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num193 = 0; num193 < 3; num193++)
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num193 = 0; num193 < 3; num193++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f);
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
}
for (int num194 = 0; num194 < 30; num194++)
{
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 0, default, 2.5f);
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
Main.dust[num195].noGravity = true;
Main.dust[num195].velocity *= 3f;
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 50, default, 1.5f);
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
Main.dust[num195].velocity *= 2f;
Main.dust[num195].noGravity = true;
}
@@ -114,8 +116,9 @@ namespace CalamityMod.Projectiles.Boss
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 180);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+74 -41
View File
@@ -1,6 +1,8 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.DataStructures;
@@ -12,48 +14,46 @@ namespace CalamityMod.Projectiles.Boss
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Holy Orb");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
{
projectile.width = 20;
projectile.height = 20;
projectile.scale = 1.5f;
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.alpha = 255;
projectile.penetrate = 1;
projectile.timeLeft = 240;
projectile.timeLeft = 200;
}
public override void AI()
{
bool expertMode = Main.expertMode;
projectile.frameCounter++;
if (projectile.frameCounter > 4)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
{
projectile.frame = 0;
}
projectile.velocity.X *= 1.01f;
projectile.velocity.Y *= 1.01f;
int num487 = (int)Player.FindClosest(projectile.position, projectile.width, projectile.height);
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
if (projectile.ai[0] < 80f)
{
projectile.ai[0] += 1f;
if (projectile.timeLeft < 160)
projectile.timeLeft = 160;
}
bool expertMode = Main.expertMode;
projectile.velocity *= 1.01f;
int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height);
Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float num489 = Main.player[num487].Center.X - vector36.X;
float num490 = Main.player[num487].Center.Y - vector36.Y;
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490);
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y)
{
int num492 = expertMode ? -150 : -100;
if (CalamityWorld.death || CalamityWorld.bossRushActive)
{
num492 = -200;
}
if (!Main.dayTime)
num492 = -300;
Main.player[num487].HealEffect(num492, false);
Main.player[num487].statLife += num492;
if (Main.player[num487].statLife > Main.player[num487].statLifeMax2)
@@ -64,48 +64,81 @@ namespace CalamityMod.Projectiles.Boss
{
Main.player[num487].KillMe(PlayerDeathReason.ByCustomReason(Main.player[Main.myPlayer].name + " burst into sinless ash."), 1000.0, 0, false);
}
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
NetMessage.SendData(66, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0);
projectile.Kill();
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D value = Main.projectileTexture[projectile.type];
Color baseColor = Main.dayTime ? new Color(255, 150, 0, 255) : new Color(0, 150, 255, 255);
Color color33 = baseColor * 0.5f;
color33.A = 0;
Vector2 vector28 = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY);
Color color34 = color33;
Vector2 origin5 = value.Size() / 2f;
Color color35 = color33 * 0.5f;
float num162 = CalamityUtils.GetLerpValue(15f, 30f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(240f, 200f, projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f;
Vector2 vector29 = new Vector2(0.5f, 1.5f) * num162;
Vector2 vector30 = new Vector2(0.5f, 1.5f) * num162;
color34 *= num162;
color35 *= num162;
public override void Kill(int timeLeft)
int num163 = 0;
Vector2 position3 = vector28 + projectile.velocity.SafeNormalize(Vector2.Zero) * CalamityUtils.GetLerpValue(0.5f, 1f, projectile.localAI[0] / 60f, clamped: true) * num163;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver2, origin5, vector29, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, 0f, origin5, vector30, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver2, origin5, vector29 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, 0f, origin5, vector30 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4, origin5, vector29 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4, origin5, vector29 * 0.36f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.36f, spriteEffects, 0);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 50;
projectile.height = 50;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 10; num621++)
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 15; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 60);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 60);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 3.0 KiB

+22 -19
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -50,17 +51,17 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override Color? GetAlpha(Color lightColor)
{
return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(0, 150, 250, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFireNight");
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int y6 = num214 * projectile.frame;
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
@@ -84,33 +85,35 @@ namespace CalamityMod.Projectiles.Boss
}
}
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 150;
projectile.height = 150;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 120);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
+23 -20
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -42,7 +43,7 @@ namespace CalamityMod.Projectiles.Boss
{
projectile.velocity.X *= 1.05f;
}
int num103 = (int)Player.FindClosest(projectile.Center, 1, 1);
int num103 = Player.FindClosest(projectile.Center, 1, 1);
projectile.ai[1] += 1f;
if (projectile.ai[1] < 180f && projectile.ai[1] > 60f)
{
@@ -56,50 +57,52 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override Color? GetAlpha(Color lightColor)
{
return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(0, 150, 250, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFire2");
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int y6 = num214 * projectile.frame;
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 150;
projectile.height = 150;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 120);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

+25 -22
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -39,19 +40,19 @@ namespace CalamityMod.Projectiles.Boss
if (projectile.frame > 3)
projectile.frame = 0;
float velocityY = projectile.position.Y + (float)projectile.height < player.position.Y ? 1f : 0.25f;
float velocityY = projectile.position.Y + projectile.height < player.position.Y ? 1f : 0.25f;
projectile.velocity.Y += 0.01f;
if (projectile.velocity.Y > velocityY)
projectile.velocity.Y = velocityY;
if (projectile.position.X + (float)projectile.width < player.position.X)
if (projectile.position.X + projectile.width < player.position.X)
{
if (projectile.velocity.X < 0f)
projectile.velocity.X *= 0.99f;
projectile.velocity.X += 0.02f;
}
else if (projectile.position.X > player.position.X + (float)player.width)
else if (projectile.position.X > player.position.X + player.width)
{
if (projectile.velocity.X > 0f)
projectile.velocity.X *= 0.99f;
@@ -64,50 +65,52 @@ namespace CalamityMod.Projectiles.Boss
projectile.rotation = projectile.velocity.X * 0.025f;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 150, 0, projectile.alpha);
}
public override Color? GetAlpha(Color lightColor)
{
return Main.dayTime ? new Color(250, 150, 0, projectile.alpha) : new Color(0, 150, 250, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
Texture2D texture2D13 = Main.dayTime ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Boss/HolyFlareNight");
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
int y6 = num214 * projectile.frame;
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 50;
projectile.height = 50;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
}
int buffType = Main.dayTime ? ModContent.BuffType<HolyFlames>() : ModContent.BuffType<Nightwither>();
target.AddBuff(buffType, 120);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+59 -30
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
@@ -9,7 +10,6 @@ namespace CalamityMod.Projectiles.Boss
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Holy Light");
Main.projFrames[projectile.type] = 4;
}
public override void SetDefaults()
@@ -19,31 +19,29 @@ namespace CalamityMod.Projectiles.Boss
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.alpha = 255;
projectile.penetrate = 1;
projectile.timeLeft = 240;
projectile.timeLeft = 200;
}
public override void AI()
{
bool expertMode = Main.expertMode;
projectile.frameCounter++;
if (projectile.frameCounter > 4)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
{
projectile.frame = 0;
}
projectile.velocity.X *= 1.01f;
projectile.velocity.Y *= 1.01f;
int num487 = (int)Player.FindClosest(projectile.position, projectile.width, projectile.height);
Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
if (projectile.ai[0] < 80f)
{
projectile.ai[0] += 1f;
if (projectile.timeLeft < 160)
projectile.timeLeft = 160;
}
bool expertMode = Main.expertMode;
projectile.velocity *= 1.01f;
int num487 = Player.FindClosest(projectile.position, projectile.width, projectile.height);
Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
float num489 = Main.player[num487].Center.X - vector36.X;
float num490 = Main.player[num487].Center.Y - vector36.Y;
float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490));
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y)
float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490);
if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y)
{
int num492 = expertMode ? 50 : 35;
Main.player[num487].HealEffect(num492, false);
@@ -52,25 +50,56 @@ namespace CalamityMod.Projectiles.Boss
{
Main.player[num487].statLife = Main.player[num487].statLifeMax2;
}
NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0);
NetMessage.SendData(66, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0);
projectile.Kill();
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(150, 255, 0, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D value = Main.projectileTexture[projectile.type];
Color baseColor = new Color(100, 255, 0, 255);
Color color33 = baseColor * 0.5f;
color33.A = 0;
Vector2 vector28 = projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY);
Color color34 = color33;
Vector2 origin5 = value.Size() / 2f;
Color color35 = color33 * 0.5f;
float num162 = CalamityUtils.GetLerpValue(15f, 30f, projectile.timeLeft, clamped: true) * CalamityUtils.GetLerpValue(240f, 200f, projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f;
Vector2 vector29 = new Vector2(0.5f, 1f) * num162;
Vector2 vector30 = new Vector2(0.5f, 1f) * num162;
color34 *= num162;
color35 *= num162;
public override void Kill(int timeLeft)
int num163 = 0;
Vector2 position3 = vector28 + projectile.velocity.SafeNormalize(Vector2.Zero) * CalamityUtils.GetLerpValue(0.5f, 1f, projectile.localAI[0] / 60f, clamped: true) * num163;
SpriteEffects spriteEffects = SpriteEffects.None;
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(value, position3, null, color34, (float)Math.PI / 2f, origin5, vector29, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, 0f, origin5, vector30, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, (float)Math.PI / 2f, origin5, vector29 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, 0f, origin5, vector30 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4, origin5, vector29 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color34, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.6f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4, origin5, vector29 * 0.36f, spriteEffects, 0);
spriteBatch.Draw(value, position3, null, color35, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.36f, spriteEffects, 0);
return false;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
projectile.position.X = projectile.position.X + (projectile.width / 2);
projectile.position.Y = projectile.position.Y + (projectile.height / 2);
projectile.width = 50;
projectile.height = 50;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f);
@@ -78,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 15; num623++)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more