mirror of
https://github.com/correl/mage.git
synced 2025-04-09 17:00:09 -09:00
Fixed static text.
This commit is contained in:
parent
d641a6de72
commit
49c403da0e
1 changed files with 24 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
* Copyright 2012 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
* permitted provided that the following conditions are met:
|
* permitted provided that the following conditions are met:
|
||||||
|
@ -40,8 +40,7 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @author Backfir3, noxx
|
||||||
* @author Backfir3
|
|
||||||
*/
|
*/
|
||||||
public class SetToughnessSourceEffect extends ContinuousEffectImpl<SetToughnessSourceEffect> {
|
public class SetToughnessSourceEffect extends ContinuousEffectImpl<SetToughnessSourceEffect> {
|
||||||
|
|
||||||
|
@ -51,41 +50,40 @@ public class SetToughnessSourceEffect extends ContinuousEffectImpl<SetToughnessS
|
||||||
public SetToughnessSourceEffect(DynamicValue amount, Duration duration) {
|
public SetToughnessSourceEffect(DynamicValue amount, Duration duration) {
|
||||||
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
staticText = "{this}'s toughness are each equal to the number of " + amount.getMessage();
|
staticText = "{this}'s toughness is equal to the number of " + amount.getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetToughnessSourceEffect(int power, int toughness, Duration duration) {
|
public SetToughnessSourceEffect(int power, int toughness, Duration duration) {
|
||||||
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
super(duration, Layer.PTChangingEffects_7, SubLayer.SetPT_7b, Outcome.BoostCreature);
|
||||||
this.toughness = toughness;
|
this.toughness = toughness;
|
||||||
staticText = "{this}'s toughness is " + power + "/" + toughness;
|
staticText = "{this}'s toughness is " + toughness;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SetToughnessSourceEffect(final SetToughnessSourceEffect effect) {
|
public SetToughnessSourceEffect(final SetToughnessSourceEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.amount = effect.amount;
|
this.amount = effect.amount;
|
||||||
this.toughness = effect.toughness;
|
this.toughness = effect.toughness;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SetToughnessSourceEffect copy() {
|
public SetToughnessSourceEffect copy() {
|
||||||
return new SetToughnessSourceEffect(this);
|
return new SetToughnessSourceEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent target = game.getPermanent(source.getSourceId());
|
Permanent target = game.getPermanent(source.getSourceId());
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
if (amount != null) {
|
if (amount != null) {
|
||||||
int value = amount.calculate(game, source);
|
int value = amount.calculate(game, source);
|
||||||
target.getToughness().setValue(value);
|
target.getToughness().setValue(value);
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
if (toughness != Integer.MIN_VALUE)
|
||||||
if (toughness != Integer.MIN_VALUE)
|
target.getToughness().setValue(toughness);
|
||||||
target.getToughness().setValue(toughness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
}
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue