forked from External/mage
Added MANA_PAYED event
This commit is contained in:
parent
2f13b536b0
commit
d94361cee7
2 changed files with 6 additions and 3 deletions
|
|
@ -28,9 +28,10 @@
|
|||
|
||||
package mage.game.events;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -87,7 +88,7 @@ public class GameEvent {
|
|||
PLAY_LAND, LAND_PLAYED,
|
||||
CAST_SPELL, SPELL_CAST,
|
||||
ACTIVATE_ABILITY, ACTIVATED_ABILITY,
|
||||
MANA_ADDED,
|
||||
MANA_ADDED, MANA_PAYED,
|
||||
LOSES, LOST, WINS,
|
||||
TARGET, TARGETED,
|
||||
COUNTER, COUNTERED,
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ public class ManaPool implements Serializable {
|
|||
for (ManaPoolItem mana : manaItems) {
|
||||
if (filter == null || filter.match(game.getObject(mana.getSourceId()))) {
|
||||
if (mana.get(manaType) > 0) {
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getSourceId(), ability.getControllerId()));
|
||||
mana.remove(manaType);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -279,7 +280,8 @@ public class ManaPool implements Serializable {
|
|||
for (ConditionalMana mana : getConditionalMana()) {
|
||||
if (mana.get(manaType) > 0 && mana.apply(ability, game, mana.getManaProducerId())) {
|
||||
mana.set(manaType, mana.get(manaType) - 1);
|
||||
break;
|
||||
game.fireEvent(new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getManaProducerId(), ability.getControllerId()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue