Implement Water Shuriken Battle Bond condition (#466)

* moves: water shuriken hits 3x 20bp in ash greninja forme

* moves: remove fusion checks
This commit is contained in:
Madi Simpson 2024-05-04 18:50:12 -07:00 committed by GitHub
parent 2c003854e9
commit 96d7fdd3f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 5 deletions

View File

@ -3224,8 +3224,7 @@ export function initAbilities() {
.attr(UncopiableAbilityAbAttr)
.attr(UnswappableAbilityAbAttr)
.attr(UnsuppressableAbilityAbAttr)
.attr(NoFusionAbilityAbAttr)
.partial(),
.attr(NoFusionAbilityAbAttr),
new Ability(Abilities.POWER_CONSTRUCT, 7) // TODO: 10% Power Construct Zygarde isn't accounted for yet. If changed, update Zygarde's getSpeciesFormIndex entry accordingly
.attr(PostBattleInitFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)
.attr(PostSummonFormChangeAbAttr, p => p.getHpRatio() <= 0.5 ? 4 : 2)

View File

@ -756,7 +756,7 @@ export enum MultiHitType {
_2_TO_5,
_3,
_3_INCR,
_1_TO_10
_1_TO_10,
}
export class HealAttr extends MoveEffectAttr {
@ -912,7 +912,9 @@ export class MultiHitAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
let hitTimes: integer;
switch (this.multiHitType) {
const hitType = new Utils.IntegerHolder(this.multiHitType)
applyMoveAttrs(ChangeMultiHitTypeAttr, user, target, move, hitType)
switch (hitType.value) {
case MultiHitType._2_TO_5:
{
const rand = user.randSeedInt(16);
@ -975,6 +977,23 @@ export class MultiHitAttr extends MoveAttr {
}
}
export class ChangeMultiHitTypeAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
//const hitType = args[0] as Utils.NumberHolder;
return false;
}
}
export class WaterShurikenMultiHitTypeAttr extends ChangeMultiHitTypeAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId == Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex == 2) {
(args[0] as Utils.IntegerHolder).value = MultiHitType._3
return true;
}
return false;
}
}
export class StatusEffectAttr extends MoveEffectAttr {
public effect: StatusEffect;
public cureTurn: integer;
@ -2049,6 +2068,16 @@ export class KnockOffPowerAttr extends VariablePowerAttr {
}
}
export class WaterShurikenPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (user.species.speciesId == Species.GRENINJA && user.hasAbility(Abilities.BATTLE_BOND) && user.formIndex == 2) {
(args[0] as Utils.IntegerHolder).value = 20
return true;
}
return false;
}
}
export class VariableAtkAttr extends MoveAttr {
constructor() {
super();
@ -5502,7 +5531,9 @@ export function initMoves() {
new AttackMove(Moves.HYPERSPACE_HOLE, Type.PSYCHIC, MoveCategory.SPECIAL, 80, -1, 5, -1, 0, 6)
.ignoresProtect(),
new AttackMove(Moves.WATER_SHURIKEN, Type.WATER, MoveCategory.SPECIAL, 15, 100, 20, -1, 1, 6)
.attr(MultiHitAttr),
.attr(MultiHitAttr)
.attr(WaterShurikenPowerAttr)
.attr(WaterShurikenMultiHitTypeAttr),
new AttackMove(Moves.MYSTICAL_FIRE, Type.FIRE, MoveCategory.SPECIAL, 75, 100, 10, 100, 0, 6)
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new SelfStatusMove(Moves.SPIKY_SHIELD, Type.GRASS, -1, 10, -1, 4, 6)