Compare commits

...

11 Commits

Author SHA1 Message Date
Benjamin Odom
ea5e535f9f
Fixed Failed Moves Not Using PP (#634)
Fixed an issue where if a move failed, it would not use power points.
2024-05-08 15:51:56 -05:00
Benjamin Odom
4509e08dc6
Renamed the Python Script File (#657)
Accidentally left out the 'c' in 'comments'
2024-05-08 15:50:31 -05:00
Flashfyre
e993bf9945 Fix session slot always saving to first slot in offline mode 2024-05-08 16:36:44 -04:00
maru
3ec9081a77
Change titlestats update interval to 60 seconds 2024-05-08 15:47:03 -04:00
Elliott Simmonds
cb24faa12e
Small fixes to burning bulwark and alluring voice (#651) 2024-05-08 13:39:22 -05:00
Madmadness65
8a35166988 Slightly adjust Recovery Tokens
Each individual token heals 1 percent less, but now stacks to 15 instead of 10, to maintain the current maximum of 30% recovered per turn.
The purpose of this change is to make the healing more gradual, and just generally less painful if you get multiple early on.
2024-05-08 12:38:31 -05:00
Lugiad
0af02210ee
Overflowing fix in French menu.ts (#648) 2024-05-08 12:36:09 -05:00
Akuma-Reiki
ea1ed1352c
Hide Ribbons When Not Owned (#649)
* Candy/Ribbon UI Update

* Removes the overrides

No level 2000000000000000 runs for you

* checks for all root species

* Hide ribbon when not owned
2024-05-08 12:35:27 -05:00
Lugiad
e93777e52a
Names of the languages in their respectives languages (#635)
* Names of the languages in their respectives languages in settings

* Names of the languages in their respectives languages
2024-05-08 12:08:34 -05:00
Akuma-Reiki
662319e9ac
Candy/Ribbon UI Improvement (#622)
* Candy/Ribbon UI Update

* Removes the overrides

No level 2000000000000000 runs for you

* checks for all root species
2024-05-08 12:01:05 -05:00
Gray
b6692e42b2
Fix Flare Blitz in Gravity (#637)
This condition is out of place since Flare Blitz is not supposed to fail if used in Gravity.
2024-05-08 10:25:47 -05:00
12 changed files with 75 additions and 38 deletions

View File

@ -5132,7 +5132,6 @@ export function initMoves() {
.attr(RecoilAttr, false, 0.33)
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
.attr(StatusEffectAttr, StatusEffect.BURN)
.condition(failOnGravityCondition)
.recklessMove(),
new AttackMove(Moves.FORCE_PALM, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, 30, 0, 4)
.attr(StatusEffectAttr, StatusEffect.PARALYSIS),
@ -6669,7 +6668,7 @@ export function initMoves() {
new AttackMove(Moves.FICKLE_BEAM, Type.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, 30, 0, 9)
.attr(PreMoveMessageAttr, doublePowerChanceMessageFunc)
.attr(DoublePowerChanceAttr),
new StatusMove(Moves.BURNING_BULWARK, Type.FIRE, -1, 10, 100, 4, 9)
new SelfStatusMove(Moves.BURNING_BULWARK, Type.FIRE, -1, 10, 100, 4, 9)
.attr(ProtectAttr, BattlerTagType.BURNING_BULWARK),
new AttackMove(Moves.THUNDERCLAP, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 5, -1, 1, 9)
.condition((user, target, move) => user.scene.currentBattle.turnCommands[target.getBattlerIndex()].command === Command.FIGHT && !target.turnData.acted && allMoves[user.scene.currentBattle.turnCommands[target.getBattlerIndex()].move.move].category !== MoveCategory.STATUS),
@ -6686,6 +6685,7 @@ export function initMoves() {
.target(MoveTarget.NEAR_ALLY)
.partial(),
new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9)
.soundBased()
.partial(),
new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result == MoveResult.MISS || user.getLastXMoves(2)[1]?.result == MoveResult.FAIL ? 2 : 1),

View File

@ -3206,6 +3206,14 @@ export class PokemonMove {
return allMoves[this.moveId];
}
/**
* Sets {@link ppUsed} for this move and ensures the value does not exceed {@link getMovePp}
* @param {number} count Amount of PP to use
*/
usePp(count: number = 1) {
this.ppUsed = Math.min(this.ppUsed + count, this.getMovePp());
}
getMovePp(): integer {
return this.getMove().pp + this.ppUp * Math.max(Math.floor(this.getMove().pp / 5), 1);
}

View File

@ -24,7 +24,7 @@ export const menu: SimpleTranslationEntries = {
"confirmPassword": "Confirmer le MDP",
"registrationAgeWarning": "Vous confirmez en vous inscrivant que vous avez 13 ans ou plus.",
"backToLogin": "Retour",
"failedToLoadSaveData": "Échec du chargement des données. Veuillez recharger la page.\nSi cela continue, veuillez contacter ladministrateur.",
"failedToLoadSaveData": "Échec du chargement des données. Veuillez recharger\nla page. Si cela persiste, contactez ladministrateur.",
"sessionSuccess": "Session chargée avec succès.",
"failedToLoadSession": "Vos données de session nont pas pu être chargées.\nElles pourraient être corrompues.",
"boyOrGirl": "Es-tu un garçon ou une fille ?",

View File

@ -955,7 +955,7 @@ export const modifierTypes = {
ENEMY_DAMAGE_BOOSTER: () => new ModifierType('Damage Token', 'Increases damage by 5%', (type, _args) => new Modifiers.EnemyDamageBoosterModifier(type, 5), 'wl_item_drop'),
ENEMY_DAMAGE_REDUCTION: () => new ModifierType('Protection Token', 'Reduces incoming damage by 2.5%', (type, _args) => new Modifiers.EnemyDamageReducerModifier(type, 2.5), 'wl_guard_spec'),
//ENEMY_SUPER_EFFECT_BOOSTER: () => new ModifierType('Type Advantage Token', 'Increases damage of super effective attacks by 30%', (type, _args) => new Modifiers.EnemySuperEffectiveDamageBoosterModifier(type, 30), 'wl_custom_super_effective'),
ENEMY_HEAL: () => new ModifierType('Recovery Token', 'Heals 3% of max HP every turn', (type, _args) => new Modifiers.EnemyTurnHealModifier(type, 3), 'wl_potion'),
ENEMY_HEAL: () => new ModifierType('Recovery Token', 'Heals 2% of max HP every turn', (type, _args) => new Modifiers.EnemyTurnHealModifier(type, 2), 'wl_potion'),
ENEMY_ATTACK_POISON_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Poison Token', 10, StatusEffect.POISON, 'wl_antidote'),
ENEMY_ATTACK_PARALYZE_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Paralyze Token', 10, StatusEffect.PARALYSIS, 'wl_paralyze_heal'),
ENEMY_ATTACK_SLEEP_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Sleep Token', 10, StatusEffect.SLEEP, 'wl_awakening'),

View File

@ -2004,7 +2004,7 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier {
super(type, stackCount);
// Hardcode temporarily
this.healPercent = 3;
this.healPercent = 2;
}
match(modifier: Modifier): boolean {
@ -2033,7 +2033,7 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier {
}
getMaxStackCount(scene: BattleScene): integer {
return 10;
return 15;
}
}

View File

@ -2158,6 +2158,7 @@ export class MovePhase extends BattlePhase {
public targets: BattlerIndex[];
protected followUp: boolean;
protected ignorePp: boolean;
protected failed: boolean;
protected cancelled: boolean;
constructor(scene: BattleScene, pokemon: Pokemon, targets: BattlerIndex[], move: PokemonMove, followUp?: boolean, ignorePp?: boolean) {
@ -2168,6 +2169,7 @@ export class MovePhase extends BattlePhase {
this.move = move;
this.followUp = !!followUp;
this.ignorePp = !!ignorePp;
this.failed = false;
this.cancelled = false;
}
@ -2175,6 +2177,12 @@ export class MovePhase extends BattlePhase {
return this.pokemon.isActive(true) && this.move.isUsable(this.pokemon, this.ignorePp) && !!this.targets.length;
}
/**Signifies the current move should fail but still use PP */
fail(): void {
this.failed = true;
}
/**Signifies the current move should cancel and retain PP */
cancel(): void {
this.cancelled = true;
}
@ -2214,7 +2222,7 @@ export class MovePhase extends BattlePhase {
this.targets[0] = attacker.getBattlerIndex();
}
if (this.targets[0] === BattlerIndex.ATTACKER) {
this.cancel();
this.fail(); // Marks the move as failed for later in doMove
this.showMoveText();
this.showFailedText();
}
@ -2234,11 +2242,24 @@ export class MovePhase extends BattlePhase {
this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
let ppUsed = 1;
// Filter all opponents to include only those this move is targeting
const targetedOpponents = this.pokemon.getOpponents().filter(o => this.targets.includes(o.getBattlerIndex()));
for (let opponent of targetedOpponents) {
if (this.move.ppUsed + ppUsed >= this.move.getMovePp()) // If we're already at max PP usage, stop checking
break;
if (opponent.hasAbilityWithAttr(IncreasePpAbAttr)) // Accounting for abilities like Pressure
ppUsed++;
}
if (!this.followUp && this.canMove() && !this.cancelled) {
this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
}
if (this.cancelled) {
if (this.cancelled || this.failed) {
if (this.failed)
this.move.usePp(ppUsed); // Only use PP if the move failed
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
return this.end();
}
@ -2253,23 +2274,12 @@ export class MovePhase extends BattlePhase {
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
moveQueue.shift();
this.cancel();
}
if (this.cancelled) {
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
return this.end();
}
if (!moveQueue.length || !moveQueue.shift().ignorePP) {
this.move.ppUsed++;
const targetedOpponents = this.pokemon.getOpponents().filter(o => this.targets.includes(o.getBattlerIndex()));
for (let opponent of targetedOpponents) {
if (this.move.ppUsed === this.move.getMove().pp)
break;
if (opponent.hasAbilityWithAttr(IncreasePpAbAttr))
this.move.ppUsed = Math.min(this.move.ppUsed + 1, this.move.getMovePp());
}
}
if (!moveQueue.length || !moveQueue.shift().ignorePP) // using .shift here clears out two turn moves once they've been used
this.move.usePp(ppUsed);
if (!allMoves[this.move.moveId].getAttrs(CopyMoveAttr).length)
this.scene.currentBattle.lastMove = this.move.moveId;

View File

@ -569,7 +569,7 @@ export class GameData {
resolve(true);
});
} else {
localStorage.setItem('sessionData', btoa(JSON.stringify(sessionData)));
localStorage.setItem(`sessionData${scene.sessionSlotId ? scene.sessionSlotId : ''}`, btoa(JSON.stringify(sessionData)));
console.debug('Session data saved');

View File

@ -183,19 +183,19 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
handler: () => changeLocaleHandler('en')
},
{
label: 'Spanish',
label: 'Español',
handler: () => changeLocaleHandler('es')
},
{
label: 'Italian',
label: 'Italiano',
handler: () => changeLocaleHandler('it')
},
{
label: 'French',
label: 'Français',
handler: () => changeLocaleHandler('fr')
},
{
label: 'German',
label: 'Deutsch',
handler: () => changeLocaleHandler('de')
},
{

View File

@ -414,7 +414,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.classicWinIcons = new Array(81).fill(null).map((_, i) => {
const x = (i % 9) * 18;
const y = Math.floor(i / 9) * 18;
const ret = this.scene.add.image(x + 152, y + 16, 'champion_ribbon');
const ret = this.scene.add.image(x + 153, y + 21, 'champion_ribbon');
ret.setOrigin(0, 0);
ret.setScale(0.5);
ret.setVisible(false);
@ -462,7 +462,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonCandyDarknessOverlay.setScale(0.5);
this.pokemonCandyDarknessOverlay.setOrigin(0, 0);
this.pokemonCandyDarknessOverlay.setTint(0x000000);
this.pokemonCandyDarknessOverlay.setAlpha(0.5);
this.pokemonCandyDarknessOverlay.setAlpha(0.50);
this.pokemonCandyDarknessOverlay.setInteractive(new Phaser.Geom.Rectangle(0, 0, 16, 16), Phaser.Geom.Rectangle.Contains);
this.starterSelectContainer.add(this.pokemonCandyDarknessOverlay);
@ -1332,7 +1332,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
}
this.pokemonCandyDarknessOverlay.setCrop(0,0,16, candyCropY);
this.pokemonCandyDarknessOverlay.setCrop(0,0,16, candyCropY);
}
this.iconAnimHandler.addOrUpdate(this.starterSelectGenIconContainers[species.generation - 1].getAt(this.genSpecies[species.generation - 1].indexOf(species)) as Phaser.GameObjects.Sprite, PokemonIconAnimMode.PASSIVE);

View File

@ -50,6 +50,8 @@ export default class SummaryUiHandler extends UiHandler {
private candyShadow: Phaser.GameObjects.Sprite;
private candyIcon: Phaser.GameObjects.Sprite;
private candyOverlay: Phaser.GameObjects.Sprite;
private candyCountText: Phaser.GameObjects.Text;
private championRibbon: Phaser.GameObjects.Image;
private statusContainer: Phaser.GameObjects.Container;
private status: Phaser.GameObjects.Image;
private summaryPageContainer: Phaser.GameObjects.Container;
@ -142,12 +144,6 @@ 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);
@ -156,6 +152,24 @@ export default class SummaryUiHandler extends UiHandler {
this.candyOverlay.setScale(0.8);
this.summaryContainer.add(this.candyOverlay);
this.candyShadow = this.scene.add.sprite(13, -140, 'candy');
this.candyShadow.setTint(0x000000);
this.candyShadow.setAlpha(0.50);
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.candyCountText = addTextObject(this.scene, 20, -146, 'x0', TextStyle.WINDOW_ALT, { fontSize: '76px' });
this.candyCountText.setOrigin(0, 0);
this.summaryContainer.add(this.candyCountText);
this.championRibbon = this.scene.add.image(88, -146, 'champion_ribbon');
this.championRibbon.setOrigin(0, 0);
//this.championRibbon.setScale(0.8);
this.championRibbon.setScale(1.25);
this.summaryContainer.add(this.championRibbon);
this.championRibbon.setVisible(false);
this.levelText = addTextObject(this.scene, 36, -17, '', TextStyle.SUMMARY_ALT);
this.levelText.setOrigin(0, 1);
this.summaryContainer.add(this.levelText);
@ -275,6 +289,11 @@ export default class SummaryUiHandler extends UiHandler {
this.splicedIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
}
if(this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].classicWinCount > 0 && this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId(true)].classicWinCount > 0)
this.championRibbon.setVisible(true);
else
this.championRibbon.setVisible(false);
var currentFriendship = this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].friendship;
if (!currentFriendship || currentFriendship === undefined)
currentFriendship = 0;
@ -287,8 +306,9 @@ export default class SummaryUiHandler extends UiHandler {
this.candyShadow.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip());
}
this.candyIcon.setCrop(0,candyCropY,16, 16);
this.candyOverlay.setCrop(0,candyCropY,16, 16);
this.candyCountText.setText(`x${this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].candyCount}`);
this.candyShadow.setCrop(0,0,16, candyCropY);
const doubleShiny = isFusion && this.pokemon.shiny && this.pokemon.fusionShiny;
const baseVariant = !doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant;

View File

@ -84,7 +84,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
this.updateTitleStats();
this.titleStatsTimer = setInterval(() => this.updateTitleStats(), 30000);
this.titleStatsTimer = setInterval(() => this.updateTitleStats(), 60000);
this.scene.tweens.add({
targets: [ this.titleContainer, ui.getMessageHandler().bg ],