add docs, remove unnecessary try-catch

This commit is contained in:
xenohedron 2024-06-03 23:40:56 -04:00
parent 1d8be572b5
commit 3ed1a82ac9
2 changed files with 3 additions and 11 deletions

View file

@ -12,7 +12,6 @@ import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
import org.apache.log4j.Logger;
/**
* @author BetaSteward_at_googlemail.com
@ -55,11 +54,8 @@ public class BoostSourceEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) {
super.init(source, game);
if (getAffectedObjectsSet()) {
try {
affectedObjectList.add(new MageObjectReference(source.getSourceId(), game));
} catch (IllegalArgumentException ex) {
Logger.getLogger(BoostSourceEffect.class).error("Could not get sourceId reference: " + source.getRule());
}
affectedObjectList.add(new MageObjectReference(source.getSourceId(), game));
// Boost must be locked in (if it's a dynamic value) for non-static ability
power = StaticValue.get(power.calculate(game, source, this));
toughness = StaticValue.get(toughness.calculate(game, source, this));
}

View file

@ -34,11 +34,6 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
this(power, toughness, Duration.EndOfTurn);
}
/**
* @param power
* @param toughness
* @param duration
*/
public BoostTargetEffect(DynamicValue power, DynamicValue toughness, Duration duration) {
super(duration, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, CardUtil.getBoostOutcome(power, toughness));
this.power = power;
@ -60,6 +55,7 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) {
super.init(source, game);
if (getAffectedObjectsSet()) {
// Boost must be locked in (if it's a dynamic value) for non-static ability
power = StaticValue.get(power.calculate(game, source, this));
toughness = StaticValue.get(toughness.calculate(game, source, this));
}