mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
Update move.ts
This commit is contained in:
parent
5a6ec181a2
commit
542944daf7
@ -1163,12 +1163,12 @@ export class FixedDamageAttr extends MoveAttr {
|
||||
}
|
||||
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
(args[0] as Utils.IntegerHolder).value = this.getDamage(user, target, move, args[1], args[2]);
|
||||
(args[0] as Utils.IntegerHolder).value = this.getDamage(user, target, move);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
getDamage(user: Pokemon, target: Pokemon, move: Move, extra1?: any, extra2?: any): integer {
|
||||
getDamage(user: Pokemon, target: Pokemon, move: Move): integer {
|
||||
return this.damage;
|
||||
}
|
||||
}
|
||||
@ -1269,7 +1269,7 @@ export class RandomLevelDamageAttr extends FixedDamageAttr {
|
||||
if (isHigh) {
|
||||
return Utils.toDmgValue(user.level * 1.5);
|
||||
}
|
||||
return Utils.toDmgValue(user.level * (user.randSeedIntRange(50, 150, "Random damage") * 0.01));
|
||||
return Utils.toDmgValue(user.level * (user.randSeedIntRange(50, 150, "Random Damage") * 0.01));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1980,13 +1980,6 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (user !== target && target.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)) {
|
||||
if (move.category === MoveCategory.STATUS) {
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target)}));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if ((!pokemon.status || (pokemon.status.effect === this.effect && moveChance < 0))
|
||||
&& pokemon.trySetStatus(this.effect, true, user, this.cureTurn)) {
|
||||
applyPostAttackAbAttrs(ConfusionOnStatusEffectAbAttr, user, target, move, null, false, this.effect);
|
||||
@ -4717,17 +4710,6 @@ export class ConfuseAttr extends AddBattlerTagAttr {
|
||||
constructor(selfTarget?: boolean) {
|
||||
super(BattlerTagType.CONFUSED, selfTarget, false, 2, 5);
|
||||
}
|
||||
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (!this.selfTarget && target.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)) {
|
||||
if (move.category === MoveCategory.STATUS) {
|
||||
user.scene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target)}));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.apply(user, target, move, args);
|
||||
}
|
||||
}
|
||||
|
||||
export class RechargeAttr extends AddBattlerTagAttr {
|
||||
@ -6106,57 +6088,6 @@ export class DestinyBondAttr extends MoveEffectAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute to apply a battler tag to the target if they have had their stats boosted this turn.
|
||||
* @extends AddBattlerTagAttr
|
||||
*/
|
||||
export class AddBattlerTagIfBoostedAttr extends AddBattlerTagAttr {
|
||||
constructor(tag: BattlerTagType) {
|
||||
super(tag, false, false, 2, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param user {@linkcode Pokemon} using this move
|
||||
* @param target {@linkcode Pokemon} target of this move
|
||||
* @param move {@linkcode Move} being used
|
||||
* @param {any[]} args N/A
|
||||
* @returns true
|
||||
*/
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (target.turnData.battleStatsIncreased) {
|
||||
super.apply(user, target, move, args);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute to apply a status effect to the target if they have had their stats boosted this turn.
|
||||
* @extends MoveEffectAttr
|
||||
*/
|
||||
export class StatusIfBoostedAttr extends MoveEffectAttr {
|
||||
public effect: StatusEffect;
|
||||
|
||||
constructor(effect: StatusEffect) {
|
||||
super(true, MoveEffectTrigger.HIT);
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param user {@linkcode Pokemon} using this move
|
||||
* @param target {@linkcode Pokemon} target of this move
|
||||
* @param move {@linkcode Move} N/A
|
||||
* @param {any[]} args N/A
|
||||
* @returns true
|
||||
*/
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (target.turnData.battleStatsIncreased) {
|
||||
target.trySetStatus(this.effect, true, user);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class LastResortAttr extends MoveAttr {
|
||||
getCondition(): MoveConditionFunc {
|
||||
return (user: Pokemon, target: Pokemon, move: Move) => {
|
||||
@ -7083,7 +7014,7 @@ export function initMoves() {
|
||||
.attr(FriendshipPowerAttr, true),
|
||||
new StatusMove(Moves.SAFEGUARD, Type.NORMAL, -1, 25, -1, 0, 2)
|
||||
.target(MoveTarget.USER_SIDE)
|
||||
.attr(AddArenaTagAttr, ArenaTagType.SAFEGUARD, 5, true, true),
|
||||
.unimplemented(),
|
||||
new StatusMove(Moves.PAIN_SPLIT, Type.NORMAL, -1, 20, -1, 0, 2)
|
||||
.attr(HpSplitAttr)
|
||||
.condition(failOnBossCondition),
|
||||
@ -7272,7 +7203,7 @@ export function initMoves() {
|
||||
.attr(RemoveScreensAttr),
|
||||
new StatusMove(Moves.YAWN, Type.NORMAL, -1, 10, -1, 0, 3)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.DROWSY, false, true)
|
||||
.condition((user, target, move) => !target.status && !target.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)),
|
||||
.condition((user, target, move) => !target.status),
|
||||
new AttackMove(Moves.KNOCK_OFF, Type.DARK, MoveCategory.PHYSICAL, 65, 100, 20, -1, 0, 3)
|
||||
.attr(MovePowerMultiplierAttr, (user, target, move) => target.getHeldItems().filter(i => i.isTransferrable).length > 0 ? 1.5 : 1)
|
||||
.attr(RemoveHeldItemAttr, false),
|
||||
@ -8622,7 +8553,7 @@ export function initMoves() {
|
||||
.partial(),
|
||||
new SelfStatusMove(Moves.NO_RETREAT, Type.FIGHTING, -1, 5, -1, 0, 8)
|
||||
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD ], 1, true)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.NO_RETREAT, true, false)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, true, false, 1)
|
||||
.condition((user, target, move) => user.getTag(TrappedTag)?.sourceMove !== Moves.NO_RETREAT), // fails if the user is currently trapped by No Retreat
|
||||
new StatusMove(Moves.TAR_SHOT, Type.ROCK, 100, 15, -1, 0, 8)
|
||||
.attr(StatChangeAttr, BattleStat.SPD, -1)
|
||||
@ -8814,10 +8745,10 @@ export function initMoves() {
|
||||
new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)
|
||||
.attr(StatChangeAttr, BattleStat.SPATK, -1),
|
||||
new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8)
|
||||
.attr(StatusIfBoostedAttr, StatusEffect.BURN)
|
||||
.target(MoveTarget.ALL_NEAR_ENEMIES),
|
||||
.target(MoveTarget.ALL_NEAR_ENEMIES)
|
||||
.partial(),
|
||||
new AttackMove(Moves.LASH_OUT, Type.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8)
|
||||
.attr(MovePowerMultiplierAttr, (user, target, move) => user.turnData.battleStatsDecreased ? 2 : 1),
|
||||
.partial(),
|
||||
new AttackMove(Moves.POLTERGEIST, Type.GHOST, MoveCategory.PHYSICAL, 110, 90, 5, -1, 0, 8)
|
||||
.attr(AttackedByItemAttr)
|
||||
.makesContact(false),
|
||||
@ -9263,11 +9194,12 @@ export function initMoves() {
|
||||
new AttackMove(Moves.HARD_PRESS, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 9)
|
||||
.attr(OpponentHighHpPowerAttr, 100),
|
||||
new StatusMove(Moves.DRAGON_CHEER, Type.DRAGON, -1, 15, -1, 0, 9)
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.DRAGON_CHEER, false, true)
|
||||
.target(MoveTarget.NEAR_ALLY),
|
||||
.attr(AddBattlerTagAttr, BattlerTagType.CRIT_BOOST, false, true)
|
||||
.target(MoveTarget.NEAR_ALLY)
|
||||
.partial(),
|
||||
new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9)
|
||||
.attr(AddBattlerTagIfBoostedAttr, BattlerTagType.CONFUSED)
|
||||
.soundBased(),
|
||||
.soundBased()
|
||||
.partial(),
|
||||
new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9)
|
||||
.attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result === MoveResult.MISS || user.getLastXMoves(2)[1]?.result === MoveResult.FAIL ? 2 : 1),
|
||||
new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9)
|
||||
|
Loading…
Reference in New Issue
Block a user