From 29b80dbed85e02e37a97123180d5fad302edd78f Mon Sep 17 00:00:00 2001 From: gericocross <32669590+gericocross@users.noreply.github.com> Date: Mon, 6 May 2024 14:44:05 +0200 Subject: [PATCH 1/5] Fixed Grafaiai animation (#547) * Longer descriptions don't stuck shorter ones anymore * Fixed Grafaiai animation --- public/images/pokemon/exp/945.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/images/pokemon/exp/945.json b/public/images/pokemon/exp/945.json index 9456e435d..31ba1c930 100644 --- a/public/images/pokemon/exp/945.json +++ b/public/images/pokemon/exp/945.json @@ -146,14 +146,14 @@ "spriteSourceSize": { "x": 0, "y": 0, - "w": 3, - "h": 3 + "w": 66, + "h": 55 }, "frame": { - "x": 132, - "y": 0, - "w": 3, - "h": 3 + "x": 0, + "y": 112, + "w": 66, + "h": 55 } }, { From f92b563baaa9baecde58c01654ad2bc2ab1899c5 Mon Sep 17 00:00:00 2001 From: Matthew Ross Date: Sun, 5 May 2024 22:12:10 -0700 Subject: [PATCH 2/5] Hunger switch shouldn't trigger if terastallized --- src/data/ability.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index c21b88832..07aecbdcc 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3453,7 +3453,8 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(NoTransformAbilityAbAttr) - .attr(NoFusionAbilityAbAttr), + .attr(NoFusionAbilityAbAttr) + .condition((pokemon) => !pokemon.isTerastallized()), new Ability(Abilities.QUICK_DRAW, 8) .unimplemented(), new Ability(Abilities.UNSEEN_FIST, 8) From e3c1d08b378aa21417650223b85f5342959da578 Mon Sep 17 00:00:00 2001 From: Lugiad Date: Mon, 6 May 2024 11:50:50 +0200 Subject: [PATCH 3/5] Update French battle.ts + typo --- src/locales/fr/battle.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/fr/battle.ts b/src/locales/fr/battle.ts index 2167ddd31..56ab69215 100644 --- a/src/locales/fr/battle.ts +++ b/src/locales/fr/battle.ts @@ -23,7 +23,7 @@ export const battle: SimpleTranslationEntries = { "attackHitsCount": `Touché {{count}} fois !`, "expGain": "{{pokemonName}} gagne\n{{exp}} Points d’Exp !", "levelUp": "{{pokemonName}} monte au\nN. {{level}} !", - "learnMove": "{{pokemonName}} apprend \n{{moveName}} !", + "learnMove": "{{pokemonName}} apprend\n{{moveName}} !", "learnMovePrompt": "{{pokemonName}} veut apprendre\n{{moveName}}.", "learnMoveLimitReached": "Cependant, {{pokemonName}} connait\ndéjà quatre capacités.", "learnMoveReplaceQuestion": "Voulez-vous oublier une capacité\net la remplacer par {{moveName}} ?", @@ -33,7 +33,7 @@ export const battle: SimpleTranslationEntries = { "learnMoveForgetSuccess": "{{pokemonName}} oublie comment\nutiliser {{moveName}}.", "levelCapUp": "La limite de niveau\na été augmentée à {{levelCap}} !", "moveNotImplemented": "{{moveName}} n’est pas encore implémenté et ne peut pas être sélectionné.", - "moveNoPP": "There's no PP left for\nthis move!", + "moveNoPP": "Il n’y a plus de PP pour\ncette capacité !", "moveDisabled": "{{moveName}} est sous entrave !", "noPokeballForce": "Une force mystérieuse\nempêche l’utilisation des Poké Balls.", "noPokeballTrainer": "Le Dresseur détourne la Ball\nVoler, c’est mal !", From 80b6001c777ca95721b6bf421034086fa2412cd5 Mon Sep 17 00:00:00 2001 From: lucfd <83493765+lucfd@users.noreply.github.com> Date: Mon, 6 May 2024 11:24:37 -0400 Subject: [PATCH 4/5] Implemented Revelation Dance (#166) * implemented Revelation Dance * fixed steam engine activating on all water moves * implemented typeless * stellar handling for revelation dance * removed testing lines * changed to UNKNOWN implementation * removed UNKNOWN RGB * removed print debug + unnecessary logic * simplified test condition further --- src/data/move.ts | 23 ++++++++++++++++++++++- src/data/type.ts | 2 +- src/field/pokemon.ts | 9 ++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index afad81d48..a4ca1e422 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2440,6 +2440,27 @@ export class HiddenPowerTypeAttr extends VariableMoveTypeAttr { } } +export class MatchUserTypeAttr extends VariableMoveTypeAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + const type = (args[0] as Utils.IntegerHolder); + + const userTypes = user.getTypes(true); + + if(userTypes.includes(Type.STELLAR)) { // will not change to stellar type + const nonTeraTypes = user.getTypes(); + type.value = nonTeraTypes[0]; + return true; + } + else if (userTypes.length > 0) { + type.value = userTypes[0]; + return true; + } + else + return false; + + } +} + export class VariableMoveTypeMultiplierAttr extends MoveAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { return false; @@ -5796,7 +5817,7 @@ export function initMoves() { .unimplemented(), new AttackMove(Moves.REVELATION_DANCE, Type.NORMAL, MoveCategory.SPECIAL, 90, 100, 15, -1, 0, 7) .danceMove() - .partial(), + .attr(MatchUserTypeAttr), new AttackMove(Moves.CORE_ENFORCER, Type.DRAGON, MoveCategory.SPECIAL, 100, 100, 10, -1, 0, 7) .target(MoveTarget.ALL_NEAR_ENEMIES) .partial(), diff --git a/src/data/type.ts b/src/data/type.ts index 14f9f932a..35c56aecd 100644 --- a/src/data/type.ts +++ b/src/data/type.ts @@ -543,4 +543,4 @@ export function getTypeRgb(type: Type): [ integer, integer, integer ] { default: return [ 0, 0, 0 ]; } -} \ No newline at end of file +} diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 36dc4265e..2242b1ee6 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -778,9 +778,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { types.splice(flyingIndex, 1); } - if (!types.length) + if (!types.length) // become UNKNOWN if no types are present types.push(Type.UNKNOWN); + if (types.length > 1 && types.includes(Type.UNKNOWN)) { // remove UNKNOWN if other types are present + const index = types.indexOf(Type.UNKNOWN); + if (index !== -1) { + types.splice(index, 1); + } + } + return types; } From f22c25d37683d053db83769d458aa67b97e07eac Mon Sep 17 00:00:00 2001 From: Viet Nguyen Date: Mon, 6 May 2024 11:30:23 -0400 Subject: [PATCH 5/5] add unit test for util function padInt (#175) Co-authored-by: Viet Nguyen --- src/utils.test.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/utils.test.ts b/src/utils.test.ts index 8dc46371a..22ccbfc63 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -1,5 +1,5 @@ import { expect, describe, it } from "vitest"; -import { randomString } from "./utils"; +import { randomString, padInt } from "./utils"; import Phaser from "phaser"; @@ -19,4 +19,26 @@ describe("utils", () => { expect(str1).toBe(str2); }); }); + + describe("padInt", () => { + it("should return a string", () => { + const result = padInt(1, 10); + expect(typeof result).toBe('string'); + }); + + it("should return a padded result with default padWith", () => { + const result = padInt(1, 3); + expect(result).toBe('001'); + }); + + it("should return a padded result using a custom padWith", () => { + const result = padInt(1, 10, 'yes') + expect(result).toBe('yesyesyes1'); + }); + + it("should return inputted value when zero length is entered", () => { + const result = padInt(1, 0); + expect(result).toBe('1') + }) + }); });