mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
Fixed Icingdeath, Frost Tongue not triggering on attack. Closes #9380
This commit is contained in:
parent
1eea93ab68
commit
eb62b921f0
1 changed files with 24 additions and 2 deletions
|
|
@ -11,10 +11,14 @@ import mage.constants.SubType;
|
|||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -25,7 +29,7 @@ public class IcingdeathFrostTongueToken extends TokenImpl {
|
|||
= new FilterCreaturePermanent("creature defending player controls");
|
||||
|
||||
static {
|
||||
filter.add(DefendingPlayerControlsPredicate.instance);
|
||||
filter.add(IcingdeathFrostTonguePredicate.instance);
|
||||
}
|
||||
|
||||
public IcingdeathFrostTongueToken() {
|
||||
|
|
@ -61,3 +65,21 @@ public class IcingdeathFrostTongueToken extends TokenImpl {
|
|||
return new IcingdeathFrostTongueToken(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum IcingdeathFrostTonguePredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
return Optional.ofNullable(input.getSource().getSourcePermanentOrLKI(game))
|
||||
.map(Permanent::getAttachedTo)
|
||||
.map(uuid -> game.getCombat().getDefendingPlayerId(uuid, game))
|
||||
.map(input.getObject()::isControlledBy)
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue