- Converted a few instances of getOpponent()

- Converted Rainbow Vale to script
This commit is contained in:
moomarc
2013-01-08 10:33:13 +00:00
parent fb27a0d956
commit 6e20e02586
6 changed files with 23 additions and 12 deletions

View File

@@ -2,7 +2,10 @@ Name:Rainbow Vale
ManaCost:no cost
Types:Land
Text:If CARDNAME is tapped for mana, an opponent gains control of CARDNAME at the beginning of the next end step.
A:AB$ Mana | Cost$ T | Produced$ Any | SpellDescription$ Add one mana of any color to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ Any | SubAbility$ ValeTrig | SpellDescription$ Add one mana of any color to your mana pool. An opponent gains control of CARDNAME at the beginning of the next end step.
SVar:ValeTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ ChooseOpp | TriggerDescription$ An opponent gains control of CARDNAME at the beginning of the next end step.
SVar:ChooseOpp:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | ChoiceTitle$ Choose an opponent to give control to: | AILogic$ Curse | SubAbility$ DonateTheVale
SVar:DonateTheVale:DB$ GainControl | Defined$ Self | NewController$ Player.Chosen
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rainbow_vale.jpg

View File

@@ -55,8 +55,7 @@ public class ChoosePlayerEffect extends SpellEffect {
} else {
if (sa.hasParam("AILogic")) {
if (sa.getParam("AILogic").equals("Curse")) {
int curseChoice;
for (curseChoice = 0; curseChoice < choices.size(); curseChoice++) {
for (int curseChoice = 0; curseChoice < choices.size(); curseChoice++) {
if (choices.get(curseChoice).isHostileTo(p)) {
card.setChosenPlayer(choices.get(curseChoice));
break;

View File

@@ -128,9 +128,9 @@ public class AbilityManaPart implements java.io.Serializable {
// TODO all of the following would be better as trigger events
// "tapped for mana"
if (source.getName().equals("Rainbow Vale")) {
/*if (source.getName().equals("Rainbow Vale")) {
source.addExtrinsicKeyword("An opponent gains control of CARDNAME at the beginning of the next end step.");
}
}*/
if (source.getName().equals("Undiscovered Paradise")) {
// Probably best to conver this to an Extrinsic Ability

View File

@@ -130,7 +130,7 @@ public class EndOfTurn extends Phase {
+ "destroy CARDNAME if it attacked this turn.");
}
}
if (c.hasKeyword("An opponent gains control of CARDNAME at the beginning of the next end step.")) {
/*if (c.hasKeyword("An opponent gains control of CARDNAME at the beginning of the next end step.")) {
final Card vale = c;
final SpellAbility change = new Ability(vale, "0") {
@Override
@@ -153,7 +153,7 @@ public class EndOfTurn extends Phase {
Singletons.getModel().getGame().getStack().addSimultaneousStackEntry(change);
}
}*/
if (c.hasKeyword("At the beginning of your end step, return CARDNAME to its owner's hand.")
&& Singletons.getModel().getGame().getPhaseHandler().isPlayerTurn(c.getController())) {

View File

@@ -37,6 +37,7 @@ import forge.Card;
import forge.CounterType;
import forge.GameEntity;
import forge.Singletons;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.toolbox.FLabel;
import forge.gui.toolbox.FPanel;
@@ -329,10 +330,18 @@ public class CardDetailPanel extends FPanel implements CardContainer {
&& !card.getController().getZone(ZoneType.Library).isEmpty()) {
area.append("\r\nTop card of your library: ");
area.append(card.getController().getCardsIn(ZoneType.Library, 1));
if (card.hasKeyword("Players play with the top card of their libraries revealed.")
&& !card.getController().getOpponent().getZone(ZoneType.Library).isEmpty()) {
area.append("\r\nTop card of your opponent's library: ");
area.append(card.getController().getOpponent().getCardsIn(ZoneType.Library, 1));
if (card.hasKeyword("Players play with the top card of their libraries revealed.")) {
for (final Player p : card.getController().getAllOtherPlayers()) {
if (p.getZone(ZoneType.Library).isEmpty()) {
area.append(p.getName());
area.append("'s library is empty.");
} else {
area.append("\r\nTop card of ");
area.append(p.getName());
area.append("'s library: ");
area.append(p.getCardsIn(ZoneType.Library, 1));
}
}
}
}

View File

@@ -458,7 +458,7 @@ public final class GuiDisplayUtil {
List<Card> computerDevExileSetup = new ArrayList<Card>();
final Player human = Singletons.getControl().getPlayer();
final Player ai = human.getOpponent();
final Player ai = human.getOpponents().get(0);
if (!tChangePlayer.trim().toLowerCase().equals("none")) {
if (tChangePlayer.trim().toLowerCase().equals("human")) {