Implement Alluring Voice and Burning Jealousy

This commit is contained in:
ElliottSimmonds 2024-05-28 12:36:02 -07:00 committed by NightKev
parent d3d376dca3
commit 507daf60a2
5 changed files with 67 additions and 6 deletions

View File

@ -1902,6 +1902,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
case BattlerTagType.GULP_MISSILE_ARROKUDA:
case BattlerTagType.GULP_MISSILE_PIKACHU:
return new GulpMissileTag(tagType, sourceMove);
case BattlerTagType.STATS_BOOSTED:
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
case BattlerTagType.NONE:
default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -5854,6 +5854,59 @@ export class DestinyBondAttr extends MoveEffectAttr {
}
}
/**
* Attribute to apply a battler tag to the target if they have had their stats boosted this turn.
*
* @extends AddBattlerTagAttr
*/
export class AddBattlerTagIfBoostedAttr extends AddBattlerTagAttr {
constructor(tag: BattlerTagType) {
super(tag, false, false, 2, 5);
}
/**
* @param user {@linkcode Pokemon} using this move
* @param target {@linkcode Pokemon} target of this move
* @param move {@linkcode Move} being used
* @param {any[]} args N/A
* @returns true
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.getTag(BattlerTagType.STATS_BOOSTED)) {
super.apply(user, target, move, args);
}
return true;
}
}
/**
* Attribute to apply a status effect to the target if they have had their stats boosted this turn.
*
* @extends MoveEffectAttr
*/
export class StatusIfBoostedAttr extends MoveEffectAttr {
public effect: StatusEffect;
constructor(effect: StatusEffect) {
super(true, MoveEffectTrigger.HIT);
this.effect = effect;
}
/**
* @param user {@linkcode Pokemon} using this move
* @param target {@linkcode Pokemon} target of this move
* @param move {@linkcode Move} being used
* @param {any[]} args N/A
* @returns true
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (target.getTag(BattlerTagType.STATS_BOOSTED)) {
target.trySetStatus(this.effect, true, user);
}
return true;
}
}
export class LastResortAttr extends MoveAttr {
getCondition(): MoveConditionFunc {
return (user: Pokemon, target: Pokemon, move: Move) => {
@ -8479,8 +8532,8 @@ export function initMoves() {
new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8)
.target(MoveTarget.ALL_NEAR_ENEMIES)
.partial(),
.attr(StatusIfBoostedAttr, StatusEffect.BURN)
.target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.LASH_OUT, Type.DARK, MoveCategory.PHYSICAL, 75, 100, 5, -1, 0, 8)
.partial(),
new AttackMove(Moves.POLTERGEIST, Type.GHOST, MoveCategory.PHYSICAL, 110, 90, 5, -1, 0, 8)
@ -8928,8 +8981,8 @@ export function initMoves() {
.target(MoveTarget.NEAR_ALLY)
.partial(),
new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9)
.soundBased()
.partial(),
.attr(AddBattlerTagIfBoostedAttr, BattlerTagType.CONFUSED)
.soundBased(),
new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result === MoveResult.MISS || user.getLastXMoves(2)[1]?.result === MoveResult.FAIL ? 2 : 1),
new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9)

View File

@ -60,6 +60,7 @@ export enum BattlerTagType {
DESTINY_BOND = "DESTINY_BOND",
CENTER_OF_ATTENTION = "CENTER_OF_ATTENTION",
ICE_FACE = "ICE_FACE",
STATS_BOOSTED = "STATS_BOOSTED",
STOCKPILING = "STOCKPILING",
RECEIVE_DOUBLE_DAMAGE = "RECEIVE_DOUBLE_DAMAGE",
ALWAYS_GET_HIT = "ALWAYS_GET_HIT",

View File

@ -4235,6 +4235,7 @@ export class PokemonBattleData {
public berriesEaten: BerryType[] = [];
public abilitiesApplied: Abilities[] = [];
public abilityRevealed: boolean = false;
public statsBoostedFirstTurn: boolean = false;
}
export class PokemonBattleSummonData {
@ -4245,8 +4246,8 @@ export class PokemonBattleSummonData {
}
export class PokemonTurnData {
public flinched: boolean;
public acted: boolean;
public flinched: boolean = false;
public acted: boolean = false;
public hitCount: integer;
public hitsLeft: integer;
public damageDealt: integer = 0;

View File

@ -3512,6 +3512,10 @@ export class StatChangePhase extends PokemonPhase {
}
for (const stat of filteredStats) {
if (levels.value > 0 && pokemon.summonData.battleStats[stat] + levels.value <= 6) {
pokemon.addTag(BattlerTagType.STATS_BOOSTED, 1);
}
pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6);
}