use of mage.abilities.effects.common.continuous.GainAbilitySourceEffect in project mage by magefree.
the class FigureOfDestinyWarriorEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null || !permanent.hasSubtype(SubType.WARRIOR, game)) {
return false;
}
game.addEffect(new AddCardSubTypeSourceEffect(Duration.Custom, SubType.KITHKIN, SubType.SPIRIT, SubType.WARRIOR, SubType.AVATAR), source);
game.addEffect(new SetPowerToughnessSourceEffect(8, 8, Duration.Custom, SubLayer.SetPT_7b), source);
game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.Custom), source);
game.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.Custom), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilitySourceEffect in project mage by magefree.
the class WardenOfTheFirstTreeEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent == null || !permanent.hasSubtype(SubType.WARRIOR, game)) {
return false;
}
game.addEffect(new AddCardSubTypeSourceEffect(Duration.Custom, SubType.HUMAN, SubType.SPIRIT, SubType.WARRIOR), source);
game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.Custom), source);
game.addEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance(), Duration.Custom), source);
return true;
}
use of mage.abilities.effects.common.continuous.GainAbilitySourceEffect in project mage by magefree.
the class MoltenSentryEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentEntering(source.getSourceId());
if (controller != null && permanent != null) {
if (controller.flipCoin(source, game, false)) {
game.informPlayers("Heads: " + permanent.getLogName() + " enters the battlefield as a 5/2 creature with haste");
permanent.getPower().modifyBaseValue(5);
permanent.getToughness().modifyBaseValue(2);
game.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield), source);
return true;
} else {
game.informPlayers("Tails: " + permanent.getLogName() + " enters the battlefield as a 2/5 creature with defender");
permanent.getPower().modifyBaseValue(2);
permanent.getToughness().modifyBaseValue(5);
game.addEffect(new GainAbilitySourceEffect(DefenderAbility.getInstance(), Duration.WhileOnBattlefield), source);
return true;
}
}
return false;
}
use of mage.abilities.effects.common.continuous.GainAbilitySourceEffect in project mage by magefree.
the class UrzasAvengerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanent(source.getSourceId());
if (sourceObject != null) {
sourceObject.addPower(-1);
sourceObject.addToughness(-1);
game.addEffect(new GainAbilitySourceEffect(gainedAbility, Duration.EndOfTurn), source);
return true;
}
return false;
}
use of mage.abilities.effects.common.continuous.GainAbilitySourceEffect in project mage by magefree.
the class CruelDeceiverEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Cards cards = new CardsImpl();
Card card = controller.getLibrary().getFromTop(game);
if (card != null) {
cards.add(card);
controller.revealCards(sourceObject.getIdName(), cards, game);
if (card.isLand(game)) {
game.addEffect(new GainAbilitySourceEffect(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), false, false, true), Duration.EndOfTurn), source);
}
}
return true;
}
return false;
}
Aggregations