Fix fusion types not factoring into damage

pull/12/head
Flashfyre 2023-12-01 18:23:51 -05:00
parent ab344cd82a
commit 167fb5110b
1 changed files with 5 additions and 3 deletions

View File

@ -835,9 +835,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let damage = new Utils.NumberHolder(0); let damage = new Utils.NumberHolder(0);
const cancelled = new Utils.BooleanHolder(false); const cancelled = new Utils.BooleanHolder(false);
const typeless = !!move.getAttrs(TypelessAttr).length const typeless = !!move.getAttrs(TypelessAttr).length;
const types = this.getTypes();
const typeMultiplier = new Utils.NumberHolder(!typeless && moveCategory !== MoveCategory.STATUS const typeMultiplier = new Utils.NumberHolder(!typeless && moveCategory !== MoveCategory.STATUS
? getTypeDamageMultiplier(move.type, this.getSpeciesForm().type1) * (this.getSpeciesForm().type2 !== null ? getTypeDamageMultiplier(move.type, this.getSpeciesForm().type2) : 1) ? getTypeDamageMultiplier(move.type, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(move.type, types[1]) : 1)
: 1); : 1);
if (typeless) if (typeless)
typeMultiplier.value = 1; typeMultiplier.value = 1;
@ -879,7 +880,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
const sourceAtk = source.getBattleStat(isPhysical ? Stat.ATK : Stat.SPATK, this); const sourceAtk = source.getBattleStat(isPhysical ? Stat.ATK : Stat.SPATK, this);
const targetDef = this.getBattleStat(isPhysical ? Stat.DEF : Stat.SPDEF, source); const targetDef = this.getBattleStat(isPhysical ? Stat.DEF : Stat.SPDEF, source);
const stabMultiplier = new Utils.NumberHolder(source.species.type1 === move.type || (source.species.type2 !== null && source.species.type2 === move.type) ? 1.5 : 1); const sourceTypes = source.getTypes();
const stabMultiplier = new Utils.NumberHolder(sourceTypes[0] === move.type || (sourceTypes.length > 1 && sourceTypes[1] === move.type) ? 1.5 : 1);
const criticalMultiplier = isCritical ? 2 : 1; const criticalMultiplier = isCritical ? 2 : 1;
const isTypeImmune = (typeMultiplier.value * weatherTypeMultiplier) === 0; const isTypeImmune = (typeMultiplier.value * weatherTypeMultiplier) === 0;