mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
couple of sonar fixes
This commit is contained in:
parent
63fc53e0f0
commit
7c2f55eda0
28 changed files with 53 additions and 134 deletions
|
|
@ -99,7 +99,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
|
|||
Target target = mode.getTargets().get(0);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (target.getMaxNumberOfTargets() > 1) {
|
||||
if (target.getNumberOfTargets() < target.getNumberOfTargets()) {
|
||||
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
|
||||
sb.append("up to ");
|
||||
}
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()).append(" get ");
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class SplitSecondEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
}
|
||||
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
|
||||
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
if (ability != null && !(ability.get() instanceof ActivatedManaAbilityImpl)) {
|
||||
if (ability.isPresent() && !(ability.get() instanceof ActivatedManaAbilityImpl)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class StormEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
Logger.getLogger(StormEffect.class).fatal("CastSpellLastTurnWatcher not found. game = " + game == null ? "NULL" : game.getGameType().toString());
|
||||
Logger.getLogger(StormEffect.class).fatal("CastSpellLastTurnWatcher not found. game = " +game.getGameType().toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public class TargetActivatedAbility extends TargetObject {
|
|||
return stackObject != null
|
||||
&& stackObject.getStackAbility() != null
|
||||
&& stackObject.getStackAbility().getAbilityType() == AbilityType.ACTIVATED
|
||||
&& source != null
|
||||
&& filter.match(stackObject, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class TargetActivatedOrTriggeredAbility extends TargetObject {
|
|||
}
|
||||
|
||||
StackObject stackObject = game.getStack().getStackObject(id);
|
||||
return isActivatedOrTriggeredAbility(stackObject) && filter.match(stackObject, source.getSourceId(), source.getControllerId(), game);
|
||||
return isActivatedOrTriggeredAbility(stackObject) && source != null && filter.match(stackObject, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue