mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 08:59:29 +02:00
Add parameter destructuring (#6092)
This commit is contained in:
parent
97e5ab882a
commit
315d4cf408
@ -41,7 +41,7 @@ export type HeldItemEffect = (typeof HeldItemEffect)[keyof typeof HeldItemEffect
|
|||||||
export class HeldItem {
|
export class HeldItem {
|
||||||
// public pokemonId: number;
|
// public pokemonId: number;
|
||||||
public type: HeldItemId;
|
public type: HeldItemId;
|
||||||
public maxStackCount: number;
|
public readonly maxStackCount: number;
|
||||||
public isTransferable = true;
|
public isTransferable = true;
|
||||||
public isStealable = true;
|
public isStealable = true;
|
||||||
public isSuppressable = true;
|
public isSuppressable = true;
|
||||||
|
@ -6,10 +6,13 @@ import type { NumberHolder } from "#utils/common";
|
|||||||
export interface AccuracyBoostParams {
|
export interface AccuracyBoostParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** Holds the move's accuracy, which may be modified after item application */
|
||||||
moveAccuracy: NumberHolder;
|
moveAccuracy: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @sealed
|
||||||
|
*/
|
||||||
export class AccuracyBoosterHeldItem extends HeldItem {
|
export class AccuracyBoosterHeldItem extends HeldItem {
|
||||||
public effects: HeldItemEffect[] = [HeldItemEffect.ACCURACY_BOOSTER];
|
public effects: HeldItemEffect[] = [HeldItemEffect.ACCURACY_BOOSTER];
|
||||||
|
|
||||||
@ -22,8 +25,8 @@ export class AccuracyBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if {@linkcode PokemonMoveAccuracyBoosterModifier} should be applied
|
* Checks if {@linkcode PokemonMoveAccuracyBoosterModifier} should be applied
|
||||||
* @param pokemon The {@linkcode Pokemon} to apply the move accuracy boost to
|
* @param pokemon - The {@linkcode Pokemon} to apply the move accuracy boost to
|
||||||
* @param moveAccuracy {@linkcode NumberHolder} holding the move accuracy boost
|
* @param moveAccuracy - {@linkcode NumberHolder} holding the move accuracy boost
|
||||||
* @returns `true` if {@linkcode PokemonMoveAccuracyBoosterModifier} should be applied
|
* @returns `true` if {@linkcode PokemonMoveAccuracyBoosterModifier} should be applied
|
||||||
*/
|
*/
|
||||||
// override shouldApply(pokemon?: Pokemon, moveAccuracy?: NumberHolder): boolean {
|
// override shouldApply(pokemon?: Pokemon, moveAccuracy?: NumberHolder): boolean {
|
||||||
@ -32,15 +35,10 @@ export class AccuracyBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode PokemonMoveAccuracyBoosterModifier}
|
* Applies {@linkcode PokemonMoveAccuracyBoosterModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} to apply the move accuracy boost to
|
|
||||||
* @param moveAccuracy {@linkcode NumberHolder} holding the move accuracy boost
|
|
||||||
* @returns always `true`
|
|
||||||
*/
|
*/
|
||||||
apply(params: AccuracyBoostParams): boolean {
|
apply({ pokemon, moveAccuracy }: AccuracyBoostParams): true {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const moveAccuracy = params.moveAccuracy;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
moveAccuracy.value = moveAccuracy.value + this.accuracyAmount * stackCount;
|
moveAccuracy.value += this.accuracyAmount * stackCount;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -66,10 +66,7 @@ export class AttackTypeBoosterHeldItem extends HeldItem {
|
|||||||
return `${HeldItemNames[this.type]?.toLowerCase()}`;
|
return `${HeldItemNames[this.type]?.toLowerCase()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(params: AttackTypeBoostParams): void {
|
apply({ pokemon, moveType, movePower }: AttackTypeBoostParams): void {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const moveType = params.moveType;
|
|
||||||
const movePower = params.movePower;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (moveType === this.moveType && movePower.value >= 1) {
|
if (moveType === this.moveType && movePower.value >= 1) {
|
||||||
movePower.value = Math.floor(movePower.value * (1 + stackCount * this.powerBoost));
|
movePower.value = Math.floor(movePower.value * (1 + stackCount * this.powerBoost));
|
||||||
|
@ -7,6 +7,7 @@ import i18next from "i18next";
|
|||||||
export interface BaseStatBoosterParams {
|
export interface BaseStatBoosterParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** The base stats of the {@linkcode pokemon} */
|
||||||
baseStats: number[];
|
baseStats: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,8 +58,8 @@ export class BaseStatBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if {@linkcode BaseStatModifier} should be applied to the specified {@linkcode Pokemon}.
|
* Checks if {@linkcode BaseStatModifier} should be applied to the specified {@linkcode Pokemon}.
|
||||||
* @param _pokemon the {@linkcode Pokemon} to be modified
|
* @param _pokemon - The {@linkcode Pokemon} to be modified
|
||||||
* @param baseStats the base stats of the {@linkcode Pokemon}
|
* @param baseStats - The base stats of the {@linkcode Pokemon}
|
||||||
* @returns `true` if the {@linkcode Pokemon} should be modified
|
* @returns `true` if the {@linkcode Pokemon} should be modified
|
||||||
*/
|
*/
|
||||||
// override shouldApply(_pokemon?: Pokemon, baseStats?: number[]): boolean {
|
// override shouldApply(_pokemon?: Pokemon, baseStats?: number[]): boolean {
|
||||||
@ -67,14 +68,9 @@ export class BaseStatBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the {@linkcode BaseStatModifier} to the specified {@linkcode Pokemon}.
|
* Applies the {@linkcode BaseStatModifier} to the specified {@linkcode Pokemon}.
|
||||||
* @param _pokemon the {@linkcode Pokemon} to be modified
|
|
||||||
* @param baseStats the base stats of the {@linkcode Pokemon}
|
|
||||||
* @returns always `true`
|
|
||||||
*/
|
*/
|
||||||
apply(params: BaseStatBoosterParams): boolean {
|
apply({ pokemon, baseStats }: BaseStatBoosterParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
const baseStats = params.baseStats;
|
|
||||||
baseStats[this.stat] = Math.floor(baseStats[this.stat] * (1 + stackCount * 0.1));
|
baseStats[this.stat] = Math.floor(baseStats[this.stat] * (1 + stackCount * 0.1));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,8 @@ export class BaseStatFlatHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the {@linkcode PokemonBaseStatFlatModifier}
|
* Applies the {@linkcode PokemonBaseStatFlatModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} that holds the item
|
|
||||||
* @param baseStats The base stats of the {@linkcode Pokemon}
|
|
||||||
* @returns always `true`
|
|
||||||
*/
|
*/
|
||||||
apply(params: BaseStatFlatParams): boolean {
|
apply({ pokemon, baseStats }: BaseStatFlatParams): true {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const baseStats = params.baseStats;
|
|
||||||
const stats = this.getStats(pokemon);
|
const stats = this.getStats(pokemon);
|
||||||
const statModifier = 20;
|
const statModifier = 20;
|
||||||
// Modifies the passed in baseStats[] array by a flat value, only if the stat is specified in this.stats
|
// Modifies the passed in baseStats[] array by a flat value, only if the stat is specified in this.stats
|
||||||
@ -57,15 +52,12 @@ export class BaseStatFlatHeldItem extends HeldItem {
|
|||||||
* Get the lowest of HP/Spd, lowest of Atk/SpAtk, and lowest of Def/SpDef
|
* Get the lowest of HP/Spd, lowest of Atk/SpAtk, and lowest of Def/SpDef
|
||||||
* @returns Array of 3 {@linkcode Stat}s to boost
|
* @returns Array of 3 {@linkcode Stat}s to boost
|
||||||
*/
|
*/
|
||||||
getStats(pokemon: Pokemon): Stat[] {
|
getStats(pokemon: Pokemon): [HpOrSpeed: Stat, AtkOrSpAtk: Stat, DefOrSpDef: Stat] {
|
||||||
const stats: Stat[] = [];
|
|
||||||
const baseStats = pokemon.getSpeciesForm().baseStats.slice(0);
|
const baseStats = pokemon.getSpeciesForm().baseStats.slice(0);
|
||||||
// HP or Speed
|
return [
|
||||||
stats.push(baseStats[Stat.HP] < baseStats[Stat.SPD] ? Stat.HP : Stat.SPD);
|
baseStats[Stat.HP] < baseStats[Stat.SPD] ? Stat.HP : Stat.SPD,
|
||||||
// Attack or SpAtk
|
baseStats[Stat.ATK] < baseStats[Stat.SPATK] ? Stat.ATK : Stat.SPATK,
|
||||||
stats.push(baseStats[Stat.ATK] < baseStats[Stat.SPATK] ? Stat.ATK : Stat.SPATK);
|
baseStats[Stat.DEF] < baseStats[Stat.SPDEF] ? Stat.DEF : Stat.SPDEF,
|
||||||
// Def or SpDef
|
];
|
||||||
stats.push(baseStats[Stat.DEF] < baseStats[Stat.SPDEF] ? Stat.DEF : Stat.SPDEF);
|
|
||||||
return stats;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import i18next from "i18next";
|
|||||||
export interface BaseStatTotalParams {
|
export interface BaseStatTotalParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** Array of the pokemon's base stat; modified in place after item application */
|
||||||
baseStats: number[];
|
baseStats: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,8 +56,7 @@ export class BaseStatTotalHeldItem extends HeldItem {
|
|||||||
* @param baseStats the base stats of the {@linkcode Pokemon}
|
* @param baseStats the base stats of the {@linkcode Pokemon}
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: BaseStatTotalParams): boolean {
|
apply({ baseStats }: BaseStatTotalParams): true {
|
||||||
const baseStats = params.baseStats;
|
|
||||||
// Modifies the passed in baseStats[] array
|
// Modifies the passed in baseStats[] array
|
||||||
baseStats.forEach((v, i) => {
|
baseStats.forEach((v, i) => {
|
||||||
// HP is affected by half as much as other stats
|
// HP is affected by half as much as other stats
|
||||||
|
@ -16,7 +16,7 @@ export class BatonHeldItem extends HeldItem {
|
|||||||
* Applies {@linkcode SwitchEffectTransferModifier}
|
* Applies {@linkcode SwitchEffectTransferModifier}
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(): boolean {
|
apply(): true {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,12 +66,9 @@ export class BerryHeldItem extends ConsumableHeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode BerryHeldItem}
|
* Applies {@linkcode BerryHeldItem}
|
||||||
* @param pokemon The {@linkcode Pokemon} that holds the berry
|
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: BerryParams): boolean {
|
apply({ pokemon }: BerryParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
|
|
||||||
if (!this.shouldApply(pokemon)) {
|
if (!this.shouldApply(pokemon)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -9,14 +9,12 @@ import i18next from "i18next";
|
|||||||
export interface BypassSpeedChanceParams {
|
export interface BypassSpeedChanceParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** Holder for whether the speed should be bypassed */
|
||||||
doBypassSpeed: BooleanHolder;
|
doBypassSpeed: BooleanHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifier used for held items, namely Toxic Orb and Flame Orb, that apply a
|
* Modifier used for items that allow a Pokémon to bypass the speed chance (Quick Claw).
|
||||||
* set {@linkcode StatusEffect} at the end of a turn.
|
|
||||||
* @extends PokemonHeldItemModifier
|
|
||||||
* @see {@linkcode apply}
|
|
||||||
*/
|
*/
|
||||||
export class BypassSpeedChanceHeldItem extends HeldItem {
|
export class BypassSpeedChanceHeldItem extends HeldItem {
|
||||||
public effects: HeldItemEffect[] = [HeldItemEffect.BYPASS_SPEED_CHANCE];
|
public effects: HeldItemEffect[] = [HeldItemEffect.BYPASS_SPEED_CHANCE];
|
||||||
@ -33,13 +31,9 @@ export class BypassSpeedChanceHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode BypassSpeedChanceModifier}
|
* Applies {@linkcode BypassSpeedChanceModifier}
|
||||||
* @param pokemon the {@linkcode Pokemon} that holds the item
|
|
||||||
* @param doBypassSpeed {@linkcode BooleanHolder} that is `true` if speed should be bypassed
|
|
||||||
* @returns `true` if {@linkcode BypassSpeedChanceModifier} has been applied
|
* @returns `true` if {@linkcode BypassSpeedChanceModifier} has been applied
|
||||||
*/
|
*/
|
||||||
apply(params: BypassSpeedChanceParams): boolean {
|
apply({ pokemon, doBypassSpeed }: BypassSpeedChanceParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const doBypassSpeed = params.doBypassSpeed;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (!doBypassSpeed.value && pokemon.randBattleSeedInt(10) < stackCount) {
|
if (!doBypassSpeed.value && pokemon.randBattleSeedInt(10) < stackCount) {
|
||||||
doBypassSpeed.value = true;
|
doBypassSpeed.value = true;
|
||||||
|
@ -7,6 +7,7 @@ import type { NumberHolder } from "#utils/common";
|
|||||||
export interface CritBoostParams {
|
export interface CritBoostParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** The critical hit stage */
|
||||||
critStage: NumberHolder;
|
critStage: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,8 +35,8 @@ export class CritBoostHeldItem extends HeldItem {
|
|||||||
* @param critStage {@linkcode NumberHolder} that holds the resulting critical-hit level
|
* @param critStage {@linkcode NumberHolder} that holds the resulting critical-hit level
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: CritBoostParams): boolean {
|
apply({ critStage }: CritBoostParams): boolean {
|
||||||
params.critStage.value += this.stageIncrement;
|
critStage.value += this.stageIncrement;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import { NumberHolder } from "#utils/common";
|
|||||||
export interface DamageMoneyRewardParams {
|
export interface DamageMoneyRewardParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** The damage, used to calculate the money reward */
|
||||||
damage: number;
|
damage: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,13 +16,9 @@ export class DamageMoneyRewardHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode DamageMoneyRewardModifier}
|
* Applies {@linkcode DamageMoneyRewardModifier}
|
||||||
* @param pokemon The {@linkcode Pokemon} attacking
|
|
||||||
* @param multiplier {@linkcode NumberHolder} holding the multiplier value
|
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: DamageMoneyRewardParams): boolean {
|
apply({ pokemon, damage }: DamageMoneyRewardParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const damage = params.damage;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
const moneyAmount = new NumberHolder(Math.floor(damage * (0.5 * stackCount)));
|
const moneyAmount = new NumberHolder(Math.floor(damage * (0.5 * stackCount)));
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount });
|
globalScene.applyPlayerItems(TrainerItemEffect.MONEY_MULTIPLIER, { numberHolder: moneyAmount });
|
||||||
|
@ -7,7 +7,7 @@ import i18next from "i18next";
|
|||||||
export interface ExpBoostParams {
|
export interface ExpBoostParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** Holds the amount of experience gained, which may be modified after item application */
|
||||||
expAmount: NumberHolder;
|
expAmount: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,13 +41,9 @@ export class ExpBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode PokemonExpBoosterModifier}
|
* Applies {@linkcode PokemonExpBoosterModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} to apply the exp boost to
|
|
||||||
* @param boost {@linkcode NumberHolder} holding the exp boost value
|
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: ExpBoostParams): boolean {
|
apply({ pokemon, expAmount }: ExpBoostParams): true {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const expAmount = params.expAmount;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
expAmount.value = Math.floor(expAmount.value * (1 + stackCount * this.boostMultiplier));
|
expAmount.value = Math.floor(expAmount.value * (1 + stackCount * this.boostMultiplier));
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@ import { HeldItem, HeldItemEffect } from "#items/held-item";
|
|||||||
import type { NumberHolder } from "#utils/common";
|
import type { NumberHolder } from "#utils/common";
|
||||||
|
|
||||||
export interface FieldEffectParams {
|
export interface FieldEffectParams {
|
||||||
pokemon: Pokemon;
|
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
|
pokemon: Pokemon;
|
||||||
|
/** Holder for the field effect duration*/
|
||||||
fieldDuration: NumberHolder;
|
fieldDuration: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,14 +21,11 @@ export class FieldEffectHeldItem extends HeldItem {
|
|||||||
/**
|
/**
|
||||||
* Provides two more turns per stack to any weather or terrain effect caused
|
* Provides two more turns per stack to any weather or terrain effect caused
|
||||||
* by the holder.
|
* by the holder.
|
||||||
* @param pokemon {@linkcode Pokemon} that holds the held item
|
* @returns always `true`
|
||||||
* @param fieldDuration {@linkcode NumberHolder} that stores the current field effect duration
|
|
||||||
* @returns `true` if the field effect extension was applied successfully
|
|
||||||
*/
|
*/
|
||||||
apply(params: FieldEffectParams): boolean {
|
apply({ pokemon, fieldDuration }: FieldEffectParams): true {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
params.fieldDuration.value += 2 * stackCount;
|
fieldDuration.value += 2 * stackCount;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import type { BooleanHolder } from "#utils/common";
|
|||||||
export interface FlinchChanceParams {
|
export interface FlinchChanceParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** Holds whether the attack will cause a flinch */
|
||||||
flinched: BooleanHolder;
|
flinched: BooleanHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,13 +38,9 @@ export class FlinchChanceHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode FlinchChanceModifier} to randomly flinch targets hit.
|
* Applies {@linkcode FlinchChanceModifier} to randomly flinch targets hit.
|
||||||
* @param pokemon - The {@linkcode Pokemon} that holds the item
|
|
||||||
* @param flinched - A {@linkcode BooleanHolder} holding whether the pokemon has flinched
|
|
||||||
* @returns `true` if {@linkcode FlinchChanceModifier} was applied successfully
|
* @returns `true` if {@linkcode FlinchChanceModifier} was applied successfully
|
||||||
*/
|
*/
|
||||||
apply(params: FlinchChanceParams): boolean {
|
apply({ pokemon, flinched }: FlinchChanceParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const flinched = params.flinched;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
// The check for pokemon.summonData is to ensure that a crash doesn't occur when a Pokemon with King's Rock procs a flinch
|
// The check for pokemon.summonData is to ensure that a crash doesn't occur when a Pokemon with King's Rock procs a flinch
|
||||||
// TODO: Since summonData is always defined now, we can probably remove this
|
// TODO: Since summonData is always defined now, we can probably remove this
|
||||||
|
@ -6,7 +6,7 @@ import i18next from "i18next";
|
|||||||
export interface FriendshipBoostParams {
|
export interface FriendshipBoostParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** Holder for the friendship amount to be changed by the item */
|
||||||
friendship: NumberHolder;
|
friendship: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,13 +19,9 @@ export class FriendshipBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode PokemonFriendshipBoosterModifier}
|
* Applies {@linkcode PokemonFriendshipBoosterModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} to apply the friendship boost to
|
|
||||||
* @param friendship {@linkcode NumberHolder} holding the friendship boost value
|
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: FriendshipBoostParams): boolean {
|
apply({ pokemon, friendship }: FriendshipBoostParams): true {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const friendship = params.friendship;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
friendship.value = Math.floor(friendship.value * (1 + 0.5 * stackCount));
|
friendship.value = Math.floor(friendship.value * (1 + 0.5 * stackCount));
|
||||||
|
|
||||||
|
@ -28,11 +28,9 @@ export class HitHealHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode HitHealModifier}
|
* Applies {@linkcode HitHealModifier}
|
||||||
* @param pokemon The {@linkcode Pokemon} that holds the item
|
|
||||||
* @returns `true` if the {@linkcode Pokemon} was healed
|
* @returns `true` if the {@linkcode Pokemon} was healed
|
||||||
*/
|
*/
|
||||||
apply(params: HitHealParams): boolean {
|
apply({ pokemon }: HitHealParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (pokemon.turnData.totalDamageDealt > 0 && !pokemon.isFullHp()) {
|
if (pokemon.turnData.totalDamageDealt > 0 && !pokemon.isFullHp()) {
|
||||||
// TODO: this shouldn't be undefined AFAIK
|
// TODO: this shouldn't be undefined AFAIK
|
||||||
|
@ -7,7 +7,9 @@ import i18next from "i18next";
|
|||||||
export interface IncrementingStatParams {
|
export interface IncrementingStatParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** The stat whose value is being impacted */
|
||||||
stat: Stat;
|
stat: Stat;
|
||||||
|
/** Holds the stat's value, which may be modified after item application */
|
||||||
// TODO: https://github.com/pagefaultgames/pokerogue/pull/5656#discussion_r2135612276
|
// TODO: https://github.com/pagefaultgames/pokerogue/pull/5656#discussion_r2135612276
|
||||||
statHolder: NumberHolder;
|
statHolder: NumberHolder;
|
||||||
}
|
}
|
||||||
@ -40,19 +42,14 @@ export class IncrementingStatHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies the {@linkcode PokemonIncrementingStatModifier}
|
* Applies the {@linkcode PokemonIncrementingStatModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} that holds the item
|
|
||||||
* @param stat The affected {@linkcode Stat}
|
|
||||||
* @param statHolder The {@linkcode NumberHolder} that holds the stat
|
|
||||||
* @returns always `true`
|
* @returns always `true`
|
||||||
*/
|
*/
|
||||||
apply(params: IncrementingStatParams): boolean {
|
apply({ pokemon, statHolder, stat }: IncrementingStatParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
const statHolder = params.statHolder;
|
|
||||||
|
|
||||||
// Modifies the passed in stat number holder by +2 per stack for HP, +1 per stack for other stats
|
// Modifies the passed in stat number holder by +2 per stack for HP, +1 per stack for other stats
|
||||||
// If the Macho Brace is at max stacks (50), adds additional 10% to total HP and 5% to other stats
|
// If the Macho Brace is at max stacks (50), adds additional 10% to total HP and 5% to other stats
|
||||||
const isHp = params.stat === Stat.HP;
|
const isHp = stat === Stat.HP;
|
||||||
|
|
||||||
if (isHp) {
|
if (isHp) {
|
||||||
statHolder.value += 2 * stackCount;
|
statHolder.value += 2 * stackCount;
|
||||||
|
@ -35,11 +35,9 @@ export class InstantReviveHeldItem extends ConsumableHeldItem {
|
|||||||
/**
|
/**
|
||||||
* Goes through the holder's stat stages and, if any are negative, resets that
|
* Goes through the holder's stat stages and, if any are negative, resets that
|
||||||
* stat stage back to 0.
|
* stat stage back to 0.
|
||||||
* @param pokemon {@linkcode Pokemon} that holds the item
|
|
||||||
* @returns `true` if any stat stages were reset, false otherwise
|
* @returns `true` if any stat stages were reset, false otherwise
|
||||||
*/
|
*/
|
||||||
apply(params: InstantReviveParams): boolean {
|
apply({ pokemon }: InstantReviveParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
// Restore the Pokemon to half HP
|
// Restore the Pokemon to half HP
|
||||||
globalScene.phaseManager.unshiftPhase(
|
globalScene.phaseManager.unshiftPhase(
|
||||||
new PokemonHealPhase(
|
new PokemonHealPhase(
|
||||||
|
@ -4,7 +4,7 @@ import { allHeldItems } from "#data/data-lists";
|
|||||||
import type { HeldItemId } from "#enums/held-item-id";
|
import type { HeldItemId } from "#enums/held-item-id";
|
||||||
import { Pokemon } from "#field/pokemon";
|
import { Pokemon } from "#field/pokemon";
|
||||||
import { HeldItem, HeldItemEffect } from "#items/held-item";
|
import { HeldItem, HeldItemEffect } from "#items/held-item";
|
||||||
import { randSeedFloat } from "#utils/common";
|
import { coerceArray, randSeedFloat } from "#utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export interface ItemStealParams {
|
export interface ItemStealParams {
|
||||||
@ -148,20 +148,20 @@ export class ContactItemStealChanceHeldItem extends ItemTransferHeldItem {
|
|||||||
* @param targetPokemon The {@linkcode Pokemon} the holder is targeting with an attack
|
* @param targetPokemon The {@linkcode Pokemon} the holder is targeting with an attack
|
||||||
* @returns The target {@linkcode Pokemon} as array for further use in `apply` implementations
|
* @returns The target {@linkcode Pokemon} as array for further use in `apply` implementations
|
||||||
*/
|
*/
|
||||||
getTargets(params: ItemStealParams): Pokemon[] {
|
getTargets({ target }: ItemStealParams): Pokemon[] {
|
||||||
return params.target ? [params.target] : [];
|
return target ? coerceArray(target) : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
getTransferredItemCount(params: ItemStealParams): number {
|
getTransferredItemCount({ pokemon }: ItemStealParams): number {
|
||||||
const stackCount = params.pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
return randSeedFloat() <= this.chance * stackCount ? 1 : 0;
|
return randSeedFloat() <= this.chance * stackCount ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTransferMessage(params: ItemStealParams, itemId: HeldItemId): string {
|
getTransferMessage({ pokemon, target }: ItemStealParams, itemId: HeldItemId): string {
|
||||||
return i18next.t("modifier:contactHeldItemTransferApply", {
|
return i18next.t("modifier:contactHeldItemTransferApply", {
|
||||||
pokemonNameWithAffix: getPokemonNameWithAffix(params.target),
|
pokemonNameWithAffix: getPokemonNameWithAffix(target),
|
||||||
itemName: allHeldItems[itemId].name,
|
itemName: allHeldItems[itemId].name,
|
||||||
pokemonName: params.pokemon.getNameToRender(),
|
pokemonName: pokemon.getNameToRender(),
|
||||||
typeName: this.name,
|
typeName: this.name,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,13 @@ import { isNullOrUndefined, type NumberHolder } from "#utils/common";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
export interface MultiHitParams {
|
export interface MultiHitParams {
|
||||||
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
|
/** The move being used */
|
||||||
moveId: MoveId;
|
moveId: MoveId;
|
||||||
|
/** Holder for the move's hit count for the turn */
|
||||||
count?: NumberHolder;
|
count?: NumberHolder;
|
||||||
|
/** Holder for the damage multiplier applied to a strike of the move */
|
||||||
damageMultiplier?: NumberHolder;
|
damageMultiplier?: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,16 +31,11 @@ export class MultiHitHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For each stack, converts 25 percent of attack damage into an additional strike.
|
* For each stack, converts 25 percent of attack damage into an additional strike.
|
||||||
* @param pokemon The {@linkcode Pokemon} using the move
|
* @returns Whether the item applies its effects to move
|
||||||
* @param moveId The {@linkcode MoveId | identifier} for the move being used
|
|
||||||
* @param count {@linkcode NumberHolder} holding the move's hit count for this turn
|
|
||||||
* @param damageMultiplier {@linkcode NumberHolder} holding a damage multiplier applied to a strike of this move
|
|
||||||
* @returns always `true`
|
|
||||||
*/
|
*/
|
||||||
apply(params: MultiHitParams): boolean {
|
apply({ pokemon, count, moveId, damageMultiplier }: MultiHitParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
const move = allMoves[moveId];
|
||||||
const move = allMoves[params.moveId];
|
/*
|
||||||
/**
|
|
||||||
* The move must meet Parental Bond's restrictions for this item
|
* The move must meet Parental Bond's restrictions for this item
|
||||||
* to apply. This means
|
* to apply. This means
|
||||||
* - Only attacks are boosted
|
* - Only attacks are boosted
|
||||||
@ -49,11 +48,11 @@ export class MultiHitHeldItem extends HeldItem {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNullOrUndefined(params.count)) {
|
if (!isNullOrUndefined(count)) {
|
||||||
return this.applyHitCountBoost(pokemon, params.count);
|
return this.applyHitCountBoost(pokemon, count);
|
||||||
}
|
}
|
||||||
if (!isNullOrUndefined(params.damageMultiplier)) {
|
if (!isNullOrUndefined(damageMultiplier)) {
|
||||||
return this.applyDamageModifier(pokemon, params.damageMultiplier);
|
return this.applyDamageModifier(pokemon, damageMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -5,7 +5,7 @@ import type { NumberHolder } from "#utils/common";
|
|||||||
export interface NatureWeightBoostParams {
|
export interface NatureWeightBoostParams {
|
||||||
/** The pokemon with the item */
|
/** The pokemon with the item */
|
||||||
pokemon: Pokemon;
|
pokemon: Pokemon;
|
||||||
/** The amount of exp to gain */
|
/** Holder for the multiplier */
|
||||||
multiplier: NumberHolder;
|
multiplier: NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,13 +14,9 @@ export class NatureWeightBoosterHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode PokemonNatureWeightModifier}
|
* Applies {@linkcode PokemonNatureWeightModifier}
|
||||||
* @param _pokemon The {@linkcode Pokemon} to apply the nature weight to
|
|
||||||
* @param multiplier {@linkcode NumberHolder} holding the nature weight
|
|
||||||
* @returns `true` if multiplier was applied
|
* @returns `true` if multiplier was applied
|
||||||
*/
|
*/
|
||||||
apply(params: NatureWeightBoostParams): boolean {
|
apply({ pokemon, multiplier }: NatureWeightBoostParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const multiplier = params.multiplier;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (multiplier.value !== 1) {
|
if (multiplier.value !== 1) {
|
||||||
multiplier.value += 0.1 * stackCount * (multiplier.value > 1 ? 1 : -1);
|
multiplier.value += 0.1 * stackCount * (multiplier.value > 1 ? 1 : -1);
|
||||||
|
@ -35,12 +35,9 @@ export class ResetNegativeStatStageHeldItem extends ConsumableHeldItem {
|
|||||||
/**
|
/**
|
||||||
* Goes through the holder's stat stages and, if any are negative, resets that
|
* Goes through the holder's stat stages and, if any are negative, resets that
|
||||||
* stat stage back to 0.
|
* stat stage back to 0.
|
||||||
* @param pokemon {@linkcode Pokemon} that holds the item
|
|
||||||
* @returns `true` if any stat stages were reset, false otherwise
|
* @returns `true` if any stat stages were reset, false otherwise
|
||||||
*/
|
*/
|
||||||
apply(params: ResetNegativeStatStageParams): boolean {
|
apply({ pokemon, isPlayer }: ResetNegativeStatStageParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const isPlayer = params.isPlayer;
|
|
||||||
let statRestored = false;
|
let statRestored = false;
|
||||||
|
|
||||||
for (const s of BATTLE_STATS) {
|
for (const s of BATTLE_STATS) {
|
||||||
|
@ -47,14 +47,11 @@ export class StatBoostHeldItem extends HeldItem {
|
|||||||
/**
|
/**
|
||||||
* Boosts the incoming stat by a {@linkcode multiplier} if the stat is listed
|
* Boosts the incoming stat by a {@linkcode multiplier} if the stat is listed
|
||||||
* in {@linkcode stats}.
|
* in {@linkcode stats}.
|
||||||
* @param _pokemon the {@linkcode Pokemon} that holds the item
|
|
||||||
* @param _stat the {@linkcode Stat} to be boosted
|
|
||||||
* @param statValue {@linkcode NumberHolder} that holds the resulting value of the stat
|
|
||||||
* @returns `true` if the stat boost applies successfully, false otherwise
|
* @returns `true` if the stat boost applies successfully, false otherwise
|
||||||
* @see shouldApply
|
* @see shouldApply
|
||||||
*/
|
*/
|
||||||
apply(params: StatBoostParams): boolean {
|
apply({ statValue }: StatBoostParams): boolean {
|
||||||
params.statValue.value *= this.multiplier;
|
statValue.value *= this.multiplier;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +85,6 @@ export class EvolutionStatBoostHeldItem extends StatBoostHeldItem {
|
|||||||
* only half of the boost if either of the fused members are fully
|
* only half of the boost if either of the fused members are fully
|
||||||
* evolved. However, if they are both unevolved, the full boost
|
* evolved. However, if they are both unevolved, the full boost
|
||||||
* will apply.
|
* will apply.
|
||||||
* @param pokemon {@linkcode Pokemon} that holds the item
|
|
||||||
* @param _stat {@linkcode Stat} The {@linkcode Stat} to be boosted
|
|
||||||
* @param statValue{@linkcode NumberHolder} that holds the resulting value of the stat
|
|
||||||
* @returns `true` if the stat boost applies successfully, false otherwise
|
* @returns `true` if the stat boost applies successfully, false otherwise
|
||||||
* @see shouldApply
|
* @see shouldApply
|
||||||
*/
|
*/
|
||||||
|
@ -32,13 +32,9 @@ export class SurviveChanceHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies {@linkcode SurviveDamageModifier}
|
* Applies {@linkcode SurviveDamageModifier}
|
||||||
* @param pokemon the {@linkcode Pokemon} that holds the item
|
|
||||||
* @param surviveDamage {@linkcode BooleanHolder} that holds the survive damage
|
|
||||||
* @returns `true` if the survive damage has been applied
|
* @returns `true` if the survive damage has been applied
|
||||||
*/
|
*/
|
||||||
apply(params: SurviveChanceParams): boolean {
|
apply({ pokemon, surviveDamage }: SurviveChanceParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const surviveDamage = params.surviveDamage;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (!surviveDamage.value && pokemon.randBattleSeedInt(10) < stackCount) {
|
if (!surviveDamage.value && pokemon.randBattleSeedInt(10) < stackCount) {
|
||||||
surviveDamage.value = true;
|
surviveDamage.value = true;
|
||||||
|
@ -14,8 +14,7 @@ export interface TurnEndHealParams {
|
|||||||
export class TurnEndHealHeldItem extends HeldItem {
|
export class TurnEndHealHeldItem extends HeldItem {
|
||||||
public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_HEAL];
|
public effects: HeldItemEffect[] = [HeldItemEffect.TURN_END_HEAL];
|
||||||
|
|
||||||
apply(params: TurnEndHealParams): boolean {
|
apply({ pokemon }: TurnEndHealParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
|
||||||
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
const stackCount = pokemon.heldItemManager.getStack(this.type);
|
||||||
if (pokemon.isFullHp()) {
|
if (pokemon.isFullHp()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -27,11 +27,10 @@ export class TurnEndStatusHeldItem extends HeldItem {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to inflicts the holder with the associated {@linkcode StatusEffect}.
|
* Tries to inflicts the holder with the associated {@linkcode StatusEffect}.
|
||||||
* @param pokemon {@linkcode Pokemon} that holds the held item
|
|
||||||
* @returns `true` if the status effect was applied successfully
|
* @returns `true` if the status effect was applied successfully
|
||||||
*/
|
*/
|
||||||
apply(params: TurnEndStatusParams): boolean {
|
apply({ pokemon }: TurnEndStatusParams): boolean {
|
||||||
return params.pokemon.trySetStatus(this.effect, true, undefined, undefined, this.name);
|
return pokemon.trySetStatus(this.effect, true, undefined, undefined, this.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
getStatusEffect(): StatusEffect {
|
getStatusEffect(): StatusEffect {
|
||||||
|
@ -67,15 +67,15 @@ export class TrainerItem {
|
|||||||
this.maxStackCount = maxStackCount;
|
this.maxStackCount = maxStackCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
get name(): string {
|
public get name(): string {
|
||||||
return i18next.t(`modifierType:ModifierType.${TrainerItemNames[this.type]}.name`);
|
return i18next.t(`modifierType:ModifierType.${TrainerItemNames[this.type]}.name`);
|
||||||
}
|
}
|
||||||
|
|
||||||
get description(): string {
|
public get description(): string {
|
||||||
return i18next.t(`modifierType:ModifierType.${TrainerItemNames[this.type]}.description`);
|
return i18next.t(`modifierType:ModifierType.${TrainerItemNames[this.type]}.description`);
|
||||||
}
|
}
|
||||||
|
|
||||||
get iconName(): string {
|
public get iconName(): string {
|
||||||
return `${TrainerItemNames[this.type]?.toLowerCase()}`;
|
return `${TrainerItemNames[this.type]?.toLowerCase()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,10 +84,9 @@ export class TrainerItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createIcon(stackCount: number): Phaser.GameObjects.Container {
|
createIcon(stackCount: number): Phaser.GameObjects.Container {
|
||||||
const container = globalScene.add.container(0, 0);
|
const container = globalScene.add.container();
|
||||||
|
|
||||||
const item = globalScene.add.sprite(0, 12, "items").setFrame(this.iconName).setOrigin(0, 0.5);
|
container.add(globalScene.add.sprite(0, 12, "items").setFrame(this.iconName).setOrigin(0, 0.5));
|
||||||
container.add(item);
|
|
||||||
|
|
||||||
const stackText = this.getIconStackText(stackCount);
|
const stackText = this.getIconStackText(stackCount);
|
||||||
if (stackText) {
|
if (stackText) {
|
||||||
@ -102,12 +101,13 @@ export class TrainerItem {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const text = globalScene.add.bitmapText(10, 15, "item-count", stackCount.toString(), 11);
|
const text = globalScene.add
|
||||||
text.letterSpacing = -0.5;
|
.bitmapText(10, 15, "item-count", stackCount.toString(), 11)
|
||||||
|
.setLetterSpacing(-0.5)
|
||||||
|
.setOrigin(0);
|
||||||
if (stackCount >= this.getMaxStackCount()) {
|
if (stackCount >= this.getMaxStackCount()) {
|
||||||
text.setTint(0xf89890);
|
text.setTint(0xf89890);
|
||||||
}
|
}
|
||||||
text.setOrigin(0);
|
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user