mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
- Code by Noxx to address the Blood Moon/Urborgtoy layering issue. Layer test updated.
This commit is contained in:
parent
d4eda294f1
commit
6da1112a89
2 changed files with 47 additions and 3 deletions
|
|
@ -33,8 +33,10 @@ import java.util.Map.Entry;
|
|||
import java.util.stream.Collectors;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.*;
|
||||
import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect;
|
||||
import mage.abilities.effects.common.continuous.CommanderReplacementEffect;
|
||||
import mage.abilities.keyword.SpliceOntoArcaneAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.*;
|
||||
|
|
@ -1037,10 +1039,25 @@ public class ContinuousEffects implements Serializable {
|
|||
private void applyContinuousEffect(ContinuousEffect effect, Layer currentLayer, Game game) {
|
||||
Set<Ability> abilities = layeredEffects.getAbility(effect.getId());
|
||||
for (Ability ability : abilities) {
|
||||
effect.apply(currentLayer, SubLayer.NA, ability, game);
|
||||
//effect.apply(currentLayer, SubLayer.NA, ability, game);
|
||||
if (isAbilityStillExists(game, ability, effect)) {
|
||||
effect.apply(currentLayer, SubLayer.NA, ability, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAbilityStillExists(final Game game, final Ability ability, ContinuousEffect effect) {
|
||||
final Card card = game.getPermanentOrLKIBattlefield(ability.getSourceId());
|
||||
if (!(effect instanceof BecomesFaceDownCreatureEffect)) {
|
||||
if (card != null) {
|
||||
if (!card.getAbilities(game).contains(ability)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Set<Ability> getLayeredEffectAbilities(ContinuousEffect effect) {
|
||||
return layeredEffects.getAbility(effect.getId());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue