Пример #1
0
 @Override
 public boolean apply(Game game, Ability source) {
   Cost cost = new GenericManaCost(1);
   cost.clearPaid();
   if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
     super.apply(game, source);
   }
   return true;
 }
Пример #2
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     CreateTokenEffect effect = new CreateTokenEffect(new ElfToken(), 2);
     effect.apply(game, source);
     if (ClashEffect.getInstance().apply(game, source)) {
       for (UUID tokenId : effect.getLastAddedTokenIds()) {
         Permanent token = game.getPermanent(tokenId);
         if (token != null) {
           ContinuousEffect continuousEffect =
               new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn);
           continuousEffect.setTargetPointer(new FixedTarget(tokenId));
           game.addEffect(continuousEffect, source);
         }
       }
     }
     return true;
   }
   return false;
 }