mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com>
This commit is contained in:
parent
0bf1b8adbe
commit
29e414ddf1
@ -136,14 +136,14 @@ export class ModifierType {
|
||||
if (this.id === modifier.modifierType.id) {
|
||||
let weight: number;
|
||||
if (modifier.weight instanceof Function) {
|
||||
weight = party ? (modifier.weight as Function)(party, rerollCount) : 0;
|
||||
weight = party ? modifier.weight(party, rerollCount) : 0;
|
||||
} else {
|
||||
weight = modifier.weight as number;
|
||||
weight = modifier.weight;
|
||||
}
|
||||
if (weight > 0) {
|
||||
this.tier = modifier.modifierType.tier;
|
||||
return this;
|
||||
} else if (!isNullOrUndefined(defaultTier)) {
|
||||
} else if (isNullOrUndefined(defaultTier)) {
|
||||
// If weight is 0, keep track of the first tier where the item was found
|
||||
defaultTier = modifier.modifierType.tier;
|
||||
}
|
||||
|
@ -2,10 +2,6 @@ import { TimedEventManager } from "#app/timed-event-manager";
|
||||
|
||||
/** Mock TimedEventManager so that ongoing events don't impact tests */
|
||||
export class MockTimedEventManager extends TimedEventManager {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
override activeEvent() {
|
||||
return undefined;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user