fixed Predatory Impetus
@@ -68,14 +68,13 @@ class PredatoryImpetusEffect extends RequirementEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent attachment = game.getPermanent(source.getSourceId());
- if (attachment != null && attachment.getAttachedTo() != null) {
- Permanent attachedCreature = game.getPermanent(attachment.getAttachedTo());
- if (attachedCreature != null && attachedCreature.isAttacking()) {
- return permanent.canBlock(attachment.getAttachedTo(), game);
- }
- }
+ if (attachment == null || attachment.getAttachedTo() == null) {
return false;
}
+ Permanent attachedCreature = game.getPermanent(attachment.getAttachedTo());
+ return attachedCreature != null && attachedCreature.isAttacking()
+ && permanent.canBlock(attachment.getAttachedTo(), game);
+ }
@Override
public boolean mustAttack(Game game) {
@@ -88,12 +87,9 @@ class PredatoryImpetusEffect extends RequirementEffect {
}
@Override
- public UUID mustBlockAttacker(Ability source, Game game) {
+ public UUID mustBlockAttackerIfElseUnblocked(Ability source, Game game) {
Permanent attachment = game.getPermanent(source.getSourceId());
- if (attachment != null && attachment.getAttachedTo() != null) {
- return attachment.getAttachedTo();
- }
- return null;
+ return attachment == null ? null : attachment.getAttachedTo();
}
@Override
