mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 23:11:11 +00:00
Laser Focus support, with the added BattlerTagTypes to support it (#103)
* Added a new BattlerTagType and support for Laser Focus BattlerTagType.ALWAYS_CRIT * Updated battler-tags to support ALWAYS_CRIT * Added ALWAYS_CRIT = "ALWAYS_CRIT", for the updated battler-tag-type * Updated the crit formula to include the new critAlways * Updated crit logic to include critAlways, fixed indents
This commit is contained in:
parent
dcb4688c76
commit
930c14fa62
@ -956,6 +956,12 @@ export class CritBoostTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AlwaysCritTag extends BattlerTag {
|
||||||
|
constructor(sourceMove: Moves) {
|
||||||
|
super(BattlerTagType.ALWAYS_CRIT, BattlerTagLapseType.TURN_END, 2, sourceMove);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class IgnoreAccuracyTag extends BattlerTag {
|
export class IgnoreAccuracyTag extends BattlerTag {
|
||||||
constructor(sourceMove: Moves) {
|
constructor(sourceMove: Moves) {
|
||||||
super(BattlerTagType.IGNORE_ACCURACY, BattlerTagLapseType.TURN_END, 2, sourceMove);
|
super(BattlerTagType.IGNORE_ACCURACY, BattlerTagLapseType.TURN_END, 2, sourceMove);
|
||||||
@ -1077,6 +1083,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
|
|||||||
return new TypeBoostTag(tagType, sourceMove, Type.FIRE);
|
return new TypeBoostTag(tagType, sourceMove, Type.FIRE);
|
||||||
case BattlerTagType.CRIT_BOOST:
|
case BattlerTagType.CRIT_BOOST:
|
||||||
return new CritBoostTag(tagType, sourceMove);
|
return new CritBoostTag(tagType, sourceMove);
|
||||||
|
case BattlerTagType.ALWAYS_CRIT:
|
||||||
|
return new AlwaysCritTag(tagType, sourceMove);
|
||||||
case BattlerTagType.NO_CRIT:
|
case BattlerTagType.NO_CRIT:
|
||||||
return new BattlerTag(tagType, BattlerTagLapseType.AFTER_MOVE, turnCount, sourceMove);
|
return new BattlerTag(tagType, BattlerTagLapseType.AFTER_MOVE, turnCount, sourceMove);
|
||||||
case BattlerTagType.IGNORE_ACCURACY:
|
case BattlerTagType.IGNORE_ACCURACY:
|
||||||
|
@ -41,6 +41,7 @@ export enum BattlerTagType {
|
|||||||
HIDDEN = "HIDDEN",
|
HIDDEN = "HIDDEN",
|
||||||
FIRE_BOOST = "FIRE_BOOST",
|
FIRE_BOOST = "FIRE_BOOST",
|
||||||
CRIT_BOOST = "CRIT_BOOST",
|
CRIT_BOOST = "CRIT_BOOST",
|
||||||
|
ALWAYS_CRIT = "ALWAYS_CRIT",
|
||||||
NO_CRIT = "NO_CRIT",
|
NO_CRIT = "NO_CRIT",
|
||||||
IGNORE_ACCURACY = "IGNORE_ACCURACY",
|
IGNORE_ACCURACY = "IGNORE_ACCURACY",
|
||||||
BYPASS_SLEEP = "BYPASS_SLEEP",
|
BYPASS_SLEEP = "BYPASS_SLEEP",
|
||||||
|
@ -2300,6 +2300,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
|||||||
case BattlerTagType.PROTECTED:
|
case BattlerTagType.PROTECTED:
|
||||||
case BattlerTagType.FLYING:
|
case BattlerTagType.FLYING:
|
||||||
case BattlerTagType.CRIT_BOOST:
|
case BattlerTagType.CRIT_BOOST:
|
||||||
|
case BattlerTagType.ALWAYS_CRIT:
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2421,6 +2422,21 @@ export class IgnoreAccuracyAttr extends AddBattlerTagAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class AlwaysCritsAttr extends AddBattlerTagAttr {
|
||||||
|
constructor() {
|
||||||
|
super(BattlerTagType.ALWAYS_CRIT, true, false, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
if (!super.apply(user, target, move, args))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
user.scene.queueMessage(getPokemonMessage(user, ` took aim\nat ${target.name}!`));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class FaintCountdownAttr extends AddBattlerTagAttr {
|
export class FaintCountdownAttr extends AddBattlerTagAttr {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(BattlerTagType.PERISH_SONG, false, true, 4);
|
super(BattlerTagType.PERISH_SONG, false, true, 4);
|
||||||
@ -4678,7 +4694,8 @@ export function initMoves() {
|
|||||||
new StatusMove(Moves.TOXIC_THREAD, "Toxic Thread", Type.POISON, 100, 20, "The user shoots poisonous threads to poison the target and lower the target's Speed stat.", 100, 0, 7)
|
new StatusMove(Moves.TOXIC_THREAD, "Toxic Thread", Type.POISON, 100, 20, "The user shoots poisonous threads to poison the target and lower the target's Speed stat.", 100, 0, 7)
|
||||||
.attr(StatusEffectAttr, StatusEffect.POISON)
|
.attr(StatusEffectAttr, StatusEffect.POISON)
|
||||||
.attr(StatChangeAttr, BattleStat.SPD, -1),
|
.attr(StatChangeAttr, BattleStat.SPD, -1),
|
||||||
new SelfStatusMove(Moves.LASER_FOCUS, "Laser Focus (N)", Type.NORMAL, -1, 30, "The user concentrates intensely. The attack on the next turn always results in a critical hit.", -1, 0, 7),
|
new SelfStatusMove(Moves.LASER_FOCUS, "Laser Focus", Type.NORMAL, -1, 30, "The user concentrates intensely. The attack on the next turn always results in a critical hit.", -1, 0, 7)
|
||||||
|
.attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_CRIT, true, false),
|
||||||
new StatusMove(Moves.GEAR_UP, "Gear Up", Type.STEEL, -1, 20, "The user engages its gears to raise the Attack and Sp. Atk stats of ally Pokémon with the Plus or Minus Ability.", -1, 0, 7)
|
new StatusMove(Moves.GEAR_UP, "Gear Up", Type.STEEL, -1, 20, "The user engages its gears to raise the Attack and Sp. Atk stats of ally Pokémon with the Plus or Minus Ability.", -1, 0, 7)
|
||||||
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 1, false, (user, target, move) => [ Abilities.PLUS, Abilities.MINUS ].includes(target.getAbility().id) || (target.canApplyPassive() && [ Abilities.PLUS, Abilities.MINUS ].includes(target.getPassiveAbility().id)))
|
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 1, false, (user, target, move) => [ Abilities.PLUS, Abilities.MINUS ].includes(target.getAbility().id) || (target.canApplyPassive() && [ Abilities.PLUS, Abilities.MINUS ].includes(target.getPassiveAbility().id)))
|
||||||
.target(MoveTarget.USER_AND_ALLIES)
|
.target(MoveTarget.USER_AND_ALLIES)
|
||||||
|
@ -1174,8 +1174,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
power.value *= 1.5;
|
power.value *= 1.5;
|
||||||
let isCritical: boolean;
|
let isCritical: boolean;
|
||||||
const critOnly = new Utils.BooleanHolder(false);
|
const critOnly = new Utils.BooleanHolder(false);
|
||||||
|
const critAlways = source.getTag(BattlerTagType.ALWAYS_CRIT);
|
||||||
applyMoveAttrs(CritOnlyAttr, source, this, move, critOnly);
|
applyMoveAttrs(CritOnlyAttr, source, this, move, critOnly);
|
||||||
if (critOnly.value)
|
if (critOnly.value || critAlways)
|
||||||
isCritical = true;
|
isCritical = true;
|
||||||
else {
|
else {
|
||||||
const critLevel = new Utils.IntegerHolder(0);
|
const critLevel = new Utils.IntegerHolder(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user