Refactor move attribute logic and add arena trap moves

This commit is contained in:
Flashfyre committed 2023-04-24 14:30:21 -04:00
1 parent 77b3f136dd
commit 92c8583129
9 files changed
+1222 -615

No files matched your search

+1 -4
View File
@@ -65,10 +65,7 @@ export function initAutoPlay() {
let maxEffectiveness = 0.5;
for (let m of attacker.moveset) {
const moveType = m.getMove().type;
const defenderTypes = defender.getTypes();
let effectiveness = getTypeDamageMultiplier(moveType, defenderTypes[0]);
if (defenderTypes.length > 1)
effectiveness *= getTypeDamageMultiplier(moveType, defenderTypes[1]);
const effectiveness = defender.getAttackMoveEffectiveness(moveType);
if (effectiveness > maxEffectiveness)
maxEffectiveness = effectiveness;
}