some more code cleanup

This commit is contained in:
termigator1359 committed 2020-03-21 10:57:54 -04:00
1 parent 4560eae442
commit 6c7083ee6f
3 files changed
+17 -17

No files matched your search

+8 -8
View File
@@ -2506,7 +2506,7 @@ namespace CalamityMod.CalPlayer
}
if (sulfurSet && player.controlJump && player.justJumped && player.jumpAgainSandstorm)
{
int bubble = Projectile.NewProjectile(new Vector2(Main.LocalPlayer.position.X, Main.LocalPlayer.position.Y + (Main.LocalPlayer.gravDir == -1f ? 20 : -20)), new Vector2(0f, 0f), ModContent.ProjectileType<SulphuricAcidBubbleFriendly>(), (int)(20f * (player.allDamage + throwingDamage - 1f)), 0f, Main.LocalPlayer.whoAmI, 1f, 0f);
int bubble = Projectile.NewProjectile(new Vector2(Main.LocalPlayer.position.X, Main.LocalPlayer.position.Y + (Main.LocalPlayer.gravDir == -1f ? 20 : -20)), new Vector2(0f, 0f), ModContent.ProjectileType<SulphuricAcidBubbleFriendly>(), (int)(20f * player.RogueDamage()), 0f, Main.LocalPlayer.whoAmI, 1f, 0f);
Main.projectile[bubble].Calamity().forceRogue = true;
}
}
@@ -7015,7 +7015,7 @@ namespace CalamityMod.CalPlayer
Rectangle rect = nPC.getRect();
if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC)))
{
float num = 50f * (player.allDamage + player.meleeDamage - 1f);
float num = 50f * player.MeleeDamage();
float num2 = 3f;
bool crit = false;
if (player.kbGlove)
@@ -7063,7 +7063,7 @@ namespace CalamityMod.CalPlayer
Rectangle rect = nPC.getRect();
if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC)))
{
float num = 1500f * (player.allDamage + player.meleeDamage - 1f);
float num = 1500f * player.MeleeDamage();
float num2 = 15f;
bool crit = false;
if (player.kbGlove)
@@ -7114,7 +7114,7 @@ namespace CalamityMod.CalPlayer
Rectangle rect = nPC.getRect();
if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC)))
{
float num = 500f * (player.allDamage + player.meleeDamage - 1f);
float num = 500f * player.MeleeDamage();
float num2 = 12f;
bool crit = false;
if (player.kbGlove)
@@ -7164,7 +7164,7 @@ namespace CalamityMod.CalPlayer
Rectangle rect = nPC.getRect();
if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC)))
{
float num = 100f * (player.allDamage + player.meleeDamage - 1f);
float num = 100f * player.MeleeDamage();
float num2 = 9f;
bool crit = false;
if (player.kbGlove)
@@ -7902,7 +7902,7 @@ namespace CalamityMod.CalPlayer
rect.Width = 2;
rect.Inflate(6, 12);
float damage = 800f * (player.allDamage + player.minionDamage - 1f);
float damage = 800f * player.MinionDamage();
float knockback = 10f;
int nPCImmuneTime = 30;
int playerImmuneTime = 6;
@@ -7918,7 +7918,7 @@ namespace CalamityMod.CalPlayer
rect2.Width = 2;
rect2.Inflate(6, 12);
float damage2 = 50f * (player.allDamage + player.minionDamage - 1f);
float damage2 = 50f * player.MinionDamage();
float knockback2 = 8f;
int nPCImmuneTime2 = 30;
int playerImmuneTime2 = 6;
@@ -7934,7 +7934,7 @@ namespace CalamityMod.CalPlayer
rect2.Width = 2;
rect2.Inflate(6, 12);
float damage2 = 25f * (player.allDamage + player.minionDamage - 1f);
float damage2 = 25f * player.MinionDamage();
float knockback2 = 5f;
int nPCImmuneTime2 = 30;
int playerImmuneTime2 = 6;
+6 -6
View File
@@ -465,7 +465,7 @@ namespace CalamityMod.Items
{
Vector2 perturbedspeed = new Vector2(correctedVelocity.X, correctedVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread));
Projectile.NewProjectile(player.Center.X, player.Center.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType<ProfanedCrystalMeleeSpear>(), (int)((shouldNerf ? 1000 : 1750) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f);
Projectile.NewProjectile(player.Center.X, player.Center.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType<ProfanedCrystalMeleeSpear>(), (int)((shouldNerf ? 1000 : 1750) * player.MinionDamage()), 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f);
spread -= Main.rand.Next(2, 4);
Main.PlaySound(SoundID.Item20, player.Center);
}
@@ -473,7 +473,7 @@ namespace CalamityMod.Items
}
else
{
Projectile.NewProjectile(player.Center, correctedVelocity * 6.9f, ModContent.ProjectileType<ProfanedCrystalMeleeSpear>(), (int)((shouldNerf ? 500 : 1250) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f);
Projectile.NewProjectile(player.Center, correctedVelocity * 6.9f, ModContent.ProjectileType<ProfanedCrystalMeleeSpear>(), (int)((shouldNerf ? 500 : 1250) * player.MinionDamage()), 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f);
Main.PlaySound(SoundID.Item20, player.Center);
}
@@ -491,7 +491,7 @@ namespace CalamityMod.Items
bool isSmallBoomer = Main.rand.NextDouble() <= (enrage ? 0.2 : 0.3); // 20% chance if enraged, else 30% This is intentional due to literally doubling the amount of projectiles fired.
bool isThiccBoomer = isSmallBoomer && Main.rand.NextDouble() <= 0.05; // 5%
int projType = isSmallBoomer ? isThiccBoomer ? 1 : 2 : 3;
int dam = (int)((shouldNerf ? 500 : 1000) * (player.allDamage + player.minionDamage - 1f));
int dam = (int)((shouldNerf ? 500 : 1000) * player.MinionDamage());
switch (projType)
{
case 1: //big boomer
@@ -530,7 +530,7 @@ namespace CalamityMod.Items
player.statMana -= manaCost;
correctedVelocity *= 25f;
Main.PlaySound(SoundID.Item20, player.Center);
int dam = (int)((shouldNerf ? 1800 : 4500) * (player.allDamage + player.minionDamage - 1f));
int dam = (int)((shouldNerf ? 1800 : 4500) * player.MinionDamage());
if (player.HasBuff(BuffID.ManaSickness))
{
int sickPenalty = (int)(dam * (0.05f * ((player.buffTime[player.FindBuffIndex(BuffID.ManaSickness)] + 60) / 60)));
@@ -555,7 +555,7 @@ namespace CalamityMod.Items
for (float i = 0; i < crystalCount; i++)
{
float angle = MathHelper.TwoPi / crystalCount * i;
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 169 : 880) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, 0f, 0f);
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 169 : 880) * player.MinionDamage()), 1f, player.whoAmI, 0f, 0f);
Main.projectile[proj].Calamity().forceMinion = true;
Main.PlaySound(SoundID.Item20, player.Center);
}
@@ -564,7 +564,7 @@ namespace CalamityMod.Items
else if (player.Calamity().profanedSoulWeaponUsage % (enrage ? 5 : 10) == 0)
{
float angle = MathHelper.TwoPi / (enrage ? 9 : 18) * (player.Calamity().profanedSoulWeaponUsage / (enrage ? 1 : 10));
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 220 : 1100) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, 1f, 0f);
int proj = Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<ProfanedCrystalRogueShard>(), (int)((shouldNerf ? 220 : 1100) * player.MinionDamage()), 1f, player.whoAmI, 1f, 0f);
Main.projectile[proj].Calamity().forceMinion = true;
Main.PlaySound(SoundID.Item20, player.Center);
}
+3 -3
View File
@@ -492,13 +492,13 @@ namespace CalamityMod.Projectiles
{
if (setDamageValues)
{
spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f);
spawnedPlayerMinionDamageValue = player.MinionDamage();
spawnedPlayerMinionProjectileDamageValue = projectile.damage;
setDamageValues = false;
}
if ((player.allDamage + player.minionDamage - 1f) != spawnedPlayerMinionDamageValue)
if (player.MinionDamage() != spawnedPlayerMinionDamageValue)
{
int damage2 = (int)((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue * (player.allDamage + player.minionDamage - 1f));
int damage2 = (int)((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue * player.MinionDamage());
projectile.damage = damage2;
}
}