mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Implemented Titanic Brawl
This commit is contained in:
parent
c66b7ca0e5
commit
4a24ab0ba8
3 changed files with 102 additions and 19 deletions
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
|
@ -18,7 +16,6 @@ import mage.constants.TargetController;
|
|||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -27,13 +24,16 @@ import mage.target.Target;
|
|||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SavageStomp extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
|
||||
private static final FilterCreaturePermanent filter
|
||||
= new FilterCreaturePermanent("creature you don't control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
|
||||
|
@ -70,23 +70,19 @@ public final class SavageStomp extends CardImpl {
|
|||
|
||||
enum SavageStompCondition implements Condition {
|
||||
instance;
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dinosaur you control");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.DINOSAUR));
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
StackObject sourceSpell = game.getStack().getStackObject(source.getSourceId());
|
||||
if (sourceSpell != null) {
|
||||
Iterator<Target> targets = sourceSpell.getStackAbility().getTargets().iterator();
|
||||
while (targets.hasNext()) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targets.next().getFirstTarget());
|
||||
if (permanent != null && filter.match(permanent, game) && permanent.isControlledBy(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
if (sourceSpell == null) {
|
||||
return false;
|
||||
}
|
||||
Iterator<Target> targets = sourceSpell.getStackAbility().getTargets().iterator();
|
||||
while (targets.hasNext()) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targets.next().getFirstTarget());
|
||||
if (permanent != null && permanent.hasSubtype(SubType.DINOSAUR, game)
|
||||
&& permanent.isControlledBy(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -96,5 +92,4 @@ enum SavageStompCondition implements Condition {
|
|||
public String toString() {
|
||||
return "it targets a Dinosaur you control";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
87
Mage.Sets/src/mage/cards/t/TitanicBrawl.java
Normal file
87
Mage.Sets/src/mage/cards/t/TitanicBrawl.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.effects.common.FightTargetsEffect;
|
||||
import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TitanicBrawl extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter
|
||||
= new FilterCreaturePermanent("creature you don't control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
|
||||
}
|
||||
|
||||
public TitanicBrawl(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
|
||||
|
||||
// This spell costs {1} less to cast if it targets a creature you control with a +1/+1 counter on it.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.STACK,
|
||||
new SpellCostReductionSourceEffect(1, TitanicBrawlCondition.instance))
|
||||
.setRuleAtTheTop(true));
|
||||
|
||||
// Target creature you control fights target creature you don't control.
|
||||
this.getSpellAbility().addEffect(new FightTargetsEffect());
|
||||
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
|
||||
}
|
||||
|
||||
private TitanicBrawl(final TitanicBrawl card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TitanicBrawl copy() {
|
||||
return new TitanicBrawl(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum TitanicBrawlCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
StackObject sourceSpell = game.getStack().getStackObject(source.getSourceId());
|
||||
if (sourceSpell == null) {
|
||||
return false;
|
||||
}
|
||||
Iterator<Target> targets = sourceSpell.getStackAbility().getTargets().iterator();
|
||||
while (targets.hasNext()) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targets.next().getFirstTarget());
|
||||
if (permanent != null && permanent.getCounters(game).containsKey(CounterType.P1P1)
|
||||
&& permanent.isControlledBy(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "it targets a creature you control with a +1/+1 counter on it";
|
||||
}
|
||||
|
||||
}
|
|
@ -107,6 +107,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Stomping Ground", 259, Rarity.RARE, mage.cards.s.StompingGround.class));
|
||||
cards.add(new SetCardInfo("Teysa Karlov", 212, Rarity.RARE, mage.cards.t.TeysaKarlov.class));
|
||||
cards.add(new SetCardInfo("The Haunt of Hightower", 273, Rarity.MYTHIC, mage.cards.t.TheHauntOfHightower.class));
|
||||
cards.add(new SetCardInfo("Titanic Brawl", 146, Rarity.COMMON, mage.cards.t.TitanicBrawl.class));
|
||||
cards.add(new SetCardInfo("Tithe Taker", 27, Rarity.RARE, mage.cards.t.TitheTaker.class));
|
||||
cards.add(new SetCardInfo("Wilderness Reclamation", 149, Rarity.UNCOMMON, mage.cards.w.WildernessReclamation.class));
|
||||
cards.add(new SetCardInfo("Zegana, Utopian Speaker", 214, Rarity.RARE, mage.cards.z.ZeganaUtopianSpeaker.class));
|
||||
|
|
Loading…
Reference in a new issue