mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
[MH2] fixed Urza's Saga not being sacrificed immediately when Blood Moon is on battlefield (ability still triggers on etb, related to Blood Moon issue)
This commit is contained in:
parent
348e6d94cb
commit
dfc2624d32
1 changed files with 27 additions and 27 deletions
|
@ -2186,34 +2186,34 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
// 704.5s If the number of lore counters on a Saga permanent is greater than or equal to its final chapter number
|
// 704.5s If the number of lore counters on a Saga permanent is greater than or equal to its final chapter number
|
||||||
// and it isn't the source of a chapter ability that has triggered but not yet left the stack, that Saga's controller sacrifices it.
|
// and it isn't the source of a chapter ability that has triggered but not yet left the stack, that Saga's controller sacrifices it.
|
||||||
if (perm.hasSubtype(SubType.SAGA, this)) {
|
if (perm.hasSubtype(SubType.SAGA, this)) {
|
||||||
for (Ability sagaAbility : perm.getAbilities()) {
|
int maxChapter = perm
|
||||||
if (sagaAbility instanceof SagaAbility) {
|
.getAbilities(this)
|
||||||
int maxChapter = ((SagaAbility) sagaAbility).getMaxChapter().getNumber();
|
.stream()
|
||||||
if (maxChapter <= perm.getCounters(this).getCount(CounterType.LORE)) {
|
.filter(SagaAbility.class::isInstance)
|
||||||
boolean noChapterAbilityTriggeredOrOnStack = true;
|
.map(SagaAbility.class::cast)
|
||||||
// Check chapter abilities on stack
|
.map(SagaAbility::getMaxChapter)
|
||||||
for (StackObject stackObject : getStack()) {
|
.mapToInt(SagaChapter::getNumber)
|
||||||
if (stackObject.getSourceId().equals(perm.getId()) && SagaAbility.isChapterAbility(stackObject)) {
|
.max()
|
||||||
noChapterAbilityTriggeredOrOnStack = false;
|
.orElse(0);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (noChapterAbilityTriggeredOrOnStack) {
|
|
||||||
for (TriggeredAbility trigger : state.getTriggered(perm.getControllerId())) {
|
|
||||||
if (SagaAbility.isChapterAbility(trigger) && trigger.getSourceId().equals(perm.getId())) {
|
|
||||||
noChapterAbilityTriggeredOrOnStack = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (noChapterAbilityTriggeredOrOnStack) {
|
|
||||||
// After the last chapter ability has left the stack, you'll sacrifice the Saga
|
|
||||||
perm.sacrifice(null, this);
|
|
||||||
somethingHappened = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
boolean sacSaga = maxChapter <= perm
|
||||||
|
.getCounters(this)
|
||||||
|
.getCount(CounterType.LORE)
|
||||||
|
&& this.getStack()
|
||||||
|
.stream()
|
||||||
|
.filter(SagaAbility::isChapterAbility)
|
||||||
|
.map(StackObject::getSourceId)
|
||||||
|
.noneMatch(perm.getId()::equals)
|
||||||
|
&& this.state
|
||||||
|
.getTriggered(perm.getControllerId())
|
||||||
|
.stream()
|
||||||
|
.filter(SagaAbility::isChapterAbility)
|
||||||
|
.map(Ability::getSourceId)
|
||||||
|
.noneMatch(perm.getId()::equals);
|
||||||
|
if (sacSaga) {
|
||||||
|
// After the last chapter ability has left the stack, you'll sacrifice the Saga
|
||||||
|
perm.sacrifice(null, this);
|
||||||
|
somethingHappened = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_PERMANENT_LEGENDARY.match(perm, this)) {
|
if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_PERMANENT_LEGENDARY.match(perm, this)) {
|
||||||
|
|
Loading…
Reference in a new issue