mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
add docs, remove unnecessary try-catch
This commit is contained in:
parent
1d8be572b5
commit
3ed1a82ac9
2 changed files with 3 additions and 11 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue