Merge pull request #25 from PokeRogue-Projects/beta

Yippee
This commit is contained in:
RedstonewolfX 2024-09-09 17:34:22 -04:00 committed by GitHub
commit 7766a5efa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 54 additions and 51 deletions

View File

@ -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 + ")")

View File

@ -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,18 +2378,7 @@ 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);
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) damageMin.value = Utils.toDmgValue((((levelMultiplier * powerLow * sourceAtkN.value / targetDefN.value) / 50) + 2)
* stabMultiplier.value * stabMultiplier.value
* typeMultiplier * typeMultiplier
@ -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,13 +2580,8 @@ 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 // want to include is.Fainted() in case multi hit move ends early, still want to render message
if (simulated) { if (source.turnData.hitsLeft === 1 || this.isFainted()) {
// Don't show text
} else if (source.turnData.hitsLeft === 1 || this.isFainted()) {
switch (result.hitResult) { switch (result.hitResult) {
case HitResult.SUPER_EFFECTIVE: case HitResult.SUPER_EFFECTIVE:
this.scene.queueMessage(i18next.t("battle:hitResultSuperEffective")); this.scene.queueMessage(i18next.t("battle:hitResultSuperEffective"));
@ -2602,17 +2599,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
} }
if (this.isFainted() && !simulated) { if (this.isFainted()) {
// set splice index here, so future scene queues happen before FaintedPhase // set splice index here, so future scene queues happen before FaintedPhase
this.scene.setPhaseQueueSplice(); this.scene.setPhaseQueueSplice();
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), isOneHitKo)); this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), isOneHitKo));
this.resetSummonData(); this.resetSummonData();
} }
if (!simulated && damage) { if (damage) {
destinyTag?.lapse(source, BattlerTagLapseType.CUSTOM); destinyTag?.lapse(source, BattlerTagLapseType.CUSTOM);
} }
} }
}
}
break; break;
case MoveCategory.STATUS: case MoveCategory.STATUS:
if (!cancelled.value && typeMultiplier === 0 && !simulated) { if (!cancelled.value && typeMultiplier === 0 && !simulated) {

View File

@ -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);

View File

@ -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;
} }