use of mage.abilities.keyword.RampageAbility in project mage by magefree.
the class RapidFireEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (controller != null && permanent != null) {
if (!permanent.getAbilities().containsClass(RampageAbility.class)) {
ContinuousEffect effect = new GainAbilityTargetEffect(new RampageAbility(2), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(effect, source);
}
}
return false;
}
use of mage.abilities.keyword.RampageAbility in project mage by magefree.
the class GabrielAngelfireGainAbilityEffect method init.
@Override
public void init(Ability source, Game game) {
super.init(source, game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Choice choice = new ChoiceImpl(true);
choice.setMessage("Choose one");
choice.setChoices(choices);
if (controller.choose(outcome, choice, game)) {
switch(choice.getChoice()) {
case "First strike":
ability = FirstStrikeAbility.getInstance();
break;
case "Trample":
ability = TrampleAbility.getInstance();
break;
case "Rampage 3":
ability = new RampageAbility(3);
break;
default:
ability = FlyingAbility.getInstance();
break;
}
} else {
discard();
}
}
}
Aggregations