mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
[ONE] Implement Skrelv's Hive
This commit is contained in:
parent
f0ea399ac6
commit
d244e52ede
4 changed files with 106 additions and 0 deletions
64
Mage.Sets/src/mage/cards/s/SkrelvsHive.java
Normal file
64
Mage.Sets/src/mage/cards/s/SkrelvsHive.java
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.condition.common.CorruptedCondition;
|
||||||
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||||
|
import mage.abilities.effects.common.CreateTokenEffect;
|
||||||
|
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||||
|
import mage.abilities.keyword.LifelinkAbility;
|
||||||
|
import mage.abilities.keyword.ToxicAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.AbilityWord;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
|
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||||
|
import mage.game.permanent.token.PhyrexianMiteToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class SkrelvsHive extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterPermanent filter = new FilterControlledCreaturePermanent();
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(new AbilityPredicate(ToxicAbility.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SkrelvsHive(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||||
|
|
||||||
|
// At the beginning of your upkeep, you lose 1 life and create a 1/1 colorless Phyrexian Mite artifact creature token with toxic 1 and "This creature can't block."
|
||||||
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(
|
||||||
|
new LoseLifeSourceControllerEffect(1), TargetController.YOU, false
|
||||||
|
);
|
||||||
|
ability.addEffect(new CreateTokenEffect(new PhyrexianMiteToken()).concatBy("and"));
|
||||||
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
// Corrupted -- As long as an opponent has three or more poison counters, creatures you control with toxic have lifelink.
|
||||||
|
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||||
|
new GainAbilityAllEffect(
|
||||||
|
LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, filter
|
||||||
|
), CorruptedCondition.instance, "as long as an opponent has three " +
|
||||||
|
"or more poison counters, creatures you control with toxic have lifelink"
|
||||||
|
)).setAbilityWord(AbilityWord.CORRUPTED).addHint(CorruptedCondition.getHint()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private SkrelvsHive(final SkrelvsHive card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SkrelvsHive copy() {
|
||||||
|
return new SkrelvsHive(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Razorverge Thicket", 257, Rarity.RARE, mage.cards.r.RazorvergeThicket.class));
|
cards.add(new SetCardInfo("Razorverge Thicket", 257, Rarity.RARE, mage.cards.r.RazorvergeThicket.class));
|
||||||
cards.add(new SetCardInfo("Seachrome Coast", 258, Rarity.RARE, mage.cards.s.SeachromeCoast.class));
|
cards.add(new SetCardInfo("Seachrome Coast", 258, Rarity.RARE, mage.cards.s.SeachromeCoast.class));
|
||||||
|
cards.add(new SetCardInfo("Skrelv's Hive", 34, Rarity.RARE, mage.cards.s.SkrelvsHive.class));
|
||||||
cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("The Monumental Facade", 255, Rarity.RARE, mage.cards.t.TheMonumentalFacade.class));
|
cards.add(new SetCardInfo("The Monumental Facade", 255, Rarity.RARE, mage.cards.t.TheMonumentalFacade.class));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package mage.abilities.condition.common;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
|
import mage.abilities.hint.ConditionHint;
|
||||||
|
import mage.abilities.hint.Hint;
|
||||||
|
import mage.counters.CounterType;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.stack.Spell;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
|
||||||
|
public enum CorruptedCondition implements Condition {
|
||||||
|
instance;
|
||||||
|
private static final Hint hint = new ConditionHint(instance, "An opponent has three or more poison counters");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return game.getOpponents(source.getControllerId())
|
||||||
|
.stream()
|
||||||
|
.map(game::getPlayer)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(Player::getCounters)
|
||||||
|
.anyMatch(counters -> counters.getCount(CounterType.POISON) >= 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "an opponent has three or more poison counters";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Hint getHint() {
|
||||||
|
return hint;
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,7 @@ public enum AbilityWord {
|
||||||
COHORT("Cohort"),
|
COHORT("Cohort"),
|
||||||
CONSTELLATION("Constellation"),
|
CONSTELLATION("Constellation"),
|
||||||
CONVERGE("Converge"),
|
CONVERGE("Converge"),
|
||||||
|
CORRUPTED("Corrupted"),
|
||||||
COUNCILS_DILEMMA("Council's dilemma"),
|
COUNCILS_DILEMMA("Council's dilemma"),
|
||||||
COVEN("Coven"),
|
COVEN("Coven"),
|
||||||
DELIRIUM("Delirium"),
|
DELIRIUM("Delirium"),
|
||||||
|
|
Loading…
Reference in a new issue