mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
- Fixed #8060
This commit is contained in:
parent
c4dc83dec9
commit
d9884aa9de
1 changed files with 34 additions and 10 deletions
|
|
@ -78,19 +78,43 @@ class LaeliaTheBladeReforgedAddCountersTriggeredAbility extends TriggeredAbility
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||||
return zEvent.getToZone() == Zone.EXILED
|
final int numberExiled = zEvent.getCards().size();
|
||||||
&& (zEvent.getFromZone() == Zone.LIBRARY || zEvent.getFromZone() == Zone.GRAVEYARD)
|
if (zEvent.getToZone() != Zone.EXILED
|
||||||
&& game
|
|| numberExiled == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
switch (zEvent.getFromZone()) {
|
||||||
|
case LIBRARY:
|
||||||
|
if (zEvent
|
||||||
.getCards()
|
.getCards()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(Card::getOwnerId)
|
.map(Card::getOwnerId)
|
||||||
.anyMatch(this::isControlledBy);
|
.anyMatch(this::isControlledBy)
|
||||||
|
&& numberExiled > 0) {
|
||||||
|
this.getEffects().clear();
|
||||||
|
this.getEffects().add(new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case GRAVEYARD:
|
||||||
|
if (zEvent
|
||||||
|
.getCards()
|
||||||
|
.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(Card::getOwnerId)
|
||||||
|
.anyMatch(this::isControlledBy)
|
||||||
|
&& numberExiled > 0) {
|
||||||
|
this.getEffects().clear();
|
||||||
|
this.getEffects().add(new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever one or more cards are put into exile from your library " +
|
return "Whenever one or more cards are put into exile from your library "
|
||||||
"and/or your graveyard, put a +1/+1 counter on {this}.";
|
+ "and/or your graveyard, put a +1/+1 counter on {this}.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue