mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Implemented Unpredictable Cyclone
This commit is contained in:
parent
a5fb946fb3
commit
a689646735
4 changed files with 151 additions and 6 deletions
|
|
@ -1,18 +1,21 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.CyclingDiscardCost;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class CyclingAbility extends ActivatedAbilityImpl {
|
||||
|
|
@ -21,7 +24,7 @@ public class CyclingAbility extends ActivatedAbilityImpl {
|
|||
private final String text;
|
||||
|
||||
public CyclingAbility(Cost cost) {
|
||||
super(Zone.HAND, new DrawCardSourceControllerEffect(1), cost);
|
||||
super(Zone.HAND, new CyclingDrawEffect(), cost);
|
||||
this.addCost(new CyclingDiscardCost());
|
||||
this.cost = cost;
|
||||
this.text = "Cycling";
|
||||
|
|
@ -56,5 +59,38 @@ public class CyclingAbility extends ActivatedAbilityImpl {
|
|||
rule.append(cost.getText()).append(" <i>(").append(super.getRule(true)).append(")</i>");
|
||||
return rule.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CyclingDrawEffect extends OneShotEffect {
|
||||
|
||||
CyclingDrawEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "draw a card";
|
||||
}
|
||||
|
||||
private CyclingDrawEffect(final CyclingDrawEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CyclingDrawEffect copy() {
|
||||
return new CyclingDrawEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getSourceId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
GameEvent event = GameEvent.getEvent(
|
||||
GameEvent.EventType.CYCLE_DRAW, source.getSourceId(),
|
||||
source.getSourceId(), source.getControllerId()
|
||||
);
|
||||
if (game.replaceEvent(event)) {
|
||||
return true;
|
||||
}
|
||||
player.drawCards(1, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ public class GameEvent implements Serializable {
|
|||
CONVOKED,
|
||||
DISCARD_CARD,
|
||||
DISCARDED_CARD,
|
||||
CYCLE_CARD, CYCLED_CARD,
|
||||
CYCLE_CARD, CYCLED_CARD, CYCLE_DRAW,
|
||||
CLASH, CLASHED,
|
||||
DAMAGE_PLAYER,
|
||||
/* DAMAGED_PLAYER
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue