mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
update a few custom Yes/No dialogs to use GameActionUtil.showYesNoDialog()
This commit is contained in:
@@ -362,7 +362,7 @@ public class AbilityFactory_CounterMagic {
|
||||
else if(ActionID.equals("GainLife")) {
|
||||
if(isOptional) {
|
||||
if(Target == AllZone.HumanPlayer) {
|
||||
if(AllZone.Display.getChoice("Do you want to gain" + SplitActionParams[0] + "life?","Yes","No").equals("Yes")) {
|
||||
if(GameActionUtil.showYesNoDialog(srcSA.getSourceCard(), "Do you want to gain" + SplitActionParams[0] + "life?")) {
|
||||
Target.gainLife(Integer.parseInt(SplitActionParams[0]), srcSA.getSourceCard());
|
||||
}
|
||||
}
|
||||
@@ -379,7 +379,7 @@ public class AbilityFactory_CounterMagic {
|
||||
if(isOptional) {
|
||||
System.out.println(Target);
|
||||
if(Target == AllZone.HumanPlayer) {
|
||||
if(AllZone.Display.getChoice("Do you want to reveal your hand?","Yes","No").equals("Yes")) {
|
||||
if(GameActionUtil.showYesNoDialog(srcSA.getSourceCard(), "Do you want to reveal your hand?")) {
|
||||
//Does nothing now, of course, but sometime in the future the AI may be able to remember cards revealed and prioritize discard spells accordingly.
|
||||
}
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public class AbilityFactory_CounterMagic {
|
||||
else if(ActionID.equals("RearrangeTopOfLibrary")) {
|
||||
if(isOptional) {
|
||||
if(Target == AllZone.HumanPlayer) {
|
||||
if(AllZone.Display.getChoice("Do you want to rearrange the top " + SplitActionParams[0] + " cards of your library?","Yes","No").equals("Yes")) {
|
||||
if(GameActionUtil.showYesNoDialog(srcSA.getSourceCard(), "Do you want to rearrange the top " + SplitActionParams[0] + " cards of your library?")) {
|
||||
AllZoneUtil.rearrangeTopOfLibrary(Target, Integer.parseInt(SplitActionParams[0]), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,13 +385,10 @@ public class Phase extends MyObservable
|
||||
final Card crd = vaults.get(0);
|
||||
|
||||
if(turn.equals(AllZone.HumanPlayer)) {
|
||||
String[] choices = {"Yes", "No"};
|
||||
Object q = null;
|
||||
q = AllZone.Display.getChoiceOptional("Untap " + crd + "?", choices);
|
||||
if("Yes".equals(q)) {
|
||||
crd.untap();
|
||||
turn = extraTurns.isEmpty() ? turn.getOpponent() : extraTurns.pop();
|
||||
}
|
||||
if(GameActionUtil.showYesNoDialog(crd, "Untap " + crd + "?")) {
|
||||
crd.untap();
|
||||
turn = extraTurns.isEmpty() ? turn.getOpponent() : extraTurns.pop();
|
||||
}
|
||||
}
|
||||
else{
|
||||
// TODO: Should AI skip his turn for time vault?
|
||||
|
||||
@@ -338,19 +338,15 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
|
||||
@Override
|
||||
public void resolve() {
|
||||
if(crd.getController().equals(AllZone.HumanPlayer)) {
|
||||
String[] choices = {"Yes", "No"};
|
||||
if(GameActionUtil.showYesNoDialog(crd, "Attach " + crd + " to " + creat + "?")) {
|
||||
if(AllZone.GameAction.isCardInZone(crd, graveZone)
|
||||
&& AllZone.GameAction.isCardInPlay(creat) && creat.isCreature()
|
||||
&& creat.getNetAttack() == 1 && creat.getNetDefense() == 1) {
|
||||
graveZone.remove(crd);
|
||||
playZone.add(crd);
|
||||
|
||||
Object q = null;
|
||||
|
||||
q = AllZone.Display.getChoiceOptional("Attach " + crd + " to " + creat + "?", choices);
|
||||
if(q == null || q.equals("No")) ;
|
||||
else if(AllZone.GameAction.isCardInZone(crd, graveZone)
|
||||
&& AllZone.GameAction.isCardInPlay(creat) && creat.isCreature()
|
||||
&& creat.getNetAttack() == 1 && creat.getNetDefense() == 1) {
|
||||
graveZone.remove(crd);
|
||||
playZone.add(crd);
|
||||
|
||||
crd.equipCard(creat);
|
||||
crd.equipCard(creat);
|
||||
}
|
||||
}
|
||||
|
||||
} else //computer
|
||||
|
||||
Reference in New Issue
Block a user