This commit is contained in:
Ozzatron committed 2021-02-10 19:28:38 -05:00
commit 29f276dbef
17 files changed
+74 -139

No files matched your search

+12 -5
View File
@@ -1625,10 +1625,17 @@ namespace CalamityMod.NPCs
// DR applies after vanilla defense.
damage = ApplyDR(npc, damage, yellowCandleDamage);
// Cancel out vanilla defense math by reversing the calculation vanilla is about to perform.
// While roundabout, this is safer than returning false to stop vanilla damage calculations entirely.
// Other mods will probably expect the vanilla code to run and may compensate for it themselves.
damage = Main.CalculateDamage((int)damage, -defense);
// Inflict 0 damage if it's below 0.5
damage = damage < 0.5 ? 0D : damage < 1D ? 1D : damage;
// Disable vanilla damage method if damage is less than 0.5
if (damage == 0D)
return false;
// Cancel out vanilla defense math by reversing the calculation vanilla is about to perform.
// While roundabout, this is safer than returning false to stop vanilla damage calculations entirely.
// Other mods will probably expect the vanilla code to run and may compensate for it themselves.
damage = Main.CalculateDamage((int)damage, -defense);
return true;
}
@@ -1689,7 +1696,7 @@ namespace CalamityMod.NPCs
}
double newDamage = (1f - effectiveDR) * damage;
return newDamage < 0.5 ? 0D : newDamage < 1D ? 1D : newDamage;
return newDamage;
}
private float DefaultDRMath(NPC npc, float DR)
-95
View File
@@ -204,31 +204,6 @@ namespace CalamityMod.NPCs.Ravager
rightDustExpr2.velocity.Y -= 4f;
}
}
if (!finalPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[1] += enrage ? 6f : 1f;
if (npc.localAI[1] >= 600f)
{
npc.localAI[1] = 0f;
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
{
float velocity = BossRushEvent.BossRushActive ? 10f : 7f;
int totalProjectiles = 8;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ProjectileID.EyeBeam;
int damage = npc.GetProjectileDamage(type);
for (int i = 0; i < totalProjectiles; i++)
{
Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i);
Projectile.NewProjectile(npc.Center, vector255, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
}
}
}
}
}
}
if (!rightClawActive)
@@ -252,24 +227,6 @@ namespace CalamityMod.NPCs.Ravager
rightDustExpr2.velocity.X += 4f;
}
}
if (!finalPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[2] += enrage ? 2f : 1f;
if (npc.localAI[2] >= 480f)
{
Main.PlaySound(SoundID.Item20, npc.position);
npc.localAI[2] = 0f;
Vector2 shootFromVector = new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f);
int type = ProjectileID.Fireball;
int damage = npc.GetProjectileDamage(type);
float velocity = BossRushEvent.BossRushActive ? 18f : 12f;
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
}
}
}
}
if (!leftClawActive)
@@ -292,24 +249,6 @@ namespace CalamityMod.NPCs.Ravager
leftDustExpr2.velocity.X -= 4f;
}
}
if (!finalPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.localAI[3] += enrage ? 2f : 1f;
if (npc.localAI[3] >= 480f)
{
Main.PlaySound(SoundID.Item20, npc.position);
npc.localAI[3] = 0f;
Vector2 shootFromVector = new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f);
int type = ProjectileID.Fireball;
int damage = npc.GetProjectileDamage(type);
float velocity = BossRushEvent.BossRushActive ? -18f : -12f;
Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, velocity, 0f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
}
}
}
}
if (!rightLegActive)
@@ -332,23 +271,6 @@ namespace CalamityMod.NPCs.Ravager
rightDustExpr2.velocity.Y += 1f;
}
}
if (!finalPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.ai[2] += 1f;
if (npc.ai[2] >= 300f)
{
npc.ai[2] = 0f;
Vector2 shootFromVector = new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f);
int type = ProjectileID.GreekFire1;
int damage = npc.GetProjectileDamage(type);
int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, type + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
Main.projectile[fire].timeLeft = 180;
}
}
}
}
if (!leftLegActive)
@@ -372,23 +294,6 @@ namespace CalamityMod.NPCs.Ravager
leftDustExpr2.velocity.Y += 1f;
}
}
if (!finalPhase)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
npc.ai[3] += 1f;
if (npc.ai[3] >= 300f)
{
npc.ai[3] = 0f;
Vector2 shootFromVector = new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f);
int type = ProjectileID.GreekFire1;
int damage = npc.GetProjectileDamage(type);
int fire = Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, 0f, 2f, type + Main.rand.Next(3), damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f);
Main.projectile[fire].timeLeft = 180;
}
}
}
}
if (npc.ai[0] == 0f)
+2 -2
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 30; num621++)
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 60; num623++)
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].velocity *= 5f;
+2 -2
View File
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
for (int num621 = 0; num621 < 30; num621++)
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
@@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 60; num623++)
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
+21 -6
View File
@@ -50,8 +50,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
timeElapsed += 0.02;
projectile.velocity.X = (float)(Math.Sin(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize);
projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize);
projectile.velocity.X = (float)(Math.Sin(timeElapsed * (0.5f * projectile.ai[0])) * circleSize);
projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (0.5f * projectile.ai[0])) * circleSize);
circleSize += circleGrowth;
projectile.frameCounter++;
if (projectile.frameCounter > 4)
@@ -88,10 +88,25 @@ namespace CalamityMod.Projectiles.Boss
public override void Kill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f);
}
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
Main.dust[num622].noGravity = true;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
+20 -7
View File
@@ -61,9 +61,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.frameCounter = 0;
}
if (projectile.frame > 5)
{
projectile.frame = 0;
}
if (start)
{
@@ -103,10 +101,25 @@ namespace CalamityMod.Projectiles.Boss
public override void Kill(int timeLeft)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f);
}
}
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
Main.dust[num622].noGravity = true;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
}
}
}
+2 -2
View File
@@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
for (int num621 = 0; num621 < 30; num621++)
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 60; num623++)
for (int num623 = 0; num623 < 20; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
+2 -2
View File
@@ -105,11 +105,11 @@ namespace CalamityMod.Projectiles.Boss
}
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyBlastImpact"), projectile.Center);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num193 = 0; num193 < 6; num193++)
for (int num193 = 0; num193 < 4; num193++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
}
for (int num194 = 0; num194 < 60; num194++)
for (int num194 = 0; num194 < 40; num194++)
{
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
Main.dust[num195].noGravity = true;
+2 -2
View File
@@ -100,11 +100,11 @@ namespace CalamityMod.Projectiles.Boss
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num193 = 0; num193 < 3; num193++)
for (int num193 = 0; num193 < 2; num193++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
}
for (int num194 = 0; num194 < 30; num194++)
for (int num194 = 0; num194 < 20; num194++)
{
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
Main.dust[num195].noGravity = true;
+2 -2
View File
@@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss
Main.PlaySound(SoundID.Item14, projectile.Center);
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 50);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int d = 0; d < 10; d++)
for (int d = 0; d < 5; d++)
{
int holy = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f);
Main.dust[holy].velocity *= 3f;
@@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[holy].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int d = 0; d < 15; d++)
for (int d = 0; d < 8; d++)
{
int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 3f);
Main.dust[fire].noGravity = true;
+2 -2
View File
@@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.height = 50;
projectile.position.X = projectile.position.X - (projectile.width / 2);
projectile.position.Y = projectile.position.Y - (projectile.height / 2);
for (int num621 = 0; num621 < 10; num621++)
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
@@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 15; num623++)
for (int num623 = 0; num623 < 8; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
+1 -1
View File
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
public override void Kill(int timeLeft)
{
int num497 = 10;
int num497 = 5;
Main.PlaySound(SoundID.Item27, projectile.position);
int num3;
for (int num498 = 0; num498 < num497; num498 = num3 + 1)
+1 -1
View File
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<IceRain>(), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f);
}
}
for (int k = 0; k < 3; k++)
for (int k = 0; k < 10; k++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
+2 -2
View File
@@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Boss
{
Main.PlaySound(SoundID.Item14, projectile.position);
projectile.Damage();
for (int num621 = 0; num621 < 20; num621++)
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
@@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 30; num623++)
for (int num623 = 0; num623 < 15; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
+2 -2
View File
@@ -119,11 +119,11 @@ namespace CalamityMod.Projectiles.Boss
Main.PlaySound(SoundID.Item20, projectile.Center);
int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither;
for (int num193 = 0; num193 < 3; num193++)
for (int num193 = 0; num193 < 2; num193++)
{
Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1.5f);
}
for (int num194 = 0; num194 < 30; num194++)
for (int num194 = 0; num194 < 20; num194++)
{
int num195 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 2.5f);
Main.dust[num195].noGravity = true;
+1 -3
View File
@@ -35,9 +35,7 @@ namespace CalamityMod.Projectiles.Ranged
if (projectile.timeLeft % 60 == 0)
{
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(projectile.Center, projectile.velocity * 0.25f, ModContent.ProjectileType<VanquisherArrowSplit>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
}
Projectile.NewProjectile(projectile.Center, projectile.velocity * 0.25f, ModContent.ProjectileType<VanquisherArrowSplit>(), projectile.damage, projectile.knockBack, projectile.owner);
}
}
-3
View File
@@ -674,9 +674,6 @@ namespace CalamityMod
{ new Tuple<int, int>(NPCID.DukeFishron, ProjectileID.Sharknado), new int[] { 80, 100, 116, 124, 174 } }, // 150 in non-rev master mode
{ new Tuple<int, int>(NPCID.DukeFishron, ProjectileID.Cthulunado), new int[] { 160, 200, 232, 248, 348 } }, // 300 in non-rev master mode
{ new Tuple<int, int>(ModContent.NPCType<RavagerBody>(), ProjectileID.EyeBeam), new int[] { 90, 144, 172, 188, 258 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerBody>(), ProjectileID.Fireball), new int[] { 80, 136, 160, 180, 240 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerBody>(), ProjectileID.GreekFire1), new int[] { 70, 128, 148, 172, 222 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead>(), ModContent.ProjectileType<ScavengerNuke>()), new int[] { 120, 180, 208, 224, 312 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead2>(), ModContent.ProjectileType<ScavengerLaser>()), new int[] { 80, 136, 160, 180, 240 } },
{ new Tuple<int, int>(ModContent.NPCType<RavagerHead2>(), ModContent.ProjectileType<ScavengerNuke>()), new int[] { 120, 180, 208, 224, 312 } },