mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
- a real fix for #5630
This commit is contained in:
parent
d4ab251c37
commit
4c88d2ae5e
1 changed files with 9 additions and 3 deletions
|
|
@ -634,13 +634,19 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return false;
|
||||
}
|
||||
if (source != null) {
|
||||
// there is only variant of shroud, so check the instance and any asthougheffects that would ignore it
|
||||
if (abilities.containsKey(ShroudAbility.getInstance().getId())
|
||||
&& game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.SHROUD, null, sourceControllerId, game) == null) {
|
||||
return false;
|
||||
}
|
||||
if (abilities.containsKey(HexproofAbility.getInstance().getId())
|
||||
&& game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game) == null) {
|
||||
return false;
|
||||
// check for all variants of hexproof and any asthougheffects that would ignore it
|
||||
// TODO there may be "prevented by rule-modification" effects, so add them if known
|
||||
for (Ability a : abilities) {
|
||||
if (a instanceof HexproofBaseAbility
|
||||
&& ((HexproofBaseAbility) a).checkObject(source, game)
|
||||
&& game.getContinuousEffects().asThough(this.getId(), AsThoughEffectType.HEXPROOF, null, sourceControllerId, game) == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !hasProtectionFrom(source, game);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue