mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 21:42:20 +02:00
Clean up shiny/HA reroll methods
This commit is contained in:
parent
718c8cfbb9
commit
41aaacf4fa
@ -3264,11 +3264,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
applyModifiersToOverride?: boolean,
|
applyModifiersToOverride?: boolean,
|
||||||
): boolean {
|
): boolean {
|
||||||
if (!this.shiny) {
|
if (!this.shiny) {
|
||||||
const shinyThreshold = new NumberHolder(BASE_SHINY_CHANCE);
|
const shinyThreshold = new NumberHolder(thresholdOverride ?? BASE_SHINY_CHANCE);
|
||||||
if (thresholdOverride === undefined || applyModifiersToOverride) {
|
if (applyModifiersToOverride) {
|
||||||
if (thresholdOverride !== undefined && applyModifiersToOverride) {
|
|
||||||
shinyThreshold.value = thresholdOverride;
|
|
||||||
}
|
|
||||||
if (timedEventManager.isEventActive()) {
|
if (timedEventManager.isEventActive()) {
|
||||||
shinyThreshold.value *= timedEventManager.getShinyMultiplier();
|
shinyThreshold.value *= timedEventManager.getShinyMultiplier();
|
||||||
}
|
}
|
||||||
@ -3278,9 +3275,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
shinyThreshold,
|
shinyThreshold,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
shinyThreshold.value = thresholdOverride;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.shiny = randSeedInt(65536) < shinyThreshold.value;
|
this.shiny = randSeedInt(65536) < shinyThreshold.value;
|
||||||
}
|
}
|
||||||
@ -3353,11 +3347,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (!this.species.abilityHidden) {
|
if (!this.species.abilityHidden) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const haThreshold = new NumberHolder(BASE_HIDDEN_ABILITY_CHANCE);
|
const haThreshold = new NumberHolder(thresholdOverride ?? BASE_HIDDEN_ABILITY_CHANCE);
|
||||||
if (thresholdOverride === undefined || applyModifiersToOverride) {
|
if (applyModifiersToOverride) {
|
||||||
if (thresholdOverride !== undefined && applyModifiersToOverride) {
|
|
||||||
haThreshold.value = thresholdOverride;
|
|
||||||
}
|
|
||||||
if (!this.hasTrainer()) {
|
if (!this.hasTrainer()) {
|
||||||
globalScene.applyModifiers(
|
globalScene.applyModifiers(
|
||||||
HiddenAbilityRateBoosterModifier,
|
HiddenAbilityRateBoosterModifier,
|
||||||
@ -3365,8 +3356,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
haThreshold,
|
haThreshold,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
haThreshold.value = thresholdOverride;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (randSeedInt(65536) < haThreshold.value) {
|
if (randSeedInt(65536) < haThreshold.value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user