Remove revive tokens, nerf heal token, add endure token
This commit is contained in:
parent
4afa0bf142
commit
8b84965d7a
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
Binary file not shown.
After Width: | Height: | Size: 275 B |
Binary file not shown.
After Width: | Height: | Size: 402 B |
|
@ -8,7 +8,7 @@ import * as Utils from '../utils';
|
|||
import { Type, TypeDamageMultiplier, getTypeDamageMultiplier, getTypeRgb } from '../data/type';
|
||||
import { getLevelTotalExp } from '../data/exp';
|
||||
import { Stat } from '../data/pokemon-stat';
|
||||
import { AttackTypeBoosterModifier, DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, PokemonBaseStatModifier, PokemonHeldItemModifier, PokemonMultiHitModifier, PokemonNatureWeightModifier, ShinyRateBoosterModifier, SurviveDamageModifier, TempBattleStatBoosterModifier, TerastallizeModifier } from '../modifier/modifier';
|
||||
import { AttackTypeBoosterModifier, DamageMoneyRewardModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyEndureChanceModifier, EnemyFusionChanceModifier, HiddenAbilityRateBoosterModifier, PokemonBaseStatModifier, PokemonHeldItemModifier, PokemonMultiHitModifier, PokemonNatureWeightModifier, ShinyRateBoosterModifier, SurviveDamageModifier, TempBattleStatBoosterModifier, TerastallizeModifier } from '../modifier/modifier';
|
||||
import { PokeballType } from '../data/pokeball';
|
||||
import { Gender } from '../data/gender';
|
||||
import { initMoveAnim, loadMoveAnimAssets } from '../data/battle-anims';
|
||||
|
@ -1194,6 +1194,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
if (damage.value) {
|
||||
if (this.getHpRatio() === 1)
|
||||
applyPreDefendAbAttrs(PreDefendFullHpEndureAbAttr, this, source, battlerMove, cancelled, damage);
|
||||
else if (!this.isPlayer() && damage.value >= this.hp)
|
||||
this.scene.applyModifiers(EnemyEndureChanceModifier, false, this);
|
||||
|
||||
const oneHitKo = result === HitResult.ONE_HIT_KO;
|
||||
damage.value = this.damageAndUpdate(damage.value, result as DamageResult, isCritical, oneHitKo, oneHitKo);
|
||||
|
@ -2671,8 +2673,7 @@ export class PokemonSummonData {
|
|||
|
||||
export class PokemonBattleData {
|
||||
public hitCount: integer = 0;
|
||||
public revived: boolean = false;
|
||||
public maxRevived: boolean = false;
|
||||
public endured: boolean = false;
|
||||
}
|
||||
|
||||
export class PokemonBattleSummonData {
|
||||
|
|
|
@ -688,9 +688,9 @@ export class EnemyAttackStatusEffectChanceModifierType extends ModifierType {
|
|||
}
|
||||
}
|
||||
|
||||
export class EnemyInstantReviveChanceModifierType extends ModifierType {
|
||||
constructor(name: string, chancePercent: number, fullHeal: boolean, iconImage?: string) {
|
||||
super(name, `Adds a ${chancePercent}% chance of reviving with ${fullHeal ? 100 : 50}% HP`, (type, _args) => new Modifiers.EnemyInstantReviveChanceModifier(type, fullHeal, chancePercent), iconImage, 'enemy_revive');
|
||||
export class EnemyEndureChanceModifierType extends ModifierType {
|
||||
constructor(name: string, chancePercent: number, iconImage?: string) {
|
||||
super(name, `Adds a ${chancePercent}% chance of enduring a hit`, (type, _args) => new Modifiers.EnemyEndureChanceModifier(type, chancePercent), iconImage, 'enemy_endure');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,15 +899,14 @@ export const modifierTypes = {
|
|||
ENEMY_DAMAGE_BOOSTER: () => new ModifierType('Damage Token', 'Increases damage by 10%', (type, _args) => new Modifiers.EnemyDamageBoosterModifier(type, 10), 'wl_item_drop'),
|
||||
ENEMY_DAMAGE_REDUCTION: () => new ModifierType('Protection Token', 'Reduces incoming damage by 5%', (type, _args) => new Modifiers.EnemyDamageReducerModifier(type, 5), 'wl_guard_spec'),
|
||||
//ENEMY_SUPER_EFFECT_BOOSTER: () => new ModifierType('Type Advantage Token', 'Increases damage of super effective attacks by 30%', (type, _args) => new Modifiers.EnemySuperEffectiveDamageBoosterModifier(type, 30), 'wl_custom_super_effective'),
|
||||
ENEMY_HEAL: () => new ModifierType('Recovery Token', 'Heals 5% of max HP every turn', (type, _args) => new Modifiers.EnemyTurnHealModifier(type, 5), 'wl_potion'),
|
||||
ENEMY_HEAL: () => new ModifierType('Recovery Token', 'Heals 5% of max HP every turn', (type, _args) => new Modifiers.EnemyTurnHealModifier(type, 3), 'wl_potion'),
|
||||
ENEMY_ATTACK_POISON_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Poison Token', 10, StatusEffect.POISON, 'wl_antidote'),
|
||||
ENEMY_ATTACK_PARALYZE_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Paralyze Token', 10, StatusEffect.PARALYSIS, 'wl_paralyze_heal'),
|
||||
ENEMY_ATTACK_SLEEP_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Sleep Token', 10, StatusEffect.SLEEP, 'wl_awakening'),
|
||||
ENEMY_ATTACK_FREEZE_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Freeze Token', 10, StatusEffect.FREEZE, 'wl_ice_heal'),
|
||||
ENEMY_ATTACK_BURN_CHANCE: () => new EnemyAttackStatusEffectChanceModifierType('Burn Token', 10, StatusEffect.BURN, 'wl_burn_heal'),
|
||||
ENEMY_STATUS_EFFECT_HEAL_CHANCE: () => new ModifierType('Full Heal Token', 'Adds a 10% chance every turn to heal a status condition', (type, _args) => new Modifiers.EnemyStatusEffectHealChanceModifier(type, 10), 'wl_full_heal'),
|
||||
ENEMY_INSTANT_REVIVE_CHANCE: () => new EnemyInstantReviveChanceModifierType('Revive Token', 5, false, 'wl_revive'),
|
||||
ENEMY_INSTANT_MAX_REVIVE_CHANCE: () => new EnemyInstantReviveChanceModifierType('Max Revive Token', 2, true, 'wl_max_revive'),
|
||||
ENEMY_ENDURE_CHANCE: () => new EnemyEndureChanceModifierType('Endure Token', 5, 'wl_reset_urge'),
|
||||
ENEMY_FUSED_CHANCE: () => new ModifierType('Fusion Token', 'Adds a 1% chance that a wild Pokémon will be a fusion', (type, _args) => new Modifiers.EnemyFusionChanceModifier(type, 1), 'wl_custom_spliced'),
|
||||
};
|
||||
|
||||
|
@ -1095,24 +1094,20 @@ const enemyBuffModifierPool: ModifierPool = {
|
|||
[ModifierTier.COMMON]: [
|
||||
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 10),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_REDUCTION, 10),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_HEAL, 10),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_POISON_CHANCE, 2),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_PARALYZE_CHANCE, 2),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_SLEEP_CHANCE, 2),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_FREEZE_CHANCE, 2),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_BURN_CHANCE, 2),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 10),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_REVIVE_CHANCE, 10),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_MAX_REVIVE_CHANCE, 6),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 10000),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
|
||||
].map(m => { m.setTier(ModifierTier.COMMON); return m; }),
|
||||
[ModifierTier.GREAT]: [
|
||||
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_REDUCTION, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_HEAL, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_REVIVE_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_MAX_REVIVE_CHANCE, 3),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
|
||||
].map(m => { m.setTier(ModifierTier.GREAT); return m; }),
|
||||
[ModifierTier.ULTRA]: [
|
||||
|
@ -1120,8 +1115,7 @@ const enemyBuffModifierPool: ModifierPool = {
|
|||
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_REDUCTION, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_HEAL, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_REVIVE_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_INSTANT_MAX_REVIVE_CHANCE, 3),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5),
|
||||
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 300)
|
||||
].map(m => { m.setTier(ModifierTier.ULTRA); return m; }),
|
||||
[ModifierTier.ROGUE]: [ ].map(m => { m.setTier(ModifierTier.ROGUE); return m; }),
|
||||
|
|
|
@ -19,6 +19,7 @@ import { VoucherType } from '../system/voucher';
|
|||
import { PreventBerryUseAbAttr, applyAbAttrs } from '../data/ability';
|
||||
import { FormChangeItem, SpeciesFormChangeItemTrigger } from '../data/pokemon-forms';
|
||||
import { Nature } from '#app/data/nature';
|
||||
import { BattlerTagType } from '#app/data/enums/battler-tag-type';
|
||||
|
||||
type ModifierType = ModifierTypes.ModifierType;
|
||||
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
||||
|
@ -1946,7 +1947,7 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier {
|
|||
constructor(type: ModifierType, healPercent: number, stackCount?: integer) {
|
||||
super(type, stackCount);
|
||||
|
||||
this.healPercent = healPercent || 10;
|
||||
this.healPercent = healPercent || 3;
|
||||
}
|
||||
|
||||
match(modifier: Modifier): boolean {
|
||||
|
@ -1975,7 +1976,7 @@ export class EnemyTurnHealModifier extends EnemyPersistentModifier {
|
|||
}
|
||||
|
||||
getMaxStackCount(scene: BattleScene): integer {
|
||||
return 20;
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2045,39 +2046,36 @@ export class EnemyStatusEffectHealChanceModifier extends EnemyPersistentModifier
|
|||
}
|
||||
}
|
||||
|
||||
export class EnemyInstantReviveChanceModifier extends EnemyPersistentModifier {
|
||||
public fullHeal: boolean;
|
||||
export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
|
||||
private chance: number;
|
||||
|
||||
constructor(type: ModifierType, healFull: boolean, chancePercent: number, stackCount?: integer) {
|
||||
constructor(type: ModifierType, chancePercent: number, stackCount?: integer) {
|
||||
super(type, stackCount);
|
||||
|
||||
this.fullHeal = healFull;
|
||||
this.chance = (chancePercent || healFull ? 2 : 5) / 100;
|
||||
this.chance = (chancePercent || 5) / 100;
|
||||
}
|
||||
|
||||
match(modifier: Modifier) {
|
||||
return modifier instanceof EnemyInstantReviveChanceModifier && modifier.fullHeal === this.fullHeal && modifier.chance === this.chance;
|
||||
return modifier instanceof EnemyEndureChanceModifier && modifier.chance === this.chance;
|
||||
}
|
||||
|
||||
clone() {
|
||||
return new EnemyInstantReviveChanceModifier(this.type, this.fullHeal, this.chance * 100, this.stackCount);
|
||||
return new EnemyEndureChanceModifier(this.type, this.chance * 100, this.stackCount);
|
||||
}
|
||||
|
||||
getArgs(): any[] {
|
||||
return [ this.fullHeal, this.chance * 100 ];
|
||||
return [ this.chance * 100 ];
|
||||
}
|
||||
|
||||
apply(args: any[]): boolean {
|
||||
if (Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount()))
|
||||
const target = (args[0] as Pokemon);
|
||||
|
||||
if (target.battleData.endured || Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount()))
|
||||
return false;
|
||||
|
||||
const pokemon = args[0] as Pokemon;
|
||||
target.addTag(BattlerTagType.ENDURING, 1);
|
||||
|
||||
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(),
|
||||
Math.max(Math.floor(pokemon.getMaxHp() / (this.fullHeal ? 1 : 2)), 1), getPokemonMessage(pokemon, ` was revived\nby its ${this.type.name}!`), false, false, true));
|
||||
|
||||
pokemon.resetStatus();
|
||||
target.battleData.endured = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMov
|
|||
import { Mode } from './ui/ui';
|
||||
import { Command } from "./ui/command-ui-handler";
|
||||
import { Stat } from "./data/pokemon-stat";
|
||||
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyInstantReviveChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, PokemonFriendshipBoosterModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier } from "./modifier/modifier";
|
||||
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyEndureChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, PokemonFriendshipBoosterModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier } from "./modifier/modifier";
|
||||
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
||||
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
||||
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
||||
|
@ -2791,8 +2791,6 @@ export class FaintPhase extends PokemonPhase {
|
|||
start() {
|
||||
super.start();
|
||||
|
||||
const pokemon = this.getPokemon();
|
||||
|
||||
if (!this.preventEndure) {
|
||||
const instantReviveModifier = this.scene.applyModifier(PokemonInstantReviveModifier, this.player, this.getPokemon()) as PokemonInstantReviveModifier;
|
||||
|
||||
|
@ -2802,20 +2800,6 @@ export class FaintPhase extends PokemonPhase {
|
|||
this.scene.updateModifiers(this.player);
|
||||
return this.end();
|
||||
}
|
||||
|
||||
if (!pokemon.isPlayer()) {
|
||||
const enemyInstantReviveModifiers = this.scene.findModifiers(m => m instanceof EnemyInstantReviveChanceModifier, false);
|
||||
for (let modifier of enemyInstantReviveModifiers) {
|
||||
const maxRevive = (modifier as EnemyInstantReviveChanceModifier).fullHeal;
|
||||
const prop = maxRevive ? 'maxRevived' : 'revived';
|
||||
if (pokemon.battleData[prop])
|
||||
continue;
|
||||
if (modifier.shouldApply([ pokemon ]) && modifier.apply([ pokemon ])) {
|
||||
pokemon.battleData[prop] = true;
|
||||
return this.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.tryOverrideForBattleSpec())
|
||||
|
|
Loading…
Reference in New Issue