mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Converted Zone.add() to moveTo() for the leftovers that aren't issue cases, or occur during game startup.
This commit is contained in:
@@ -173,7 +173,6 @@ public class Card extends MyObservable {
|
||||
//used a limited number of times per turn
|
||||
//CardFactory.SSP_canPlay(Card) uses these variables
|
||||
|
||||
private int abilityTurnUsed; //What turn did this card last use this ability?
|
||||
private int abilityUsed; //How many times has this ability been used?
|
||||
|
||||
public void addTrigger(Trigger t)
|
||||
@@ -202,15 +201,7 @@ public class Card extends MyObservable {
|
||||
{
|
||||
triggers.clear();
|
||||
}
|
||||
|
||||
public void setAbilityTurnUsed(int i) {
|
||||
abilityTurnUsed = i;
|
||||
}
|
||||
|
||||
public int getAbilityTurnUsed() {
|
||||
return abilityTurnUsed;
|
||||
}
|
||||
|
||||
|
||||
public void setAbilityUsed(int i) {
|
||||
abilityUsed = i;
|
||||
}
|
||||
|
||||
@@ -5325,8 +5325,7 @@ public class CardFactory implements NewConstants {
|
||||
AllZone.GameAction.exile(getTargetCard());
|
||||
|
||||
//put permanent onto the battlefield
|
||||
Card c = getSourceCard();
|
||||
AllZone.getZone(Constant.Zone.Battlefield, c.getController()).add(c);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
}
|
||||
}//resolve()
|
||||
|
||||
@@ -5359,9 +5358,7 @@ public class CardFactory implements NewConstants {
|
||||
if(!c.isToken()) {
|
||||
c = AllZone.CardFactory.copyCard(c);
|
||||
c.setController(c.getOwner());
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
|
||||
play.add(c);
|
||||
AllZone.GameAction.moveToPlay(c);
|
||||
}
|
||||
}//resolve()
|
||||
};//SpellAbility
|
||||
@@ -6750,12 +6747,11 @@ public class CardFactory implements NewConstants {
|
||||
public void resolve() {
|
||||
final Player player = card.getController();
|
||||
CardList grave = AllZoneUtil.getPlayerGraveyard(player);
|
||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||
|
||||
for(Card c:grave) {
|
||||
lib.add(c);
|
||||
AllZone.GameAction.moveToLibrary(c);
|
||||
}
|
||||
AllZone.getZone(Constant.Zone.Graveyard, player).reset();
|
||||
|
||||
player.shuffle();
|
||||
}
|
||||
|
||||
@@ -6788,13 +6784,13 @@ public class CardFactory implements NewConstants {
|
||||
public void resolve() {
|
||||
final Player player = card.getController();
|
||||
CardList grave = AllZoneUtil.getPlayerGraveyard(player);
|
||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
||||
|
||||
AllZone.GameAction.moveToLibrary(card);
|
||||
|
||||
for(Card c:grave) {
|
||||
lib.add(c);
|
||||
AllZone.GameAction.moveToLibrary(c);
|
||||
}
|
||||
AllZone.getZone(Constant.Zone.Graveyard, player).reset();
|
||||
|
||||
player.shuffle();
|
||||
player.gainLife(5, card);
|
||||
}
|
||||
|
||||
@@ -1097,7 +1097,6 @@ public class CardFactoryUtil {
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, sourceCard.getController());
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, sourceCard.getController());
|
||||
|
||||
CardList mercs = new CardList();
|
||||
CardList list = new CardList(lib.getCards());
|
||||
@@ -4089,15 +4088,14 @@ public class CardFactoryUtil {
|
||||
for(String kw:intrinsicKeywords)
|
||||
c.addIntrinsicKeyword(kw);
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, controller);
|
||||
|
||||
int multiplier = AllZoneUtil.getDoublingSeasonMagnitude(controller);
|
||||
// todo: does this need to set PlayerZone_ComesIntoPlay.SimultaneousEntry like Rite of Replication does?
|
||||
for(int i = 0; i < multiplier; i++) {
|
||||
Card temp = CardFactory.copyStats(c);
|
||||
temp.setController(controller);
|
||||
temp.setOwner(controller);
|
||||
temp.setToken(true);
|
||||
play.add(temp);
|
||||
AllZone.GameAction.moveToPlay(temp);
|
||||
list.add(temp);
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -100,8 +100,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -292,8 +291,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -410,8 +408,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -605,8 +602,7 @@ class CardFactory_Auras {
|
||||
NewType[0] = GuiUtils.getChoice("Select land type.", "Plains","Island","Swamp","Mountain","Forest");
|
||||
}
|
||||
}
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -782,8 +778,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -862,8 +857,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -980,8 +974,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1074,8 +1067,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1173,8 +1165,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1235,8 +1226,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1340,8 +1330,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1450,8 +1439,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1768,8 +1756,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -1882,8 +1869,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -2021,8 +2007,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) card.enchantCard(c);
|
||||
@@ -2340,8 +2325,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
@@ -2481,8 +2465,7 @@ class CardFactory_Auras {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(card);
|
||||
AllZone.GameAction.moveToPlay(card);
|
||||
|
||||
Card c = getTargetCard();
|
||||
|
||||
|
||||
@@ -268,9 +268,7 @@ public class CardFactory_Creatures {
|
||||
copy.setImageFilename("morph.jpg");
|
||||
}
|
||||
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(copy);
|
||||
AllZone.GameAction.moveToPlay(copy);
|
||||
crds[i] = copy;
|
||||
}
|
||||
|
||||
@@ -5378,8 +5376,7 @@ public class CardFactory_Creatures {
|
||||
copy.setBaseAttack(token.getBaseAttack());
|
||||
copy.setBaseDefense(token.getBaseDefense());
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(copy);
|
||||
AllZone.GameAction.moveToPlay(copy);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -7875,11 +7872,12 @@ public class CardFactory_Creatures {
|
||||
double Count = DoublingSeasons.size();
|
||||
Count = Math.pow(2,Count);
|
||||
for(int i = 0; i < Count; i++) {
|
||||
if(i + 1== Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getSourceCard());
|
||||
Copy.setToken(true);
|
||||
Copy.setController(getSourceCard().getController());
|
||||
play.add(Copy);
|
||||
|
||||
AllZone.GameAction.moveToPlay(Copy);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,8 +107,7 @@ class CardFactory_Planeswalkers {
|
||||
emblem.setController(card.getController());
|
||||
emblem.setOwner(card.getOwner());
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(emblem);
|
||||
AllZone.GameAction.moveToPlay(emblem);
|
||||
|
||||
//AllZone.GameAction.checkStateEffects();
|
||||
AllZone.StaticEffects.rePopulateStateBasedList();
|
||||
@@ -1978,8 +1977,8 @@ class CardFactory_Planeswalkers {
|
||||
emblem.setController(card.getController());
|
||||
emblem.setOwner(card.getOwner());
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(emblem);
|
||||
// todo: Emblems live in the command zone
|
||||
AllZone.GameAction.moveToPlay(emblem);
|
||||
|
||||
//AllZone.GameAction.checkStateEffects();
|
||||
AllZone.StaticEffects.rePopulateStateBasedList();
|
||||
@@ -2339,8 +2338,7 @@ class CardFactory_Planeswalkers {
|
||||
emblem.setController(card.getController());
|
||||
emblem.setOwner(card.getOwner());
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(emblem);
|
||||
AllZone.GameAction.moveToPlay(emblem);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2853,19 +2853,18 @@ public class CardFactory_Sorceries {
|
||||
@Override
|
||||
public void resolve() {
|
||||
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
||||
double Count = AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||
for(int i = 0; i < Count; i++) {
|
||||
if(i + 1== Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||
Copy.setToken(true);
|
||||
Copy.setController(card.getController());
|
||||
play.add(Copy);
|
||||
}
|
||||
}
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
||||
double Count = AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||
for(int i = 0; i < Count; i++) {
|
||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||
Copy.setToken(true);
|
||||
Copy.setController(card.getController());
|
||||
AllZone.GameAction.moveToPlay(Copy);
|
||||
}
|
||||
}
|
||||
}//resolve()
|
||||
};
|
||||
|
||||
@@ -2923,19 +2922,18 @@ public class CardFactory_Sorceries {
|
||||
@Override
|
||||
public void resolve() {
|
||||
card.setKicked(true);
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
||||
int Count = 5 * AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||
for(int i = 0; i < Count; i++) {
|
||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||
Copy.setToken(true);
|
||||
Copy.setController(card.getController());
|
||||
play.add(Copy);
|
||||
}
|
||||
}
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
PlayerZone_ComesIntoPlay.SimultaneousEntry = true;
|
||||
int Count = 5 * AllZoneUtil.getDoublingSeasonMagnitude(card.getController());
|
||||
for(int i = 0; i < Count; i++) {
|
||||
if(i + 1 == Count) PlayerZone_ComesIntoPlay.SimultaneousEntry = false;
|
||||
Card Copy = AllZone.CardFactory.copyCardintoNew(getTargetCard());
|
||||
Copy.setToken(true);
|
||||
Copy.setController(card.getController());
|
||||
AllZone.GameAction.moveToPlay(Copy);
|
||||
}
|
||||
}
|
||||
}//resolve()
|
||||
};
|
||||
kicker.setKickerAbility(true);
|
||||
|
||||
@@ -2543,7 +2543,6 @@ public class CombatUtil {
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone library = AllZone.getZone(Constant.Zone.Library, attacker.getController());
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, attacker.getController());
|
||||
|
||||
CardList enchantments = new CardList(library.getCards());
|
||||
//final String turn = attacker.getController();
|
||||
|
||||
@@ -49,10 +49,12 @@ public class GameAction {
|
||||
p.remove(c);
|
||||
}
|
||||
else{
|
||||
// things that were just created will not have zones!
|
||||
//System.out.println(c.getName() + " " + zone.getZoneName());
|
||||
}
|
||||
Card moving = c;
|
||||
if (!c.isToken()){
|
||||
// Don't add the Token, unless it's moving to the battlefield
|
||||
if (!c.isToken() || zone.is(Constant.Zone.Battlefield)){
|
||||
// If a nontoken card is moving from the Battlefield, to non-Battlefield zone copy it
|
||||
if (p != null && p.is(Constant.Zone.Battlefield) && !zone.is(Constant.Zone.Battlefield))
|
||||
moving = AllZone.CardFactory.copyCard(c);
|
||||
@@ -2392,10 +2394,10 @@ public class GameAction {
|
||||
AllZone.ComputerPlayer.drawCard();
|
||||
}
|
||||
|
||||
// todo: ManaPool should be moved to Player and be represented in the player panel
|
||||
ManaPool mp = AllZone.ManaPool;
|
||||
mp.setImageFilename("mana_pool");
|
||||
AllZone.Human_Battlefield.add(mp);
|
||||
//ButtonUtil.reset();
|
||||
|
||||
AllZone.InputControl.setInput(new Input_Mulligan());
|
||||
Phase.GameBegins = 1;
|
||||
|
||||
@@ -869,7 +869,7 @@ public class GameActionUtil {
|
||||
}
|
||||
revealed.shuffle();
|
||||
for(Card bottom:revealed) {
|
||||
lib.add(bottom);
|
||||
AllZone.GameAction.moveToBottomOfLibrary(bottom);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -10231,9 +10231,7 @@ public class GameActionUtil {
|
||||
c.addSpellAbility(devour);
|
||||
c.addComesIntoPlayCommand(intoPlay);
|
||||
|
||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
||||
play.add(c);
|
||||
|
||||
AllZone.GameAction.moveToPlay(c);
|
||||
}
|
||||
};// Ability
|
||||
ability.setStackDescription("Dragon Broodmother - put a 1/1 red and green Dragon token onto the battlefield.");
|
||||
|
||||
Reference in New Issue
Block a user