Skip to content

Commit

Permalink
fix stat snafu
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 21, 2023
1 parent d60c80a commit ab7b366
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion client/src/app/pages/worship/worship.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class WorshipPage implements OnInit {
buff: OOCBuff.Offense,
color: '#ef0107',
description:
'Pray to a powerful deity to gain a 15% attack boost for 1 hour.',
'Pray to a powerful deity to gain a 15% offense boost for 1 hour.',
},
{
name: 'Spoodles',
Expand Down
5 changes: 3 additions & 2 deletions server/src/modules/content/playerhelper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class PlayerHelperService {
gainXp(player: Player, xp = 1) {
if (this.isDeityXpBuffActive(player) && xp > 0) {
xp = Math.floor(
xp * percentNumberAsMultiplier(this.constants.worshipXpBoost),
xp + xp * percentNumberAsMultiplier(this.constants.worshipXpBoost),
);
}

Expand All @@ -57,7 +57,8 @@ export class PlayerHelperService {
gainCoins(player: Player, amount = 1) {
if (this.isDeityCoinsBuffActive(player) && amount > 0) {
amount = Math.floor(
amount * percentNumberAsMultiplier(this.constants.worshipCoinBoost),
amount +
amount * percentNumberAsMultiplier(this.constants.worshipCoinBoost),
);
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/gameplay/travel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class TravelService {
if (this.playerHelper.isDeityTravelSpeedBuffActive(playerRef)) {
steps -= Math.floor(
steps *
percentNumberAsMultiplier(this.constants.worshipTravelBoost, 0),
percentNumberAsMultiplier(this.constants.worshipTravelBoost),
);
}

Expand Down
28 changes: 12 additions & 16 deletions server/src/modules/player/player.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,25 +550,21 @@ export class PlayerService {
});

if (this.playerHelper.isDeityDefenseBuffActive(player)) {
base.toughness += base.toughness * percentNumberAsMultiplier(
this.constants.worshipDefenseBoost,
0,
);
base.resistance += base.resistance * percentNumberAsMultiplier(
this.constants.worshipDefenseBoost,
0,
);
base.toughness +=
base.toughness *
percentNumberAsMultiplier(this.constants.worshipDefenseBoost);
base.resistance +=
base.resistance *
percentNumberAsMultiplier(this.constants.worshipDefenseBoost);
}

if (this.playerHelper.isDeityOffenseBuffActive(player)) {
base.power += base.power * percentNumberAsMultiplier(
this.constants.worshipOffenseBoost,
0,
);
base.magic += base.magic * percentNumberAsMultiplier(
this.constants.worshipOffenseBoost,
0,
);
base.power +=
base.power *
percentNumberAsMultiplier(this.constants.worshipOffenseBoost);
base.magic +=
base.magic *
percentNumberAsMultiplier(this.constants.worshipOffenseBoost);
}

return base;
Expand Down
4 changes: 2 additions & 2 deletions server/src/utils/number.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function percentNumberAsMultiplier(num: number, startAt = 1): number {
return startAt + num / 100;
export function percentNumberAsMultiplier(num: number): number {
return num / 100;
}

0 comments on commit ab7b366

Please sign in to comment.