mirror of
https://github.com/correl/mage.git
synced 2025-04-12 01:01:04 -09:00
- Fixed #6872. ¯\_(ツ)_/¯
This commit is contained in:
parent
83f7ae377a
commit
bfa54c3418
2 changed files with 27 additions and 12 deletions
Mage.Sets/src/mage/cards/d
Mage/src/main/java/mage/abilities/effects/common/continuous
|
@ -26,6 +26,7 @@ import mage.game.events.GameEvent;
|
|||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
@ -42,19 +43,22 @@ public final class DomriChaosBringer extends CardImpl {
|
|||
// +1: Add {R} or {G}. If that mana is spent on a creature spell, it gains riot.
|
||||
this.addAbility(new LoyaltyAbility(new DomriChaosBringerEffect(), 1));
|
||||
|
||||
// −3: Look at the top four cards of your library. You may reveal up to two creature cards from among them and put them into your hand. Put the rest on the bottom of your library in a random order.
|
||||
// −3: Look at the top four cards of your library. You may reveal up to two
|
||||
// creature cards from among them and put them into your hand. Put the rest
|
||||
// on the bottom of your library in a random order.
|
||||
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
|
||||
StaticValue.get(4), false, StaticValue.get(2),
|
||||
StaticFilters.FILTER_CARD_CREATURE, Zone.LIBRARY, false,
|
||||
true, true, Zone.HAND, false, false, false
|
||||
).setText(
|
||||
"Look at the top four cards of your library. " +
|
||||
"You may reveal up to two creature cards from among them " +
|
||||
"and put them into your hand. Put the rest on the bottom of your library " +
|
||||
"in a random order."
|
||||
"Look at the top four cards of your library. "
|
||||
+ "You may reveal up to two creature cards from among them "
|
||||
+ "and put them into your hand. Put the rest on the bottom of your library "
|
||||
+ "in a random order."
|
||||
), -3));
|
||||
|
||||
// −8: You get an emblem with "At the beginning of each end step, create a 4/4 red and green Beast creature token with trample."
|
||||
// −8: You get an emblem with "At the beginning of each end step, create a 4/4 red
|
||||
// and green Beast creature token with trample."
|
||||
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new DomriChaosBringerEmblem()), -8));
|
||||
}
|
||||
|
||||
|
@ -136,9 +140,15 @@ class DomriChaosBringerTriggeredAbility extends DelayedTriggeredAbility {
|
|||
if (mo == null || !mo.isCreature()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
StackObject stackObject = game.getStack().getStackObject(event.getTargetId());
|
||||
|
||||
if (stackObject == null) {
|
||||
return false;
|
||||
}
|
||||
this.getEffects().clear();
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new CardIdPredicate(event.getTargetId()));
|
||||
filter.add(new CardIdPredicate(stackObject.getSourceId()));
|
||||
this.addEffect(new GainAbilityControlledSpellsEffect(new RiotAbility(), filter));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -44,9 +44,11 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && permanent != null) {
|
||||
if (player != null
|
||||
&& permanent != null) {
|
||||
for (Card card : game.getExile().getAllCards(game)) {
|
||||
if (card.isOwnedBy(source.getControllerId()) && filter.match(card, game)) {
|
||||
if (card.isOwnedBy(source.getControllerId())
|
||||
&& filter.match(card, game)) {
|
||||
game.getState().addOtherAbility(card, ability);
|
||||
}
|
||||
}
|
||||
|
@ -67,16 +69,19 @@ public class GainAbilityControlledSpellsEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
// only spells cast, so no copies of spells
|
||||
if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.isControlledBy(source.getControllerId())) {
|
||||
if ((stackObject instanceof Spell)
|
||||
&& !stackObject.isCopy()
|
||||
&& stackObject.isControlledBy(source.getControllerId())) {
|
||||
Card card = game.getCard(stackObject.getSourceId());
|
||||
if (card != null && filter.match(card, game)) {
|
||||
if (card != null
|
||||
&& filter.match(card, game)) {
|
||||
if (!card.hasAbility(ability, game)) {
|
||||
game.getState().addOtherAbility(card, ability);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue