Finished Godsend.

This commit is contained in:
LevelX2 2014-04-09 00:27:35 +02:00
parent 9c3d9fb290
commit 6d2499e52f
2 changed files with 14 additions and 7 deletions

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continious.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
@ -50,6 +51,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
@ -219,12 +221,17 @@ class GodsendReplacementEffect extends ReplacementEffectImpl<GodsendReplacementE
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
List<String> nameOfExiledCards = new ArrayList<>();
// game.getExile()
// MageObject object = game.getObject(event.getSourceId());
// if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
// return true;
// }
MageObject object = game.getObject(event.getSourceId());
if (object != null) {
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if ((exileZone != null)) {
for(Card card:exileZone.getCards(game)) {
if ((card.getName().equals(object.getName()))) {
return true;
}
}
}
}
}
return false;
}

View file

@ -9,7 +9,7 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
public class CountersCount implements DynamicValue {
private CounterType counter;
private final CounterType counter;
public CountersCount(CounterType counter) {
this.counter = counter;