Implemented Burn Up & Double Shock (#161)

* Implemented barrier-breaking moves

* removed (P) from move names

* refactored to support defog

* Implements Burn Up & Double Shock

* Removed code irrelevant to current PR
This commit is contained in:
lucfd 2024-04-16 15:07:38 -04:00 committed by GitHub
parent 1138530a0c
commit 24408edfdc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 48 additions and 4 deletions

View File

@ -2773,6 +2773,38 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
} }
} }
export class RemoveTypeAttr extends MoveEffectAttr {
private removedType: Type;
private messageCallback: ((user: Pokemon) => void) | undefined;
constructor(removedType: Type, messageCallback?: (user: Pokemon) => void) {
super(true, MoveEffectTrigger.POST_APPLY);
this.removedType = removedType;
this.messageCallback = messageCallback;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (!super.apply(user, target, move, args))
return false;
if(user.isTerastallized && user.getTeraType() == this.removedType) // active tera types cannot be removed
return false;
const userTypes = user.getTypes(true)
const modifiedTypes = userTypes.filter(type => type !== this.removedType);
user.summonData.types = modifiedTypes;
if (this.messageCallback) {
this.messageCallback(user);
}
return true;
}
}
export class CopyTypeAttr extends MoveEffectAttr { export class CopyTypeAttr extends MoveEffectAttr {
constructor() { constructor() {
super(true); super(true);
@ -5273,9 +5305,15 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.DEF, -1), .attr(StatChangeAttr, BattleStat.DEF, -1),
new AttackMove(Moves.POWER_TRIP, Type.DARK, MoveCategory.PHYSICAL, 20, 100, 10, -1, 0, 7) new AttackMove(Moves.POWER_TRIP, Type.DARK, MoveCategory.PHYSICAL, 20, 100, 10, -1, 0, 7)
.attr(StatChangeCountPowerAttr), .attr(StatChangeCountPowerAttr),
new AttackMove(Moves.BURN_UP, Type.FIRE, MoveCategory.SPECIAL, 130, 100, 5, -1, 0, 7) new AttackMove(Moves.BURN_UP, "Burn Up", Type.FIRE, MoveCategory.SPECIAL, 130, 100, 5, "To inflict massive damage, the user burns itself out. After using this move, the user will no longer be Fire type.", -1, 0, 7)
.condition((user) => {
const userTypes = user.getTypes(true);
return userTypes.includes(Type.FIRE);
})
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
.partial(), .attr(RemoveTypeAttr, Type.FIRE, (user) => {
user.scene.queueMessage(getPokemonMessage(user, ` burned itself out!`));
}),
new StatusMove(Moves.SPEED_SWAP, Type.PSYCHIC, -1, 10, -1, 0, 7) new StatusMove(Moves.SPEED_SWAP, Type.PSYCHIC, -1, 10, -1, 0, 7)
.unimplemented(), .unimplemented(),
new AttackMove(Moves.SMART_STRIKE, Type.STEEL, MoveCategory.PHYSICAL, 70, -1, 10, -1, 0, 7), new AttackMove(Moves.SMART_STRIKE, Type.STEEL, MoveCategory.PHYSICAL, 70, -1, 10, -1, 0, 7),
@ -5960,8 +5998,14 @@ export function initMoves() {
.attr(HitHealAttr) .attr(HitHealAttr)
.slicingMove() .slicingMove()
.triageMove(), .triageMove(),
new AttackMove(Moves.DOUBLE_SHOCK, Type.ELECTRIC, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 9) new AttackMove(Moves.DOUBLE_SHOCK, "Double Shock", Type.ELECTRIC, MoveCategory.PHYSICAL, 120, 100, 5, "The user discharges all the electricity from its body to perform a high-damage attack. After using this move, the user will no longer be Electric type.", -1, 0, 9)
.partial(), .condition((user) => {
const userTypes = user.getTypes(true);
return userTypes.includes(Type.ELECTRIC);
})
.attr(RemoveTypeAttr, Type.ELECTRIC, (user) => {
user.scene.queueMessage(getPokemonMessage(user, ` used up all its electricity!`));
}),
new AttackMove(Moves.GIGATON_HAMMER, Type.STEEL, MoveCategory.PHYSICAL, 160, 100, 5, -1, 0, 9) new AttackMove(Moves.GIGATON_HAMMER, Type.STEEL, MoveCategory.PHYSICAL, 160, 100, 5, -1, 0, 9)
.makesContact(false) .makesContact(false)
.condition((user, target, move) => { .condition((user, target, move) => {