mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-11 19:02:16 +02:00
Resolving conflict
This commit is contained in:
parent
6faf9f1d61
commit
0294c7d853
@ -135,3 +135,43 @@ export function getStatusEffectCatchRateMultiplier(statusEffect: StatusEffect):
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random non-volatile StatusEffect
|
||||
*/
|
||||
export function generateRandomStatusEffect(): StatusEffect {
|
||||
return Utils.randIntRange(1, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random non-volatile StatusEffect between the two provided
|
||||
* @param statusEffectA The first StatusEffect
|
||||
* @param statusEffectA The second StatusEffect
|
||||
*/
|
||||
export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB: StatusEffect): StatusEffect {
|
||||
if (statusEffectA === StatusEffect.NONE || statusEffectA === StatusEffect.FAINT) {
|
||||
return statusEffectB;
|
||||
}
|
||||
if (statusEffectB === StatusEffect.NONE || statusEffectB === StatusEffect.FAINT) {
|
||||
return statusEffectA;
|
||||
}
|
||||
|
||||
return Utils.randIntRange(0, 2) ? statusEffectA : statusEffectB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a random non-volatile StatusEffect between the two provided
|
||||
* @param statusA The first Status
|
||||
* @param statusB The second Status
|
||||
*/
|
||||
export function getRandomStatus(statusA: Status, statusB: Status): Status {
|
||||
if (statusA === undefined || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) {
|
||||
return statusB;
|
||||
}
|
||||
if (statusB === undefined || statusB.effect === StatusEffect.NONE || statusB.effect === StatusEffect.FAINT) {
|
||||
return statusA;
|
||||
}
|
||||
|
||||
|
||||
return Utils.randIntRange(0, 2) ? statusA : statusB;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user