Compare commits

..

No commits in common. "03ba575ee592818c4f94a09e0737cf586d95a95f" and "abbf4974fdc209390e587d5076c1d3631dfb39ee" have entirely different histories.

19 changed files with 584 additions and 492 deletions

View File

@ -3,138 +3,270 @@
{
"image": "1001.png",
"format": "RGBA8888",
"size": { "w": 161, "h": 157 },
"size": {
"w": 237,
"h": 237
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"trimmed": false,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 79,
"h": 79
},
"frame": {
"x": 0,
"y": 0,
"w": 79,
"h": 79
}
},
{
"filename": "0002.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"sourceSize": {
"w": 79,
"h": 79
},
{
"filename": "0003.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"spriteSourceSize": {
"x": 0,
"y": 1,
"w": 79,
"h": 78
},
{
"filename": "0004.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
},
{
"filename": "0005.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0006.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0007.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0008.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0009.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
},
{
"filename": "0010.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
},
{
"filename": "0011.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
"frame": {
"x": 79,
"y": 0,
"w": 79,
"h": 78
}
},
{
"filename": "0012.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
"sourceSize": {
"w": 79,
"h": 79
},
{
"filename": "0013.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
"spriteSourceSize": {
"x": 0,
"y": 1,
"w": 79,
"h": 78
},
{
"filename": "0014.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
},
{
"filename": "0015.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
},
{
"filename": "0016.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
"frame": {
"x": 79,
"y": 0,
"w": 79,
"h": 78
}
]}],
"meta": {"app": "https://www.aseprite.org/","version": "1.3.7-x64"
},
{
"filename": "0003.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 3,
"w": 79,
"h": 76
},
"frame": {
"x": 158,
"y": 0,
"w": 79,
"h": 76
}
},
{
"filename": "0011.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 3,
"w": 79,
"h": 76
},
"frame": {
"x": 158,
"y": 0,
"w": 79,
"h": 76
}
},
{
"filename": "0004.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 4,
"w": 79,
"h": 75
},
"frame": {
"x": 158,
"y": 76,
"w": 79,
"h": 75
}
},
{
"filename": "0010.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 4,
"w": 79,
"h": 75
},
"frame": {
"x": 158,
"y": 76,
"w": 79,
"h": 75
}
},
{
"filename": "0005.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 5,
"w": 79,
"h": 74
},
"frame": {
"x": 79,
"y": 78,
"w": 79,
"h": 74
}
},
{
"filename": "0009.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 5,
"w": 79,
"h": 74
},
"frame": {
"x": 79,
"y": 78,
"w": 79,
"h": 74
}
},
{
"filename": "0006.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 79,
"h": 73
},
"frame": {
"x": 0,
"y": 79,
"w": 79,
"h": 73
}
},
{
"filename": "0008.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 79,
"h": 73
},
"frame": {
"x": 0,
"y": 79,
"w": 79,
"h": 73
}
},
{
"filename": "0007.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 7,
"w": 79,
"h": 72
},
"frame": {
"x": 158,
"y": 151,
"w": 79,
"h": 72
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:2873276355a5ff8fe57d616764a11cb5:5516cfd39964108d480df461b020785f:c8a3fc07f857e38a4f887e43523aab92$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -3,138 +3,270 @@
{
"image": "1001.png",
"format": "RGBA8888",
"size": { "w": 161, "h": 157 },
"size": {
"w": 237,
"h": 237
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"trimmed": false,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 79,
"h": 79
},
"frame": {
"x": 0,
"y": 0,
"w": 79,
"h": 79
}
},
{
"filename": "0002.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"sourceSize": {
"w": 79,
"h": 79
},
{
"filename": "0003.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
"spriteSourceSize": {
"x": 0,
"y": 1,
"w": 79,
"h": 78
},
{
"filename": "0004.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 79, "h": 79 },
"frame": { "x": 80, "y": 78, "w": 79, "h": 79 }
},
{
"filename": "0005.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0006.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0007.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0008.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 80, "h": 78 },
"frame": { "x": 0, "y": 79, "w": 80, "h": 78 }
},
{
"filename": "0009.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
},
{
"filename": "0010.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
},
{
"filename": "0011.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
"frame": {
"x": 79,
"y": 0,
"w": 79,
"h": 78
}
},
{
"filename": "0012.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 1, "w": 81, "h": 78 },
"frame": { "x": 80, "y": 0, "w": 81, "h": 78 }
"sourceSize": {
"w": 79,
"h": 79
},
{
"filename": "0013.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
"spriteSourceSize": {
"x": 0,
"y": 1,
"w": 79,
"h": 78
},
{
"filename": "0014.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
},
{
"filename": "0015.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
},
{
"filename": "0016.png",
"rotated": false,
"trimmed": true,
"sourceSize": { "w": 81, "h": 79 },
"spriteSourceSize": { "x": 0, "y": 0, "w": 80, "h": 79 },
"frame": { "x": 0, "y": 0, "w": 80, "h": 79 }
"frame": {
"x": 79,
"y": 0,
"w": 79,
"h": 78
}
]}],
"meta": {"app": "https://www.aseprite.org/","version": "1.3.7-x64"
},
{
"filename": "0003.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 3,
"w": 79,
"h": 76
},
"frame": {
"x": 158,
"y": 0,
"w": 79,
"h": 76
}
},
{
"filename": "0011.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 3,
"w": 79,
"h": 76
},
"frame": {
"x": 158,
"y": 0,
"w": 79,
"h": 76
}
},
{
"filename": "0004.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 4,
"w": 79,
"h": 75
},
"frame": {
"x": 158,
"y": 76,
"w": 79,
"h": 75
}
},
{
"filename": "0010.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 4,
"w": 79,
"h": 75
},
"frame": {
"x": 158,
"y": 76,
"w": 79,
"h": 75
}
},
{
"filename": "0005.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 5,
"w": 79,
"h": 74
},
"frame": {
"x": 79,
"y": 78,
"w": 79,
"h": 74
}
},
{
"filename": "0009.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 5,
"w": 79,
"h": 74
},
"frame": {
"x": 79,
"y": 78,
"w": 79,
"h": 74
}
},
{
"filename": "0006.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 79,
"h": 73
},
"frame": {
"x": 0,
"y": 79,
"w": 79,
"h": 73
}
},
{
"filename": "0008.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 79,
"h": 73
},
"frame": {
"x": 0,
"y": 79,
"w": 79,
"h": 73
}
},
{
"filename": "0007.png",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 79,
"h": 79
},
"spriteSourceSize": {
"x": 0,
"y": 7,
"w": 79,
"h": 72
},
"frame": {
"x": 158,
"y": 151,
"w": 79,
"h": 72
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:83b74b0673ef1ae8346efab60ae89872:f76c930177bf7a296d3f47eb6294ae4f:c8a3fc07f857e38a4f887e43523aab92$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -425,13 +425,7 @@ export class FixedBattleConfig {
}
}
/**
* Helper function to generate a random trainer for evil team trainers and the elite 4/champion
* @param trainerPool The TrainerType or list of TrainerTypes that can possibly be generated
* @param randomGender whether or not to randomly (50%) generate a female trainer (for use with evil team grunts)
* @returns the generated trainer
*/
function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[], randomGender: boolean = false): GetTrainerFunc {
function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[]): GetTrainerFunc {
return (scene: BattleScene) => {
const rand = Utils.randSeedInt(trainerPool.length);
const trainerTypes: TrainerType[] = [];
@ -441,20 +435,11 @@ function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[], rand
: trainerPoolEntry;
trainerTypes.push(trainerType);
}
let trainerGender = TrainerVariant.DEFAULT;
if (randomGender) {
trainerGender = (Utils.randInt(2) === 0) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT;
// If the trainer type has a double variant, there's a 33% chance of it being a double battle (for now we only allow tate&liza to be double)
if (trainerConfigs[trainerTypes[rand]].trainerTypeDouble && (trainerTypes[rand] === TrainerType.TATE || trainerTypes[rand] === TrainerType.LIZA)) {
return new Trainer(scene, trainerTypes[rand], Utils.randSeedInt(3) ? TrainerVariant.DOUBLE : TrainerVariant.DEFAULT);
}
/* 1/3 chance for evil team grunts to be double battles */
const evilTeamGrunts = [TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT];
const isEvilTeamGrunt = evilTeamGrunts.includes(trainerTypes[rand]);
if (trainerConfigs[trainerTypes[rand]].hasDouble && isEvilTeamGrunt) {
return new Trainer(scene, trainerTypes[rand], (Utils.randInt(3) === 0) ? TrainerVariant.DOUBLE : trainerGender);
}
return new Trainer(scene, trainerTypes[rand], trainerGender);
return new Trainer(scene, trainerTypes[rand], TrainerVariant.DEFAULT);
};
}
@ -477,21 +462,21 @@ 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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[66]: 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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[114]: 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 ], true)),
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT ])),
[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 ])),
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)

