mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
[MID] Implement Consuming Blob
This commit is contained in:
parent
7e89d620b8
commit
eb065bc0e7
4 changed files with 151 additions and 1 deletions
|
|
@ -0,0 +1,71 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.hint.common.CardTypesInGraveyardHint;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* @author ciaccona007
|
||||
*/
|
||||
public final class ConsumingBlobToken extends TokenImpl {
|
||||
|
||||
public ConsumingBlobToken() {
|
||||
super("Ooze", "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.\"");
|
||||
setOriginalExpansionSetCode("MID");
|
||||
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 ConsumingBlobTokenEffect()).addHint(CardTypesInGraveyardHint.YOU));
|
||||
|
||||
}
|
||||
|
||||
private ConsumingBlobToken(final ConsumingBlobToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumingBlobToken copy() {
|
||||
return new ConsumingBlobToken(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ConsumingBlobTokenEffect extends ContinuousEffectImpl {
|
||||
|
||||
public ConsumingBlobTokenEffect() {
|
||||
super(Duration.EndOfGame, Layer.PTChangingEffects_7, SubLayer.CharacteristicDefining_7a, Outcome.BoostCreature);
|
||||
staticText = "{this}'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";
|
||||
}
|
||||
|
||||
public ConsumingBlobTokenEffect(final ConsumingBlobTokenEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumingBlobTokenEffect copy() {
|
||||
return new ConsumingBlobTokenEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject target = source.getSourceObject(game);
|
||||
if (target == null) {
|
||||
return false;
|
||||
}
|
||||
int number = CardTypesInGraveyardCount.YOU.calculate(game, source, this);
|
||||
target.getPower().setValue(number);
|
||||
target.getToughness().setValue(number + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue