mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Fixed that conditional mana colors were not tracked correctly for abilities like Converge.
This commit is contained in:
parent
89542ccb67
commit
9a28f8d678
1 changed files with 3 additions and 2 deletions
|
@ -125,7 +125,7 @@ public class ManaPool implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getConditional(manaType, ability, filter, game, costToPay) > 0) {
|
if (getConditional(manaType, ability, filter, game, costToPay) > 0) {
|
||||||
removeConditional(manaType, ability, game, costToPay);
|
removeConditional(manaType, ability, game, costToPay, usedManaToPay);
|
||||||
lockManaType(); // pay only one mana if mana payment is set to manually
|
lockManaType(); // pay only one mana if mana payment is set to manually
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -437,10 +437,11 @@ public class ManaPool implements Serializable {
|
||||||
return new ManaPool(this);
|
return new ManaPool(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeConditional(ManaType manaType, Ability ability, Game game, Cost costToPay) {
|
private void removeConditional(ManaType manaType, Ability ability, Game game, Cost costToPay, Mana usedManaToPay) {
|
||||||
for (ConditionalMana mana : getConditionalMana()) {
|
for (ConditionalMana mana : getConditionalMana()) {
|
||||||
if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId(), costToPay)) {
|
if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId(), costToPay)) {
|
||||||
mana.set(manaType, mana.get(manaType) - 1);
|
mana.set(manaType, mana.get(manaType) - 1);
|
||||||
|
usedManaToPay.increase(manaType);
|
||||||
GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAID, ability.getId(), mana.getManaProducerId(), ability.getControllerId(), 0, mana.getFlag());
|
GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAID, ability.getId(), mana.getManaProducerId(), ability.getControllerId(), 0, mana.getFlag());
|
||||||
event.setData(mana.getManaProducerOriginalId().toString());
|
event.setData(mana.getManaProducerOriginalId().toString());
|
||||||
game.fireEvent(event);
|
game.fireEvent(event);
|
||||||
|
|
Loading…
Reference in a new issue