mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-12 10:29:30 +02:00
for_draft
This commit is contained in:
parent
79d0862d3f
commit
4094041981
@ -25,7 +25,7 @@ import { Gender } from "./data/gender";
|
|||||||
import { Weather, WeatherType, getRandomWeatherType, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather";
|
import { Weather, WeatherType, getRandomWeatherType, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather";
|
||||||
import { TempBattleStat } from "./data/temp-battle-stat";
|
import { TempBattleStat } from "./data/temp-battle-stat";
|
||||||
import { ArenaTagType, ArenaTrapTag, TrickRoomTag } from "./data/arena-tag";
|
import { ArenaTagType, ArenaTrapTag, TrickRoomTag } from "./data/arena-tag";
|
||||||
import { Abilities, CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability";
|
import { Abilities, CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, StatChangeMultiplierAbAttr, LowerHpWeakerAbAttr, SuppressWeatherEffectAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability";
|
||||||
import { Unlockables, getUnlockableName } from "./system/unlockables";
|
import { Unlockables, getUnlockableName } from "./system/unlockables";
|
||||||
import { getBiomeKey } from "./arena";
|
import { getBiomeKey } from "./arena";
|
||||||
import { BattleType, BattlerIndex, TurnCommand } from "./battle";
|
import { BattleType, BattlerIndex, TurnCommand } from "./battle";
|
||||||
@ -2033,6 +2033,10 @@ export class DamagePhase extends PokemonPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.applyDamage();
|
this.applyDamage();
|
||||||
|
|
||||||
|
const pokemon = this.getPokemon()
|
||||||
|
const stats = this.getPokemon().stats
|
||||||
|
applyAbAttrs(LowerHpWeakerAbAttr,pokemon , null, stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyDamage() {
|
applyDamage() {
|
||||||
|
@ -123,6 +123,29 @@ export class StabBoostAbAttr extends AbAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class LowerHpWeakerAbAttr extends AbAttr {
|
||||||
|
private hpLeft: integer;
|
||||||
|
|
||||||
|
constructor(hpLeft: integer) {
|
||||||
|
super(true)
|
||||||
|
|
||||||
|
this.hpLeft = hpLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(pokemon: Pokemon, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||||
|
const hpRatio = pokemon.getHpRatio();
|
||||||
|
|
||||||
|
if (hpRatio <= this.hpLeft) {
|
||||||
|
args[0] *= 55.5
|
||||||
|
args[1] *= 55.5
|
||||||
|
args[2] *= 55.5
|
||||||
|
args[3] *= 55.5
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class ReceivedTypeDamageMultiplierAbAttr extends PreDefendAbAttr {
|
export class ReceivedTypeDamageMultiplierAbAttr extends PreDefendAbAttr {
|
||||||
private moveType: Type;
|
private moveType: Type;
|
||||||
private powerMultiplier: number;
|
private powerMultiplier: number;
|
||||||
@ -1507,7 +1530,8 @@ export function initAbilities() {
|
|||||||
new Ability(Abilities.CONTRARY, "Contrary", "Makes stat changes have an opposite effect.", 5)
|
new Ability(Abilities.CONTRARY, "Contrary", "Makes stat changes have an opposite effect.", 5)
|
||||||
.attr(StatChangeMultiplierAbAttr, -1),
|
.attr(StatChangeMultiplierAbAttr, -1),
|
||||||
new Ability(Abilities.CURSED_BODY, "Cursed Body (N)", "May disable a move used on the Pokémon.", 5),
|
new Ability(Abilities.CURSED_BODY, "Cursed Body (N)", "May disable a move used on the Pokémon.", 5),
|
||||||
new Ability(Abilities.DEFEATIST, "Defeatist (N)", "Lowers stats when HP drops below half.", 5),
|
new Ability(Abilities.DEFEATIST, "Defeatist", "Lowers stats when HP drops below half.", 5)
|
||||||
|
.attr(LowerHpWeakerAbAttr, 0.5),
|
||||||
new Ability(Abilities.DEFIANT, "Defiant (N)", "Sharply raises Attack when the Pokémon's stats are lowered.", 5),
|
new Ability(Abilities.DEFIANT, "Defiant (N)", "Sharply raises Attack when the Pokémon's stats are lowered.", 5),
|
||||||
new Ability(Abilities.FLARE_BOOST, "Flare Boost (N)", "Powers up special attacks when burned.", 5),
|
new Ability(Abilities.FLARE_BOOST, "Flare Boost (N)", "Powers up special attacks when burned.", 5),
|
||||||
new Ability(Abilities.FRIEND_GUARD, "Friend Guard (N)", "Reduces damage done to allies.", 5),
|
new Ability(Abilities.FRIEND_GUARD, "Friend Guard (N)", "Reduces damage done to allies.", 5),
|
||||||
|
@ -39,7 +39,7 @@ export enum FieldPosition {
|
|||||||
RIGHT
|
RIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
const ABILITY_OVERRIDE = Abilities.NONE;
|
const ABILITY_OVERRIDE = Abilities.DEFEATIST;
|
||||||
const MOVE_OVERRIDE = Moves.NONE;
|
const MOVE_OVERRIDE = Moves.NONE;
|
||||||
|
|
||||||
const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user