View File

@ -84,7 +84,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
public friendship: integer;
public metLevel: integer;
public metBiome: Biome | -1;
public metSpecies: Species;
public luck: integer;
public pauseEvolutions: boolean;
public pokerus: boolean;
@ -174,7 +173,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.metLevel = dataSource.metLevel || 5;
this.luck = dataSource.luck;
this.metBiome = dataSource.metBiome;
this.metSpecies = dataSource.metSpecies ?? (this.metBiome !== -1 ? this.species.speciesId : this.species.getRootSpeciesId(true));
this.pauseEvolutions = dataSource.pauseEvolutions;
this.pokerus = !!dataSource.pokerus;
this.fusionSpecies = dataSource.fusionSpecies instanceof PokemonSpecies ? dataSource.fusionSpecies : getPokemonSpecies(dataSource.fusionSpecies);
@ -215,7 +213,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.friendship = species.baseFriendship;
this.metLevel = level;
this.metBiome = scene.currentBattle ? scene.arena.biomeType : -1;
this.metSpecies = species.speciesId;
this.pokerus = false;
if (level > 1) {
@ -888,40 +885,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Checks which egg moves have been unlocked for the {@linkcode Pokemon} based
* on the species it was met at or by the first {@linkcode Pokemon} in its evolution
* line that can act as a starter and provides those egg moves.
* @returns an array of {@linkcode Moves}, the length of which is determined by how many
* egg moves are unlocked for that species.
*/
getUnlockedEggMoves(): Moves[] {
const moves: Moves[] = [];
const species = this.metSpecies in speciesEggMoves ? this.metSpecies : this.getSpeciesForm(true).getRootSpeciesId(true);
if (species in speciesEggMoves) {
for (let i = 0; i < 4; i++) {
if (this.scene.gameData.starterData[species].eggMoves & (1 << i)) {
moves.push(speciesEggMoves[species][i]);
}
}
}
return moves;
}
/**
* Gets all possible learnable level moves for the {@linkcode Pokemon},
* excluding any moves already known.
*
* Available egg moves are only included if the {@linkcode Pokemon} was
* in the starting party of the run.
* @returns an array of {@linkcode Moves}, the length of which is determined
* by how many learnable moves there are for the {@linkcode Pokemon}.
* All moves that could be relearned by this pokemon at this point. Used for memory mushrooms.
* @returns {Moves[]} The valid moves
*/
getLearnableLevelMoves(): Moves[] {
let levelMoves = this.getLevelMoves(1, true).map(lm => lm[1]);
if (this.metBiome === -1) {
levelMoves = this.getUnlockedEggMoves().concat(levelMoves);
}
return levelMoves.filter(lm => !this.moveset.some(m => m.moveId === lm));
return this.getLevelMoves(1, true, false, true).map(lm => lm[1]).filter(lm => !this.moveset.filter(m => m.moveId === lm).length).filter((move: Moves, i: integer, array: Moves[]) => array.indexOf(move) === i);
}
/**
@ -4107,7 +4075,6 @@ export class EnemyPokemon extends Pokemon {
this.pokeball = pokeballType;
this.metLevel = this.level;
this.metBiome = this.scene.arena.biomeType;
this.metSpecies = this.species.speciesId;
const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, this.gender, this.shiny, this.variant, this.ivs, this.nature, this);
party.push(newPokemon);
ret = newPokemon;

View File

@ -126,23 +126,17 @@ export const trainerClasses: SimpleTranslationEntries = {
"workers": "Workers",
"youngster": "Youngster",
"rocket_grunt": "Rocket Grunt",
"rocket_grunts": "Rocket Grunts",
"rocket_grunt_female": "Rocket Grunt",
"magma_grunt": "Magma Grunt",
"magma_grunt_female": "Magma Grunt",
"magma_grunts": "Magma Grunts",
"aqua_grunt": "Aqua Grunt",
"aqua_grunt_female": "Aqua Grunt",
"aqua_grunts": "Aqua Grunts",
"galactic_grunt": "Galactic Grunt",
"galactic_grunt_female": "Galactic Grunt",
"galactic_grunts": "Galactic Grunts",
"plasma_grunt": "Plasma Grunt",
"plasma_grunt_female": "Plasma Grunt",
"plasma_grunts": "Plasma Grunts",
"flare_grunt": "Flare Grunt",
"flare_grunt_female": "Flare Grunt",
"flare_grunts": "Flare Grunts",
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -117,25 +117,7 @@ export const trainerClasses: SimpleTranslationEntries = {
"worker": "Operario",
"worker_female": "Operaria",
"workers": "Operarios",
"youngster": "Joven",
"rocket_grunt": "Rocket Grunt",
"rocket_grunts": "Rocket Grunts",
"rocket_grunt_female": "Rocket Grunt",
"magma_grunt": "Magma Grunt",
"magma_grunt_female": "Magma Grunt",
"magma_grunts": "Magma Grunts",
"aqua_grunt": "Aqua Grunt",
"aqua_grunt_female": "Aqua Grunt",
"aqua_grunts": "Aqua Grunts",
"galactic_grunt": "Galactic Grunt",
"galactic_grunt_female": "Galactic Grunt",
"galactic_grunts": "Galactic Grunts",
"plasma_grunt": "Plasma Grunt",
"plasma_grunt_female": "Plasma Grunt",
"plasma_grunts": "Plasma Grunts",
"flare_grunt": "Flare Grunt",
"flare_grunt_female": "Flare Grunt",
"flare_grunts": "Flare Grunts",
"youngster": "Joven"
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -127,22 +127,16 @@ export const trainerClasses: SimpleTranslationEntries = {
"youngster": "Gamin",
"rocket_grunt": "Sbire de la Team Rocket",
"rocket_grunt_female": "Sbire de la Team Rocket",
"rocket_grunts": "Sbires de la Team Rocket",
"magma_grunt": "Sbire de la Team Magma",
"magma_grunt_female": "Sbire de la Team Magma",
"magma_grunts": "Sbires de la Team Magma",
"aqua_grunt": "Sbire de la Team Aqua",
"aqua_grunt_female": "Sbire de la Team Aqua",
"aqua_grunts": "Sbires de la Team Aqua",
"galactic_grunt": "Sbire de la Team Galaxie",
"galactic_grunt_female": "Sbire de la Team Galaxie",
"galactic_grunts": "Sbires de la Team Galaxie",
"galactic_grunt_female": "Sbire Team Galaxie",
"plasma_grunt": "Sbire de la Team Plasma",
"plasma_grunt_female": "Sbire de la Team Plasma",
"plasma_grunts": "Sbires de la Team Plasma",
"flare_grunt": "Sbire de la Team Flare",
"flare_grunt_female": "Sbire de la Team Flare",
"flare_grunts": "Sbires de la Team Flare",
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -118,25 +118,7 @@ export const trainerClasses: SimpleTranslationEntries = {
"worker": "Operaio",
"worker_female": "Lavoratrice",
"workers": "Lavoratori",
"youngster": "Bullo",
"rocket_grunt": "Recluta Team Rocket",
"rocket_grunts": "Reclute Team Rocket",
"rocket_grunt_female": "Recluta Team Rocket",
"magma_grunt": "Recluta Team Magma",
"magma_grunt_female": "Recluta Team Magma",
"magma_grunts": "Reclute Team Magma",
"aqua_grunt": "Recluta Team Idro",
"aqua_grunt_female": "Recluta Team Idro",
"aqua_grunts": "Recluta Team Idro",
"galactic_grunt": "Recluta Team Galassia",
"galactic_grunt_female": "Recluta Team Galassia",
"galactic_grunts": "Reclute Team Galassia",
"plasma_grunt": "Seguace Plasma",
"plasma_grunt_female": "Seguace Plasma",
"plasma_grunts": "Seguaci Plasma",
"flare_grunt": "Recluta Team Flare",
"flare_grunt_female": "Recluta Team Flare",
"flare_grunts": "Reclute Team Flare",
"youngster": "Bullo"
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -127,22 +127,16 @@ export const trainerClasses: SimpleTranslationEntries = {
"youngster": "반바지 꼬마",
"rocket_grunt": "로켓단 조무래기",
"rocket_grunt_female": "로켓단 조무래기",
"rocket_grunts": "로켓단 조무래기들",
"magma_grunt": "마그마단 조무래기",
"magma_grunt_female": "마그마단 조무래기",
"magma_grunts": "마그마단 조무래기들",
"aqua_grunt": "아쿠아단 조무래기",
"aqua_grunt_female": "아쿠아단 조무래기",
"aqua_grunts": "아쿠아단 조무래기들",
"galactic_grunt": "갤럭시단 조무래기",
"galactic_grunt_female": "갤럭시단 조무래기",
"galactic_grunts": "갤럭시단 조무래기들",
"plasma_grunt": "플라스마단 조무래기",
"plasma_grunt_female": "플라스마단 조무래기",
"plasma_grunts": "플라스마단 조무래기들",
"flare_grunt": "플레어단 조무래기",
"flare_grunt_female": "플레어단 조무래기",
"flare_grunts": "플레어단 조무래기들",
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -127,22 +127,16 @@ export const trainerClasses: SimpleTranslationEntries = {
"youngster": "Jovem",
"rocket_grunt": "Recruta da Equipe Rocket",
"rocket_grunt_female": "Recruta da Equipe Rocket",
"rocket_grunts": "Recrutas da Equipe Rocket",
"magma_grunt": "Recruta da Equipe Magma",
"magma_grunt_female": "Recruta da Equipe Magma",
"magma_grunts": "Recrutas da Equipe Magma",
"aqua_grunt": "Recruta da Equipe Aqua",
"aqua_grunt_female": "Recruta da Equipe Aqua",
"aqua_grunts": "Recrutas da Equipe Aqua",
"galactic_grunt": "Recruta da Equipe Galáctica",
"galactic_grunt_female": "Recruta da Equipe Galáctica",
"galactic_grunts": "Recrutas da Equipe Galáctica",
"plasma_grunt": "Recruta da Equipe Plasma",
"plasma_grunt_female": "Recruta da Equipe Plasma",
"plasma_grunts": "Recrutas da Equipe Plasma",
"flare_grunt": "Recruta da Equipe Flare",
"flare_grunt_female": "Recruta da Equipe Flare",
"flare_grunts": "Recrutas da Equipe Flare",
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -127,22 +127,16 @@ export const trainerClasses: SimpleTranslationEntries = {
"youngster": "短裤小子",
"rocket_grunt": "火箭队手下",
"rocket_grunt_female": "火箭队手下",
"rocket_grunts": "火箭队手下们",
"magma_grunt": "熔岩队手下",
"magma_grunt_female": "熔岩队手下",
"magma_grunts": "熔岩队手下们",
"aqua_grunt": "海洋队手下",
"aqua_grunt_female": "海洋队手下",
"aqua_grunts": "海洋队手下们",
"galactic_grunt": "银河队手下",
"galactic_grunt_female": "银河队手下",
"galactic_grunts": "银河队手下们",
"plasma_grunt": "等离子队手下",
"plasma_grunt_female": "等离子队手下",
"plasma_grunts": "等离子队手下们",
"flare_grunt": "闪焰队手下",
"flare_grunt_female": "闪焰队手下",
"flare_grunts": "闪焰队手下们",
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -118,23 +118,7 @@ export const trainerClasses: SimpleTranslationEntries = {
"worker": "工人",
"worker_female": "工人",
"workers": "工人組合",
"youngster": "短褲小子",
"rocket_grunts": "火箭队手下們",
"magma_grunt": "熔岩队手下",
"magma_grunt_female": "熔岩队手下",
"magma_grunts": "熔岩队手下們",
"aqua_grunt": "海洋队手下",
"aqua_grunt_female": "海洋队手下",
"aqua_grunts": "海洋队手下們",
"galactic_grunt": "银河队手下",
"galactic_grunt_female": "银河队手下",
"galactic_grunts": "银河队手下們",
"plasma_grunt": "等离子队手下",
"plasma_grunt_female": "等离子队手下",
"plasma_grunts": "等离子队手下們",
"flare_grunt": "闪焰队手下",
"flare_grunt_female": "闪焰队手下",
"flare_grunts": "闪焰队手下們",
"youngster": "短褲小子"
} as const;
// Names of special trainers like gym leaders, elite four, and the champion

View File

@ -1569,7 +1569,7 @@ const modifierPool: ModifierPool = {
p => !p.getHeldItems().some(i => i instanceof Modifiers.PokemonResetNegativeStatStageModifier && i.stackCount >= i.getMaxHeldItemCount(p)) &&
(checkedAbilities.some(a => p.hasAbility(a, false, true)) || p.getMoveset(true).some(m => selfStatLowerMoves.includes(m.moveId)))).length;
// If a party member has one of the above moves or abilities and doesn't have max herbs, the herb will appear more frequently
return 2 * (weightMultiplier ? 2 : 1) + (weightMultiplier ? weightMultiplier : 0);
return 3 * (weightMultiplier ? 2: 1) + (weightMultiplier ? weightMultiplier - 1 : 0);
}, 10),
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
new WeightedModifierType(modifierTypes.CANDY_JAR, 5),
@ -1637,7 +1637,7 @@ const wildModifierPool: ModifierPool = {
}),
[ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10),
new WeightedModifierType(modifierTypes.WHITE_HERB, 1)
new WeightedModifierType(modifierTypes.WHITE_HERB, 2)
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
}),
@ -1666,7 +1666,7 @@ const trainerModifierPool: ModifierPool = {
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10),
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5),
new WeightedModifierType(modifierTypes.WHITE_HERB, 1),
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
@ -1684,7 +1684,6 @@ const trainerModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.KINGS_ROCK, 1),
new WeightedModifierType(modifierTypes.LEFTOVERS, 1),
new WeightedModifierType(modifierTypes.SHELL_BELL, 1),
new WeightedModifierType(modifierTypes.SCOPE_LENS, 1),
].map(m => {
m.setTier(ModifierTier.MASTER); return m;
})

View File

@ -1437,7 +1437,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
this.scene.time.delayedCall(750, () => this.summon());
} else {
const trainerName = this.scene.currentBattle.trainer.getName(!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER);
const pokemonName = this.getPokemon().getNameToRender();
const pokemonName = getPokemonNameWithAffix(this.getPokemon());
const message = i18next.t("battle:trainerSendOut", { trainerName, pokemonName });
this.scene.pbTrayEnemy.hide();
@ -1650,7 +1650,7 @@ export class SwitchSummonPhase extends SummonPhase {
i18next.t("battle:playerGo", { pokemonName: getPokemonNameWithAffix(switchedPokemon) }) :
i18next.t("battle:trainerGo", {
trainerName: this.scene.currentBattle.trainer.getName(!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER),
pokemonName: this.getPokemon().getNameToRender()
pokemonName: getPokemonNameWithAffix(this.getPokemon())
})
);
// Ensure improperly persisted summon data (such as tags) is cleared upon switching
@ -5038,7 +5038,7 @@ export class AttemptCapturePhase extends PokemonPhase {
Promise.all([pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon)]).then(() => {
if (this.scene.getParty().length === 6) {
const promptRelease = () => {
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.getNameToRender() }), null, () => {
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: getPokemonNameWithAffix(pokemon) }), null, () => {
this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true);
this.scene.ui.setMode(Mode.CONFIRM, () => {
const newPokemon = this.scene.addPlayerPokemon(pokemon.species, pokemon.level, pokemon.abilityIndex, pokemon.formIndex, pokemon.gender, pokemon.shiny, pokemon.variant, pokemon.ivs, pokemon.nature, pokemon);

View File

@ -38,7 +38,6 @@ export default class PokemonData {
public friendship: integer;
public metLevel: integer;
public metBiome: Biome | -1;
public metSpecies: Species;
public luck: integer;
public pauseEvolutions: boolean;
public pokerus: boolean;
@ -84,7 +83,6 @@ export default class PokemonData {
this.friendship = source.friendship !== undefined ? source.friendship : getPokemonSpecies(this.species).baseFriendship;
this.metLevel = source.metLevel || 5;
this.metBiome = source.metBiome !== undefined ? source.metBiome : -1;
this.metSpecies = source.metSpecies;
this.luck = source.luck !== undefined ? source.luck : (source.shiny ? (source.variant + 1) : 0);
if (!forHistory) {
this.pauseEvolutions = !!source.pauseEvolutions;

View File

@ -40,8 +40,8 @@ export default class MenuUiHandler extends MessageUiHandler {
private cursorObj: Phaser.GameObjects.Image;
private excludedMenus: () => ConditionalMenu[];
private menuOptions: MenuOptions[];
protected ignoredMenuOptions: MenuOptions[];
protected menuOptions: MenuOptions[];
protected manageDataConfig: OptionSelectConfig;
protected communityConfig: OptionSelectConfig;
@ -52,19 +52,13 @@ export default class MenuUiHandler extends MessageUiHandler {
constructor(scene: BattleScene, mode?: Mode) {
super(scene, mode);
this.excludedMenus = () => [
{ condition: [Mode.COMMAND, Mode.TITLE].includes(mode ?? Mode.TITLE), options: [ MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
{ condition: bypassLogin, options: [ MenuOptions.LOG_OUT ] }
];
this.menuOptions = Utils.getEnumKeys(MenuOptions)
.map(m => parseInt(MenuOptions[m]) as MenuOptions)
.filter(m => {
return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m));
});
this.ignoredMenuOptions = !bypassLogin
? [ ]
: [ MenuOptions.LOG_OUT ];
this.menuOptions = Utils.getEnumKeys(MenuOptions).map(m => parseInt(MenuOptions[m]) as MenuOptions).filter(m => !this.ignoredMenuOptions.includes(m));
}
setup(): void {
setup() {
const ui = this.getUi();
// wiki url directs based on languges available on wiki
const lang = i18next.resolvedLanguage.substring(0,2);
@ -86,25 +80,10 @@ export default class MenuUiHandler extends MessageUiHandler {
this.menuOverlay.setOrigin(0,0);
this.menuContainer.add(this.menuOverlay);
this.menuContainer.add(this.bgmBar);
this.menuContainer.setVisible(false);
}
render() {
const ui = this.getUi();
this.excludedMenus = () => [
{ condition: ![Mode.COMMAND, Mode.TITLE].includes(ui.getModeChain()[0]), options: [ MenuOptions.EGG_GACHA, MenuOptions.EGG_LIST] },
{ condition: bypassLogin, options: [ MenuOptions.LOG_OUT ] }
];
this.menuOptions = Utils.getEnumKeys(MenuOptions)
.map(m => parseInt(MenuOptions[m]) as MenuOptions)
.filter(m => {
return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m));
});
const menuMessageText = addTextObject(this.scene, 8, 8, "", TextStyle.WINDOW, { maxLines: 2 });
menuMessageText.setName("menu-message");
menuMessageText.setWordWrapWidth(1224);
menuMessageText.setOrigin(0, 0);
this.optionSelectText = addTextObject(this.scene, 0, 0, this.menuOptions.map(o => `${i18next.t(`menuUiHandler:${MenuOptions[o]}`)}`).join("\n"), TextStyle.WINDOW, { maxLines: this.menuOptions.length });
this.optionSelectText.setLineSpacing(12);
@ -129,12 +108,10 @@ export default class MenuUiHandler extends MessageUiHandler {
menuMessageBox.setOrigin(0, 0);
this.menuMessageBoxContainer.add(menuMessageBox);
const menuMessageText = addTextObject(this.scene, 8, 8, "", TextStyle.WINDOW, { maxLines: 2 });
menuMessageText.setName("menu-message");
menuMessageText.setWordWrapWidth(1224);
menuMessageText.setOrigin(0, 0);
this.menuMessageBoxContainer.add(menuMessageText);
this.menuContainer.add(this.bgmBar);
this.message = menuMessageText;
this.menuContainer.add(this.menuMessageBoxContainer);
@ -293,18 +270,15 @@ export default class MenuUiHandler extends MessageUiHandler {
xOffset: 98,
options: communityOptions
};
this.setCursor(0);
this.menuContainer.setVisible(false);
}
show(args: any[]): boolean {
this.render();
super.show(args);
this.menuOptions = Utils.getEnumKeys(MenuOptions)
.map(m => parseInt(MenuOptions[m]) as MenuOptions)
.filter(m => {
return !this.excludedMenus().some(exclusion => exclusion.condition && exclusion.options.includes(m));
});
super.show(args);
this.menuContainer.setVisible(true);
this.setCursor(0);
@ -331,17 +305,13 @@ export default class MenuUiHandler extends MessageUiHandler {
if (button === Button.ACTION) {
let adjustedCursor = this.cursor;
const excludedMenu = this.excludedMenus().find(e => e.condition);
if (excludedMenu !== undefined && excludedMenu.options !== undefined && excludedMenu.options.length > 0) {
const sortedOptions = excludedMenu.options.sort();
for (const imo of sortedOptions) {
for (const imo of this.ignoredMenuOptions) {
if (adjustedCursor >= imo) {
adjustedCursor++;
} else {
break;
}
}
}
switch (adjustedCursor) {
case MenuOptions.GAME_SETTINGS:
ui.setOverlayMode(Mode.SETTINGS);
@ -536,8 +506,3 @@ export default class MenuUiHandler extends MessageUiHandler {
this.cursorObj = null;
}
}
interface ConditionalMenu {
condition: boolean;
options: MenuOptions[];
}

View File

@ -536,8 +536,4 @@ export default class UI extends Phaser.GameObjects.Container {
this.revertMode().then(success => Utils.executeIf(success, this.revertModes).then(() => resolve()));
});
}
public getModeChain(): Mode[] {
return this.modeChain;
}
}