Can block any number of creatures - fixed that it can be broken with some of "can block an additional creature" effects

This commit is contained in:
Oleg Agafonov 2025-04-27 23:34:58 +04:00
parent db9bdc05c2
commit 49c28458ec
6 changed files with 24 additions and 24 deletions

View file

@ -45,7 +45,9 @@ public class CanBlockAdditionalCreatureAllEffect extends ContinuousEffectImpl {
if (permanent != null) {
// maxBlocks = 0 equals to "can block any number of creatures"
if (amount > 0) {
permanent.setMaxBlocks(permanent.getMaxBlocks() + amount);
if (permanent.getMaxBlocks() > 0) {
permanent.setMaxBlocks(permanent.getMaxBlocks() + amount);
}
} else {
permanent.setMaxBlocks(0);
}

View file

@ -53,7 +53,9 @@ public class CanBlockAdditionalCreatureEffect extends ContinuousEffectImpl {
if (permanent != null) {
// maxBlocks = 0 equals to "can block any number of creatures"
if (amount > 0) {
permanent.setMaxBlocks(permanent.getMaxBlocks() + amount);
if (permanent.getMaxBlocks() > 0) {
permanent.setMaxBlocks(permanent.getMaxBlocks() + amount);
}
} else {
permanent.setMaxBlocks(0);
}

View file

@ -53,7 +53,9 @@ public class CanBlockAdditionalCreatureTargetEffect extends ContinuousEffectImpl
// maxBlocks = 0 equals to "can block any number of creatures"
if (amount > 0) {
target.setMaxBlocks(target.getMaxBlocks() + amount);
if (target.getMaxBlocks() > 0) {
target.setMaxBlocks(target.getMaxBlocks() + amount);
}
} else {
target.setMaxBlocks(0);
}