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:
LevelX2 2015-07-01 02:00:07 +02:00
parent 5f5513f4ed
commit 15fe85c5da
13 changed files with 326 additions and 301 deletions

View file

@ -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