forked from External/mage
* Adding some tests and minor changes to commander code.
This commit is contained in:
parent
bd14054372
commit
d8128d3741
5 changed files with 357 additions and 31 deletions
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.abilities.common;
|
||||
|
||||
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.SpellAbilityType;
|
||||
|
|
@ -57,22 +56,14 @@ public class CastCommanderAbility extends SpellAbility {
|
|||
public boolean activate(Game game, boolean noMana) {
|
||||
if (super.activate(game, noMana)) {
|
||||
// save amount of times commander was cast
|
||||
Integer castCount = (Integer)game.getState().getValue(sourceId + "_castCount");
|
||||
if(castCount != null){
|
||||
castCount++;
|
||||
game.getState().setValue(sourceId + "_castCount", castCount);
|
||||
}
|
||||
else {
|
||||
castCount = 1;
|
||||
game.getState().setValue(sourceId + "_castCount", castCount);
|
||||
}
|
||||
Integer castCount = (Integer) game.getState().getValue(sourceId + "_castCount");
|
||||
castCount++;
|
||||
game.getState().setValue(sourceId + "_castCount", castCount);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public CastCommanderAbility copy() {
|
||||
return new CastCommanderAbility(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue