From e91c9c011d5b8427b1668f0a498345c282e40802 Mon Sep 17 00:00:00 2001 From: IshaD Date: Tue, 27 Feb 2018 14:59:36 +0100 Subject: [PATCH 01/49] Start of prestige --- src/scripts/GameConstants.ts | 6 ++ src/scripts/Prestige/Prestige.ts | 81 +++++++++++++++++++++++++ src/scripts/Prestige/PrestigeBonuses.ts | 21 +++++++ src/scripts/Prestige/PrestigeUpgrade.ts | 16 +++++ 4 files changed, 124 insertions(+) create mode 100644 src/scripts/Prestige/Prestige.ts create mode 100644 src/scripts/Prestige/PrestigeBonuses.ts create mode 100644 src/scripts/Prestige/PrestigeUpgrade.ts diff --git a/src/scripts/GameConstants.ts b/src/scripts/GameConstants.ts index 35e6a95e..0153e97c 100644 --- a/src/scripts/GameConstants.ts +++ b/src/scripts/GameConstants.ts @@ -120,6 +120,12 @@ namespace GameConstants { "Cell Battery", } + export enum PrestigeType { + "Easy" = 0, + "Medium", + "Hard" + } + // Dungeons export const DUNGEON_SIZE = 5; export const DUNGEON_CHEST_SHOW = 2; diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts new file mode 100644 index 00000000..873e8d60 --- /dev/null +++ b/src/scripts/Prestige/Prestige.ts @@ -0,0 +1,81 @@ +class Prestige { + + public static upgradeList = []; + + /** + * Upgrades 2, 16, 22 and 36 can always be reached. Otherwise check if a neighbour is already unlocked. + * Can take some inspiration from how dungeons handle this. + */ + public static canReachUpgrade(upgradeId: number): boolean { + // TODO + return null + } + + /** + * Set the id of the upgrade to true in player and subtract the correct points. + */ + public static buyUpgrade(upgradeId: number) { + if (this.canBuyUpgrade(upgradeId)) { + // TODO + } + } + + /** + * Reward 1 of each point that is lower or equal to the prestige that is started. + */ + public static awardPrestigePoints(type: GameConstants.PrestigeType) { + // TODO + } + + /** + * Check if an upgrade is bought. + */ + public static isUpgradeBought(upgradeId: number): boolean { + // TODO + return null; + } + + + /** + * Reset all player values except caughtShinyList, defeatedAmount, eggSlots, itemList, diamons, shardUpgrades, mineUpgrade, statistics, questXp, shinyCatches, all farm related stuff. + * Store money, dungeontokens and questpoints so they can be recovered. + * Award prestigepoints. + * Restart the game. + */ + public static startPrestige(type: GameConstants.PrestigeType) { + this.awardPrestigePoints(type); + // TODO + } + + /** + * Check if an upgrade can be bought + */ + public static canBuyUpgrade(upgradeId: number): boolean { + let prestigeUpgrade: PrestigeUpgrade = this.getUpgrade(upgradeId); + return !this.isUpgradeBought(upgradeId) && this.canReachUpgrade(upgradeId) && player.prestigePoints[prestigeUpgrade.costType] >= prestigeUpgrade.cost; + } + + + /** + * Return the upgrade from the upgradeList + */ + public static getUpgrade(upgradeId: number): PrestigeUpgrade { + return this.upgradeList[upgradeId]; + } + + public static addUpgrade(upgrade: PrestigeUpgrade) { + this.upgradeList[upgrade.id] = upgrade; + } + + /** + * All upgrades are percentages in the form (1 + bonus). + * Decreasing a time by 33% will be (1 + -0.33) and the bonus will be -0.33 + * Increasing money by 50% will be (1 + 0.5) and the bonus will be 0.5 + */ + + public static initialize() { + // TODO + this.addUpgrade(new PrestigeUpgrade(1, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)) + } + +} \ No newline at end of file diff --git a/src/scripts/Prestige/PrestigeBonuses.ts b/src/scripts/Prestige/PrestigeBonuses.ts new file mode 100644 index 00000000..d401500e --- /dev/null +++ b/src/scripts/Prestige/PrestigeBonuses.ts @@ -0,0 +1,21 @@ +class PrestigeBonuses { + /** + * TODO not sure if this is the best way to do it, see #238 + */ + + /** + * Return the bonus if the upgrade is bought, 1 otherwise + */ + public static getBonus(upgradeId){ + return Prestige.isUpgradeBought(upgradeId) ? (1+Prestige.getUpgrade(upgradeId).bonus) : 0 + } + + /** + * Repeat 36 times :/ + */ + public static getHarvestTimeBonus(){ + return this.getBonus(1); + } + + +} \ No newline at end of file diff --git a/src/scripts/Prestige/PrestigeUpgrade.ts b/src/scripts/Prestige/PrestigeUpgrade.ts new file mode 100644 index 00000000..f8a5b012 --- /dev/null +++ b/src/scripts/Prestige/PrestigeUpgrade.ts @@ -0,0 +1,16 @@ +class PrestigeUpgrade { + + public id: number; + public description: string; + public cost: number; + public costType: GameConstants.PrestigeType; + public bonus: number; + + constructor(id: number, description: string, cost: number, costType: GameConstants.PrestigeType, bonus = 0) { + this.id = id; + this.description = description; + this.cost = cost; + this.costType = costType; + this.bonus = bonus; + } +} \ No newline at end of file From 44af5065a2948ee98337be341ed7d0a7838ccc42 Mon Sep 17 00:00:00 2001 From: IshaD Date: Tue, 27 Feb 2018 17:40:34 +0100 Subject: [PATCH 02/49] More work on prestige Mockup UI, colors are still ugly tho --- src/components/prestigeModal.html | 83 +++++++++++++++++++ src/index.html | 3 + src/scripts/GameConstants.ts | 8 ++ src/scripts/Main.ts | 6 +- src/scripts/Player.ts | 3 + src/scripts/Prestige/Prestige.ts | 133 ++++++++++++++++++++++++++++-- src/styles/prestige.less | 44 ++++++++++ 7 files changed, 271 insertions(+), 9 deletions(-) create mode 100644 src/components/prestigeModal.html create mode 100644 src/styles/prestige.less diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html new file mode 100644 index 00000000..ce3e2602 --- /dev/null +++ b/src/components/prestigeModal.html @@ -0,0 +1,83 @@ + \ No newline at end of file diff --git a/src/index.html b/src/index.html index e48e5b78..ed3cc18a 100644 --- a/src/index.html +++ b/src/index.html @@ -680,5 +680,8 @@

Pokéclicker

