mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
Fix conditional "must be blocked if able" (#11436)
* Add missing overrides to ConditionalRequirementEffect.java
This commit is contained in:
parent
8ad53750ee
commit
8a007c9953
1 changed files with 30 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue