Merge origin/master

This commit is contained in:
LevelX2 2018-06-19 17:36:36 +02:00
commit 18df3b6a85
3 changed files with 153 additions and 4 deletions

View file

@ -0,0 +1,89 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect;
import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
/**
*
* @author TheElk801
*/
public final class HungeringHydra extends CardImpl {
public HungeringHydra(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}");
this.subtype.add(SubType.HYDRA);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Hungering Hydra enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(
new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance())
));
// Hungering Hydra can't be blocked by more than one creature.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new CantBeBlockedByMoreThanOneSourceEffect()
));
// Whenever damage is dealt to Hungering Hydra, put that many +1/+1 counters on it.
this.addAbility(new DealtDamageToSourceTriggeredAbility(
Zone.BATTLEFIELD, new HungeringHydraEffect(),
false, false, true
));
}
public HungeringHydra(final HungeringHydra card) {
super(card);
}
@Override
public HungeringHydra copy() {
return new HungeringHydra(this);
}
}
class HungeringHydraEffect extends OneShotEffect {
public HungeringHydraEffect() {
super(Outcome.Benefit);
this.staticText = "put that many +1/+1 counters on it";
}
public HungeringHydraEffect(final HungeringHydraEffect effect) {
super(effect);
}
@Override
public HungeringHydraEffect copy() {
return new HungeringHydraEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int damage = (int) this.getValue("damage");
if (damage == 0) {
return false;
}
return new AddCountersSourceEffect(
CounterType.P1P1.createInstance(damage)
).apply(game, source);
}
}

View file

@ -22,6 +22,7 @@ import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -103,13 +104,71 @@ class TezzeretCruelMachinistEffect extends OneShotEffect {
continue; continue;
} }
cardsToMove.add(card); cardsToMove.add(card);
ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT, CardType.CREATURE); ContinuousEffect effect = new TezzeretCruelMachinistCardTypeEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)); effect.setTargetPointer(new FixedTarget(
card.getId(),
card.getZoneChangeCounter(game) + 1
));
game.addEffect(effect, source); game.addEffect(effect, source);
effect = new SetPowerToughnessTargetEffect(5, 5, Duration.WhileOnBattlefield); effect = new TezzeretCruelMachinistPowerToughnessEffect();
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)); effect.setTargetPointer(new FixedTarget(
card.getId(),
card.getZoneChangeCounter(game) + 1
));
game.addEffect(effect, source); game.addEffect(effect, source);
} }
return player.moveCards(cardsToMove.getCards(game), Zone.BATTLEFIELD, source, game, false, true, true, null); return player.moveCards(cardsToMove.getCards(game), Zone.BATTLEFIELD, source, game, false, true, true, null);
} }
} }
class TezzeretCruelMachinistCardTypeEffect extends AddCardTypeTargetEffect {
public TezzeretCruelMachinistCardTypeEffect() {
super(Duration.WhileOnBattlefield, CardType.ARTIFACT, CardType.CREATURE);
}
public TezzeretCruelMachinistCardTypeEffect(final TezzeretCruelMachinistCardTypeEffect effect) {
super(effect);
}
@Override
public TezzeretCruelMachinistCardTypeEffect copy() {
return new TezzeretCruelMachinistCardTypeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null || !permanent.isFaceDown(game)) {
this.discard();
return false;
}
return super.apply(game, source);
}
}
class TezzeretCruelMachinistPowerToughnessEffect extends SetPowerToughnessTargetEffect {
public TezzeretCruelMachinistPowerToughnessEffect() {
super(5, 5, Duration.WhileOnBattlefield);
}
public TezzeretCruelMachinistPowerToughnessEffect(final TezzeretCruelMachinistPowerToughnessEffect effect) {
super(effect);
}
@Override
public TezzeretCruelMachinistPowerToughnessEffect copy() {
return new TezzeretCruelMachinistPowerToughnessEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null || !permanent.isFaceDown(game)) {
this.discard();
return false;
}
return super.apply(game, source);
}
}

View file

@ -92,6 +92,7 @@ public final class CoreSet2019 extends ExpansionSet {
cards.add(new SetCardInfo("Highland Game", 188, Rarity.COMMON, mage.cards.h.HighlandGame.class)); cards.add(new SetCardInfo("Highland Game", 188, Rarity.COMMON, mage.cards.h.HighlandGame.class));
cards.add(new SetCardInfo("Horizon Scholar", 59, Rarity.UNCOMMON, mage.cards.h.HorizonScholar.class)); cards.add(new SetCardInfo("Horizon Scholar", 59, Rarity.UNCOMMON, mage.cards.h.HorizonScholar.class));
cards.add(new SetCardInfo("Hostile Minotaur", 147, Rarity.COMMON, mage.cards.h.HostileMinotaur.class)); cards.add(new SetCardInfo("Hostile Minotaur", 147, Rarity.COMMON, mage.cards.h.HostileMinotaur.class));
cards.add(new SetCardInfo("Hungering Hydra", 189, Rarity.RARE, mage.cards.h.HungeringHydra.class));
cards.add(new SetCardInfo("Infernal Reckoning", 102, Rarity.RARE, mage.cards.i.InfernalReckoning.class)); cards.add(new SetCardInfo("Infernal Reckoning", 102, Rarity.RARE, mage.cards.i.InfernalReckoning.class));
cards.add(new SetCardInfo("Infernal Scarring", 103, Rarity.COMMON, mage.cards.i.InfernalScarring.class)); cards.add(new SetCardInfo("Infernal Scarring", 103, Rarity.COMMON, mage.cards.i.InfernalScarring.class));
cards.add(new SetCardInfo("Inspired Charge", 15, Rarity.COMMON, mage.cards.i.InspiredCharge.class)); cards.add(new SetCardInfo("Inspired Charge", 15, Rarity.COMMON, mage.cards.i.InspiredCharge.class));