mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- Update state-based actions (704_5r now fire remove counter triggers, Brother Yamazaki now work correctly with Humility)
This commit is contained in:
@@ -685,7 +685,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
public final void checkStaticAbilities() {
|
public final void checkStaticAbilities() { // TODO return checkagain in SBA
|
||||||
if (game.isGameOver()) {
|
if (game.isGameOver()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -875,10 +875,9 @@ public class GameAction {
|
|||||||
if (game.getTriggerHandler().runWaitingTriggers()) {
|
if (game.getTriggerHandler().runWaitingTriggers()) {
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean yamazaki = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Brothers Yamazaki")).size() == 2;
|
|
||||||
for (Player p : game.getPlayers()) {
|
for (Player p : game.getPlayers()) {
|
||||||
if (this.handleLegendRule(p, yamazaki)) {
|
if (this.handleLegendRule(p)) {
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1041,19 +1040,16 @@ public class GameAction {
|
|||||||
*/
|
*/
|
||||||
private boolean stateBasedAction704_5r(Card c) {
|
private boolean stateBasedAction704_5r(Card c) {
|
||||||
boolean checkAgain = false;
|
boolean checkAgain = false;
|
||||||
// +1/+1 counters should erase -1/-1 counters
|
int plusOneCounters = c.getCounters(CounterType.P1P1);
|
||||||
if (c.getCounters(CounterType.P1P1) > 0 && c.getCounters(CounterType.M1M1) > 0) {
|
int minusOneCounters = c.getCounters(CounterType.M1M1);
|
||||||
int plusOneCounters = c.getCounters(CounterType.P1P1);
|
if (plusOneCounters > 0 && minusOneCounters > 0) {
|
||||||
int minusOneCounters = c.getCounters(CounterType.M1M1);
|
int remove = Math.min(plusOneCounters, minusOneCounters);
|
||||||
|
// If a permanent has both a +1/+1 counter and a -1/-1 counter on it,
|
||||||
if (plusOneCounters >= minusOneCounters) c.getCounters().remove(CounterType.M1M1);
|
// N +1/+1 and N -1/-1 counters are removed from it, where N is the
|
||||||
if (plusOneCounters <= minusOneCounters) c.getCounters().remove(CounterType.P1P1);
|
// smaller of the number of +1/+1 and -1/-1 counters on it.
|
||||||
|
// This should fire remove counters trigger
|
||||||
int diff = plusOneCounters - minusOneCounters;
|
c.subtractCounter(CounterType.P1P1, remove);
|
||||||
if (diff != 0) {
|
c.subtractCounter(CounterType.M1M1, remove);
|
||||||
CounterType ct = diff > 0 ? CounterType.P1P1 : CounterType.M1M1;
|
|
||||||
c.getCounters().put(ct, Math.abs(diff));
|
|
||||||
}
|
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
}
|
}
|
||||||
return checkAgain;
|
return checkAgain;
|
||||||
@@ -1186,16 +1182,15 @@ public class GameAction {
|
|||||||
* destroyLegendaryCreatures.
|
* destroyLegendaryCreatures.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
private boolean handleLegendRule(Player p, boolean yama) {
|
private boolean handleLegendRule(Player p) {
|
||||||
final List<Card> a = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), "Legendary");
|
final List<Card> a = CardLists.getType(p.getCardsIn(ZoneType.Battlefield), "Legendary");
|
||||||
if (a.isEmpty() || game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
|
if (a.isEmpty() || game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean recheck = false;
|
boolean recheck = false;
|
||||||
if (yama) {
|
List<Card> yamazaki = CardLists.getKeyword(a, "Legend rule doesn't apply to CARDNAME.");
|
||||||
List<Card> yamazaki = CardLists.filter(a, CardPredicates.nameEquals("Brothers Yamazaki"));
|
a.removeAll(yamazaki);
|
||||||
a.removeAll(yamazaki);
|
|
||||||
}
|
|
||||||
|
|
||||||
Multimap<String, Card> uniqueLegends = ArrayListMultimap.create();
|
Multimap<String, Card> uniqueLegends = ArrayListMultimap.create();
|
||||||
for (Card c : a) {
|
for (Card c : a) {
|
||||||
|
|||||||
@@ -2,8 +2,9 @@ Name:Brothers Yamazaki
|
|||||||
ManaCost:2 R
|
ManaCost:2 R
|
||||||
Types:Legendary Creature Human Samurai
|
Types:Legendary Creature Human Samurai
|
||||||
PT:2/1
|
PT:2/1
|
||||||
Text:If there are exactly two permanents named CARDNAME on the battlefield, the "legend rule" doesn't apply to them.
|
|
||||||
K:Bushido 1
|
K:Bushido 1
|
||||||
|
S:Mode$ Continuous | Affected$ Permanent.namedBrothers Yamazaki | CheckSVar$ X | SVarCompare$ EQ2 | AddHiddenKeyword$ Legend rule doesn't apply to CARDNAME. | Description$ If there are exactly two permanents named Brothers Yamazaki on the battlefield, the "legend rule" doesn't apply to them.
|
||||||
|
SVar:X:Count$Valid Permanent.namedBrothers Yamazaki
|
||||||
S:Mode$ Continuous | Affected$ Creature.Other+namedBrothers Yamazaki | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Haste | Description$ Each other creature named CARDNAME gets +2/+2 and has haste.
|
S:Mode$ Continuous | Affected$ Creature.Other+namedBrothers Yamazaki | AddPower$ 2 | AddToughness$ 2 | AddKeyword$ Haste | Description$ Each other creature named CARDNAME gets +2/+2 and has haste.
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/brothers_yamazaki.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/brothers_yamazaki.jpg
|
||||||
Oracle:Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.)\nIf there are exactly two permanents named Brothers Yamazaki on the battlefield, the "legend rule" doesn't apply to them.\nEach other creature named Brothers Yamazaki gets +2/+2 and has haste.
|
Oracle:Bushido 1 (When this blocks or becomes blocked, it gets +1/+1 until end of turn.)\nIf there are exactly two permanents named Brothers Yamazaki on the battlefield, the "legend rule" doesn't apply to them.\nEach other creature named Brothers Yamazaki gets +2/+2 and has haste.
|
||||||
Reference in New Issue
Block a user