Skip to content

Commit

Permalink
Some v0.10.16 fixes/updates (#168)
Browse files Browse the repository at this point in the history
* Restore missing images

* Fixup pokemon dungeon location display

* All available shadows
  • Loading branch information
CypherX authored Dec 1, 2023
1 parent b5488d4 commit e628b35
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 18 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
4 changes: 4 additions & 0 deletions images/settings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion pages/Pokémon/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ <h4 class="accordion-header">
</h4>
<div id="obtain-method-dungeon" class="accordion-collapse collapse">
<div class="accordion-body" data-bind="foreach: Object.values($data[PokemonLocationType.Dungeon])">
<a class="badge text-bg-secondary" data-bind="text: $data, attr: { href: `#!Dungeons/${$data}` }"></a>
<a class="badge text-bg-secondary" data-bind="text: $data.dungeon + `${$data.requirements ? ' 🔒' : ''}`,
attr: { href: `#!Dungeons/${$data.dungeon}` },
tooltip: {
title: $data.requirements ?? '',
html: false,
placement: 'bottom',
trigger: 'hover'
}"></a>
</div>
</div>
</div>
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 e628b35

Please sign in to comment.