mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Merge origin/master
This commit is contained in:
commit
18df3b6a85
3 changed files with 153 additions and 4 deletions
89
Mage.Sets/src/mage/cards/h/HungeringHydra.java
Normal file
89
Mage.Sets/src/mage/cards/h/HungeringHydra.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
@ -103,13 +104,71 @@ class TezzeretCruelMachinistEffect extends OneShotEffect {
|
|||
continue;
|
||||
}
|
||||
cardsToMove.add(card);
|
||||
ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT, CardType.CREATURE);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));
|
||||
ContinuousEffect effect = new TezzeretCruelMachinistCardTypeEffect();
|
||||
effect.setTargetPointer(new FixedTarget(
|
||||
card.getId(),
|
||||
card.getZoneChangeCounter(game) + 1
|
||||
));
|
||||
game.addEffect(effect, source);
|
||||
effect = new SetPowerToughnessTargetEffect(5, 5, Duration.WhileOnBattlefield);
|
||||
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));
|
||||
effect = new TezzeretCruelMachinistPowerToughnessEffect();
|
||||
effect.setTargetPointer(new FixedTarget(
|
||||
card.getId(),
|
||||
card.getZoneChangeCounter(game) + 1
|
||||
));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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("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("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 Scarring", 103, Rarity.COMMON, mage.cards.i.InfernalScarring.class));
|
||||
cards.add(new SetCardInfo("Inspired Charge", 15, Rarity.COMMON, mage.cards.i.InspiredCharge.class));
|
||||
|
|
Loading…
Reference in a new issue