Skip to content

Commit

Permalink
Achievements page (#164)
Browse files Browse the repository at this point in the history
* Achievements

* no click attack challenge making things annoying
  • Loading branch information
CypherX authored Dec 23, 2023
1 parent 859abf4 commit 5cfa96a
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -77498,6 +77498,7 @@ App.game.specialEvents.initialize();
QuestLineHelper.loadQuestLines();
BattleFrontierRunner.stage(100);
BattleFrontierBattle.generateNewEnemy();
AchievementHandler.initialize(multiplier, new Challenges());

const now = new Date();
DailyDeal.generateDeals(5, now);
Expand Down Expand Up @@ -80035,6 +80036,12 @@ const searchOptions = [
type: 'Flutes',
page: '',
},
// Achievements
{
display: 'Achievements',
type: 'Achievements',
page: '',
},
];
// Differentiate our different links with the same name
searchOptions.forEach(a => {
Expand Down
1 change: 1 addition & 0 deletions data/Achievements/overview_description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
As the player earns achievements they will receive bonuses to [[Pokémon Dollars]], [[Dungeon Tokens]], and Experience from all sources. Click Attack and [[Flutes]] are also boosted by achievement bonus. The **Achievement Tracker** is unlocked after catching 110 unique Pokémon.
57 changes: 57 additions & 0 deletions pages/Achievements/overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<h3>Categories</h3>
<table class="table table-bordered table-striped table-hover no-data-tables">
<thead>
<tr>
<th>Category</th>
<th>Max Bonus</th>
<th>Number of Achievements</th>
</tr>
</thead>
<!--
ko with: (() => {
const categories = AchievementHandler.getAchievementCategories().filter(c => (GameConstants.Region[c.name] || 0) <= GameConstants.MAX_AVAILABLE_REGION);
const globalIndex = categories.findIndex(c => c.name == 'global');
categories.unshift(categories.splice(globalIndex, 1)[0]);
return categories;
})()
-->
<tbody data-bind="foreach: $data">
<tr>
<td data-bind="text: GameConstants.camelCaseToString(name)"></td>
<td data-bind="text: `${achievementBonus}%`"></td>
<td data-bind="text: AchievementHandler.achievementList.filter(a => a.category == $data && a.achievable()).length.toLocaleString()"></td>
</tr>
</tbody>
<tfoot>
<tr class="fw-bold">
<td class="text-end">Total</td>
<td data-bind="text: `${$data.reduce((sum, c) => sum += c.achievementBonus, 0).toLocaleString()}%`"></td>
<td data-bind="text: AchievementHandler.achievementList.filter(a => a.achievable()).length.toLocaleString()"></td>
</tr>
</tfoot>
<!-- /ko -->
</table>

<h3 class="mt-4">Achievement List</h3>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Description</th>
<th>Type</th>
<th>Category</th>
<th>Bonus</th>
</tr>
</thead>
<tbody data-bind="foreach: AchievementHandler.achievementList.filter(a => a.achievable())">
<tr class="align-middle">
<td data-bind="text: $index() + 1"></td>
<td data-bind="text: name"></td>
<td data-bind="text: description"></td>
<td data-bind="text: GameConstants.AchievementType[property.achievementType]"></td>
<td data-bind="text: GameConstants.camelCaseToString(category.name)"></td>
<td data-bind="text: `+ ${getBonus()}%`"></td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<a href="#!Hatchery_Helpers" class="btn btn-primary text-nowrap">Hatchery Helpers</a>
<a href="#!Weather" class="btn btn-primary text-nowrap">Weather</a>
<a href="#!Events" class="btn btn-primary text-nowrap">Events</a>

<a href="#!Achievements" class="btn btn-primary text-nowrap">Achievements</a>
</div>
<br>
<center><h4>Guides, Calculators, Statistics, and Miscellaneous Information</h4></center>
Expand Down
1 change: 1 addition & 0 deletions scripts/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ App.game.specialEvents.initialize();
QuestLineHelper.loadQuestLines();
BattleFrontierRunner.stage(100);
BattleFrontierBattle.generateNewEnemy();
AchievementHandler.initialize(multiplier, new Challenges());

const now = new Date();
DailyDeal.generateDeals(5, now);
Expand Down
6 changes: 6 additions & 0 deletions scripts/typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ const searchOptions = [
type: 'Flutes',
page: '',
},
// Achievements
{
display: 'Achievements',
type: 'Achievements',
page: '',
},
];
// Differentiate our different links with the same name
searchOptions.forEach(a => {
Expand Down

0 comments on commit 5cfa96a

Please sign in to comment.