Forge version 1.4.3

Tentative target release date: Friday July 12.
High Quality Resources for Collectible Card Games
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=10930
Canceling spells/undoing mana payments still doesn't redraw.Max mtg wrote:So... what exactly remains 'disrupted' after r22478?
Index: main/java/forge/game/GameAction.java
===================================================================
--- main/java/forge/game/GameAction.java (revision 22532)
+++ main/java/forge/game/GameAction.java (working copy)
@@ -902,14 +902,16 @@
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
}
- if (this.handleLegendRule()) {
- checkAgain = true;
+ for(Player p : game.getPlayers() ) {
+ if (this.handleLegendRule(p)) {
+ checkAgain = true;
+ }
+
+ if (this.handlePlaneswalkerRule(p)) {
+ checkAgain = true;
+ }
}
- if (this.handlePlaneswalkerRule()) {
- checkAgain = true;
- }
-
if (!checkAgain) {
break; // do not continue the loop
}
@@ -1139,9 +1141,9 @@
* destroyPlaneswalkers.
* </p>
*/
- private boolean handlePlaneswalkerRule() {
+ private boolean handlePlaneswalkerRule(Player p) {
// get all Planeswalkers
- final List<Card> list = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANEWALKERS);
+ final List<Card> list = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANEWALKERS);
boolean recheck = false;
Card c;
@@ -1179,8 +1181,8 @@
* destroyLegendaryCreatures.
* </p>
*/
- private boolean handleLegendRule() {
- final List<Card> a = CardLists.getType(game.getCardsIn(ZoneType.Battlefield), "Legendary");
+ private boolean handleLegendRule(Player p) {
+ final List<Card> a = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), "Legendary");
if (a.isEmpty() || game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
return false;
}
@@ -1190,7 +1192,7 @@
a.removeAll(yamazaki);
}
while (!a.isEmpty()) {
- List<Card> b = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals(a.get(0).getName()));
+ List<Card> b = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals(a.get(0).getName()));
b = CardLists.getType(b, "Legendary");
b = CardLists.filter(b, new Predicate<Card>() {
@Override
Wouldn't this destroy all plainswalkers/legends with the same name belonging to a particular player? Under the new rules the player is supposed to choose one of them that stays on the battlefield while the rest is destroyed.Max mtg wrote:Legendary/Planeswalker rule handling is rediculously easy.Didn't commit it
- Code: Select all
Index: main/java/forge/game/GameAction.java
===================================================================
--- main/java/forge/game/GameAction.java (revision 22532)
+++ main/java/forge/game/GameAction.java (working copy)
@@ -902,14 +902,16 @@
game.getStack().chooseOrderOfSimultaneousStackEntryAll();
}
- if (this.handleLegendRule()) {
- checkAgain = true;
+ for(Player p : game.getPlayers() ) {
+ if (this.handleLegendRule(p)) {
+ checkAgain = true;
+ }
+
+ if (this.handlePlaneswalkerRule(p)) {
+ checkAgain = true;
+ }
}
- if (this.handlePlaneswalkerRule()) {
- checkAgain = true;
- }
-
if (!checkAgain) {
break; // do not continue the loop
}
@@ -1139,9 +1141,9 @@
* destroyPlaneswalkers.
* </p>
*/
- private boolean handlePlaneswalkerRule() {
+ private boolean handlePlaneswalkerRule(Player p) {
// get all Planeswalkers
- final List<Card> list = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANEWALKERS);
+ final List<Card> list = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANEWALKERS);
boolean recheck = false;
Card c;
@@ -1179,8 +1181,8 @@
* destroyLegendaryCreatures.
* </p>
*/
- private boolean handleLegendRule() {
- final List<Card> a = CardLists.getType(game.getCardsIn(ZoneType.Battlefield), "Legendary");
+ private boolean handleLegendRule(Player p) {
+ final List<Card> a = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), "Legendary");
if (a.isEmpty() || game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
return false;
}
@@ -1190,7 +1192,7 @@
a.removeAll(yamazaki);
}
while (!a.isEmpty()) {
- List<Card> b = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals(a.get(0).getName()));
+ List<Card> b = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals(a.get(0).getName()));
b = CardLists.getType(b, "Legendary");
b = CardLists.filter(b, new Predicate<Card>() {
@Override
Has been done.friarsol wrote:Indestructible now a Keyword (Code Changes + Script updates?)
The code i commited reads quite the sameswordshine wrote:State-based action for Brothers Yamazaki: if there are exactly two permanents named Brothers Yamazaki on the battlefield, remove them from the check, otherwise apply the legend rule.
Current code cannot handle situation when each player has exactly two Brothers Yamazaki.Max mtg wrote:The code i commited reads quite the same![]()
There will remain only one if there were 3+ of them