mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[BRO] Implement Mishra's Domination
This commit is contained in:
parent
266c21d652
commit
91faa1a4de
2 changed files with 84 additions and 0 deletions
83
Mage.Sets/src/mage/cards/m/MishrasDomination.java
Normal file
83
Mage.Sets/src/mage/cards/m/MishrasDomination.java
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
package mage.cards.m;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.condition.Condition;
|
||||||
|
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||||
|
import mage.abilities.decorator.ConditionalRestrictionEffect;
|
||||||
|
import mage.abilities.effects.common.AttachEffect;
|
||||||
|
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||||
|
import mage.abilities.keyword.EnchantAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.game.Controllable;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class MishrasDomination extends CardImpl {
|
||||||
|
|
||||||
|
public MishrasDomination(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
|
// Enchant creature
|
||||||
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||||
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||||
|
this.addAbility(new EnchantAbility(auraTarget));
|
||||||
|
|
||||||
|
// As long as you control enchanted creature, it gets +2/+2. Otherwise, it can't block.
|
||||||
|
Ability ability = new SimpleStaticAbility(new ConditionalContinuousEffect(
|
||||||
|
new BoostEnchantedEffect(2, 2), MishrasDominationCondition.TRUE,
|
||||||
|
"as long as you control enchanted creature, it gets +2/+2"
|
||||||
|
));
|
||||||
|
ability.addEffect(new ConditionalRestrictionEffect(
|
||||||
|
new CantBlockSourceEffect(Duration.WhileOnBattlefield),
|
||||||
|
MishrasDominationCondition.FALSE, "otherwise, it can't block"
|
||||||
|
));
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MishrasDomination(final MishrasDomination card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MishrasDomination copy() {
|
||||||
|
return new MishrasDomination(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum MishrasDominationCondition implements Condition {
|
||||||
|
TRUE(true),
|
||||||
|
FALSE(false);
|
||||||
|
private final boolean value;
|
||||||
|
|
||||||
|
MishrasDominationCondition(boolean value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return Optional
|
||||||
|
.ofNullable(source.getSourcePermanentIfItStillExists(game))
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(Controllable::getControllerId)
|
||||||
|
.map(source::isControlledBy)
|
||||||
|
.equals(value);
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,6 +101,7 @@ public final class TheBrothersWar extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Mass Production", 15, Rarity.UNCOMMON, mage.cards.m.MassProduction.class));
|
cards.add(new SetCardInfo("Mass Production", 15, Rarity.UNCOMMON, mage.cards.m.MassProduction.class));
|
||||||
cards.add(new SetCardInfo("Mine Worker", 239, Rarity.COMMON, mage.cards.m.MineWorker.class));
|
cards.add(new SetCardInfo("Mine Worker", 239, Rarity.COMMON, mage.cards.m.MineWorker.class));
|
||||||
cards.add(new SetCardInfo("Mishra's Command", 141, Rarity.RARE, mage.cards.m.MishrasCommand.class));
|
cards.add(new SetCardInfo("Mishra's Command", 141, Rarity.RARE, mage.cards.m.MishrasCommand.class));
|
||||||
|
cards.add(new SetCardInfo("Mishra's Domination", 142, Rarity.COMMON, mage.cards.m.MishrasDomination.class));
|
||||||
cards.add(new SetCardInfo("Mishra's Foundry", 265, Rarity.RARE, mage.cards.m.MishrasFoundry.class));
|
cards.add(new SetCardInfo("Mishra's Foundry", 265, Rarity.RARE, mage.cards.m.MishrasFoundry.class));
|
||||||
cards.add(new SetCardInfo("Mishra's Juggernaut", 161, Rarity.COMMON, mage.cards.m.MishrasJuggernaut.class));
|
cards.add(new SetCardInfo("Mishra's Juggernaut", 161, Rarity.COMMON, mage.cards.m.MishrasJuggernaut.class));
|
||||||
cards.add(new SetCardInfo("Mishra's Onslaught", 143, Rarity.COMMON, mage.cards.m.MishrasOnslaught.class));
|
cards.add(new SetCardInfo("Mishra's Onslaught", 143, Rarity.COMMON, mage.cards.m.MishrasOnslaught.class));
|
||||||
|
|
Loading…
Reference in a new issue