Skip to content

Commit

Permalink
EiPP Clause fix
Browse files Browse the repository at this point in the history
multihits should trigger EiPP clause for all hits, not just first
  • Loading branch information
Celestia74 committed Nov 9, 2024
1 parent 5835821 commit 0b7c3f8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![npm version](https://img.shields.io/npm/v/@smogon/calc.svg)](https://www.npmjs.com/package/@smogon/calc) 

Damage calculator and soon-to-be multipurpose tool for Everyone is Pokémon Pokémon.
Modified damage calculator for Everyone is Pokémon Pokémon.

Fork of [smogon/damage-calc][0].

Expand Down
3 changes: 3 additions & 0 deletions calc/src/mechanics/gen4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ export function calculateDPP(
newFinalDamage = Math.floor(newFinalDamage * filterMod);
newFinalDamage = Math.floor(newFinalDamage * ebeltMod);
newFinalDamage = Math.floor(newFinalDamage * tintedMod);
if (move.timesUsed! === 1) {
newFinalDamage = Math.floor(newFinalDamage * dwcMod);
}
newFinalDamage = Math.max(1, newFinalDamage);
damageMultiplier++;
return affectedAmount + newFinalDamage;
Expand Down
2 changes: 1 addition & 1 deletion calc/src/mechanics/gen56.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ function calculateFinalModsBWXY(
desc.defenderItem = defender.item;
}

if (typeEffectiveness === 4 && field.defenderSide.isDWC === true && hitCount === 0) {
if (typeEffectiveness === 4 && field.defenderSide.isDWC === true && (move.timesUsed! === 1 || move.timesUsed! >1 && hitCount === 0)) {
finalMods.push(2048);
desc.dwc = true;
}
Expand Down
2 changes: 1 addition & 1 deletion calc/src/mechanics/gen789.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ export function calculateFinalModsSMSSSV(
desc.defenderItem = defender.item;
}

if (typeEffectiveness === 4 && field.defenderSide.isDWC === true && hitCount === 0) {
if (typeEffectiveness === 4 && field.defenderSide.isDWC === true && (move.timesUsed! === 1 || move.timesUsed! >1 && hitCount === 0)) {
finalMods.push(2048);
desc.dwc = true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/base.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,8 @@
<script type="text/javascript" src="./js/moveset_import.js?"></script>
</div>

<div class="credits">Created by Honko, maintained by Austin and Kris <br> EiPP Mod by Celestia
<div class="credits">Created by Honko, maintained by Austin and Kris
<br> EiPP Mod by Celestia </br>
<ul><li><a href="https://github.com/smogon/damage-calc/contributors" class="links-lighten" target="_blank">Contributors</a></li>
<li><a href="https://github.com/Celestia74/eipp-calc" class="links-lighten" target="_blank">GitHub repository</a></li></ul>

Expand Down

0 comments on commit 0b7c3f8

Please sign in to comment.