add quest exp modifier upgrade

This commit is contained in:
2023-04-23 15:22:40 +02:00
parent 3b47ed1bed
commit 40d5a876b8
6 changed files with 67 additions and 11 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ export class Quest {
/**
* Generate rewards for a quest and return it
* @param quest
* @param expModifier - multiplification modifier for the exp reward
*/
export function getQuestWithRewards(quest: Quest) {
export function getQuestWithRewards(quest: Quest, expModifier: number = 1) {
let maxProgress = 1;
@@ -70,7 +71,7 @@ export function getQuestWithRewards(quest: Quest) {
}
let goldReward = Math.floor(maxProgress/6);
let expReward = Math.floor(Math.floor(maxProgress/120) - maxProgress/1000);
let expReward = Math.floor((Math.floor(maxProgress/120) - maxProgress/1000) * expModifier);
// add some randomness to the rewards
goldReward = Math.floor(randomNumberBetween(goldReward * 0.95, goldReward * 1.1));