Added ConditionalPreventionEffect to support prevention effects with conditions (#5738)

This commit is contained in:
Oleg Agafonov 2019-05-01 12:49:19 +04:00
parent f25f7a0f68
commit 367a1fd189
7 changed files with 340 additions and 18 deletions

View file

@ -369,6 +369,7 @@ public class ContinuousEffects implements Serializable {
replaceEffects.put(effect, applicableAbilities);
}
}
for (Iterator<PreventionEffect> iterator = preventionEffects.iterator(); iterator.hasNext(); ) {
PreventionEffect effect = iterator.next();
if (!effect.checksEventType(event, game)) {
@ -394,6 +395,7 @@ public class ContinuousEffects implements Serializable {
replaceEffects.put(effect, applicableAbilities);
}
}
return replaceEffects;
}