use of mage.abilities.effects.common.continuous.GainAbilityControlledEffect in project mage by magefree.
the class BoldDefenseEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
if (KickedCondition.instance.apply(game, source)) {
game.addEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn), source);
game.addEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE), source);
} else {
game.addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn), source);
}
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilityControlledEffect in project mage by magefree.
the class EonFrolickerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player == null) {
return false;
}
game.getState().getTurnMods().add(new TurnMod(player.getId(), false));
FilterPlayer filter = new FilterPlayer(player.getName());
filter.add(new PlayerIdPredicate(player.getId()));
Ability ability = new ProtectionAbility(filter);
game.addEffect(new GainAbilityControlledEffect(ability, Duration.UntilYourNextTurn, StaticFilters.FILTER_PERMANENT_PLANESWALKER), source);
game.addEffect(new GainAbilityControllerEffect(ability, Duration.UntilYourNextTurn), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilityControlledEffect in project mage by magefree.
the class LenaSelflessChampionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (permanent == null) {
return false;
}
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, permanent.getPower().getValue()));
game.addEffect(new GainAbilityControlledEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn, filter), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilityControlledEffect in project mage by magefree.
the class LinvalaShieldOfSeaGateEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Ability ability = player.chooseUse(Outcome.Neutral, "Choose hexproof or indestructible", null, "Hexproof", "Indestructible", source, game) ? HexproofAbility.getInstance() : IndestructibleAbility.getInstance();
game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURE), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilityControlledEffect in project mage by magefree.
the class VeilOfSummerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new GainAbilityControlledEffect(HexproofFromBlueAbility.getInstance(), Duration.EndOfTurn), source);
game.addEffect(new GainAbilityControlledEffect(HexproofFromBlackAbility.getInstance(), Duration.EndOfTurn), source);
game.addEffect(new GainAbilityControllerEffect(HexproofFromBlueAbility.getInstance(), Duration.EndOfTurn), source);
game.addEffect(new GainAbilityControllerEffect(HexproofFromBlackAbility.getInstance(), Duration.EndOfTurn), source);
return true;
}
Aggregations