mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Finished Godsend.
This commit is contained in:
parent
9c3d9fb290
commit
6d2499e52f
2 changed files with 14 additions and 7 deletions
|
@ -41,6 +41,7 @@ import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||||
import mage.abilities.keyword.EquipAbility;
|
import mage.abilities.keyword.EquipAbility;
|
||||||
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
@ -50,6 +51,7 @@ import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.permanent.PermanentIdPredicate;
|
import mage.filter.predicate.permanent.PermanentIdPredicate;
|
||||||
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.combat.CombatGroup;
|
import mage.game.combat.CombatGroup;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
@ -219,12 +221,17 @@ class GodsendReplacementEffect extends ReplacementEffectImpl<GodsendReplacementE
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||||
List<String> nameOfExiledCards = new ArrayList<>();
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
// game.getExile()
|
if (object != null) {
|
||||||
// MageObject object = game.getObject(event.getSourceId());
|
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
|
||||||
// if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString()))) {
|
if ((exileZone != null)) {
|
||||||
// return true;
|
for(Card card:exileZone.getCards(game)) {
|
||||||
// }
|
if ((card.getName().equals(object.getName()))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
public class CountersCount implements DynamicValue {
|
public class CountersCount implements DynamicValue {
|
||||||
private CounterType counter;
|
private final CounterType counter;
|
||||||
|
|
||||||
public CountersCount(CounterType counter) {
|
public CountersCount(CounterType counter) {
|
||||||
this.counter = counter;
|
this.counter = counter;
|
||||||
|
|
Loading…
Reference in a new issue