foul-magics/Mage/src/main/java/mage/game/permanent/token/ConsumingBlobOozeToken.java
xenohedron 1780972f71
Refactor to clean up base P/T setting and fix text generation (#10264)
* Adjust constructors to simplify

* Refactor to remove duration parameter for CDA (always end of game)

* Fix warnings

* Druid Class not CDA

* Entropic Specter fixup

* Further constructor simplification

* Analogous simplification for setting power only

* Analogous simplification for setting toughness only

* Remove superfluous parameter

* Set fields final
2023-04-24 17:43:18 +04:00

49 lines
2 KiB
Java

package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.AdditiveDynamicValue;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.constants.*;
import java.util.Arrays;
/**
* @author ciaccona007
*/
public final class ConsumingBlobOozeToken extends TokenImpl {
private static final DynamicValue powerValue = CardTypesInGraveyardCount.YOU;
private static final DynamicValue toughnessValue = new AdditiveDynamicValue(powerValue, StaticValue.get(1));
public ConsumingBlobOozeToken() {
super("Ooze Token", "green Ooze creature token with \"This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1.\"");
cardType.add(CardType.CREATURE);
subtype.add(SubType.OOZE);
color.setGreen(true);
power = new MageInt(0);
toughness = new MageInt(1);
// This creature's power is equal to the number of card types among cards in your graveyard and its toughness is equal to that number plus 1.
this.addAbility(new SimpleStaticAbility(
Zone.ALL,
new SetBasePowerToughnessSourceEffect(powerValue, toughnessValue, Duration.EndOfGame, SubLayer.CharacteristicDefining_7a)
.setText("{this}'s power is equal to the number of creature cards in all graveyards and its toughness is equal to that number plus 1")
));
availableImageSetCodes.addAll(Arrays.asList("MID"));
}
private ConsumingBlobOozeToken(final ConsumingBlobOozeToken token) {
super(token);
}
@Override
public ConsumingBlobOozeToken copy() {
return new ConsumingBlobOozeToken(this);
}
}