mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
*Extended Setup Game State - Added named parameters.
-Tapped = If this is True,well... the card is tapped, ofc. -SummonSick = If this is True, the card has Summoning Sickness. -Counters = A comma-separated list of counters on the card. -Morphed = If this is True, the card is facedown. (It must have the morph keyword for this to work) -Set = Like you previously set SetCode.If absent, the latest printing is used. Ex. "AICardsInPlay=Aphetto Alchemist|Set:ONS|Tapped:True|SummonSick:True|Counters:P1P1,P1P1,M0M2|Morphed:True; Memnite"
This commit is contained in:
@@ -87,6 +87,7 @@ public class Card extends MyObservable implements Comparable<Card> {
|
|||||||
private boolean dealtDmgToComputerThisTurn = false;
|
private boolean dealtDmgToComputerThisTurn = false;
|
||||||
private boolean sirenAttackOrDestroy = false;
|
private boolean sirenAttackOrDestroy = false;
|
||||||
|
|
||||||
|
private boolean canMorph = false;
|
||||||
private boolean faceDown = false;
|
private boolean faceDown = false;
|
||||||
private boolean kicked = false;
|
private boolean kicked = false;
|
||||||
private boolean evoked = false;
|
private boolean evoked = false;
|
||||||
@@ -2270,6 +2271,22 @@ public class Card extends MyObservable implements Comparable<Card> {
|
|||||||
public boolean isFaceDown() {
|
public boolean isFaceDown() {
|
||||||
return faceDown;
|
return faceDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>setCanMorph.</p>
|
||||||
|
* @param b a boolean.
|
||||||
|
*/
|
||||||
|
public void setCanMorph(boolean b) {
|
||||||
|
canMorph = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>getCanMorph.</p>
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public boolean getCanMorph() {
|
||||||
|
return canMorph;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>addTrigger.</p>
|
* <p>addTrigger.</p>
|
||||||
|
|||||||
@@ -1227,7 +1227,7 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
computerDevExileSetup = devProcessCardsForZone(computerSetupExile, AllZone.getComputerPlayer());
|
computerDevExileSetup = devProcessCardsForZone(computerSetupExile, AllZone.getComputerPlayer());
|
||||||
|
|
||||||
AllZone.getTriggerHandler().suppressMode("ChangesZone");
|
AllZone.getTriggerHandler().suppressMode("ChangesZone");
|
||||||
|
AllZone.getCombat().reset();
|
||||||
for (Card c : humanDevSetup) {
|
for (Card c : humanDevSetup) {
|
||||||
AllZone.getHumanHand().add(c);
|
AllZone.getHumanHand().add(c);
|
||||||
AllZone.getGameAction().moveToPlay(c);
|
AllZone.getGameAction().moveToPlay(c);
|
||||||
@@ -1295,10 +1295,55 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
|
|
||||||
Card c = AllZone.getCardFactory().getCard(cardinfo[0], player);
|
Card c = AllZone.getCardFactory().getCard(cardinfo[0], player);
|
||||||
|
|
||||||
if (cardinfo.length != 2)
|
boolean hasSetCurSet = false;
|
||||||
|
for(String info : cardinfo)
|
||||||
|
{
|
||||||
|
if(info.startsWith("Set:"))
|
||||||
|
{
|
||||||
|
c.setCurSetCode(info.substring(info.indexOf(':')+1));
|
||||||
|
hasSetCurSet = true;
|
||||||
|
}
|
||||||
|
else if(info.equalsIgnoreCase("Tapped:True"))
|
||||||
|
{
|
||||||
|
c.tap();
|
||||||
|
}
|
||||||
|
else if(info.startsWith("Counters:"))
|
||||||
|
{
|
||||||
|
String[] counterStrings = info.substring(info.indexOf(':')+1).split(",");
|
||||||
|
for(String counter : counterStrings)
|
||||||
|
{
|
||||||
|
c.addCounter(Counters.valueOf(counter), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(info.equalsIgnoreCase("SummonSick:True"))
|
||||||
|
{
|
||||||
|
c.setSickness(true);
|
||||||
|
}
|
||||||
|
else if(info.equalsIgnoreCase("Morphed:True"))
|
||||||
|
{
|
||||||
|
if(!c.getCanMorph())
|
||||||
|
{
|
||||||
|
System.out.println("Setup game state - Can't morph a card without the morph keyword!");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
c.setIsFaceDown(true);
|
||||||
|
c.setManaCost("");
|
||||||
|
c.setColor(new ArrayList<Card_Color>()); //remove all colors
|
||||||
|
c.addColor("0");
|
||||||
|
c.setBaseAttack(2);
|
||||||
|
c.setBaseDefense(2);
|
||||||
|
c.comesIntoPlay();
|
||||||
|
c.setIntrinsicKeyword(new ArrayList<String>()); //remove all keywords
|
||||||
|
c.setType(new ArrayList<String>()); //remove all types
|
||||||
|
c.addType("Creature");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasSetCurSet)
|
||||||
|
{
|
||||||
c.setCurSetCode(c.getMostRecentSet());
|
c.setCurSetCode(c.getMostRecentSet());
|
||||||
else
|
}
|
||||||
c.setCurSetCode(cardinfo[1]);
|
|
||||||
|
|
||||||
c.setImageFilename(CardUtil.buildFilename(c));
|
c.setImageFilename(CardUtil.buildFilename(c));
|
||||||
for (Trigger trig : c.getTriggers()) {
|
for (Trigger trig : c.getTriggers()) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user