Compare commits

...

16 Commits

Author SHA1 Message Date
Madmadness65 747b388f66
Merge e679ad01ab into 51bb80cb66 2024-09-19 00:45:43 -05:00
MokaStitcher 51bb80cb66
[Bug][UI] Fix scrolling UIs not resetting properly and add Scrollbars (#4312)
* [bug] fix scrollable elements not resetting properly

* [ui] add wrap around and scrolling bar to the achievements menu

* [ui] add scrollbar to the settings
2024-09-18 19:53:30 -04:00
Madmadness65 e679ad01ab Guarantee Starmobiles on admin's teams
Also resizing the Starmobiles by 1.5 like Gigantamax Pokémon (it is still just regular Revavroom visually for now).
2024-09-18 17:25:23 -05:00
Madmadness65 1bf418f43d Merge branch 'beta' into new-team 2024-09-18 17:05:21 -05:00
Madmadness65 e5dd187edf Guarantee Sylveon is always Terastallized 2024-09-15 02:09:19 -05:00
Madmadness65 2792ba83c9
Merge branch 'beta' into new-team 2024-09-15 01:01:44 -05:00
Madmadness65 35248f8479 fix missing semicolon 2024-09-15 01:00:21 -05:00
Madmadness65 4cfff4fffc
Update Team Star boss team compositions
Bunch up Eeveelutions more in first fight, move random Rotom form to first fight. Remove Espeon, Umbreon, and Rotom from second fight, add legendary beasts and paradox beasts in their place, remove Zacian chance from second fight.

Co-authored-by: Tempoanon <163687446+Tempo-anon@users.noreply.github.com>
2024-09-15 00:51:39 -05:00
Madmadness65 5b254ff772 Add back Team Star trainer types
Latest merge of beta into this PR deleted them for some reason
2024-09-13 22:29:45 -05:00
Madmadness65 9e3bd1a323
Merge branch 'beta' into new-team 2024-09-13 22:13:02 -05:00
Madmadness65 68b133bb96 Add dialogue entries in dialogue.ts
Forgot them with my last commit, whoops
2024-09-12 18:07:35 -05:00
Madmadness65 96a7e7136d Add additional Macro Grunt dialogue lines
As suggested to be included by @Blitz425
2024-09-12 14:51:52 -05:00
Madmadness65 49ca3a2180
Merge branch 'beta' into new-team 2024-09-12 14:43:23 -05:00
Madmadness65 25cdba4bc3
Merge branch 'beta' into new-team 2024-09-04 18:07:06 -05:00
Madmadness65 5bfa0bb688 Add dialogue for all Team Star trainers
Dialogue put together courtesy of @Blitz425
2024-09-04 18:05:53 -05:00
Madmadness65 0e0b68aa8b Add Team Star (WIP)
Still missing dialogue for all new trainer types, team compositions will need refining, and Starmobile graphics still do not exist yet.
2024-09-03 22:28:51 -05:00
38 changed files with 941 additions and 83 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "atticus.png",
"format": "RGBA8888",
"size": {
"w": 46,
"h": 46
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 21,
"y": 33,
"w": 43,
"h": 46
},
"frame": {
"x": 0,
"y": 0,
"w": 43,
"h": 46
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:6dcd7c3d3982793cbca0d6fcd1f9260e:19c44634629fadd9d039d23dc71ec987:d26ede35f15aa571d5a7a2dd2fb868e1$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "eri.png",
"format": "RGBA8888",
"size": {
"w": 74,
"h": 74
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 15,
"y": 5,
"w": 45,
"h": 74
},
"frame": {
"x": 0,
"y": 0,
"w": 45,
"h": 74
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:59594ac27e74ec85e2949d12ff680dc2:d65b6b00858ac47b26ef8393a8fa6795:d7f4cd3ff755f8074c14d3006b0c8301$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "giacomo.png",
"format": "RGBA8888",
"size": {
"w": 75,
"h": 75
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 23,
"y": 4,
"w": 37,
"h": 75
},
"frame": {
"x": 0,
"y": 0,
"w": 37,
"h": 75
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:8c4e7da48e5667abc6d364330268c092:0fa43e58d8a746d3b86cb2dd763719f4:8603cc19e888c8c8de62177f4011577c$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "mela.png",
"format": "RGBA8888",
"size": {
"w": 78,
"h": 78
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 18,
"y": 1,
"w": 46,
"h": 78
},
"frame": {
"x": 0,
"y": 0,
"w": 46,
"h": 78
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:e26d8c926c54c848cef673b3f59f35e7:ff040c2cebb1a92d2ef61dc91c018390:68668cf06383ff459cccaafb6bf56215$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "ortega.png",
"format": "RGBA8888",
"size": {
"w": 69,
"h": 69
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 8,
"y": 10,
"w": 53,
"h": 69
},
"frame": {
"x": 0,
"y": 0,
"w": 53,
"h": 69
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:c6ff92d90ed884222095de81d1db9166:a91cf3c83a063f549c52afb42f7ba3b0:c3f9fcec121c8bc93f2b230b20b79c57$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "penny.png",
"format": "RGBA8888",
"size": {
"w": 75,
"h": 75
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 24,
"y": 4,
"w": 34,
"h": 75
},
"frame": {
"x": 0,
"y": 0,
"w": 34,
"h": 75
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:54f184bf1995a94a78aff33c9a851e6b:a6c9b3fe428b0cd0344b5cf14b999f36:cf221da9747cb8cb356053d3042d8d22$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "star_grunt_f.png",
"format": "RGBA8888",
"size": {
"w": 68,
"h": 68
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 24,
"y": 11,
"w": 30,
"h": 68
},
"frame": {
"x": 0,
"y": 0,
"w": 30,
"h": 68
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:b542a1bdd6995584fc776f75d578b434:f03fddece4494ab59698002fe6671972:c6f0e54e24ec5ffaa711700431b1955e$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "star_grunt_m.png",
"format": "RGBA8888",
"size": {
"w": 70,
"h": 70
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 80,
"h": 80
},
"spriteSourceSize": {
"x": 24,
"y": 9,
"w": 31,
"h": 70
},
"frame": {
"x": 0,
"y": 0,
"w": 31,
"h": 70
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:abc4b0424c37fd55a2bf2e9f5142adce:41a140aa68a1eda61d9a00cab4e07721:a0796711f9e0333796b6629cd43ff8e8$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

View File

@ -2135,12 +2135,16 @@ export default class BattleScene extends SceneBase {
return 20.87;
case "battle_macro_grunt": // SWSH Trainer Battle
return 11.56;
case "battle_star_grunt": //SV Team Star Battle
return 133.362;
case "battle_galactic_admin": //BDSP Team Galactic Admin Battle
return 11.997;
case "battle_skull_admin": //SM Team Skull Admin Battle
return 15.463;
case "battle_oleana": //SWSH Oleana Battle
return 14.110;
case "battle_star_admin": //SV Team Star Boss Battle
return 9.493;
case "battle_rocket_boss": //USUM Giovanni Battle
return 9.115;
case "battle_aqua_magma_boss": //ORAS Archie & Maxie Battle
@ -2157,6 +2161,8 @@ export default class BattleScene extends SceneBase {
return 13.13;
case "battle_macro_boss": //SWSH Rose Battle
return 11.42;
case "battle_star_boss": //SV Cassiopeia Battle
return 25.764;
}
return 0;

View File

@ -505,27 +505,27 @@ export const classicFixedBattles: FixedBattleConfigs = {
[25]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_2, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
[35]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT, TrainerType.STAR_GRUNT ], true)),
[55]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_3, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
[62]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT, TrainerType.STAR_GRUNT ], true)),
[64]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT, TrainerType.STAR_GRUNT ], true)),
[66]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA, [ TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI ] ], true)),
[95]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
[112]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT, TrainerType.STAR_GRUNT ], true)),
[114]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true, 1)),
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA, [ TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI ] ], true, 1)),
[115]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE ])),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE, TrainerType.PENNY ])),
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
[165]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2 ])),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2, TrainerType.PENNY_2 ])),
[182]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.LORELEI, TrainerType.WILL, TrainerType.SIDNEY, TrainerType.AARON, TrainerType.SHAUNTAL, TrainerType.MALVA, [ TrainerType.HALA, TrainerType.MOLAYNE ], TrainerType.MARNIE_ELITE, TrainerType.RIKA, TrainerType.CRISPIN ])),
[184]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(182)

