mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
*Added Epic keyword.
*Added Endless Swarm Enduring Ideal Eternal Dominion Neverending Torment Undying Flames can't be done in script currently.
This commit is contained in:
@@ -1160,6 +1160,8 @@ public class GameAction {
|
||||
canShowWinLose = true;
|
||||
forge.card.trigger.Trigger.resetIDs();
|
||||
AllZone.getTriggerHandler().clearTriggerSettings();
|
||||
AllZone.getHumanPlayer().setEpicSpell(null);
|
||||
AllZone.getComputerPlayer().setEpicSpell(null);
|
||||
|
||||
{ //re-number cards just so their unique numbers are low, just for user friendliness
|
||||
CardFactoryInterface c = AllZone.getCardFactory();
|
||||
|
||||
@@ -49,6 +49,8 @@ public abstract class Player extends GameEntity {
|
||||
|
||||
Map<Constant.Zone, PlayerZone> zones = new EnumMap<Constant.Zone, PlayerZone>(Constant.Zone.class);
|
||||
public final static List<Zone> ALL_ZONES = Collections.unmodifiableList(Arrays.asList(Zone.Battlefield, Zone.Library, Zone.Graveyard, Zone.Hand, Zone.Exile, Zone.Command));
|
||||
|
||||
private SpellAbility epicSpell = null;
|
||||
|
||||
/**
|
||||
* <p>Constructor for Player.</p>
|
||||
@@ -1914,4 +1916,18 @@ public abstract class Player extends GameEntity {
|
||||
return p1.getName().equals(getName());
|
||||
} else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the epicSpell
|
||||
*/
|
||||
public SpellAbility getEpicSpell() {
|
||||
return epicSpell;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param epicSpell0 the epicSpell to set
|
||||
*/
|
||||
public void setEpicSpell(SpellAbility epicSpell0) {
|
||||
this.epicSpell = epicSpell0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4981,6 +4981,57 @@ public class CardFactoryUtil {
|
||||
card.setSVar("ProvokeAbility", abString);
|
||||
card.setSVar("DBUntap", dbString);
|
||||
}
|
||||
|
||||
if(card.hasKeyword("Epic")) {
|
||||
final SpellAbility origSA = card.getSpellAbilities().get(0);
|
||||
|
||||
SpellAbility newSA = new Spell(card,origSA.getPayCosts(),origSA.getTarget()) {
|
||||
private static final long serialVersionUID = -7934420043356101045L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.getController().setEpicSpell(origSA);
|
||||
|
||||
//Create Epic emblem
|
||||
Card eff = new Card();
|
||||
eff.setName(card.toString() + " Epic");
|
||||
eff.addType("Effect"); // Or Emblem
|
||||
eff.setToken(true); // Set token to true, so when leaving play it gets nuked
|
||||
eff.addController(card.getController());
|
||||
eff.setOwner(card.getController());
|
||||
eff.setImageName(card.getImageName());
|
||||
eff.setColor(card.getColor());
|
||||
eff.setImmutable(true);
|
||||
|
||||
eff.addStaticAbility("Mode$ CantBeCast | ValidCard$ Card | Caster$ You | Description$ For the rest of the game, you can't cast spells.");
|
||||
|
||||
Trigger copyTrigger = forge.card.trigger.TriggerHandler.parseTrigger("Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerDescription$ At the beginning of each of your upkeeps, copy " + card.toString() + " except for its epic ability.", card, false);
|
||||
|
||||
copyTrigger.setOverridingAbility(origSA);
|
||||
|
||||
eff.addTrigger(copyTrigger);
|
||||
AllZone.getTriggerHandler().registerTrigger(copyTrigger);
|
||||
|
||||
AllZone.getTriggerHandler().suppressMode("ChangesZone");
|
||||
AllZone.getGameAction().moveToPlay(eff);
|
||||
AllZone.getTriggerHandler().clearSuppression("ChangesZone");
|
||||
|
||||
if(card.getController().isHuman()) {
|
||||
AllZone.getGameAction().playSpellAbility_NoStack(origSA, false);
|
||||
}
|
||||
else {
|
||||
ComputerUtil.playNoStack(origSA);
|
||||
}
|
||||
}
|
||||
};
|
||||
newSA.setDescription(origSA.getDescription());
|
||||
|
||||
origSA.setPayCosts(null);
|
||||
origSA.setManaCost("0");
|
||||
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(newSA);
|
||||
}
|
||||
|
||||
return card;
|
||||
}
|
||||
@@ -5424,6 +5475,7 @@ public class CardFactoryUtil {
|
||||
|
||||
card.addTrigger(stormTrigger);
|
||||
} // Storm
|
||||
|
||||
}
|
||||
|
||||
} //end class CardFactoryUtil
|
||||
|
||||
@@ -56,6 +56,10 @@ abstract public class Spell extends SpellAbility implements java.io.Serializable
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
if (AllZone.getStack().isSplitSecondOnStack()) return false;
|
||||
|
||||
if(getSourceCard().getController().getEpicSpell() != null) {
|
||||
return false; //Player has cast an Epic spell and can't cast more this game.
|
||||
}
|
||||
|
||||
Card card = getSourceCard();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user