Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
mod: lower bonus versus shields (#1214)
Browse files Browse the repository at this point in the history
  • Loading branch information
namidaka authored Jul 30, 2023
1 parent 0731bce commit 3ef360c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Module.Server/Common/Models/CrpgAgentApplyDamageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public override float CalculateDamage(
WeaponClass.OneHandedPolearm,
WeaponClass.TwoHandedPolearm,
};
List<WeaponClass> swordClass = new()
{
WeaponClass.Dagger,
WeaponClass.OneHandedSword,
WeaponClass.TwoHandedSword,
};
float finalDamage = base.CalculateDamage(attackInformation, collisionData, weapon, baseDamage);
if (weapon.IsEmpty)
{
Expand Down Expand Up @@ -65,10 +71,11 @@ public override float CalculateDamage(
if (weapon.CurrentUsageItem.WeaponFlags.HasAnyFlag(WeaponFlags.BonusAgainstShield))
{
// this bonus is on top of the native x2 in MissionCombatMechanicsHelper
// so the final bonus is 3.5. We do this instead of nerfing the impact of shield skill so shield can stay virtually unbreakable against sword.
// so the final bonus is 3.5 for axes and 3 for swords. We do this instead of nerfing the impact of shield skill so shield can stay virtually unbreakable against sword.
// it is the same logic as arrows not dealing a lot of damage to horse but spears dealing extra damage to horses
// As we want archer to fear cavs and cavs to fear spears, we want swords to fear shielders and shielders to fear axes.
finalDamage *= 2f;

finalDamage *= swordClass.Contains(weapon.CurrentUsageItem.WeaponClass) ? 1.5f : 1.75f;
}
}
}
Expand Down

0 comments on commit 3ef360c

Please sign in to comment.