View File

@ -837,11 +837,15 @@ export const trainerTypeDialogue: TrainerTypeDialogue = {
"dialogue:macro_grunt.encounter.1",
"dialogue:macro_grunt.encounter.2",
"dialogue:macro_grunt.encounter.3",
"dialogue:macro_grunt.encounter.4",
"dialogue:macro_grunt.encounter.5",
],
victory: [
"dialogue:macro_grunt.victory.1",
"dialogue:macro_grunt.victory.2",
"dialogue:macro_grunt.victory.3",
"dialogue:macro_grunt.victory.4",
"dialogue:macro_grunt.victory.5",
]
}
],
@ -859,6 +863,66 @@ export const trainerTypeDialogue: TrainerTypeDialogue = {
]
}
],
[TrainerType.STAR_GRUNT]: [
{
encounter: [
"dialogue:star_grunt.encounter.1",
],
victory: [
"dialogue:star_grunt.victory.1",
]
}
],
[TrainerType.GIACOMO]: [
{
encounter: [
"dialogue:giacomo.encounter.1",
],
victory: [
"dialogue:giacomo.victory.1",
]
}
],
[TrainerType.MELA]: [
{
encounter: [
"dialogue:mela.encounter.1",
],
victory: [
"dialogue:mela.victory.1",
]
}
],
[TrainerType.ATTICUS]: [
{
encounter: [
"dialogue:atticus.encounter.1",
],
victory: [
"dialogue:atticus.victory.1",
]
}
],
[TrainerType.ORTEGA]: [
{
encounter: [
"dialogue:ortega.encounter.1",
],
victory: [
"dialogue:ortega.victory.1",
]
}
],
[TrainerType.ERI]: [
{
encounter: [
"dialogue:eri.encounter.1",
],
victory: [
"dialogue:eri.victory.1",
]
}
],
[TrainerType.ROCKET_BOSS_GIOVANNI_1]: [
{
encounter: [
@ -1093,6 +1157,32 @@ export const trainerTypeDialogue: TrainerTypeDialogue = {
]
}
],
[TrainerType.PENNY]: [
{
encounter: [
"dialogue:star_boss_penny_1.encounter.1"
],
victory: [
"dialogue:star_boss_penny_1.victory.1"
],
defeat: [
"dialogue:star_boss_penny_1.defeat.1"
]
}
],
[TrainerType.PENNY_2]: [
{
encounter: [
"dialogue:star_boss_penny_2.encounter.1"
],
victory: [
"dialogue:star_boss_penny_2.victory.1"
],
defeat: [
"dialogue:star_boss_penny_2.defeat.1"
]
}
],
[TrainerType.BUCK]: [
{
encounter: [

View File

@ -19498,6 +19498,108 @@ export const pokemonFormLevelMoves: PokemonSpeciesFormLevelMoves = {
[ 51, Moves.BELCH ],
],
},
[Species.REVAVROOM]: {
1: [
[ EVOLVE_MOVE, Moves.WICKED_TORQUE ],
[ EVOLVE_MOVE, Moves.SHIFT_GEAR ],
[ 1, Moves.LICK ],
[ 1, Moves.POISON_GAS ],
[ 1, Moves.MAGNET_RISE ],
[ 4, Moves.SMOG ],
[ 7, Moves.TAUNT ],
[ 10, Moves.ASSURANCE ],
[ 13, Moves.SLUDGE ],
[ 17, Moves.GYRO_BALL ],
[ 21, Moves.HEADBUTT ],
[ 25, Moves.SCREECH ],
[ 28, Moves.IRON_HEAD ],
[ 32, Moves.SWAGGER ],
[ 36, Moves.POISON_JAB ],
[ 46, Moves.UPROAR ],
[ 52, Moves.SPIN_OUT ],
[ 58, Moves.GUNK_SHOT ],
],
2: [
[ EVOLVE_MOVE, Moves.BLAZING_TORQUE ],
[ EVOLVE_MOVE, Moves.SHIFT_GEAR ],
[ 1, Moves.LICK ],
[ 1, Moves.POISON_GAS ],
[ 1, Moves.MAGNET_RISE ],
[ 4, Moves.SMOG ],
[ 7, Moves.TAUNT ],
[ 10, Moves.ASSURANCE ],
[ 13, Moves.SLUDGE ],
[ 17, Moves.GYRO_BALL ],
[ 21, Moves.HEADBUTT ],
[ 25, Moves.SCREECH ],
[ 28, Moves.IRON_HEAD ],
[ 32, Moves.SWAGGER ],
[ 36, Moves.POISON_JAB ],
[ 46, Moves.UPROAR ],
[ 52, Moves.SPIN_OUT ],
[ 58, Moves.GUNK_SHOT ],
],
3: [
[ EVOLVE_MOVE, Moves.NOXIOUS_TORQUE ],
[ EVOLVE_MOVE, Moves.SHIFT_GEAR ],
[ 1, Moves.LICK ],
[ 1, Moves.POISON_GAS ],
[ 1, Moves.MAGNET_RISE ],
[ 4, Moves.SMOG ],
[ 7, Moves.TAUNT ],
[ 10, Moves.ASSURANCE ],
[ 13, Moves.SLUDGE ],
[ 17, Moves.GYRO_BALL ],
[ 21, Moves.HEADBUTT ],
[ 25, Moves.SCREECH ],
[ 28, Moves.IRON_HEAD ],
[ 32, Moves.SWAGGER ],
[ 36, Moves.POISON_JAB ],
[ 46, Moves.UPROAR ],
[ 52, Moves.SPIN_OUT ],
[ 58, Moves.GUNK_SHOT ],
],
4: [
[ EVOLVE_MOVE, Moves.MAGICAL_TORQUE ],
[ EVOLVE_MOVE, Moves.SHIFT_GEAR ],
[ 1, Moves.LICK ],
[ 1, Moves.POISON_GAS ],
[ 1, Moves.MAGNET_RISE ],
[ 4, Moves.SMOG ],
[ 7, Moves.TAUNT ],
[ 10, Moves.ASSURANCE ],
[ 13, Moves.SLUDGE ],
[ 17, Moves.GYRO_BALL ],
[ 21, Moves.HEADBUTT ],
[ 25, Moves.SCREECH ],
[ 28, Moves.IRON_HEAD ],
[ 32, Moves.SWAGGER ],
[ 36, Moves.POISON_JAB ],
[ 46, Moves.UPROAR ],
[ 52, Moves.SPIN_OUT ],
[ 58, Moves.GUNK_SHOT ],
],
5: [
[ EVOLVE_MOVE, Moves.COMBAT_TORQUE ],
[ EVOLVE_MOVE, Moves.SHIFT_GEAR ],
[ 1, Moves.LICK ],
[ 1, Moves.POISON_GAS ],
[ 1, Moves.MAGNET_RISE ],
[ 4, Moves.SMOG ],
[ 7, Moves.TAUNT ],
[ 10, Moves.ASSURANCE ],
[ 13, Moves.SLUDGE ],
[ 17, Moves.GYRO_BALL ],
[ 21, Moves.HEADBUTT ],
[ 25, Moves.SCREECH ],
[ 28, Moves.IRON_HEAD ],
[ 32, Moves.SWAGGER ],
[ 36, Moves.POISON_JAB ],
[ 46, Moves.UPROAR ],
[ 52, Moves.SPIN_OUT ],
[ 58, Moves.GUNK_SHOT ],
],
},
[Species.PALDEA_TAUROS]: {
1: [
[ 1, Moves.TACKLE ],

View File

@ -2545,7 +2545,14 @@ export function initSpecies() {
new PokemonForm("Hero Form", "hero", Type.WATER, null, 1.8, 97.4, Abilities.ZERO_TO_HERO, Abilities.NONE, Abilities.ZERO_TO_HERO, 650, 100, 160, 97, 106, 87, 100, 45, 50, 160),
),
new PokemonSpecies(Species.VAROOM, 9, false, false, false, "Single-Cyl Pokémon", Type.STEEL, Type.POISON, 1, 35, Abilities.OVERCOAT, Abilities.NONE, Abilities.SLOW_START, 300, 45, 70, 63, 30, 45, 47, 190, 50, 60, GrowthRate.MEDIUM_FAST, 50, false),
new PokemonSpecies(Species.REVAVROOM, 9, false, false, false, "Multi-Cyl Pokémon", Type.STEEL, Type.POISON, 1.8, 120, Abilities.OVERCOAT, Abilities.NONE, Abilities.FILTER, 500, 80, 119, 90, 54, 67, 90, 75, 50, 175, GrowthRate.MEDIUM_FAST, 50, false),
new PokemonSpecies(Species.REVAVROOM, 9, false, false, false, "Multi-Cyl Pokémon", Type.STEEL, Type.POISON, 1.8, 120, Abilities.OVERCOAT, Abilities.NONE, Abilities.FILTER, 500, 80, 119, 90, 54, 67, 90, 75, 50, 175, GrowthRate.MEDIUM_FAST, 50, false, false,
new PokemonForm("Normal", "", Type.STEEL, Type.POISON, 1.8, 120, Abilities.OVERCOAT, Abilities.NONE, Abilities.FILTER, 500, 80, 119, 90, 54, 67, 90, 75, 50, 175, false, null, true),
new PokemonForm("Segin Starmobile", "segin-starmobile", Type.STEEL, Type.DARK, 1.8, 120, Abilities.INTIMIDATE, Abilities.NONE, Abilities.INTIMIDATE, 600, 120, 129, 100, 59, 77, 115, 75, 50, 175, false, ""),
new PokemonForm("Schedar Starmobile", "schedar-starmobile", Type.STEEL, Type.FIRE, 1.8, 120, Abilities.SPEED_BOOST, Abilities.NONE, Abilities.SPEED_BOOST, 600, 120, 129, 100, 59, 77, 115, 75, 50, 175, false, ""),
new PokemonForm("Navi Starmobile", "navi-starmobile", Type.STEEL, Type.POISON, 1.8, 120, Abilities.TOXIC_DEBRIS, Abilities.NONE, Abilities.TOXIC_DEBRIS, 600, 120, 129, 100, 59, 77, 115, 75, 50, 175, false, ""),
new PokemonForm("Ruchbah Starmobile", "ruchbah-starmobile", Type.STEEL, Type.FAIRY, 1.8, 120, Abilities.MISTY_SURGE, Abilities.NONE, Abilities.MISTY_SURGE, 600, 120, 129, 100, 59, 77, 115, 75, 50, 175, false, ""),
new PokemonForm("Caph Starmobile", "caph-starmobile", Type.STEEL, Type.FIGHTING, 1.8, 120, Abilities.STAMINA, Abilities.NONE, Abilities.STAMINA, 600, 120, 129, 100, 59, 77, 115, 75, 50, 175, false, ""),
),
new PokemonSpecies(Species.CYCLIZAR, 9, false, false, false, "Mount Pokémon", Type.DRAGON, Type.NORMAL, 1.6, 63, Abilities.SHED_SKIN, Abilities.NONE, Abilities.REGENERATOR, 501, 70, 95, 65, 85, 65, 121, 190, 50, 175, GrowthRate.MEDIUM_SLOW, 50, false),
new PokemonSpecies(Species.ORTHWORM, 9, false, false, false, "Earthworm Pokémon", Type.STEEL, null, 2.5, 310, Abilities.EARTH_EATER, Abilities.NONE, Abilities.SAND_VEIL, 480, 70, 85, 145, 60, 55, 65, 25, 50, 240, GrowthRate.SLOW, 50, false),
new PokemonSpecies(Species.GLIMMET, 9, false, false, false, "Ore Pokémon", Type.ROCK, Type.POISON, 0.7, 8, Abilities.TOXIC_DEBRIS, Abilities.NONE, Abilities.CORROSION, 350, 48, 35, 42, 105, 60, 60, 70, 50, 70, GrowthRate.MEDIUM_SLOW, 50, false),

View File

@ -335,6 +335,9 @@ export class TrainerConfig {
case TrainerType.ROSE_2:
trainerType = TrainerType.ROSE;
break;
case TrainerType.PENNY_2:
trainerType = TrainerType.PENNY;
break;
case TrainerType.MARNIE_ELITE:
trainerType = TrainerType.MARNIE;
break;
@ -619,6 +622,41 @@ export class TrainerConfig {
[TrainerPoolTier.RARE]: [Species.TINKATINK, Species.HISUI_LILLIGANT]
};
}
case "star_1": {
return {
[TrainerPoolTier.COMMON]: [ Species.MURKROW, Species.CACNEA, Species.STUNKY, Species.SANDILE, Species.NYMBLE, Species.MASCHIFF, Species.GALAR_ZIGZAGOON ],
[TrainerPoolTier.UNCOMMON]: [ Species.SNEASEL, Species.SABLEYE, Species.SCRAGGY, Species.ZORUA ],
[TrainerPoolTier.RARE]: [ Species.DEINO, Species.HISUI_SAMUROTT ]
};
}
case "star_2": {
return {
[TrainerPoolTier.COMMON]: [ Species.GROWLITHE, Species.HOUNDOUR, Species.NUMEL, Species.FLETCHLING, Species.LITLEO, Species.CAPSAKID ],
[TrainerPoolTier.UNCOMMON]: [ Species.PONYTA, Species.TORKOAL, Species.ROLYCOLY, Species.SALAZZLE ],
[TrainerPoolTier.RARE]: [ Species.LARVESTA, Species.HISUI_GROWLITHE ]
};
}
case "star_3": {
return {
[TrainerPoolTier.COMMON]: [ Species.VENONAT, Species.GRIMER, Species.GULPIN, Species.STUNKY, Species.FOONGUS, Species.SHROODLE, Species.PALDEA_WOOPER ],
[TrainerPoolTier.UNCOMMON]: [ Species.GASTLY, Species.SEVIPER, Species.MAREANIE, Species.VAROOM ],
[TrainerPoolTier.RARE]: [ Species.SKRELP, Species.HISUI_SNEASEL ]
};
}
case "star_4": {
return {
[TrainerPoolTier.COMMON]: [ Species.CLEFFA, Species.IGGLYBUFF, Species.AZURILL, Species.FLABEBE, Species.MORELULL, Species.HATENNA, Species.IMPIDIMP ],
[TrainerPoolTier.UNCOMMON]: [ Species.TOGEPI, Species.KLEFKI, Species.MIMIKYU, Species.TINKATINK ],
[TrainerPoolTier.RARE]: [ Species.POPPLIO, Species.GALAR_PONYTA ]
};
}
case "star_5": {
return {
[TrainerPoolTier.COMMON]: [ Species.SHROOMISH, Species.MAKUHITA, Species.MEDITITE, Species.CROAGUNK, Species.MIENFOO, Species.CRABRAWLER, Species.FALINKS ],
[TrainerPoolTier.UNCOMMON]: [ Species.HERACROSS, Species.RIOLU, Species.HAWLUCHA, Species.PASSIMIAN ],
[TrainerPoolTier.RARE]: [ Species.JANGMO_O, Species.PALDEA_TAUROS ]
};
}
}
console.warn(`Evil team admin for ${team} not found. Returning empty species pools.`);
@ -1520,6 +1558,38 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerPoolTier.SUPER_RARE]: [Species.DURALUDON, Species.DREEPY]
}),
[TrainerType.OLEANA]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("macro_admin", "macro", [Species.GARBODOR]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_oleana").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene)),
[TrainerType.STAR_GRUNT]: new TrainerConfig(++t).setHasGenders("Star Grunt Female").setHasDouble("Star Grunts").setMoneyMultiplier(1.0).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_grunt").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.VENONAT, Species.MURKROW, Species.HOUNDOUR, Species.AZURILL, Species.GULPIN, Species.NUMEL, Species.STUNKY, Species.FOONGUS, Species.LITLEO, Species.YUNGOOS, Species.CRABRAWLER, Species.NYMBLE, Species.SHROODLE, Species.PALDEA_WOOPER ],
[TrainerPoolTier.UNCOMMON]: [ Species.RALTS, Species.TORKOAL, Species.SEVIPER, Species.ZORUA, Species.FLABEBE, Species.MIMIKYU, Species.ROLYCOLY, Species.IMPIDIMP, Species.FALINKS ],
[TrainerPoolTier.RARE]: [ Species.MANKEY, Species.PAWNIARD, Species.FIDOUGH, Species.CHARCADET, Species.VAROOM ],
[TrainerPoolTier.SUPER_RARE]: [ Species.TINKATINK, Species.PALDEA_TAUROS ]
}),
[TrainerType.GIACOMO]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("star_admin", "star_1", [Species.KINGAMBIT]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_admin").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([Species.REVAVROOM], TrainerSlot.TRAINER, true, p => {
p.formIndex = 1; // Segin Starmobile
p.generateAndPopulateMoveset();
})),
[TrainerType.MELA]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("star_admin", "star_2", [Species.ARMAROUGE]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_admin").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([Species.VENUSAUR], TrainerSlot.TRAINER, true, p => {
p.formIndex = 2; // Schedar Starmobile
p.generateAndPopulateMoveset();
})),
[TrainerType.ATTICUS]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("star_admin", "star_3", [Species.REVAVROOM]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_admin").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([Species.REVAVROOM], TrainerSlot.TRAINER, true, p => {
p.formIndex = 3; // Navi Starmobile
p.generateAndPopulateMoveset();
})),
[TrainerType.ORTEGA]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("star_admin", "star_4", [Species.DACHSBUN]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_admin").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([Species.REVAVROOM], TrainerSlot.TRAINER, true, p => {
p.formIndex = 4; // Ruchbah Starmobile
p.generateAndPopulateMoveset();
})),
[TrainerType.ERI]: new TrainerConfig(++t).setMoneyMultiplier(1.5).initForEvilTeamAdmin("star_admin", "star_5", [Species.ANNIHILAPE]).setEncounterBgm(TrainerType.PLASMA_GRUNT).setBattleBgm("battle_plasma_grunt").setMixedBattleBgm("battle_star_admin").setVictoryBgm("victory_team_plasma").setPartyTemplateFunc(scene => getEvilGruntPartyTemplate(scene))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([Species.REVAVROOM], TrainerSlot.TRAINER, true, p => {
p.formIndex = 5; // Caph Starmobile
p.generateAndPopulateMoveset();
})),
[TrainerType.BROCK]: new TrainerConfig((t = TrainerType.BROCK)).initForGymLeader(signatureSpecies["BROCK"], true, Type.ROCK).setBattleBgm("battle_kanto_gym").setMixedBattleBgm("battle_kanto_gym"),
[TrainerType.MISTY]: new TrainerConfig(++t).initForGymLeader(signatureSpecies["MISTY"], false, Type.WATER).setBattleBgm("battle_kanto_gym").setMixedBattleBgm("battle_kanto_gym"),
@ -2154,6 +2224,64 @@ export const trainerConfigs: TrainerConfigs = {
p.generateName();
p.pokeball = PokeballType.ULTRA_BALL;
})),
[TrainerType.PENNY]: new TrainerConfig(++t).setName("Penny").initForEvilTeamLeader("Star Boss", []).setMixedBattleBgm("battle_star_boss").setVictoryBgm("victory_team_plasma")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VAPOREON, Species.JOLTEON, Species.FLAREON ]))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.ESPEON, Species.UMBREON ], TrainerSlot.TRAINER, true, p => {
p.abilityIndex = 2; // Magic Bounce Espeon, Inner Focus Umbreon
p.generateAndPopulateMoveset();
}))
.setPartyMemberFunc(2, getRandomPartyMemberFunc([ Species.LEAFEON, Species.GLACEON ]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([ Species.ROTOM ], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.formIndex = Utils.randSeedInt(5, 1); // Heat, Wash, Frost, Fan, or Mow
}))
.setPartyMemberFunc(4, getRandomPartyMemberFunc([ Species.SYLVEON ], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = 2; // Pixilate
}))
.setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.EEVEE ], TrainerSlot.TRAINER, true, p => {
p.setBoss(true, 2);
p.generateAndPopulateMoveset();
p.formIndex = 2; // G-Max Eevee
p.pokeball = PokeballType.ULTRA_BALL;
p.generateName();
}))
.setGenModifiersFunc(party => {
const teraPokemon = party[4];
return [modifierTypes.TERA_SHARD().generateType([], [teraPokemon.species.type1])!.withIdFromFunc(modifierTypes.TERA_SHARD).newModifier(teraPokemon) as PersistentModifier]; //TODO: is the bang correct?
}),
[TrainerType.PENNY_2]: new TrainerConfig(++t).setName("Penny").initForEvilTeamLeader("Star Boss", [], true).setMixedBattleBgm("battle_star_boss").setVictoryBgm("victory_team_plasma")
.setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.REVAVROOM ], TrainerSlot.TRAINER, true, p => {
p.setBoss(true, 2);
p.generateAndPopulateMoveset();
p.formIndex = Utils.randSeedInt(5, 1); //Random Starmobile form
p.pokeball = PokeballType.ULTRA_BALL;
}))
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.ENTEI, Species.RAIKOU, Species.SUICUNE ], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.ULTRA_BALL;
}))
.setPartyMemberFunc(2, getRandomPartyMemberFunc([ Species.WALKING_WAKE, Species.GOUGING_FIRE, Species.RAGING_BOLT ]))
.setPartyMemberFunc(3, getRandomPartyMemberFunc([ Species.SYLVEON ], TrainerSlot.TRAINER, true, p => {
p.generateAndPopulateMoveset();
p.abilityIndex = 2; // Pixilate
}))
.setPartyMemberFunc(4, getRandomPartyMemberFunc([ Species.EEVEE ], TrainerSlot.TRAINER, true, p => {
p.setBoss(true, 2);
p.generateAndPopulateMoveset();
p.formIndex = 2;
p.generateName();
p.pokeball = PokeballType.ULTRA_BALL;
}))
.setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.ZAMAZENTA ], TrainerSlot.TRAINER, true, p => {
p.setBoss(true, 2);
p.generateAndPopulateMoveset();
p.pokeball = PokeballType.MASTER_BALL;
}))
.setGenModifiersFunc(party => {
const teraPokemon = party[3];
return [modifierTypes.TERA_SHARD().generateType([], [teraPokemon.species.type1])!.withIdFromFunc(modifierTypes.TERA_SHARD).newModifier(teraPokemon) as PersistentModifier]; //TODO: is the bang correct?
}),
[TrainerType.BUCK]: new TrainerConfig(++t).setName("Buck").initForStatTrainer([], true)
.setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.CLAYDOL ], TrainerSlot.TRAINER, true, p => {
p.setBoss(true, 3);

View File

@ -78,6 +78,12 @@ export enum TrainerType {
PLUMERIA,
MACRO_GRUNT,
OLEANA,
STAR_GRUNT,
GIACOMO,
MELA,
ATTICUS,
ORTEGA,
ERI,
ROCKET_BOSS_GIOVANNI_1,
ROCKET_BOSS_GIOVANNI_2,
MAXIE,
@ -96,6 +102,8 @@ export enum TrainerType {
GUZMA_2,
ROSE,
ROSE_2,
PENNY,
PENNY_2,
BUCK,
CHERYL,
MARLEY,

View File

@ -584,7 +584,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
getSpriteScale(): number {
const formKey = this.getFormKey();
if (formKey.indexOf(SpeciesFormKey.GIGANTAMAX) > -1 || formKey.indexOf(SpeciesFormKey.ETERNAMAX) > -1) {
if (this.isMax() === true || formKey === "segin-starmobile" || formKey === "schedar-starmobile" || formKey === "navi-starmobile" || formKey === "ruchbah-starmobile" || formKey === "caph-starmobile") {
return 1.5;
} else if (this.mysteryEncounterPokemonData.spriteScale > 0) {
return this.mysteryEncounterPokemonData.spriteScale;

View File

@ -83,9 +83,11 @@
"battle_aether_grunt": "SM Aether Foundation Battle",
"battle_skull_grunt": "SM Team Skull Battle",
"battle_macro_grunt": "SWSH Trainer Battle",
"battle_star_grunt": "SV Team Star Battle",
"battle_galactic_admin": "BDSP Team Galactic Admin Battle",
"battle_skull_admin": "SM Team Skull Admin Battle",
"battle_oleana": "SWSH Oleana Battle",
"battle_star_admin": "SV Team Star Boss",
"battle_rocket_boss": "USUM Giovanni Battle",
"battle_aqua_magma_boss": "ORAS Archie & Maxie Battle",
"battle_galactic_boss": "BDSP Cyrus Battle",
@ -94,6 +96,7 @@
"battle_aether_boss": "SM Lusamine Battle",
"battle_skull_boss": "SM Guzma Battle",
"battle_macro_boss": "SWSH Rose Battle",
"battle_star_boss": "SV Cassiopeia Battle",
"abyss": "PMD EoS Dark Crater",
"badlands": "PMD EoS Barren Valley",

View File

@ -764,12 +764,16 @@
"1": "It looks like this is the end of the line for you!",
"2": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.",
"2_female": "You are a trainer aren't you? I'm afraid that doesn't give you the right to interfere in our work.",
"3": "I'm from Macro Cosmos Insurance! Do you have a life insurance policy?"
"3": "I'm from Macro Cosmos Insurance! Do you have a life insurance policy?",
"4": "I found you! In that case, time for a Pokémon battle!",
"5": "An earful from Ms. Oleana is way worse than anything you can do!"
},
"victory": {
"1": "I have little choice but to respectfully retreat.",
"2": "Having to give up my pocket money... Losing means I'm back in the red...",
"3": "Nobody can beat Macro Cosmos when it comes to our dedication to our work!"
"3": "Nobody can beat Macro Cosmos when it comes to our dedication to our work!",
"4": "I even switched up my Pokémon...",
"5": "Battles didn't work... Only thing to do now is run!"
}
},
"oleana": {
@ -785,6 +789,73 @@
"3": "*sigh* I am one tired Oleana..."
}
},
"star_grunt": {
"encounter": {
"1": "We're Team Star, kid. We burn so bright, it hurts to look at us!",
"2": "We'll come at you full force - Hasta la vistaaar! ☆",
"3": "If you don't clear out real quick-like, I'll hafta come at you in self-defense. You get me?",
"4": "Sorry, but if you don't turn yourself around here, amigo, we'll have to send you packing!",
"4_female": "Sorry, but if you don't turn yourself around here, amiga, we'll have to send you packing!",
"5": "Oh great. Here comes another rando to ruin my day."
},
"victory": {
"1": "How come I'M the one seeing stars?!",
"2": "You're scary, kid. If you joined Team Star, you'd be looking down from the top in no time!",
"3": "I defended myself all right... But it wasn't enough!",
"4": "H-hasta la vistar... ☆",
"5": "I didn't think grunt work for Team Star newbies would be this much of a chore..."
}
},
"giacomo": {
"encounter": {
"1": "You don't really think things through, do ya? Declarin' war on Team Star is a real bad move.",
"2": "I'll play you a sick requiem as you crash and burn. Let's get this party staaarteeed!"
},
"victory": {
"1": "Guess that's that...",
"2": "You turned my melody into a threnody..."
}
},
"mela": {
"encounter": {
"1": "So you're the dope who picked a fight with Team Star... Prepare to get messed up.",
"2": "All riiight, BRING IT! I'll blow everythin' sky high!"
},
"victory": {
"1": "Ugh. Is this really how it's gonna end? What a hassle...",
"2": "I burned through everythin' I had...and now I've sputtered out."
}
},
"atticus": {
"encounter": {
"1": "You have some nerve baring your fangs at Team Star. Come, then, villainous wretch!",
"2": "Be warned—I shall spare thee no mercy! En garde!"
},
"victory": {
"1": "Forgive me, my friends...",
"2": "You have utterly bested me. But thy victory stir'd no bitterness within me—such was its brilliance."
}
},
"ortega": {
"encounter": {
"1": "I promise I'll play nice, so don't blame me when this battle sends you blubbering back home!",
"2": "I'll wipe that smug look off your face for sure! You're going down!"
},
"victory": {
"1": "Ugh! How could I LOSE! What the HECK!",
"2": "Arrrrgggh! That strength of yours is SO. NOT. FAIR."
}
},
"eri": {
"encounter": {
"1": "Doesn't matter who you are. I'll bury anyone who tries to take down Team Star!",
"2": "I give as good as I get—that's a promise! We'll see who's left standing in the end!"
},
"victory": {
"1": "I'm so sorry, everyone...",
"2": "I gave it my all, but it wasn't enough—I wasn't enough..."
}
},
"rocket_boss_giovanni_1": {
"encounter": {
"1": "So! I must say, I am impressed you got here!"
@ -985,6 +1056,28 @@
"1": "I suppose it must seem that I am doing something terrible. I don't expect you to understand.\n$But I must provide the Galar region with limitless energy to ensure everlasting prosperity."
}
},
"star_boss_penny_1": {
"encounter": {
"1": "I'm the big boss of Team Star. The name's Cassiopeia. \n$Now, bow down before the overwhelming might of Team Star's founder!"
},
"victory": {
"1": "... ... .."
},
"defeat": {
"1": "Heh..."
}
},
"star_boss_penny_2": {
"encounter": {
"1": "I won't hold back in this battle! I'll stay true to Team Star's code! \n$My Veevee power will crush you into stardust!"
},
"victory": {
"1": "...It's all over now."
},
"defeat": {
"1": "I can't fault you on your battle skills at all... Considering how the bosses fell at your hands."
}
},
"stat_trainer_buck": {
"encounter": {
"1": "...I'm telling you right now. I'm seriously tough. Act surprised!",

View File

@ -126,5 +126,8 @@
"skull_grunts": "Team Skull Grunts",
"macro_grunt": "Macro Cosmos Trainer",
"macro_grunt_female": "Macro Cosmos Trainer",
"macro_grunts": "Macro Cosmos Trainers"
"macro_grunts": "Macro Cosmos Trainers",
"star_grunt": "Star Grunt",
"star_grunt_female": "Star Grunt",
"star_grunts": "Star Grunts"
}

View File

@ -141,6 +141,11 @@
"faba": "Faba",
"plumeria": "Plumeria",
"oleana": "Oleana",
"giacomo": "Giacomo",
"mela": "Mela",
"atticus": "Atticus",
"ortega": "Ortega",
"eri": "Eri",
"maxie": "Maxie",
"archie": "Archie",
@ -150,6 +155,7 @@
"lusamine": "Lusamine",
"guzma": "Guzma",
"rose": "Rose",
"penny": "Penny",
"blue_red_double": "Blue & Red",
"red_blue_double": "Red & Blue",

View File

@ -19,6 +19,7 @@
"aether_boss": "Aether President",
"skull_boss": "Team Skull Boss",
"macro_boss": "Macro Cosmos President",
"star_boss": "Team Star Leader",
"rocket_admin": "Team Rocket Admin",
"rocket_admin_female": "Team Rocket Admin",
@ -35,6 +36,7 @@
"aether_admin": "Aether Foundation Admin",
"skull_admin": "Team Skull Admin",
"macro_admin": "Macro Cosmos",
"star_admin": "Team Star Squad Boss",
"the_winstrates": "The Winstrates'"
}

View File

@ -344,6 +344,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
super.clear();
this.config = null;
this.optionSelectContainer.setVisible(false);
this.scrollCursor = 0;
this.eraseCursor();
}

View File

@ -1,12 +1,13 @@
import BattleScene from "../battle-scene";
import BattleScene from "#app/battle-scene";
import { Button } from "#enums/buttons";
import i18next from "i18next";
import { Achv, achvs, getAchievementDescription } from "../system/achv";
import { Voucher, getVoucherTypeIcon, getVoucherTypeName, vouchers } from "../system/voucher";
import MessageUiHandler from "./message-ui-handler";
import { addTextObject, TextStyle } from "./text";
import { Mode } from "./ui";
import { addWindow } from "./ui-theme";
import { Achv, achvs, getAchievementDescription } from "#app/system/achv";
import { Voucher, getVoucherTypeIcon, getVoucherTypeName, vouchers } from "#app/system/voucher";
import MessageUiHandler from "#app/ui/message-ui-handler";
import { addTextObject, TextStyle } from "#app/ui/text";
import { Mode } from "#app/ui/ui";
import { addWindow } from "#app/ui/ui-theme";
import { ScrollBar } from "#app/ui/scroll-bar";
import { PlayerGender } from "#enums/player-gender";
enum Page {
@ -49,6 +50,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
private vouchersTotal: number;
private currentTotal: number;
private scrollBar: ScrollBar;
private scrollCursor: number;
private cursorObj: Phaser.GameObjects.NineSlice | null;
private currentPage: Page;
@ -91,7 +93,10 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.iconsBg = addWindow(this.scene, 0, this.headerBg.height, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - this.headerBg.height - 68);
this.iconsBg.setOrigin(0, 0);
this.iconsContainer = this.scene.add.container(6, this.headerBg.height + 6);
const yOffset = 6;
this.scrollBar = new ScrollBar(this.scene, this.iconsBg.width - 9, this.iconsBg.y + yOffset, 4, this.iconsBg.height - yOffset * 2, this.ROWS);
this.iconsContainer = this.scene.add.container(5, this.headerBg.height + 8);
this.icons = [];
@ -148,6 +153,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.mainContainer.add(this.headerText);
this.mainContainer.add(this.headerActionText);
this.mainContainer.add(this.iconsBg);
this.mainContainer.add(this.scrollBar);
this.mainContainer.add(this.iconsContainer);
this.mainContainer.add(titleBg);
this.mainContainer.add(this.titleText);
@ -162,6 +168,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.currentPage = Page.ACHIEVEMENTS;
this.setCursor(0);
this.setScrollCursor(0);
this.mainContainer.setVisible(false);
}
@ -175,6 +182,8 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.mainContainer.setVisible(true);
this.setCursor(0);
this.setScrollCursor(0);
this.scrollBar.setTotalRows(Math.ceil(this.currentTotal / this.COLS));
this.scrollBar.setScrollCursor(0);
this.getUi().moveTo(this.mainContainer, this.getUi().length - 1);
@ -224,6 +233,8 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.updateAchvIcons();
}
this.setCursor(0, true);
this.scrollBar.setTotalRows(Math.ceil(this.currentTotal / this.COLS));
this.scrollBar.setScrollCursor(0);
this.mainContainer.update();
}
if (button === Button.CANCEL) {
@ -237,32 +248,44 @@ export default class AchvsUiHandler extends MessageUiHandler {
if (this.cursor < this.COLS) {
if (this.scrollCursor) {
success = this.setScrollCursor(this.scrollCursor - 1);
} else {
// Wrap around to the last row
success = this.setScrollCursor(Math.ceil(this.currentTotal / this.COLS) - this.ROWS);
let newCursorIndex = this.cursor + (this.ROWS - 1) * this.COLS;
if (newCursorIndex > this.currentTotal - this.scrollCursor * this.COLS -1) {
newCursorIndex -= this.COLS;
}
success = success && this.setCursor(newCursorIndex);
}
} else {
success = this.setCursor(this.cursor - this.COLS);
}
break;
case Button.DOWN:
const canMoveDown = (this.cursor + itemOffset) + this.COLS < this.currentTotal;
const canMoveDown = itemOffset + 1 < this.currentTotal;
if (rowIndex >= this.ROWS - 1) {
if (this.scrollCursor < Math.ceil(this.currentTotal / this.COLS) - this.ROWS && canMoveDown) {
// scroll down one row
success = this.setScrollCursor(this.scrollCursor + 1);
} else {
// wrap back to the first row
success = this.setScrollCursor(0) && this.setCursor(this.cursor % this.COLS);
}
} else if (canMoveDown) {
success = this.setCursor(this.cursor + this.COLS);
success = this.setCursor(Math.min(this.cursor + this.COLS, this.currentTotal - itemOffset - 1));
}
break;
case Button.LEFT:
if (!this.cursor && this.scrollCursor) {
success = this.setScrollCursor(this.scrollCursor - 1) && this.setCursor(this.cursor + (this.COLS - 1));
} else if (this.cursor) {
if (this.cursor % this.COLS === 0) {
success = this.setCursor(Math.min(this.cursor + this.COLS - 1, this.currentTotal - itemOffset - 1));
} else {
success = this.setCursor(this.cursor - 1);
}
break;
case Button.RIGHT:
if (this.cursor + 1 === this.ROWS * this.COLS && this.scrollCursor < Math.ceil(this.currentTotal / this.COLS) - this.ROWS) {
success = this.setScrollCursor(this.scrollCursor + 1) && this.setCursor(this.cursor - (this.COLS - 1));
} else if (this.cursor + itemOffset < this.currentTotal - 1) {
if ((this.cursor + 1) % this.COLS === 0 || (this.cursor + itemOffset) === (this.currentTotal - 1)) {
success = this.setCursor(this.cursor - this.cursor % this.COLS);
} else {
success = this.setCursor(this.cursor + 1);
}
break;
@ -315,15 +338,22 @@ export default class AchvsUiHandler extends MessageUiHandler {
}
this.scrollCursor = scrollCursor;
this.scrollBar.setScrollCursor(this.scrollCursor);
// Cursor cannot go farther than the last element in the list
const maxCursor = Math.min(this.cursor, this.currentTotal - this.scrollCursor * this.COLS - 1);
if (maxCursor !== this.cursor) {
this.setCursor(maxCursor);
}
switch (this.currentPage) {
case Page.ACHIEVEMENTS:
this.updateAchvIcons();
this.showAchv(achvs[Object.keys(achvs)[Math.min(this.cursor + this.scrollCursor * this.COLS, Object.values(achvs).length - 1)]]);
this.showAchv(achvs[Object.keys(achvs)[this.cursor + this.scrollCursor * this.COLS]]);
break;
case Page.VOUCHERS:
this.updateVoucherIcons();
this.showVoucher(vouchers[Object.keys(vouchers)[Math.min(this.cursor + this.scrollCursor * this.COLS, Object.values(vouchers).length - 1)]]);
this.showVoucher(vouchers[Object.keys(vouchers)[this.cursor + this.scrollCursor * this.COLS]]);
break;
}
return true;
@ -411,6 +441,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
super.clear();
this.currentPage = Page.ACHIEVEMENTS;
this.mainContainer.setVisible(false);
this.setScrollCursor(0);
this.eraseCursor();
}

View File

@ -1,36 +1,65 @@
/**
* A vertical scrollbar element that resizes dynamically based on the current scrolling
* and number of elements that can be shown on screen
*/
export class ScrollBar extends Phaser.GameObjects.Container {
private bg: Phaser.GameObjects.Image;
private bg: Phaser.GameObjects.NineSlice;
private handleBody: Phaser.GameObjects.Rectangle;
private handleBottom: Phaser.GameObjects.Image;
private pages: number;
private page: number;
private handleBottom: Phaser.GameObjects.NineSlice;
private currentRow: number;
private totalRows: number;
private maxRows: number;
constructor(scene: Phaser.Scene, x: number, y: number, pages: number) {
/**
* @param scene the current scene
* @param x the scrollbar's x position (origin: top left)
* @param y the scrollbar's y position (origin: top left)
* @param width the scrollbar's width
* @param height the scrollbar's height
* @param maxRows the maximum number of rows that can be shown at once
*/
constructor(scene: Phaser.Scene, x: number, y: number, width: number, height: number, maxRows: number) {
super(scene, x, y);
this.bg = scene.add.image(0, 0, "scroll_bar");
this.maxRows = maxRows;
const borderSize = 2;
width = Math.max(width, 4);
this.bg = scene.add.nineslice(0, 0, "scroll_bar", undefined, width, height, borderSize, borderSize, borderSize, borderSize);
this.bg.setOrigin(0, 0);
this.add(this.bg);
this.handleBody = scene.add.rectangle(1, 1, 3, 4, 0xaaaaaa);
this.handleBody = scene.add.rectangle(1, 1, width - 2, 4, 0xaaaaaa);
this.handleBody.setOrigin(0, 0);
this.add(this.handleBody);
this.handleBottom = scene.add.image(1, 1, "scroll_bar_handle");
this.handleBottom = scene.add.nineslice(1, 1, "scroll_bar_handle", undefined, width - 2, 2, 2, 0, 0, 0);
this.handleBottom.setOrigin(0, 0);
this.add(this.handleBottom);
}
setPage(page: number): void {
this.page = page;
this.handleBody.y = 1 + (this.bg.displayHeight - 1 - this.handleBottom.displayHeight) / this.pages * page;
/**
* Set the current row that is displayed
* Moves the bar handle up or down accordingly
* @param scrollCursor how many times the view was scrolled down
*/
setScrollCursor(scrollCursor: number): void {
this.currentRow = scrollCursor;
this.handleBody.y = 1 + (this.bg.displayHeight - 1 - this.handleBottom.displayHeight) / this.totalRows * this.currentRow;
this.handleBottom.y = this.handleBody.y + this.handleBody.displayHeight;
}
setPages(pages: number): void {
this.pages = pages;
this.handleBody.height = (this.bg.displayHeight - 1 - this.handleBottom.displayHeight) * 9 / this.pages;
/**
* Set the total number of rows to display
* If it's smaller than the maximum number of rows on screen the bar will get hidden
* Otherwise the scrollbar handle gets resized based on the ratio to the maximum number of rows
* @param rows how many rows of data there are in total
*/
setTotalRows(rows: number): void {
this.totalRows = rows;
this.handleBody.height = (this.bg.displayHeight - 1 - this.handleBottom.displayHeight) * this.maxRows / this.totalRows;
this.setVisible(this.pages > 9);
this.setVisible(this.totalRows > this.maxRows);
}
}

View File

@ -1,11 +1,12 @@
import UiHandler from "../ui-handler";
import BattleScene from "../../battle-scene";
import {Mode} from "../ui";
import {InterfaceConfig} from "../../inputs-controller";
import {addWindow} from "../ui-theme";
import {addTextObject, TextStyle} from "../text";
import {getIconWithSettingName} from "#app/configs/inputs/configHandler";
import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu";
import UiHandler from "#app/ui/ui-handler";
import BattleScene from "#app/battle-scene";
import { Mode } from "#app/ui/ui";
import { InterfaceConfig } from "#app/inputs-controller";
import { addWindow } from "#app/ui/ui-theme";
import { addTextObject, TextStyle } from "#app/ui/text";
import { ScrollBar } from "#app/ui/scroll-bar";
import { getIconWithSettingName } from "#app/configs/inputs/configHandler";
import NavigationMenu, { NavigationManager } from "#app/ui/settings/navigationMenu";
import { Device } from "#enums/devices";
import { Button } from "#enums/buttons";
import i18next from "i18next";
@ -19,7 +20,7 @@ export interface LayoutConfig {
inputsIcons: InputsIcons;
settingLabels: Phaser.GameObjects.Text[];
optionValueLabels: Phaser.GameObjects.Text[][];
optionCursors: integer[];
optionCursors: number[];
keys: string[];
bindingSettings: Array<String>;
}
@ -31,8 +32,9 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
protected optionsContainer: Phaser.GameObjects.Container;
protected navigationContainer: NavigationMenu;
protected scrollCursor: integer;
protected optionCursors: integer[];
protected scrollBar: ScrollBar;
protected scrollCursor: number;
protected optionCursors: number[];
protected cursorObj: Phaser.GameObjects.NineSlice | null;
protected optionsBg: Phaser.GameObjects.NineSlice;
@ -65,7 +67,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
protected device: Device;
abstract saveSettingToLocalStorage(setting, cursor): void;
abstract setSetting(scene: BattleScene, setting, value: integer): boolean;
abstract setSetting(scene: BattleScene, setting, value: number): boolean;
/**
* Constructor for the AbstractSettingsUiHandler.
@ -241,7 +243,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
// Calculate the total available space for placing option labels next to their setting label
// We reserve space for the setting label and then distribute the remaining space evenly
const totalSpace = (300 - labelWidth) - totalWidth / 6;
const totalSpace = (297 - labelWidth) - totalWidth / 6;
// Calculate the spacing between options based on the available space divided by the number of gaps between labels
const optionSpacing = Math.floor(totalSpace / (optionValueLabels[s].length - 1));
@ -269,6 +271,11 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
// Add the options container to the overall settings container to be displayed in the UI.
this.settingsContainer.add(optionsContainer);
}
// Add vertical scrollbar
this.scrollBar = new ScrollBar(this.scene, this.optionsBg.width - 9, this.optionsBg.y + 5, 4, this.optionsBg.height - 11, this.rowsToDisplay);
this.settingsContainer.add(this.scrollBar);
// Add the settings container to the UI.
ui.add(this.settingsContainer);
@ -413,6 +420,8 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
this.optionCursors = layout.optionCursors;
this.inputsIcons = layout.inputsIcons;
this.bindingSettings = layout.bindingSettings;
this.scrollBar.setTotalRows(layout.settingLabels.length);
this.scrollBar.setScrollCursor(0);
// Return true indicating the layout was successfully applied.
return true;
@ -538,7 +547,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
* @param cursor - The cursor position to set.
* @returns `true` if the cursor was set successfully.
*/
setCursor(cursor: integer): boolean {
setCursor(cursor: number): boolean {
const ret = super.setCursor(cursor);
// If the optionsContainer is not initialized, return the result from the parent class directly.
if (!this.optionsContainer) {
@ -547,7 +556,8 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
// Check if the cursor object exists, if not, create it.
if (!this.cursorObj) {
this.cursorObj = this.scene.add.nineslice(0, 0, "summary_moves_cursor", undefined, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
const cursorWidth = (this.scene.game.canvas.width / 6) - (this.scrollBar.visible? 16 : 10);
this.cursorObj = this.scene.add.nineslice(0, 0, "summary_moves_cursor", undefined, cursorWidth, 16, 1, 1, 1, 1);
this.cursorObj.setOrigin(0, 0); // Set the origin to the top-left corner.
this.optionsContainer.add(this.cursorObj); // Add the cursor to the options container.
}
@ -564,7 +574,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
* @param scrollCursor - The scroll cursor position to set.
* @returns `true` if the scroll cursor was set successfully.
*/
setScrollCursor(scrollCursor: integer): boolean {
setScrollCursor(scrollCursor: number): boolean {
// Check if the new scroll position is the same as the current one; if so, do not update.
if (scrollCursor === this.scrollCursor) {
return false;
@ -572,6 +582,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
// Update the internal scroll cursor state
this.scrollCursor = scrollCursor;
this.scrollBar.setScrollCursor(this.scrollCursor);
// Apply the new scroll position to the settings UI.
this.updateSettingsScroll();
@ -590,7 +601,7 @@ export default abstract class AbstractControlSettingsUiHandler extends UiHandler
* @param save - Whether to save the setting to local storage.
* @returns `true` if the option cursor was set successfully.
*/
setOptionCursor(settingIndex: integer, cursor: integer, save?: boolean): boolean {
setOptionCursor(settingIndex: number, cursor: number, save?: boolean): boolean {
// Retrieve the specific setting using the settingIndex from the settingDevice enumeration.
const setting = this.setting[Object.keys(this.setting)[settingIndex]];

View File

@ -1,12 +1,13 @@
import BattleScene from "../../battle-scene";
import { hasTouchscreen, isMobile } from "../../touch-controls";
import { TextStyle, addTextObject } from "../text";
import { Mode } from "../ui";
import UiHandler from "../ui-handler";
import { addWindow } from "../ui-theme";
import {Button} from "#enums/buttons";
import {InputsIcons} from "#app/ui/settings/abstract-control-settings-ui-handler";
import NavigationMenu, {NavigationManager} from "#app/ui/settings/navigationMenu";
import BattleScene from "#app/battle-scene";
import { hasTouchscreen, isMobile } from "#app/touch-controls";
import { TextStyle, addTextObject } from "#app/ui/text";
import { Mode } from "#app/ui/ui";
import UiHandler from "#app/ui/ui-handler";
import { addWindow } from "#app/ui/ui-theme";
import { ScrollBar } from "#app/ui/scroll-bar";
import { Button } from "#enums/buttons";
import { InputsIcons } from "#app/ui/settings/abstract-control-settings-ui-handler";
import NavigationMenu, { NavigationManager } from "#app/ui/settings/navigationMenu";
import { Setting, SettingKeys, SettingType } from "#app/system/settings/settings";
import i18next from "i18next";
@ -19,11 +20,12 @@ export default class AbstractSettingsUiHandler extends UiHandler {
private optionsContainer: Phaser.GameObjects.Container;
private navigationContainer: NavigationMenu;
private scrollCursor: integer;
private scrollCursor: number;
private scrollBar: ScrollBar;
private optionsBg: Phaser.GameObjects.NineSlice;
private optionCursors: integer[];
private optionCursors: number[];
private settingLabels: Phaser.GameObjects.Text[];
private optionValueLabels: Phaser.GameObjects.Text[][];
@ -117,7 +119,7 @@ export default class AbstractSettingsUiHandler extends UiHandler {
const labelWidth = Math.max(78, this.settingLabels[s].displayWidth + 8);
const totalSpace = (300 - labelWidth) - totalWidth / 6;
const totalSpace = (297 - labelWidth) - totalWidth / 6;
const optionSpacing = Math.floor(totalSpace / (this.optionValueLabels[s].length - 1));
let xOffset = 0;
@ -130,7 +132,11 @@ export default class AbstractSettingsUiHandler extends UiHandler {
this.optionCursors = this.settings.map(setting => setting.default);
this.scrollBar = new ScrollBar(this.scene, this.optionsBg.width - 9, this.optionsBg.y + 5, 4, this.optionsBg.height - 11, this.rowsToDisplay);
this.scrollBar.setTotalRows(this.settings.length);
this.settingsContainer.add(this.optionsBg);
this.settingsContainer.add(this.scrollBar);
this.settingsContainer.add(this.navigationContainer);
this.settingsContainer.add(actionsBg);
this.settingsContainer.add(this.optionsContainer);
@ -186,6 +192,7 @@ export default class AbstractSettingsUiHandler extends UiHandler {
this.settingsContainer.setVisible(true);
this.setCursor(0);
this.setScrollCursor(0);
this.getUi().moveTo(this.settingsContainer, this.getUi().length - 1);
@ -301,11 +308,12 @@ export default class AbstractSettingsUiHandler extends UiHandler {
* @param cursor - The cursor position to set.
* @returns `true` if the cursor was set successfully.
*/
setCursor(cursor: integer): boolean {
setCursor(cursor: number): boolean {
const ret = super.setCursor(cursor);
if (!this.cursorObj) {
this.cursorObj = this.scene.add.nineslice(0, 0, "summary_moves_cursor", undefined, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
const cursorWidth = (this.scene.game.canvas.width / 6) - (this.scrollBar.visible? 16 : 10);
this.cursorObj = this.scene.add.nineslice(0, 0, "summary_moves_cursor", undefined, cursorWidth, 16, 1, 1, 1, 1);
this.cursorObj.setOrigin(0, 0);
this.optionsContainer.add(this.cursorObj);
}
@ -323,7 +331,7 @@ export default class AbstractSettingsUiHandler extends UiHandler {
* @param save - Whether to save the setting to local storage.
* @returns `true` if the option cursor was set successfully.
*/
setOptionCursor(settingIndex: integer, cursor: integer, save?: boolean): boolean {
setOptionCursor(settingIndex: number, cursor: number, save?: boolean): boolean {
const setting = this.settings[settingIndex];
if (setting.key === SettingKeys.Touch_Controls && cursor && hasTouchscreen() && isMobile()) {
@ -359,12 +367,13 @@ export default class AbstractSettingsUiHandler extends UiHandler {
* @param scrollCursor - The scroll cursor position to set.
* @returns `true` if the scroll cursor was set successfully.
*/
setScrollCursor(scrollCursor: integer): boolean {
setScrollCursor(scrollCursor: number): boolean {
if (scrollCursor === this.scrollCursor) {
return false;
}
this.scrollCursor = scrollCursor;
this.scrollBar.setScrollCursor(this.scrollCursor);
this.updateSettingsScroll();
@ -394,6 +403,7 @@ export default class AbstractSettingsUiHandler extends UiHandler {
clear() {
super.clear();
this.settingsContainer.setVisible(false);
this.setScrollCursor(0);
this.eraseCursor();
this.getUi().bgmBar.toggleBgmBar(this.scene.showBgmBar);
if (this.reloadRequired) {

View File

@ -627,7 +627,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const starterBoxContainer = this.scene.add.container(speciesContainerX + 6, 9); //115
this.starterSelectScrollBar = new ScrollBar(this.scene, 161, 12, 0);
this.starterSelectScrollBar = new ScrollBar(this.scene, 161, 12, 5, starterContainerWindow.height - 6, 9);
starterBoxContainer.add(this.starterSelectScrollBar);
@ -2540,8 +2540,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
}
});
this.starterSelectScrollBar.setPages(Math.max(Math.ceil(this.filteredStarterContainers.length / 9), 1));
this.starterSelectScrollBar.setPage(0);
this.starterSelectScrollBar.setTotalRows(Math.max(Math.ceil(this.filteredStarterContainers.length / 9), 1));
this.starterSelectScrollBar.setScrollCursor(0);
// sort
const sort = this.filterBar.getVals(DropDownColumn.SORT)[0];
@ -2576,7 +2576,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const onScreenFirstIndex = this.scrollCursor * maxColumns;
const onScreenLastIndex = Math.min(this.filteredStarterContainers.length - 1, onScreenFirstIndex + maxRows * maxColumns -1);
this.starterSelectScrollBar.setPage(this.scrollCursor);
this.starterSelectScrollBar.setScrollCursor(this.scrollCursor);
let pokerusCursorIndex = 0;
this.filteredStarterContainers.forEach((container, i) => {