mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Some minor code reworks.
This commit is contained in:
parent
c764da43f3
commit
a8742b934a
3 changed files with 50 additions and 49 deletions
|
@ -28,19 +28,14 @@
|
|||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.LookLibraryControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
|
@ -49,6 +44,11 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
@ -68,10 +68,8 @@ public class CallousDeceiver extends CardImpl {
|
|||
// {1}: Look at the top card of your library.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new LookLibraryControllerEffect(), new GenericManaCost(1)));
|
||||
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn.
|
||||
Ability ability = new CallousDeceiverAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{2}"));
|
||||
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(),Duration.EndOfTurn));
|
||||
this.addAbility(ability);
|
||||
// {2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn.
|
||||
this.addAbility(new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new CallousDeceiverEffect(), new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public CallousDeceiver(final CallousDeceiver card) {
|
||||
|
@ -85,38 +83,39 @@ public class CallousDeceiver extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
class CallousDeceiverAbility extends LimitedTimesPerTurnActivatedAbility {
|
||||
class CallousDeceiverEffect extends OneShotEffect {
|
||||
|
||||
public CallousDeceiverAbility(Zone zone, Effect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
public CallousDeceiverEffect() {
|
||||
super(Outcome.BoostCreature);
|
||||
this.staticText = "Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn";
|
||||
}
|
||||
|
||||
public CallousDeceiverAbility(CallousDeceiverAbility ability) {
|
||||
super(ability);
|
||||
public CallousDeceiverEffect(final CallousDeceiverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CallousDeceiverAbility copy() {
|
||||
return new CallousDeceiverAbility(this);
|
||||
}
|
||||
@Override
|
||||
public CallousDeceiverEffect copy() {
|
||||
return new CallousDeceiverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIfClause(Game game) {
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Callous Deceiver", cards, game);
|
||||
if (card != null && card.getCardType().contains(CardType.LAND)) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{2}: Reveal the top card of your library. If it's a land card, {this} gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn.";
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -52,7 +52,7 @@ public class CleverImpersonator extends CardImpl {
|
|||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// You have may Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield.
|
||||
// You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||
new EntersBattlefieldEffect(new CopyPermanentEffect(new FilterNonlandPermanent()),
|
||||
"You may have {this} enter the battlefield as a copy of any nonland permanent on the battlefield",
|
||||
|
|
|
@ -33,10 +33,10 @@ import mage.MageInt;
|
|||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ControlPermanentCost;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.ConditionalAnyColorManaAbility;
|
||||
|
@ -58,6 +58,7 @@ import mage.game.permanent.token.Token;
|
|||
public class SliverHive extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Sliver");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Sliver"));
|
||||
}
|
||||
|
@ -73,9 +74,10 @@ public class SliverHive extends CardImpl {
|
|||
this.addAbility(new ConditionalAnyColorManaAbility(new TapSourceCost(), 1, new SliverHiveManaBuilder(), true));
|
||||
|
||||
// {5}, {T}: Put a 1/1 colorless Sliver creature token onto the battlefield. Activate this ability only if you control a Sliver.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliverToken()), new TapSourceCost());
|
||||
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new SliverToken()), new TapSourceCost(),
|
||||
new PermanentsOnTheBattlefieldCondition(filter),
|
||||
"{5}, {T}: Put a 1/1 colorless Sliver creature token onto the battlefield. Activate this ability only if you control a Sliver.");
|
||||
ability.addCost(new GenericManaCost(5));
|
||||
ability.addCost(new ControlPermanentCost(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue