Fix conditional "must be blocked if able" (#11436)

* Add missing overrides to ConditionalRequirementEffect.java
This commit is contained in:
Daniel Cowman 2023-11-19 21:49:19 -05:00 committed by GitHub
parent 8ad53750ee
commit 8a007c9953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,6 +125,16 @@ public class ConditionalRequirementEffect extends RequirementEffect {
return false;
}
@Override
public boolean mustBlockAllAttackers(Game game) {
if (conditionState) {
return effect.mustBlockAllAttackers(game);
} else if (otherwiseEffect != null) {
return otherwiseEffect.mustBlockAllAttackers(game);
}
return false;
}
@Override
public UUID mustAttackDefender(Ability source, Game game) {
if (conditionState) {
@ -145,6 +155,26 @@ public class ConditionalRequirementEffect extends RequirementEffect {
return null;
}
@Override
public UUID mustBlockAttackerIfElseUnblocked(Ability source, Game game) {
if (conditionState) {
return effect.mustBlockAttackerIfElseUnblocked(source, game);
} else if (otherwiseEffect != null) {
return otherwiseEffect.mustBlockAttackerIfElseUnblocked(source, game);
}
return null;
}
@Override
public int getMinNumberOfBlockers() {
if (conditionState) {
return effect.getMinNumberOfBlockers();
} else if (otherwiseEffect != null) {
return otherwiseEffect.getMinNumberOfBlockers();
}
return super.getMinNumberOfBlockers();
}
@Override
public ConditionalRequirementEffect copy() {
return new ConditionalRequirementEffect(this);