mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09:00
* Fixed a bug that allowed to apply damage prevention replacement effects under certain circumstances multiple times to the same event.
This commit is contained in:
parent
84246e1935
commit
1a1fc09221
2 changed files with 6 additions and 1 deletions
|
@ -87,7 +87,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
private static final Logger log = Logger.getLogger(HumanPlayer.class);
|
private static final Logger log = Logger.getLogger(HumanPlayer.class);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
replacementEffectChoice.setMessage("Choose replacement effect");
|
replacementEffectChoice.setMessage("Choose replacement effect to resolve first");
|
||||||
staticOptions.put("UI.right.btn.text", "Done");
|
staticOptions.put("UI.right.btn.text", "Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -359,6 +359,11 @@ public class ContinuousEffects implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (PreventionEffect effect: preventionEffects) {
|
for (PreventionEffect effect: preventionEffects) {
|
||||||
|
if (event.getAppliedEffects() != null && event.getAppliedEffects().contains(effect.getId())) {
|
||||||
|
// Effect already applied to this event, ignore it
|
||||||
|
// TODO: Handle also gained effect that are connected to different abilities.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
HashSet<Ability> abilities = preventionEffects.getAbility(effect.getId());
|
HashSet<Ability> abilities = preventionEffects.getAbility(effect.getId());
|
||||||
HashSet<Ability> applicableAbilities = new HashSet<>();
|
HashSet<Ability> applicableAbilities = new HashSet<>();
|
||||||
for (Ability ability : abilities) {
|
for (Ability ability : abilities) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue