Madness fixes. Removed end_of_turn sound

This commit is contained in:
magenoxx 2012-08-03 17:11:16 +04:00
parent c97d5e8a35
commit 5c1a2f7a43
3 changed files with 13 additions and 6 deletions

View file

@ -48,7 +48,6 @@ import mage.client.dialog.*;
import mage.client.game.FeedbackPanel.FeedbackMode;
import mage.client.plugins.adapters.MageActionCallback;
import mage.client.plugins.impl.Plugins;
import mage.client.util.AudioManager;
import mage.client.util.Config;
import mage.client.util.GameManager;
import mage.client.util.PhaseManager;
@ -408,7 +407,7 @@ public class GamePanel extends javax.swing.JPanel {
this.txtPhase.setText("");
}
if (game.getPhase() != null && game.getPhase().toString().equals("End") && game.getStep().toString().equals("End Turn")) {
AudioManager.playEndTurn();
//AudioManager.playEndTurn();
}
if (game.getStep() != null)

View file

@ -211,6 +211,7 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
return false;
}
}
//20100716 - 601.2g
if (!costs.pay(this, game, sourceId, controllerId, noMana)) {
logger.debug("activate failed - non mana costs");

View file

@ -8,6 +8,7 @@ import mage.abilities.StaticAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
@ -105,13 +106,18 @@ class MadnessPlayEffect extends AsThoughEffectImpl<MadnessPlayEffect> {
if (card != null && card.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(source.getSourceId()) == Constants.Zone.EXILED) {
Object object = game.getState().getValue("madness_" + card.getId());
if (object != null && object.equals(true)) {
Object alfreadyConfirmed = game.getState().getValue("madness_ok_" + card.getId());
if (alfreadyConfirmed != null) {
return true;
}
Player player = game.getPlayer(card.getOwnerId());
String message = "Cast " + card.getName() + " by its madness cost?";
if (player != null && player.chooseUse(Constants.Outcome.Benefit, message, game)) {
if (cost.pay(card.getSpellAbility(), game, sourceId, player.getId(), false)) {
card.getSpellAbility().getManaCostsToPay().clear();
return true;
}
Cost costToPay = cost.copy();
card.getSpellAbility().getManaCostsToPay().clear();
card.getSpellAbility().getManaCostsToPay().add((ManaCost)costToPay);
game.getState().setValue("madness_ok_" + card.getId(), true);
return true;
}
}
}
@ -232,6 +238,7 @@ class MadnessCleanUpWatcher extends WatcherImpl<MadnessCleanUpWatcher> {
game.informPlayers("Madness cost wasn't paied. " + card.getName() + " was put to its owner's graveyard.");
// reset
game.getState().setValue("madness_" + card.getId(), null);
game.getState().setValue("madness_ok_" + card.getId(), null);
}
card.moveToZone(Constants.Zone.GRAVEYARD, sourceId, game, true);
}