mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
parent
150fc8649a
commit
46fff6acfe
3 changed files with 5 additions and 114 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -89,4 +89,3 @@ Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target
|
||||||
*.netbeans_automatic_build
|
*.netbeans_automatic_build
|
||||||
*.txt
|
*.txt
|
||||||
Mage.Client/serverlist.txt
|
Mage.Client/serverlist.txt
|
||||||
/bin/
|
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
package mage.sets.futuresight;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
|
||||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
|
||||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
|
||||||
import mage.abilities.keyword.MadnessAbility;
|
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.filter.common.FilterCreatureCard;
|
|
||||||
import mage.MageInt;
|
|
||||||
import mage.target.common.TargetCardInGraveyard;
|
|
||||||
|
|
||||||
public class GraveScrabbler extends CardImpl{
|
|
||||||
|
|
||||||
public GraveScrabbler(UUID ownerId) {
|
|
||||||
super(ownerId, 86, "Grave Scrabbler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
|
||||||
this.expansionSetCode = "FUT";
|
|
||||||
this.subtype.add("Zombie");
|
|
||||||
|
|
||||||
this.power = new MageInt(2);
|
|
||||||
this.toughness = new MageInt(2);
|
|
||||||
|
|
||||||
//Madness {1}{B}
|
|
||||||
this.addAbility(new MadnessAbility(this, new ManaCostsImpl("{1}{B}")));
|
|
||||||
|
|
||||||
//When Grave Scrabbler enters the battlefield, if its madness cost was paid,
|
|
||||||
//you may return target creature card from a graveyard to its owner's hand.
|
|
||||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
|
|
||||||
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
|
|
||||||
this.addAbility(new ConditionalTriggeredAbility(ability, MadnessAbility.GetCondition(),
|
|
||||||
"When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand."));
|
|
||||||
}
|
|
||||||
|
|
||||||
public GraveScrabbler(final GraveScrabbler card){
|
|
||||||
super(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Card copy() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return new GraveScrabbler(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
package mage.abilities.keyword;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.StaticAbility;
|
import mage.abilities.StaticAbility;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.condition.Condition;
|
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
|
@ -16,6 +13,7 @@ import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.events.GameEvent.EventType;
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
@ -56,11 +54,6 @@ public class MadnessAbility extends StaticAbility {
|
||||||
return new MadnessAbility(this);
|
return new MadnessAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Condition GetCondition()
|
|
||||||
{
|
|
||||||
return MadnessCondition.getInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return rule;
|
return rule;
|
||||||
|
|
@ -124,8 +117,7 @@ class MadnessReplacementEffect extends ReplacementEffectImpl {
|
||||||
* If not, the card goes to the graveyard.
|
* If not, the card goes to the graveyard.
|
||||||
*/
|
*/
|
||||||
class MadnessTriggeredAbility extends TriggeredAbilityImpl {
|
class MadnessTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
//This array holds the Id's of all of the cards that activated madness
|
|
||||||
private static ArrayList<UUID> activatedIds = new ArrayList<UUID>();
|
|
||||||
MadnessTriggeredAbility(ManaCosts<ManaCost> madnessCost ) {
|
MadnessTriggeredAbility(ManaCosts<ManaCost> madnessCost ) {
|
||||||
super(Zone.EXILED, new MadnessCastEffect(madnessCost), true);
|
super(Zone.EXILED, new MadnessCastEffect(madnessCost), true);
|
||||||
this.setRuleVisible(false);
|
this.setRuleVisible(false);
|
||||||
|
|
@ -163,28 +155,9 @@ class MadnessTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
activatedIds.add(getSourceId());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isActivated()
|
|
||||||
{
|
|
||||||
//Look through the list of activated Ids and see if the current source's Id is one of them
|
|
||||||
for(UUID currentId : activatedIds)
|
|
||||||
{
|
|
||||||
if(currentId.equals(getSourceId()))
|
|
||||||
{
|
|
||||||
//Remove the current source from the list, so if the card is somehow recast without
|
|
||||||
//paying the madness cost, this will return false
|
|
||||||
activatedIds.remove(currentId);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//If the current source's Id was not found, return false
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "When this card is exiled this way, " + super.getRule();
|
return "When this card is exiled this way, " + super.getRule();
|
||||||
|
|
@ -236,35 +209,3 @@ class MadnessCastEffect extends OneShotEffect {
|
||||||
return new MadnessCastEffect(this);
|
return new MadnessCastEffect(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MadnessCondition implements Condition {
|
|
||||||
|
|
||||||
private static MadnessCondition fInstance = null;
|
|
||||||
|
|
||||||
private MadnessCondition() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Condition getInstance() {
|
|
||||||
if (fInstance == null) {
|
|
||||||
fInstance = new MadnessCondition();
|
|
||||||
}
|
|
||||||
|
|
||||||
return fInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Game game, Ability source) {
|
|
||||||
Card card = game.getCard(source.getSourceId());
|
|
||||||
if (card != null) {
|
|
||||||
for (Ability ability : card.getAbilities()) {
|
|
||||||
if (ability instanceof MadnessTriggeredAbility) {
|
|
||||||
if (((MadnessTriggeredAbility) ability).isActivated()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue