Merge 035ba6e47e into c41546b680
commit
d0faaa0a66
|
|
@ -35,4 +35,4 @@ src/data/battle-anim-raw-data*.ts
|
||||||
src/data/battle-anim-data.ts
|
src/data/battle-anim-data.ts
|
||||||
src/overrides.ts
|
src/overrides.ts
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
|
|
|
||||||
|
|
@ -887,6 +887,30 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class PreAttackChangeType extends PreAttackAbAttr{
|
||||||
|
private condition: PokemonAttackCondition;
|
||||||
|
|
||||||
|
constructor (condition:PokemonAttackCondition) {
|
||||||
|
super(true);
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean{
|
||||||
|
const MoveType = move.getMove().type;
|
||||||
|
const originalType = pokemon.getTypes();
|
||||||
|
|
||||||
|
if (this.condition(pokemon,defender,move.getMove())){
|
||||||
|
if (originalType.length > 1 || originalType[0] !== MoveType){
|
||||||
|
pokemon.summonData.types = [MoveType];
|
||||||
|
pokemon.battleSummonData.abilityTriggered = true;
|
||||||
|
pokemon.updateInfo();
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class VariableMoveTypeAbAttr extends AbAttr {
|
export class VariableMoveTypeAbAttr extends AbAttr {
|
||||||
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
//const power = args[0] as Utils.IntegerHolder;
|
//const power = args[0] as Utils.IntegerHolder;
|
||||||
|
|
@ -3144,7 +3168,7 @@ export function initAbilities() {
|
||||||
new Ability(Abilities.CHEEK_POUCH, 6)
|
new Ability(Abilities.CHEEK_POUCH, 6)
|
||||||
.unimplemented(),
|
.unimplemented(),
|
||||||
new Ability(Abilities.PROTEAN, 6)
|
new Ability(Abilities.PROTEAN, 6)
|
||||||
.unimplemented(),
|
.attr(PreAttackChangeType,(user,target,move) => move.id !== Moves.STRUGGLE && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false),
|
||||||
new Ability(Abilities.FUR_COAT, 6)
|
new Ability(Abilities.FUR_COAT, 6)
|
||||||
.attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5)
|
.attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
|
|
@ -3364,7 +3388,7 @@ export function initAbilities() {
|
||||||
new Ability(Abilities.DAUNTLESS_SHIELD, 8)
|
new Ability(Abilities.DAUNTLESS_SHIELD, 8)
|
||||||
.attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true),
|
.attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true),
|
||||||
new Ability(Abilities.LIBERO, 8)
|
new Ability(Abilities.LIBERO, 8)
|
||||||
.unimplemented(),
|
.attr(PreAttackChangeType,(user,target,move) => move.id !== Moves.STRUGGLE && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false),
|
||||||
new Ability(Abilities.BALL_FETCH, 8)
|
new Ability(Abilities.BALL_FETCH, 8)
|
||||||
.unimplemented(),
|
.unimplemented(),
|
||||||
new Ability(Abilities.COTTON_DOWN, 8)
|
new Ability(Abilities.COTTON_DOWN, 8)
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import { TempBattleStat } from '../data/temp-battle-stat';
|
||||||
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag';
|
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag';
|
||||||
import { ArenaTagType } from "../data/enums/arena-tag-type";
|
import { ArenaTagType } from "../data/enums/arena-tag-type";
|
||||||
import { Biome } from "../data/enums/biome";
|
import { Biome } from "../data/enums/biome";
|
||||||
|
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, PreAttackChangeType } from '../data/ability';
|
||||||
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr } from '../data/ability';
|
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr } from '../data/ability';
|
||||||
import { Abilities } from "#app/data/enums/abilities";
|
import { Abilities } from "#app/data/enums/abilities";
|
||||||
import PokemonData from '../system/pokemon-data';
|
import PokemonData from '../system/pokemon-data';
|
||||||
|
|
@ -1256,6 +1257,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
// 2nd argument is for MoveTypeChangePowerMultiplierAbAttr
|
// 2nd argument is for MoveTypeChangePowerMultiplierAbAttr
|
||||||
applyAbAttrs(VariableMoveTypeAbAttr, source, null, variableType, typeChangeMovePowerMultiplier);
|
applyAbAttrs(VariableMoveTypeAbAttr, source, null, variableType, typeChangeMovePowerMultiplier);
|
||||||
applyPreAttackAbAttrs(MoveTypeChangeAttr, source, this, battlerMove, variableType, typeChangeMovePowerMultiplier);
|
applyPreAttackAbAttrs(MoveTypeChangeAttr, source, this, battlerMove, variableType, typeChangeMovePowerMultiplier);
|
||||||
|
applyPreAttackAbAttrs(PreAttackChangeType,source,this,battlerMove,)
|
||||||
const type = variableType.value as Type;
|
const type = variableType.value as Type;
|
||||||
const types = this.getTypes(true, true);
|
const types = this.getTypes(true, true);
|
||||||
|
|
||||||
|
|
@ -3109,12 +3111,13 @@ export class PokemonSummonData {
|
||||||
export class PokemonBattleData {
|
export class PokemonBattleData {
|
||||||
public hitCount: integer = 0;
|
public hitCount: integer = 0;
|
||||||
public endured: boolean = false;
|
public endured: boolean = false;
|
||||||
public berriesEaten: BerryType[] = [];
|
public berriesEaten: BerryType[] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PokemonBattleSummonData {
|
export class PokemonBattleSummonData {
|
||||||
public turnCount: integer = 1;
|
public turnCount: integer = 1;
|
||||||
public moveHistory: TurnMove[] = [];
|
public moveHistory: TurnMove[] = [];
|
||||||
|
public abilityTriggered: boolean = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PokemonTurnData {
|
export class PokemonTurnData {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue