diff --git a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java index 03f6c96dff6..fdd97d9b35c 100644 --- a/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/FeedbackPanel.java @@ -64,7 +64,6 @@ public class FeedbackPanel extends javax.swing.JPanel { INFORM, QUESTION, CONFIRM, CANCEL, SELECT, END } - private boolean selected = false; private UUID gameId; private Session session; private FeedbackMode mode; @@ -96,7 +95,6 @@ public class FeedbackPanel extends javax.swing.JPanel { this.lblMessage.setText(message); this.helper.setMessage(message); - this.selected = false; this.mode = mode; switch (this.mode) { case INFORM: @@ -270,7 +268,6 @@ public class FeedbackPanel extends javax.swing.JPanel { } private void btnRightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRightActionPerformed - this.selected = true; if (connectedDialog != null) { connectedDialog.removeDialog(); connectedDialog = null; @@ -289,7 +286,6 @@ public class FeedbackPanel extends javax.swing.JPanel { }//GEN-LAST:event_btnRightActionPerformed private void btnLeftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLeftActionPerformed - this.selected = true; session.sendPlayerBoolean(gameId, true); AudioManager.playButtonCancel(); }//GEN-LAST:event_btnLeftActionPerformed diff --git a/Mage.Client/src/main/java/mage/client/game/GamePanel.java b/Mage.Client/src/main/java/mage/client/game/GamePanel.java index 2799b50f36f..a1ba349b4e7 100644 --- a/Mage.Client/src/main/java/mage/client/game/GamePanel.java +++ b/Mage.Client/src/main/java/mage/client/game/GamePanel.java @@ -602,8 +602,8 @@ public final class GamePanel extends javax.swing.JPanel { if (game.getStep() != null) { updatePhases(game.getStep()); this.txtStep.setText(game.getStep().toString()); - } - else { + } else { + logger.debug("Step is empty"); this.txtStep.setText(""); } if (game.getSpellsCastCurrentTurn() > 0 && PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_SHOW_STORM_COUNTER, "true").equals("true")) { @@ -749,18 +749,40 @@ public final class GamePanel extends javax.swing.JPanel { currentStep.setLocation(prevPoint); } switch (step) { - case UNTAP: updateButton("Untap"); break; - case UPKEEP: updateButton("Upkeep"); break; - case DRAW: updateButton("Draw"); break; - case PRECOMBAT_MAIN: updateButton("Main1"); break; - case BEGIN_COMBAT: updateButton("Combat_Start"); break; - case DECLARE_ATTACKERS: updateButton("Combat_Attack"); break; - case DECLARE_BLOCKERS: updateButton("Combat_Block"); break; + case UNTAP: + updateButton("Untap"); + break; + case UPKEEP: + updateButton("Upkeep"); + break; + case DRAW: + updateButton("Draw"); + break; + case PRECOMBAT_MAIN: + updateButton("Main1"); + break; + case BEGIN_COMBAT: + updateButton("Combat_Start"); + break; + case DECLARE_ATTACKERS: + updateButton("Combat_Attack"); + break; + case DECLARE_BLOCKERS: + updateButton("Combat_Block"); + break; case FIRST_COMBAT_DAMAGE: - case COMBAT_DAMAGE: updateButton("Combat_Damage"); break; - case END_COMBAT: updateButton("Combat_End"); break; - case POSTCOMBAT_MAIN: updateButton("Main2"); break; - case END_TURN: updateButton("Cleanup"); break; + case COMBAT_DAMAGE: + updateButton("Combat_Damage"); + break; + case END_COMBAT: + updateButton("Combat_End"); + break; + case POSTCOMBAT_MAIN: + updateButton("Main2"); + break; + case END_TURN: + updateButton("Cleanup"); + break; } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java index 00e064850ed..2c01f7d33cf 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ShimatsuTheBloodcloaked.java @@ -57,7 +57,6 @@ public class ShimatsuTheBloodcloaked extends CardImpl { this.subtype.add("Demon"); this.subtype.add("Spirit"); - this.color.setRed(true); this.power = new MageInt(0); this.toughness = new MageInt(0); @@ -90,15 +89,15 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { public ShimatsuTheBloodcloakedEffect copy() { return new ShimatsuTheBloodcloakedEffect(this); } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD - && event.getTargetId().equals(source.getSourceId())) { - return true; - } - return false; - + return event.getTargetId().equals(source.getSourceId()); } @Override @@ -125,9 +124,5 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl { } return false; } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } + } diff --git a/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java new file mode 100644 index 00000000000..a53c41a32c6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempest/Dracoplasm.java @@ -0,0 +1,150 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempest; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ColoredManaCost; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.ColoredManaSymbol; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.Target; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LevelX2 + */ +public class Dracoplasm extends CardImpl { + + public Dracoplasm(UUID ownerId) { + super(ownerId, 341, "Dracoplasm", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{U}{R}"); + this.expansionSetCode = "TMP"; + this.subtype.add("Shapeshifter"); + this.power = new MageInt(0); + this.toughness = new MageInt(0); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // As Dracoplasm enters the battlefield, sacrifice any number of creatures. Dracoplasm's power becomes the total power of those creatures and its toughness becomes their total toughness. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DracoplasmEffect())); + + // {R}: Dracoplasm gets +1/+0 until end of turn. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); + } + + public Dracoplasm(final Dracoplasm card) { + super(card); + } + + @Override + public Dracoplasm copy() { + return new Dracoplasm(this); + } +} + +class DracoplasmEffect extends ReplacementEffectImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + + static { + filter.add(new AnotherPredicate()); + } + + public DracoplasmEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + this.staticText = "As {this} enters the battlefield, sacrifice any number of creatures. {this}'s power becomes the total power of those creatures and its toughness becomes their total toughness"; + } + + public DracoplasmEffect(final DracoplasmEffect effect) { + super(effect); + } + + @Override + public DracoplasmEffect copy() { + return new DracoplasmEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(source.getSourceId()); + + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent creature = game.getPermanent(event.getTargetId()); + Player controller = game.getPlayer(source.getControllerId()); + if (creature != null && controller != null) { + Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, filter, true); + if (!target.canChoose(source.getSourceId(), source.getControllerId(), game)) { + return false; + } + controller.chooseTarget(Outcome.Detriment, target, source, game); + if (target.getTargets().size() > 0) { + int power = 0; + int toughness = 0; + for (UUID targetId: target.getTargets()) { + Permanent targetCreature = game.getPermanent(targetId); + if (targetCreature != null && targetCreature.sacrifice(source.getSourceId(), game)) { + power += targetCreature.getPower().getValue(); + toughness += targetCreature.getToughness().getValue(); + } + } + ContinuousEffect effect = new SetPowerToughnessSourceEffect(power, toughness, Duration.Custom); + game.addEffect(effect, source); + } + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/tempest/SandstoneWarrior.java b/Mage.Sets/src/mage/sets/tempest/SandstoneWarrior.java index 072b157ef94..c2f16dcdce3 100644 --- a/Mage.Sets/src/mage/sets/tempest/SandstoneWarrior.java +++ b/Mage.Sets/src/mage/sets/tempest/SandstoneWarrior.java @@ -49,10 +49,13 @@ public class SandstoneWarrior extends CardImpl { this.subtype.add("Human"); this.subtype.add("Soldier"); this.subtype.add("Warrior"); - this.color.setRed(true); this.power = new MageInt(1); this.toughness = new MageInt(3); + + // First strike (This creature deals combat damage before creatures without first strike.) this.addAbility(FirstStrikeAbility.getInstance()); + + // {R}: Sandstone Warrior gets +1/+0 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.R))); } diff --git a/Mage.Sets/src/mage/sets/tempestremastered/Dracoplasm.java b/Mage.Sets/src/mage/sets/tempestremastered/Dracoplasm.java new file mode 100644 index 00000000000..b666347312d --- /dev/null +++ b/Mage.Sets/src/mage/sets/tempestremastered/Dracoplasm.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.tempestremastered; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class Dracoplasm extends mage.sets.tempest.Dracoplasm { + + public Dracoplasm(UUID ownerId) { + super(ownerId); + this.cardNumber = 208; + this.expansionSetCode = "TPR"; + } + + public Dracoplasm(final Dracoplasm card) { + super(card); + } + + @Override + public Dracoplasm copy() { + return new Dracoplasm(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java index e9e5f8776ad..62a2ad491a1 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java @@ -77,6 +77,9 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { MageObject mageObject = game.getObject(source.getSourceId()); // there are character definig abilities (e.g. P/T Nightmare) that have to work also for P/T of cards if (mageObject == null) { + if (duration.equals(Duration.Custom)) { + discard(); + } return false; } if (amount != null) {