mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-06 08:07:42 +00:00
7e003d68a9
* initial implementation * updated logic * reverse retTint * added candy overlays and colors * added settings and minor fixes * german changes * logic fix * german changes pt2 * german changes pt3 * setting name changed * Update battle-scene.ts * initial animation implementation * minor fixes * main compatibility * minor fix * logic for animations * eslint fixes * final generation logic * Pause Animation when Selected or Purchased * Disable Indicator if not Root Species * Add to Reload and Add Anchor * Fix Animation on Change * Fix Icon on Change * Code Cleanup * fix --------- Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
97 lines
2.5 KiB
TypeScript
97 lines
2.5 KiB
TypeScript
import Move from "./data/move";
|
|
|
|
/** Alias for all {@linkcode BattleScene} events */
|
|
export enum BattleSceneEventType {
|
|
/**
|
|
* Triggers when the corresponding setting is changed
|
|
* @see {@linkcode CandyUpgradeNotificationChangedEvent}
|
|
*/
|
|
CANDY_UPGRADE_NOTIFICATION_CHANGED = "onCandyUpgradeDisplayChanged",
|
|
|
|
/**
|
|
* Triggers when a move is successfully used
|
|
* @see {@linkcode MoveUsedEvent}
|
|
*/
|
|
MOVE_USED = "onMoveUsed",
|
|
/**
|
|
* Triggers on the first turn of a new battle
|
|
* @see {@linkcode TurnInitEvent}
|
|
*/
|
|
TURN_INIT = "onTurnInit",
|
|
/**
|
|
* Triggers after a turn ends in battle
|
|
* @see {@linkcode TurnEndEvent}
|
|
*/
|
|
TURN_END = "onTurnEnd",
|
|
/**
|
|
* Triggers when a new {@linkcode Arena} is created during initialization
|
|
* @see {@linkcode NewArenaEvent}
|
|
*/
|
|
NEW_ARENA = "onNewArena",
|
|
}
|
|
|
|
/**
|
|
* Container class for {@linkcode BattleSceneEventType.CANDY_UPGRADE_NOTIFICATION_CHANGED} events
|
|
* @extends Event
|
|
*/
|
|
export class CandyUpgradeNotificationChangedEvent extends Event {
|
|
/** The new value the setting was changed to */
|
|
public newValue: number;
|
|
constructor(newValue: number) {
|
|
super(BattleSceneEventType.CANDY_UPGRADE_NOTIFICATION_CHANGED);
|
|
|
|
this.newValue = newValue;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Container class for {@linkcode BattleSceneEventType.MOVE_USED} events
|
|
* @extends Event
|
|
*/
|
|
export class MoveUsedEvent extends Event {
|
|
/** The ID of the {@linkcode Pokemon} that used the {@linkcode Move} */
|
|
public userId: number;
|
|
/** The {@linkcode Move} used */
|
|
public move: Move;
|
|
/** The amount of PP used on the {@linkcode Move} this turn */
|
|
public ppUsed: number;
|
|
constructor(userId: number, move: Move, ppUsed: number) {
|
|
super(BattleSceneEventType.MOVE_USED);
|
|
|
|
this.userId = userId;
|
|
this.move = move;
|
|
this.ppUsed = ppUsed;
|
|
}
|
|
}
|
|
/**
|
|
* Container class for {@linkcode BattleSceneEventType.TURN_INIT} events
|
|
* @extends Event
|
|
*/
|
|
export class TurnInitEvent extends Event {
|
|
constructor() {
|
|
super(BattleSceneEventType.TURN_INIT);
|
|
}
|
|
}
|
|
/**
|
|
* Container class for {@linkcode BattleSceneEventType.TURN_END} events
|
|
* @extends Event
|
|
*/
|
|
export class TurnEndEvent extends Event {
|
|
/** The amount of turns in the current battle */
|
|
public turnCount: number;
|
|
constructor(turnCount: number) {
|
|
super(BattleSceneEventType.TURN_END);
|
|
|
|
this.turnCount = turnCount;
|
|
}
|
|
}
|
|
/**
|
|
* Container class for {@linkcode BattleSceneEventType.NEW_ARENA} events
|
|
* @extends Event
|
|
*/
|
|
export class NewArenaEvent extends Event {
|
|
constructor() {
|
|
super(BattleSceneEventType.NEW_ARENA);
|
|
}
|
|
}
|