Tweak for daily run final boss
parent
14912541c5
commit
a52b8c6b4b
|
@ -1690,11 +1690,11 @@ export default class BattleScene extends Phaser.Scene {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (this.currentBattle.battleSpec === BattleSpec.FINAL_BOSS)
|
if (this.currentBattle.battleSpec === BattleSpec.FINAL_BOSS)
|
||||||
return resolve();
|
return resolve();
|
||||||
const waveIndex = this.currentBattle.waveIndex;
|
const difficultyWaveIndex = this.gameMode.getWaveForDifficulty(this.currentBattle.waveIndex);
|
||||||
const chances = Math.ceil(waveIndex / 10);
|
const isFinalBoss = this.gameMode.isWaveFinal(this.currentBattle.waveIndex);
|
||||||
const isBoss = !(waveIndex % 10) || (this.currentBattle.battleType === BattleType.TRAINER && this.currentBattle.trainer.config.isBoss);
|
let chances = Math.ceil(difficultyWaveIndex / 10);
|
||||||
|
if (isFinalBoss)
|
||||||
const modifierChance = this.gameMode.getEnemyModifierChance(isBoss);
|
chances = Math.ceil(chances * 2.5);
|
||||||
|
|
||||||
const party = this.getEnemyParty();
|
const party = this.getEnemyParty();
|
||||||
|
|
||||||
|
@ -1705,6 +1705,13 @@ export default class BattleScene extends Phaser.Scene {
|
||||||
}
|
}
|
||||||
|
|
||||||
party.forEach((enemyPokemon: EnemyPokemon, i: integer) => {
|
party.forEach((enemyPokemon: EnemyPokemon, i: integer) => {
|
||||||
|
const isBoss = enemyPokemon.isBoss() || (this.currentBattle.battleType === BattleType.TRAINER && this.currentBattle.trainer.config.isBoss);
|
||||||
|
let upgradeChance = 32;
|
||||||
|
if (isBoss)
|
||||||
|
upgradeChance /= 2;
|
||||||
|
if (isFinalBoss)
|
||||||
|
upgradeChance /= 8;
|
||||||
|
const modifierChance = this.gameMode.getEnemyModifierChance(isBoss);
|
||||||
let pokemonModifierChance = modifierChance;
|
let pokemonModifierChance = modifierChance;
|
||||||
if (this.currentBattle.battleType === BattleType.TRAINER)
|
if (this.currentBattle.battleType === BattleType.TRAINER)
|
||||||
pokemonModifierChance = Math.ceil(pokemonModifierChance * this.currentBattle.trainer.getPartyMemberModifierChanceMultiplier(i));
|
pokemonModifierChance = Math.ceil(pokemonModifierChance * this.currentBattle.trainer.getPartyMemberModifierChanceMultiplier(i));
|
||||||
|
@ -1715,7 +1722,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||||
}
|
}
|
||||||
if (isBoss)
|
if (isBoss)
|
||||||
count = Math.max(count, Math.floor(chances / 2));
|
count = Math.max(count, Math.floor(chances / 2));
|
||||||
getEnemyModifierTypesForWave(waveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD)
|
getEnemyModifierTypesForWave(difficultyWaveIndex, count, [ enemyPokemon ], this.currentBattle.battleType === BattleType.TRAINER ? ModifierPoolType.TRAINER : ModifierPoolType.WILD, upgradeChance)
|
||||||
.map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this));
|
.map(mt => mt.newModifier(enemyPokemon).add(this.enemyModifiers, false, this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3392,7 +3392,7 @@ export function initMoves() {
|
||||||
new AttackMove(Moves.SHEER_COLD, "Sheer Cold", Type.ICE, MoveCategory.SPECIAL, -1, 30, 5, -1, "The target faints instantly. It's less likely to hit the target if it's used by Pokémon other than Ice types.", -1, 0, 3)
|
new AttackMove(Moves.SHEER_COLD, "Sheer Cold", Type.ICE, MoveCategory.SPECIAL, -1, 30, 5, -1, "The target faints instantly. It's less likely to hit the target if it's used by Pokémon other than Ice types.", -1, 0, 3)
|
||||||
.attr(OneHitKOAttr)
|
.attr(OneHitKOAttr)
|
||||||
.attr(OneHitKOAccuracyAttr),
|
.attr(OneHitKOAccuracyAttr),
|
||||||
new AttackMove(Moves.MUDDY_WATER, "Muddy Water", Type.WATER, MoveCategory.SPECIAL, 90, 85, 10, -1, "The user attacks by shooting muddy water at opposing Pokémon. This may also lower their accuracy.", 30, 0, 3)
|
new AttackMove(Moves.MUDDY_WATER, "Muddy Water", Type.WATER, MoveCategory.SPECIAL, 110, 85, 10, -1, "The user attacks by shooting muddy water at opposing Pokémon. This may also lower their accuracy.", 30, 0, 3)
|
||||||
.attr(StatChangeAttr, BattleStat.ACC, -1)
|
.attr(StatChangeAttr, BattleStat.ACC, -1)
|
||||||
.target(MoveTarget.ALL_NEAR_ENEMIES),
|
.target(MoveTarget.ALL_NEAR_ENEMIES),
|
||||||
new AttackMove(Moves.BULLET_SEED, "Bullet Seed", Type.GRASS, MoveCategory.PHYSICAL, 25, 100, 30, 56, "The user forcefully shoots seeds at the target two to five times in a row.", -1, 0, 3)
|
new AttackMove(Moves.BULLET_SEED, "Bullet Seed", Type.GRASS, MoveCategory.PHYSICAL, 25, 100, 30, 56, "The user forcefully shoots seeds at the target two to five times in a row.", -1, 0, 3)
|
||||||
|
|
|
@ -1304,8 +1304,8 @@ export function getEnemyBuffModifierForWave(tier: ModifierTier, enemyModifiers:
|
||||||
return modifier;
|
return modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER): PokemonHeldItemModifierType[] {
|
export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER, upgradeChance: integer = 0): PokemonHeldItemModifierType[] {
|
||||||
const ret = new Array(count).fill(0).map(() => getNewModifierTypeOption(party, poolType).type as PokemonHeldItemModifierType);
|
const ret = new Array(count).fill(0).map(() => getNewModifierTypeOption(party, poolType, undefined, upgradeChance && !Utils.randSeedInt(upgradeChance) ? 1 : 0).type as PokemonHeldItemModifierType);
|
||||||
if (!(waveIndex % 1000))
|
if (!(waveIndex % 1000))
|
||||||
ret.push(getModifierType(modifierTypes.MINI_BLACK_HOLE) as PokemonHeldItemModifierType);
|
ret.push(getModifierType(modifierTypes.MINI_BLACK_HOLE) as PokemonHeldItemModifierType);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1353,7 +1353,8 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType,
|
||||||
}
|
}
|
||||||
if (tier === undefined) {
|
if (tier === undefined) {
|
||||||
const tierValue = Utils.randSeedInt(1024);
|
const tierValue = Utils.randSeedInt(1024);
|
||||||
upgradeCount = 0;
|
if (!upgradeCount)
|
||||||
|
upgradeCount = 0;
|
||||||
if (player && tierValue) {
|
if (player && tierValue) {
|
||||||
const partyShinyCount = party.filter(p => p.isShiny() && !p.isFainted()).length;
|
const partyShinyCount = party.filter(p => p.isShiny() && !p.isFainted()).length;
|
||||||
const upgradeOdds = Math.floor(32 / ((partyShinyCount + 2) / 2));
|
const upgradeOdds = Math.floor(32 / ((partyShinyCount + 2) / 2));
|
||||||
|
@ -1365,7 +1366,8 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType,
|
||||||
} while (upgraded);
|
} while (upgraded);
|
||||||
}
|
}
|
||||||
tier = tierValue > 255 ? ModifierTier.COMMON : tierValue > 60 ? ModifierTier.GREAT : tierValue > 12 ? ModifierTier.ULTRA : tierValue ? ModifierTier.ROGUE : ModifierTier.MASTER;
|
tier = tierValue > 255 ? ModifierTier.COMMON : tierValue > 60 ? ModifierTier.GREAT : tierValue > 12 ? ModifierTier.ULTRA : tierValue ? ModifierTier.ROGUE : ModifierTier.MASTER;
|
||||||
upgradeCount = Math.min(upgradeCount, ModifierTier.MASTER - tier);
|
if (!upgradeCount)
|
||||||
|
upgradeCount = Math.min(upgradeCount, ModifierTier.MASTER - tier);
|
||||||
tier += upgradeCount;
|
tier += upgradeCount;
|
||||||
while (tier && (!modifierPool.hasOwnProperty(tier) || !modifierPool[tier].length)) {
|
while (tier && (!modifierPool.hasOwnProperty(tier) || !modifierPool[tier].length)) {
|
||||||
tier--;
|
tier--;
|
||||||
|
|
|
@ -1260,7 +1260,6 @@ export class ExpBoosterModifier extends PersistentModifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
console.log(this.boostMultiplier);
|
|
||||||
(args[0] as Utils.NumberHolder).value = Math.floor((args[0] as Utils.NumberHolder).value * (1 + (this.getStackCount() * this.boostMultiplier)));
|
(args[0] as Utils.NumberHolder).value = Math.floor((args[0] as Utils.NumberHolder).value * (1 + (this.getStackCount() * this.boostMultiplier)));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -392,6 +392,13 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||||
}
|
}
|
||||||
const durationMultiplier = Phaser.Tweens.Builders.GetEaseFunction('Sine.easeIn')(1 - (Math.max(this.lastLevel - 100, 0) / 150));
|
const durationMultiplier = Phaser.Tweens.Builders.GetEaseFunction('Sine.easeIn')(1 - (Math.max(this.lastLevel - 100, 0) / 150));
|
||||||
let duration = this.visible && !instant ? (((levelExp - this.lastLevelExp) / relLevelExp) * 1650) * durationMultiplier * levelDurationMultiplier : 0;
|
let duration = this.visible && !instant ? (((levelExp - this.lastLevelExp) / relLevelExp) * 1650) * durationMultiplier * levelDurationMultiplier : 0;
|
||||||
|
if (ratio === 1) {
|
||||||
|
this.lastLevelExp = 0;
|
||||||
|
this.lastLevel++;
|
||||||
|
} else {
|
||||||
|
this.lastExp = pokemon.exp;
|
||||||
|
this.lastLevelExp = pokemon.levelExp;
|
||||||
|
}
|
||||||
if (duration)
|
if (duration)
|
||||||
(this.scene as BattleScene).playSound('exp');
|
(this.scene as BattleScene).playSound('exp');
|
||||||
this.scene.tweens.add({
|
this.scene.tweens.add({
|
||||||
|
@ -405,8 +412,6 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||||
if (duration)
|
if (duration)
|
||||||
this.scene.sound.stopByKey('exp');
|
this.scene.sound.stopByKey('exp');
|
||||||
if (ratio === 1) {
|
if (ratio === 1) {
|
||||||
this.lastLevelExp = 0;
|
|
||||||
this.lastLevel++;
|
|
||||||
(this.scene as BattleScene).playSound('level_up');
|
(this.scene as BattleScene).playSound('level_up');
|
||||||
this.setLevel(this.lastLevel);
|
this.setLevel(this.lastLevel);
|
||||||
this.scene.time.delayedCall(500 * levelDurationMultiplier, () => {
|
this.scene.time.delayedCall(500 * levelDurationMultiplier, () => {
|
||||||
|
@ -414,9 +419,6 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||||
this.updateInfo(pokemon, instant).then(() => resolve());
|
this.updateInfo(pokemon, instant).then(() => resolve());
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
this.lastExp = pokemon.exp;
|
|
||||||
this.lastLevelExp = pokemon.levelExp;
|
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue