mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Some minor mainly fixed target changes.
This commit is contained in:
parent
b33e863262
commit
dfb9446994
5 changed files with 33 additions and 47 deletions
|
@ -41,9 +41,9 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
|
@ -60,7 +60,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
public class CoffinQueen extends CardImpl {
|
||||
|
||||
public CoffinQueen(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(1);
|
||||
|
@ -68,14 +68,14 @@ public class CoffinQueen extends CardImpl {
|
|||
|
||||
// You may choose not to untap Coffin Queen during your untap step.
|
||||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
|
||||
|
||||
// {2}{B}, {tap}: Put target creature card from a graveyard onto the battlefield under your control. When Coffin Queen becomes untapped or you lose control of Coffin Queen, exile that creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new ManaCostsImpl("{2}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card from a graveyard")));
|
||||
ability.addEffect(new CoffinQueenCreateDelayedTriggerEffect());
|
||||
ability.addEffect(new CoffinQueenCreateDelayedTriggerEffect());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public CoffinQueen(final CoffinQueen card) {
|
||||
|
@ -87,33 +87,30 @@ public class CoffinQueen extends CardImpl {
|
|||
return new CoffinQueen(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CoffinQueenCreateDelayedTriggerEffect extends OneShotEffect {
|
||||
|
||||
|
||||
public CoffinQueenCreateDelayedTriggerEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "When Coffin Queen becomes untapped or you lose control of Coffin Queen, exile that creature";
|
||||
this.staticText = "When {this} becomes untapped or you lose control of {this}, exile that creature.";
|
||||
}
|
||||
|
||||
|
||||
public CoffinQueenCreateDelayedTriggerEffect(final CoffinQueenCreateDelayedTriggerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CoffinQueenCreateDelayedTriggerEffect copy() {
|
||||
return new CoffinQueenCreateDelayedTriggerEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent controlledCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (controlledCreature != null) {
|
||||
DelayedTriggeredAbility delayedAbility = new CoffinQueenDelayedTriggeredAbility();
|
||||
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature.getId()));
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
delayedAbility.init(game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(controlledCreature, game));
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -123,7 +120,7 @@ class CoffinQueenCreateDelayedTriggerEffect extends OneShotEffect {
|
|||
class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
CoffinQueenDelayedTriggeredAbility() {
|
||||
super(new ExileTargetEffect(), Duration.EndOfGame, true);
|
||||
super(new ExileTargetEffect(), Duration.EndOfGame, true);
|
||||
}
|
||||
|
||||
CoffinQueenDelayedTriggeredAbility(CoffinQueenDelayedTriggeredAbility ability) {
|
||||
|
@ -136,7 +133,6 @@ class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
|| event.getType() == EventType.UNTAPPED;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (EventType.LOST_CONTROL == event.getType()
|
||||
|
@ -146,14 +142,14 @@ class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
return EventType.UNTAPPED == event.getType()
|
||||
&& event.getTargetId() != null && event.getTargetId().equals(getSourceId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CoffinQueenDelayedTriggeredAbility copy() {
|
||||
return new CoffinQueenDelayedTriggeredAbility(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When {this} becomes untapped or you lose control of {this}, exile that creature";
|
||||
return "When {this} becomes untapped or you lose control of {this}, exile that creature.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
|||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.AdjustingSourceCosts;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.GainLifeTargetEffect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.abilities.effects.common.RegenerateSourceEffect;
|
||||
|
@ -58,7 +57,7 @@ import mage.util.CardUtil;
|
|||
public class LaquatussChampion extends CardImpl {
|
||||
|
||||
public LaquatussChampion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||
this.subtype.add(SubType.NIGHTMARE);
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
||||
|
@ -126,9 +125,7 @@ class LaquatussChampionLeavesBattlefieldTriggeredAbility extends LeavesBattlefie
|
|||
String key = CardUtil.getCardZoneString("targetPlayer", this.getSourceId(), game, true);
|
||||
Object object = game.getState().getValue(key);
|
||||
if (object instanceof UUID) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget((UUID) object));
|
||||
}
|
||||
this.getEffects().setTargetPointer(new FixedTarget((UUID) object));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,19 +24,17 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
|
@ -48,7 +46,6 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class DetainAllEffect extends OneShotEffect {
|
||||
|
||||
private FilterPermanent filter = new FilterPermanent();
|
||||
|
@ -56,7 +53,7 @@ public class DetainAllEffect extends OneShotEffect {
|
|||
public DetainAllEffect(FilterPermanent filter) {
|
||||
super(Outcome.Benefit);
|
||||
this.filter = filter;
|
||||
this.staticText = new StringBuilder("detain ").append(filter.getMessage()).toString();
|
||||
this.staticText = "detain " + filter.getMessage();
|
||||
}
|
||||
|
||||
public DetainAllEffect(final DetainAllEffect effect) {
|
||||
|
@ -73,10 +70,10 @@ public class DetainAllEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
List<FixedTarget> detainedObjects = new ArrayList<>();
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (!game.isSimulation())
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers("Detained permanent: " + permanent.getName());
|
||||
FixedTarget fixedTarget = new FixedTarget(permanent.getId());
|
||||
fixedTarget.init(game, source);
|
||||
}
|
||||
FixedTarget fixedTarget = new FixedTarget(permanent, game);
|
||||
detainedObjects.add(fixedTarget);
|
||||
}
|
||||
|
||||
|
@ -103,23 +100,22 @@ class DetainAllRestrictionEffect extends RestrictionEffect {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
for(FixedTarget fixedTarget :this.detainedObjects) {
|
||||
for (FixedTarget fixedTarget : this.detainedObjects) {
|
||||
Permanent permanent = game.getPermanent(fixedTarget.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("detain").append(getId()).toString(),"[Detained]", game);
|
||||
permanent.addInfo(new StringBuilder("detain").append(getId()).toString(), "[Detained]", game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE)
|
||||
{
|
||||
if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
|
||||
if (game.getActivePlayerId().equals(source.getControllerId()) || game.getPlayer(source.getControllerId()).hasReachedNextTurnAfterLeaving()) {
|
||||
for(FixedTarget fixedTarget :this.detainedObjects) {
|
||||
for (FixedTarget fixedTarget : this.detainedObjects) {
|
||||
Permanent permanent = game.getPermanent(fixedTarget.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("detain").append(getId()).toString(),"", game);
|
||||
permanent.addInfo(new StringBuilder("detain").append(getId()).toString(), "", game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -130,7 +126,7 @@ class DetainAllRestrictionEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
for(FixedTarget fixedTarget :this.detainedObjects) {
|
||||
for (FixedTarget fixedTarget : this.detainedObjects) {
|
||||
UUID targetId = fixedTarget.getFirst(game, source);
|
||||
if (targetId != null && targetId.equals(permanent.getId())) {
|
||||
return true;
|
||||
|
@ -148,7 +144,7 @@ class DetainAllRestrictionEffect extends RestrictionEffect {
|
|||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canUseActivatedAbilities(Permanent permanent, Ability source, Game game) {
|
||||
return false;
|
||||
|
|
|
@ -63,7 +63,7 @@ public class RegenerateAllEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
RegenerateTargetEffect regenEffect = new RegenerateTargetEffect();
|
||||
regenEffect.setTargetPointer(new FixedTarget(permanent.getId()));
|
||||
regenEffect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
game.addEffect(regenEffect, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -38,7 +38,6 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
public class PersistAbility extends DiesTriggeredAbility {
|
||||
|
||||
|
@ -66,8 +65,6 @@ public class PersistAbility extends DiesTriggeredAbility {
|
|||
if (super.checkTrigger(event, game)) {
|
||||
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
|
||||
if (permanent.getCounters(game).getCount(CounterType.M1M1) == 0) {
|
||||
FixedTarget fixedTarget = new FixedTarget(permanent.getId());
|
||||
fixedTarget.init(game, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue