Skip to content

Commit

Permalink
fix(modificators): fix artillery calculation in heroSkills modificator
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd committed Mar 26, 2022
1 parent e86070c commit a5231e9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/modules/modificators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ export const Modificators = {

heroSkills: (hero: HeroInstance, target: CreatureInstance): CreatureInstance => {
let {
minDamage,
maxDamage,
hits,
calculation: { damageBonus, defenseBonus },
} = target

Expand Down Expand Up @@ -151,18 +150,16 @@ export const Modificators = {
}

if (
(target.id === Creatures.Ballista || target.id === Creatures.Cannon) &&
hero.skills.artillery &&
hero.skills.artillery === 3 &&
(target.id === Creatures.Ballista || target.id === Creatures.Cannon)
hero.skills.artillery === 2
) {
minDamage *= 2
maxDamage *= 2
hits = 2
}

return {
...target,
minDamage,
maxDamage,
hits,
calculation: {
...target.calculation,
damageBonus,
Expand Down

0 comments on commit a5231e9

Please sign in to comment.