-
-
Save Flashback083/ae0eeb1c55a7ed6999679c3bf9514931 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public AttackResult applyEffectDuring(PixelmonWrapper user, PixelmonWrapper target) { | |
AbilityBase targetAbility = target.getBattleAbility(); | |
if (targetAbility instanceof Illusion && ((Illusion)targetAbility).disguisedPokemon != null || target.hasStatus(StatusType.Substitute, StatusType.Transformed)) { | |
user.bc.sendToAll("pixelmon.effect.effectfailed"); | |
return AttackResult.failed; | |
} | |
if (!user.bc.simulateMode) { | |
EntityDataManager dataManager = user.entity.getDataManager(); | |
if (user.removeStatus(StatusType.Transformed)) { | |
dataManager.set(EntityPixelmon.dwTransformation, 0); | |
} | |
user.bc.sendToAll("pixelmon.status.transform", user.getNickname(), target.getNickname()); | |
dataManager.set(EntityPixelmon.dwTransformation, -1); | |
Transformed transformed = new Transformed(user, target); | |
if (target.entity.getSpecies().is(EnumSpecies.Mimikyu)){ | |
AbilityBase ability = AbilityBase.getAbility(user.getAbility().getName()).get(); | |
user.addStatus(transformed, target); | |
user.setTempAbility(ability); | |
}else{ | |
user.addStatus(transformed, target); | |
} | |
Moveset tempMoveset = new Moveset().withPokemon(user.pokemon); | |
for (Attack a : target.getMoveset()) { | |
if (a == null) continue; | |
Attack copy = a.copy(); | |
copy.pp = 5; | |
copy.overridePPMax(5); | |
tempMoveset.add(copy); | |
} | |
user.setTemporaryMoveset(tempMoveset); | |
} | |
return AttackResult.succeeded; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment