if (controller.chooseTarget(outcome, target, source, game)) {
Permanent attackingCreature = game.getPermanent(target.getFirstTarget());
if (attackingCreature != null) {
int newSourcePower = attackingCreature.getPower().getValue();
int newAttackerPower = sourceCreature.getPower().getValue();
ContinuousEffect effect = new SetPowerToughnessTargetEffect(newSourcePower, sourceCreature.getToughness().getValue(), Duration.EndOfCombat);
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
game.addEffect(effect, source);
effect = new SetPowerToughnessTargetEffect(newAttackerPower, attackingCreature.getToughness().getValue(), Duration.EndOfCombat);
effect.setTargetPointer(new FixedTarget(attackingCreature.getId()));
game.addEffect(effect, source);
return true;
}
}
}