@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
ColoredManaCost cost = new ColoredManaCost(ColoredManaSymbol.R);
if (player != null) {
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability. You may choose new targets for the copy.", source, game)) {
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
StackAbility ability = (StackAbility) getValue("stackAbility");
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (ability != null && controller != null) {
ability.createCopyOnStack(game, source, source.getControllerId(), true);
game.informPlayers(sourcePermanent.getName() + ": " + controller.getLogName() + " copied activated ability");
return true;
}
return false;
}
}
}
return false;
}
}