Skip to content

Commit

Permalink
All available shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
CypherX committed Dec 1, 2023
1 parent 08cd95d commit d8b0975
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
18 changes: 10 additions & 8 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -78950,13 +78950,9 @@ const hasLootWithRequirements = (dungeon) => {
hasLootWithRequirements.cache = new WeakMap();

const getDungeonShadowPokemon = (dungeon) => {
// This will need to be updated to skip checking requirements once Orre XD is released
const shadows = [];
let shadows = [];
dungeon.enemyList.forEach(enemy => {
if (enemy instanceof DungeonTrainer) {
if (enemy.options?.requirement?.isCompleted() === false) {
return;
}
enemy.getTeam().forEach(pokemon => {
if (pokemon.shadow == GameConstants.ShadowStatus.Shadow) {
shadows.push({
Expand All @@ -78970,9 +78966,6 @@ const getDungeonShadowPokemon = (dungeon) => {
});
dungeon.bossList.forEach(boss => {
if (boss instanceof DungeonTrainer) {
if (boss.options?.requirement?.isCompleted() === false) {
return;
}
boss.getTeam().forEach(pokemon => {
if (pokemon.shadow == GameConstants.ShadowStatus.Shadow) {
shadows.push({
Expand All @@ -78986,6 +78979,15 @@ const getDungeonShadowPokemon = (dungeon) => {
}
});

// Some dungeons have duplicate trainers with the same shadow form, filter these out
shadows = shadows.reduce((unique, s) => {
if (!unique.some(obj => obj.pokemon === s.pokemon && obj.dungeon === s.dungeon
&& obj.trainer.name === s.trainer.name && obj.boss === s.boss)) {
unique.push(s);
}
return unique;
}, []);

return shadows;
};

Expand Down
2 changes: 1 addition & 1 deletion data/Shadow Pokémon/overview_description.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shadow Pokémon are Pokémon with a shadowy aura that can be encountered in Orre, a subregion from [[Regions/Hoenn]]. They can only be encountered as part of a trainer battle and never as a wild encounter.
Shadow Pokémon are Pokémon with a shadowy aura that can be encountered in Orre, a subregion from [[Regions/Hoenn]]. They can only be encountered as part of a trainer battle and never as a wild encounter. There are a total of **131** Pokémon that can be obtained as shadows.

These Pokémon have a **0.8x** multiplier to its attack. However, they can be purified which will change the multiplier to **1.2x** instead, making Purified Pokémon stronger than a regular one.

Expand Down
18 changes: 10 additions & 8 deletions scripts/pages/dungeons.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,9 @@ const hasLootWithRequirements = (dungeon) => {
hasLootWithRequirements.cache = new WeakMap();

const getDungeonShadowPokemon = (dungeon) => {
// This will need to be updated to skip checking requirements once Orre XD is released
const shadows = [];
let shadows = [];
dungeon.enemyList.forEach(enemy => {
if (enemy instanceof DungeonTrainer) {
if (enemy.options?.requirement?.isCompleted() === false) {
return;
}
enemy.getTeam().forEach(pokemon => {
if (pokemon.shadow == GameConstants.ShadowStatus.Shadow) {
shadows.push({
Expand All @@ -336,9 +332,6 @@ const getDungeonShadowPokemon = (dungeon) => {
});
dungeon.bossList.forEach(boss => {
if (boss instanceof DungeonTrainer) {
if (boss.options?.requirement?.isCompleted() === false) {
return;
}
boss.getTeam().forEach(pokemon => {
if (pokemon.shadow == GameConstants.ShadowStatus.Shadow) {
shadows.push({
Expand All @@ -352,6 +345,15 @@ const getDungeonShadowPokemon = (dungeon) => {
}
});

// Some dungeons have duplicate trainers with the same shadow form, filter these out
shadows = shadows.reduce((unique, s) => {
if (!unique.some(obj => obj.pokemon === s.pokemon && obj.dungeon === s.dungeon
&& obj.trainer.name === s.trainer.name && obj.boss === s.boss)) {
unique.push(s);
}
return unique;
}, []);

return shadows;
};

Expand Down

0 comments on commit d8b0975

Please sign in to comment.