badge of bravery fix

This commit is contained in:
termigator1359 committed 2020-11-06 20:54:17 -05:00
1 parent 733597f3fc
commit d8c2659ea9
2 files changed
+19 -8

No files matched your search

+3 -3
View File
@@ -3564,10 +3564,10 @@ namespace CalamityMod.CalPlayer
float maxDistance = 480f; // 30 tile distance
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance)
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance));
meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
}
+16 -5
View File
@@ -3261,10 +3261,10 @@ namespace CalamityMod.CalPlayer
float maxDistance = 480f; // 30 tile distance
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance)
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
player.meleeDamage += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance));
player.meleeDamage += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
}
@@ -3925,8 +3925,19 @@ namespace CalamityMod.CalPlayer
((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) +
(player.kbGlove ? 0.1 : 0) +
(modPlayer.eGauntlet ? 0.1 : 0) +
(modPlayer.yInsignia ? 0.1 : 0) +
(modPlayer.badgeOfBraveryRare ? 0.2 : 0);
(modPlayer.yInsignia ? 0.1 : 0);
if (modPlayer.badgeOfBraveryRare)
{
float maxDistance = 480f; // 30 tile distance
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC npc = Main.npc[l];
if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance)
{
damageAdd += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance));
}
}
}
modPlayer.trueMeleeDamage += damageAdd;
// Intentionally at the end: Bloodflare Core's defense reduction (after all other boosting effects and whatnot)