mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Fix dark depths to only put token into play if it was sacrificed successfully
This commit is contained in:
parent
f8902483ea
commit
bd86082100
1 changed files with 35 additions and 7 deletions
|
@ -29,10 +29,10 @@ package mage.sets.coldsnap;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.StateTriggeredAbility;
|
import mage.abilities.StateTriggeredAbility;
|
||||||
import mage.abilities.common.EntersBattlefieldAbility;
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -81,11 +81,42 @@ public class DarkDepths extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DarkDepthsSacrificeEffect extends SacrificeSourceEffect {
|
||||||
|
|
||||||
|
private boolean sacrificed = false;
|
||||||
|
|
||||||
|
public DarkDepthsSacrificeEffect(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DarkDepthsSacrificeEffect(final DarkDepthsSacrificeEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
this.sacrificed = effect.sacrificed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DarkDepthsSacrificeEffect copy() {
|
||||||
|
return new DarkDepthsSacrificeEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
sacrificed = super.apply(game, source);
|
||||||
|
if (sacrificed) {
|
||||||
|
new CreateTokenEffect(new MaritLageToken()).apply(game, source);
|
||||||
|
}
|
||||||
|
return sacrificed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSacrificed() {
|
||||||
|
return sacrificed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class DarkDepthsAbility extends StateTriggeredAbility {
|
class DarkDepthsAbility extends StateTriggeredAbility {
|
||||||
|
|
||||||
public DarkDepthsAbility() {
|
public DarkDepthsAbility() {
|
||||||
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
|
super(Zone.BATTLEFIELD, new DarkDepthsSacrificeEffect());
|
||||||
this.addEffect(new CreateTokenEffect(new MaritLageToken()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DarkDepthsAbility(final DarkDepthsAbility ability) {
|
public DarkDepthsAbility(final DarkDepthsAbility ability) {
|
||||||
|
@ -100,10 +131,7 @@ class DarkDepthsAbility extends StateTriggeredAbility {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Permanent permanent = game.getPermanent(getSourceId());
|
Permanent permanent = game.getPermanent(getSourceId());
|
||||||
if(permanent != null && permanent.getCounters().getCount(CounterType.ICE) == 0){
|
return permanent != null && permanent.getCounters().getCount(CounterType.ICE) == 0;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue