Ejemplo n.º 1
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player you = game.getPlayer(source.getControllerId());
   if (you != null) {
     Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source));
     if (spell != null) {
       ObjectColor color1 =
           new ObjectColor((String) game.getState().getValue(source.getSourceId() + "_color1"));
       ObjectColor color2 =
           new ObjectColor((String) game.getState().getValue(source.getSourceId() + "_color2"));
       int amount = 0;
       if (spell.getColor(game).contains(color1)) {
         ++amount;
       }
       if (spell.getColor(game).contains(color2)) {
         ++amount;
       }
       if (amount > 0) {
         you.gainLife(amount, game);
         return true;
       }
     }
   }
   return false;
 }
Ejemplo n.º 2
0
 @Override
 public boolean checkTrigger(GameEvent event, Game game) {
   if (event.getType() == GameEvent.EventType.SPELL_CAST) {
     Spell spell = game.getStack().getSpell(event.getTargetId());
     if (spell != null && spell.getColor().contains(ObjectColor.GREEN)) {
       return true;
     }
   }
   return false;
 }