@import "safariModal.html" + +@import "prestigeModal.html" + \ No newline at end of file diff --git a/src/scripts/GameConstants.ts b/src/scripts/GameConstants.ts index 0153e97c..c53afac8 100644 --- a/src/scripts/GameConstants.ts +++ b/src/scripts/GameConstants.ts @@ -120,12 +120,20 @@ namespace GameConstants { "Cell Battery", } + export function normalize(n: number, max:number){ + return Math.min( max, Math.max(0, n)); + } + + + // Prestige export enum PrestigeType { "Easy" = 0, "Medium", "Hard" } + export const AMOUNT_OF_PRESTIGE_UPGRADES = 37; + // Dungeons export const DUNGEON_SIZE = 5; export const DUNGEON_CHEST_SHOW = 2; diff --git a/src/scripts/Main.ts b/src/scripts/Main.ts index 17d01826..af326daa 100644 --- a/src/scripts/Main.ts +++ b/src/scripts/Main.ts @@ -4,13 +4,16 @@ * Start the game when all html elements are loaded. */ let player; -const debug = false; +const debug = true; let game; document.addEventListener("DOMContentLoaded", function (event) { + $('#PrestigeModal').modal('show'); Preload.load(debug).then(function () { OakItemRunner.initialize(); UndergroundItem.initialize(); + Prestige.initialize(); + game = new Game(); // DungeonRunner.initializeDungeon(dungeonList["Viridian Forest"]); @@ -62,6 +65,7 @@ document.addEventListener("DOMContentLoaded", function (event) { Game.applyRouteBindings(); Preload.hideSplashScreen(); game.start(); + Prestige.updateHTML() }); }); diff --git a/src/scripts/Player.ts b/src/scripts/Player.ts index efc2e330..a075d045 100644 --- a/src/scripts/Player.ts +++ b/src/scripts/Player.ts @@ -9,6 +9,9 @@ class Player { private _dungeonTokens: KnockoutObservable; public achievementsCompleted: { [name: string]: boolean }; + public prestigesCompleted: number[] = [0,0,0]; + public prestigePoints: number[] = [20,20,20]; + public prestigeUpgradesBought = new Array(GameConstants.AMOUNT_OF_PRESTIGE_UPGRADES).fill(false); private _caughtShinyList: KnockoutObservableArray; private _route: KnockoutObservable; diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 873e8d60..ca8ab9ce 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -1,5 +1,15 @@ class Prestige { + public static upgradeLayout = [ + [0, 0, 1, 2, 3, 0, 0], + [0, 4, 5, 6, 7, 8, 0], + [9, 10, 11, 12, 13, 14, 15], + [16, 17, 18, 19, 20, 21, 22], + [23, 24, 25, 26, 27, 28, 29], + [0, 30, 31, 32, 33, 34, 0], + [0, 0, 35, 36, 37, 0, 0], + ]; + public static upgradeList = []; /** @@ -7,17 +17,49 @@ class Prestige { * Can take some inspiration from how dungeons handle this. */ public static canReachUpgrade(upgradeId: number): boolean { - // TODO - return null + if (upgradeId == 2 || upgradeId == 16 || upgradeId == 22 || upgradeId == 36) { + return true; + } + + if (this.isUpgradeBought(upgradeId)) { + return true; + } + + let x = 0; + let y = 0; + + for (let i = 0; i < this.upgradeLayout.length; i++) { + for (let j = 0; j < this.upgradeLayout[i].length; j++) { + if (this.upgradeLayout[i][j] == upgradeId) { + x = JSON.parse(JSON.stringify(j)); + y = JSON.parse(JSON.stringify(i)); + break; + } + } + } + + console.log(`${x},${y}`) + let nb1 = this.upgradeLayout[GameConstants.normalize(y + 1, this.upgradeLayout.length-1)][GameConstants.normalize(x, this.upgradeLayout.length-1)]; + let nb2 = this.upgradeLayout[GameConstants.normalize(y - 1, this.upgradeLayout.length-1)][GameConstants.normalize(x, this.upgradeLayout.length-1)]; + let nb3 = this.upgradeLayout[GameConstants.normalize(y, this.upgradeLayout.length-1)][GameConstants.normalize(x + 1, this.upgradeLayout.length-1)]; + let nb4 = this.upgradeLayout[GameConstants.normalize(y, this.upgradeLayout.length-1)][GameConstants.normalize(x - 1, this.upgradeLayout.length-1)]; + + console.log(`${nb1}, ${nb2}, ${nb3}, ${nb4}`) + return this.isUpgradeBought(nb1) || this.isUpgradeBought(nb2) || this.isUpgradeBought(nb3) || this.isUpgradeBought(nb4); } + /** * Set the id of the upgrade to true in player and subtract the correct points. */ public static buyUpgrade(upgradeId: number) { + if(upgradeId == 0){ + + } if (this.canBuyUpgrade(upgradeId)) { - // TODO + player.prestigeUpgradesBought[upgradeId] = true; } + this.updateHTML(); } /** @@ -31,8 +73,7 @@ class Prestige { * Check if an upgrade is bought. */ public static isUpgradeBought(upgradeId: number): boolean { - // TODO - return null; + return player.prestigeUpgradesBought[upgradeId]; } @@ -52,7 +93,21 @@ class Prestige { */ public static canBuyUpgrade(upgradeId: number): boolean { let prestigeUpgrade: PrestigeUpgrade = this.getUpgrade(upgradeId); - return !this.isUpgradeBought(upgradeId) && this.canReachUpgrade(upgradeId) && player.prestigePoints[prestigeUpgrade.costType] >= prestigeUpgrade.cost; + if (this.isUpgradeBought(upgradeId)) { + Notifier.notify("Already bought this upgrade", GameConstants.NotificationOption.danger); + return false; + } + if (!this.canReachUpgrade(upgradeId)) { + Notifier.notify("Can't reach this upgrade yet", GameConstants.NotificationOption.danger); + return false; + + } + if (player.prestigePoints[prestigeUpgrade.costType] < prestigeUpgrade.cost) { + Notifier.notify("Can't afford upgrade", GameConstants.NotificationOption.danger); + return false; + + } + return true; } @@ -74,8 +129,70 @@ class Prestige { */ public static initialize() { - // TODO - this.addUpgrade(new PrestigeUpgrade(1, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)) + // TODO add correct description and bonuses + this.addUpgrade(new PrestigeUpgrade(1, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(2, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(3, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(4, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(5, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(6, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(7, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(8, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(9, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(10, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(11, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(12, "Harvest time decreased by 33%", 6, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(13, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(14, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(15, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(16, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(17, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(18, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(19, "Harvest time decreased by 33%", 7, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(20, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(21, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(22, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(23, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(24, "Harvest time decreased by 33%", 5, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(25, "Harvest time decreased by 33%", 4, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(26, "Harvest time decreased by 33%", 6, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(27, "Harvest time decreased by 33%", 4, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(28, "Harvest time decreased by 33%", 5, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(29, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(30, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(31, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(32, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(33, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(34, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(35, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(36, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(37, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + } + + public static updateHTML() { + let html = ""; + for (let i = 0; i < this.upgradeLayout.length; i++) { + html += ""; + for (let j = 0; j < this.upgradeLayout[i].length; j++) { + let id = this.upgradeLayout[i][j]; + let cssClass = this.getUpgrade(id) !== undefined ? GameConstants.PrestigeType[this.getUpgrade(id).costType].toLocaleLowerCase() : "none"; + let opacity = "prestige-locked"; + if (this.isUpgradeBought(id) || id == 0) { + opacity = "" + } else if (this.canReachUpgrade(id)) { + opacity = "prestige-reachable"; + } + + + html += ""; + } + + html += ""; + } + + $("#prestige-modal-body").html(html) } } \ No newline at end of file diff --git a/src/styles/prestige.less b/src/styles/prestige.less new file mode 100644 index 00000000..4b349884 --- /dev/null +++ b/src/styles/prestige.less @@ -0,0 +1,44 @@ +.prestige-table { + width: 90%; +} +.prestige-table td { + width: 14.2857143%; + position: relative; +} +.prestige-table td:after { + content: ''; + display: block; + margin-top: 100%; +} +.prestige-upgrade { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.prestige-easy { + background-color: #333333; + border: 1px solid black; +} + +.prestige-medium { + background-color:white; + border: 1px solid black; +} + +.prestige-hard { + background-color:red; + border: 1px solid black; +} + +.prestige-locked { + filter: brightness(20%); +} + +.prestige-reachable { + filter: brightness(50%); + border: 4px solid blue; + +} \ No newline at end of file From b62a59d6c3cf238f0f03933413326b732769e7b1 Mon Sep 17 00:00:00 2001 From: IshaD Date: Tue, 27 Feb 2018 17:42:46 +0100 Subject: [PATCH 03/49] Prevent buying of empty upgrade --- src/scripts/Prestige/Prestige.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index ca8ab9ce..d5cfeb4e 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -54,7 +54,7 @@ class Prestige { */ public static buyUpgrade(upgradeId: number) { if(upgradeId == 0){ - + return; } if (this.canBuyUpgrade(upgradeId)) { player.prestigeUpgradesBought[upgradeId] = true; From 24ecd806298df4a31050dd29d90bd4b97703cf32 Mon Sep 17 00:00:00 2001 From: IshaD Date: Tue, 27 Feb 2018 19:15:26 +0100 Subject: [PATCH 04/49] Some color changes --- src/components/prestigeModal.html | 65 ------------------------------- src/scripts/Prestige/Prestige.ts | 2 - src/styles/prestige.less | 11 ++---- 3 files changed, 3 insertions(+), 75 deletions(-) diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html index ce3e2602..d70e5612 100644 --- a/src/components/prestigeModal.html +++ b/src/components/prestigeModal.html @@ -6,71 +6,6 @@ Header
"; + html += `
${id}
`; + html += "
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0
0
1
2
3
0
0
0
4
5
6
7
8
0
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
0
30
31
32
33
34
0
0
0
35
36
37
0
0
diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index d5cfeb4e..8a1ae5f8 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -38,13 +38,11 @@ class Prestige { } } - console.log(`${x},${y}`) let nb1 = this.upgradeLayout[GameConstants.normalize(y + 1, this.upgradeLayout.length-1)][GameConstants.normalize(x, this.upgradeLayout.length-1)]; let nb2 = this.upgradeLayout[GameConstants.normalize(y - 1, this.upgradeLayout.length-1)][GameConstants.normalize(x, this.upgradeLayout.length-1)]; let nb3 = this.upgradeLayout[GameConstants.normalize(y, this.upgradeLayout.length-1)][GameConstants.normalize(x + 1, this.upgradeLayout.length-1)]; let nb4 = this.upgradeLayout[GameConstants.normalize(y, this.upgradeLayout.length-1)][GameConstants.normalize(x - 1, this.upgradeLayout.length-1)]; - console.log(`${nb1}, ${nb2}, ${nb3}, ${nb4}`) return this.isUpgradeBought(nb1) || this.isUpgradeBought(nb2) || this.isUpgradeBought(nb3) || this.isUpgradeBought(nb4); } diff --git a/src/styles/prestige.less b/src/styles/prestige.less index 4b349884..cb6026a0 100644 --- a/src/styles/prestige.less +++ b/src/styles/prestige.less @@ -19,26 +19,21 @@ } .prestige-easy { - background-color: #333333; - border: 1px solid black; + background-color: black; } .prestige-medium { background-color:white; - border: 1px solid black; } .prestige-hard { background-color:red; - border: 1px solid black; } .prestige-locked { - filter: brightness(20%); + filter: contrast(10%); } .prestige-reachable { - filter: brightness(50%); - border: 4px solid blue; - + filter: contrast(45%); } \ No newline at end of file From 168e4e2dfdfa79964db65f9f99c97b0c5aed15ee Mon Sep 17 00:00:00 2001 From: IshaD Date: Tue, 6 Mar 2018 14:25:16 +0100 Subject: [PATCH 05/49] Finally make it look somewhat decent --- src/styles/prestige.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/styles/prestige.less b/src/styles/prestige.less index cb6026a0..f8e8f4f8 100644 --- a/src/styles/prestige.less +++ b/src/styles/prestige.less @@ -32,8 +32,10 @@ .prestige-locked { filter: contrast(10%); + z-index: 2; } .prestige-reachable { - filter: contrast(45%); + filter: contrast(10%) blur(0.5px); + z-index: 1; } \ No newline at end of file From 288266e8842619184f320b1e99c058254cd04c7a Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Sun, 25 Aug 2019 13:11:23 +1200 Subject: [PATCH 06/49] Fixups --- package.json | 2 +- src/scripts/GameConstants.ts | 2 +- src/scripts/dungeons/Dungeon.ts | 6 +++--- src/scripts/items/EvolutionStone.ts | 2 +- src/scripts/towns/Town.ts | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 454e4ff7..f6d7d315 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "gulp", "website": "gulp website", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "gulp scripts" }, "repository": { "type": "git", diff --git a/src/scripts/GameConstants.ts b/src/scripts/GameConstants.ts index e815635a..46f55aea 100644 --- a/src/scripts/GameConstants.ts +++ b/src/scripts/GameConstants.ts @@ -470,7 +470,7 @@ namespace GameConstants { 24: GameConstants.Badge.Cascade, }, 1: { - 28: GameConstants.Badge.JohtoChampion, + 28: GameConstants.Badge.Elite_JohtoChampion, 32: GameConstants.Badge.Zephyr, 34: GameConstants.Badge.Hive, 35: GameConstants.Badge.Plain, diff --git a/src/scripts/dungeons/Dungeon.ts b/src/scripts/dungeons/Dungeon.ts index 7d49899f..3e0f8111 100644 --- a/src/scripts/dungeons/Dungeon.ts +++ b/src/scripts/dungeons/Dungeon.ts @@ -133,7 +133,7 @@ dungeonList["Cerulean Cave"] = new Dungeon("Cerulean Cave", [GameConstants.BattleItemType.xAttack, GameConstants.BattleItemType.xClick, GameConstants.BattleItemType.xClick, GameConstants.BattleItemType.Lucky_incense], 28735, [new DungeonBossPokemon("Rhydon", 143675, 60), new DungeonBossPokemon("Mewtwo", 215512, 70)], - 2500, GameConstants.Badge.Champion, 20, 55 + 2500, GameConstants.Badge.Elite_Champion, 20, 55 ); dungeonList["Sprout Tower"] = new Dungeon("Sprout Tower", @@ -141,7 +141,7 @@ dungeonList["Sprout Tower"] = new Dungeon("Sprout Tower", [GameConstants.BattleItemType.xAttack, GameConstants.BattleItemType.xClick, GameConstants.BattleItemType.xAttack, GameConstants.BattleItemType.Item_magnet], 28735, [new DungeonBossPokemon("Bellsprout", 2000, 10)], - 2500, GameConstants.Badge.Champion, 31, 5 + 2500, GameConstants.Badge.Elite_Champion, 31, 5 ); dungeonList["Ruins of Alph"] = new Dungeon("Ruins of Alph", @@ -229,5 +229,5 @@ dungeonList["Mt Silver"] = new Dungeon("Mt Silver", [GameConstants.BattleItemType.xAttack, GameConstants.BattleItemType.xExp], 3500, [new DungeonBossPokemon("Larvitar", 12000, 60)], - 10000, GameConstants.Badge.Karen, 28, 50 + 10000, GameConstants.Badge.Elite_Karen, 28, 50 ); diff --git a/src/scripts/items/EvolutionStone.ts b/src/scripts/items/EvolutionStone.ts index 1ec7a346..7a7ecf75 100644 --- a/src/scripts/items/EvolutionStone.ts +++ b/src/scripts/items/EvolutionStone.ts @@ -25,7 +25,7 @@ class EvolutionStone extends Item { // Assume stones and evolutions in pokemonList are consistent in ordering let pkmObj = PokemonHelper.getPokemonByName(pokemon); let index = pkmObj.evoLevel.indexOf(GameConstants.StoneType[type]); - return pkmObj.evolutionByIndex(index); + return pkmObj.evolutionByIndex(index, true); } } diff --git a/src/scripts/towns/Town.ts b/src/scripts/towns/Town.ts index 08083a67..4e5ebde5 100644 --- a/src/scripts/towns/Town.ts +++ b/src/scripts/towns/Town.ts @@ -122,7 +122,7 @@ TownList["Power Plant"] = new DungeonTown("Power Plant", [9], GameConstants.Badg TownList["Pokemon Tower"] = new DungeonTown("Pokemon Tower", [10], GameConstants.Badge.Cascade); TownList["Seafoam Islands"] = new DungeonTown("Seafoam Islands", [19], GameConstants.Badge.Soul); TownList["Victory Road"] = new DungeonTown("Victory Road", [22], GameConstants.Badge.Earth); -TownList["Cerulean Cave"] = new DungeonTown("Cerulean Cave", [4], GameConstants.Badge.Champion); +TownList["Cerulean Cave"] = new DungeonTown("Cerulean Cave", [4], GameConstants.Badge.Elite_Champion); TownList["Pokemon Mansion"] = new DungeonTown("Pokemon Mansion", [20], GameConstants.Badge.Soul); //Johto Towns @@ -165,4 +165,4 @@ TownList["Whirl Islands"] = new DungeonTown("Whirl Islands", [41]); TownList["Mt Mortar"] = new DungeonTown("Mt Mortar", [42]); TownList["Ice Path"] = new DungeonTown("Ice Path", [44]); TownList["Dark Cave"] = new DungeonTown("Dark Cave", [45]); -TownList["Mt Silver"] = new DungeonTown("Mt Silver", [28], GameConstants.Badge.Karen); +TownList["Mt Silver"] = new DungeonTown("Mt Silver", [28], GameConstants.Badge.Elite_Karen); From d978691b903b65eace503f6c4dd5789bccb29fb2 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Sun, 25 Aug 2019 14:02:28 +1200 Subject: [PATCH 07/49] [shiny] Don't force masterball usage on new shiny, only use player selected pokeball --- src/scripts/Player.ts | 15 ++++++--------- src/scripts/dungeons/DungeonBattle.ts | 5 +++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/scripts/Player.ts b/src/scripts/Player.ts index 1e76f1aa..1050a4e6 100644 --- a/src/scripts/Player.ts +++ b/src/scripts/Player.ts @@ -358,21 +358,18 @@ class Player { * @param shiny if the pokémon is shiny. * @returns {GameConstants.Pokeball} pokéball to use. */ - public calculatePokeballToUse(alreadyCaught: boolean, shiny: boolean, alreadyCaughtShiny: boolean): GameConstants.Pokeball { + public calculatePokeballToUse(alreadyCaughtShiny: boolean, shiny: boolean): GameConstants.Pokeball { let pref: GameConstants.Pokeball; - if (alreadyCaught) { - pref = this._alreadyCaughtBallSelection(); - } else { + // just check against alreadyCaughtShiny as this returns false when you don't have the pokemon yet. + if (!alreadyCaughtShiny) { pref = this._notCaughtBallSelection(); - } - - // Always throw the highest available Pokéball at shinies - if (shiny && !alreadyCaughtShiny) { - pref = GameConstants.Pokeball.Masterball; + } else { + pref = this._alreadyCaughtBallSelection(); } let use: GameConstants.Pokeball = GameConstants.Pokeball.None; + // Check which Pokeballs we have in stock that are of equal or lesser than selection for (let i: number = pref; i >= 0; i--) { if (this._pokeballs[i]() > 0) { use = i; diff --git a/src/scripts/dungeons/DungeonBattle.ts b/src/scripts/dungeons/DungeonBattle.ts index ea0b42f2..aed92e97 100644 --- a/src/scripts/dungeons/DungeonBattle.ts +++ b/src/scripts/dungeons/DungeonBattle.ts @@ -13,8 +13,9 @@ class DungeonBattle extends Battle { DungeonRunner.map.currentTile().type(GameConstants.DungeonTile.empty); DungeonRunner.map.currentTile().calculateCssClass(); - let alreadyCaught: boolean = player.alreadyCaughtPokemon(this.enemyPokemon().name); - let pokeBall: GameConstants.Pokeball = player.calculatePokeballToUse(alreadyCaught); + const alreadyCaught: boolean = player.alreadyCaughtPokemonShiny(this.enemyPokemon().name); + const isShiny: boolean = this.enemyPokemon().shiny; + let pokeBall: GameConstants.Pokeball = player.calculatePokeballToUse(alreadyCaught, isShiny); if (pokeBall !== GameConstants.Pokeball.None) { this.prepareCatch(pokeBall); From fed4e8621d53aebf1a5a9d0179c95f57af4977c9 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Thu, 29 Aug 2019 12:15:28 +1200 Subject: [PATCH 08/49] Minor changes/Tidy up --- src/components/gameMenu.html | 3 + src/components/prestigeModal.html | 7 +-- src/scripts/Prestige/Prestige.ts | 101 +++++++++++++++--------------- 3 files changed, 55 insertions(+), 56 deletions(-) diff --git a/src/components/gameMenu.html b/src/components/gameMenu.html index 9247c223..780cf7bb 100644 --- a/src/components/gameMenu.html +++ b/src/components/gameMenu.html @@ -22,6 +22,9 @@
  • Items
  • +
  • + Prestige +
  • Settings
  • diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html index d70e5612..b48d161c 100644 --- a/src/components/prestigeModal.html +++ b/src/components/prestigeModal.html @@ -2,17 +2,12 @@ - \ No newline at end of file + diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 8a1ae5f8..3f82e2ef 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -92,16 +92,16 @@ class Prestige { public static canBuyUpgrade(upgradeId: number): boolean { let prestigeUpgrade: PrestigeUpgrade = this.getUpgrade(upgradeId); if (this.isUpgradeBought(upgradeId)) { - Notifier.notify("Already bought this upgrade", GameConstants.NotificationOption.danger); + Notifier.notify('Already bought this upgrade', GameConstants.NotificationOption.danger); return false; } if (!this.canReachUpgrade(upgradeId)) { - Notifier.notify("Can't reach this upgrade yet", GameConstants.NotificationOption.danger); + Notifier.notify('Can't reach this upgrade yet', GameConstants.NotificationOption.danger); return false; } if (player.prestigePoints[prestigeUpgrade.costType] < prestigeUpgrade.cost) { - Notifier.notify("Can't afford upgrade", GameConstants.NotificationOption.danger); + Notifier.notify('Can't afford upgrade', GameConstants.NotificationOption.danger); return false; } @@ -128,69 +128,70 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses - this.addUpgrade(new PrestigeUpgrade(1, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(2, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(3, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(4, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(5, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(6, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(7, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(8, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(9, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(10, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(11, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(12, "Harvest time decreased by 33%", 6, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(13, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(14, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(15, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(16, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(17, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(18, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(19, "Harvest time decreased by 33%", 7, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(20, "Harvest time decreased by 33%", 3, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(21, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(22, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(23, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(24, "Harvest time decreased by 33%", 5, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(25, "Harvest time decreased by 33%", 4, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(26, "Harvest time decreased by 33%", 6, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(27, "Harvest time decreased by 33%", 4, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(28, "Harvest time decreased by 33%", 5, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(29, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(30, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(31, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(32, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(33, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(34, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(35, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(36, "Harvest time decreased by 33%", 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(37, "Harvest time decreased by 33%", 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(1, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(2, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(3, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(4, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(5, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(6, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(7, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(8, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(9, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(10, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(11, 'Harvest time decreased by 33%', 3, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(12, 'Harvest time decreased by 33%', 6, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(13, 'Harvest time decreased by 33%', 3, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(14, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Hard, -0.33)); + this.addUpgrade(new PrestigeUpgrade(15, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(16, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(17, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(18, 'Harvest time decreased by 33%', 3, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(19, 'Harvest time decreased by 33%', 7, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(20, 'Harvest time decreased by 33%', 3, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(21, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(22, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(23, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(24, 'Harvest time decreased by 33%', 5, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(25, 'Harvest time decreased by 33%', 4, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(26, 'Harvest time decreased by 33%', 6, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(27, 'Harvest time decreased by 33%', 4, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(28, 'Harvest time decreased by 33%', 5, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(29, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(30, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(31, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(32, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(33, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Medium, -0.33)); + this.addUpgrade(new PrestigeUpgrade(34, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(35, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(36, 'Harvest time decreased by 33%', 1, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(37, 'Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); } public static updateHTML() { - let html = ""; + let html = '
    '; for (let i = 0; i < this.upgradeLayout.length; i++) { html += ""; for (let j = 0; j < this.upgradeLayout[i].length; j++) { let id = this.upgradeLayout[i][j]; - let cssClass = this.getUpgrade(id) !== undefined ? GameConstants.PrestigeType[this.getUpgrade(id).costType].toLocaleLowerCase() : "none"; - let opacity = "prestige-locked"; + let cssClass = this.getUpgrade(id) !== undefined ? GameConstants.PrestigeType[this.getUpgrade(id).costType].toLocaleLowerCase() : 'none'; + let opacity = 'prestige-locked'; if (this.isUpgradeBought(id) || id == 0) { - opacity = "" + opacity = '' } else if (this.canReachUpgrade(id)) { - opacity = "prestige-reachable"; + opacity = 'prestige-reachable'; } - html += ""; + html += ''; } - html += ""; + html += ''; } + html += '
    "; + html += ''; html += `
    ${id}
    `; - html += "
    '; - $("#prestige-modal-body").html(html) + $('#prestige-modal-body').html(html) } -} \ No newline at end of file +} From 1d2c48e4fdbbb1f1f156e48735b91f1e00f9c60f Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Thu, 29 Aug 2019 12:16:10 +1200 Subject: [PATCH 09/49] fixup --- src/scripts/Prestige/Prestige.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 3f82e2ef..59060c7b 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -96,12 +96,12 @@ class Prestige { return false; } if (!this.canReachUpgrade(upgradeId)) { - Notifier.notify('Can't reach this upgrade yet', GameConstants.NotificationOption.danger); + Notifier.notify(`Can't reach this upgrade yet`, GameConstants.NotificationOption.danger); return false; } if (player.prestigePoints[prestigeUpgrade.costType] < prestigeUpgrade.cost) { - Notifier.notify('Can't afford upgrade', GameConstants.NotificationOption.danger); + Notifier.notify(`Can't afford upgrade`, GameConstants.NotificationOption.danger); return false; } From b3b2a4fe4a027e29cb15c9e674ee37424486b945 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Thu, 29 Aug 2019 13:23:48 +1200 Subject: [PATCH 10/49] prestige, bind to observables --- src/components/prestigeModal.html | 20 ++++++++++++++++++++ src/scripts/Player.ts | 5 ++++- src/scripts/Prestige/Prestige.ts | 18 +++++++++++++++--- src/styles/prestige.less | 9 +++++---- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html index b48d161c..6a5986e4 100644 --- a/src/components/prestigeModal.html +++ b/src/components/prestigeModal.html @@ -4,6 +4,26 @@ - \ No newline at end of file + diff --git a/src/components/receiveGymBadge.html b/src/components/receiveGymBadge.html index 43daf870..cef079f1 100644 --- a/src/components/receiveGymBadge.html +++ b/src/components/receiveGymBadge.html @@ -17,19 +17,11 @@ data-bind="attr:{ src: 'assets/images/badges/' + GymRunner.gymObservable().leaderName + '.png'}, visible: !GameConstants.Badge[GymRunner.gymObservable().badgeReward].startsWith('Elite')"> -
    +
    -
    - -
    diff --git a/src/scripts/gym/GymRunner.ts b/src/scripts/gym/GymRunner.ts index c9410a32..4e687deb 100644 --- a/src/scripts/gym/GymRunner.ts +++ b/src/scripts/gym/GymRunner.ts @@ -83,9 +83,13 @@ document.addEventListener("DOMContentLoaded", function (event) { $('#receiveBadgeModal').on('hidden.bs.modal', function () { - if(GymBattle.gym.badgeReward == GameConstants.Badge.Soul){ - player.gainKeyItem("Safari ticket"); - } + if(GymBattle.gym.badgeReward == GameConstants.Badge.Soul){ + player.gainKeyItem("Safari ticket"); + } + + if (GymRunner.gymObservable() instanceof Champion) { + $('#hallOfFameModal').modal('show'); + } }); }); From 20b493953f170365d7b74c02d7696e125fb12b65 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 11:53:33 +1200 Subject: [PATCH 35/49] Update prestige modal message --- src/components/prestigeModal.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html index 5b0a3e5f..49183b1c 100644 --- a/src/components/prestigeModal.html +++ b/src/components/prestigeModal.html @@ -37,7 +37,8 @@

    Prestige

    -

    Here you can reset your progress in order to gain 1 prestige point in your current difficulty ().

    +

    Here you can reset your progress in order to gain prestige points in your current difficulty ().

    +

    The amount of points gained is based on beating the Elite 4 Champion in each region

    The points gained from Prestiging can be used to buy Upgrades which will affect your gameplay in various ways.

    When you prestige, most of your progress will be reset to the beginning of the game.

    The following will not be reset:

    From 3895be692597f8a44dfc9ddabb5eab2741ac0834 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 14:18:38 +1200 Subject: [PATCH 36/49] update prestige modal message --- src/components/prestigeModal.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/prestigeModal.html b/src/components/prestigeModal.html index 49183b1c..ebf50e8f 100644 --- a/src/components/prestigeModal.html +++ b/src/components/prestigeModal.html @@ -37,10 +37,10 @@

    Prestige

    -

    Here you can reset your progress in order to gain prestige points in your current difficulty ().

    -

    The amount of points gained is based on beating the Elite 4 Champion in each region

    -

    The points gained from Prestiging can be used to buy Upgrades which will affect your gameplay in various ways.

    -

    When you prestige, most of your progress will be reset to the beginning of the game.

    +

    Here you can reset your progress in order to gain prestige points in your current difficulty (). +
    The amount of points gained is based on beating the Elite 4 Champion in each region +
    The points gained from Prestiging can be used to buy Upgrades which will affect your gameplay in various ways. +
    When you prestige, most of your progress will be reset to the beginning of the game.

    The following will not be reset:

    Shiny Pokemon
    Oak item xp/level
    From ae0c2a616b42208a9e1db4682145aa70b9d698e2 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 14:30:33 +1200 Subject: [PATCH 37/49] update Prestige Bonus amounts --- src/scripts/Prestige/Prestige.ts | 74 ++++++++++++------------- src/scripts/Prestige/PrestigeBonuses.ts | 2 +- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 928a891f..778a5a17 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -171,43 +171,43 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses - this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(11, '[General]
    Routekills required decreased to 8', 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(12, '[Quest]
    Unlock +1 quest slot', 3, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(14, '[Quest]
    Quest skip cost halved', 2, GameConstants.PrestigeType.Hard, -0.33)); - this.addUpgrade(new PrestigeUpgrade(15, '[Safari Zone]
    Max steps +200', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(16, '[General]
    Gain 10% more exp', 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(17, '[General]
    Seed droprate + 20%', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(18, '[Dungeons]
    Dungeons contain +1 treasure', 3, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(19, '[General]
    Catch time -250ms', 7, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(20, '[Breeding]
    Egg slot cost halved', 3, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(21, '[Oak Items]
    Oak item xp gain increased by 30%', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(22, '[General]
    Gain 20% more money', 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(23, '[Dungeons]
    Dungeon enemies drop 3 more shards', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(24, '[Gyms]
    Gym time limit is +10s', 5, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(25, '[Breeding]
    Hatched Pokémon start at level 50', 4, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(26, '[Underground]
    Energy regen time -10s', 6, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(27, '[General]
    Encounter 25% more shinies', 4, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(31, '[Underground]
    Max energy +50', 2, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(32, '[Farm]
    Berry gain +20%', 1, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, -0.33)); - this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, -0.33)); - this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, -0.33)); + this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, 0.77)); + this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); + this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); + this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); + this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); + this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); + this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 000)); + this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, 1.2)); + this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, 000)); + this.addUpgrade(new PrestigeUpgrade(11, '[General]
    Routekills required decreased by 20%', 2, GameConstants.PrestigeType.Hard, 0.8)); + this.addUpgrade(new PrestigeUpgrade(12, '[Quest]
    Unlock +1 quest slot', 3, GameConstants.PrestigeType.Easy, 1)); + this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, 000)); + this.addUpgrade(new PrestigeUpgrade(14, '[Quest]
    Quest skip cost halved', 2, GameConstants.PrestigeType.Hard, 0.5)); + this.addUpgrade(new PrestigeUpgrade(15, '[Safari Zone]
    Max steps +200', 2, GameConstants.PrestigeType.Easy, 200)); + this.addUpgrade(new PrestigeUpgrade(16, '[General]
    Gain 10% more exp', 1, GameConstants.PrestigeType.Easy, 1.1)); + this.addUpgrade(new PrestigeUpgrade(17, '[General]
    Seed droprate + 20%', 2, GameConstants.PrestigeType.Easy, 1.2)); + this.addUpgrade(new PrestigeUpgrade(18, '[Dungeons]
    Dungeons contain +1 treasure', 3, GameConstants.PrestigeType.Easy, 1)); + this.addUpgrade(new PrestigeUpgrade(19, '[General]
    Catch time -250ms', 7, GameConstants.PrestigeType.Medium, -250)); + this.addUpgrade(new PrestigeUpgrade(20, '[Breeding]
    Egg slot cost halved', 3, GameConstants.PrestigeType.Easy, 0.5)); + this.addUpgrade(new PrestigeUpgrade(21, '[Oak Items]
    Oak item xp gain increased by 30%', 2, GameConstants.PrestigeType.Easy, 1.3)); + this.addUpgrade(new PrestigeUpgrade(22, '[General]
    Gain 20% more money', 1, GameConstants.PrestigeType.Easy, 1.2)); + this.addUpgrade(new PrestigeUpgrade(23, '[Dungeons]
    Dungeon enemies drop 3 more shards', 2, GameConstants.PrestigeType.Easy, 3)); + this.addUpgrade(new PrestigeUpgrade(24, '[Gyms]
    Gym time limit is +10s', 5, GameConstants.PrestigeType.Medium, 1e4)); + this.addUpgrade(new PrestigeUpgrade(25, '[Breeding]
    Hatched Pokémon start at level 50', 4, GameConstants.PrestigeType.Medium, 50)); + this.addUpgrade(new PrestigeUpgrade(26, '[Underground]
    Energy regen time -10s', 6, GameConstants.PrestigeType.Easy, -1e4)); + this.addUpgrade(new PrestigeUpgrade(27, '[General]
    Encounter 25% more shinies', 4, GameConstants.PrestigeType.Medium, 1.25)); + this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, 000)); + this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(31, '[Underground]
    Max energy +50', 2, GameConstants.PrestigeType.Medium, 50)); + this.addUpgrade(new PrestigeUpgrade(32, '[Farm]
    Harvest Berry gain +20%', 1, GameConstants.PrestigeType.Medium, 1.2)); + this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, 1.1)); + this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, 1.25)); + this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 1.1)); + this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 000)); } public static isLocked(upgradeId: number) { diff --git a/src/scripts/Prestige/PrestigeBonuses.ts b/src/scripts/Prestige/PrestigeBonuses.ts index 5ba52a33..6a47d147 100644 --- a/src/scripts/Prestige/PrestigeBonuses.ts +++ b/src/scripts/Prestige/PrestigeBonuses.ts @@ -7,7 +7,7 @@ class PrestigeBonuses { * Return the bonus if the upgrade is bought, 1 otherwise */ public static getBonus(upgradeId){ - return Prestige.isUpgradeBought(upgradeId) ? (1+Prestige.getUpgrade(upgradeId).bonus) : 0 + return Prestige.isUpgradeBought(upgradeId) ? Prestige.getUpgrade(upgradeId).bonus : 0 } /** From f7e1a074d931b1b7c910377859acb888500ad0b8 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 14:31:10 +1200 Subject: [PATCH 38/49] 000 -> 0 --- src/scripts/Prestige/Prestige.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 778a5a17..fff94a75 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -177,13 +177,13 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); - this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 000)); - this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); + this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 0)); this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, 1.2)); - this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, 000)); + this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, 0)); this.addUpgrade(new PrestigeUpgrade(11, '[General]
    Routekills required decreased by 20%', 2, GameConstants.PrestigeType.Hard, 0.8)); this.addUpgrade(new PrestigeUpgrade(12, '[Quest]
    Unlock +1 quest slot', 3, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, 000)); + this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, 0)); this.addUpgrade(new PrestigeUpgrade(14, '[Quest]
    Quest skip cost halved', 2, GameConstants.PrestigeType.Hard, 0.5)); this.addUpgrade(new PrestigeUpgrade(15, '[Safari Zone]
    Max steps +200', 2, GameConstants.PrestigeType.Easy, 200)); this.addUpgrade(new PrestigeUpgrade(16, '[General]
    Gain 10% more exp', 1, GameConstants.PrestigeType.Easy, 1.1)); @@ -198,16 +198,16 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(25, '[Breeding]
    Hatched Pokémon start at level 50', 4, GameConstants.PrestigeType.Medium, 50)); this.addUpgrade(new PrestigeUpgrade(26, '[Underground]
    Energy regen time -10s', 6, GameConstants.PrestigeType.Easy, -1e4)); this.addUpgrade(new PrestigeUpgrade(27, '[General]
    Encounter 25% more shinies', 4, GameConstants.PrestigeType.Medium, 1.25)); - this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, 000)); - this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, 000)); - this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, 0)); + this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, 0)); + this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, 0)); this.addUpgrade(new PrestigeUpgrade(31, '[Underground]
    Max energy +50', 2, GameConstants.PrestigeType.Medium, 50)); this.addUpgrade(new PrestigeUpgrade(32, '[Farm]
    Harvest Berry gain +20%', 1, GameConstants.PrestigeType.Medium, 1.2)); this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, 1.1)); - this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 0)); this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, 1.25)); this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 1.1)); - this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 000)); + this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 0)); } public static isLocked(upgradeId: number) { From 0e9fdcb5932b4f66b67236a55e4a9fff92814418 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 14:47:29 +1200 Subject: [PATCH 39/49] Add notes to unimplemented prestige bonuses --- src/scripts/Prestige/Prestige.ts | 74 ++++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index fff94a75..4235ab20 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -171,43 +171,43 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses - this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, 0.77)); - this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); - this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); - this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); - this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); - this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 0)); - this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, 1.2)); - this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, 0)); - this.addUpgrade(new PrestigeUpgrade(11, '[General]
    Routekills required decreased by 20%', 2, GameConstants.PrestigeType.Hard, 0.8)); - this.addUpgrade(new PrestigeUpgrade(12, '[Quest]
    Unlock +1 quest slot', 3, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, 0)); - this.addUpgrade(new PrestigeUpgrade(14, '[Quest]
    Quest skip cost halved', 2, GameConstants.PrestigeType.Hard, 0.5)); - this.addUpgrade(new PrestigeUpgrade(15, '[Safari Zone]
    Max steps +200', 2, GameConstants.PrestigeType.Easy, 200)); - this.addUpgrade(new PrestigeUpgrade(16, '[General]
    Gain 10% more exp', 1, GameConstants.PrestigeType.Easy, 1.1)); - this.addUpgrade(new PrestigeUpgrade(17, '[General]
    Seed droprate + 20%', 2, GameConstants.PrestigeType.Easy, 1.2)); - this.addUpgrade(new PrestigeUpgrade(18, '[Dungeons]
    Dungeons contain +1 treasure', 3, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(19, '[General]
    Catch time -250ms', 7, GameConstants.PrestigeType.Medium, -250)); - this.addUpgrade(new PrestigeUpgrade(20, '[Breeding]
    Egg slot cost halved', 3, GameConstants.PrestigeType.Easy, 0.5)); - this.addUpgrade(new PrestigeUpgrade(21, '[Oak Items]
    Oak item xp gain increased by 30%', 2, GameConstants.PrestigeType.Easy, 1.3)); - this.addUpgrade(new PrestigeUpgrade(22, '[General]
    Gain 20% more money', 1, GameConstants.PrestigeType.Easy, 1.2)); - this.addUpgrade(new PrestigeUpgrade(23, '[Dungeons]
    Dungeon enemies drop 3 more shards', 2, GameConstants.PrestigeType.Easy, 3)); - this.addUpgrade(new PrestigeUpgrade(24, '[Gyms]
    Gym time limit is +10s', 5, GameConstants.PrestigeType.Medium, 1e4)); - this.addUpgrade(new PrestigeUpgrade(25, '[Breeding]
    Hatched Pokémon start at level 50', 4, GameConstants.PrestigeType.Medium, 50)); - this.addUpgrade(new PrestigeUpgrade(26, '[Underground]
    Energy regen time -10s', 6, GameConstants.PrestigeType.Easy, -1e4)); - this.addUpgrade(new PrestigeUpgrade(27, '[General]
    Encounter 25% more shinies', 4, GameConstants.PrestigeType.Medium, 1.25)); - this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, 0)); - this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, 0)); - this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, 0)); - this.addUpgrade(new PrestigeUpgrade(31, '[Underground]
    Max energy +50', 2, GameConstants.PrestigeType.Medium, 50)); - this.addUpgrade(new PrestigeUpgrade(32, '[Farm]
    Harvest Berry gain +20%', 1, GameConstants.PrestigeType.Medium, 1.2)); - this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, 1.1)); - this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 0)); - this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, 1.25)); - this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 1.1)); - this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 0)); + this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, 0.77)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, 1.2)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(10, '______', 6, GameConstants.PrestigeType.Hard, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(11, '[General]
    Routekills required decreased by 20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(12, '[Quest]
    Unlock +1 quest slot', 3, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(13, '______', 3, GameConstants.PrestigeType.Hard, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(14, '[Quest]
    Quest skip cost halved', 2, GameConstants.PrestigeType.Hard, 0.5)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(15, '[Safari Zone]
    Max steps +200', 2, GameConstants.PrestigeType.Easy, 200)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(16, '[General]
    Gain 10% more exp', 1, GameConstants.PrestigeType.Easy, 1.1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(17, '[General]
    Seed droprate + 20%', 2, GameConstants.PrestigeType.Easy, 1.2)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(18, '[Dungeons]
    Dungeons contain +1 treasure', 3, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(19, '[General]
    Catch time -250ms', 7, GameConstants.PrestigeType.Medium, -250)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(20, '[Breeding]
    Egg slot cost halved', 3, GameConstants.PrestigeType.Easy, 0.5)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(21, '[Oak Items]
    Oak item xp gain increased by 30%', 2, GameConstants.PrestigeType.Easy, 1.3)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(22, '[General]
    Gain 20% more money', 1, GameConstants.PrestigeType.Easy, 1.2)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(23, '[Dungeons]
    Dungeon enemies drop 3 more shards', 2, GameConstants.PrestigeType.Easy, 3)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(24, '[Gyms]
    Gym time limit is +10s', 5, GameConstants.PrestigeType.Medium, 1e4)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(25, '[Breeding]
    Hatched Pokémon start at level 50', 4, GameConstants.PrestigeType.Medium, 50)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(26, '[Underground]
    Energy regen time -10s', 6, GameConstants.PrestigeType.Easy, -1e4)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(27, '[General]
    Encounter 25% more shinies', 4, GameConstants.PrestigeType.Medium, 1.25)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(28, '______', 5, GameConstants.PrestigeType.Medium, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(29, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(30, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(31, '[Underground]
    Max energy +50', 2, GameConstants.PrestigeType.Medium, 50)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(32, '[Farm]
    Harvest Berry gain +20%', 1, GameConstants.PrestigeType.Medium, 1.2)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, 1.1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, 1.25)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 1.1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus } public static isLocked(upgradeId: number) { From b2bb689565d10aecb7db03b155042d69342fc2dc Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 15:55:11 +1200 Subject: [PATCH 40/49] add new bonus methods --- src/scripts/Prestige/PrestigeBonuses.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/scripts/Prestige/PrestigeBonuses.ts b/src/scripts/Prestige/PrestigeBonuses.ts index 6a47d147..d0fd2f36 100644 --- a/src/scripts/Prestige/PrestigeBonuses.ts +++ b/src/scripts/Prestige/PrestigeBonuses.ts @@ -7,7 +7,15 @@ class PrestigeBonuses { * Return the bonus if the upgrade is bought, 1 otherwise */ public static getBonus(upgradeId){ - return Prestige.isUpgradeBought(upgradeId) ? Prestige.getUpgrade(upgradeId).bonus : 0 + return Math.round(Prestige.getUpgrade(upgradeId).bonus) != Prestige.getUpgrade(upgradeId).bonus ? this.getPercentageBonus(upgradeId) : this.getAddBonus(upgradeId); + } + + public static getPercentageBonus(upgradeId){ + return Prestige.isUpgradeBought(upgradeId) ? Prestige.getUpgrade(upgradeId).bonus : 1; + } + + public static getAddBonus(upgradeId){ + return Prestige.isUpgradeBought(upgradeId) ? Prestige.getUpgrade(upgradeId).bonus : 0; } /** From cdf1337853ca7a350567e8de74149ea160cfe31d Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 16:01:07 +1200 Subject: [PATCH 41/49] Add prestige bonus to catch bonus --- src/scripts/Battle.ts | 13 ++++++++++--- src/scripts/Prestige/Prestige.ts | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/scripts/Battle.ts b/src/scripts/Battle.ts index 3cd0c009..b55efb8d 100644 --- a/src/scripts/Battle.ts +++ b/src/scripts/Battle.ts @@ -90,10 +90,17 @@ class Battle { } protected static calculateActualCatchRate(pokeBall: GameConstants.Pokeball) { - let pokeballBonus = GameConstants.getCatchBonus(pokeBall); - let oakBonus = OakItemRunner.isActive(GameConstants.OakItem.Magic_Ball) ? + // Each of the bonuses is added on, not multiplied (20+5+10+10) + let catchRate = this.enemyPokemon().catchRate; + // Pokeball bonus + catchRate += GameConstants.getCatchBonus(pokeBall); + // Oak item bonus + catchRate += OakItemRunner.isActive(GameConstants.OakItem.Magic_Ball) ? OakItemRunner.calculateBonus(GameConstants.OakItem.Magic_Ball) : 0; - let totalChance = GameConstants.clipNumber(this.enemyPokemon().catchRate + pokeballBonus + oakBonus, 0, 100); + // Prestige bonus + catchRate += PrestigeBonuses.getBonus(36); + // Limit the catch chance to 0-100 + const totalChance = GameConstants.clipNumber(catchRate, 0, 100); return totalChance; } diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 4235ab20..75b2431f 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -206,7 +206,7 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(33, '[Breeding]
    Breeding increases attack with +10%', 2, GameConstants.PrestigeType.Medium, 1.1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(34, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(35, '[Quest]
    Gain 25% more quest points', 2, GameConstants.PrestigeType.Easy, 1.25)); // To implement bonus - this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 1.1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(36, '[General]
    Catch rate +10%', 1, GameConstants.PrestigeType.Easy, 10)); this.addUpgrade(new PrestigeUpgrade(37, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus } From 9e4c19dafdd6358aa8fd7881a0cf35d0438cad18 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 16:40:12 +1200 Subject: [PATCH 42/49] Add prestige 1 --- src/scripts/Prestige/Prestige.ts | 4 ++-- src/scripts/farm/FarmRunner.ts | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 75b2431f..31bd50b1 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -72,7 +72,7 @@ class Prestige { * Check if an upgrade is bought. */ public static isUpgradeBought(upgradeId: number): boolean { - return player.prestigeUpgradesBought[upgradeId](); + return player ? player.prestigeUpgradesBought[upgradeId]() : false; } @@ -171,7 +171,7 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses - this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 33%', 2, GameConstants.PrestigeType.Easy, 0.77)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 20%', 2, GameConstants.PrestigeType.Easy, 20)); this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus diff --git a/src/scripts/farm/FarmRunner.ts b/src/scripts/farm/FarmRunner.ts index c7d9d9e7..72ddb95c 100644 --- a/src/scripts/farm/FarmRunner.ts +++ b/src/scripts/farm/FarmRunner.ts @@ -18,9 +18,10 @@ class FarmRunner { } public static timeToReduce(){ - let oakItemBonus = OakItemRunner.isActive(GameConstants.OakItem.Sprayduck) ? OakItemRunner.calculateBonus(GameConstants.OakItem.Sprayduck) / 100 : 0; - oakItemBonus = 1 - oakItemBonus; - return Math.round(100 / oakItemBonus) / 100; + const oakItemBonus = OakItemRunner.isActive(GameConstants.OakItem.Sprayduck) ? OakItemRunner.calculateBonus(GameConstants.OakItem.Sprayduck) : 0 + const prestigeBonus = PrestigeBonuses.getBonus(1); + const bonus = 1 - ((oakItemBonus + prestigeBonus) / 100); + return Math.round(100 / bonus) / 100; } public static tick() { From 91ace0ba1c8d78dd88932cdb29cf1b98c5527bbc Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 16:49:08 +1200 Subject: [PATCH 43/49] Add bonus 2 --- src/scripts/Player.ts | 3 ++- src/scripts/Prestige/Prestige.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/Player.ts b/src/scripts/Player.ts index eae5e508..db6b15a4 100644 --- a/src/scripts/Player.ts +++ b/src/scripts/Player.ts @@ -667,9 +667,10 @@ class Player { } public gainDungeonTokens(tokens: number) { + tokens = Math.round(tokens * PrestigeBonuses.getBonus(2)); this._dungeonTokens(Math.floor(this._dungeonTokens() + tokens)); GameHelper.incrementObservable(this.statistics.totalTokens, tokens); - Game.animateMoney(tokens,'playerMoneyDungeon'); + Game.animateMoney(tokens, 'playerMoneyDungeon'); } get routeKills(): Array> { diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 31bd50b1..018000a9 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -172,8 +172,8 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 20%', 2, GameConstants.PrestigeType.Easy, 20)); - this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); // To implement bonus From 8d695ea7baecafe1c7799a21b27d889a0d946649 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 16:49:18 +1200 Subject: [PATCH 44/49] Add bonus 3 --- src/scripts/Prestige/Prestige.ts | 2 +- src/scripts/underground/Underground.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 018000a9..8e0c3ed4 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -172,8 +172,8 @@ class Prestige { public static initialize() { // TODO add correct description and bonuses this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 20%', 2, GameConstants.PrestigeType.Easy, 20)); - this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); + this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); // To implement bonus diff --git a/src/scripts/underground/Underground.ts b/src/scripts/underground/Underground.ts index fd8d7d44..6f7d811b 100644 --- a/src/scripts/underground/Underground.ts +++ b/src/scripts/underground/Underground.ts @@ -25,7 +25,7 @@ class Underground { } public static getDailyDealsMax() { - return Underground.BASE_DAILY_DEALS_MAX + this.getUpgrade(Underground.Upgrades.Daily_Deals_Max).calculateBonus(); + return Underground.BASE_DAILY_DEALS_MAX + this.getUpgrade(Underground.Upgrades.Daily_Deals_Max).calculateBonus() + PrestigeBonuses.getBonus(3); } From 8a68a0452aaaa464bb6dc6e47687a0f69eb605c0 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 16:51:24 +1200 Subject: [PATCH 45/49] Add prestige 4 --- src/scripts/Prestige/Prestige.ts | 2 +- src/scripts/underground/Underground.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 8e0c3ed4..5109e54c 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -174,7 +174,7 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(1, '[Farm]
    Harvest time decreased by 20%', 2, GameConstants.PrestigeType.Easy, 20)); this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); // To implement bonus diff --git a/src/scripts/underground/Underground.ts b/src/scripts/underground/Underground.ts index 6f7d811b..bdbe38fa 100644 --- a/src/scripts/underground/Underground.ts +++ b/src/scripts/underground/Underground.ts @@ -13,7 +13,7 @@ class Underground { } public static getMaxItems() { - return Underground.BASE_ITEMS_MAX + this.getUpgrade(Underground.Upgrades.Items_Max).calculateBonus(); + return Underground.BASE_ITEMS_MAX + this.getUpgrade(Underground.Upgrades.Items_Max).calculateBonus() + PrestigeBonuses.getBonus(4); } public static getEnergyGain() { From 1f2f8fc06d030ec878b5de9559dbc2b3036298de Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 17:02:38 +1200 Subject: [PATCH 46/49] Add prestige bonus 6 --- src/scripts/Prestige/Prestige.ts | 2 +- src/scripts/underground/Mine.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 5109e54c..bc06894f 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -176,7 +176,7 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus - this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(9, '[Farm]
    Fertilizer effect +20%', 2, GameConstants.PrestigeType.Easy, 1.2)); // To implement bonus diff --git a/src/scripts/underground/Mine.ts b/src/scripts/underground/Mine.ts index 121ba908..5022ab20 100644 --- a/src/scripts/underground/Mine.ts +++ b/src/scripts/underground/Mine.ts @@ -125,7 +125,7 @@ class Mine { private static chisel(x: number, y: number) { if (Mine.grid[x][y]() > 0) { if (Underground.energy >= Underground.CHISEL_ENERGY) { - Mine.grid[Mine.normalizeY(x)][Mine.normalizeX(y)](Math.max(0, Mine.grid[Mine.normalizeY(x)][Mine.normalizeX(y)]() - 2)); + Mine.grid[Mine.normalizeY(x)][Mine.normalizeX(y)](Math.max(0, Mine.grid[Mine.normalizeY(x)][Mine.normalizeX(y)]() - (2 + PrestigeBonuses.getBonus(6)))); Underground.energy = Underground.energy - Underground.CHISEL_ENERGY; } } From 29f1a2eb0d68b8ef9061cc23119330d62e37beb1 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 17:04:34 +1200 Subject: [PATCH 47/49] Add prestige bonus 5 --- src/scripts/Prestige/Prestige.ts | 2 +- src/scripts/safari/SafariBattle.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index bc06894f..1d0188a9 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -175,7 +175,7 @@ class Prestige { this.addUpgrade(new PrestigeUpgrade(2, '[General]
    Gain 30% more dungeon tokens', 1, GameConstants.PrestigeType.Easy, 1.3)); this.addUpgrade(new PrestigeUpgrade(3, '[Underground]
    Max daily deals +1', 2, GameConstants.PrestigeType.Easy, 1)); this.addUpgrade(new PrestigeUpgrade(4, '[Underground]
    Max treasures +1', 2, GameConstants.PrestigeType.Easy, 1)); - this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 0.8)); // To implement bonus + this.addUpgrade(new PrestigeUpgrade(5, '[Safari Zone]
    Flee chance -20%', 2, GameConstants.PrestigeType.Hard, 20)); this.addUpgrade(new PrestigeUpgrade(6, '[Underground]
    Chisel damage +1', 1, GameConstants.PrestigeType.Hard, 1)); this.addUpgrade(new PrestigeUpgrade(7, '______', 2, GameConstants.PrestigeType.Hard, 0)); // To implement bonus this.addUpgrade(new PrestigeUpgrade(8, '______', 2, GameConstants.PrestigeType.Easy, 0)); // To implement bonus diff --git a/src/scripts/safari/SafariBattle.ts b/src/scripts/safari/SafariBattle.ts index 67fb72b3..3dfc70fd 100644 --- a/src/scripts/safari/SafariBattle.ts +++ b/src/scripts/safari/SafariBattle.ts @@ -71,7 +71,8 @@ class SafariBattle { setTimeout(function(){ const oakBonus = OakItemRunner.isActive(GameConstants.OakItem.Magic_Ball) ? OakItemRunner.calculateBonus(GameConstants.OakItem.Magic_Ball) : 0; - if (random * 100 < SafariBattle.enemy.catchFactor + oakBonus){ + const prestigeBonus = PrestigeBonuses.getBonus(5); + if (random * 100 < SafariBattle.enemy.catchFactor + oakBonus + prestigeBonus){ SafariBattle.capturePokemon(); $('#safariBall').css('filter', 'brightness(0.4) grayscale(100%)'); setTimeout(function(){ From 3975ae3c27def7d941496c1917c9773533dcc0c9 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Fri, 6 Sep 2019 17:08:14 +1200 Subject: [PATCH 48/49] fixup --- src/scripts/Prestige/Prestige.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Prestige/Prestige.ts b/src/scripts/Prestige/Prestige.ts index 1d0188a9..a2a4070b 100644 --- a/src/scripts/Prestige/Prestige.ts +++ b/src/scripts/Prestige/Prestige.ts @@ -113,7 +113,7 @@ class Prestige { public static prestigePointsEarned(){ switch(true){ - case player.hasBadge(GameConstants.Badge.Elite_JohtoChampion);: + case player.hasBadge(GameConstants.Badge.Elite_JohtoChampion): return 3; break; case player.hasBadge(GameConstants.Badge.Elite_Champion): From b897c88ade3d5186dfb1765997ab4cfbdb3e1ca6 Mon Sep 17 00:00:00 2001 From: RedSparr0w Date: Tue, 24 Dec 2019 11:48:38 +1300 Subject: [PATCH 49/49] merge [v1.0.3] --- .travis.yml | 12 +- README.md | 22 +- .../gymLeaders/{bruno2.png => Bruno2.png} | Bin .../gymLeaders/{karen.png => Karen.png} | Bin .../gymLeaders/{koga2.png => Koga2.png} | Bin .../gymLeaders/{lance2.png => Lance2.png} | Bin .../images/gymLeaders/{will.png => Will.png} | Bin src/changelog.html | 3 - src/components/KantoSVG.html | 2 +- src/components/battleItemContainer.html | 40 +++ src/components/breeding.html | 56 ++-- src/components/breedingDisplay.html | 16 +- src/components/changelog.html | 32 +-- src/components/oakItems.html | 89 +++++++ src/components/pokeballSelector.html | 91 +++++++ src/components/pokedex.html | 18 +- src/components/pokemonListContainer.html | 37 +++ src/components/questDisplay.html | 21 +- src/components/receiveGymBadge.html | 7 +- src/components/shards.html | 2 +- src/components/shipModal.html | 2 +- src/components/shopModal.html | 3 +- src/components/underground.html | 1 - src/index.html | 250 +----------------- src/scripts/Battle.ts | 8 +- src/scripts/Changelog.ts | 43 +++ src/scripts/GameConstants.ts | 18 +- src/scripts/GameHelper.ts | 14 + src/scripts/Main.ts | 9 +- src/scripts/Player.ts | 80 +++++- src/scripts/Save.ts | 14 +- src/scripts/StartSequenceRunner.ts | 1 - src/scripts/achievements/Achievement.ts | 9 +- src/scripts/breeding/BreedingHelper.ts | 10 +- src/scripts/dungeons/DungeonRunner.ts | 10 +- .../effectEngine/effectEngineRunner.ts | 41 +++ src/scripts/farm/FarmRunner.ts | 1 - src/scripts/farm/Plot.ts | 3 - src/scripts/items/BattleItem.ts | 21 +- src/scripts/items/EggItem.ts | 8 +- src/scripts/items/ItemHandler.ts | 19 +- src/scripts/oakitems/OakItemRunner.ts | 9 +- src/scripts/pokemons/CaughtPokemon.ts | 4 +- src/scripts/pokemons/DataPokemon.ts | 4 +- src/scripts/quests/Quest.ts | 15 +- src/scripts/quests/QuestHelper.ts | 25 +- src/scripts/quests/QuestLineHelper.ts | 14 +- src/scripts/safari/Safari.ts | 2 +- src/scripts/safari/SafariBattle.ts | 4 +- src/scripts/towns/Town.ts | 3 +- src/scripts/underground/Mine.ts | 3 +- src/scripts/underground/SeededRand.ts | 2 +- src/scripts/utilities/Preload.ts | 1 + src/scripts/worldmap/MapHelper.ts | 18 +- src/styles/battleItem.less | 38 +++ src/styles/main.less | 10 +- src/styles/map.less | 7 +- src/styles/oakItem.less | 1 + src/styles/pokedex.less | 6 +- 59 files changed, 732 insertions(+), 447 deletions(-) rename src/assets/images/gymLeaders/{bruno2.png => Bruno2.png} (100%) rename src/assets/images/gymLeaders/{karen.png => Karen.png} (100%) rename src/assets/images/gymLeaders/{koga2.png => Koga2.png} (100%) rename src/assets/images/gymLeaders/{lance2.png => Lance2.png} (100%) rename src/assets/images/gymLeaders/{will.png => Will.png} (100%) delete mode 100644 src/changelog.html create mode 100644 src/components/battleItemContainer.html create mode 100644 src/components/oakItems.html create mode 100644 src/components/pokeballSelector.html create mode 100644 src/components/pokemonListContainer.html create mode 100644 src/scripts/Changelog.ts create mode 100644 src/scripts/effectEngine/effectEngineRunner.ts create mode 100644 src/styles/battleItem.less diff --git a/.travis.yml b/.travis.yml index cda2753c..7a5cfe61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,10 @@ language: node_js node_js: -- 'node' + - "10" cache: directories: - node_modules -before_install: -- chmod a+x ./install.sh -- chmod a+x ./testDebug.sh install: -- ./install.sh -before_script: - - npm install -g gulp-cli +- npm install script: -- gulp build -- ./testDebug.sh \ No newline at end of file +- npm test diff --git a/README.md b/README.md index 9ddcd740..1dc62734 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Build Status](https://travis-ci.org/Ishadijcks/pokeclicker.svg?branch=develop)](https://travis-ci.org/Ishadijcks/pokeclicker) +[![Build Status](https://img.shields.io/travis/pokeclicker/pokeclicker?logo=travis)](https://travis-ci.org/pokeclicker/pokeclicker) + # PokéClicker A game about catching Pokémon, defeating gym leaders, and watching numbers get bigger. @@ -20,17 +21,30 @@ All file and class names should be [upper CamelCase](https://en.wikipedia.org/wi First make sure you have git and npm available as command-line utilities (so you should install Git and NodeJS if you don't have them already). Open a command line interface in the directory that contains this README file, and use the following command to install PokéClicker's other dependencies locally: -- npm install +```cmd +npm install +``` Then finally, run the following command in the command line interface to start a browser running PokéClicker. -- npm start +```cmd +npm start +``` Changes to the sourcecode will automatically cause the browser to refresh. This means you don't need to compile TypeScript yourself. Gulp will do this for you :thumbsup: +## Use Google cloud shell _(alternative)_ +[![Google Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.png)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/pokeclicker-dev/pokeclicker&git_branch=develop&page=editor&open_in_editor=README.md) +```cmd +npm install +npm start +``` + ## Deploying a new version to Github Pages Before deploying, check that the game compiles and starts up without errors. Then run: -- npm run website +```cmd +npm run website +``` After this command completes, push the changed files in the 'docs' directory to Github. diff --git a/src/assets/images/gymLeaders/bruno2.png b/src/assets/images/gymLeaders/Bruno2.png similarity index 100% rename from src/assets/images/gymLeaders/bruno2.png rename to src/assets/images/gymLeaders/Bruno2.png diff --git a/src/assets/images/gymLeaders/karen.png b/src/assets/images/gymLeaders/Karen.png similarity index 100% rename from src/assets/images/gymLeaders/karen.png rename to src/assets/images/gymLeaders/Karen.png diff --git a/src/assets/images/gymLeaders/koga2.png b/src/assets/images/gymLeaders/Koga2.png similarity index 100% rename from src/assets/images/gymLeaders/koga2.png rename to src/assets/images/gymLeaders/Koga2.png diff --git a/src/assets/images/gymLeaders/lance2.png b/src/assets/images/gymLeaders/Lance2.png similarity index 100% rename from src/assets/images/gymLeaders/lance2.png rename to src/assets/images/gymLeaders/Lance2.png diff --git a/src/assets/images/gymLeaders/will.png b/src/assets/images/gymLeaders/Will.png similarity index 100% rename from src/assets/images/gymLeaders/will.png rename to src/assets/images/gymLeaders/Will.png diff --git a/src/changelog.html b/src/changelog.html deleted file mode 100644 index 628007ad..00000000 --- a/src/changelog.html +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/KantoSVG.html b/src/components/KantoSVG.html index 09b505e8..f6ed55ab 100644 --- a/src/components/KantoSVG.html +++ b/src/components/KantoSVG.html @@ -507,5 +507,5 @@ fill="url(#mx-gradient-dae8fc-1-7ea6e0-1-s-0)" height="12.6" stroke="#6c8ebf" width="12.6" x="325" y="240" data-bind="click:function(){MapHelper.openShipModal()}, - css:{ unlockedTown: player.highestRegion >= 1}"> + css:{ unlockedTown: player.highestRegion() >= 1}"> diff --git a/src/components/battleItemContainer.html b/src/components/battleItemContainer.html new file mode 100644 index 00000000..9ad637f6 --- /dev/null +++ b/src/components/battleItemContainer.html @@ -0,0 +1,40 @@ +
    +
    + Battle Items +
    +
    + + + + + + + + + + + + +
    + + +
    +
    + +
    diff --git a/src/components/breeding.html b/src/components/breeding.html index d4c8d1d6..6e9d0fc6 100644 --- a/src/components/breeding.html +++ b/src/components/breeding.html @@ -10,11 +10,11 @@
    -
    -

    + +

    Unfortunately, you don't have any pokémon of level 100

    + +

    + Pick a pokémon below to breed them: +

    +
    + +
    +
    -
    -

    - Unfortunately, you don't have any free eggslots -

    -
    +

    + Unfortunately, you don't have any free eggslots +