mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
commit
7766a5efa9
@ -403,7 +403,7 @@ export default class Battle {
|
|||||||
scene.rngCounter = this.rngCounter++;
|
scene.rngCounter = this.rngCounter++;
|
||||||
scene.rngSeedOverride = this.battleSeed;
|
scene.rngSeedOverride = this.battleSeed;
|
||||||
const ret = Utils.randSeedInt(range, min);
|
const ret = Utils.randSeedInt(range, min);
|
||||||
console.log(reason, ret)
|
console.log("[RNG] " + reason, ret)
|
||||||
this.battleSeedState = Phaser.Math.RND.state();
|
this.battleSeedState = Phaser.Math.RND.state();
|
||||||
Phaser.Math.RND.state(state);
|
Phaser.Math.RND.state(state);
|
||||||
//scene.setScoreText("RNG: " + tempRngCounter + " (Last sim: " + this.rngCounter + ")")
|
//scene.setScoreText("RNG: " + tempRngCounter + " (Last sim: " + this.rngCounter + ")")
|
||||||
|
@ -2231,7 +2231,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
const typeBoost = source.findTag(t => t instanceof TypeBoostTag && t.boostedType === moveType) as TypeBoostTag;
|
const typeBoost = source.findTag(t => t instanceof TypeBoostTag && t.boostedType === moveType) as TypeBoostTag;
|
||||||
if (typeBoost?.oneUse) {
|
if (typeBoost?.oneUse && !simulated) {
|
||||||
source.removeTag(typeBoost.tagType);
|
source.removeTag(typeBoost.tagType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2378,19 +2378,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
if (!isTypeImmune) {
|
if (!isTypeImmune) {
|
||||||
const levelMultiplier = (2 * source.level / 5 + 2);
|
const levelMultiplier = (2 * source.level / 5 + 2);
|
||||||
var randRoll = simulated ? 1 : this.randSeedIntRange(85, 100, "Random damage roll")
|
if (simulated) {
|
||||||
const randomMultiplier = (randRoll / 100);
|
damageMin.value = Utils.toDmgValue((((levelMultiplier * powerLow * sourceAtkN.value / targetDefN.value) / 50) + 2)
|
||||||
damage.value = Utils.toDmgValue((((levelMultiplier * power * sourceAtk.value / targetDef.value) / 50) + 2)
|
|
||||||
* stabMultiplier.value
|
|
||||||
* typeMultiplier
|
|
||||||
* arenaAttackTypeMultiplier.value
|
|
||||||
* screenMultiplier.value
|
|
||||||
* twoStrikeMultiplier.value
|
|
||||||
* targetMultiplier
|
|
||||||
* criticalMultiplier.value
|
|
||||||
* glaiveRushModifier.value
|
|
||||||
* randomMultiplier);
|
|
||||||
damageMin.value = Utils.toDmgValue((((levelMultiplier * powerLow * sourceAtkN.value / targetDefN.value) / 50) + 2)
|
|
||||||
* stabMultiplier.value
|
* stabMultiplier.value
|
||||||
* typeMultiplier
|
* typeMultiplier
|
||||||
* arenaAttackTypeMultiplier.value
|
* arenaAttackTypeMultiplier.value
|
||||||
@ -2400,7 +2389,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* criticalMultiplierN.value
|
* criticalMultiplierN.value
|
||||||
* glaiveRushModifier.value
|
* glaiveRushModifier.value
|
||||||
* 0.85);
|
* 0.85);
|
||||||
damageMax.value = Utils.toDmgValue((((levelMultiplier * powerHigh * sourceAtkC.value / targetDefC.value) / 50) + 2)
|
damageMax.value = Utils.toDmgValue((((levelMultiplier * powerHigh * sourceAtkC.value / targetDefC.value) / 50) + 2)
|
||||||
* stabMultiplier.value
|
* stabMultiplier.value
|
||||||
* typeMultiplier
|
* typeMultiplier
|
||||||
* arenaAttackTypeMultiplier.value
|
* arenaAttackTypeMultiplier.value
|
||||||
@ -2409,7 +2398,20 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
* targetMultiplier
|
* targetMultiplier
|
||||||
* criticalMultiplierC.value
|
* criticalMultiplierC.value
|
||||||
* glaiveRushModifier.value);
|
* glaiveRushModifier.value);
|
||||||
|
} else {
|
||||||
|
var randRoll = simulated ? 1 : this.randSeedIntRange(85, 100, "Random damage roll")
|
||||||
|
const randomMultiplier = (randRoll / 100);
|
||||||
|
damage.value = Utils.toDmgValue((((levelMultiplier * power * sourceAtk.value / targetDef.value) / 50) + 2)
|
||||||
|
* stabMultiplier.value
|
||||||
|
* typeMultiplier
|
||||||
|
* arenaAttackTypeMultiplier.value
|
||||||
|
* screenMultiplier.value
|
||||||
|
* twoStrikeMultiplier.value
|
||||||
|
* targetMultiplier
|
||||||
|
* criticalMultiplier.value
|
||||||
|
* glaiveRushModifier.value
|
||||||
|
* randomMultiplier);
|
||||||
|
}
|
||||||
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
|
if (isPhysical && source.status && source.status.effect === StatusEffect.BURN) {
|
||||||
if (!move.hasAttr(BypassBurnDamageReductionAttr)) {
|
if (!move.hasAttr(BypassBurnDamageReductionAttr)) {
|
||||||
const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
|
const burnDamageReductionCancelled = new Utils.BooleanHolder(false);
|
||||||
@ -2578,40 +2580,37 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (source.isPlayer() && !this.isPlayer()) {
|
if (source.isPlayer() && !this.isPlayer()) {
|
||||||
this.scene.applyModifiers(DamageMoneyRewardModifier, true, source, damage);
|
this.scene.applyModifiers(DamageMoneyRewardModifier, true, source, damage);
|
||||||
}
|
}
|
||||||
|
// want to include is.Fainted() in case multi hit move ends early, still want to render message
|
||||||
|
if (source.turnData.hitsLeft === 1 || this.isFainted()) {
|
||||||
|
switch (result.hitResult) {
|
||||||
|
case HitResult.SUPER_EFFECTIVE:
|
||||||
|
this.scene.queueMessage(i18next.t("battle:hitResultSuperEffective"));
|
||||||
|
break;
|
||||||
|
case HitResult.NOT_VERY_EFFECTIVE:
|
||||||
|
this.scene.queueMessage(i18next.t("battle:hitResultNotVeryEffective"));
|
||||||
|
break;
|
||||||
|
case HitResult.ONE_HIT_KO:
|
||||||
|
this.scene.queueMessage(i18next.t("battle:hitResultOneHitKO"));
|
||||||
|
break;
|
||||||
|
case HitResult.IMMUNE:
|
||||||
|
case HitResult.NO_EFFECT:
|
||||||
|
console.error("Unhandled move immunity!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isFainted()) {
|
||||||
|
// set splice index here, so future scene queues happen before FaintedPhase
|
||||||
|
this.scene.setPhaseQueueSplice();
|
||||||
|
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), isOneHitKo));
|
||||||
|
this.resetSummonData();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (damage) {
|
||||||
|
destinyTag?.lapse(source, BattlerTagLapseType.CUSTOM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// want to include is.Fainted() in case multi hit move ends early, still want to render message
|
|
||||||
if (simulated) {
|
|
||||||
// Don't show text
|
|
||||||
} else if (source.turnData.hitsLeft === 1 || this.isFainted()) {
|
|
||||||
switch (result.hitResult) {
|
|
||||||
case HitResult.SUPER_EFFECTIVE:
|
|
||||||
this.scene.queueMessage(i18next.t("battle:hitResultSuperEffective"));
|
|
||||||
break;
|
|
||||||
case HitResult.NOT_VERY_EFFECTIVE:
|
|
||||||
this.scene.queueMessage(i18next.t("battle:hitResultNotVeryEffective"));
|
|
||||||
break;
|
|
||||||
case HitResult.ONE_HIT_KO:
|
|
||||||
this.scene.queueMessage(i18next.t("battle:hitResultOneHitKO"));
|
|
||||||
break;
|
|
||||||
case HitResult.IMMUNE:
|
|
||||||
case HitResult.NO_EFFECT:
|
|
||||||
console.error("Unhandled move immunity!");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.isFainted() && !simulated) {
|
|
||||||
// set splice index here, so future scene queues happen before FaintedPhase
|
|
||||||
this.scene.setPhaseQueueSplice();
|
|
||||||
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), isOneHitKo));
|
|
||||||
this.resetSummonData();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!simulated && damage) {
|
|
||||||
destinyTag?.lapse(source, BattlerTagLapseType.CUSTOM);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MoveCategory.STATUS:
|
case MoveCategory.STATUS:
|
||||||
|
@ -63,6 +63,8 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
const y = Math.round(65536 / Math.sqrt(Math.sqrt(255 / x)));
|
const y = Math.round(65536 / Math.sqrt(Math.sqrt(255 / x)));
|
||||||
const fpOffset = pokemon.getFieldPositionOffset();
|
const fpOffset = pokemon.getFieldPositionOffset();
|
||||||
|
|
||||||
|
LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, "Poké Ball Throw")
|
||||||
|
|
||||||
const pokeballAtlasKey = getPokeballAtlasKey(this.pokeballType);
|
const pokeballAtlasKey = getPokeballAtlasKey(this.pokeballType);
|
||||||
this.pokeball = this.scene.addFieldSprite(16, 80, "pb", pokeballAtlasKey);
|
this.pokeball = this.scene.addFieldSprite(16, 80, "pb", pokeballAtlasKey);
|
||||||
this.pokeball.setOrigin(0.5, 0.625);
|
this.pokeball.setOrigin(0.5, 0.625);
|
||||||
|
@ -372,6 +372,8 @@ class SessionSlot extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
this.add(pokemonIconsContainer);
|
this.add(pokemonIconsContainer);
|
||||||
|
|
||||||
|
const modifiersModule = await import("../modifier/modifier");
|
||||||
|
|
||||||
const modifierIconsContainer = this.scene.add.container(148, 30);
|
const modifierIconsContainer = this.scene.add.container(148, 30);
|
||||||
modifierIconsContainer.setScale(0.5);
|
modifierIconsContainer.setScale(0.5);
|
||||||
let visibleModifierIndex = 0;
|
let visibleModifierIndex = 0;
|
||||||
@ -379,13 +381,13 @@ class SessionSlot extends Phaser.GameObjects.Container {
|
|||||||
const itemDisplayLimit = 9
|
const itemDisplayLimit = 9
|
||||||
for (const m of data.modifiers) {
|
for (const m of data.modifiers) {
|
||||||
const modifier = m.toModifier(this.scene, modifiersModule[m.className]);
|
const modifier = m.toModifier(this.scene, modifiersModule[m.className]);
|
||||||
if (modifier instanceof PokemonHeldItemModifier) {
|
if (modifier instanceof Modifier.PokemonHeldItemModifier) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
numberOfModifiers++;
|
numberOfModifiers++;
|
||||||
}
|
}
|
||||||
for (const m of data.modifiers) {
|
for (const m of data.modifiers) {
|
||||||
const modifier = m.toModifier(this.scene, Modifier[m.className]);
|
const modifier = m.toModifier(this.scene, modifiersModule[m.className]);
|
||||||
if (modifier instanceof Modifier.PokemonHeldItemModifier) {
|
if (modifier instanceof Modifier.PokemonHeldItemModifier) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user