[BOT] Implemented Goldbug, Humanity's Ally / Goldbug, Scrappy Scout

This commit is contained in:
Evan Kranzler 2022-10-01 10:51:09 -04:00
parent 58dc37e7cf
commit 43838d3675
8 changed files with 307 additions and 0 deletions

View file

@ -0,0 +1,36 @@
package mage.abilities.keyword;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect;
import mage.abilities.hint.common.MyTurnHint;
import mage.constants.CardType;
import mage.constants.Duration;
/**
* @author TheElk801
*/
public class LivingMetalAbility extends EntersBattlefieldTriggeredAbility {
public LivingMetalAbility() {
super(new ConditionalContinuousEffect(new AddCardTypeSourceEffect(
Duration.WhileOnBattlefield, CardType.ARTIFACT, CardType.CREATURE
), MyTurnCondition.instance, ""));
this.addHint(MyTurnHint.instance);
}
public LivingMetalAbility(final LivingMetalAbility ability) {
super(ability);
}
@Override
public LivingMetalAbility copy() {
return new LivingMetalAbility(this);
}
@Override
public String getRule() {
return "Living metal <i>(As long as it's your turn, this Vehicle is also a creature.)</i>";
}
}

View file

@ -0,0 +1,96 @@
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.Card;
import mage.constants.*;
import mage.game.Game;
import mage.game.stack.Spell;
/**
* @author weirddan455, JayDi85, TheElk801 (based heavily on disturb)
*/
public class MoreThanMeetsTheEyeAbility extends SpellAbility {
private final String manaCost;
private SpellAbility spellAbilityToResolve;
public MoreThanMeetsTheEyeAbility(Card card, String manaCost) {
super(card.getSecondFaceSpellAbility());
this.newId();
// getSecondFaceSpellAbility() already verified that second face exists
this.setCardName(card.getSecondCardFace().getName() + " with Disturb");
this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE;
this.spellAbilityCastMode = SpellAbilityCastMode.DISTURB;
this.manaCost = manaCost;
this.getManaCosts().clear();
this.getManaCostsToPay().clear();
this.addManaCost(new ManaCostsImpl<>(manaCost));
this.addSubAbility(new TransformAbility());
}
private MoreThanMeetsTheEyeAbility(final MoreThanMeetsTheEyeAbility ability) {
super(ability);
this.manaCost = ability.manaCost;
this.spellAbilityToResolve = ability.spellAbilityToResolve;
}
@Override
public MoreThanMeetsTheEyeAbility copy() {
return new MoreThanMeetsTheEyeAbility(this);
}
@Override
public boolean activate(Game game, boolean noMana) {
if (super.activate(game, noMana)) {
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getSourceId(), Boolean.TRUE);
// TODO: must be removed after transform cards (one side) migrated to MDF engine (multiple sides)
game.addEffect(new MoreThanMeetsTheEyeEffect(), this);
return true;
}
return false;
}
@Override
public String getRule(boolean all) {
return this.getRule();
}
@Override
public String getRule() {
return "More Than Meets The Eye " + this.manaCost
+ " <i>(You may cast this card converted for" + this.manaCost + ".)</i>";
}
}
class MoreThanMeetsTheEyeEffect extends ContinuousEffectImpl {
public MoreThanMeetsTheEyeEffect() {
super(Duration.WhileOnStack, Layer.CopyEffects_1, SubLayer.CopyEffects_1a, Outcome.BecomeCreature);
staticText = "";
}
private MoreThanMeetsTheEyeEffect(final MoreThanMeetsTheEyeEffect effect) {
super(effect);
}
@Override
public MoreThanMeetsTheEyeEffect copy() {
return new MoreThanMeetsTheEyeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = game.getSpell(source.getSourceId());
if (spell == null || spell.getCard().getSecondCardFace() == null) {
return false;
}
// simulate another side as new card (another code part in spell constructor)
TransformAbility.transformCardSpellDynamic(spell, spell.getCard().getSecondCardFace(), game);
return true;
}
}