mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Added log for mana bug.
This commit is contained in:
parent
9f9d140fa5
commit
48f0437bc7
1 changed files with 15 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.abilities.effects.common.continious;
|
package mage.abilities.effects.common.continious;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -34,8 +35,10 @@ import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
import mage.game.command.CommandObject;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.ManaEvent;
|
import mage.game.events.ManaEvent;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -49,6 +52,8 @@ import mage.game.events.ManaEvent;
|
||||||
*/
|
*/
|
||||||
public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
|
public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
|
private static final transient Logger logger = Logger.getLogger(CommanderManaReplacementEffect.class);
|
||||||
|
|
||||||
private final UUID playerId;
|
private final UUID playerId;
|
||||||
private final Mana commanderMana;
|
private final Mana commanderMana;
|
||||||
|
|
||||||
|
@ -114,6 +119,16 @@ public class CommanderManaReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ADD_MANA && event.getPlayerId().equals(playerId)) {
|
if (event.getType() == GameEvent.EventType.ADD_MANA && event.getPlayerId().equals(playerId)) {
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
if (!game.getGameType().toString().startsWith("Commander")) {
|
||||||
|
logger.debug("Non Commander game has active CommanderManaReplacementEffect");
|
||||||
|
Iterator it = game.getState().getCommand().iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
Object object = it.next();
|
||||||
|
logger.debug("Class: " + object.getClass() + " - " + object.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue