mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
[minor] SunburstCount prevent exception.
This commit is contained in:
parent
250f860298
commit
514d21375c
2 changed files with 24 additions and 23 deletions
|
|
@ -69,11 +69,11 @@ public class SuspendedCondition implements Condition {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (found) {
|
||||||
if (found) {
|
if (game.getState().getZone(card.getId()) == Zone.EXILED &&
|
||||||
if (game.getState().getZone(card.getId()) == Zone.EXILED &&
|
card.getCounters().getCount(CounterType.TIME) > 0) {
|
||||||
card.getCounters().getCount(CounterType.TIME) > 0) {
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -49,24 +49,25 @@ public class SunburstCount implements DynamicValue{
|
||||||
@Override
|
@Override
|
||||||
public int calculate(Game game, Ability source) {
|
public int calculate(Game game, Ability source) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
if (!game.getStack().isEmpty()) {
|
||||||
StackObject spell = game.getStack().getFirst();
|
StackObject spell = game.getStack().getFirst();
|
||||||
if (spell != null && spell instanceof Spell && ((Spell)spell).getSourceId().equals(source.getSourceId())) {
|
if (spell != null && spell instanceof Spell && ((Spell)spell).getSourceId().equals(source.getSourceId())) {
|
||||||
Mana mana = ((Spell)spell).getSpellAbility().getManaCostsToPay().getPayment();
|
Mana mana = ((Spell)spell).getSpellAbility().getManaCostsToPay().getPayment();
|
||||||
if(mana.getBlack() > 0) {
|
if(mana.getBlack() > 0) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if(mana.getBlue() > 0) {
|
if(mana.getBlue() > 0) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if(mana.getGreen() > 0) {
|
if(mana.getGreen() > 0) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if(mana.getRed() > 0) {
|
if(mana.getRed() > 0) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if(mana.getWhite() > 0) {
|
if(mana.getWhite() > 0) {
|
||||||
count++;
|
count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue