[MH2] Implemented Nettlecyst

This commit is contained in:
Evan Kranzler 2021-05-31 09:32:07 -04:00
parent 3c614e1d3c
commit 870d0338f8
4 changed files with 72 additions and 43 deletions

View file

@ -1,17 +1,13 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.abilities.effects.common.CreateTokenAttachSourceEffect;
import mage.game.permanent.token.GermToken;
import mage.players.Player;
public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility {
public LivingWeaponAbility() {
super(new LivingWeaponEffect());
super(new CreateTokenAttachSourceEffect(new GermToken()));
}
public LivingWeaponAbility(final LivingWeaponAbility ability) {
@ -20,7 +16,8 @@ public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility {
@Override
public String getRule() {
return "Living weapon <i>(When this Equipment enters the battlefield, create a 0/0 black Germ creature token, then attach this to it.)</i>";
return "Living weapon <i>(When this Equipment enters the battlefield, " +
"create a 0/0 black Phyrexian Germ creature token, then attach this to it.)</i>";
}
@Override
@ -28,34 +25,3 @@ public class LivingWeaponAbility extends EntersBattlefieldTriggeredAbility {
return new LivingWeaponAbility(this);
}
}
class LivingWeaponEffect extends CreateTokenEffect {
LivingWeaponEffect() {
super(new GermToken());
}
LivingWeaponEffect(final LivingWeaponEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (super.apply(game, source)) {
Permanent p = game.getPermanent(this.getLastAddedTokenId());
if (p != null) {
p.addAttachment(source.getSourceId(), source, game);
return true;
}
}
}
return false;
}
@Override
public LivingWeaponEffect copy() {
return new LivingWeaponEffect(this);
}
}

View file

@ -1,12 +1,12 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author spjspj
@ -28,11 +28,12 @@ public final class GermToken extends TokenImpl {
}
public GermToken(String setCode, int tokenType) {
super("Germ", "0/0 black Germ creature token");
super("Germ", "0/0 black Phyrexian Germ creature token");
availableImageSetCodes = tokenImageSets;
setOriginalExpansionSetCode(setCode);
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add(SubType.PHYREXIAN);
subtype.add(SubType.GERM);
power = new MageInt(0);
toughness = new MageInt(0);