Merge branch 'master' into class-items-(not-patron)
This commit is contained in:
commit
d2f0c46f4e
20 files changed
+803
-934
No files matched your search
+17
-38
@@ -183,12 +183,6 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 valueBoom = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float spreadBoom = 15f * 0.0174f;
|
||||
double startAngleBoom = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spreadBoom / 2;
|
||||
double deltaAngleBoom = spreadBoom / 8f;
|
||||
double offsetAngleBoom;
|
||||
int iBoom;
|
||||
int damageBoom = Main.expertMode ? 23 : 28;
|
||||
float velocity = revenge ? 7.5f : 6.5f;
|
||||
if (death)
|
||||
@@ -196,16 +190,16 @@ namespace CalamityMod.NPCs
|
||||
if (CalamityWorld.bossRushActive)
|
||||
velocity = 11f;
|
||||
|
||||
for (iBoom = 0; iBoom < 15; iBoom++)
|
||||
int totalProjectiles = 30;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
int projectileType = Main.rand.NextBool(2) ? ModContent.ProjectileType<SandTooth>() : ModContent.ProjectileType<SandBlast>();
|
||||
if (projectileType == ModContent.ProjectileType<SandTooth>())
|
||||
{
|
||||
damageBoom = Main.expertMode ? 25 : 30;
|
||||
}
|
||||
offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom;
|
||||
int boom1 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocity), (float)(Math.Cos(offsetAngleBoom) * velocity), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
int boom2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocity), (float)(-Math.Cos(offsetAngleBoom) * velocity), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
damageBoom = Main.expertMode ? 28 : 33;
|
||||
@@ -959,7 +953,6 @@ namespace CalamityMod.NPCs
|
||||
|
||||
int totalProjectiles = 6;
|
||||
float offsetAngle = (float)Math.PI * radialOffset;
|
||||
|
||||
for (int j = 0; j < totalProjectiles; j++)
|
||||
{
|
||||
float radians = j - (totalProjectiles - 1f) / 2f;
|
||||
@@ -969,19 +962,12 @@ namespace CalamityMod.NPCs
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
}
|
||||
|
||||
vectorCenter = npc.Center;
|
||||
totalProjectiles = 12;
|
||||
float spread = MathHelper.ToRadians(30); // 30 degrees in radians = 0.523599
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
double offsetAngle2;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
float radians2 = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
offsetAngle2 = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, (float)(Math.Sin(offsetAngle2) * projectileSpeed), (float)(Math.Cos(offsetAngle2) * projectileSpeed), ModContent.ProjectileType<BrimstoneBarrage>(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f);
|
||||
Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, (float)(-Math.Sin(offsetAngle2) * projectileSpeed), (float)(-Math.Cos(offsetAngle2) * projectileSpeed), ModContent.ProjectileType<BrimstoneBarrage>(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f);
|
||||
Vector2 vector255 = new Vector2(0f, -projectileSpeed).RotatedBy(radians2 * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<BrimstoneBarrage>(), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 1f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2330,21 +2316,14 @@ namespace CalamityMod.NPCs
|
||||
// Fire astral flames while teleporting
|
||||
if ((npc.ai[0] >= 5f && npc.ai[0] != 7) || calamityGlobalNPC.enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive))
|
||||
{
|
||||
Vector2 shootFromVector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
float velocity = CalamityWorld.bossRushActive ? 10f : 7f;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity),
|
||||
(float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<AstralFlame>(), laserDamage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity),
|
||||
(float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<AstralFlame>(), laserDamage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
int totalProjectiles = 8;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<AstralFlame>(), laserDamage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
// Fire astral lasers while falling or walking
|
||||
|
||||
+33
-58
@@ -10,14 +10,11 @@ using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.Events;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
|
||||
namespace CalamityMod.NPCs
|
||||
{
|
||||
@@ -6456,25 +6453,17 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[1] >= 480f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
Vector2 shootFromVector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
int totalProjectiles = 12;
|
||||
float spread = MathHelper.ToRadians(30); // 30 degrees in radians = 0.523599
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
double offsetAngle;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
int damage = 31;
|
||||
if (death)
|
||||
damage += 3;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
int proj = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
int proj2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
Main.projectile[proj2].timeLeft = 300;
|
||||
}
|
||||
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = death ? 34 : 31;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6589,25 +6578,17 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[1] >= 45f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
Vector2 shootFromVector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
int totalProjectiles = 12;
|
||||
float spread = MathHelper.ToRadians(30); // 30 degrees in radians = 0.523599
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
double offsetAngle;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
int damage = 31;
|
||||
if (death)
|
||||
damage += 3;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
int proj = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
int proj2 = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
Main.projectile[proj2].timeLeft = 300;
|
||||
}
|
||||
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = death ? 34 : 31;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7126,23 +7107,17 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[0] >= 120f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
Vector2 shootFromVector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
int totalProjectiles = 12;
|
||||
float spread = MathHelper.ToRadians(30); // 30 degrees in radians = 0.523599
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
double deltaAngle = spread / totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
double offsetAngle;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
int damage = 31;
|
||||
if (death)
|
||||
damage += 3;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = death ? 34 : 31;
|
||||
float velocity = CalamityWorld.bossRushActive ? 6.5f : 5f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(npc.Center, vector255, ProjectileID.DeathLaser, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+113
-150
@@ -1,5 +1,4 @@
|
||||
using CalamityMod;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Vanity;
|
||||
@@ -23,7 +22,6 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
@@ -114,7 +112,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 1f, 1f);
|
||||
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 0f, 1f, 1f);
|
||||
|
||||
// Get a target
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
@@ -130,16 +128,16 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
if ((int)npc.ai[0] + 1 > currentPhase && currentPhase < 6)
|
||||
{
|
||||
handlePhaseTransition((int)npc.ai[0] + 1);
|
||||
HandlePhaseTransition((int)npc.ai[0] + 1);
|
||||
}
|
||||
|
||||
if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 6
|
||||
{
|
||||
int num6 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType<CryogenIce>(), npc.whoAmI, 0f, 0f, 0f, 0f, 255);
|
||||
npc.ai[2] = (float)(num6 + 1);
|
||||
npc.ai[2] = num6 + 1;
|
||||
npc.localAI[1] = -1f;
|
||||
npc.netUpdate = true;
|
||||
Main.npc[num6].ai[0] = (float)npc.whoAmI;
|
||||
Main.npc[num6].ai[0] = npc.whoAmI;
|
||||
Main.npc[num6].netUpdate = true;
|
||||
}
|
||||
|
||||
@@ -197,27 +195,21 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
else if (npc.timeLeft < 1800)
|
||||
npc.timeLeft = 1800;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || (double)npc.life >= (double)npc.lifeMax * 0.15))
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || npc.life >= npc.lifeMax * 0.15))
|
||||
{
|
||||
time++;
|
||||
if (time >= 600)
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
int totalProjectiles = 4;
|
||||
float spread = MathHelper.ToRadians(90);
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / (float)totalProjectiles;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
int num184 = 25;
|
||||
float velocity = CalamityWorld.bossRushActive ? 12f : 4f;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBomb>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBomb>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = 25;
|
||||
float velocity = CalamityWorld.bossRushActive ? 12f : 4f;
|
||||
Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = spinningPoint.RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBomb>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
time = 0;
|
||||
}
|
||||
}
|
||||
@@ -233,20 +225,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.netUpdate = true;
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int num184 = expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 12f : 8f;
|
||||
int i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
int totalProjectiles = 16;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = Main.expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 12f : 8f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +241,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num1243 = player.Center.X - vector142.X;
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
|
||||
float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244);
|
||||
float num1246 = isChill ? 4f : 8f;
|
||||
if (death)
|
||||
{
|
||||
@@ -271,7 +258,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
|
||||
|
||||
double HPMult = death ? 0.95 : 0.83 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
npc.ai[0] = 1f;
|
||||
@@ -289,22 +276,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.localAI[0] = 0f;
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int num184 = expertMode ? 20 : 23;
|
||||
float projVelocity = CalamityWorld.bossRushActive ? 12f : 8f;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * projVelocity), (float)(Math.Cos(offsetAngle) * projVelocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * projVelocity), (float)(-Math.Cos(offsetAngle) * projVelocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[ice].timeLeft = 300;
|
||||
Main.projectile[ice2].timeLeft = 300;
|
||||
}
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = Main.expertMode ? 20 : 23;
|
||||
float velocity2 = CalamityWorld.bossRushActive ? 12f : 8f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity2).RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -340,7 +320,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.Y = -velocity;
|
||||
}
|
||||
|
||||
if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 300f)
|
||||
if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 300f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -350,7 +330,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (npc.velocity.X > velocity)
|
||||
npc.velocity.X = velocity;
|
||||
}
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 300f)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 300f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -362,7 +342,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
|
||||
double HPMult = death ? 0.8 : 0.66 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
npc.ai[0] = 2f;
|
||||
@@ -384,22 +364,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int num184 = expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 14f : 9f;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[ice].timeLeft = 300;
|
||||
Main.projectile[ice2].timeLeft = 300;
|
||||
}
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = Main.expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 14f : 9f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -407,11 +380,11 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num179 = 14f;
|
||||
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
float num181 = Math.Abs(num180) * 0.1f;
|
||||
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
num183 = num179 / num183;
|
||||
num180 *= num183;
|
||||
num182 *= num183;
|
||||
@@ -421,12 +394,12 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
value9.Y += num182;
|
||||
for (int num186 = 0; num186 < 15; num186++)
|
||||
{
|
||||
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
num183 = num179 / num183;
|
||||
num180 += (float)Main.rand.Next(-180, 181);
|
||||
num182 += (float)Main.rand.Next(-180, 181);
|
||||
num180 += Main.rand.Next(-180, 181);
|
||||
num182 += Main.rand.Next(-180, 181);
|
||||
num180 *= num183;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, num180, -8f, num185, num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
@@ -438,7 +411,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num1243 = player.Center.X - vector142.X;
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
|
||||
float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244);
|
||||
float num1246 = isChill ? 6f : 12f;
|
||||
if (death)
|
||||
{
|
||||
@@ -455,7 +428,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.Y = (npc.velocity.Y * 50f + num1244) / 51f;
|
||||
|
||||
double HPMult = death ? 0.7 : 0.49 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
npc.ai[0] = 3f;
|
||||
@@ -477,11 +450,11 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (CalamityWorld.bossRushActive)
|
||||
num179 = 14f;
|
||||
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
float num181 = Math.Abs(num180) * 0.1f;
|
||||
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
npc.netUpdate = true;
|
||||
num183 = num179 / num183;
|
||||
num180 *= num183;
|
||||
@@ -492,12 +465,12 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
value9.Y += num182;
|
||||
for (int num186 = 0; num186 < 15; num186++)
|
||||
{
|
||||
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
num183 = num179 / num183;
|
||||
num180 += (float)Main.rand.Next(-360, 361);
|
||||
num182 += (float)Main.rand.Next(-360, 361);
|
||||
num180 += Main.rand.Next(-360, 361);
|
||||
num182 += Main.rand.Next(-360, 361);
|
||||
num180 *= num183;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, num180, -2.5f, num185, num184, 0f, Main.myPlayer, 1f, 0f);
|
||||
}
|
||||
@@ -536,7 +509,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.Y = -velocity;
|
||||
}
|
||||
|
||||
if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 300f)
|
||||
if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 300f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -546,7 +519,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (npc.velocity.X > velocity)
|
||||
npc.velocity.X = velocity;
|
||||
}
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 300f)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 300f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -558,7 +531,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
|
||||
double HPMult = death ? 0.55 : 0.32 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
npc.ai[0] = 4f;
|
||||
@@ -577,21 +550,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.localAI[0] = 0f;
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int num184 = expertMode ? 20 : 23;
|
||||
int i;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 9f), (float)(Math.Cos(offsetAngle) * 9f), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 9f), (float)(-Math.Cos(offsetAngle) * 9f), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[ice].timeLeft = 300;
|
||||
Main.projectile[ice2].timeLeft = 300;
|
||||
}
|
||||
int totalProjectiles = 12;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = Main.expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 14f : 9f;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -599,7 +566,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num1243 = player.Center.X - vector142.X;
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244));
|
||||
float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244);
|
||||
float speed = revenge ? 5.5f : 5f;
|
||||
if (CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -642,7 +609,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
else
|
||||
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))
|
||||
if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2(num1250 * 16, num1251 * 16), 1, 1, player.position, player.width, player.height))
|
||||
break;
|
||||
|
||||
if (num1249 > 100)
|
||||
@@ -659,7 +626,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
else if (npc.ai[1] == 1f)
|
||||
{
|
||||
Vector2 position = new Vector2((float)teleportLocationX * 16f - (float)(npc.width / 2), (float)iceShard * 16f - (float)(npc.height / 2));
|
||||
Vector2 position = new Vector2(teleportLocationX * 16f - (npc.width / 2), iceShard * 16f - (npc.height / 2));
|
||||
for (int m = 0; m < 5; m++)
|
||||
{
|
||||
int dust = Dust.NewDust(position, npc.width, npc.height, 67, 0f, 0f, 100, default, 2f);
|
||||
@@ -695,7 +662,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
|
||||
double HPMult = death ? 0.4 : 0.15 + multAdd;
|
||||
if ((double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
@@ -704,7 +671,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
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 < 70; num623++)
|
||||
@@ -716,7 +683,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
|
||||
float randomSpread = (float)(Main.rand.Next(-200, 200) / 100);
|
||||
float randomSpread = Main.rand.Next(-200, 200) / 100;
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore1"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore2"), 1f);
|
||||
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoGore3"), 1f);
|
||||
@@ -752,10 +719,10 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
else if (npc.ai[0] == 5f)
|
||||
{
|
||||
npc.damage = (int)((float)npc.defDamage * 1.5f);
|
||||
npc.damage = (int)(npc.defDamage * 1.5f);
|
||||
|
||||
double HPMult = death ? 0.25 : 0.15;
|
||||
if (revenge && (double)npc.life < (double)npc.lifeMax * HPMult)
|
||||
if (revenge && npc.life < npc.lifeMax * HPMult)
|
||||
{
|
||||
if (npc.ai[1] == 60f)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (CalamityWorld.bossRushActive ? 30f : (isChill ? 18f : 24f));
|
||||
@@ -785,7 +752,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.rotation = npc.velocity.X * 0.15f;
|
||||
}
|
||||
else
|
||||
npc.rotation += (float)npc.direction * 0.5f;
|
||||
npc.rotation += npc.direction * 0.5f;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -795,16 +762,16 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
num1372 = 32f;
|
||||
}
|
||||
Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f);
|
||||
float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X;
|
||||
Vector2 vector167 = new Vector2(npc.Center.X + (npc.direction * 20), npc.Center.Y + 6f);
|
||||
float num1373 = player.position.X + player.width * 0.5f - vector167.X;
|
||||
float num1374 = player.Center.Y - vector167.Y;
|
||||
float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374));
|
||||
float num1375 = (float)Math.Sqrt(num1373 * num1373 + num1374 * num1374);
|
||||
float num1376 = num1372 / num1375;
|
||||
num1373 *= num1376;
|
||||
num1374 *= num1376;
|
||||
iceShard--;
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || death)
|
||||
if (npc.life < npc.lifeMax * (0.1 + multAdd) || death)
|
||||
{
|
||||
if (num1375 < 170f || iceShard > 0)
|
||||
{
|
||||
@@ -812,11 +779,11 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
iceShard = 17;
|
||||
}
|
||||
npc.rotation += (float)npc.direction * 0.5f;
|
||||
npc.rotation += npc.direction * 0.5f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if ((double)npc.life < (double)npc.lifeMax * (0.125 + multAdd))
|
||||
else if (npc.life < npc.lifeMax * (0.125 + multAdd))
|
||||
{
|
||||
if (num1375 < 190f || iceShard > 0)
|
||||
{
|
||||
@@ -824,7 +791,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
iceShard = 19;
|
||||
}
|
||||
npc.rotation += (float)npc.direction * 0.35f;
|
||||
npc.rotation += npc.direction * 0.35f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -836,7 +803,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
iceShard = 20;
|
||||
}
|
||||
npc.rotation += (float)npc.direction * 0.3f;
|
||||
npc.rotation += npc.direction * 0.3f;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -860,19 +827,15 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
time++;
|
||||
if (time >= 75)
|
||||
{
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 4f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
int num184 = 25;
|
||||
int totalProjectiles = 4;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = 25;
|
||||
float velocity2 = CalamityWorld.bossRushActive ? 16f : 6f;
|
||||
for (i = 0; i < 2; i++)
|
||||
Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity2) : Vector2.Normalize(new Vector2(-velocity2, -velocity2)) * velocity2;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * velocity2), (float)(Math.Cos(offsetAngle) * velocity2), ModContent.ProjectileType<IceBomb>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * velocity2), (float)(-Math.Cos(offsetAngle) * velocity2), ModContent.ProjectileType<IceBomb>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Vector2 vector255 = spinningPoint.RotatedBy(radians * k);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBomb>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
time = 0;
|
||||
}
|
||||
@@ -919,7 +882,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.velocity.Y = -velocity;
|
||||
}
|
||||
|
||||
if (npc.position.X + (float)(npc.width / 2) > player.position.X + (float)(player.width / 2) + 350f)
|
||||
if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 350f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -929,7 +892,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (npc.velocity.X > velocity)
|
||||
npc.velocity.X = velocity;
|
||||
}
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)(player.width / 2) - 350f)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 350f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
npc.velocity.X *= 0.98f;
|
||||
@@ -941,24 +904,24 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
if (!revenge || (double)npc.life >= (double)npc.lifeMax * (death ? 0.25 : 0.15))
|
||||
if (!revenge || npc.life >= npc.lifeMax * (death ? 0.25 : 0.15))
|
||||
{
|
||||
if (npc.ai[3] == 0f && npc.life > 0)
|
||||
{
|
||||
npc.ai[3] = (float)npc.lifeMax;
|
||||
npc.ai[3] = npc.lifeMax;
|
||||
}
|
||||
if (npc.life > 0)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num660 = (int)((double)npc.lifeMax * 0.075);
|
||||
if ((float)(npc.life + num660) < npc.ai[3])
|
||||
int num660 = (int)(npc.lifeMax * 0.075);
|
||||
if ((npc.life + num660) < npc.ai[3])
|
||||
{
|
||||
npc.ai[3] = (float)npc.life;
|
||||
npc.ai[3] = npc.life;
|
||||
for (int num662 = 0; num662 < 2; num662++)
|
||||
{
|
||||
int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32));
|
||||
int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32));
|
||||
int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32));
|
||||
int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32));
|
||||
int random = 1;
|
||||
switch ((int)npc.ai[0])
|
||||
{
|
||||
@@ -1001,7 +964,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
private void handlePhaseTransition (int newPhase)
|
||||
private void HandlePhaseTransition(int newPhase)
|
||||
{
|
||||
int chipGoreAmount = newPhase >= 5 ? 3 : newPhase >= 3 ? 2 : 1;
|
||||
for (int i = 1; i < chipGoreAmount; i++)
|
||||
|
||||
+21
-19
@@ -50,8 +50,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
{
|
||||
npc.velocity = Vector2.Zero;
|
||||
npc.position = Main.npc[num989].Center;
|
||||
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.gfxOffY = Main.npc[num989].gfxOffY + 14;
|
||||
return;
|
||||
}
|
||||
@@ -92,9 +92,10 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
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 < 50; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 3f);
|
||||
@@ -103,25 +104,26 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 4f;
|
||||
double offsetAngle;
|
||||
int num184 = Main.expertMode ? 20 : 23;
|
||||
int i;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int ice = Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 8f), (float)(Math.Cos(offsetAngle) * 8f), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
int ice2 = Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 8f), (float)(-Math.Cos(offsetAngle) * 8f), ModContent.ProjectileType<IceBlast>(), num184, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[ice].timeLeft = 300;
|
||||
Main.projectile[ice2].timeLeft = 300;
|
||||
}
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int totalProjectiles = 4;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage2 = Main.expertMode ? 20 : 23;
|
||||
float velocity = CalamityWorld.bossRushActive ? 12f : 8f;
|
||||
Vector2 spinningPoint = Main.rand.NextBool(2) ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
Vector2 vector255 = spinningPoint.RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<IceBlast>(), damage2, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 300;
|
||||
}
|
||||
}
|
||||
|
||||
float randomSpread;
|
||||
for (int spike = 0; spike < 4; spike++)
|
||||
{
|
||||
randomSpread = (float)(Main.rand.Next(-200, 200) / 100);
|
||||
randomSpread = Main.rand.Next(-200, 200) / 100;
|
||||
for (int x = 0; x < 4; x++)
|
||||
{
|
||||
Gore.NewGore(npc.Center, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/CryoShieldGore" + x), 1f);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -10,7 +8,6 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod;
|
||||
|
||||
namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
@@ -67,12 +64,12 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
if (npc.velocity.X < 0f)
|
||||
{
|
||||
npc.spriteDirection = -1;
|
||||
npc.rotation = (float)Math.Atan2((double)-(double)npc.velocity.Y, (double)-(double)npc.velocity.X);
|
||||
npc.rotation = (float)Math.Atan2(-npc.velocity.Y, -npc.velocity.X);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.spriteDirection = 1;
|
||||
npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X);
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X);
|
||||
}
|
||||
|
||||
npc.alpha -= 6;
|
||||
@@ -139,9 +136,9 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
Main.PlaySound(npc.DeathSound, npc.position);
|
||||
}
|
||||
|
||||
CheckDead();
|
||||
npc.life = 0;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
npc.active = false;
|
||||
return;
|
||||
}
|
||||
@@ -161,7 +158,7 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
spriteEffects = SpriteEffects.None;
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
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.Lime;
|
||||
float amount9 = 0.5f;
|
||||
int num153 = 10;
|
||||
@@ -173,16 +170,16 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
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 / 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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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 / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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);
|
||||
|
||||
@@ -207,11 +204,11 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 12);
|
||||
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.width = (npc.height = 96);
|
||||
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 = npc.height = 96;
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
|
||||
for (int num621 = 0; num621 < 15; num621++)
|
||||
{
|
||||
@@ -221,7 +218,7 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,11 +231,14 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
Main.dust[num624].velocity.X *= 2f;
|
||||
}
|
||||
|
||||
int spawnX = (int)(npc.width / 2);
|
||||
int damage = Main.expertMode ? 55 : 70;
|
||||
for (int i = 0; i < 2; i++)
|
||||
Projectile.NewProjectile(npc.Center.X + (float)Main.rand.Next(-spawnX, spawnX), npc.Center.Y,
|
||||
(float)Main.rand.Next(-3, 4), (float)Main.rand.Next(-12, -6), ModContent.ProjectileType<OldDukeGore>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int spawnX = npc.width / 2;
|
||||
int damage = Main.expertMode ? 55 : 70;
|
||||
for (int i = 0; i < 2; i++)
|
||||
Projectile.NewProjectile(npc.Center.X + Main.rand.Next(-spawnX, spawnX), npc.Center.Y,
|
||||
Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), ModContent.ProjectileType<OldDukeGore>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -247,13 +247,13 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default(Color), 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 20; k++)
|
||||
{
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default(Color), 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod;
|
||||
|
||||
namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
@@ -84,9 +79,11 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
if (vector.Length() < 40f || npc.ai[3] >= 900f)
|
||||
{
|
||||
npc.dontTakeDamage = false;
|
||||
CheckDead();
|
||||
npc.life = 0;
|
||||
return;
|
||||
npc.HitEffect(0, 10.0);
|
||||
npc.checkDead();
|
||||
npc.active = false;
|
||||
return;
|
||||
}
|
||||
npc.ai[3] += 1f;
|
||||
npc.dontTakeDamage = (npc.ai[3] >= 600f ? false : true);
|
||||
@@ -97,14 +94,14 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
return;
|
||||
}
|
||||
float num1372 = 12f;
|
||||
Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f);
|
||||
float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X;
|
||||
Vector2 vector167 = new Vector2(npc.Center.X + npc.direction * 20, npc.Center.Y + 6f);
|
||||
float num1373 = player.position.X + player.width * 0.5f - vector167.X;
|
||||
float num1374 = player.Center.Y - vector167.Y;
|
||||
float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374));
|
||||
float num1375 = (float)Math.Sqrt(num1373 * num1373 + num1374 * num1374);
|
||||
float num1376 = num1372 / num1375;
|
||||
num1373 *= num1376;
|
||||
num1374 *= num1376;
|
||||
npc.ai[0] -= (float)Main.rand.Next(6);
|
||||
npc.ai[0] -= Main.rand.Next(6);
|
||||
if (num1375 < 300f || npc.ai[0] > 0f)
|
||||
{
|
||||
if (num1375 < 300f)
|
||||
@@ -176,56 +173,49 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 12);
|
||||
|
||||
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 = (npc.height = 96);
|
||||
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 < 15; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default(Color), 2f);
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.Next(2) == 0)
|
||||
{
|
||||
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;
|
||||
}
|
||||
Main.dust[num622].noGravity = true;
|
||||
}
|
||||
|
||||
for (int num623 = 0; num623 < 30; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default(Color), 3f);
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, 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.SulfurousSeaAcid, 0f, 0f, 100, default(Color), 2f);
|
||||
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
Main.dust[num624].noGravity = true;
|
||||
}
|
||||
|
||||
if (Main.netMode != 1)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Vector2 valueBoom = npc.Center;
|
||||
int totalProjectiles = 4;
|
||||
float spreadBoom = MathHelper.ToRadians(90);
|
||||
double startAngleBoom = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spreadBoom / 2;
|
||||
double deltaAngleBoom = spreadBoom / (float)totalProjectiles;
|
||||
double offsetAngleBoom;
|
||||
int iBoom;
|
||||
int damageBoom = Main.expertMode ? 55 : 70;
|
||||
int projectileType = ModContent.ProjectileType<SandTooth>();
|
||||
Projectile.NewProjectile(valueBoom.X, valueBoom.Y, 0f, 0f, ModContent.ProjectileType<SandPoisonCloud>(), damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
for (iBoom = 0; iBoom < 2; iBoom++)
|
||||
{
|
||||
float velocity = (float)Main.rand.Next(7, 11);
|
||||
offsetAngleBoom = (startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f) + 32f * iBoom;
|
||||
int proj = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocity), (float)(Math.Cos(offsetAngleBoom) * velocity), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = Main.expertMode ? 55 : 70;
|
||||
for (int k = 0; k < totalProjectiles; k++)
|
||||
{
|
||||
float velocity = Main.rand.Next(7, 11);
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * k);
|
||||
int proj = Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<SandTooth>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj].timeLeft = 360;
|
||||
int proj2 = Projectile.NewProjectile(valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocity), (float)(-Math.Cos(offsetAngleBoom) * velocity), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[proj2].timeLeft = 360;
|
||||
}
|
||||
Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType<SandPoisonCloud>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -233,13 +223,13 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
{
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default(Color), 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
for (int k = 0; k < 15; k++)
|
||||
{
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default(Color), 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.SulfurousSeaAcid, hitDirection, -1f, 0, default, 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,10 @@ using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
namespace CalamityMod.NPCs.Perforator
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
|
||||
@@ -14,8 +14,6 @@ using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
|
||||
namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
@@ -108,7 +106,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
CalamityGlobalNPC.doughnutBoss = npc.whoAmI;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = (float)npc.life / (float)npc.lifeMax;
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
Vector2 vectorCenter = npc.Center;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[1] == 0f)
|
||||
@@ -200,7 +198,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
if (Main.rand.Next(3) < num1009)
|
||||
{
|
||||
int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, (int)CalamityDusts.ProfanedFire, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
int num1012 = Dust.NewDust(vectorCenter - new Vector2(num1010), num1010 * 2, num1010 * 2, (int)CalamityDusts.ProfanedFire, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
Main.dust[num1012].noGravity = true;
|
||||
Main.dust[num1012].velocity *= 0.2f;
|
||||
Main.dust[num1012].fadeIn = 1f;
|
||||
@@ -216,58 +214,35 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
|
||||
Main.PlaySound(SoundID.Item20, npc.position);
|
||||
|
||||
Vector2 center = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
int totalProjectiles = 18;
|
||||
float spread = MathHelper.ToRadians(20);
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
double deltaAngle = spread / (float)totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
float velocity = 5f;
|
||||
int damage = expertMode ? 50 : 60;
|
||||
int projectileType = ModContent.ProjectileType<ProfanedSpear>();
|
||||
int totalProjectiles = 10;
|
||||
float velocity = 5f;
|
||||
int damage = expertMode ? 50 : 60;
|
||||
int projectileType = ModContent.ProjectileType<ProfanedSpear>();
|
||||
|
||||
double offsetAngle;
|
||||
int i;
|
||||
switch (spearType)
|
||||
{
|
||||
case 0:
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 1:
|
||||
totalProjectiles = 12;
|
||||
spread = MathHelper.ToRadians(30); // 30 degrees in radians = 0.523599
|
||||
startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
deltaAngle = spread / (float)totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
velocity = 5.5f;
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
totalProjectiles = 8;
|
||||
spread = MathHelper.ToRadians(45); // 30 degrees in radians = 0.523599
|
||||
startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; // Where the projectiles start spawning at, don't change this
|
||||
deltaAngle = spread / (float)totalProjectiles; // Angle between each projectile, 0.04363325
|
||||
velocity = 6f;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; // Used to be 32
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(center.X, center.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
spearType++;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, projectileType, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
spearType++;
|
||||
if (spearType > 2)
|
||||
spearType = 0;
|
||||
}
|
||||
@@ -287,7 +262,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
flag64 = true;
|
||||
}
|
||||
float num1014 = 8f;
|
||||
flag64 = flag64 && vector126.ToRotation() > 3.14159274f / num1014 && vector126.ToRotation() < 3.14159274f - 3.14159274f / num1014;
|
||||
flag64 = flag64 && vector126.ToRotation() > MathHelper.Pi / num1014 && vector126.ToRotation() < MathHelper.Pi - MathHelper.Pi / num1014;
|
||||
if (num1013 > 1200f || !flag64)
|
||||
{
|
||||
npc.velocity.X = (npc.velocity.X * (num1000 - 1f) + vector127.X) / num1000;
|
||||
@@ -337,8 +312,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
Main.PlaySound(SoundID.Item20, npc.position);
|
||||
int damage = expertMode ? 55 : 70;
|
||||
Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter;
|
||||
int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, ModContent.ProjectileType<FlareDust>(), damage, 0f, Main.myPlayer, 0f, 0f); //changed
|
||||
Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (npc.width + 20) / 2f + vectorCenter;
|
||||
int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, npc.direction * 2, 4f, ModContent.ProjectileType<FlareDust>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[projectile].timeLeft = 120;
|
||||
Main.projectile[projectile].velocity.X = 0f;
|
||||
Main.projectile[projectile].velocity.Y = 0f;
|
||||
@@ -363,7 +338,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
vec2.Normalize();
|
||||
if (vec2.HasNaNs())
|
||||
{
|
||||
vec2 = new Vector2((float)npc.direction, 0f);
|
||||
vec2 = new Vector2(npc.direction, 0f);
|
||||
}
|
||||
npc.velocity = (npc.velocity * (num1000 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / num1000;
|
||||
}
|
||||
@@ -388,7 +363,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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 / 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;
|
||||
@@ -402,16 +377,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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 / 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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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 / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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);
|
||||
|
||||
@@ -425,9 +400,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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)texture2D15.Width, (float)(texture2D15.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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
@@ -136,7 +134,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
dustType = 160;
|
||||
}
|
||||
int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
int num1012 = Dust.NewDust(npc.Center - new Vector2(num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
Main.dust[num1012].noGravity = true;
|
||||
Main.dust[num1012].velocity *= 0.2f;
|
||||
Main.dust[num1012].fadeIn = 1f;
|
||||
@@ -153,7 +151,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num784 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.X - vector96.X;
|
||||
float num785 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.Y - vector96.Y;
|
||||
float num786 = (float)Math.Sqrt((double)(num784 * num784 + num785 * num785));
|
||||
float num786 = (float)Math.Sqrt(num784 * num784 + num785 * num785);
|
||||
if (num786 > 90f)
|
||||
{
|
||||
num786 = 21f / num786; //8f
|
||||
@@ -173,7 +171,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
num784 = player.Center.X - vector96.X;
|
||||
num785 = player.Center.Y - vector96.Y;
|
||||
num786 = (float)Math.Sqrt((double)(num784 * num784 + num785 * num785));
|
||||
num786 = (float)Math.Sqrt(num784 * num784 + num785 * num785);
|
||||
num786 = 21f / num786; //8f
|
||||
npc.velocity.X = num784 * num786;
|
||||
npc.velocity.Y = num785 * num786;
|
||||
@@ -190,7 +188,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Vector2 vector97 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num787 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.X - vector97.X;
|
||||
float num788 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.Y - vector97.Y;
|
||||
float num789 = (float)Math.Sqrt((double)(num787 * num787 + num788 * num788));
|
||||
float num789 = (float)Math.Sqrt(num787 * num787 + num788 * num788);
|
||||
if (num789 > 700f)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
@@ -206,20 +204,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Main.PlaySound(SoundID.Item20, npc.position);
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int damage = expertMode ? 50 : 60;
|
||||
int projectileShot = ModContent.ProjectileType<ProfanedSpear>();
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
float velocity = 5f;
|
||||
int totalProjectiles = 6;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int damage = expertMode ? 50 : 60;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<ProfanedSpear>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,7 +226,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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 / 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;
|
||||
@@ -244,16 +238,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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 / 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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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 / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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);
|
||||
|
||||
@@ -267,9 +261,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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)texture2D15.Width, (float)(texture2D15.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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
[AutoloadBossHead]
|
||||
@@ -136,7 +134,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
{
|
||||
dustType = 107;
|
||||
}
|
||||
int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
int num1012 = Dust.NewDust(npc.Center - new Vector2(num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f);
|
||||
Main.dust[num1012].noGravity = true;
|
||||
Main.dust[num1012].velocity *= 0.2f;
|
||||
Main.dust[num1012].fadeIn = 1f;
|
||||
@@ -153,7 +151,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num784 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.X - vector96.X;
|
||||
float num785 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.Y - vector96.Y;
|
||||
float num786 = (float)Math.Sqrt((double)(num784 * num784 + num785 * num785));
|
||||
float num786 = (float)Math.Sqrt(num784 * num784 + num785 * num785);
|
||||
if (num786 > 90f)
|
||||
{
|
||||
num786 = 21f / num786; //8f
|
||||
@@ -173,7 +171,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
vector96 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
num784 = player.Center.X - vector96.X;
|
||||
num785 = player.Center.Y - vector96.Y;
|
||||
num786 = (float)Math.Sqrt((double)(num784 * num784 + num785 * num785));
|
||||
num786 = (float)Math.Sqrt(num784 * num784 + num785 * num785);
|
||||
num786 = 21f / num786; //8f
|
||||
npc.velocity.X = num784 * num786;
|
||||
npc.velocity.Y = num785 * num786;
|
||||
@@ -190,7 +188,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
Vector2 vector97 = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
float num787 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.X - vector97.X;
|
||||
float num788 = Main.npc[CalamityGlobalNPC.doughnutBoss].Center.Y - vector97.Y;
|
||||
float num789 = (float)Math.Sqrt((double)(num787 * num787 + num788 * num788));
|
||||
float num789 = (float)Math.Sqrt(num787 * num787 + num788 * num788);
|
||||
if (num789 > 700f)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
@@ -206,20 +204,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Main.PlaySound(SoundID.Item20, npc.position);
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int damage = 0;
|
||||
int projectileShot = ModContent.ProjectileType<HealOrbProv>();
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), projectileShot, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
float velocity = 5f;
|
||||
int totalProjectiles = 6;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ModContent.ProjectileType<HealOrbProv>(), 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,7 +226,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
|
||||
Texture2D texture2D15 = Main.npcTexture[npc.type];
|
||||
Texture2D texture2D16 = ModContent.GetTexture("CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardianBoss3Glow2");
|
||||
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;
|
||||
@@ -245,16 +238,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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 / 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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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 / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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);
|
||||
|
||||
@@ -269,16 +262,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
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)texture2D15.Width, (float)(texture2D15.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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, 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(texture2D16, vector44, npc.frame, color43, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
phase = 3;
|
||||
break; // 1575 or 1500
|
||||
case 1:
|
||||
phase = 5;
|
||||
phase = 2;
|
||||
break; // 1875 or 1800
|
||||
case 2:
|
||||
phase = 0;
|
||||
@@ -763,7 +763,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
num867 *= -1f;
|
||||
}
|
||||
|
||||
/*if (npc.velocity.Length() <= 2f)
|
||||
if (npc.velocity.Length() <= 2f)
|
||||
npc.velocity = Vector2.Zero;
|
||||
if (npc.velocity.Length() > 2f)
|
||||
return;
|
||||
@@ -774,54 +774,55 @@ namespace CalamityMod.NPCs.Providence
|
||||
float interval = totalProjectiles / chains * divisor;
|
||||
double patternInterval = Math.Floor(npc.ai[3] / interval);
|
||||
float velocity = 3f;
|
||||
Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f);
|
||||
|
||||
if (patternInterval % 2 == 0)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.ai[3] % divisor == 0f)
|
||||
if (patternInterval % 2 == 0)
|
||||
{
|
||||
double radians = (patternInterval % 4 == 0 ? MathHelper.TwoPi + MathHelper.Pi / 3 : MathHelper.TwoPi) / chains;
|
||||
float radialOffset = MathHelper.ToRadians(npc.ai[2]);
|
||||
Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f);
|
||||
|
||||
for (int i = 0; i < chains; i++)
|
||||
if (npc.ai[3] % divisor == 0f)
|
||||
{
|
||||
Vector2 vector2 = new Vector2(0f, -velocity).RotatedBy(radians * i + radialOffset);
|
||||
Vector2 spinningPoint = calamityGlobalNPC.newAI[1] % 2f == 0f ? new Vector2(0f, -velocity) : Vector2.Normalize(new Vector2(-velocity, -velocity)) * velocity;
|
||||
double radians = MathHelper.TwoPi / chains;
|
||||
for (int i = 0; i < chains; i++)
|
||||
{
|
||||
Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(npc.ai[2]));
|
||||
|
||||
int projectileType = ModContent.ProjectileType<HolyBurnOrb>();
|
||||
if (Main.rand.NextBool(4) && !death)
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
int projectileType = ModContent.ProjectileType<HolyBurnOrb>();
|
||||
if (Main.rand.NextBool(4) && !death)
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
|
||||
Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
|
||||
// Radial offset
|
||||
npc.ai[2] += 10f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
|
||||
// Radial offset
|
||||
npc.ai[2] += 10f;
|
||||
totalProjectiles = 16;
|
||||
if (npc.ai[3] % (divisor * totalProjectiles) == 0f)
|
||||
{
|
||||
calamityGlobalNPC.newAI[1] += 1f;
|
||||
double radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector2 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
|
||||
int projectileType = ModContent.ProjectileType<HolyBurnOrb>();
|
||||
if (Main.rand.NextBool(4) && !death)
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
|
||||
Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.ai[2] = 0f;
|
||||
|
||||
totalProjectiles = 16;
|
||||
if (npc.ai[3] % (divisor * totalProjectiles) == 0f)
|
||||
{
|
||||
double radians = MathHelper.TwoPi / totalProjectiles;
|
||||
Vector2 fireFrom = new Vector2(vector.X, vector.Y + 20f);
|
||||
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector2 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
|
||||
int projectileType = ModContent.ProjectileType<HolyBurnOrb>();
|
||||
if (Main.rand.NextBool(4) && !death)
|
||||
projectileType = ModContent.ProjectileType<HolyLight>();
|
||||
|
||||
Projectile.NewProjectile(fireFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
int shootBoost = (int)(4f * (1f - lifeRatio));
|
||||
/*int shootBoost = (int)(4f * (1f - lifeRatio));
|
||||
|
||||
int num870 = (expertMode ? 3 : 4) - shootBoost;
|
||||
|
||||
@@ -839,7 +840,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
else
|
||||
Projectile.NewProjectile(vector114.X, vector114.Y, num866, num867, ModContent.ProjectileType<HolyBurnOrb>(), 0, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (npc.ai[3] == 0f)
|
||||
{
|
||||
|
||||
+37
-44
@@ -19,8 +19,6 @@ using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
|
||||
namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
@@ -116,7 +114,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
bool death = CalamityWorld.death || CalamityWorld.bossRushActive;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = (float)npc.life / (float)npc.lifeMax;
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Large fire light
|
||||
Lighting.AddLight((int)(npc.Center.X - 110f) / 16, (int)(npc.Center.Y - 30f) / 16, 0f, 0.5f, 2f);
|
||||
@@ -177,7 +175,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
|
||||
bool enrage = false;
|
||||
if (player.position.Y + (float)(player.height / 2) > npc.position.Y + (float)(npc.height / 2) + 10f)
|
||||
if (player.position.Y + (player.height / 2) > npc.position.Y + (npc.height / 2) + 10f)
|
||||
enrage = true;
|
||||
|
||||
if (headActive || rightClawActive || leftClawActive || rightLegActive || leftLegActive)
|
||||
@@ -199,8 +197,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Main.dust[rightDust].velocity *= 0.2f;
|
||||
|
||||
Dust rightDustExpr = Main.dust[rightDust];
|
||||
rightDustExpr.velocity.Y -= 3f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
rightDustExpr.velocity.Y -= 3f + Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
@@ -208,7 +206,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
if (Main.rand.Next(20) != 0)
|
||||
{
|
||||
Main.dust[rightDust].noGravity = true;
|
||||
Main.dust[rightDust].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].scale *= 1f + Main.rand.Next(10) * 0.1f;
|
||||
Dust rightDustExpr2 = Main.dust[rightDust];
|
||||
rightDustExpr2.velocity.Y -= 4f;
|
||||
}
|
||||
@@ -223,20 +221,15 @@ namespace CalamityMod.NPCs.Ravager
|
||||
npc.TargetClosest(true);
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
|
||||
{
|
||||
Vector2 shootFromVector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
int laserDamage = 45;
|
||||
float velocity = CalamityWorld.bossRushActive ? 10f : 7f;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), 259, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), 259, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
float velocity = CalamityWorld.bossRushActive ? 10f : 7f;
|
||||
int totalProjectiles = 8;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int laserDamage = 45;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(npc.Center, vector255, ProjectileID.EyeBeam, laserDamage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,8 +242,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Main.dust[rightDust].velocity *= 0.2f;
|
||||
|
||||
Dust rightDustExpr = Main.dust[rightDust];
|
||||
rightDustExpr.velocity.X += 3f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
rightDustExpr.velocity.X += 3f + Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
@@ -258,7 +251,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
if (Main.rand.Next(20) != 0)
|
||||
{
|
||||
Main.dust[rightDust].noGravity = true;
|
||||
Main.dust[rightDust].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].scale *= 1f + Main.rand.Next(10) * 0.1f;
|
||||
Dust rightDustExpr2 = Main.dust[rightDust];
|
||||
rightDustExpr2.velocity.X += 4f;
|
||||
}
|
||||
@@ -286,8 +279,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Main.dust[leftDust].velocity *= 0.2f;
|
||||
|
||||
Dust leftDustExpr = Main.dust[leftDust];
|
||||
leftDustExpr.velocity.X -= 3f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
leftDustExpr.velocity.X -= 3f + Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
@@ -295,7 +288,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
if (Main.rand.Next(20) != 0)
|
||||
{
|
||||
Main.dust[leftDust].noGravity = true;
|
||||
Main.dust[leftDust].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].scale *= 1f + Main.rand.Next(10) * 0.1f;
|
||||
Dust leftDustExpr2 = Main.dust[leftDust];
|
||||
leftDustExpr2.velocity.X -= 4f;
|
||||
}
|
||||
@@ -323,8 +316,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Main.dust[rightDust].velocity *= 0.2f;
|
||||
|
||||
Dust rightDustExpr = Main.dust[rightDust];
|
||||
rightDustExpr.velocity.Y += 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
rightDustExpr.velocity.Y += 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
@@ -332,7 +325,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
if (Main.rand.Next(20) != 0)
|
||||
{
|
||||
Main.dust[rightDust].noGravity = true;
|
||||
Main.dust[rightDust].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[rightDust].scale *= 1f + Main.rand.Next(10) * 0.1f;
|
||||
Dust rightDustExpr2 = Main.dust[rightDust];
|
||||
rightDustExpr2.velocity.Y += 1f;
|
||||
}
|
||||
@@ -359,8 +352,8 @@ namespace CalamityMod.NPCs.Ravager
|
||||
Main.dust[leftDust].velocity *= 0.2f;
|
||||
|
||||
Dust leftDustExpr = Main.dust[leftDust];
|
||||
leftDustExpr.velocity.Y += 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].fadeIn = 0.5f + (float)Main.rand.Next(10) * 0.1f;
|
||||
leftDustExpr.velocity.Y += 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f;
|
||||
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
@@ -368,7 +361,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
if (Main.rand.Next(20) != 0)
|
||||
{
|
||||
Main.dust[leftDust].noGravity = true;
|
||||
Main.dust[leftDust].scale *= 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[leftDust].scale *= 1f + Main.rand.Next(10) * 0.1f;
|
||||
Dust leftDustExpr2 = Main.dust[leftDust];
|
||||
leftDustExpr2.velocity.Y += 1f;
|
||||
}
|
||||
@@ -421,7 +414,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
|
||||
bool shouldFall = (player.position.Y >= npc.position.Y + (float)npc.height);
|
||||
bool shouldFall = player.position.Y >= npc.position.Y + npc.height;
|
||||
float velocityXBoost = death ? 4f : 4f * (1f - lifeRatio);
|
||||
float velocityX = ((enrage || npc.Calamity().enraged > 0 || (CalamityMod.CalamityConfig.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 8f : 4f) + velocityXBoost;
|
||||
float velocityY = -16f;
|
||||
@@ -446,7 +439,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
}
|
||||
|
||||
npc.velocity.X = velocityX * (float)npc.direction;
|
||||
npc.velocity.X = velocityX * npc.direction;
|
||||
npc.velocity.Y = velocityY;
|
||||
|
||||
npc.ai[0] = 1f;
|
||||
@@ -484,11 +477,11 @@ namespace CalamityMod.NPCs.Ravager
|
||||
{
|
||||
for (int stompDustAmount = 0; stompDustAmount < 6; stompDustAmount++)
|
||||
{
|
||||
int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + (float)npc.height), npc.width + 30, 4, 31, 0f, 0f, 100, default, 1.5f);
|
||||
int stompDust = Dust.NewDust(new Vector2(npc.position.X - 30f, npc.position.Y + npc.height), npc.width + 30, 4, 31, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[stompDust].velocity *= 0.2f;
|
||||
}
|
||||
|
||||
int stompGore = Gore.NewGore(new Vector2((float)(stompDustArea - 30), npc.position.Y + (float)npc.height - 12f), default, Main.rand.Next(61, 64), 1f);
|
||||
int stompGore = Gore.NewGore(new Vector2(stompDustArea - 30, npc.position.Y + npc.height - 12f), default, Main.rand.Next(61, 64), 1f);
|
||||
Main.gore[stompGore].velocity *= 0.4f;
|
||||
}
|
||||
}
|
||||
@@ -498,16 +491,16 @@ namespace CalamityMod.NPCs.Ravager
|
||||
|
||||
// Fall through
|
||||
if (npc.target >= 0 && revenge &&
|
||||
((player.position.Y > npc.position.Y + (float)npc.height && npc.velocity.Y > 0f) || (player.position.Y < npc.position.Y + (float)npc.height && npc.velocity.Y < 0f)))
|
||||
((player.position.Y > npc.position.Y + npc.height && npc.velocity.Y > 0f) || (player.position.Y < npc.position.Y + npc.height && npc.velocity.Y < 0f)))
|
||||
npc.noTileCollide = true;
|
||||
else if (!player.dead)
|
||||
npc.noTileCollide = false;
|
||||
|
||||
if (npc.position.X < player.position.X && npc.position.X + (float)npc.width > player.position.X + (float)player.width)
|
||||
if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width)
|
||||
{
|
||||
npc.velocity.X *= 0.9f;
|
||||
|
||||
if (player.position.Y > npc.position.Y + (float)npc.height)
|
||||
if (player.position.Y > npc.position.Y + npc.height)
|
||||
{
|
||||
float fallSpeedBoost = death ? 0.6f : 0.6f * (1f - lifeRatio);
|
||||
float fallSpeed = 0.6f + fallSpeedBoost;
|
||||
@@ -552,11 +545,11 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
|
||||
int distanceFromTarget = 3000;
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > (float)distanceFromTarget)
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > distanceFromTarget)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
player = Main.player[npc.target];
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > (float)distanceFromTarget)
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) + Math.Abs(npc.Center.Y - player.Center.Y) > distanceFromTarget)
|
||||
{
|
||||
npc.active = false;
|
||||
npc.netUpdate = true;
|
||||
@@ -572,9 +565,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Vector2 center = new Vector2(npc.Center.X, npc.Center.Y);
|
||||
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);
|
||||
Vector2 vector = center - Main.screenPosition;
|
||||
vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f;
|
||||
vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Width, ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow").Height / Main.npcFrameCount[npc.type]) * 1f / 2f;
|
||||
vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY);
|
||||
Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Color.Blue);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Ravager/RavagerBodyGlow"), vector,
|
||||
|
||||
@@ -23,8 +23,6 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.Config;
|
||||
using CalamityMod;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
@@ -416,7 +414,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (npc.velocity.Y > 3f)
|
||||
npc.velocity.Y = 3f;
|
||||
@@ -445,7 +443,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -456,18 +454,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
int damage = expertMode ? 200 : 250; //800 500
|
||||
if (bulletHellCounter2 < 300) //blasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else if (bulletHellCounter2 < 600) //blasts from left and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else //blasts from above, left, and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -522,7 +520,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -531,21 +529,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
if (bulletHellCounter2 % 180 == 0) //blasts from top
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200)
|
||||
{
|
||||
if (bulletHellCounter2 % 180 == 0) //blasts from right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
else if (bulletHellCounter2 > 1500)
|
||||
{
|
||||
if (bulletHellCounter2 % 180 == 0) //blasts from top
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
bulletHellCounter += 1;
|
||||
@@ -554,22 +552,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
bulletHellCounter = 0;
|
||||
if (bulletHellCounter2 < 1200) //blasts from below
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else if (bulletHellCounter2 < 1500) //blasts from left
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else //blasts from left and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!startSecondAttack && ((double)npc.life <= (double)npc.lifeMax * 0.75))
|
||||
if (!startSecondAttack && (npc.life <= npc.lifeMax * 0.75))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText4";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -599,18 +597,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int damage = expertMode ? 150 : 200;
|
||||
if (bulletHellCounter2 % 180 == 0) //blasts from top
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
if (bulletHellCounter2 % 240 == 0) //fireblasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
bulletHellCounter += 1;
|
||||
if (bulletHellCounter > (enraged ? 9 : 11))
|
||||
@@ -618,22 +616,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
bulletHellCounter = 0;
|
||||
if (bulletHellCounter2 < 2100) //blasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else if (bulletHellCounter2 < 2400) //blasts from right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else //blasts from left and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!startThirdAttack && ((double)npc.life <= (double)npc.lifeMax * 0.5))
|
||||
if (!startThirdAttack && (npc.life <= npc.lifeMax * 0.5))
|
||||
{
|
||||
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
|
||||
if (calamityModMusic != null)
|
||||
@@ -668,22 +666,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient) //more clustered attack
|
||||
{
|
||||
int damage = expertMode ? 150 : 200;
|
||||
if (bulletHellCounter2 % 180 == 0) //blasts from top
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
if (bulletHellCounter2 % 240 == 0) //fireblasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
if (bulletHellCounter2 % 225 == 0) //giant homing fireballs
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType<BrimstoneMonster>(), damage, 0f, Main.myPlayer, 0f, passedVar);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType<BrimstoneMonster>(), damage, 0f, Main.myPlayer, 0f, passedVar);
|
||||
passedVar += 1f;
|
||||
}
|
||||
bulletHellCounter += 1;
|
||||
@@ -692,22 +690,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
bulletHellCounter = 0;
|
||||
if (bulletHellCounter2 < 3000) //blasts from below
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else if (bulletHellCounter2 < 3300) //blasts from left
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else //blasts from left and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!startFourthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.3))
|
||||
if (!startFourthAttack && (npc.life <= npc.lifeMax * 0.3))
|
||||
{
|
||||
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
|
||||
if (calamityModMusic != null)
|
||||
@@ -742,22 +740,22 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int damage = expertMode ? 150 : 200;
|
||||
if (bulletHellCounter2 % 240 == 0) //blasts from top
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType<BrimstoneGigaBlast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
if (bulletHellCounter2 % 360 == 0) //fireblasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType<BrimstoneFireblast>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-500, 500), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneWave>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-500, 500), -5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneWave>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
bulletHellCounter += 1;
|
||||
if (bulletHellCounter > (enraged ? 12 : 14))
|
||||
@@ -765,24 +763,24 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
bulletHellCounter = 0;
|
||||
if (bulletHellCounter2 < 3900) //blasts from above
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else if (bulletHellCounter2 < 4200) //blasts from left and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
else //blasts from above, left, and right
|
||||
{
|
||||
Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + (float)Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType<BrimstoneHellblast2>(), damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!startFifthAttack && ((double)npc.life <= (double)npc.lifeMax * 0.1))
|
||||
if (!startFifthAttack && (npc.life <= npc.lifeMax * 0.1))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText9";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -817,7 +815,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num = player.Center.X - vectorCenter.X;
|
||||
float num1 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num1, (double)num) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num1, num) - MathHelper.PiOver2;
|
||||
|
||||
if (CalamityWorld.downedSCal) //after first time you kill her
|
||||
{
|
||||
@@ -877,7 +875,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.dontTakeDamage = true;
|
||||
return;
|
||||
}
|
||||
if (!gettingTired5 && ((double)npc.life <= (double)npc.lifeMax * 0.01))
|
||||
if (!gettingTired5 && (npc.life <= npc.lifeMax * 0.01))
|
||||
{
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
{
|
||||
@@ -901,7 +899,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
gettingTired5 = true;
|
||||
return;
|
||||
}
|
||||
else if (!gettingTired4 && ((double)npc.life <= (double)npc.lifeMax * 0.02))
|
||||
else if (!gettingTired4 && (npc.life <= npc.lifeMax * 0.02))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText23";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -916,7 +914,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
gettingTired4 = true;
|
||||
return;
|
||||
}
|
||||
else if (!gettingTired3 && ((double)npc.life <= (double)npc.lifeMax * 0.04))
|
||||
else if (!gettingTired3 && (npc.life <= npc.lifeMax * 0.04))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText22";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -931,7 +929,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
gettingTired3 = true;
|
||||
return;
|
||||
}
|
||||
else if (!gettingTired2 && ((double)npc.life <= (double)npc.lifeMax * 0.06))
|
||||
else if (!gettingTired2 && (npc.life <= npc.lifeMax * 0.06))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText21";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -946,7 +944,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
gettingTired2 = true;
|
||||
return;
|
||||
}
|
||||
else if (!gettingTired && ((double)npc.life <= (double)npc.lifeMax * 0.08))
|
||||
else if (!gettingTired && (npc.life <= npc.lifeMax * 0.08))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText20";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -1008,7 +1006,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
#endregion
|
||||
#region TransformSeekerandBrotherTriggers
|
||||
if (!halfLife && ((double)npc.life <= (double)npc.lifeMax * 0.4))
|
||||
if (!halfLife && (npc.life <= npc.lifeMax * 0.4))
|
||||
{
|
||||
string key = "Mods.CalamityMod.SupremeBossText";
|
||||
Color messageColor = Color.Orange;
|
||||
@@ -1023,7 +1021,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
halfLife = true;
|
||||
}
|
||||
|
||||
if ((double)npc.life <= (double)npc.lifeMax * 0.2)
|
||||
if (npc.life <= npc.lifeMax * 0.2)
|
||||
{
|
||||
if (secondStage == false)
|
||||
{
|
||||
@@ -1054,16 +1052,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
if (bossLife == 0f && npc.life > 0)
|
||||
{
|
||||
bossLife = (float)npc.lifeMax;
|
||||
bossLife = npc.lifeMax;
|
||||
}
|
||||
if (npc.life > 0)
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int num660 = (int)((double)npc.lifeMax * 0.55);
|
||||
if ((float)(npc.life + num660) < bossLife)
|
||||
int num660 = (int)(npc.lifeMax * 0.55);
|
||||
if ((npc.life + num660) < bossLife)
|
||||
{
|
||||
bossLife = (float)npc.life;
|
||||
bossLife = npc.life;
|
||||
NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType<SupremeCataclysm>());
|
||||
NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType<SupremeCatastrophe>());
|
||||
string key = "Mods.CalamityMod.SupremeBossText6";
|
||||
@@ -1082,26 +1080,26 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
#endregion
|
||||
#region TargetandRotation
|
||||
float num801 = npc.position.X + (float)(npc.width / 2) - player.position.X - (float)(player.width / 2);
|
||||
float num802 = npc.position.Y + (float)npc.height - 59f - player.position.Y - (float)(player.height / 2);
|
||||
float num803 = (float)Math.Atan2((double)num802, (double)num801) + 1.57f;
|
||||
float num801 = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2);
|
||||
float num802 = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2);
|
||||
float num803 = (float)Math.Atan2(num802, num801) + MathHelper.PiOver2;
|
||||
|
||||
if (num803 < 0f)
|
||||
num803 += 6.283f;
|
||||
else if ((double)num803 > 6.283)
|
||||
num803 -= 6.283f;
|
||||
num803 += MathHelper.TwoPi;
|
||||
else if (num803 > MathHelper.TwoPi)
|
||||
num803 -= MathHelper.TwoPi;
|
||||
|
||||
float num804 = 0.1f;
|
||||
if (npc.rotation < num803)
|
||||
{
|
||||
if ((double)(num803 - npc.rotation) > 3.1415)
|
||||
if ((num803 - npc.rotation) > MathHelper.Pi)
|
||||
npc.rotation -= num804;
|
||||
else
|
||||
npc.rotation += num804;
|
||||
}
|
||||
else if (npc.rotation > num803)
|
||||
{
|
||||
if ((double)(npc.rotation - num803) > 3.1415)
|
||||
if ((npc.rotation - num803) > MathHelper.Pi)
|
||||
npc.rotation += num804;
|
||||
else
|
||||
npc.rotation -= num804;
|
||||
@@ -1111,9 +1109,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.rotation = num803;
|
||||
|
||||
if (npc.rotation < 0f)
|
||||
npc.rotation += 6.283f;
|
||||
else if ((double)npc.rotation > 6.283)
|
||||
npc.rotation -= 6.283f;
|
||||
npc.rotation += MathHelper.TwoPi;
|
||||
else if (npc.rotation > MathHelper.TwoPi)
|
||||
npc.rotation -= MathHelper.TwoPi;
|
||||
|
||||
if (npc.rotation > num803 - num804 && npc.rotation < num803 + num804)
|
||||
npc.rotation = num803;
|
||||
@@ -1140,7 +1138,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
|
||||
float num740 = player.Center.X - vectorCenter.X;
|
||||
float num741 = player.Center.Y - vectorCenter.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num741, (double)num740) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(num741, num740) - MathHelper.PiOver2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -1241,7 +1239,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
break;
|
||||
}
|
||||
|
||||
npc.ai[1] = (float)phase;
|
||||
npc.ai[1] = phase;
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
}
|
||||
@@ -1252,10 +1250,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num823 = 12f;
|
||||
float num824 = 0.12f;
|
||||
|
||||
Vector2 vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num825 = player.position.X + (float)(player.width / 2) - vector82.X;
|
||||
float num826 = player.position.Y + (float)(player.height / 2) - 550f - vector82.Y;
|
||||
float num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
Vector2 vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num825 = player.position.X + (player.width / 2) - vector82.X;
|
||||
float num826 = player.position.Y + (player.height / 2) - 550f - vector82.Y;
|
||||
float num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
|
||||
num827 = num823 / num827;
|
||||
num825 *= num827;
|
||||
@@ -1297,10 +1295,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num825 = player.position.X + (float)(player.width / 2) - vector82.X;
|
||||
num826 = player.position.Y + (float)(player.height / 2) - vector82.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f;
|
||||
vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num825 = player.position.X + (player.width / 2) - vector82.X;
|
||||
num826 = player.position.Y + (player.height / 2) - vector82.Y;
|
||||
npc.rotation = (float)Math.Atan2(num826, num825) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -1311,11 +1309,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num828 = 10f * uDieLul;
|
||||
int num829 = expertMode ? 150 : 200; //600 400
|
||||
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
float num181 = Math.Abs(num180) * 0.1f;
|
||||
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
|
||||
num183 = num828 / num183;
|
||||
num180 *= num183;
|
||||
@@ -1328,7 +1326,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
canFireSplitingFireball = false;
|
||||
randomShot = ModContent.ProjectileType<BrimstoneFireblast>();
|
||||
num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
num827 = num828 / num827;
|
||||
num825 *= num827;
|
||||
num826 *= num827;
|
||||
@@ -1340,7 +1338,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
canFireSplitingFireball = false;
|
||||
randomShot = ModContent.ProjectileType<BrimstoneGigaBlast>();
|
||||
num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
num827 = num828 / num827;
|
||||
num825 *= num827;
|
||||
num826 *= num827;
|
||||
@@ -1354,10 +1352,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
randomShot = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
for (int num186 = 0; num186 < 8; num186++)
|
||||
{
|
||||
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float speedBoost = (float)(num186 > 3 ? -(num186 - 3) : num186);
|
||||
num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
float speedBoost = num186 > 3 ? -(num186 - 3) : num186;
|
||||
num183 = (8f + speedBoost) / num183;
|
||||
num180 *= num183;
|
||||
num182 *= num183;
|
||||
@@ -1371,21 +1369,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
npc.rotation = num803;
|
||||
float num383 = wormAlive ? 26f : 30f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.95)
|
||||
if (npc.life < npc.lifeMax * 0.95)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.85)
|
||||
if (npc.life < npc.lifeMax * 0.85)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.7)
|
||||
if (npc.life < npc.lifeMax * 0.7)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.6)
|
||||
if (npc.life < npc.lifeMax * 0.6)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.5)
|
||||
if (npc.life < npc.lifeMax * 0.5)
|
||||
num383 += 1f;
|
||||
|
||||
Vector2 vector37 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num384 = player.position.X + (float)(player.width / 2) - vector37.X;
|
||||
float num385 = player.position.Y + (float)(player.height / 2) - vector37.Y;
|
||||
float num386 = (float)Math.Sqrt((double)(num384 * num384 + num385 * num385));
|
||||
Vector2 vector37 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num384 = player.position.X + (player.width / 2) - vector37.X;
|
||||
float num385 = player.position.Y + (player.height / 2) - vector37.Y;
|
||||
float num386 = (float)Math.Sqrt(num384 * num384 + num385 * num385);
|
||||
num386 = num383 / num386;
|
||||
|
||||
if (!canDespawn)
|
||||
@@ -1405,14 +1403,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
npc.velocity *= 0.96f;
|
||||
|
||||
if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1)
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1)
|
||||
if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1)
|
||||
npc.velocity.Y = 0f;
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2;
|
||||
|
||||
if (npc.ai[2] >= 70f)
|
||||
{
|
||||
@@ -1433,13 +1431,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num413 = 1.2f;
|
||||
|
||||
int num414 = 1;
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + player.width)
|
||||
num414 = -1;
|
||||
|
||||
Vector2 vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num415 = player.position.X + (float)(player.width / 2) + (float)(num414 * 600) - vector40.X;
|
||||
float num416 = player.position.Y + (float)(player.height / 2) - vector40.Y;
|
||||
float num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416));
|
||||
Vector2 vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num415 = player.position.X + (player.width / 2) + (num414 * 600) - vector40.X;
|
||||
float num416 = player.position.Y + (player.height / 2) - vector40.Y;
|
||||
float num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416);
|
||||
|
||||
num417 = num412 / num417;
|
||||
num415 *= num417;
|
||||
@@ -1489,16 +1487,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (npc.ai[3] >= 20f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num415 = player.position.X + (float)(player.width / 2) - vector40.X;
|
||||
num416 = player.position.Y + (float)(player.height / 2) - vector40.Y;
|
||||
vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num415 = player.position.X + (player.width / 2) - vector40.X;
|
||||
num416 = player.position.Y + (player.height / 2) - vector40.Y;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float num418 = 10f * uDieLul;
|
||||
int num419 = expertMode ? 150 : 200; //600 500
|
||||
int num420 = ModContent.ProjectileType<BrimstoneHellblast>();
|
||||
num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416));
|
||||
num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416);
|
||||
num417 = num418 / num417;
|
||||
num415 *= num417;
|
||||
num416 *= num417;
|
||||
@@ -1512,16 +1510,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
else if (npc.ai[1] == 4f)
|
||||
{
|
||||
int num831 = 1;
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + player.width)
|
||||
num831 = -1;
|
||||
|
||||
float num832 = 32f;
|
||||
float num833 = 1.2f;
|
||||
|
||||
Vector2 vector83 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num834 = player.position.X + (float)(player.width / 2) + (float)(num831 * 750) - vector83.X; //600
|
||||
float num835 = player.position.Y + (float)(player.height / 2) - vector83.Y;
|
||||
float num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835));
|
||||
Vector2 vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num834 = player.position.X + (player.width / 2) + (num831 * 750) - vector83.X; //600
|
||||
float num835 = player.position.Y + (player.height / 2) - vector83.Y;
|
||||
float num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
|
||||
num836 = num832 / num836;
|
||||
num834 *= num836;
|
||||
@@ -1555,10 +1553,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
vector83 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num834 = player.position.X + (float)(player.width / 2) - vector83.X;
|
||||
num835 = player.position.Y + (float)(player.height / 2) - vector83.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f;
|
||||
vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num834 = player.position.X + (player.width / 2) - vector83.X;
|
||||
num835 = player.position.Y + (player.height / 2) - vector83.Y;
|
||||
npc.rotation = (float)Math.Atan2(num835, num834) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -1569,7 +1567,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num837 = 5f * uDieLul;
|
||||
int num838 = expertMode ? 150 : 200; //600 500
|
||||
int num839 = ModContent.ProjectileType<BrimstoneFireblast>();
|
||||
num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835));
|
||||
num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
num836 = num837 / num836;
|
||||
num834 *= num836;
|
||||
num835 *= num836;
|
||||
@@ -1589,7 +1587,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.4)
|
||||
if (npc.life < npc.lifeMax * 0.4)
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
npc.ai[1] = 0f;
|
||||
@@ -1608,7 +1606,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (npc.ai[0] == 1f)
|
||||
{
|
||||
npc.ai[2] += 0.005f;
|
||||
if ((double)npc.ai[2] > 0.5)
|
||||
if (npc.ai[2] > 0.5)
|
||||
npc.ai[2] = 0.5f;
|
||||
}
|
||||
else
|
||||
@@ -1631,21 +1629,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
else
|
||||
{
|
||||
for (int num388 = 0; num388 < 50; num388++)
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f);
|
||||
|
||||
Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f);
|
||||
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f);
|
||||
|
||||
if (!canDespawn)
|
||||
{
|
||||
npc.velocity *= 0.98f;
|
||||
|
||||
if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1)
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1)
|
||||
if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1)
|
||||
npc.velocity.Y = 0f;
|
||||
}
|
||||
}
|
||||
@@ -1764,7 +1762,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
break;
|
||||
}
|
||||
|
||||
npc.ai[1] = (float)phase;
|
||||
npc.ai[1] = phase;
|
||||
npc.ai[2] = 0f;
|
||||
npc.ai[3] = 0f;
|
||||
}
|
||||
@@ -1775,10 +1773,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num823 = 12f;
|
||||
float num824 = 0.12f;
|
||||
|
||||
Vector2 vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num825 = player.position.X + (float)(player.width / 2) - vector82.X;
|
||||
float num826 = player.position.Y + (float)(player.height / 2) - 550f - vector82.Y;
|
||||
float num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
Vector2 vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num825 = player.position.X + (player.width / 2) - vector82.X;
|
||||
float num826 = player.position.Y + (player.height / 2) - 550f - vector82.Y;
|
||||
float num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
|
||||
num827 = num823 / num827;
|
||||
num825 *= num827;
|
||||
@@ -1821,10 +1819,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
vector82 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num825 = player.position.X + (float)(player.width / 2) - vector82.X;
|
||||
num826 = player.position.Y + (float)(player.height / 2) - vector82.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num826, (double)num825) - 1.57f;
|
||||
vector82 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num825 = player.position.X + (player.width / 2) - vector82.X;
|
||||
num826 = player.position.Y + (player.height / 2) - vector82.Y;
|
||||
npc.rotation = (float)Math.Atan2(num826, num825) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -1835,11 +1833,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num828 = 10f * uDieLul;
|
||||
int num829 = expertMode ? 150 : 200; //600 500
|
||||
|
||||
Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
float num181 = Math.Abs(num180) * 0.1f;
|
||||
float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
|
||||
num183 = num828 / num183;
|
||||
num180 *= num183;
|
||||
@@ -1852,7 +1850,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
canFireSplitingFireball = false;
|
||||
randomShot = ModContent.ProjectileType<BrimstoneFireblast>();
|
||||
num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
num827 = num828 / num827;
|
||||
num825 *= num827;
|
||||
num826 *= num827;
|
||||
@@ -1864,7 +1862,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
canFireSplitingFireball = false;
|
||||
randomShot = ModContent.ProjectileType<BrimstoneGigaBlast>();
|
||||
num827 = (float)Math.Sqrt((double)(num825 * num825 + num826 * num826));
|
||||
num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
num827 = num828 / num827;
|
||||
num825 *= num827;
|
||||
num826 *= num827;
|
||||
@@ -1878,10 +1876,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
randomShot = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
for (int num186 = 0; num186 < 8; num186++)
|
||||
{
|
||||
num180 = player.position.X + (float)player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + (float)player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182));
|
||||
float speedBoost = (float)(num186 > 3 ? -(num186 - 3) : num186);
|
||||
num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
float speedBoost = num186 > 3 ? -(num186 - 3) : num186;
|
||||
num183 = (8f + speedBoost) / num183;
|
||||
num180 *= num183;
|
||||
num182 *= num183;
|
||||
@@ -1895,17 +1893,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
npc.rotation = num803;
|
||||
float num383 = wormAlive ? 31f : 35f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.3)
|
||||
if (npc.life < npc.lifeMax * 0.3)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.2)
|
||||
if (npc.life < npc.lifeMax * 0.2)
|
||||
num383 += 1f;
|
||||
if ((double)npc.life < (double)npc.lifeMax * 0.1)
|
||||
if (npc.life < npc.lifeMax * 0.1)
|
||||
num383 += 1f;
|
||||
|
||||
Vector2 vector37 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num384 = player.position.X + (float)(player.width / 2) - vector37.X;
|
||||
float num385 = player.position.Y + (float)(player.height / 2) - vector37.Y;
|
||||
float num386 = (float)Math.Sqrt((double)(num384 * num384 + num385 * num385));
|
||||
Vector2 vector37 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num384 = player.position.X + (player.width / 2) - vector37.X;
|
||||
float num385 = player.position.Y + (player.height / 2) - vector37.Y;
|
||||
float num386 = (float)Math.Sqrt(num384 * num384 + num385 * num385);
|
||||
num386 = num383 / num386;
|
||||
|
||||
if (!canDespawn)
|
||||
@@ -1925,14 +1923,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
npc.velocity *= 0.96f;
|
||||
|
||||
if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1)
|
||||
if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1)
|
||||
npc.velocity.X = 0f;
|
||||
if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1)
|
||||
if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1)
|
||||
npc.velocity.Y = 0f;
|
||||
}
|
||||
}
|
||||
else
|
||||
npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f;
|
||||
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2;
|
||||
|
||||
if (npc.ai[2] >= 70f)
|
||||
{
|
||||
@@ -1952,13 +1950,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num412 = 32f;
|
||||
float num413 = 1.2f;
|
||||
int num414 = 1;
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + player.width)
|
||||
num414 = -1;
|
||||
|
||||
Vector2 vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num415 = player.position.X + (float)(player.width / 2) + (float)(num414 * 600) - vector40.X;
|
||||
float num416 = player.position.Y + (float)(player.height / 2) - vector40.Y;
|
||||
float num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416));
|
||||
Vector2 vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num415 = player.position.X + (player.width / 2) + (num414 * 600) - vector40.X;
|
||||
float num416 = player.position.Y + (player.height / 2) - vector40.Y;
|
||||
float num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416);
|
||||
|
||||
num417 = num412 / num417;
|
||||
num415 *= num417;
|
||||
@@ -2008,16 +2006,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
if (npc.ai[3] >= 24f)
|
||||
{
|
||||
npc.ai[3] = 0f;
|
||||
vector40 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num415 = player.position.X + (float)(player.width / 2) - vector40.X;
|
||||
num416 = player.position.Y + (float)(player.height / 2) - vector40.Y;
|
||||
vector40 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num415 = player.position.X + (player.width / 2) - vector40.X;
|
||||
num416 = player.position.Y + (player.height / 2) - vector40.Y;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float num418 = 10f * uDieLul;
|
||||
int num419 = expertMode ? 150 : 200; //600 500
|
||||
int num420 = ModContent.ProjectileType<BrimstoneHellblast>();
|
||||
num417 = (float)Math.Sqrt((double)(num415 * num415 + num416 * num416));
|
||||
num417 = (float)Math.Sqrt(num415 * num415 + num416 * num416);
|
||||
num417 = num418 / num417;
|
||||
num415 *= num417;
|
||||
num416 *= num417;
|
||||
@@ -2031,16 +2029,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
else if (npc.ai[1] == 4f)
|
||||
{
|
||||
int num831 = 1;
|
||||
if (npc.position.X + (float)(npc.width / 2) < player.position.X + (float)player.width)
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + player.width)
|
||||
num831 = -1;
|
||||
|
||||
float num832 = 32f;
|
||||
float num833 = 1.2f;
|
||||
|
||||
Vector2 vector83 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
float num834 = player.position.X + (float)(player.width / 2) + (float)(num831 * 750) - vector83.X; //600
|
||||
float num835 = player.position.Y + (float)(player.height / 2) - vector83.Y;
|
||||
float num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835));
|
||||
Vector2 vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num834 = player.position.X + (player.width / 2) + (num831 * 750) - vector83.X; //600
|
||||
float num835 = player.position.Y + (player.height / 2) - vector83.Y;
|
||||
float num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
|
||||
num836 = num832 / num836;
|
||||
num834 *= num836;
|
||||
@@ -2074,10 +2072,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
}
|
||||
|
||||
vector83 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f);
|
||||
num834 = player.position.X + (float)(player.width / 2) - vector83.X;
|
||||
num835 = player.position.Y + (float)(player.height / 2) - vector83.Y;
|
||||
npc.rotation = (float)Math.Atan2((double)num835, (double)num834) - 1.57f;
|
||||
vector83 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
num834 = player.position.X + (player.width / 2) - vector83.X;
|
||||
num835 = player.position.Y + (player.height / 2) - vector83.Y;
|
||||
npc.rotation = (float)Math.Atan2(num835, num834) - MathHelper.PiOver2;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
@@ -2088,7 +2086,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
float num837 = 5f * uDieLul;
|
||||
int num838 = expertMode ? 150 : 200; //600 500
|
||||
int num839 = ModContent.ProjectileType<BrimstoneFireblast>();
|
||||
num836 = (float)Math.Sqrt((double)(num834 * num834 + num835 * num835));
|
||||
num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
num836 = num837 / num836;
|
||||
num834 *= num836;
|
||||
num835 *= num836;
|
||||
@@ -2283,7 +2281,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
Texture2D texture2D15 = npc.ai[0] > 1f ? ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitas2") : Main.npcTexture[npc.type];
|
||||
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 = 7;
|
||||
@@ -2295,16 +2293,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
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 / 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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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 / Main.npcFrameCount[npc.type])) * npc.scale / 2f;
|
||||
vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * 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);
|
||||
|
||||
@@ -2317,9 +2315,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
Color color41 = color37;
|
||||
color41 = Color.Lerp(color41, color36, amount9);
|
||||
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)texture2D15.Width, (float)(texture2D15.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(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f;
|
||||
vector44 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY);
|
||||
spriteBatch.Draw(texture2D15, vector44, npc.frame, color41, npc.rotation, vector11, npc.scale, spriteEffects, 0f);
|
||||
}
|
||||
@@ -2338,12 +2336,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
}
|
||||
if (npc.life <= 0)
|
||||
{
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 100;
|
||||
npc.height = 100;
|
||||
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 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
@@ -2351,7 +2349,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
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 < 70; num623++)
|
||||
|
||||
+188
-197
File diff suppressed because it is too large.
Load diff
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (projectile.timeLeft < 180)
|
||||
projectile.tileCollide = true;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f;
|
||||
|
||||
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 0.5f);
|
||||
Main.dust[num469].noGravity = true;
|
||||
@@ -40,5 +40,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BurningBlood>(), 120);
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 50, 50, projectile.alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
distance += (projectile.ai[1] == 1f ? 2D : 1D);
|
||||
projectile.position.X = startingPosX - (int)(Math.Cos(rad) * distance) - projectile.width / 2;
|
||||
projectile.position.Y = startingPosY - (int)(Math.Sin(rad) * distance) - projectile.height / 2;
|
||||
projectile.ai[0] += 1f;
|
||||
projectile.ai[0] += 0.5f;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
+18
-11
@@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
bool useSin = projectile.ai[0] == 3f;
|
||||
|
||||
WavyMotion(0.1f, 0f, useSin);
|
||||
WavyMotion(0.1f, 0f, useSin, false);
|
||||
|
||||
break;
|
||||
|
||||
@@ -166,9 +166,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
int totalProjectiles = 4;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector = new Vector2(0f, -8f).RotatedBy(MathHelper.PiOver2 * i);
|
||||
Vector2 vector = new Vector2(0f, -8f).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(projectile.Center, vector, projectile.type, projectile.damage, 0f, Main.myPlayer, Main.rand.Next(6), 0f);
|
||||
}
|
||||
}
|
||||
@@ -187,9 +189,11 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
int totalProjectiles = 8;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector = new Vector2(0f, -8f).RotatedBy(MathHelper.PiOver4 * i);
|
||||
Vector2 vector = new Vector2(0f, -8f).RotatedBy(radians * i);
|
||||
Projectile.NewProjectile(projectile.Center, vector, projectile.type, projectile.damage, 0f, Main.myPlayer, Main.rand.Next(2), 0f);
|
||||
}
|
||||
}
|
||||
@@ -207,7 +211,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
bool splitThrice = projectile.timeLeft < 450;
|
||||
|
||||
if (splitOnce)
|
||||
WavyMotion(0.05f, 2f, true);
|
||||
WavyMotion(0.05f, 2f, true, true);
|
||||
|
||||
projectile.localAI[0] += 1f;
|
||||
|
||||
@@ -215,8 +219,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float randomRotation = MathHelper.ToRadians(Main.rand.NextFloat() * 60f);
|
||||
float radians = MathHelper.TwoPi / 3f + randomRotation;
|
||||
int totalProjectiles = 3;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
int spread = 8;
|
||||
|
||||
if (splitOnce)
|
||||
@@ -229,7 +233,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
vector.Normalize();
|
||||
vector *= 3f;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 vector2 = splitOnce ? projectile.velocity.RotatedBy(MathHelper.ToRadians(i * spread)) : new Vector2(0f, -3f).RotatedBy(radians * i);
|
||||
|
||||
@@ -394,7 +398,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
|
||||
private void WavyMotion(float frequency, float amplitude, bool useSin)
|
||||
private void WavyMotion(float frequency, float amplitude, bool useSin, bool waveWithVelocity)
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
@@ -409,7 +413,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
float wavyVelocity = useSin ? (float)Math.Sin(projectile.ai[1]) : (float)Math.Cos(projectile.ai[1]);
|
||||
|
||||
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity).RotatedBy(MathHelper.ToRadians(velocity.ToRotation())) * amplitude;
|
||||
if (waveWithVelocity)
|
||||
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity) * amplitude;
|
||||
else
|
||||
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity).RotatedBy(MathHelper.ToRadians(velocity.ToRotation())) * amplitude;
|
||||
}
|
||||
|
||||
private void LurchForward(float frequncy, float deceleration, float acceleration)
|
||||
|
||||
@@ -20,12 +20,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.height = 10;
|
||||
projectile.penetrate = -1;
|
||||
projectile.hostile = true;
|
||||
projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0.01f, 0.25f, 0.25f);
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
Lighting.AddLight((int)((projectile.position.X + (projectile.width / 2)) / 16f), (int)((projectile.position.Y + (projectile.height / 2)) / 16f), 0.01f, 0.25f, 0.25f);
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f;
|
||||
int num3;
|
||||
for (int num322 = 0; num322 < 2; num322 = num3 + 1)
|
||||
{
|
||||
|
||||
@@ -54,5 +54,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
target.AddBuff(BuffID.Ichor, 180);
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(200, 200, 50, projectile.alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
The Calamity Mod currently adds:
|
||||
|
||||
20+ new bosses
|
||||
A brand new event
|
||||
A lot of new enemies, ores, and items
|
||||
5 new modes for extra challenge
|
||||
6 new biomes and several new structures
|
||||
Buffs and nerfs to certain vanilla features in order to maintain balance
|
||||
Buffs and nerfs to certain vanilla items that were either too weak or too strong
|
||||
Cross-content support for various other mods
|
||||
- 20+ new bosses
|
||||
- A brand new event
|
||||
- A lot of new enemies, ores, and items
|
||||
- 5 new modes for extra challenge
|
||||
- 6 new biomes and several new structures
|
||||
- Buffs and nerfs to certain vanilla features in order to maintain balance
|
||||
- Buffs and nerfs to certain vanilla items that were either too weak or too strong
|
||||
- Cross-content support for various other mods
|
||||
|
||||
PLEASE BE ADVISED:
|
||||
|
||||
|
||||
Reference in new issue
Block a user