mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Merge origin/master
This commit is contained in:
commit
269189f87e
9 changed files with 12 additions and 11 deletions
|
@ -103,7 +103,7 @@ class BoseijuWhoSheltersAllWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.MANA_PAYED) {
|
if (event.getType() == GameEvent.EventType.MANA_PAID) {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
// TODO: Replace identification by name by better method that also works if ability is copied from other land with other name
|
// TODO: Replace identification by name by better method that also works if ability is copied from other land with other name
|
||||||
if (object != null && object.getName().equals("Boseiju, Who Shelters All") && event.getFlag()) {
|
if (object != null && object.getName().equals("Boseiju, Who Shelters All") && event.getFlag()) {
|
||||||
|
|
|
@ -169,7 +169,7 @@ class CavernOfSoulsWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.MANA_PAYED) {
|
if (event.getType() == GameEvent.EventType.MANA_PAID) {
|
||||||
if (event.getData() != null && event.getData().equals(originalId)) {
|
if (event.getData() != null && event.getData().equals(originalId)) {
|
||||||
spells.add(event.getTargetId());
|
spells.add(event.getTargetId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ class GeneratorServantWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.MANA_PAYED) {
|
if (event.getType() == GameEvent.EventType.MANA_PAID) {
|
||||||
MageObject target = game.getObject(event.getTargetId());
|
MageObject target = game.getObject(event.getTargetId());
|
||||||
if (event.getSourceId() != null
|
if (event.getSourceId() != null
|
||||||
&& event.getSourceId().equals(this.getSourceId()) && target != null && target.isCreature() && event.getFlag()) {
|
&& event.getSourceId().equals(this.getSourceId()) && target != null && target.isCreature() && event.getFlag()) {
|
||||||
|
|
|
@ -110,7 +110,7 @@ class HallOfTheBanditLordWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == EventType.MANA_PAYED) {
|
if (event.getType() == EventType.MANA_PAID) {
|
||||||
MageObject target = game.getObject(event.getTargetId());
|
MageObject target = game.getObject(event.getTargetId());
|
||||||
if (event.getSourceId() != null
|
if (event.getSourceId() != null
|
||||||
&& event.getSourceId().equals(this.getSourceId())
|
&& event.getSourceId().equals(this.getSourceId())
|
||||||
|
|
|
@ -110,7 +110,7 @@ class OpalPalaceWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.MANA_PAYED) {
|
if (event.getType() == GameEvent.EventType.MANA_PAID) {
|
||||||
if (event.getData() != null && event.getData().equals(originalId)) {
|
if (event.getData() != null && event.getData().equals(originalId)) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
if (spell != null) {
|
if (spell != null) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ class PyromancersGogglesTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == EventType.MANA_PAYED;
|
return event.getType() == EventType.MANA_PAID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -120,7 +120,7 @@ class WookieeMysticWatcher extends Watcher {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.MANA_PAYED) {
|
if (event.getType() == GameEvent.EventType.MANA_PAID) {
|
||||||
MageObject target = game.getObject(event.getTargetId());
|
MageObject target = game.getObject(event.getTargetId());
|
||||||
if (event.getSourceId() != null
|
if (event.getSourceId() != null
|
||||||
&& event.getSourceId().equals(this.getSourceId())
|
&& event.getSourceId().equals(this.getSourceId())
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class GameEvent implements Serializable {
|
||||||
mana the mana added
|
mana the mana added
|
||||||
*/
|
*/
|
||||||
MANA_ADDED,
|
MANA_ADDED,
|
||||||
/* MANA_PAYED
|
/* MANA_PAID
|
||||||
targetId id if the ability the mana was paid for (not the sourceId)
|
targetId id if the ability the mana was paid for (not the sourceId)
|
||||||
sourceId sourceId of the mana source
|
sourceId sourceId of the mana source
|
||||||
playerId controller of the ability the mana was paid for
|
playerId controller of the ability the mana was paid for
|
||||||
|
@ -174,7 +174,7 @@ public class GameEvent implements Serializable {
|
||||||
flag indicates a special condition
|
flag indicates a special condition
|
||||||
data originalId of the mana producing ability
|
data originalId of the mana producing ability
|
||||||
*/
|
*/
|
||||||
MANA_PAYED,
|
MANA_PAID,
|
||||||
LOSES, LOST, WINS,
|
LOSES, LOST, WINS,
|
||||||
TARGET, TARGETED,
|
TARGET, TARGETED,
|
||||||
/* TARGETS_VALID
|
/* TARGETS_VALID
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.util.UUID;
|
||||||
import mage.ConditionalMana;
|
import mage.ConditionalMana;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.ActivatedAbility;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.ManaType;
|
import mage.constants.ManaType;
|
||||||
|
@ -146,7 +147,7 @@ public class ManaPool implements Serializable {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (mana.get(usableManaType) > 0) {
|
if (mana.get(usableManaType) > 0) {
|
||||||
GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAYED, ability.getId(), mana.getSourceId(), ability.getControllerId(), 0, mana.getFlag());
|
GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAID, ability.getId(), mana.getSourceId(), ability.getControllerId(), 0, mana.getFlag());
|
||||||
event.setData(mana.getOriginalId().toString());
|
event.setData(mana.getOriginalId().toString());
|
||||||
game.fireEvent(event);
|
game.fireEvent(event);
|
||||||
mana.remove(usableManaType);
|
mana.remove(usableManaType);
|
||||||
|
@ -424,7 +425,7 @@ public class ManaPool implements Serializable {
|
||||||
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);
|
||||||
GameEvent event = new GameEvent(GameEvent.EventType.MANA_PAYED, 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);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue