mirror of
https://github.com/correl/mage.git
synced 2025-04-09 09:11:05 -09:00
Implemented Challenger Troll
This commit is contained in:
parent
42f5847ba7
commit
2a5aaa9c72
2 changed files with 81 additions and 0 deletions
Mage.Sets/src/mage
80
Mage.Sets/src/mage/cards/c/ChallengerTroll.java
Normal file
80
Mage.Sets/src/mage/cards/c/ChallengerTroll.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ChallengerTroll extends CardImpl {
|
||||
|
||||
public ChallengerTroll(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||
|
||||
this.subtype.add(SubType.TROLL);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Each creature you control with power 4 or greater can't be blocked by more than one creature.
|
||||
this.addAbility(new SimpleStaticAbility(new ChallengerTrollEffect()));
|
||||
}
|
||||
|
||||
private ChallengerTroll(final ChallengerTroll card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChallengerTroll copy() {
|
||||
return new ChallengerTroll(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ChallengerTrollEffect extends ContinuousEffectImpl {
|
||||
|
||||
ChallengerTrollEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "Each creature you control with power 4 or greater can't be blocked by more than one creature.";
|
||||
}
|
||||
|
||||
private ChallengerTrollEffect(final ChallengerTrollEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChallengerTrollEffect copy() {
|
||||
return new ChallengerTrollEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
if (layer != Layer.RulesEffects) {
|
||||
return false;
|
||||
}
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (permanent != null && permanent.isControlledBy(source.getControllerId())
|
||||
&& permanent.isCreature() && permanent.getPower().getValue() >= 4) {
|
||||
permanent.setMaxBlockedBy(1);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.RulesEffects;
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ public final class WarOfTheSpark extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Bolt Bend", 115, Rarity.UNCOMMON, mage.cards.b.BoltBend.class));
|
||||
cards.add(new SetCardInfo("Bulwark Giant", 7, Rarity.COMMON, mage.cards.b.BulwarkGiant.class));
|
||||
cards.add(new SetCardInfo("Burning Prophet", 117, Rarity.COMMON, mage.cards.b.BurningProphet.class));
|
||||
cards.add(new SetCardInfo("Challenger Troll", 157, Rarity.UNCOMMON, mage.cards.c.ChallengerTroll.class));
|
||||
cards.add(new SetCardInfo("Courage in Crisis", 158, Rarity.COMMON, mage.cards.c.CourageInCrisis.class));
|
||||
cards.add(new SetCardInfo("Cruel Celebrant", 188, Rarity.UNCOMMON, mage.cards.c.CruelCelebrant.class));
|
||||
cards.add(new SetCardInfo("Crush Dissent", 47, Rarity.COMMON, mage.cards.c.CrushDissent.class));
|
||||
|
|
Loading…
Add table
Reference in a new issue