mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
- Little fixes
This commit is contained in:
parent
281d88c972
commit
951b944555
3 changed files with 15 additions and 7 deletions
|
@ -46,13 +46,11 @@ import mage.constants.Layer;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
@ -63,7 +61,7 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*/
|
||||
public class KarrthusTyrantOfJund extends CardImpl<KarrthusTyrantOfJund> {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other Dragons you control");
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Dragon creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
|
|
|
@ -76,7 +76,7 @@ public class PardicDragon extends CardImpl<PardicDragon> {
|
|||
this.addAbility(new SuspendAbility(2, new ManaCostsImpl("{R}{R}"), this, true));
|
||||
// Whenever an opponent casts a spell, if Pardic Dragon is suspended, that player may put a time counter on Pardic Dragon.
|
||||
this.addAbility(new ConditionalTriggeredAbility(
|
||||
new OpponentCastsSpellTriggeredAbility(Zone.EXILED, new PardicDragonEffect(), new FilterCard(), false),
|
||||
new OpponentCastsSpellTriggeredAbility(Zone.EXILED, new PardicDragonEffect(), new FilterCard(), false, true),
|
||||
SuspendedCondition.getInstance(),
|
||||
"Whenever an opponent casts a spell, if {this} is suspended, that player may put a time counter on Pardic Dragon."
|
||||
));
|
||||
|
|
|
@ -41,8 +41,10 @@ import mage.target.targetpointer.FixedTarget;
|
|||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class OpponentCastsSpellTriggeredAbility extends TriggeredAbilityImpl<OpponentCastsSpellTriggeredAbility> {
|
||||
|
||||
private static final FilterCard spellCard = new FilterCard("a spell");
|
||||
protected FilterCard filter;
|
||||
protected boolean setTargetPointerPlayer;
|
||||
|
||||
public OpponentCastsSpellTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, spellCard, optional);
|
||||
|
@ -51,25 +53,34 @@ public class OpponentCastsSpellTriggeredAbility extends TriggeredAbilityImpl<Opp
|
|||
public OpponentCastsSpellTriggeredAbility(Effect effect, FilterCard filter, boolean optional) {
|
||||
this(Zone.BATTLEFIELD, effect, filter, optional);
|
||||
}
|
||||
|
||||
|
||||
public OpponentCastsSpellTriggeredAbility(Zone zone, Effect effect, FilterCard filter, boolean optional) {
|
||||
super(zone, effect, optional);
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
public OpponentCastsSpellTriggeredAbility(Zone zone, Effect effect, FilterCard filter, boolean optional, boolean setTargetPointerPlayer) {
|
||||
super(zone, effect, optional);
|
||||
this.filter = filter;
|
||||
this.setTargetPointerPlayer = setTargetPointerPlayer;
|
||||
}
|
||||
|
||||
public OpponentCastsSpellTriggeredAbility(final OpponentCastsSpellTriggeredAbility ability) {
|
||||
super(ability);
|
||||
filter = ability.filter;
|
||||
this.setTargetPointerPlayer = ability.setTargetPointerPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && filter.match(spell, game)) {
|
||||
if (spell != null && filter.match(spell, game) && !setTargetPointerPlayer) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
return true;
|
||||
} else {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -84,5 +95,4 @@ public class OpponentCastsSpellTriggeredAbility extends TriggeredAbilityImpl<Opp
|
|||
public OpponentCastsSpellTriggeredAbility copy() {
|
||||
return new OpponentCastsSpellTriggeredAbility(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue