mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-11 10:52:17 +02:00
Compare commits
20 Commits
2a32189ea1
...
9d90cc3e10
Author | SHA1 | Date | |
---|---|---|---|
|
9d90cc3e10 | ||
|
af86bdeb06 | ||
|
1d29ca7974 | ||
|
19d244ee94 | ||
|
1c56efc860 | ||
|
74ee3329f8 | ||
|
3a3611dfc0 | ||
|
5d0dbfff98 | ||
|
b45cd2f7e7 | ||
|
7e5c7fb4f7 | ||
|
ed87293867 | ||
|
47c9eb547d | ||
|
e2dfbc4aa5 | ||
|
487b1d26d1 | ||
|
40993793cb | ||
|
4e6cf2a6ac | ||
|
fa60e002e8 | ||
|
610de916a0 | ||
|
34a4f86982 | ||
|
9a49691a9e |
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 60 KiB |
@ -3,7 +3,7 @@ import { Type } from "./type";
|
|||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import { BattleStat, getBattleStatName } from "./battle-stat";
|
import { BattleStat, getBattleStatName } from "./battle-stat";
|
||||||
import { PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
|
import { PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
|
||||||
import { getPokemonMessage } from "../messages";
|
import { getPokemonMessage, getPokemonPrefix } from "../messages";
|
||||||
import { Weather, WeatherType } from "./weather";
|
import { Weather, WeatherType } from "./weather";
|
||||||
import { BattlerTag } from "./battler-tags";
|
import { BattlerTag } from "./battler-tags";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
@ -144,7 +144,7 @@ export class BlockRecoilDamageAttr extends AbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]) {
|
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]) {
|
||||||
return getPokemonMessage(pokemon, `'s ${abilityName}\nprotected it from recoil!`);
|
return i18next.t('abilityTriggers:blockRecoilDamage', {pokemonName: `${getPokemonPrefix(pokemon)}${pokemon.name}`, abilityName: abilityName});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -991,6 +991,42 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class for abilities that boost the damage of moves
|
||||||
|
* For abilities that boost the base power of moves, see VariableMovePowerAbAttr
|
||||||
|
* @param damageMultiplier the amount to multiply the damage by
|
||||||
|
* @param condition the condition for this ability to be applied
|
||||||
|
*/
|
||||||
|
export class DamageBoostAbAttr extends PreAttackAbAttr {
|
||||||
|
private damageMultiplier: number;
|
||||||
|
private condition: PokemonAttackCondition;
|
||||||
|
|
||||||
|
constructor(damageMultiplier: number, condition: PokemonAttackCondition){
|
||||||
|
super(true);
|
||||||
|
this.damageMultiplier = damageMultiplier;
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param pokemon the attacker pokemon
|
||||||
|
* @param passive N/A
|
||||||
|
* @param defender the target pokemon
|
||||||
|
* @param move the move used by the attacker pokemon
|
||||||
|
* @param args Utils.NumberHolder as damage
|
||||||
|
* @returns true if the function succeeds
|
||||||
|
*/
|
||||||
|
applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean {
|
||||||
|
if (this.condition(pokemon, defender, move.getMove())) {
|
||||||
|
const power = args[0] as Utils.NumberHolder;
|
||||||
|
power.value = Math.floor(power.value * this.damageMultiplier);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr {
|
export class MovePowerBoostAbAttr extends VariableMovePowerAbAttr {
|
||||||
private condition: PokemonAttackCondition;
|
private condition: PokemonAttackCondition;
|
||||||
private powerMultiplier: number;
|
private powerMultiplier: number;
|
||||||
@ -3121,7 +3157,7 @@ export function initAbilities() {
|
|||||||
.attr(IgnoreOpponentStatChangesAbAttr)
|
.attr(IgnoreOpponentStatChangesAbAttr)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.TINTED_LENS, 4)
|
new Ability(Abilities.TINTED_LENS, 4)
|
||||||
.attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) <= 0.5, 2),
|
.attr(DamageBoostAbAttr, 2, (user, target, move) => target.getAttackTypeEffectiveness(move.type, user) <= 0.5),
|
||||||
new Ability(Abilities.FILTER, 4)
|
new Ability(Abilities.FILTER, 4)
|
||||||
.attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75)
|
.attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type, user) >= 2, 0.75)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
@ -3427,9 +3463,9 @@ export function initAbilities() {
|
|||||||
.attr(UnsuppressableAbilityAbAttr)
|
.attr(UnsuppressableAbilityAbAttr)
|
||||||
.attr(NoFusionAbilityAbAttr),
|
.attr(NoFusionAbilityAbAttr),
|
||||||
new Ability(Abilities.POWER_CONSTRUCT, 7) // TODO: 10% Power Construct Zygarde isn't accounted for yet. If changed, update Zygarde's getSpeciesFormIndex entry accordingly
|
new Ability(Abilities.POWER_CONSTRUCT, 7) // TODO: 10% Power Construct Zygarde isn't accounted for yet. If changed, update Zygarde's getSpeciesFormIndex entry accordingly
|
||||||
.attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
|
.attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
|
||||||
.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
|
.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
|
||||||
.attr(PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
|
.attr(PostTurnFormChangeAbAttr, p => p.getHpRatio() <= 0.5 || p.getFormKey() === 'complete' ? 4 : 2)
|
||||||
.attr(UncopiableAbilityAbAttr)
|
.attr(UncopiableAbilityAbAttr)
|
||||||
.attr(UnswappableAbilityAbAttr)
|
.attr(UnswappableAbilityAbAttr)
|
||||||
.attr(UnsuppressableAbilityAbAttr)
|
.attr(UnsuppressableAbilityAbAttr)
|
||||||
|
@ -1353,6 +1353,25 @@ export class BypassSleepAttr extends MoveAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attribute used for moves that bypass the burn damage reduction of physical moves, currently only facade
|
||||||
|
* Called during damage calculation
|
||||||
|
* @param user N/A
|
||||||
|
* @param target N/A
|
||||||
|
* @param move Move with this attribute
|
||||||
|
* @param args Utils.BooleanHolder for burnDamageReductionCancelled
|
||||||
|
* @returns true if the function succeeds
|
||||||
|
*/
|
||||||
|
export class BypassBurnDamageReductionAttr extends MoveAttr {
|
||||||
|
|
||||||
|
/** Prevents the move's damage from being reduced by burn */
|
||||||
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
(args[0] as Utils.BooleanHolder).value = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class WeatherChangeAttr extends MoveEffectAttr {
|
export class WeatherChangeAttr extends MoveEffectAttr {
|
||||||
private weatherType: WeatherType;
|
private weatherType: WeatherType;
|
||||||
|
|
||||||
@ -4904,7 +4923,8 @@ export function initMoves() {
|
|||||||
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -2),
|
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -2),
|
||||||
new AttackMove(Moves.FACADE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 3)
|
new AttackMove(Moves.FACADE, Type.NORMAL, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 3)
|
||||||
.attr(MovePowerMultiplierAttr, (user, target, move) => user.status
|
.attr(MovePowerMultiplierAttr, (user, target, move) => user.status
|
||||||
&& (user.status.effect === StatusEffect.BURN || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.PARALYSIS) ? 2 : 1),
|
&& (user.status.effect === StatusEffect.BURN || user.status.effect === StatusEffect.POISON || user.status.effect === StatusEffect.TOXIC || user.status.effect === StatusEffect.PARALYSIS) ? 2 : 1)
|
||||||
|
.attr(BypassBurnDamageReductionAttr),
|
||||||
new AttackMove(Moves.FOCUS_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 20, -1, -3, 3)
|
new AttackMove(Moves.FOCUS_PUNCH, Type.FIGHTING, MoveCategory.PHYSICAL, 150, 100, 20, -1, -3, 3)
|
||||||
.punchingMove()
|
.punchingMove()
|
||||||
.ignoresVirtual()
|
.ignoresVirtual()
|
||||||
@ -6821,7 +6841,7 @@ export function initMoves() {
|
|||||||
const turnMove = user.getLastXMoves(1);
|
const turnMove = user.getLastXMoves(1);
|
||||||
return !turnMove.length || turnMove[0].move !== move.id || turnMove[0].result !== MoveResult.SUCCESS;
|
return !turnMove.length || turnMove[0].move !== move.id || turnMove[0].result !== MoveResult.SUCCESS;
|
||||||
}), // TODO Add Instruct/Encore interaction
|
}), // TODO Add Instruct/Encore interaction
|
||||||
new AttackMove(Moves.COMEUPPANCE, Type.DARK, MoveCategory.PHYSICAL, 1, 100, 10, -1, 0, 9)
|
new AttackMove(Moves.COMEUPPANCE, Type.DARK, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 9)
|
||||||
.attr(CounterDamageAttr, (move: Move) => (move.category === MoveCategory.PHYSICAL || move.category === MoveCategory.SPECIAL), 1.5)
|
.attr(CounterDamageAttr, (move: Move) => (move.category === MoveCategory.PHYSICAL || move.category === MoveCategory.SPECIAL), 1.5)
|
||||||
.target(MoveTarget.ATTACKER),
|
.target(MoveTarget.ATTACKER),
|
||||||
new AttackMove(Moves.AQUA_CUTTER, Type.WATER, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 9)
|
new AttackMove(Moves.AQUA_CUTTER, Type.WATER, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 9)
|
||||||
|
@ -13,7 +13,7 @@ export default class DamageNumberHandler {
|
|||||||
add(target: Pokemon, amount: integer, result: DamageResult | HitResult.HEAL = HitResult.EFFECTIVE, critical: boolean = false): void {
|
add(target: Pokemon, amount: integer, result: DamageResult | HitResult.HEAL = HitResult.EFFECTIVE, critical: boolean = false): void {
|
||||||
const scene = target.scene;
|
const scene = target.scene;
|
||||||
|
|
||||||
if (!scene.damageNumbersMode)
|
if (!scene?.damageNumbersMode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const battlerIndex = target.getBattlerIndex();
|
const battlerIndex = target.getBattlerIndex();
|
||||||
|
@ -4,7 +4,7 @@ import { Variant, VariantSet, variantColorCache } from '#app/data/variant';
|
|||||||
import { variantData } from '#app/data/variant';
|
import { variantData } from '#app/data/variant';
|
||||||
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
||||||
import { Moves } from "../data/enums/moves";
|
import { Moves } from "../data/enums/moves";
|
||||||
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveTypeAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr } from "../data/move";
|
import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariableAtkAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, OneHitKOAttr, MultiHitAttr, StatusMoveTypeImmunityAttr, MoveTarget, VariableDefAttr, AttackMove, ModifiedDamageAttr, VariableMoveTypeMultiplierAttr, IgnoreOpponentStatChangesAttr, SacrificialAttr, VariableMoveTypeAttr, VariableMoveCategoryAttr, CounterDamageAttr, StatChangeAttr, RechargeAttr, ChargeAttr, IgnoreWeatherTypeDebuffAttr, BypassBurnDamageReductionAttr } from "../data/move";
|
||||||
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from '../data/pokemon-species';
|
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from '../data/pokemon-species';
|
||||||
import * as Utils from '../utils';
|
import * as Utils from '../utils';
|
||||||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
||||||
@ -27,7 +27,7 @@ import { TempBattleStat } from '../data/temp-battle-stat';
|
|||||||
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag';
|
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag';
|
||||||
import { ArenaTagType } from "../data/enums/arena-tag-type";
|
import { ArenaTagType } from "../data/enums/arena-tag-type";
|
||||||
import { Biome } from "../data/enums/biome";
|
import { Biome } from "../data/enums/biome";
|
||||||
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr } from '../data/ability';
|
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr } from '../data/ability';
|
||||||
import { Abilities } from "#app/data/enums/abilities";
|
import { Abilities } from "#app/data/enums/abilities";
|
||||||
import PokemonData from '../system/pokemon-data';
|
import PokemonData from '../system/pokemon-data';
|
||||||
import Battle, { BattlerIndex } from '../battle';
|
import Battle, { BattlerIndex } from '../battle';
|
||||||
@ -1225,24 +1225,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.level >= 25) { // No egg moves below level 25
|
if (this.level >= 60) { // No egg moves below level 60
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
const moveId = speciesEggMoves[this.species.getRootSpeciesId()][i];
|
const moveId = speciesEggMoves[this.species.getRootSpeciesId()][i];
|
||||||
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
|
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
|
||||||
movePool.push([moveId, Math.min(this.level * 0.5, 40)]);
|
movePool.push([moveId, Math.min(this.level * 0.5, 40)]);
|
||||||
}
|
}
|
||||||
const moveId = speciesEggMoves[this.species.getRootSpeciesId()][3];
|
|
||||||
if (this.level >= 60 && !movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) // No rare egg moves before level 60
|
|
||||||
movePool.push([moveId, Math.min(this.level * 0.2, 20)]);
|
|
||||||
if (this.fusionSpecies) {
|
if (this.fusionSpecies) {
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][i];
|
const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][i];
|
||||||
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
|
if (!movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)'))
|
||||||
movePool.push([moveId, Math.min(this.level * 0.5, 30)]);
|
movePool.push([moveId, Math.min(this.level * 0.5, 30)]);
|
||||||
}
|
}
|
||||||
const moveId = speciesEggMoves[this.fusionSpecies.getRootSpeciesId()][3];
|
|
||||||
if (this.level >= 60 && !movePool.some(m => m[0] === moveId) && !allMoves[moveId].name.endsWith(' (N)')) // No rare egg moves before level 60
|
|
||||||
movePool.push([moveId, Math.min(this.level * 0.2, 20)]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1540,11 +1534,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (!isTypeImmune) {
|
if (!isTypeImmune) {
|
||||||
damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier.value);
|
damage.value = Math.ceil(((((2 * source.level / 5 + 2) * power.value * sourceAtk.value / targetDef.value) / 50) + 2) * stabMultiplier.value * typeMultiplier.value * arenaAttackTypeMultiplier.value * screenMultiplier.value * ((this.scene.randBattleSeedInt(15) + 85) / 100) * criticalMultiplier.value);
|
||||||
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
|
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
|
||||||
const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
|
if(!move.getAttrs(BypassBurnDamageReductionAttr).length) {
|
||||||
applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled);
|
const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
|
||||||
if (!burnDamageReductionCancelled.value)
|
applyAbAttrs(BypassBurnDamageReductionAbAttr, source, burnDamageReductionCancelled);
|
||||||
damage.value = Math.floor(damage.value / 2);
|
if (!burnDamageReductionCancelled.value)
|
||||||
|
damage.value = Math.floor(damage.value / 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage);
|
||||||
|
|
||||||
move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => {
|
move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => {
|
||||||
if (this.getTag(hta.tagType))
|
if (this.getTag(hta.tagType))
|
||||||
damage.value *= 2;
|
damage.value *= 2;
|
||||||
|
5
src/locales/de/ability-trigger.ts
Normal file
5
src/locales/de/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const deConfig = {
|
export const deConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": "N: Wesen Ändern",
|
"cycleNature": "N: Wesen Ändern",
|
||||||
"cycleVariant": "V: Seltenheit ändern",
|
"cycleVariant": "V: Seltenheit ändern",
|
||||||
"enablePassive": "Passiv-Skill aktivieren",
|
"enablePassive": "Passiv-Skill aktivieren",
|
||||||
"disablePassive": "Passiv-Skill deaktivieren"
|
"disablePassive": "Passiv-Skill deaktivieren",
|
||||||
|
"locked": "Gesperrt",
|
||||||
|
"disabled": "Deaktiviert",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
5
src/locales/en/ability-trigger.ts
Normal file
5
src/locales/en/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const enConfig = {
|
export const enConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": 'N: Cycle Nature',
|
"cycleNature": 'N: Cycle Nature',
|
||||||
"cycleVariant": 'V: Cycle Variant',
|
"cycleVariant": 'V: Cycle Variant',
|
||||||
"enablePassive": "Enable Passive",
|
"enablePassive": "Enable Passive",
|
||||||
"disablePassive": "Disable Passive"
|
"disablePassive": "Disable Passive",
|
||||||
|
"locked": "Locked",
|
||||||
|
"disabled": "Disabled",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
5
src/locales/es/ability-trigger.ts
Normal file
5
src/locales/es/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const esConfig = {
|
export const esConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": 'N: Cambiar Naturaleza',
|
"cycleNature": 'N: Cambiar Naturaleza',
|
||||||
"cycleVariant": 'V: Cambiar Variante',
|
"cycleVariant": 'V: Cambiar Variante',
|
||||||
"enablePassive": "Activar Pasiva",
|
"enablePassive": "Activar Pasiva",
|
||||||
"disablePassive": "Desactivar Pasiva"
|
"disablePassive": "Desactivar Pasiva",
|
||||||
|
"locked": "Locked",
|
||||||
|
"disabled": "Disabled",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
5
src/locales/fr/ability-trigger.ts
Normal file
5
src/locales/fr/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const frConfig = {
|
export const frConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": "N: » Natures",
|
"cycleNature": "N: » Natures",
|
||||||
"cycleVariant": "V: » Variants",
|
"cycleVariant": "V: » Variants",
|
||||||
"enablePassive": "Activer Passif",
|
"enablePassive": "Activer Passif",
|
||||||
"disablePassive": "Désactiver Passif"
|
"disablePassive": "Désactiver Passif",
|
||||||
|
"locked": "Verrouillé",
|
||||||
|
"disabled": "Désactivé",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
||||||
|
5
src/locales/it/ability-trigger.ts
Normal file
5
src/locales/it/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const itConfig = {
|
export const itConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": 'N: Alterna Natura',
|
"cycleNature": 'N: Alterna Natura',
|
||||||
"cycleVariant": 'V: Alterna Variante',
|
"cycleVariant": 'V: Alterna Variante',
|
||||||
"enablePassive": "Attiva Passiva",
|
"enablePassive": "Attiva Passiva",
|
||||||
"disablePassive": "Disattiva Passiva"
|
"disablePassive": "Disattiva Passiva",
|
||||||
|
"locked": "Locked",
|
||||||
|
"disabled": "Disabled",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ export const battle: SimpleTranslationEntries = {
|
|||||||
"trainerComeBack": "{{trainerName}} retirou {{pokemonName}} da batalha!",
|
"trainerComeBack": "{{trainerName}} retirou {{pokemonName}} da batalha!",
|
||||||
"playerGo": "{{pokemonName}}, eu escolho você!",
|
"playerGo": "{{pokemonName}}, eu escolho você!",
|
||||||
"trainerGo": "{{trainerName}} enviou {{pokemonName}}!",
|
"trainerGo": "{{trainerName}} enviou {{pokemonName}}!",
|
||||||
"switchQuestion": "Quer trocar\n{{pokemonName}}?",
|
"switchQuestion": "Quer trocar\nde {{pokemonName}}?",
|
||||||
"trainerDefeated": "Você derrotou\n{{trainerName}}!",
|
"trainerDefeated": "Você derrotou\n{{trainerName}}!",
|
||||||
"pokemonCaught": "{{pokemonName}} foi capturado!",
|
"pokemonCaught": "{{pokemonName}} foi capturado!",
|
||||||
"pokemon": "Pokémon",
|
"pokemon": "Pokémon",
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": 'N: Mudar Nature',
|
"cycleNature": 'N: Mudar Nature',
|
||||||
"cycleVariant": 'V: Mudar Variante',
|
"cycleVariant": 'V: Mudar Variante',
|
||||||
"enablePassive": "Ativar Passiva",
|
"enablePassive": "Ativar Passiva",
|
||||||
"disablePassive": "Desativar Passiva"
|
"disablePassive": "Desativar Passiva",
|
||||||
|
"locked": "Bloqueado",
|
||||||
|
"disabled": "Desativado",
|
||||||
|
"uncaught": "Não capturado"
|
||||||
}
|
}
|
@ -1,43 +1,51 @@
|
|||||||
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
export const tutorial: SimpleTranslationEntries = {
|
export const tutorial: SimpleTranslationEntries = {
|
||||||
"intro": `Bem-vindo ao PokéRogue! Este é um jogo de Pokémon feito por fãs focado em batalha com elementos roguelite.
|
"intro": `Bem-vindo ao PokéRogue! Este é um jogo Pokémon feito por fãs focado em batalhas com elementos roguelite.
|
||||||
$Este jogo não é monetizado e não reivindicamos propriedade de Pokémon nem dos ativos protegidos por direitos autorais usados.
|
$Este jogo não é monetizado e não reivindicamos propriedade de Pokémon nem dos ativos protegidos
|
||||||
$O jogo é um trabalho em andamento, mas totalmente jogável.\nPara relatórios de bugs, use a comunidade no Discord.
|
$por direitos autorais usados.
|
||||||
$Se o jogo rodar lentamente, certifique-se de que a 'Aceleração de hardware' esteja ativada nas configurações do seu navegador.`,
|
$O jogo é um trabalho em andamento, mas é totalmente jogável.
|
||||||
|
$Para relatórios de bugs, use a comunidade no Discord.
|
||||||
|
$Se o jogo estiver rodando lentamente, certifique-se de que a 'Aceleração de hardware' esteja ativada
|
||||||
|
$nas configurações do seu navegador.`,
|
||||||
|
|
||||||
"accessMenu": `Para acessar o menu, aperte M ou Esc.
|
"accessMenu": `Para acessar o menu, aperte M ou Esc.
|
||||||
$O menu contém configurações e diversas funções.`,
|
$O menu contém configurações e diversas funções.`,
|
||||||
|
|
||||||
"menu": `A partir deste menu, você pode acessar as configurações.
|
"menu": `A partir deste menu, você pode acessar as configurações.
|
||||||
$Nas configurações, você pode alterar a velocidade do jogo, o estilo da janela e outras opções.
|
$Nas configurações, você pode alterar a velocidade do jogo,
|
||||||
$Existem também vários outros recursos aqui, então não deixe de conferir todos eles!`,
|
$o estilo da janela, entre outras opções.
|
||||||
|
$Existem também vários outros recursos disponíveis aqui.
|
||||||
|
$Não deixe de conferir todos eles!`,
|
||||||
|
|
||||||
"starterSelect": `Nessa tela, você pode selecionar seus iniciais.\nEsses são os Pokémon iniciais da sua equipe.
|
"starterSelect": `Aqui você pode escolher seus iniciais.\nEsses serão os primeiro Pokémon da sua equipe.
|
||||||
$Cada inicial tem seu próprio custo. Sua equipe pode ter até \n6 membros contando que o preço não ultrapasse 10.
|
$Cada inicial tem seu custo. Sua equipe pode ter até 6\nmembros, desde que a soma dos custos não ultrapasse 10.
|
||||||
$Você pode também selecionar o gênero, habilidade, e formas dependendo \ndas variantes que você capturou ou chocou.
|
$Você pode escolher o gênero, a habilidade\ne até a forma do seu inicial.
|
||||||
$Os IVs da espécie são os melhores de todos que você \njá capturou ou chocou, então tente conseguir vários Pokémon da mesma espécie!`,
|
$Essas opções dependem das variantes dessa\nespécie que você já capturou ou chocou.
|
||||||
|
$Os IVs de cada inicial são os melhores de todos os Pokémon\ndaquela espécie que você já capturou ou chocou.
|
||||||
|
$Sempre capture vários Pokémon de várias espécies!`,
|
||||||
|
|
||||||
"pokerus": `Todo dia, 3 Pokémon iniciais ficam com uma borda roxa.
|
"pokerus": `Todo dia, 3 Pokémon iniciais ficam com uma borda roxa.
|
||||||
$Caso veja um inicial que você possui com uma dessa, tente\nadicioná-lo a sua equipe. Lembre-se de olhar seu sumário!`,
|
$Caso veja um inicial que você possui com uma dessa, tente\nadicioná-lo a sua equipe. Lembre-se de olhar seu sumário!`,
|
||||||
|
|
||||||
"statChange": `As mudanças de estatísticas se mantém depois do combate\ndesde que o Pokémon não seja trocado.
|
"statChange": `As mudanças de atributos se mantém após a batalha desde que o Pokémon não seja trocado.
|
||||||
$Seus Pokémon voltam a suas Poké Bolas antes de batalhas contra treinadores e de entrar em um novo bioma.
|
$Seus Pokémon voltam a suas Poké Bolas antes de batalhas contra treinadores e de entrar em um novo bioma.
|
||||||
$Também é possível ver as mudanças de estatísticas dos Pokémon em campo mantendo pressionado C ou Shift.`,
|
$Para ver as mudanças de atributos dos Pokémon em campo, mantena C ou Shift pressionado durante a batalha.`,
|
||||||
|
|
||||||
"selectItem": `Após cada batalha você pode escolher entre 3 itens aleatórios.\nVocê pode escolher apenas um.
|
"selectItem": `Após cada batalha, você pode escolher entre 3 itens aleatórios.
|
||||||
$Esses variam entre consumíveis, itens de segurar, e itens passivos permanentes.
|
$Você pode escolher apenas um deles.
|
||||||
$A maioria dos efeitos de itens não consumíveis serão acumulados de várias maneiras.
|
$Esses itens variam entre consumíveis, itens de segurar e itens passivos permanentes.
|
||||||
$Alguns itens só aparecerão se puderem ser usados, por exemplo, itens de evolução.
|
$A maioria dos efeitos de itens não consumíveis podem ser acumulados.
|
||||||
$Você também pode transferir itens de segurar entre os Pokémon utilizando a opção de transferir.
|
$Alguns itens só aparecerão se puderem ser usados, como os itens de evolução.
|
||||||
|
$Você também pode transferir itens de segurar entre os Pokémon utilizando a opção "Transfer".
|
||||||
$A opção de transferir irá aparecer no canto inferior direito assim que você obter um item de segurar.
|
$A opção de transferir irá aparecer no canto inferior direito assim que você obter um item de segurar.
|
||||||
$Você pode comprar itens consumíveis com dinheiro, e uma maior variedade ficará disponível conforme você for mais longe.
|
$Você pode comprar itens consumíveis com dinheiro, e sua variedade aumentará conforme você for mais longe.
|
||||||
$Certifique-se de comprá-los antes de escolher seu item aleatório. Ao escolher, a próxima batalha começará.`,
|
$Certifique-se de comprá-los antes de escolher seu item aleatório. Ao escolhê-lo, a próxima batalha começará.`,
|
||||||
|
|
||||||
"eggGacha": `Nesta tela você pode trocar seus vouchers\npor ovos de Pokémon.
|
"eggGacha": `Aqui você pode trocar seus vouchers\npor ovos de Pokémon.
|
||||||
$Ovos ficam mais próximos de chocar depois de cada batalha.\nOvos raros demoram mais para chocar.
|
$Ovos ficam mais próximos de chocar após cada batalha.\nOvos mais raros demoram mais para chocar.
|
||||||
$Pokémon chocados não serão adicionados a sua equipe,\nmas sim aos seus iniciais.
|
$Pokémon chocados não serão adicionados a sua equipe,\nmas sim aos seus iniciais.
|
||||||
$Pokémon chocados geralmente possuem IVs melhores\nque Pokémon selvagens.
|
$Pokémon chocados geralmente possuem IVs melhores\nque Pokémon selvagens.
|
||||||
$Alguns Pokémon só podem ser obtidos através de seus ovos.
|
$Alguns Pokémon só podem ser obtidos através de seus ovos.
|
||||||
$Há 3 máquinas, cada uma com um bônus diferente,\nentão escolha a que mais lhe convém!`,
|
$Temos 3 máquinas, cada uma com seu bônus específico,\nentão escolha a que mais lhe convém!`,
|
||||||
} as const;
|
} as const;
|
5
src/locales/zh_CN/ability-trigger.ts
Normal file
5
src/locales/zh_CN/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -15,6 +16,7 @@ import { nature } from "./nature";
|
|||||||
|
|
||||||
export const zhCnConfig = {
|
export const zhCnConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -28,5 +28,8 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
|
|||||||
"cycleNature": 'N: 切换性格',
|
"cycleNature": 'N: 切换性格',
|
||||||
"cycleVariant": 'V: 切换变种',
|
"cycleVariant": 'V: 切换变种',
|
||||||
"enablePassive": "启用被动",
|
"enablePassive": "启用被动",
|
||||||
"disablePassive": "禁用被动"
|
"disablePassive": "禁用被动",
|
||||||
|
"locked": "Locked",
|
||||||
|
"disabled": "Disabled",
|
||||||
|
"uncaught": "Uncaught"
|
||||||
}
|
}
|
@ -554,10 +554,10 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
|
|||||||
super(Utils.toReadableString(EvolutionItem[evolutionItem]), `Causes certain Pokémon to evolve`, (_type, args) => new Modifiers.EvolutionItemModifier(this, (args[0] as PlayerPokemon).id),
|
super(Utils.toReadableString(EvolutionItem[evolutionItem]), `Causes certain Pokémon to evolve`, (_type, args) => new Modifiers.EvolutionItemModifier(this, (args[0] as PlayerPokemon).id),
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && pokemonEvolutions[pokemon.species.speciesId].filter(e => e.item === this.evolutionItem
|
if (pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) && pokemonEvolutions[pokemon.species.speciesId].filter(e => e.item === this.evolutionItem
|
||||||
&& (!e.condition || e.condition.predicate(pokemon))).length)
|
&& (!e.condition || e.condition.predicate(pokemon))).length && (pokemon.formIndex == 0))
|
||||||
return null;
|
return null;
|
||||||
else if (pokemon.isFusion() && pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.item === this.evolutionItem
|
else if (pokemon.isFusion() && pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) && pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.item === this.evolutionItem
|
||||||
&& (!e.condition || e.condition.predicate(pokemon))).length)
|
&& (!e.condition || e.condition.predicate(pokemon))).length && (pokemon.fusionFormIndex == 0))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
|
@ -635,6 +635,9 @@ export class PokemonBaseStatModifier extends PokemonHeldItemModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies Specific Type item boosts (e.g., Magnet)
|
||||||
|
*/
|
||||||
export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
|
export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
|
||||||
private moveType: Type;
|
private moveType: Type;
|
||||||
private boostMultiplier: number;
|
private boostMultiplier: number;
|
||||||
@ -667,8 +670,15 @@ export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
|
|||||||
return super.shouldApply(args) && args.length === 3 && typeof args[1] === 'number' && args[2] instanceof Utils.NumberHolder;
|
return super.shouldApply(args) && args.length === 3 && typeof args[1] === 'number' && args[2] instanceof Utils.NumberHolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array<any>} args Array
|
||||||
|
* - Index 0: {Pokemon} Pokemon
|
||||||
|
* - Index 1: {number} Move type
|
||||||
|
* - Index 2: {Utils.NumberHolder} Move power
|
||||||
|
* @returns {boolean} Returns true if boosts have been applied to the move.
|
||||||
|
*/
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
if (args[1] === this.moveType) {
|
if (args[1] === this.moveType && (args[2] as Utils.NumberHolder).value >= 1) {
|
||||||
(args[2] as Utils.NumberHolder).value = Math.floor((args[2] as Utils.NumberHolder).value * (1 + (this.getStackCount() * this.boostMultiplier)));
|
(args[2] as Utils.NumberHolder).value = Math.floor((args[2] as Utils.NumberHolder).value * (1 + (this.getStackCount() * this.boostMultiplier)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -775,7 +775,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
|
|
||||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
if (!this.loaded) {
|
if (!this.loaded) {
|
||||||
this.scene.gameData.saveAll(this.scene, true).then(success => {
|
this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 5 === 1).then(success => {
|
||||||
this.scene.disableMenu = false;
|
this.scene.disableMenu = false;
|
||||||
if (!success)
|
if (!success)
|
||||||
return this.scene.reset(true);
|
return this.scene.reset(true);
|
||||||
|
@ -98,7 +98,8 @@ declare module 'i18next' {
|
|||||||
menu: SimpleTranslationEntries;
|
menu: SimpleTranslationEntries;
|
||||||
menuUiHandler: SimpleTranslationEntries;
|
menuUiHandler: SimpleTranslationEntries;
|
||||||
move: MoveTranslationEntries;
|
move: MoveTranslationEntries;
|
||||||
battle: SimpleTranslationEntries,
|
battle: SimpleTranslationEntries;
|
||||||
|
abilityTriggers: SimpleTranslationEntries;
|
||||||
ability: AbilityTranslationEntries;
|
ability: AbilityTranslationEntries;
|
||||||
pokeball: SimpleTranslationEntries;
|
pokeball: SimpleTranslationEntries;
|
||||||
pokemon: SimpleTranslationEntries;
|
pokemon: SimpleTranslationEntries;
|
||||||
|
@ -277,7 +277,7 @@ export class GameData {
|
|||||||
const maxIntAttrValue = Math.pow(2, 31);
|
const maxIntAttrValue = Math.pow(2, 31);
|
||||||
const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v);
|
const systemData = JSON.stringify(data, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v);
|
||||||
|
|
||||||
if (!bypassLogin) {
|
if (!bypassLogin && !localStorage.getItem('data')) {
|
||||||
Utils.apiPost(`savedata/update?datatype=${GameDataType.SYSTEM}`, systemData, undefined, true)
|
Utils.apiPost(`savedata/update?datatype=${GameDataType.SYSTEM}`, systemData, undefined, true)
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(error => {
|
.then(error => {
|
||||||
@ -293,12 +293,15 @@ export class GameData {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
}
|
}
|
||||||
|
localStorage.removeItem('data');
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem('data_bak', localStorage.getItem('data'));
|
const encFunc = bypassLogin
|
||||||
|
? (data: string) => btoa(data)
|
||||||
|
: (data: string) => AES.encrypt(data, saveKey);
|
||||||
|
|
||||||
localStorage.setItem('data', btoa(systemData));
|
localStorage.setItem('data', encFunc(systemData));
|
||||||
|
|
||||||
this.scene.ui.savingIcon.hide();
|
this.scene.ui.savingIcon.hide();
|
||||||
|
|
||||||
@ -309,7 +312,7 @@ export class GameData {
|
|||||||
|
|
||||||
public loadSystem(): Promise<boolean> {
|
public loadSystem(): Promise<boolean> {
|
||||||
return new Promise<boolean>(resolve => {
|
return new Promise<boolean>(resolve => {
|
||||||
if (bypassLogin && !localStorage.hasOwnProperty('data'))
|
if (bypassLogin && !localStorage.getItem('data'))
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
|
|
||||||
const handleSystemData = (systemDataStr: string) => {
|
const handleSystemData = (systemDataStr: string) => {
|
||||||
@ -421,7 +424,7 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bypassLogin) {
|
if (!bypassLogin && !localStorage.getItem('data')) {
|
||||||
Utils.apiFetch(`savedata/get?datatype=${GameDataType.SYSTEM}`, true)
|
Utils.apiFetch(`savedata/get?datatype=${GameDataType.SYSTEM}`, true)
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@ -439,8 +442,12 @@ export class GameData {
|
|||||||
|
|
||||||
handleSystemData(response);
|
handleSystemData(response);
|
||||||
});
|
});
|
||||||
} else
|
} else {
|
||||||
handleSystemData(atob(localStorage.getItem('data')));
|
const decFunc = bypassLogin
|
||||||
|
? (data: string) => atob(data)
|
||||||
|
: (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8);
|
||||||
|
handleSystemData(decFunc(localStorage.getItem('data')));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,40 +564,6 @@ export class GameData {
|
|||||||
} as SessionSaveData;
|
} as SessionSaveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveSession(scene: BattleScene, skipVerification?: boolean): Promise<boolean> {
|
|
||||||
return new Promise<boolean>(resolve => {
|
|
||||||
Utils.executeIf(!skipVerification, updateUserInfo).then(success => {
|
|
||||||
if (success !== null && !success)
|
|
||||||
return resolve(false);
|
|
||||||
|
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
|
||||||
|
|
||||||
if (!bypassLogin) {
|
|
||||||
Utils.apiPost(`savedata/update?datatype=${GameDataType.SESSION}&slot=${scene.sessionSlotId}&trainerId=${this.trainerId}&secretId=${this.secretId}`, JSON.stringify(sessionData), undefined, true)
|
|
||||||
.then(response => response.text())
|
|
||||||
.then(error => {
|
|
||||||
if (error) {
|
|
||||||
if (error.startsWith('session out of date')) {
|
|
||||||
this.scene.clearPhaseQueue();
|
|
||||||
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
|
|
||||||
}
|
|
||||||
console.error(error);
|
|
||||||
return resolve(false);
|
|
||||||
}
|
|
||||||
console.debug('Session data saved');
|
|
||||||
resolve(true);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, btoa(JSON.stringify(sessionData)));
|
|
||||||
|
|
||||||
console.debug('Session data saved');
|
|
||||||
|
|
||||||
resolve(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getSession(slotId: integer): Promise<SessionSaveData> {
|
getSession(slotId: integer): Promise<SessionSaveData> {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (slotId < 0)
|
if (slotId < 0)
|
||||||
@ -605,7 +578,7 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!bypassLogin) {
|
if (!bypassLogin && !localStorage.getItem(`sessionData${slotId ? slotId : ''}`)) {
|
||||||
Utils.apiFetch(`savedata/get?datatype=${GameDataType.SESSION}&slot=${slotId}`, true)
|
Utils.apiFetch(`savedata/get?datatype=${GameDataType.SESSION}&slot=${slotId}`, true)
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(async response => {
|
.then(async response => {
|
||||||
@ -618,9 +591,12 @@ export class GameData {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const sessionData = localStorage.getItem(`sessionData${slotId ? slotId : ''}`);
|
const sessionData = localStorage.getItem(`sessionData${slotId ? slotId : ''}`);
|
||||||
if (sessionData)
|
if (sessionData) {
|
||||||
await handleSessionData(atob(sessionData));
|
const decFunc = bypassLogin
|
||||||
else
|
? (data: string) => atob(data)
|
||||||
|
: (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8);
|
||||||
|
await handleSessionData(decFunc(sessionData));
|
||||||
|
} else
|
||||||
return resolve(null);
|
return resolve(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -731,7 +707,7 @@ export class GameData {
|
|||||||
deleteSession(slotId: integer): Promise<boolean> {
|
deleteSession(slotId: integer): Promise<boolean> {
|
||||||
return new Promise<boolean>(resolve => {
|
return new Promise<boolean>(resolve => {
|
||||||
if (bypassLogin) {
|
if (bypassLogin) {
|
||||||
localStorage.removeItem('sessionData');
|
localStorage.removeItem(`sessionData${this.scene.sessionSlotId ? this.scene.sessionSlotId : ''}`);
|
||||||
return resolve(true);
|
return resolve(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,6 +717,7 @@ export class GameData {
|
|||||||
Utils.apiFetch(`savedata/delete?datatype=${GameDataType.SESSION}&slot=${slotId}`, true).then(response => {
|
Utils.apiFetch(`savedata/delete?datatype=${GameDataType.SESSION}&slot=${slotId}`, true).then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
loggedInUser.lastSessionSlot = -1;
|
loggedInUser.lastSessionSlot = -1;
|
||||||
|
localStorage.removeItem(`sessionData${this.scene.sessionSlotId ? this.scene.sessionSlotId : ''}`);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
return response.text();
|
return response.text();
|
||||||
@ -771,8 +748,10 @@ export class GameData {
|
|||||||
return resolve([false, false]);
|
return resolve([false, false]);
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
const sessionData = this.getSessionSaveData(scene);
|
||||||
Utils.apiPost(`savedata/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
Utils.apiPost(`savedata/clear?slot=${slotId}&trainerId=${this.trainerId}&secretId=${this.secretId}`, JSON.stringify(sessionData), undefined, true).then(response => {
|
||||||
if (response.ok)
|
if (response.ok) {
|
||||||
loggedInUser.lastSessionSlot = -1;
|
loggedInUser.lastSessionSlot = -1;
|
||||||
|
localStorage.removeItem(`sessionData${this.scene.sessionSlotId ? this.scene.sessionSlotId : ''}`);
|
||||||
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
}).then(jsonResponse => {
|
}).then(jsonResponse => {
|
||||||
if (!jsonResponse.error)
|
if (!jsonResponse.error)
|
||||||
@ -825,13 +804,13 @@ export class GameData {
|
|||||||
}) as SessionSaveData;
|
}) as SessionSaveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveAll(scene: BattleScene, skipVerification?: boolean): Promise<boolean> {
|
saveAll(scene: BattleScene, skipVerification: boolean = false, sync: boolean = false): Promise<boolean> {
|
||||||
return new Promise<boolean>(resolve => {
|
return new Promise<boolean>(resolve => {
|
||||||
Utils.executeIf(!skipVerification, updateUserInfo).then(success => {
|
Utils.executeIf(!skipVerification, updateUserInfo).then(success => {
|
||||||
if (success !== null && !success)
|
if (success !== null && !success)
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
this.scene.ui.savingIcon.show();
|
if (sync)
|
||||||
const data = this.getSystemSaveData();
|
this.scene.ui.savingIcon.show();
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
const sessionData = this.getSessionSaveData(scene);
|
||||||
|
|
||||||
const maxIntAttrValue = Math.pow(2, 31);
|
const maxIntAttrValue = Math.pow(2, 31);
|
||||||
@ -843,11 +822,12 @@ export class GameData {
|
|||||||
sessionSlotId: scene.sessionSlotId
|
sessionSlotId: scene.sessionSlotId
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!bypassLogin) {
|
if (!bypassLogin && sync) {
|
||||||
Utils.apiPost('savedata/updateall', JSON.stringify(request, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v), undefined, true)
|
Utils.apiPost('savedata/updateall', JSON.stringify(request, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v), undefined, true)
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(error => {
|
.then(error => {
|
||||||
this.scene.ui.savingIcon.hide();
|
if (sync)
|
||||||
|
this.scene.ui.savingIcon.hide();
|
||||||
if (error) {
|
if (error) {
|
||||||
if (error.startsWith('client version out of date')) {
|
if (error.startsWith('client version out of date')) {
|
||||||
this.scene.clearPhaseQueue();
|
this.scene.clearPhaseQueue();
|
||||||
@ -859,14 +839,18 @@ export class GameData {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
}
|
}
|
||||||
|
localStorage.removeItem('data');
|
||||||
|
localStorage.removeItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem('data_bak', localStorage.getItem('data'));
|
const encFunc = bypassLogin
|
||||||
|
? (data: string) => btoa(data)
|
||||||
|
: (data: string) => AES.encrypt(data, saveKey);
|
||||||
|
|
||||||
localStorage.setItem('data', btoa(JSON.stringify(systemData, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v)));
|
localStorage.setItem('data', encFunc(JSON.stringify(systemData, (k: any, v: any) => typeof v === 'bigint' ? v <= maxIntAttrValue ? Number(v) : v.toString() : v)));
|
||||||
|
|
||||||
localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, btoa(JSON.stringify(sessionData)));
|
localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, encFunc(JSON.stringify(sessionData)));
|
||||||
|
|
||||||
console.debug('Session data saved');
|
console.debug('Session data saved');
|
||||||
|
|
||||||
@ -910,8 +894,12 @@ export class GameData {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const data = localStorage.getItem(dataKey);
|
const data = localStorage.getItem(dataKey);
|
||||||
if (data)
|
if (data) {
|
||||||
handleData(atob(data));
|
const decFunc = bypassLogin
|
||||||
|
? (data: string) => atob(data)
|
||||||
|
: (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8);
|
||||||
|
handleData(decFunc(data));
|
||||||
|
}
|
||||||
resolve(!!data);
|
resolve(!!data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -979,7 +967,7 @@ export class GameData {
|
|||||||
return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500));
|
return this.scene.ui.showText(`Your ${dataName} data could not be loaded. It may be corrupted.`, null, () => this.scene.ui.showText(null, 0), Utils.fixedInt(1500));
|
||||||
this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => {
|
this.scene.ui.showText(`Your ${dataName} data will be overridden and the page will reload. Proceed?`, null, () => {
|
||||||
this.scene.ui.setOverlayMode(Mode.CONFIRM, () => {
|
this.scene.ui.setOverlayMode(Mode.CONFIRM, () => {
|
||||||
if (!bypassLogin && dataType < GameDataType.SETTINGS) {
|
if (!bypassLogin && dataType < GameDataType.SETTINGS && localStorage.getItem(dataKey)) {
|
||||||
updateUserInfo().then(success => {
|
updateUserInfo().then(success => {
|
||||||
if (!success)
|
if (!success)
|
||||||
return displayError(`Could not contact the server. Your ${dataName} data could not be imported.`);
|
return displayError(`Could not contact the server. Your ${dataName} data could not be imported.`);
|
||||||
@ -990,11 +978,15 @@ export class GameData {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
return displayError(`An error occurred while updating ${dataName} data. Please contact the administrator.`);
|
return displayError(`An error occurred while updating ${dataName} data. Please contact the administrator.`);
|
||||||
}
|
}
|
||||||
|
localStorage.removeItem(dataKey);
|
||||||
window.location = window.location;
|
window.location = window.location;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem(dataKey, btoa(dataStr));
|
const encFunc = bypassLogin || dataType === GameDataType.SETTINGS
|
||||||
|
? (data: string) => btoa(data)
|
||||||
|
: (data: string) => AES.encrypt(data, saveKey);
|
||||||
|
localStorage.setItem(dataKey, encFunc(dataStr));
|
||||||
window.location = window.location;
|
window.location = window.location;
|
||||||
}
|
}
|
||||||
}, () => {
|
}, () => {
|
||||||
|
@ -206,19 +206,20 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
|
|||||||
label: 'Deutsch',
|
label: 'Deutsch',
|
||||||
handler: () => changeLocaleHandler('de')
|
handler: () => changeLocaleHandler('de')
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '简体中文',
|
|
||||||
handler: () => changeLocaleHandler('zh_CN')
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'Português (BR)',
|
label: 'Português (BR)',
|
||||||
handler: () => changeLocaleHandler('pt_BR')
|
handler: () => changeLocaleHandler('pt_BR')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '简体中文',
|
||||||
|
handler: () => changeLocaleHandler('zh_CN')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
handler: () => cancelHandler()
|
handler: () => cancelHandler()
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
maxOptions: 7
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
import BattleScene, { starterColors } from "../battle-scene";
|
|
||||||
import PokemonSpecies, { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, speciesStarters, starterPassiveAbilities, getStarterValueFriendshipCap } from "../data/pokemon-species";
|
|
||||||
import { Species } from "../data/enums/species";
|
|
||||||
import { TextStyle, addBBCodeTextObject, addTextObject } from "./text";
|
|
||||||
import { Mode } from "./ui";
|
|
||||||
import MessageUiHandler from "./message-ui-handler";
|
|
||||||
import { Gender, getGenderColor, getGenderSymbol } from "../data/gender";
|
|
||||||
import { allAbilities } from "../data/ability";
|
|
||||||
import { GameModes, gameModes } from "../game-mode";
|
|
||||||
import { GrowthRate, getGrowthRateColor } from "../data/exp";
|
|
||||||
import { AbilityAttr, DexAttr, DexAttrProps, DexEntry, Passive as PassiveAttr, StarterFormMoveData, StarterMoveset } from "../system/game-data";
|
|
||||||
import * as Utils from "../utils";
|
|
||||||
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler";
|
|
||||||
import { StatsContainer } from "./stats-container";
|
|
||||||
import { addWindow } from "./ui-theme";
|
|
||||||
import { Nature, getNatureName } from "../data/nature";
|
|
||||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
|
||||||
import { pokemonFormChanges } from "../data/pokemon-forms";
|
|
||||||
import { Tutorial, handleTutorial } from "../tutorial";
|
|
||||||
import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/pokemon-level-moves";
|
|
||||||
import { allMoves } from "../data/move";
|
|
||||||
import { Type } from "../data/type";
|
|
||||||
import { Moves } from "../data/enums/moves";
|
|
||||||
import { speciesEggMoves } from "../data/egg-moves";
|
|
||||||
import { TitlePhase } from "../phases";
|
|
||||||
import { argbFromRgba } from "@material/material-color-utilities";
|
|
||||||
import { OptionSelectItem } from "./abstact-option-select-ui-handler";
|
|
||||||
import { pokemonPrevolutions } from "#app/data/pokemon-evolutions";
|
import { pokemonPrevolutions } from "#app/data/pokemon-evolutions";
|
||||||
import { Variant, getVariantTint } from "#app/data/variant";
|
import { Variant, getVariantTint } from "#app/data/variant";
|
||||||
|
import { argbFromRgba } from "@material/material-color-utilities";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import {Button} from "../enums/buttons";
|
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||||
|
import BattleScene, { starterColors } from "../battle-scene";
|
||||||
|
import { allAbilities } from "../data/ability";
|
||||||
|
import { speciesEggMoves } from "../data/egg-moves";
|
||||||
|
import { Moves } from "../data/enums/moves";
|
||||||
|
import { Species } from "../data/enums/species";
|
||||||
|
import { GrowthRate, getGrowthRateColor } from "../data/exp";
|
||||||
|
import { Gender, getGenderColor, getGenderSymbol } from "../data/gender";
|
||||||
|
import { allMoves } from "../data/move";
|
||||||
|
import { Nature, getNatureName } from "../data/nature";
|
||||||
|
import { pokemonFormChanges } from "../data/pokemon-forms";
|
||||||
|
import { LevelMoves, pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "../data/pokemon-level-moves";
|
||||||
|
import PokemonSpecies, { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from "../data/pokemon-species";
|
||||||
|
import { Type } from "../data/type";
|
||||||
|
import { Button } from "../enums/buttons";
|
||||||
|
import { GameModes, gameModes } from "../game-mode";
|
||||||
|
import { TitlePhase } from "../phases";
|
||||||
|
import { AbilityAttr, DexAttr, DexAttrProps, DexEntry, Passive as PassiveAttr, StarterFormMoveData, StarterMoveset } from "../system/game-data";
|
||||||
|
import { Tutorial, handleTutorial } from "../tutorial";
|
||||||
|
import * as Utils from "../utils";
|
||||||
|
import { OptionSelectItem } from "./abstact-option-select-ui-handler";
|
||||||
|
import MessageUiHandler from "./message-ui-handler";
|
||||||
|
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler";
|
||||||
|
import { StatsContainer } from "./stats-container";
|
||||||
|
import { TextStyle, addBBCodeTextObject, addTextObject } from "./text";
|
||||||
|
import { Mode } from "./ui";
|
||||||
|
import { addWindow } from "./ui-theme";
|
||||||
|
|
||||||
export type StarterSelectCallback = (starters: Starter[]) => void;
|
export type StarterSelectCallback = (starters: Starter[]) => void;
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
this.pokemonGenderText.setOrigin(0, 0);
|
this.pokemonGenderText.setOrigin(0, 0);
|
||||||
this.starterSelectContainer.add(this.pokemonGenderText);
|
this.starterSelectContainer.add(this.pokemonGenderText);
|
||||||
|
|
||||||
this.pokemonUncaughtText = addTextObject(this.scene, 6, 127, 'Uncaught', TextStyle.SUMMARY_ALT, { fontSize: '56px' });
|
this.pokemonUncaughtText = addTextObject(this.scene, 6, 127, i18next.t("starterSelectUiHandler:uncaught"), TextStyle.SUMMARY_ALT, { fontSize: '56px' });
|
||||||
this.pokemonUncaughtText.setOrigin(0, 0);
|
this.pokemonUncaughtText.setOrigin(0, 0);
|
||||||
this.starterSelectContainer.add(this.pokemonUncaughtText);
|
this.starterSelectContainer.add(this.pokemonUncaughtText);
|
||||||
|
|
||||||
@ -357,6 +357,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
icon.setScale(0.5);
|
icon.setScale(0.5);
|
||||||
icon.setOrigin(0, 0);
|
icon.setOrigin(0, 0);
|
||||||
icon.setFrame(species.getIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant));
|
icon.setFrame(species.getIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant));
|
||||||
|
this.checkIconId(icon, species, defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant);
|
||||||
icon.setTint(0);
|
icon.setTint(0);
|
||||||
this.starterSelectGenIconContainers[g].add(icon);
|
this.starterSelectGenIconContainers[g].add(icon);
|
||||||
this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);
|
this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);
|
||||||
@ -792,6 +793,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor);
|
const props = this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor);
|
||||||
this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex, props.shiny, props.variant));
|
this.starterIcons[this.starterCursors.length].setTexture(species.getIconAtlasKey(props.formIndex, props.shiny, props.variant));
|
||||||
this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny, props.variant));
|
this.starterIcons[this.starterCursors.length].setFrame(species.getIconId(props.female, props.formIndex, props.shiny, props.variant));
|
||||||
|
this.checkIconId(this.starterIcons[this.starterCursors.length], species, props.female, props.formIndex, props.shiny, props.variant);
|
||||||
this.starterGens.push(this.getGenCursorWithScroll());
|
this.starterGens.push(this.getGenCursorWithScroll());
|
||||||
this.starterCursors.push(this.cursor);
|
this.starterCursors.push(this.cursor);
|
||||||
this.starterAttr.push(this.dexAttrCursor);
|
this.starterAttr.push(this.dexAttrCursor);
|
||||||
@ -1306,6 +1308,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, dexAttr);
|
const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, dexAttr);
|
||||||
const lastSpeciesIcon = (this.starterSelectGenIconContainers[this.lastSpecies.generation - 1].getAt(this.genSpecies[this.lastSpecies.generation - 1].indexOf(this.lastSpecies)) as Phaser.GameObjects.Sprite);
|
const lastSpeciesIcon = (this.starterSelectGenIconContainers[this.lastSpecies.generation - 1].getAt(this.genSpecies[this.lastSpecies.generation - 1].indexOf(this.lastSpecies)) as Phaser.GameObjects.Sprite);
|
||||||
lastSpeciesIcon.setTexture(this.lastSpecies.getIconAtlasKey(props.formIndex, props.shiny, props.variant), this.lastSpecies.getIconId(props.female, props.formIndex, props.shiny, props.variant));
|
lastSpeciesIcon.setTexture(this.lastSpecies.getIconAtlasKey(props.formIndex, props.shiny, props.variant), this.lastSpecies.getIconId(props.female, props.formIndex, props.shiny, props.variant));
|
||||||
|
this.checkIconId(lastSpeciesIcon, this.lastSpecies, props.female, props.formIndex, props.shiny, props.variant);
|
||||||
this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE);
|
this.iconAnimHandler.addOrUpdate(lastSpeciesIcon, PokemonIconAnimMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1548,12 +1551,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite)
|
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite)
|
||||||
.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant));
|
.setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant));
|
||||||
// Temporary fix to show pokemon's default icon if variant icon doesn't exist
|
this.checkIconId((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite), species, female, formIndex, shiny, variant);
|
||||||
if ((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).frame.name != species.getIconId(female, formIndex, shiny, variant)) {
|
|
||||||
console.log(`${species.name}'s variant icon does not exist. Replacing with default.`);
|
|
||||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setTexture(species.getIconAtlasKey(formIndex, false, variant));
|
|
||||||
(this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, false, variant));
|
|
||||||
}
|
|
||||||
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
|
this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY);
|
||||||
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
|
this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE);
|
||||||
this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
|
this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;
|
||||||
@ -1580,7 +1578,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true));
|
this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true));
|
||||||
|
|
||||||
const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr;
|
const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr;
|
||||||
this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : 'Disabled' : 'Locked');
|
this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : i18next.t("starterSelectUiHandler:disabled") : i18next.t("starterSelectUiHandler:locked"));
|
||||||
this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY));
|
this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY));
|
||||||
this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true));
|
this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true));
|
||||||
|
|
||||||
@ -1827,4 +1825,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
if (this.statsMode)
|
if (this.statsMode)
|
||||||
this.toggleStatsMode(false);
|
this.toggleStatsMode(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkIconId(icon: Phaser.GameObjects.Sprite, species: PokemonSpecies, female, formIndex, shiny, variant) {
|
||||||
|
if (icon.frame.name != species.getIconId(female, formIndex, shiny, variant)) {
|
||||||
|
console.log(`${species.name}'s variant icon does not exist. Replacing with default.`);
|
||||||
|
icon.setTexture(species.getIconAtlasKey(formIndex, false, variant));
|
||||||
|
icon.setFrame(species.getIconId(female, formIndex, false, variant));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user