mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
Redundant code :despair:
This commit is contained in:
parent
45aa8f1e21
commit
891ee0482f
@ -4198,10 +4198,12 @@ export class BlockRedirectAbAttr extends AbAttr { }
|
|||||||
* @see {@linkcode apply}
|
* @see {@linkcode apply}
|
||||||
*/
|
*/
|
||||||
export class ReduceStatusEffectDurationAbAttr extends AbAttr {
|
export class ReduceStatusEffectDurationAbAttr extends AbAttr {
|
||||||
constructor(
|
private statusEffect: StatusEffect;
|
||||||
private statusEffect: StatusEffect
|
|
||||||
) {
|
constructor(statusEffect: StatusEffect) {
|
||||||
super(true);
|
super(true);
|
||||||
|
|
||||||
|
this.statusEffect = statusEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2037,13 +2037,16 @@ export class WaterShurikenMultiHitTypeAttr extends ChangeMultiHitTypeAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class StatusEffectAttr extends MoveEffectAttr {
|
export class StatusEffectAttr extends MoveEffectAttr {
|
||||||
constructor(
|
public effect: StatusEffect;
|
||||||
public effect: StatusEffect,
|
public turnsRemaining?: number;
|
||||||
selfTarget?: boolean,
|
public overrideStatus: boolean = false;
|
||||||
public turnsRemaining?: number,
|
|
||||||
public overrideStatus: boolean = false
|
constructor(effect: StatusEffect, selfTarget?: boolean, turnsRemaining?: number, overrideStatus: boolean = false) {
|
||||||
) {
|
|
||||||
super(selfTarget, MoveEffectTrigger.HIT);
|
super(selfTarget, MoveEffectTrigger.HIT);
|
||||||
|
|
||||||
|
this.effect = effect;
|
||||||
|
this.turnsRemaining = turnsRemaining;
|
||||||
|
this.overrideStatus = overrideStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
@ -5,12 +5,16 @@ import i18next, { ParseKeys } from "i18next";
|
|||||||
export { StatusEffect };
|
export { StatusEffect };
|
||||||
|
|
||||||
export class Status {
|
export class Status {
|
||||||
constructor(
|
public effect: StatusEffect;
|
||||||
public effect: StatusEffect,
|
|
||||||
/** Toxic damage is `1/16 max HP * toxicTurnCount` */
|
/** Toxic damage is `1/16 max HP * toxicTurnCount` */
|
||||||
public toxicTurnCount: number = 0,
|
public toxicTurnCount: number = 0;
|
||||||
public sleepTurnsRemaining?: number
|
public sleepTurnsRemaining?: number;
|
||||||
) {}
|
|
||||||
|
constructor(effect: StatusEffect, toxicTurnCount: number = 0, sleepTurnsRemaining?: number) {
|
||||||
|
this.effect = effect;
|
||||||
|
this.toxicTurnCount = toxicTurnCount;
|
||||||
|
this.sleepTurnsRemaining = sleepTurnsRemaining;
|
||||||
|
}
|
||||||
|
|
||||||
incrementTurn(): void {
|
incrementTurn(): void {
|
||||||
this.toxicTurnCount++;
|
this.toxicTurnCount++;
|
||||||
|
@ -8,16 +8,18 @@ import { getPokemonNameWithAffix } from "#app/messages";
|
|||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
|
|
||||||
export class ObtainStatusEffectPhase extends PokemonPhase {
|
export class ObtainStatusEffectPhase extends PokemonPhase {
|
||||||
|
private statusEffect?: StatusEffect;
|
||||||
|
private turnsRemaining?: number;
|
||||||
|
private sourceText?: string | null;
|
||||||
|
private sourcePokemon?: Pokemon | null;
|
||||||
|
|
||||||
constructor(
|
constructor(scene: BattleScene, battlerIndex: BattlerIndex, statusEffect?: StatusEffect, turnsRemaining?: number, sourceText?: string | null, sourcePokemon?: Pokemon | null) {
|
||||||
scene: BattleScene,
|
|
||||||
battlerIndex: BattlerIndex,
|
|
||||||
private statusEffect?: StatusEffect,
|
|
||||||
private turnsRemaining?: number,
|
|
||||||
private sourceText?: string | null,
|
|
||||||
private sourcePokemon?: Pokemon | null
|
|
||||||
) {
|
|
||||||
super(scene, battlerIndex);
|
super(scene, battlerIndex);
|
||||||
|
|
||||||
|
this.statusEffect = statusEffect;
|
||||||
|
this.turnsRemaining = turnsRemaining;
|
||||||
|
this.sourceText = sourceText;
|
||||||
|
this.sourcePokemon = sourcePokemon;
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
Loading…
Reference in New Issue
Block a user