-
-
Save Flashback083/619edb1d638a1cb6f72b73b0211038d0 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 void applySwitchInEffect(PixelmonWrapper newPokemon) { | |
if (newPokemon.bc.simulateMode) { | |
return; | |
} | |
PixelmonWrapper target = newPokemon.bc.getOppositePokemon(newPokemon); | |
if (target.getBattleAbility() instanceof Illusion && ((Illusion)target.getBattleAbility()).disguisedPokemon != null || target.hasStatus(StatusType.Substitute, StatusType.Transformed)) { | |
return; | |
} | |
newPokemon.bc.sendToAll("pixelmon.abilities.imposter", newPokemon.getNickname(), target.getNickname()); | |
EntityDataManager dataManager = newPokemon.entity.getDataManager(); | |
dataManager.set(EntityPixelmon.dwTransformation, -1); | |
Transformed transformed = new Transformed(newPokemon, target); | |
if (newPokemon.entity.getSpecies().is(EnumSpecies.Ditto) && target.entity.getSpecies().is(EnumSpecies.Mimikyu)){ | |
newPokemon.addStatus(transformed, target); | |
AbilityBase ability = AbilityBase.getAbility("Imposter").get(); | |
newPokemon.setTempAbility(ability); | |
}else{ | |
newPokemon.addStatus(transformed, target); | |
} | |
Moveset tempMoveset = new Moveset().withPokemon(newPokemon.pokemon); | |
for (Attack a : target.getMoveset()) { | |
if (a == null) continue; | |
Attack copy = a.copy(); | |
copy.pp = 5; | |
copy.overridePPMax(5); | |
tempMoveset.add(copy); | |
} | |
newPokemon.setTemporaryMoveset(tempMoveset); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment