[NEO] Implemented Hotshot Mechanic

This commit is contained in:
Evan Kranzler 2022-02-01 09:21:33 -05:00
parent a85745b694
commit 4409a0aa95
4 changed files with 71 additions and 7 deletions

View file

@ -0,0 +1,37 @@
package mage.cards.h;
import mage.MageInt;
import mage.abilities.common.CrewIncreasedPowerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class HotshotMechanic extends CardImpl {
public HotshotMechanic(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{W}");
this.subtype.add(SubType.FOX);
this.subtype.add(SubType.PILOT);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Hotshot Mechanic crews Vehicles as though its power were 2 greater.
this.addAbility(new CrewIncreasedPowerAbility());
}
private HotshotMechanic(final HotshotMechanic card) {
super(card);
}
@Override
public HotshotMechanic copy() {
return new HotshotMechanic(this);
}
}

View file

@ -61,6 +61,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
cards.add(new SetCardInfo("Hand of Enlightenment", 11, Rarity.COMMON, mage.cards.h.HandOfEnlightenment.class));
cards.add(new SetCardInfo("Hidetsugu, Devouring Chaos", 99, Rarity.RARE, mage.cards.h.HidetsuguDevouringChaos.class));
cards.add(new SetCardInfo("High-Speed Hoverbike", 247, Rarity.UNCOMMON, mage.cards.h.HighSpeedHoverbike.class));
cards.add(new SetCardInfo("Hotshot Mechanic", 16, Rarity.UNCOMMON, mage.cards.h.HotshotMechanic.class));
cards.add(new SetCardInfo("Imperial Moth", 4, Rarity.COMMON, mage.cards.i.ImperialMoth.class));
cards.add(new SetCardInfo("Imperial Subduer", 19, Rarity.COMMON, mage.cards.i.ImperialSubduer.class));
cards.add(new SetCardInfo("Inkrise Infiltrator", 100, Rarity.COMMON, mage.cards.i.InkriseInfiltrator.class));

View file

@ -0,0 +1,28 @@
package mage.abilities.common;
import mage.abilities.StaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.constants.Zone;
/**
* @author TheElk801
*/
public class CrewIncreasedPowerAbility extends StaticAbility {
public CrewIncreasedPowerAbility() {
this("{this}");
}
public CrewIncreasedPowerAbility(String selfName) {
super(Zone.BATTLEFIELD, new InfoEffect(selfName + " crews Vehicles as though its power were 2 greater."));
}
private CrewIncreasedPowerAbility(final CrewIncreasedPowerAbility ability) {
super(ability);
}
@Override
public CrewIncreasedPowerAbility copy() {
return new CrewIncreasedPowerAbility(this);
}
}

View file

@ -1,7 +1,7 @@
package mage.abilities.keyword;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CrewIncreasedPowerAbility;
import mage.abilities.common.CrewWithToughnessAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
@ -140,14 +140,12 @@ class CrewCost extends CostImpl {
}
private int getCrewPower(Permanent permanent, Game game) {
MageInt crewPowerSource = null;
if (permanent.hasAbility(CrewWithToughnessAbility.getInstance(), game)) {
crewPowerSource = permanent.getToughness();
return permanent.getToughness().getValue();
} else if (permanent.getAbilities(game).containsClass(CrewIncreasedPowerAbility.class)) {
return permanent.getPower().getValue() + 2;
} else {
crewPowerSource = permanent.getPower();
return permanent.getPower().getValue();
}
return crewPowerSource.getValue();
}
}