Implement False Swipe and Hold Back moves
This commit is contained in:
1 parent
83377713a2
commit
a240a45318
2 files changed
+35
-4
No files matched your search
@@ -2,7 +2,7 @@ import Phaser from 'phaser';
|
||||
import BattleScene, { AnySound } from '../battle-scene';
|
||||
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
||||
import { Moves } from "../data/enums/moves";
|
||||
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove } from "../data/move";
|
||||
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr } from "../data/move";
|
||||
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm } from '../data/pokemon-species';
|
||||
import * as Utils from '../utils';
|
||||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
||||
@@ -1135,6 +1135,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
if (this.scene.arena.terrain?.terrainType === TerrainType.MISTY && this.isGrounded() && move.type === Type.DRAGON)
|
||||
damage.value = Math.floor(damage.value / 2);
|
||||
|
||||
applyMoveAttrs(ModifiedDamageAttr, source, this, move, damage);
|
||||
|
||||
const fixedDamage = new Utils.IntegerHolder(0);
|
||||
applyMoveAttrs(FixedDamageAttr, source, this, move, fixedDamage);
|
||||
if (!isTypeImmune && fixedDamage.value) {
|
||||
@@ -1143,7 +1145,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
result = HitResult.EFFECTIVE;
|
||||
}
|
||||
|
||||
console.log('damage', damage, move.name, power.value, sourceAtk, targetDef);
|
||||
console.log('damage', damage.value, move.name, power.value, sourceAtk, targetDef);
|
||||
|
||||
if (!result) {
|
||||
if (!typeMultiplier.value)
|
||||
|
||||
Reference in new issue
Block a user