mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 23:42:18 +02:00
More Disguise changes and fixes.
Added pokemon battledata abilityTriggered. Disguise conditions now depend on abilityTriggered and if it got hit on the turn. The bug of excess HP is now fixed.
This commit is contained in:
parent
396ddea18d
commit
19e8161b46
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,3 +35,4 @@ src/data/battle-anim-raw-data*.ts
|
|||||||
src/data/battle-anim-data.ts
|
src/data/battle-anim-data.ts
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
|
src/battle-scene.ts
|
||||||
|
@ -61,18 +61,18 @@ import CandyBar from './ui/candy-bar';
|
|||||||
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
||||||
|
|
||||||
export const SEED_OVERRIDE = '';
|
export const SEED_OVERRIDE = '';
|
||||||
export const STARTER_SPECIES_OVERRIDE = 0;
|
export const STARTER_SPECIES_OVERRIDE = 778;
|
||||||
export const STARTER_FORM_OVERRIDE = 0;
|
export const STARTER_FORM_OVERRIDE = 1;
|
||||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
export const STARTING_LEVEL_OVERRIDE = 2000;
|
||||||
export const STARTING_WAVE_OVERRIDE = 0;
|
export const STARTING_WAVE_OVERRIDE = 0;
|
||||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
||||||
export const STARTING_MONEY_OVERRIDE = 0;
|
export const STARTING_MONEY_OVERRIDE = 0;
|
||||||
|
|
||||||
export const ABILITY_OVERRIDE = Abilities.NONE;
|
export const ABILITY_OVERRIDE = Abilities.DISGUISE;
|
||||||
export const MOVE_OVERRIDE = Moves.NONE;
|
export const MOVE_OVERRIDE = Moves.DRAGON_RAGE;
|
||||||
export const OPP_SPECIES_OVERRIDE = 0;
|
export const OPP_SPECIES_OVERRIDE = 778;
|
||||||
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
export const OPP_ABILITY_OVERRIDE = Abilities.MOLD_BREAKER;
|
||||||
export const OPP_MOVE_OVERRIDE = Moves.NONE;
|
export const OPP_MOVE_OVERRIDE = Moves.BITE;
|
||||||
|
|
||||||
const DEBUG_RNG = false;
|
const DEBUG_RNG = false;
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ export class PreDefendMovePowerReductionAbAttr extends ReceivedMoveDamageMultipl
|
|||||||
statUsed = 1;
|
statUsed = 1;
|
||||||
|
|
||||||
(args[0] as Utils.NumberHolder).value = 1 / (statUsed * attacker.getMaxHp());
|
(args[0] as Utils.NumberHolder).value = 1 / (statUsed * attacker.getMaxHp());
|
||||||
|
pokemon.battleData.abilityTriggered = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,21 +436,18 @@ export class PostDefendDisguiseAbAttr extends PostDefendAbAttr {
|
|||||||
|
|
||||||
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
||||||
if (this.condition(pokemon, attacker, move.getMove())) {
|
if (this.condition(pokemon, attacker, move.getMove())) {
|
||||||
|
|
||||||
const damageDealt = attacker.turnData.damageDealt;
|
const damageDealt = attacker.turnData.damageDealt;
|
||||||
const eighthOfMaxHp = Math.ceil(pokemon.getMaxHp() / 8);
|
const eighthOfMaxHp = Math.ceil(pokemon.getMaxHp() / 8);
|
||||||
|
|
||||||
let recoilDamage;
|
let recoilDamage;
|
||||||
|
|
||||||
if (damageDealt < eighthOfMaxHp) {
|
if (damageDealt < eighthOfMaxHp) {
|
||||||
recoilDamage = Math.ceil(eighthOfMaxHp - damageDealt);
|
recoilDamage = eighthOfMaxHp - damageDealt;
|
||||||
} else {
|
} else {
|
||||||
recoilDamage = Math.min(damageDealt - eighthOfMaxHp, pokemon.getMaxHp());
|
recoilDamage = Math.max(eighthOfMaxHp - damageDealt, -1*pokemon.getMaxHp()-eighthOfMaxHp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!recoilDamage) return false;
|
if (!recoilDamage) return false;
|
||||||
pokemon.battleData.hitCount += 1;
|
|
||||||
pokemon.damageAndUpdate(recoilDamage, HitResult.OTHER);
|
pokemon.damageAndUpdate(Math.ceil(recoilDamage), HitResult.OTHER);
|
||||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, '\'s disguise was busted!'));
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, '\'s disguise was busted!'));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2807,12 +2804,12 @@ export function initAbilities() {
|
|||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
.attr(UnsuppressableAbilityAbAttr),
|
.attr(UnsuppressableAbilityAbAttr),
|
||||||
new Ability(Abilities.DISGUISE, "Disguise (P)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7)
|
new Ability(Abilities.DISGUISE, "Disguise (P)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7)
|
||||||
.attr(PreDefendMovePowerReductionAbAttr, (target, user, move) => target.battleData.hitCount === 0 && target.getAttackTypeEffectiveness(move.type) > 0)
|
.attr(PreDefendMovePowerReductionAbAttr, (target, user, move) => target.battleData.abilityTriggered == false && target.getAttackTypeEffectiveness(move.type) > 0)
|
||||||
.attr(PostSummonFormChangeAbAttr, p => p.getFormKey() == `disguised` && p.battleData.hitCount >= 1 ? 1 : p.getFormKey() == `busted` && p.battleData.hitCount >= 1 ? 1 : 0)
|
.attr(PostDefendDisguiseAbAttr, (target, user, move) => target.battleData.abilityTriggered == false && target.turnData.hitCount >= 1 && (move.category == MoveCategory.SPECIAL || move.category == MoveCategory.PHYSICAL))
|
||||||
.attr(PostBattleInitFormChangeAbAttr, p => p.getFormKey() == `disguised` && p.battleData.hitCount >= 1 ? 1 : p.getFormKey() == `busted` && p.battleData.hitCount >= 1 ? 1 : 0)
|
.attr(PostSummonFormChangeAbAttr, p => p.battleData.abilityTriggered == false ? 0 : 1)
|
||||||
.attr(PostDefendFormChangeAbAttr, p => p.getFormKey() == `disguised` && p.battleData.hitCount >= 1 ? 1 : p.getFormKey() == `busted` && p.battleData.hitCount >= 1 ? 1 : 0)
|
.attr(PostBattleInitFormChangeAbAttr, p => p.battleData.abilityTriggered == false ? 0 : 1)
|
||||||
.attr(PreDefendFormChangeAbAttr, p => p.getFormKey() == `disguised` && p.battleData.hitCount >= 1 ? 1 : p.getFormKey() == `busted` && p.battleData.hitCount >= 1 ? 1 : 0)
|
.attr(PostDefendFormChangeAbAttr, p => p.battleData.abilityTriggered == false ? 0 : 1)
|
||||||
.attr(PostDefendDisguiseAbAttr, (target, user, move) => target.battleData.hitCount === 1 && (move.category == MoveCategory.SPECIAL || move.category == MoveCategory.PHYSICAL))
|
.attr(PreDefendFormChangeAbAttr, p => p.battleData.abilityTriggered == false ? 0 : 1)
|
||||||
.attr(UncopiableAbilityAbAttr)
|
.attr(UncopiableAbilityAbAttr)
|
||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
.attr(UnsuppressableAbilityAbAttr)
|
.attr(UnsuppressableAbilityAbAttr)
|
||||||
|
@ -2843,6 +2843,7 @@ 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 abilityTriggered: boolean = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class PokemonBattleSummonData {
|
export class PokemonBattleSummonData {
|
||||||
|
Loading…
Reference in New Issue
Block a user