forked from External/mage
Fixed that the information what mana was payed to pay the mana cost of a spell or ability were not correct if "spend mana as though" abilities were involved in the payment (fixes #3604).
This commit is contained in:
parent
dc5007003b
commit
5a3243890d
8 changed files with 109 additions and 23 deletions
|
|
@ -237,6 +237,38 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|
|||
any += mana.getAny();
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the given mana by one.
|
||||
*
|
||||
* @param manaType
|
||||
*/
|
||||
public void increase(ManaType manaType) {
|
||||
switch (manaType) {
|
||||
case BLACK:
|
||||
black++;
|
||||
break;
|
||||
case BLUE:
|
||||
blue++;
|
||||
break;
|
||||
case COLORLESS:
|
||||
colorless++;
|
||||
break;
|
||||
case GENERIC:
|
||||
generic++;
|
||||
break;
|
||||
case GREEN:
|
||||
green++;
|
||||
break;
|
||||
case RED:
|
||||
red++;
|
||||
break;
|
||||
case WHITE:
|
||||
white++;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the Red mana by one.
|
||||
*/
|
||||
|
|
@ -815,11 +847,12 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns if this objects mana contains any coloured mana the same as the passed in
|
||||
* {@link Mana}'s mana.
|
||||
* Returns if this objects mana contains any coloured mana the same as the
|
||||
* passed in {@link Mana}'s mana.
|
||||
*
|
||||
* @param mana the mana to check for
|
||||
* @return true if this contains any of the same type of coloured mana that this has
|
||||
* @return true if this contains any of the same type of coloured mana that
|
||||
* this has
|
||||
*/
|
||||
public boolean containsAny(final Mana mana) {
|
||||
if (mana.black > 0 && this.black > 0) {
|
||||
|
|
@ -832,7 +865,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
|
|||
return true;
|
||||
} else if (mana.green > 0 && this.green > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue