forked from External/mage
fix Rikku, Resourceful Guardian
This commit is contained in:
parent
6f398ca2fc
commit
6dd4f33db2
1 changed files with 11 additions and 41 deletions
|
|
@ -2,22 +2,22 @@ package mage.cards.r;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
|
||||||
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||||
|
import mage.abilities.common.PutCounterOnPermanentTriggeredAbility;
|
||||||
import mage.abilities.costs.common.TapSourceCost;
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect;
|
import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect;
|
||||||
import mage.abilities.effects.common.counter.MoveCounterTargetsEffect;
|
import mage.abilities.effects.common.counter.MoveCounterTargetsEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.SuperType;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.target.common.TargetControlledCreaturePermanent;
|
import mage.target.common.TargetControlledCreaturePermanent;
|
||||||
import mage.target.common.TargetOpponentsCreaturePermanent;
|
import mage.target.common.TargetOpponentsCreaturePermanent;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,7 +35,12 @@ public final class RikkuResourcefulGuardian extends CardImpl {
|
||||||
this.toughness = new MageInt(3);
|
this.toughness = new MageInt(3);
|
||||||
|
|
||||||
// Whenever you put one or more counters on a creature, until end of turn, that creature can't be blocked by creatures your opponents control.
|
// Whenever you put one or more counters on a creature, until end of turn, that creature can't be blocked by creatures your opponents control.
|
||||||
this.addAbility(new RikkuResourcefulGuardianTriggeredAbility());
|
this.addAbility(new PutCounterOnPermanentTriggeredAbility(
|
||||||
|
new CantBeBlockedByAllTargetEffect(
|
||||||
|
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, Duration.EndOfTurn
|
||||||
|
).setText("until end of turn, that creature can't be blocked by creatures your opponents control"),
|
||||||
|
null, StaticFilters.FILTER_PERMANENT_CREATURE, true, false
|
||||||
|
));
|
||||||
|
|
||||||
// Steal -- {1}, {T}: Move a counter from target creature an opponent controls onto target creature you control. Activate only as a sorcery.
|
// Steal -- {1}, {T}: Move a counter from target creature an opponent controls onto target creature you control. Activate only as a sorcery.
|
||||||
Ability ability = new ActivateAsSorceryActivatedAbility(new MoveCounterTargetsEffect(), new GenericManaCost(1));
|
Ability ability = new ActivateAsSorceryActivatedAbility(new MoveCounterTargetsEffect(), new GenericManaCost(1));
|
||||||
|
|
@ -54,38 +59,3 @@ public final class RikkuResourcefulGuardian extends CardImpl {
|
||||||
return new RikkuResourcefulGuardian(this);
|
return new RikkuResourcefulGuardian(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RikkuResourcefulGuardianTriggeredAbility extends TriggeredAbilityImpl {
|
|
||||||
|
|
||||||
RikkuResourcefulGuardianTriggeredAbility() {
|
|
||||||
super(Zone.BATTLEFIELD, new CantBeBlockedByAllTargetEffect(
|
|
||||||
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, Duration.EndOfTurn
|
|
||||||
).setText("until end of turn, that creature can't be blocked by creatures your opponents control"));
|
|
||||||
this.setTriggerPhrase("Whenever you put one or more counters on a creature, ");
|
|
||||||
}
|
|
||||||
|
|
||||||
private RikkuResourcefulGuardianTriggeredAbility(final RikkuResourcefulGuardianTriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RikkuResourcefulGuardianTriggeredAbility copy() {
|
|
||||||
return new RikkuResourcefulGuardianTriggeredAbility(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == GameEvent.EventType.COUNTERS_ADDED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
return isControlledBy(event.getPlayerId())
|
|
||||||
&& Optional
|
|
||||||
.ofNullable(event)
|
|
||||||
.map(GameEvent::getTargetId)
|
|
||||||
.map(game::getPermanent)
|
|
||||||
.map(permanent -> permanent.isCreature(game))
|
|
||||||
.orElse(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue