Skip to content

Commit

Permalink
Fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Apr 7, 2018
1 parent 5e9e7e7 commit 00950dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ModifierPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,11 @@ public class ModifierPlayer : ModPlayer
public int LightStrength; // Light generation
public int LifeRegen; // Health regeneration
public float DodgeChance; // Dodge chance
public float CritDamage = 1f; // Crit damage multiplier
public float CritMulti = 1f; // Crit damage multiplier
public float SurvivalChance; // Chance to survive lethal blow
public float ManaShield; // % of damage redirected to mana
public float PercentDefBoost; // % defense bonus
public float HealthyFoesBonus = 1f; // Damage multiplier vs max life foes
public float HealthyFoesMulti = 1f; // Damage multiplier vs max life foes

// List of current debuff chances. Tuple format is [chance, buffType, buffTime]
// TODO with c#7 we should favor a named tuple (waiting for TML support)
Expand All @@ -495,11 +495,11 @@ public override void ResetEffects()
BonusImmunityTime = 0;
LightStrength = 0;
DodgeChance = 0;
CritDamage = 1f;
CritMulti = 1f;
SurvivalChance = 0;
ManaShield = 0;
PercentDefBoost = 0;
HealthyFoesBonus = 1f;
HealthyFoesMulti = 1f;
DebuffChances.Clear();
}

Expand Down Expand Up @@ -547,12 +547,12 @@ public override void PostUpdateEquips()

private void CritBonus(ref int damage, bool crit)
{
if (crit) damage = (int)(Math.Ceiling(damage * CritDamage));
if (crit) damage = (int)Math.Ceiling(damage * CritMulti);
}

private void HealthyBonus(ref int damage, NPC npc)
{
if (npc.life == npc.lifeMax) damage = (int)(Math.Ceiling(damage * HealthyFoesBonus));
if (npc.life == npc.lifeMax) damage = (int)(Math.Ceiling(damage * HealthyFoesMulti));
}

public override bool PreHurt(bool pvp, bool quiet, ref int damage, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
Expand Down
2 changes: 1 addition & 1 deletion Modifiers/EquipModifiers/CritDamagePlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override ModifierProperties GetModifierProperties(Item item)

public override void UpdateEquip(Item item, Player player)
{
ModifierPlayer.PlayerInfo(player).CritDamage += Properties.RoundedPower;
ModifierPlayer.PlayerInfo(player).CritMulti += Properties.RoundedPower/100f;
}
}
}
2 changes: 1 addition & 1 deletion Modifiers/EquipModifiers/HealthyFoesBonus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override ModifierProperties GetModifierProperties(Item item)

public override void UpdateEquip(Item item, Player player)
{
ModifierPlayer.PlayerInfo(player).HealthyFoesBonus += Properties.RoundedPower / 100;
ModifierPlayer.PlayerInfo(player).HealthyFoesMulti += Properties.RoundedPower / 100;
}
}
}

0 comments on commit 00950dd

Please sign in to comment.