forked from External/mage
Fixed that creatures forced to attack that have to pay a cost to attack lock the UI (not completed for all existing cards yet).
This commit is contained in:
parent
5f5513f4ed
commit
15fe85c5da
13 changed files with 326 additions and 301 deletions
|
|
@ -324,6 +324,30 @@ public class ContinuousEffects implements Serializable {
|
|||
return effects;
|
||||
}
|
||||
|
||||
public boolean checkIfThereArePayCostToAttackBlockEffects(GameEvent event, Game game) {
|
||||
for (ReplacementEffect effect : replacementEffects) {
|
||||
if (!effect.checksEventType(event, game)) {
|
||||
continue;
|
||||
}
|
||||
if (effect instanceof PayCostToAttackBlockEffect) {
|
||||
HashSet<Ability> abilities = replacementEffects.getAbility(effect.getId());
|
||||
for (Ability ability : abilities) {
|
||||
// for replacment effects of static abilities do not use LKI to check if to apply
|
||||
if (ability.getAbilityType() != AbilityType.STATIC || ability.isInUseableZone(game, null, event)) {
|
||||
if (effect.getDuration() != Duration.OneUse || !effect.isUsed()) {
|
||||
if (!game.getScopeRelevant() || effect.hasSelfScope() || !event.getTargetId().equals(ability.getSourceId())) {
|
||||
if (effect.applies(event, ability, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param event
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue