Merge branch 'main' into nuzlocke-mode

This commit is contained in:
Flashfyre committed 2024-05-05 00:04:18 -04:00
commit cd1684180f
115 files changed
+14999 -6892

No files matched your search

+9 -3
View File
@@ -2104,6 +2104,13 @@ export class StatChangeMultiplierAbAttr extends AbAttr {
}
}
export class StatChangeCopyAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, (args[0] as BattleStat[]), (args[1] as integer), true, false, false));
return true;
}
}
export class BypassBurnDamageReductionAbAttr extends AbAttr {
constructor() {
super(false);
@@ -3217,8 +3224,7 @@ export function initAbilities() {
.attr(UncopiableAbilityAbAttr)
.attr(UnswappableAbilityAbAttr)
.attr(UnsuppressableAbilityAbAttr)
.attr(NoFusionAbilityAbAttr)
.partial(),
.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
.attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
@@ -3484,7 +3490,7 @@ export function initAbilities() {
.attr(PostBiomeChangeTerrainChangeAbAttr, TerrainType.ELECTRIC)
.conditionalAttr(getTerrainCondition(TerrainType.ELECTRIC), BattleStatMultiplierAbAttr, BattleStat.SPATK, 4 / 3),
new Ability(Abilities.OPPORTUNIST, 9)
.unimplemented(),
.attr(StatChangeCopyAbAttr),
new Ability(Abilities.CUD_CHEW, 9)
.unimplemented(),
new Ability(Abilities.SHARPNESS, 9)
+1 -1
View File
@@ -115,7 +115,7 @@ export const speciesEggMoves = {
[Species.PHANPY]: [ Moves.SHORE_UP, Moves.HEAD_SMASH, Moves.MOUNTAIN_GALE, Moves.VOLT_TACKLE ],
[Species.STANTLER]: [ Moves.HORN_LEECH, Moves.HIGH_JUMP_KICK, Moves.BULK_UP, Moves.HEAD_CHARGE ],
[Species.SMEARGLE]: [ Moves.BATON_PASS, Moves.BURNING_BULWARK, Moves.SALT_CURE, Moves.SPORE ],
[Species.TYROGUE]: [ Moves.MACH_PUNCH, Moves.WICKED_TORQUE, Moves.METEOR_MASH, Moves.COLLISION_COURSE ],
[Species.TYROGUE]: [ Moves.VICTORY_DANCE, Moves.WICKED_TORQUE, Moves.METEOR_MASH, Moves.COLLISION_COURSE ],
[Species.SMOOCHUM]: [ Moves.EXPANDING_FORCE, Moves.AURA_SPHERE, Moves.FREEZY_FROST, Moves.TAKE_HEART ],
[Species.ELEKID]: [ Moves.DRAIN_PUNCH, Moves.TIDY_UP, Moves.ICE_HAMMER, Moves.PLASMA_FISTS ],
[Species.MAGBY]: [ Moves.STORED_POWER, Moves.EARTH_POWER, Moves.ARMOR_CANNON, Moves.FLEUR_CANNON ],
+68 -10
View File
@@ -756,7 +756,7 @@ export enum MultiHitType {
_2_TO_5,
_3,
_3_INCR,
_1_TO_10
_1_TO_10,
}
export class HealAttr extends MoveEffectAttr {
@@ -912,7 +912,9 @@ export class MultiHitAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
let hitTimes: integer;
switch (this.multiHitType) {
const hitType = new Utils.IntegerHolder(this.multiHitType)
applyMoveAttrs(ChangeMultiHitTypeAttr, user, target, move, hitType)
switch (hitType.value) {
case MultiHitType._2_TO_5:
{
const rand = user.randSeedInt(16);
@@ -975,6 +977,23 @@ export class MultiHitAttr extends MoveAttr {
}
}
export class ChangeMultiHitTypeAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
//const hitType = args[0] as Utils.NumberHolder;
return false;
}
}
export class WaterShurikenMultiHitTypeAttr extends ChangeMultiHitTypeAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId == Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex == 2) {
(args[0] as Utils.IntegerHolder).value = MultiHitType._3
return true;
}
return false;
}
}
export class StatusEffectAttr extends MoveEffectAttr {
public effect: StatusEffect;
public cureTurn: integer;
@@ -2049,6 +2068,16 @@ export class KnockOffPowerAttr extends VariablePowerAttr {
}
}
export class WaterShurikenPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId == Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex == 2) {
(args[0] as Utils.IntegerHolder).value = 20
return true;
}
return false;
}
}
export class VariableAtkAttr extends MoveAttr {
constructor() {
super();
@@ -2216,6 +2245,36 @@ export class VariableMoveTypeAttr extends MoveAttr {
}
}
export class TechnoBlastTypeAttr extends VariableMoveTypeAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if ([user.species.speciesId, user.fusionSpecies?.speciesId].includes(Species.GENESECT)) {
const form = user.species.speciesId === Species.GENESECT ? user.formIndex : user.fusionSpecies.formIndex;
const type = (args[0] as Utils.IntegerHolder);
switch (form) {
case 1: // Shock Drive
type.value = Type.ELECTRIC;
break;
case 2: // Burn Drive
type.value = Type.FIRE;
break;
case 3: // Chill Drive
type.value = Type.ICE;
break;
case 4: // Douse Drive
type.value = Type.WATER;
break;
default:
type.value = Type.NORMAL;
break;
}
return true;
}
return false;
}
}
export class AuraWheelTypeAttr extends VariableMoveTypeAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if ([user.species.speciesId, user.fusionSpecies?.speciesId].includes(Species.MORPEKO)) {
@@ -4736,8 +4795,7 @@ export function initMoves() {
.attr(StatusEffectAttr, StatusEffect.SLEEP)
.soundBased(),
new StatusMove(Moves.TICKLE, Type.NORMAL, 100, 20, -1, 0, 3)
.attr(StatChangeAttr, BattleStat.ATK, -1)
.attr(StatChangeAttr, BattleStat.DEF, -1),
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], -1),
new SelfStatusMove(Moves.COSMIC_POWER, Type.PSYCHIC, -1, 20, -1, 0, 3)
.attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], 1, true),
new AttackMove(Moves.WATER_SPOUT, Type.WATER, MoveCategory.SPECIAL, 150, 100, 5, -1, 0, 3)
@@ -5334,7 +5392,7 @@ export function initMoves() {
.ballBombMove()
.target(MoveTarget.ALL_NEAR_OTHERS),
new AttackMove(Moves.TECHNO_BLAST, Type.NORMAL, MoveCategory.SPECIAL, 120, 100, 5, -1, 0, 5)
.partial(),
.attr(TechnoBlastTypeAttr),
new AttackMove(Moves.RELIC_SONG, Type.NORMAL, MoveCategory.SPECIAL, 75, 100, 10, 10, 0, 5)
.attr(StatusEffectAttr, StatusEffect.SLEEP)
.soundBased()
@@ -5473,7 +5531,9 @@ export function initMoves() {
new AttackMove(Moves.HYPERSPACE_HOLE, Type.PSYCHIC, MoveCategory.SPECIAL, 80, -1, 5, -1, 0, 6)
.ignoresProtect(),
new AttackMove(Moves.WATER_SHURIKEN, Type.WATER, MoveCategory.SPECIAL, 15, 100, 20, -1, 1, 6)
.attr(MultiHitAttr),
.attr(MultiHitAttr)
.attr(WaterShurikenPowerAttr)
.attr(WaterShurikenMultiHitTypeAttr),
new AttackMove(Moves.MYSTICAL_FIRE, Type.FIRE, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new SelfStatusMove(Moves.SPIKY_SHIELD, Type.GRASS, -1, 10, -1, 4, 6)
@@ -5777,8 +5837,7 @@ export function initMoves() {
.ignoresAbilities()
.partial(),
new StatusMove(Moves.TEARFUL_LOOK, Type.NORMAL, -1, 20, 100, 0, 7)
.attr(StatChangeAttr, BattleStat.ATK, -1)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1),
new AttackMove(Moves.ZING_ZAP, Type.ELECTRIC, MoveCategory.PHYSICAL, 80, 100, 10, 30, 0, 7)
.attr(FlinchAttr),
new AttackMove(Moves.NATURES_MADNESS, Type.FAIRY, MoveCategory.SPECIAL, -1, 90, 10, -1, 0, 7)
@@ -5957,8 +6016,7 @@ export function initMoves() {
new AttackMove(Moves.BODY_PRESS, Type.FIGHTING, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 8)
.attr(DefAtkAttr),
new StatusMove(Moves.DECORATE, Type.FAIRY, -1, 15, 100, 0, 8)
.attr(StatChangeAttr, BattleStat.ATK, 2)
.attr(StatChangeAttr, BattleStat.SPATK, 2),
.attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], 2),
new AttackMove(Moves.DRUM_BEATING, Type.GRASS, MoveCategory.PHYSICAL, 80, 100, 10, 100, 0, 8)
.attr(StatChangeAttr, BattleStat.SPD, -1)
.makesContact(false),
+11 -1
View File
@@ -82,7 +82,11 @@ export enum FormChangeItem {
SHADOW_REINS_OF_UNITY,
WELLSPRING_MASK,
HEARTHFLAME_MASK,
CORNERSTONE_MASK
CORNERSTONE_MASK,
SHOCK_DRIVE,
BURN_DRIVE,
CHILL_DRIVE,
DOUSE_DRIVE
}
export type SpeciesFormChangeConditionPredicate = (p: Pokemon) => boolean;
@@ -542,6 +546,12 @@ export const pokemonFormChanges: PokemonFormChanges = {
new SpeciesFormChange(Species.MELOETTA, 'pirouette', 'aria', new SpeciesFormChangePostMoveTrigger(Moves.RELIC_SONG), true),
new SpeciesFormChange(Species.MELOETTA, 'pirouette', 'aria', new SpeciesFormChangeActiveTrigger(false), true)
],
[Species.GENESECT]: [
new SpeciesFormChange(Species.GENESECT, '', 'shock', new SpeciesFormChangeItemTrigger(FormChangeItem.SHOCK_DRIVE)),
new SpeciesFormChange(Species.GENESECT, '', 'burn', new SpeciesFormChangeItemTrigger(FormChangeItem.BURN_DRIVE)),
new SpeciesFormChange(Species.GENESECT, '', 'chill', new SpeciesFormChangeItemTrigger(FormChangeItem.CHILL_DRIVE)),
new SpeciesFormChange(Species.GENESECT, '', 'douse', new SpeciesFormChangeItemTrigger(FormChangeItem.DOUSE_DRIVE))
],
[Species.GRENINJA]: [
new SpeciesFormChange(Species.GRENINJA, 'battle-bond', 'ash', new SpeciesFormChangeManualTrigger(), true),
new SpeciesFormChange(Species.GRENINJA, 'ash', 'battle-bond', new SpeciesFormChangeManualTrigger(), true)
+29 -29
View File
@@ -30,7 +30,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 24, Moves.SWEET_SCENT ],
[ 27, Moves.SYNTHESIS ],
[ 30, Moves.WORRY_SEED ],
[ 33, Moves.DOUBLE_EDGE ],
[ 33, Moves.POWER_WHIP ],
[ 36, Moves.SOLAR_BEAM ],
],
[Species.IVYSAUR]: [
@@ -47,16 +47,16 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 30, Moves.SWEET_SCENT ],
[ 35, Moves.SYNTHESIS ],
[ 40, Moves.WORRY_SEED ],
[ 45, Moves.DOUBLE_EDGE ],
[ 45, Moves.POWER_WHIP ],
[ 50, Moves.SOLAR_BEAM ],
],
[Species.VENUSAUR]: [
[ 0, Moves.PETAL_BLIZZARD ],
[ 1, Moves.GROWTH ],
[ 1, Moves.PETAL_DANCE ],
[ 1, Moves.VINE_WHIP ],
[ 1, Moves.TACKLE ],
[ 1, Moves.GROWL ],
[ 1, Moves.GROWTH ],
[ 1, Moves.PETAL_DANCE ],
[ 9, Moves.LEECH_SEED ],
[ 12, Moves.RAZOR_LEAF ],
[ 15, Moves.POISON_POWDER ],
@@ -66,7 +66,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 30, Moves.SWEET_SCENT ],
[ 37, Moves.SYNTHESIS ],
[ 44, Moves.WORRY_SEED ],
[ 51, Moves.DOUBLE_EDGE ],
[ 51, Moves.POWER_WHIP ],
[ 58, Moves.SOLAR_BEAM ],
],
[Species.CHARMANDER]: [
@@ -127,7 +127,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 27, Moves.SHELL_SMASH ],
[ 30, Moves.IRON_DEFENSE ],
[ 33, Moves.HYDRO_PUMP ],
[ 36, Moves.SKULL_BASH ],
[ 36, Moves.WAVE_CRASH ],
],
[Species.WARTORTLE]: [
[ 1, Moves.TACKLE ],
@@ -143,7 +143,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 35, Moves.SHELL_SMASH ],
[ 40, Moves.IRON_DEFENSE ],
[ 45, Moves.HYDRO_PUMP ],
[ 50, Moves.SKULL_BASH ],
[ 50, Moves.WAVE_CRASH ],
],
[Species.BLASTOISE]: [
[ 0, Moves.FLASH_CANNON ],
@@ -160,7 +160,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 35, Moves.SHELL_SMASH ],
[ 42, Moves.IRON_DEFENSE ],
[ 49, Moves.HYDRO_PUMP ],
[ 56, Moves.SKULL_BASH ],
[ 56, Moves.WAVE_CRASH ],
],
[Species.CATERPIE]: [
[ 1, Moves.TACKLE ],
@@ -341,9 +341,9 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 12, Moves.GLARE ],
[ 17, Moves.SCREECH ],
[ 20, Moves.ACID ],
[ 25, Moves.SWALLOW ],
[ 25, Moves.STOCKPILE ],
[ 25, Moves.SPIT_UP ],
[ 25, Moves.SWALLOW ],
[ 28, Moves.ACID_SPRAY ],
[ 33, Moves.SLUDGE_BOMB ],
[ 36, Moves.GASTRO_ACID ],
@@ -1780,14 +1780,15 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 4, Moves.DOUBLE_KICK ],
[ 8, Moves.LOW_KICK ],
[ 12, Moves.ENDURE ],
[ 16, Moves.REVENGE ],
[ 16, Moves.SUCKER_PUNCH ],
[ 21, Moves.WIDE_GUARD ],
[ 24, Moves.BLAZE_KICK ],
[ 28, Moves.MIND_READER ],
[ 28, Moves.FEINT ],
[ 32, Moves.MEGA_KICK ],
[ 36, Moves.CLOSE_COMBAT ],
[ 40, Moves.REVERSAL ],
[ 44, Moves.HIGH_JUMP_KICK ],
[ 50, Moves.AXE_KICK ],
],
[Species.HITMONCHAN]: [
[ 0, Moves.DRAIN_PUNCH ],
@@ -1796,16 +1797,14 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.FAKE_OUT ],
[ 1, Moves.HELPING_HAND ],
[ 1, Moves.FEINT ],
[ 1, Moves.VACUUM_WAVE ],
[ 1, Moves.BULLET_PUNCH ],
[ 4, Moves.MACH_PUNCH ],
[ 8, Moves.POWER_UP_PUNCH ],
[ 8, Moves.VACUUM_WAVE ],
[ 12, Moves.DETECT ],
[ 16, Moves.REVENGE ],
[ 16, Moves.BULLET_PUNCH ],
[ 21, Moves.QUICK_GUARD ],
[ 24, Moves.FIRE_PUNCH ],
[ 24, Moves.ICE_PUNCH ],
[ 24, Moves.THUNDER_PUNCH ],
[ 24, Moves.ICE_PUNCH ],
[ 24, Moves.FIRE_PUNCH ],
[ 28, Moves.AGILITY ],
[ 32, Moves.MEGA_PUNCH ],
[ 36, Moves.CLOSE_COMBAT ],
@@ -2598,7 +2597,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 31, Moves.LIGHT_SCREEN ],
[ 34, Moves.BODY_SLAM ],
[ 39, Moves.SAFEGUARD ],
[ 42, Moves.AROMATHERAPY ],
[ 42, Moves.GIGA_DRAIN ],
[ 45, Moves.SOLAR_BEAM ],
],
[Species.BAYLEEF]: [
@@ -2614,7 +2613,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 36, Moves.LIGHT_SCREEN ],
[ 40, Moves.BODY_SLAM ],
[ 46, Moves.SAFEGUARD ],
[ 50, Moves.AROMATHERAPY ],
[ 50, Moves.GIGA_DRAIN ],
[ 54, Moves.SOLAR_BEAM ],
],
[Species.MEGANIUM]: [
@@ -2632,7 +2631,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 40, Moves.LIGHT_SCREEN ],
[ 46, Moves.BODY_SLAM ],
[ 54, Moves.SAFEGUARD ],
[ 60, Moves.AROMATHERAPY ],
[ 60, Moves.GIGA_DRAIN ],
[ 65, Moves.SOLAR_BEAM ],
],
[Species.CYNDAQUIL]: [
@@ -2796,6 +2795,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.ECHOED_VOICE ],
[ 9, Moves.CONFUSION ],
[ 12, Moves.REFLECT ],
[ 15, Moves.DEFOG ],
[ 18, Moves.AIR_SLASH ],
[ 23, Moves.EXTRASENSORY ],
[ 28, Moves.TAKE_DOWN ],
@@ -3574,7 +3574,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 13, Moves.LICK ],
[ 19, Moves.HEADBUTT ],
[ 25, Moves.ROAR ],
[ 31, Moves.RAGE ],
[ 31, Moves.LAST_RESORT ],
[ 37, Moves.PLAY_ROUGH ],
[ 43, Moves.PAYBACK ],
[ 49, Moves.CRUNCH ],
@@ -3592,7 +3592,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 13, Moves.LICK ],
[ 19, Moves.HEADBUTT ],
[ 27, Moves.ROAR ],
[ 35, Moves.RAGE ],
[ 35, Moves.LAST_RESORT ],
[ 43, Moves.PLAY_ROUGH ],
[ 51, Moves.PAYBACK ],
[ 59, Moves.CRUNCH ],
@@ -3868,7 +3868,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 20, Moves.WING_ATTACK ],
[ 24, Moves.SLASH ],
[ 28, Moves.STEEL_WING ],
[ 32, Moves.AUTOTOMIZE ],
[ 32, Moves.PAYBACK ],
[ 36, Moves.DRILL_PECK ],
[ 40, Moves.METAL_SOUND ],
[ 44, Moves.SPIKES ],
@@ -3923,11 +3923,12 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 20, Moves.DRAGON_BREATH ],
[ 25, Moves.BUBBLE_BEAM ],
[ 30, Moves.AGILITY ],
[ 37, Moves.LASER_FOCUS ],
[ 37, Moves.WATER_PULSE ],
[ 44, Moves.DRAGON_PULSE ],
[ 51, Moves.HYDRO_PUMP ],
[ 58, Moves.DRAGON_DANCE ],
[ 65, Moves.RAIN_DANCE ],
[ 72, Moves.WAVE_CRASH ],
],
[Species.PHANPY]: [
[ 1, Moves.TACKLE ],
@@ -3974,10 +3975,9 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 35, Moves.RECOVER ],
[ 40, Moves.DISCHARGE ],
[ 45, Moves.TRI_ATTACK ],
[ 50, Moves.MAGIC_COAT ],
[ 55, Moves.LOCK_ON ],
[ 60, Moves.ZAP_CANNON ],
[ 65, Moves.HYPER_BEAM ],
[ 50, Moves.LOCK_ON ],
[ 55, Moves.ZAP_CANNON ],
[ 60, Moves.HYPER_BEAM ],
],
[Species.STANTLER]: [
[ 1, Moves.TACKLE ],
@@ -4268,7 +4268,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 72, Moves.FIRE_BLAST ],
[ 81, Moves.FUTURE_SIGHT ],
[ 90, Moves.SKY_ATTACK ],
[ 99, Moves.BURN_UP ],
[ 99, Moves.OVERHEAT ],
],
[Species.CELEBI]: [
[ 1, Moves.CONFUSION ],
+40
View File
@@ -134,4 +134,44 @@ export function getStatusEffectCatchRateMultiplier(statusEffect: StatusEffect):
}
return 1;
}
/**
* Returns a random non-volatile StatusEffect
*/
export function generateRandomStatusEffect(): StatusEffect {
return Utils.randIntRange(1, 6);
}
/**
* Returns a random non-volatile StatusEffect between the two provided
* @param statusEffectA The first StatusEffect
* @param statusEffectA The second StatusEffect
*/
export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB: StatusEffect): StatusEffect {
if (statusEffectA === StatusEffect.NONE || statusEffectA === StatusEffect.FAINT) {
return statusEffectB;
}
if (statusEffectB === StatusEffect.NONE || statusEffectB === StatusEffect.FAINT) {
return statusEffectA;
}
return Utils.randIntRange(0, 2) ? statusEffectA : statusEffectB;
}
/**
* Returns a random non-volatile StatusEffect between the two provided
* @param statusA The first Status
* @param statusB The second Status
*/
export function getRandomStatus(statusA: Status, statusB: Status): Status {
if (statusA === undefined || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) {
return statusB;
}
if (statusB === undefined || statusB.effect === StatusEffect.NONE || statusB.effect === StatusEffect.FAINT) {
return statusA;
}
return Utils.randIntRange(0, 2) ? statusA : statusB;
}
+4 -3
View File
@@ -4,6 +4,7 @@ import { Type } from "./type";
import * as Utils from "../utils";
import { IncrementMovePriorityAbAttr, applyAbAttrs } from "./ability";
import { ProtectAttr } from "./move";
import { BattlerIndex } from "#app/battle.js";
export enum TerrainType {
NONE,
@@ -48,13 +49,13 @@ export class Terrain {
return 1;
}
isMoveTerrainCancelled(user: Pokemon, move: Move): boolean {
isMoveTerrainCancelled(user: Pokemon, targets: BattlerIndex[], move: Move): boolean {
switch (this.terrainType) {
case TerrainType.PSYCHIC:
if (!move.getAttrs(ProtectAttr).length){
if (!move.getAttrs(ProtectAttr).length) {
const priority = new Utils.IntegerHolder(move.priority);
applyAbAttrs(IncrementMovePriorityAbAttr, user, null, move, priority);
return priority.value > 0;
return priority.value > 0 && user.getOpponents().filter(o => targets.includes(o.getBattlerIndex())).length > 0;
}
}
+2 -2
View File
@@ -336,8 +336,8 @@ export class Arena {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(move);
}
isMoveTerrainCancelled(user: Pokemon, move: Move) {
return this.terrain && this.terrain.isMoveTerrainCancelled(user, move);
isMoveTerrainCancelled(user: Pokemon, targets: BattlerIndex[], move: Move) {
return this.terrain && this.terrain.isMoveTerrainCancelled(user, targets, move);
}
getTerrainType() : TerrainType {
+22 -1
View File
@@ -14,7 +14,7 @@ import { AttackTypeBoosterModifier, DamageMoneyRewardModifier, EnemyDamageBooste
import { PokeballType } from '../data/pokeball';
import { Gender } from '../data/gender';
import { initMoveAnim, loadMoveAnimAssets } from '../data/battle-anims';
import { Status, StatusEffect } from '../data/status-effect';
import { Status, StatusEffect, getRandomStatus } from '../data/status-effect';
import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from '../data/pokemon-evolutions';
import { reverseCompatibleTms, tmSpecies } from '../data/tms';
import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases';
@@ -2551,6 +2551,10 @@ export class PlayerPokemon extends Pokemon {
this.generateCompatibleTms();
}
/**
* Returns a Promise to fuse two PlayerPokemon together
* @param pokemon The PlayerPokemon to fuse to this one
*/
fuse(pokemon: PlayerPokemon): Promise<void> {
return new Promise(resolve => {
this.fusionSpecies = pokemon.species;
@@ -2564,8 +2568,25 @@ export class PlayerPokemon extends Pokemon {
this.scene.validateAchv(achvs.SPLICE);
this.scene.gameData.gameStats.pokemonFused++;
// Store the average HP% that each Pokemon has
const newHpPercent = ((pokemon.hp / pokemon.stats[Stat.HP]) + (this.hp / this.stats[Stat.HP])) / 2;
this.generateName();
this.calculateStats();
// Set this Pokemon's HP to the average % of both fusion components
this.hp = Math.round(this.stats[Stat.HP] * newHpPercent);
if (!this.isFainted()) {
// If this Pokemon hasn't fainted, make sure the HP wasn't set over the new maximum
this.hp = Math.min(this.hp, this.stats[Stat.HP]);
this.status = getRandomStatus(this.status, pokemon.status); // Get a random valid status between the two
}
else if (!pokemon.isFainted()) {
// If this Pokemon fainted but the other hasn't, make sure the HP wasn't set to zero
this.hp = Math.max(this.hp, 1);
this.status = pokemon.status; // Inherit the other Pokemon's status
}
this.generateCompatibleTms();
this.updateInfo(true);
const fusedPartyMemberIndex = this.scene.getParty().indexOf(pokemon);
+2
View File
@@ -31,6 +31,8 @@ export class LoadingScene extends SceneBase {
this.loadAtlas('bg', 'ui');
this.loadImage('command_fight_labels', 'ui');
this.loadAtlas('prompt', 'ui');
this.loadImage('candy', 'ui');
this.loadImage('candy_overlay', 'ui');
this.loadImage('cursor', 'ui');
this.loadImage('cursor_reverse', 'ui');
for (let wv of Utils.getEnumValues(WindowVariant)) {
File diff suppressed because it is too large. Load diff
+46 -46
View File
@@ -1,52 +1,52 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const battle: SimpleTranslationEntries = {
"bossAppeared": "{{bossName}} appeared.",
"trainerAppeared": "{{trainerName}}\nwould like to battle!",
"singleWildAppeared": "A wild {{pokemonName}} appeared!",
"multiWildAppeared": "A wild {{pokemonName1}}\nand {{pokemonName2}} appeared!",
"playerComeBack": "Come back, {{pokemonName}}!",
"trainerComeBack": "{{trainerName}} withdrew {{pokemonName}}!",
"playerGo": "Go! {{pokemonName}}!",
"trainerGo": "{{trainerName}} sent out {{pokemonName}}!",
"switchQuestion": "Will you switch\n{{pokemonName}}?",
"trainerDefeated": `You defeated\n{{trainerName}}!`,
"pokemonCaught": "{{pokemonName}} was caught!",
"bossAppeared": "{{bossName}} è apparso.",
"trainerAppeared": "{{trainerName}}\nvuole combattere!",
"singleWildAppeared": "Appare {{pokemonName}} selvatico!",
"multiWildAppeared": "Appaiono {{pokemonName1}}\ne {{pokemonName2}} salvatici!",
"playerComeBack": "Rientra, {{pokemonName}}!",
"trainerComeBack": "{{trainerName}} ha ritirato {{pokemonName}}!",
"playerGo": "Vai! {{pokemonName}}!",
"trainerGo": "{{trainerName}} manda in campo {{pokemonName}}!",
"switchQuestion": "Vuoi cambiare\n{{pokemonName}}?",
"trainerDefeated": `Hai sconfitto\n{{trainerName}}!`,
"pokemonCaught": "{{pokemonName}} è stato catturato!",
"pokemon": "Pokémon",
"sendOutPokemon": "Go! {{pokemonName}}!",
"hitResultCriticalHit": "A critical hit!",
"hitResultSuperEffective": "It's super effective!",
"hitResultNotVeryEffective": "It's not very effective…",
"hitResultNoEffect": "It doesn't affect {{pokemonName}}!",
"hitResultOneHitKO": "It's a one-hit KO!",
"attackFailed": "But it failed!",
"attackHitsCount": `Hit {{count}} time(s)!`,
"expGain": "{{pokemonName}} gained\n{{exp}} EXP. Points!",
"levelUp": "{{pokemonName}} grew to\nLv. {{level}}!",
"learnMove": "{{pokemonName}} learned\n{{moveName}}!",
"learnMovePrompt": "{{pokemonName}} wants to learn the\nmove {{moveName}}.",
"learnMoveLimitReached": "However, {{pokemonName}} already\nknows four moves.",
"learnMoveReplaceQuestion": "Should a move be forgotten and\nreplaced with {{moveName}}?",
"learnMoveStopTeaching": "Stop trying to teach\n{{moveName}}?",
"learnMoveNotLearned": "{{pokemonName}} did not learn the\nmove {{moveName}}.",
"learnMoveForgetQuestion": "Which move should be forgotten?",
"learnMoveForgetSuccess": "{{pokemonName}} forgot how to\nuse {{moveName}}.",
"levelCapUp": "The level cap\nhas increased to {{levelCap}}!",
"moveNotImplemented": "{{moveName}} is not yet implemented and cannot be selected.",
"moveDisabled": "{{moveName}} is disabled!",
"noPokeballForce": "An unseen force\nprevents using Poké Balls.",
"noPokeballTrainer": "You can't catch\nanother trainer's Pokémon!",
"noPokeballMulti": "You can only throw a Poké Ball\nwhen there is one Pokémon remaining!",
"noPokeballStrong": "The target Pokémon is too strong to be caught!\nYou need to weaken it first!",
"noEscapeForce": "An unseen force\nprevents escape.",
"noEscapeTrainer": "You can't run\nfrom a trainer battle!",
"noEscapePokemon": "{{pokemonName}}'s {{moveName}}\nprevents {{escapeVerb}}!",
"runAwaySuccess": "You got away safely!",
"runAwayCannotEscape": 'You can\'t escape!',
"escapeVerbSwitch": "switching",
"escapeVerbFlee": "fleeing",
"notDisabled": "{{moveName}} is disabled\nno more!",
"skipItemQuestion": "Are you sure you want to skip taking an item?",
"sendOutPokemon": "Vai! {{pokemonName}}!",
"hitResultCriticalHit": "Brutto colpo!",
"hitResultSuperEffective": "È superefficace!",
"hitResultNotVeryEffective": "Non è molto efficace…",
"hitResultNoEffect": "Non ha effetto su {{pokemonName}}!",
"hitResultOneHitKO": "È KO con un colpo solo!",
"attackFailed": "Ma ha fallito!",
"attackHitsCount": `Colpito {{count}} volta/e!`,
"expGain": "{{pokemonName}} ha guadagnato\n{{exp}} Punti Esperienza!",
"levelUp": "{{pokemonName}} è salito al \nLivello {{level}}!",
"learnMove": "{{pokemonName}} impara \n{{moveName}}!",
"learnMovePrompt": "{{pokemonName}} vorrebbe imparare \l{{moveName}}.",
"learnMoveLimitReached": "Tuttavia, {{pokemonName}} \nconosce già quattro mosse.",
"learnMoveReplaceQuestion": "Vuoi che ne dimentichi una e al suo \nposto la sostituisca con {{moveName}}?",
"learnMoveStopTeaching": "Vuoi smettere di fargli imparare \n{{moveName}}?",
"learnMoveNotLearned": "{{pokemonName}} non ha imparato\n{{moveName}}.",
"learnMoveForgetQuestion": "Quale mossa deve dimenticare?",
"learnMoveForgetSuccess": "{{pokemonName}} ha dimenticato la mossa\n{{moveName}}.",
"levelCapUp": "Il livello massimo\nè aumentato a {{levelCap}}!",
"moveNotImplemented": "{{moveName}} non è ancora implementata e non può essere selezionata.",
"moveDisabled": "{{moveName}} è disabilitata!",
"noPokeballForce": "Una forza misteriosa\nimpedisce l'uso dell Poké Ball.",
"noPokeballTrainer": "Non puoi catturare\nPokémon di altri allenatori!",
"noPokeballMulti": "Puoi lanciare una Poké Ball\nquando rimane un solo Pokémon!",
"noPokeballStrong": "Il Pokémon avversario è troppo forte per essere catturato!\nDevi prima indebolirlo!",
"noEscapeForce": "Una forza misteriosa\nimpedisce la fuga.",
"noEscapeTrainer": "Non puoi fuggire\nda una battaglia contro un'allenatore!",
"noEscapePokemon": "{{moveName}} di {{pokemonName}}\npreviene la {{escapeVerb}}!",
"runAwaySuccess": "Sei riuscito a fuggire!",
"runAwayCannotEscape": 'Non puoi fuggire!',
"escapeVerbSwitch": "cambiando",
"escapeVerbFlee": "fuggendo",
"notDisabled": "{{moveName}} non è più\ndisabilitata!",
"skipItemQuestion": "Sei sicuro di non voler prendere nessun oggetto?",
"eggHatching": "Oh?",
"ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?"
"ivScannerUseQuestion": "Vuoi usare lo scanner di IV su {{pokemonName}}?"
} as const;
+9
View File
@@ -0,0 +1,9 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const commandUiHandler: SimpleTranslationEntries = {
"fight": "Lotta",
"ball": "Borsa",
"pokemon": "Pokémon",
"run": "Fuga",
"actionMessage": "Cosa deve fare {{pokemonName}}?",
} as const;
+1 -1
View File
@@ -2,5 +2,5 @@ import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const fightUiHandler: SimpleTranslationEntries = {
"pp": "PP",
"power": "POWER",
"power": "POTENZA",
} as const;
+17 -17
View File
@@ -1,23 +1,23 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const menuUiHandler: SimpleTranslationEntries = {
"GAME_SETTINGS": 'Game Settings',
"ACHIEVEMENTS": "Achievements",
"STATS": "Stats",
"VOUCHERS": "Vouchers",
"EGG_LIST": "Egg List",
"EGG_GACHA": "Egg Gacha",
"MANAGE_DATA": "Manage Data",
"GAME_SETTINGS": 'Impostazioni',
"ACHIEVEMENTS": "Risultati",
"STATS": "Statistiche",
"VOUCHERS": "Biglietti",
"EGG_LIST": "Lista Uova",
"EGG_GACHA": "Gacha Uova",
"MANAGE_DATA": "Gestisci Dati",
"COMMUNITY": "Community",
"RETURN_TO_TITLE": "Return To Title",
"LOG_OUT": "Log Out",
"RETURN_TO_TITLE": "Ritorna al Titolo",
"LOG_OUT": "Disconnettiti",
"slot": "Slot {{slotNumber}}",
"importSession": "Import Session",
"importSlotSelect": "Select a slot to import to.",
"exportSession": "Export Session",
"exportSlotSelect": "Select a slot to export from.",
"importData": "Import Data",
"exportData": "Export Data",
"cancel": "Cancel",
"losingProgressionWarning": "You will lose any progress since the beginning of the battle. Proceed?"
"importSession": "Importa Sessione",
"importSlotSelect": "Seleziona uno slot in cui importare.",
"exportSession": "Esporta Sessione",
"exportSlotSelect": "Seleziona uno slot da cui esportare.",
"importData": "Importa Dati",
"exportData": "Esporta Dati",
"cancel": "Annulla",
"losingProgressionWarning": "Perderai tutti i progressi dall'inizio della battaglia. Procedere?"
} as const;
+30 -30
View File
@@ -12,36 +12,36 @@ export const menu: SimpleTranslationEntries = {
"loadGame": "Carica Partita",
"dailyRun": "Corsa Giornaliera (Beta)",
"selectGameMode": "Seleziona una modalità di gioco.",
"logInOrCreateAccount": "Log in or create an account to start. No email required!",
"username": "Username",
"logInOrCreateAccount": "Accedi o crea un nuovo account per iniziare. Non è richiesta un'email!",
"username": "Nome Utente",
"password": "Password",
"login": "Login",
"register": "Register",
"emptyUsername": "Username must not be empty",
"invalidLoginUsername": "The provided username is invalid",
"invalidRegisterUsername": "Username must only contain letters, numbers, or underscores",
"invalidLoginPassword": "The provided password is invalid",
"invalidRegisterPassword": "Password must be 6 characters or longer",
"usernameAlreadyUsed": "The provided username is already in use",
"accountNonExistent": "The provided user does not exist",
"unmatchingPassword": "The provided password does not match",
"passwordNotMatchingConfirmPassword": "Password must match confirm password",
"confirmPassword": "Confirm Password",
"registrationAgeWarning": "By registering, you confirm you are of 13 years of age or older.",
"backToLogin": "Back to Login",
"failedToLoadSaveData": "Failed to load save data. Please reload the page.\nIf this continues, please contact the administrator.",
"sessionSuccess": "Session loaded successfully.",
"failedToLoadSession": "Your session data could not be loaded.\nIt may be corrupted.",
"boyOrGirl": "Are you a boy or a girl?",
"boy": "Boy",
"girl": "Girl",
"dailyRankings": "Daily Rankings",
"weeklyRankings": "Weekly Rankings",
"noRankings": "No Rankings",
"loading": "Loading…",
"playersOnline": "Players Online",
"empty":"Empty",
"yes":"Yes",
"login": "Accedi",
"register": "Registrati",
"emptyUsername": "Nome utente mancante!",
"invalidLoginUsername": "Nome utente non valido!",
"invalidRegisterUsername": "Il nome utente può contenere solo lettere, numeri o trattini bassi",
"invalidLoginPassword": "Password non valida!",
"invalidRegisterPassword": "La password deve contenere almeno 6 caratteri",
"usernameAlreadyUsed": "Il nome utente inserito è stato già utilizzato!",
"accountNonExistent": "Account inesistente!",
"unmatchingPassword": "La password inserita non è corretta!",
"passwordNotMatchingConfirmPassword": "La password deve essere uguale alla conferma password!",
"confirmPassword": "Conferma Password",
"registrationAgeWarning": "Registrandoti confermi di avere 13 anni o più.",
"backToLogin": "Torna all'accesso",
"failedToLoadSaveData": "Impossibile caricare i dati di salvataggio. Ricarica la pagina.\nSe il problema persiste, contatta l'amministratore.",
"sessionSuccess": "Sessione caricata correttamente.",
"failedToLoadSession": "Impossibile caricare i dati della sessione.\nPotrebbero essere danneggiati.",
"boyOrGirl": "Sei un ragazzo o una ragazza?",
"boy": "Ragazzo",
"girl": "Ragazza",
"dailyRankings": "Classifica Giornaliera",
"weeklyRankings": "Classifica Settimanale",
"noRankings": "Nessuna Classifica",
"loading": "Caricamento…",
"playersOnline": "Giocatori Online",
"empty":"Vuoto",
"yes":"Si",
"no":"No",
"confirmStartTeam":'Begin with these Pokémon?',
"confirmStartTeam":'Vuoi iniziare con questi Pokémon?',
} as const;
File diff suppressed because it is too large. Load diff
+10
View File
@@ -0,0 +1,10 @@
import { SimpleTranslationEntries } from "#app/plugins/i18n";
export const pokeball: SimpleTranslationEntries = {
"pokeBall": "Poké Ball",
"greatBall": "Mega Ball",
"ultraBall": "Ultra Ball",
"rogueBall": "Rogue Ball",
"masterBall": "Master Ball",
"luxuryBall": "Chich Ball",
} as const;
File diff suppressed because it is too large. Load diff
+29 -11
View File
@@ -2,7 +2,7 @@ import BattleScene, { bypassLogin, startingWave } from "./battle-scene";
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
import * as Utils from './utils';
import { Moves } from "./data/enums/moves";
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr } from "./data/move";
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr } from "./data/move";
import { Mode } from './ui/ui';
import { Command } from "./ui/command-ui-handler";
import { Stat } from "./data/pokemon-stat";
@@ -30,7 +30,7 @@ import { Weather, WeatherType, getRandomWeatherType, getTerrainBlockMessage, get
import { TempBattleStat } from "./data/temp-battle-stat";
import { ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag } from "./data/arena-tag";
import { ArenaTagType } from "./data/enums/arena-tag-type";
import { CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostAttackAbAttr, PostBattleAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RedirectMoveAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostBattleAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs, BattleStatMultiplierAbAttr, applyBattleStatMultiplierAbAttrs, IncrementMovePriorityAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr, applyPostBattleInitAbAttrs, PostBattleInitAbAttr, BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, PostBiomeChangeAbAttr, applyPostFaintAbAttrs, PostFaintAbAttr, IncreasePpAbAttr, PostStatChangeAbAttr, applyPostStatChangeAbAttrs, AlwaysHitAbAttr, PreventBerryUseAbAttr } from "./data/ability";
import { CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostAttackAbAttr, PostBattleAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RedirectMoveAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostBattleAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs, BattleStatMultiplierAbAttr, applyBattleStatMultiplierAbAttrs, IncrementMovePriorityAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr, applyPostBattleInitAbAttrs, PostBattleInitAbAttr, BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, PostBiomeChangeAbAttr, applyPostFaintAbAttrs, PostFaintAbAttr, IncreasePpAbAttr, PostStatChangeAbAttr, applyPostStatChangeAbAttrs, AlwaysHitAbAttr, PreventBerryUseAbAttr, StatChangeCopyAbAttr } from "./data/ability";
import { Unlockables, getUnlockableName } from "./system/unlockables";
import { getBiomeKey } from "./field/arena";
import { BattleType, BattlerIndex, TurnCommand } from "./battle";
@@ -1206,14 +1206,26 @@ export class SummonPhase extends PartyMemberPokemonPhase {
this.preSummon();
}
/**
* Sends out a Pokemon before the battle begins and shows the appropriate messages
*/
preSummon(): void {
const partyMember = this.getPokemon();
// If the Pokemon about to be sent out is fainted, switch to the first non-fainted Pokemon
if (partyMember.isFainted()) {
console.warn("The Pokemon about to be sent out is fainted. Attempting to resolve...");
const party = this.getParty();
const nonFaintedIndex = party.slice(this.partyMemberIndex).findIndex(p => !p.isFainted()) + this.partyMemberIndex;
const nonFaintedPartyMember = party[nonFaintedIndex];
party[nonFaintedIndex] = partyMember;
party[this.partyMemberIndex] = nonFaintedPartyMember;
// Find the first non-fainted Pokemon index above the current one
const nonFaintedIndex = party.findIndex((p, i) => i > this.partyMemberIndex && !p.isFainted());
if (nonFaintedIndex === -1) {
console.error("Party Details:\n", party);
throw new Error("All available Pokemon were fainted!");
}
// Swaps the fainted Pokemon and the first non-fainted Pokemon in the party
[party[this.partyMemberIndex], party[nonFaintedIndex]] = [party[nonFaintedIndex], party[this.partyMemberIndex]];
console.warn("Swapped %s %O with %s %O", partyMember?.name, partyMember, party[0]?.name, party[0]);
}
if (this.player) {
@@ -2299,7 +2311,7 @@ export class MovePhase extends BattlePhase {
let failedText = null;
if (success && this.scene.arena.isMoveWeatherCancelled(this.move.getMove()))
success = false;
else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.move.getMove())) {
else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, this.move.getMove())) {
success = false;
failedText = getTerrainBlockMessage(targets[0], this.scene.arena.terrain.terrainType);
}
@@ -2430,7 +2442,7 @@ export class MoveEffectPhase extends PokemonPhase {
const targetHitChecks = Object.fromEntries(targets.map(p => [ p.getBattlerIndex(), this.hitCheck(p) ]));
const activeTargets = targets.map(t => t.isActive(true));
if (!activeTargets.length || (!this.move.getMove().isMultiTarget() && !targetHitChecks[this.targets[0]])) {
if (!activeTargets.length || (!this.move.getMove().getAttrs(VariableTargetAttr).length && !this.move.getMove().isMultiTarget() && !targetHitChecks[this.targets[0]])) {
user.turnData.hitCount = 1;
user.turnData.hitsLeft = 1;
if (activeTargets.length) {
@@ -2691,8 +2703,9 @@ export class StatChangePhase extends PokemonPhase {
private levels: integer;
private showMessage: boolean;
private ignoreAbilities: boolean;
private canBeCopied: boolean;
constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], levels: integer, showMessage: boolean = true, ignoreAbilities: boolean = false) {
constructor(scene: BattleScene, battlerIndex: BattlerIndex, selfTarget: boolean, stats: BattleStat[], levels: integer, showMessage: boolean = true, ignoreAbilities: boolean = false, canBeCopied: boolean = true) {
super(scene, battlerIndex);
this.selfTarget = selfTarget;
@@ -2700,6 +2713,7 @@ export class StatChangePhase extends PokemonPhase {
this.levels = levels;
this.showMessage = showMessage;
this.ignoreAbilities = ignoreAbilities;
this.canBeCopied = canBeCopied;
}
start() {
@@ -2747,8 +2761,12 @@ export class StatChangePhase extends PokemonPhase {
for (let stat of filteredStats)
pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6);
if (levels.value > 0 && this.canBeCopied)
for (let opponent of pokemon.getOpponents())
applyAbAttrs(StatChangeCopyAbAttr, opponent, null, this.stats, levels.value);
applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget);
pokemon.updateInfo();
handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end());
@@ -4387,7 +4405,7 @@ export class SelectModifierPhase extends BattlePhase {
const isMoveModifier = modifierType instanceof PokemonMoveModifierType;
const isTmModifier = modifierType instanceof TmModifierType;
const isRememberMoveModifier = modifierType instanceof RememberMoveModifierType;
const isPpRestoreModifier = modifierType instanceof PokemonPpRestoreModifierType;
const isPpRestoreModifier = (modifierType instanceof PokemonPpRestoreModifierType || modifierType instanceof PokemonPpUpModifierType);
const partyUiMode = isMoveModifier ? PartyUiMode.MOVE_MODIFIER
: isTmModifier ? PartyUiMode.TM_MODIFIER
: isRememberMoveModifier ? PartyUiMode.REMEMBER_MOVE_MODIFIER
+10
View File
@@ -21,21 +21,25 @@ import { battle as deBattle } from '../locales/de/battle';
import { move as enMove } from '../locales/en/move';
import { move as esMove } from '../locales/es/move';
import { move as itMove } from '../locales/it/move';
import { move as frMove } from '../locales/fr/move';
import { move as deMove } from '../locales/de/move';
import { ability as enAbility } from '../locales/en/ability';
import { ability as esAbility } from '../locales/es/ability';
import { ability as itAbility } from '../locales/it/ability';
import { ability as frAbility } from '../locales/fr/ability';
import { ability as deAbility } from '../locales/de/ability';
import { pokeball as enPokeball } from '../locales/en/pokeball';
import { pokeball as esPokeball } from '../locales/es/pokeball';
import { pokeball as itPokeball } from '../locales/it/pokeball';
import { pokeball as frPokeball } from '../locales/fr/pokeball';
import { pokeball as dePokeball } from '../locales/de/pokeball';
import { pokemon as enPokemon } from '../locales/en/pokemon';
import { pokemon as esPokemon } from '../locales/es/pokemon';
import { pokemon as itPokemon } from '../locales/it/pokemon';
import { pokemon as frPokemon } from '../locales/fr/pokemon';
import { pokemon as dePokemon } from '../locales/de/pokemon';
@@ -47,6 +51,7 @@ import { pokemonStat as dePokemonStat } from '../locales/de/pokemon-stat';
import { commandUiHandler as enCommandUiHandler } from '../locales/en/command-ui-handler';
import { commandUiHandler as esCommandUiHandler } from '../locales/es/command-ui-handler';
import { commandUiHandler as itCommandUiHandler } from '../locales/it/command-ui-handler';
import { commandUiHandler as frCommandUiHandler } from '../locales/fr/command-ui-handler';
import { commandUiHandler as deCommandUiHandler } from '../locales/de/command-ui-handler';
@@ -162,7 +167,12 @@ export function initI18n(): void {
menu: itMenu,
menuUiHandler: itMenuUiHandler,
battle: itBattle,
move: itMove,
ability: itAbility,
pokeball: itPokeball,
pokemon: itPokemon,
pokemonStat: itPokemonStat,
commandUiHandler: itCommandUiHandler,
fightUiHandler: itFightUiHandler,
tutorial: itTutorial,
},
+4
View File
@@ -180,6 +180,10 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
label: 'Spanish',
handler: () => changeLocaleHandler('es')
},
{
label: 'Italian',
handler: () => changeLocaleHandler('it')
},
{
label: 'French',
handler: () => changeLocaleHandler('fr')
+39 -1
View File
@@ -1,8 +1,10 @@
import BattleScene, { Button } from "../battle-scene";
import BattleScene, { Button, starterColors } from "../battle-scene";
import { Mode } from "./ui";
import UiHandler from "./ui-handler";
import * as Utils from "../utils";
import { PlayerPokemon } from "../field/pokemon";
import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies, getPokemonSpeciesForm, getStarterValueFriendshipCap, speciesStarters, starterPassiveAbilities } from '../data/pokemon-species';
import { argbFromRgba } from "@material/material-color-utilities";
import { Type, getTypeRgb } from "../data/type";
import { TextStyle, addBBCodeTextObject, addTextObject, getBBCodeFrag, getTextColor } from "./text";
import Move, { MoveCategory } from "../data/move";
@@ -44,6 +46,9 @@ export default class SummaryUiHandler extends UiHandler {
private genderText: Phaser.GameObjects.Text;
private shinyIcon: Phaser.GameObjects.Image;
private fusionShinyIcon: Phaser.GameObjects.Image;
private candyShadow: Phaser.GameObjects.Sprite;
private candyIcon: Phaser.GameObjects.Sprite;
private candyOverlay: Phaser.GameObjects.Sprite;
private statusContainer: Phaser.GameObjects.Container;
private status: Phaser.GameObjects.Image;
private summaryPageContainer: Phaser.GameObjects.Container;
@@ -136,6 +141,20 @@ export default class SummaryUiHandler extends UiHandler {
this.pokeball.setOrigin(0, 1);
this.summaryContainer.add(this.pokeball);
this.candyShadow = this.scene.add.sprite(13, -140, 'candy');
this.candyShadow.setTint(0x141414)
this.candyShadow.setScale(0.8);
this.candyShadow.setInteractive(new Phaser.Geom.Rectangle(0, 0, 16, 16), Phaser.Geom.Rectangle.Contains);
this.summaryContainer.add(this.candyShadow);
this.candyIcon = this.scene.add.sprite(13, -140, 'candy');
this.candyIcon.setScale(0.8);
this.summaryContainer.add(this.candyIcon);
this.candyOverlay = this.scene.add.sprite(13, -140, 'candy_overlay');
this.candyOverlay.setScale(0.8);
this.summaryContainer.add(this.candyOverlay);
this.levelText = addTextObject(this.scene, 36, -17, '', TextStyle.SUMMARY_ALT);
this.levelText.setOrigin(0, 1);
this.summaryContainer.add(this.levelText);
@@ -222,6 +241,10 @@ export default class SummaryUiHandler extends UiHandler {
this.shinyOverlay.setVisible(this.pokemon.isShiny());
const colorScheme = starterColors[this.pokemon.species.getRootSpeciesId()];
this.candyIcon.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[0])));
this.candyOverlay.setTint(argbFromRgba(Utils.rgbHexToRgba(colorScheme[1])));
this.numberText.setText(Utils.padInt(this.pokemon.species.speciesId, 4));
this.numberText.setColor(this.getTextColor(!this.pokemon.isShiny() ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD));
this.numberText.setShadowColor(this.getTextColor(!this.pokemon.isShiny() ? TextStyle.SUMMARY : TextStyle.SUMMARY_GOLD, true));
@@ -251,6 +274,21 @@ export default class SummaryUiHandler extends UiHandler {
this.splicedIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
}
var currentFriendship = this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].friendship;
if (!currentFriendship || currentFriendship === undefined)
currentFriendship = 0;
const friendshipCap = getStarterValueFriendshipCap(speciesStarters[this.pokemon.species.getRootSpeciesId()]);
const candyCropY = 16 - (16 * (currentFriendship / friendshipCap));
if (this.candyShadow.visible) {
this.candyShadow.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `${currentFriendship}/${friendshipCap}`, true));
this.candyShadow.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
}
this.candyIcon.setCrop(0,candyCropY,16, 16);
this.candyOverlay.setCrop(0,candyCropY,16, 16);
const doubleShiny = isFusion && this.pokemon.shiny && this.pokemon.fusionShiny;
const baseVariant = !doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant;
+10
View File
@@ -62,6 +62,11 @@ export function padInt(value: integer, length: integer, padWith?: string): strin
return valueStr;
}
/**
* Returns a random integer between min and min + range
* @param range The amount of possible numbers
* @param min The starting number
*/
export function randInt(range: integer, min: integer = 0): integer {
if (range === 1)
return min;
@@ -74,6 +79,11 @@ export function randSeedInt(range: integer, min: integer = 0): integer {
return Phaser.Math.RND.integerInRange(min, (range - 1) + min);
}
/**
* Returns a random integer between min and max (non-inclusive)
* @param min The lowest number
* @param max The highest number
*/
export function randIntRange(min: integer, max: integer): integer {
return randInt(max - min, min);
}