- [WIP] More updates to the Setup Battlefield dev command, now allows to set specific cards for the human and AI hand, set up the specific human and AI life, and place specific cards on the battlefield; not finished yet - does not yet register the cards on the battlefield properly for some reason - will be fixed and updated ASAP.

This commit is contained in:
jendave
2011-08-07 00:41:43 +00:00
parent b042368fc8
commit 5ec9119f56

View File

@@ -7,6 +7,7 @@ import arcane.ui.ViewPanel;
import arcane.ui.util.Animation;
import forge.card.cardFactory.CardFactoryUtil;
import forge.card.spellability.SpellAbility;
import forge.card.trigger.Trigger;
import forge.error.ErrorViewer;
import forge.gui.ForgeAction;
import forge.gui.GuiUtils;
@@ -175,7 +176,88 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
private static final long serialVersionUID = -6660930759092583160L;
public void actionPerformed(ActionEvent arg0) {
// Set up the battlefield here
// Set up the battlefield here - list the cards that need to be placed on the human and the AI's battlefield, respectively
int setHumanLife = 10;
int setComputerLife = 6;
String humanSetupCardsInPlay[] = {"Mountain", "Raging Goblin"}; // cards to be placed on the human battlefield
String computerSetupCardsInPlay[] = {"Durkwood Boars", "Forest", "Forest", "Forest", "Forest", "Forest", "Forest"}; // cards to be placed on the AI battlefield
String humanSetupCardsInHand[] = {"Raging Goblin"}; // cards that will replace the current human hand
String computerSetupCardsInHand[] = {"Force of Nature"}; // cards that will replace the current AI hand
CardList humanDevSetup = new CardList();
CardList computerDevSetup = new CardList();
CardList humanDevHandSetup = new CardList();
CardList computerDevHandSetup = new CardList();
for (int i = 0; i < humanSetupCardsInPlay.length; i ++) {
Card c = AllZone.CardFactory.getCard(humanSetupCardsInPlay[i], AllZone.HumanPlayer);
for(Trigger trig : c.getTriggers())
{
AllZone.TriggerHandler.registerTrigger(trig);
}
c.setCurSetCode(c.getMostRecentSet());
c.setImageFilename(CardUtil.buildFilename(c));
humanDevSetup.add(c);
}
for (int i = 0; i < humanSetupCardsInHand.length; i ++) {
Card c = AllZone.CardFactory.getCard(humanSetupCardsInHand[i], AllZone.HumanPlayer);
for(Trigger trig : c.getTriggers())
{
AllZone.TriggerHandler.registerTrigger(trig);
}
c.setCurSetCode(c.getMostRecentSet());
c.setImageFilename(CardUtil.buildFilename(c));
humanDevHandSetup.add(c);
}
for (int i = 0; i < computerSetupCardsInPlay.length; i ++) {
Card c = AllZone.CardFactory.getCard(computerSetupCardsInPlay[i], AllZone.ComputerPlayer);
c.setCurSetCode(c.getMostRecentSet());
c.setImageFilename(CardUtil.buildFilename(c));
for(Trigger trig : c.getTriggers())
{
AllZone.TriggerHandler.registerTrigger(trig);
}
computerDevSetup.add(c);
}
for (int i = 0; i < computerSetupCardsInHand.length; i ++) {
Card c = AllZone.CardFactory.getCard(computerSetupCardsInHand[i], AllZone.HumanPlayer);
c.setCurSetCode(c.getMostRecentSet());
c.setImageFilename(CardUtil.buildFilename(c));
for(Trigger trig : c.getTriggers())
{
AllZone.TriggerHandler.registerTrigger(trig);
}
computerDevHandSetup.add(c);
}
for (Card c : humanDevSetup)
{
AllZone.Human_Hand.add(c);
AllZone.GameAction.moveToPlay(c);
}
for (Card c: computerDevSetup)
{
AllZone.Computer_Hand.add(c);
AllZone.GameAction.moveToPlay(c);
}
AllZone.Computer_Hand.setCards(computerDevHandSetup.toArray());
AllZone.Human_Hand.setCards(humanDevHandSetup.toArray());
AllZone.ComputerPlayer.setLife(setComputerLife, null);
AllZone.HumanPlayer.setLife(setHumanLife, null);
}
};
// - Battlefield setup -