mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Some null exceptions checking and fixed some other minor problems.
This commit is contained in:
parent
af2d55f8aa
commit
fcc6174e5e
13 changed files with 156 additions and 130 deletions
|
|
@ -851,7 +851,6 @@
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JCheckBox" name="chkUnique">
|
<Component class="javax.swing.JCheckBox" name="chkUnique">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="selected" type="boolean" value="false"/>
|
|
||||||
<Property name="text" type="java.lang.String" value="Unique"/>
|
<Property name="text" type="java.lang.String" value="Unique"/>
|
||||||
<Property name="toolTipText" type="java.lang.String" value="Show only the first found card of every card name."/>
|
<Property name="toolTipText" type="java.lang.String" value="Show only the first found card of every card name."/>
|
||||||
<Property name="focusable" type="boolean" value="false"/>
|
<Property name="focusable" type="boolean" value="false"/>
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,13 @@ import mage.client.MageFrame;
|
||||||
import mage.client.cards.*;
|
import mage.client.cards.*;
|
||||||
import mage.client.constants.Constants.SortBy;
|
import mage.client.constants.Constants.SortBy;
|
||||||
import mage.client.deckeditor.table.TableModel;
|
import mage.client.deckeditor.table.TableModel;
|
||||||
|
import mage.client.dialog.CheckBoxList;
|
||||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_NAMES;
|
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_NAMES;
|
||||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_RULES;
|
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_RULES;
|
||||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_TYPES;
|
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_TYPES;
|
||||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_UNIQUE;
|
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_UNIQUE;
|
||||||
import mage.client.util.GUISizeHelper;
|
import mage.client.util.GUISizeHelper;
|
||||||
import mage.client.util.gui.FastSearchUtil;
|
import mage.client.util.gui.FastSearchUtil;
|
||||||
import mage.client.dialog.CheckBoxList;
|
|
||||||
import mage.client.util.sets.ConstructedFormats;
|
import mage.client.util.sets.ConstructedFormats;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
|
|
@ -108,11 +108,9 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
String[] setCodes = ConstructedFormats.getTypes();
|
String[] setCodes = ConstructedFormats.getTypes();
|
||||||
java.util.List<String> result = new ArrayList<>();
|
java.util.List<String> result = new ArrayList<>();
|
||||||
|
|
||||||
for(int i=0; (i<setCodes.length)&&(!is_removeFinish);i++)
|
for (int i = 0; (i < setCodes.length) && (!is_removeFinish); i++) {
|
||||||
{
|
|
||||||
String item = setCodes[i];
|
String item = setCodes[i];
|
||||||
if(!item.equals(ConstructedFormats.ALL))
|
if (!item.equals(ConstructedFormats.ALL)) {
|
||||||
{
|
|
||||||
result.add(item);
|
result.add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -377,16 +375,13 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
criteria.rarities(Rarity.BONUS);
|
criteria.rarities(Rarity.BONUS);
|
||||||
}
|
}
|
||||||
if (this.cbExpansionSet.isVisible()) {
|
if (this.cbExpansionSet.isVisible()) {
|
||||||
if(listCodeSelected.getCheckedIndices().length <= 1)
|
if (listCodeSelected.getCheckedIndices().length <= 1) {
|
||||||
{
|
|
||||||
String expansionSelection = this.cbExpansionSet.getSelectedItem().toString();
|
String expansionSelection = this.cbExpansionSet.getSelectedItem().toString();
|
||||||
if (!expansionSelection.equals("- All Sets")) {
|
if (!expansionSelection.equals("- All Sets")) {
|
||||||
java.util.List<String> setCodes = ConstructedFormats.getSetsByFormat(expansionSelection);
|
java.util.List<String> setCodes = ConstructedFormats.getSetsByFormat(expansionSelection);
|
||||||
criteria.setCodes(setCodes.toArray(new String[0]));
|
criteria.setCodes(setCodes.toArray(new String[0]));
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
java.util.List<String> setCodes = new ArrayList<>();
|
java.util.List<String> setCodes = new ArrayList<>();
|
||||||
//java.util.List<String> listReceived=new ArrayList<>() ;
|
//java.util.List<String> listReceived=new ArrayList<>() ;
|
||||||
|
|
||||||
|
|
@ -404,7 +399,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return criteria;
|
return criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1234,17 +1228,14 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
|
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
|
||||||
if(!cbExpansionSet.getSelectedItem().toString().contains(TEST_MULTI_SET))
|
if (!cbExpansionSet.getSelectedItem().toString().contains(TEST_MULTI_SET)) {
|
||||||
{
|
|
||||||
int index = cbExpansionSet.getSelectedIndex();
|
int index = cbExpansionSet.getSelectedIndex();
|
||||||
if(cbExpansionSet.getItemAt(0).contains(TEST_MULTI_SET))
|
if (cbExpansionSet.getItemAt(0).contains(TEST_MULTI_SET)) {
|
||||||
{
|
|
||||||
cbExpansionSet.removeItemAt(0);
|
cbExpansionSet.removeItemAt(0);
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
listCodeSelected.uncheckAll();
|
listCodeSelected.uncheckAll();
|
||||||
if(index > 0)
|
if (index > 0) {
|
||||||
{
|
|
||||||
//ofset because all sets is removed from the list
|
//ofset because all sets is removed from the list
|
||||||
listCodeSelected.setChecked(index - 1, true);
|
listCodeSelected.setChecked(index - 1, true);
|
||||||
}
|
}
|
||||||
|
|
@ -1439,34 +1430,26 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
if (choiseValue.length == 0)//none
|
if (choiseValue.length == 0)//none
|
||||||
{
|
{
|
||||||
cbExpansionSet.setSelectedIndex(0);
|
cbExpansionSet.setSelectedIndex(0);
|
||||||
}
|
} else if (choiseValue.length == 1)//one
|
||||||
else if(choiseValue.length==1)//one
|
|
||||||
{
|
{
|
||||||
String itemSelected = listCodeSelected.getModel().getElementAt(choiseValue[0]).toString();
|
String itemSelected = listCodeSelected.getModel().getElementAt(choiseValue[0]).toString();
|
||||||
for(int index=0;index < cbExpansionSet.getItemCount();index++)
|
for (int index = 0; index < cbExpansionSet.getItemCount(); index++) {
|
||||||
{
|
if (cbExpansionSet.getItemAt(index).equals(itemSelected)) {
|
||||||
if(cbExpansionSet.getItemAt(index).equals(itemSelected))
|
|
||||||
{
|
|
||||||
cbExpansionSet.setSelectedIndex(index);
|
cbExpansionSet.setSelectedIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else//many
|
||||||
else//many
|
|
||||||
{
|
{
|
||||||
String message = String.format("%s:%d", TEST_MULTI_SET, choiseValue.length);
|
String message = String.format("%s:%d", TEST_MULTI_SET, choiseValue.length);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cbExpansionSet.insertItemAt(message, 0);
|
cbExpansionSet.insertItemAt(message, 0);
|
||||||
cbExpansionSet.setSelectedIndex(0);
|
cbExpansionSet.setSelectedIndex(0);
|
||||||
|
|
||||||
if(cbExpansionSet.getItemAt(1).contains(TEST_MULTI_SET))
|
if (cbExpansionSet.getItemAt(1).contains(TEST_MULTI_SET)) {
|
||||||
{
|
|
||||||
cbExpansionSet.removeItemAt(1);
|
cbExpansionSet.removeItemAt(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//listCodeSelected.setChecked(index-1, true);
|
//listCodeSelected.setChecked(index-1, true);
|
||||||
//cbExpansionSet.
|
//cbExpansionSet.
|
||||||
}
|
}
|
||||||
|
|
@ -1476,7 +1459,6 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
//
|
//
|
||||||
|
|
||||||
filterCards();
|
filterCards();
|
||||||
}//GEN-LAST:event_btnExpansionSearchActionPerformed
|
}//GEN-LAST:event_btnExpansionSearchActionPerformed
|
||||||
|
|
||||||
|
|
@ -1538,7 +1520,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
||||||
private JTable mainTable;
|
private JTable mainTable;
|
||||||
private ICardGrid currentView;
|
private ICardGrid currentView;
|
||||||
|
|
||||||
private CheckBoxList listCodeSelected;
|
private final CheckBoxList listCodeSelected;
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.ButtonGroup bgView;
|
private javax.swing.ButtonGroup bgView;
|
||||||
|
|
|
||||||
|
|
@ -486,7 +486,11 @@ public class TableController {
|
||||||
if (userPlayerMap.get(userId) != null) {
|
if (userPlayerMap.get(userId) != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return UserManager.instance.getUser(userId).get().ccWatchGame(match.getGame().getId());
|
Optional<User> _user = UserManager.instance.getUser(userId);
|
||||||
|
if (!_user.isPresent()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return _user.get().ccWatchGame(match.getGame().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ class CorrosiveOozeCombatWatcher extends Watcher {
|
||||||
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
|
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
|
||||||
Permanent attacker = game.getPermanent(event.getTargetId());
|
Permanent attacker = game.getPermanent(event.getTargetId());
|
||||||
Permanent blocker = game.getPermanent(event.getSourceId());
|
Permanent blocker = game.getPermanent(event.getSourceId());
|
||||||
if (attacker != null && attacker.getName().equals("Corrosive Ooze")) {
|
if (attacker != null && attacker.getName().equals("Corrosive Ooze")) { // To check for name is not working if Ooze is copied but name changed
|
||||||
if (blocker != null && hasAttachedEquipment(game, blocker)) {
|
if (blocker != null && hasAttachedEquipment(game, blocker)) {
|
||||||
MageObjectReference oozeMor = new MageObjectReference(attacker, game);
|
MageObjectReference oozeMor = new MageObjectReference(attacker, game);
|
||||||
HashSet<MageObjectReference> relatedCreatures = oozeBlocksOrBlocked.getOrDefault(oozeMor, new HashSet<>());
|
HashSet<MageObjectReference> relatedCreatures = oozeBlocksOrBlocked.getOrDefault(oozeMor, new HashSet<>());
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class JinxedIdolEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
|
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
return permanent.changeControllerId(source.getFirstTarget(), game);
|
return permanent.changeControllerId(source.getFirstTarget(), game);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
@ -45,6 +44,8 @@ public class MutagenicGrowth extends CardImpl {
|
||||||
public MutagenicGrowth(UUID ownerId, CardSetInfo setInfo) {
|
public MutagenicGrowth(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G/P}");
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G/P}");
|
||||||
|
|
||||||
|
// ({GP} can be paid with either {G} or 2 life.)
|
||||||
|
// Target creature gets +2/+2 until end of turn.
|
||||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||||
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
|
this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ public class Paralyze extends CardImpl {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||||
this.subtype.add(SubType.AURA);
|
this.subtype.add(SubType.AURA);
|
||||||
|
|
||||||
|
|
||||||
// Enchant creature
|
// Enchant creature
|
||||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
|
|
@ -96,14 +95,18 @@ class ParalyzeEffect extends DoIfCostPaid {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Player getPayingPlayer(Game game, Ability source) {
|
protected Player getPayingPlayer(Game game, Ability source) {
|
||||||
Permanent attachment = game.getPermanent(source.getSourceId());
|
Permanent attachment = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
|
if (attachment != null && attachment.getAttachedTo() != null) {
|
||||||
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
||||||
|
if (attachedTo != null) {
|
||||||
return game.getPlayer(attachedTo.getControllerId());
|
return game.getPlayer(attachedTo.getControllerId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText(Mode mode) {
|
public String getText(Mode mode) {
|
||||||
return new StringBuilder("that player may ").append(getCostText())
|
return "that player may " + getCostText() + ". If he or she does, " + executingEffects.getText(mode);
|
||||||
.append(". If he or she does, ").append(executingEffects.getText(mode)).toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,7 +6,6 @@ import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.util.functions.Function;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
|
@ -16,11 +15,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
public class ConstellationTest extends CardTestPlayerBase {
|
public class ConstellationTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Daxos's Torment {3}{B}
|
* Daxos's Torment {3}{B} Constellation — Whenever Daxos’s Torment or
|
||||||
* Constellation — Whenever Daxos’s Torment or another enchantment enters the battlefield under your control,
|
* another enchantment enters the battlefield under your control, Daxos’s
|
||||||
* Daxos’s Torment becomes a 5/5 Demon creature with flying and haste in addition to its other types until end of turn.
|
* Torment becomes a 5/5 Demon creature with flying and haste in addition to
|
||||||
|
* its other types until end of turn.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private final String daxosCard = "Daxos's Torment";
|
private final String daxosCard = "Daxos's Torment";
|
||||||
|
|
||||||
private void assertDaxosBoost(boolean mustHave) {
|
private void assertDaxosBoost(boolean mustHave) {
|
||||||
|
|
@ -150,7 +149,7 @@ public class ConstellationTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
assertHandCount(playerA, daxosCard, 0);
|
assertHandCount(playerA, daxosCard, 0);
|
||||||
assertPermanentCount(playerA, daxosCard, 1);
|
assertPermanentCount(playerA, daxosCard, 1);
|
||||||
assertHandCount(playerA, "Gravity Sphere", 0);
|
assertHandCount(playerA, "Gravity Sphere", 0); // Possible problem : this is sometimes 1
|
||||||
assertPermanentCount(playerA, "Gravity Sphere", 1);
|
assertPermanentCount(playerA, "Gravity Sphere", 1);
|
||||||
|
|
||||||
assertPowerToughness(playerA, daxosCard, 5, 5);
|
assertPowerToughness(playerA, daxosCard, 5, 5);
|
||||||
|
|
@ -227,5 +226,3 @@ public class ConstellationTest extends CardTestPlayerBase {
|
||||||
playDaxosAndVampire(true);
|
playDaxosAndVampire(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -185,4 +185,44 @@ public class SuspendTest extends CardTestPlayerBase {
|
||||||
assertHandCount(playerA, "Rift Bolt", 0);
|
assertHandCount(playerA, "Rift Bolt", 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cards cast from other zones that aren't the hand should not trigger
|
||||||
|
* Knowledge Pool, as it states that only cards cast from the hand should be
|
||||||
|
* exiled afterwards.
|
||||||
|
*
|
||||||
|
* Example: cards coming off suspend shouldn't trigger Knowledge Pool.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testThatNotCastFromHand() {
|
||||||
|
|
||||||
|
// Rift Bolt deals 3 damage to any target.
|
||||||
|
// Suspend 1-{R}
|
||||||
|
addCard(Zone.HAND, playerA, "Rift Bolt", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||||
|
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 3);
|
||||||
|
// Imprint - When Knowledge Pool enters the battlefield, each player exiles the top three cards of their library
|
||||||
|
// Whenever a player casts a spell from their hand, that player exiles it. If the player does, he or she may cast another nonland card
|
||||||
|
// exiled with Knowledge Pool without paying that card's mana cost.
|
||||||
|
addCard(Zone.HAND, playerB, "Knowledge Pool", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Plains", 6);
|
||||||
|
addCard(Zone.LIBRARY, playerB, "Silvercoat Lion", 3);
|
||||||
|
|
||||||
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Suspend");
|
||||||
|
|
||||||
|
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Knowledge Pool");
|
||||||
|
|
||||||
|
addTarget(playerA, playerB);
|
||||||
|
|
||||||
|
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerB, "Knowledge Pool", 1);
|
||||||
|
assertHandCount(playerA, "Rift Bolt", 0);
|
||||||
|
assertGraveyardCount(playerA, "Rift Bolt", 1);
|
||||||
|
assertLife(playerB, 17);
|
||||||
|
assertPermanentCount(playerA, "Silvercoat Lion", 0);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,8 @@ public class ContinuousEffects implements Serializable {
|
||||||
}
|
}
|
||||||
// boolean checkLKI = event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT);
|
// boolean checkLKI = event.getType().equals(EventType.ZONE_CHANGE) || event.getType().equals(EventType.DESTROYED_PERMANENT);
|
||||||
//get all applicable transient Replacement effects
|
//get all applicable transient Replacement effects
|
||||||
for (ReplacementEffect effect : replacementEffects) {
|
for (Iterator<ReplacementEffect> iterator = replacementEffects.iterator(); iterator.hasNext();) {
|
||||||
|
ReplacementEffect effect = iterator.next();
|
||||||
if (!effect.checksEventType(event, game)) {
|
if (!effect.checksEventType(event, game)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -378,7 +379,8 @@ public class ContinuousEffects implements Serializable {
|
||||||
replaceEffects.put(effect, applicableAbilities);
|
replaceEffects.put(effect, applicableAbilities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (PreventionEffect effect : preventionEffects) {
|
for (Iterator<PreventionEffect> iterator = preventionEffects.iterator(); iterator.hasNext();) {
|
||||||
|
PreventionEffect effect = iterator.next();
|
||||||
if (!effect.checksEventType(event, game)) {
|
if (!effect.checksEventType(event, game)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -933,7 +935,6 @@ public class ContinuousEffects implements Serializable {
|
||||||
.map((eff) -> {return eff.getClass().getName().replaceAll(".+\\.(.+)", "$1");})
|
.map((eff) -> {return eff.getClass().getName().replaceAll(".+\\.(.+)", "$1");})
|
||||||
.collect(Collectors.joining(", ")));
|
.collect(Collectors.joining(", ")));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (ContinuousEffect effect : layer) {
|
for (ContinuousEffect effect : layer) {
|
||||||
if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet
|
if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet
|
||||||
Set<UUID> dependentTo = effect.isDependentTo(layer);
|
Set<UUID> dependentTo = effect.isDependentTo(layer);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.abilities.keyword;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.SpellAbility;
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.StaticAbility;
|
import mage.abilities.StaticAbility;
|
||||||
|
|
@ -41,8 +42,6 @@ import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 20121001 702.31. Kicker 702.31a Kicker is a static ability that functions
|
* 20121001 702.31. Kicker 702.31a Kicker is a static ability that functions
|
||||||
* while the spell with kicker is on the stack. "Kicker [cost]" means "You may
|
* while the spell with kicker is on the stack. "Kicker [cost]" means "You may
|
||||||
|
|
@ -134,7 +133,8 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
||||||
cost.reset();
|
cost.reset();
|
||||||
}
|
}
|
||||||
String key = getActivationKey(source, "", game);
|
String key = getActivationKey(source, "", game);
|
||||||
for (String activationKey : activations.keySet()) {
|
for (Iterator<String> iterator = activations.keySet().iterator(); iterator.hasNext();) {
|
||||||
|
String activationKey = iterator.next();
|
||||||
if (activationKey.startsWith(key) && activations.get(activationKey) > 0) {
|
if (activationKey.startsWith(key) && activations.get(activationKey) > 0) {
|
||||||
activations.put(key, 0);
|
activations.put(key, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ public class Deck implements Serializable {
|
||||||
cardInfo = CardRepository.instance.findCard("Silvercoat Lion");
|
cardInfo = CardRepository.instance.findCard("Silvercoat Lion");
|
||||||
Logger.getLogger(Deck.class).error("Tried to restart the DB: " + (cardInfo == null ? "not successful" : "successful"));
|
Logger.getLogger(Deck.class).error("Tried to restart the DB: " + (cardInfo == null ? "not successful" : "successful"));
|
||||||
}
|
}
|
||||||
return new GameException("Card not found - " + deckCardInfo.getCardName() + " - " + deckCardInfo.getSetCode() + " for deck - " + deckName + '\n'
|
return new GameException("Card not found - " + deckCardInfo.getCardName() + " - " + deckCardInfo.getSetCode() + "/" + deckCardInfo.getCardNum() + " for deck - " + deckName + '\n'
|
||||||
+ "Possible reason is, that you use cards in your deck, that are only supported in newer versions of the server.\n"
|
+ "Possible reason is, that you use cards in your deck, that are only supported in newer versions of the server.\n"
|
||||||
+ "So it can help to use the same card from another set, that's already supported from this server.");
|
+ "So it can help to use the same card from another set, that's already supported from this server.");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ package mage.game.combat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import mage.abilities.common.ControllerAssignCombatDamageToBlockersAbility;
|
import mage.abilities.common.ControllerAssignCombatDamageToBlockersAbility;
|
||||||
import mage.abilities.common.ControllerDivideCombatDamageAbility;
|
import mage.abilities.common.ControllerDivideCombatDamageAbility;
|
||||||
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
||||||
|
|
@ -334,7 +333,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
defenderDamage(attacker, damage, game);
|
defenderDamage(attacker, damage, game);
|
||||||
} else if (!blockerOrder.isEmpty()) {
|
} else if (!blockerOrder.isEmpty()) {
|
||||||
// Assign the damage left to first blocker
|
// Assign the damage left to first blocker
|
||||||
assigned.put(blockerOrder.get(0), assigned.get(blockerOrder.get(0)) + damage);
|
assigned.put(blockerOrder.get(0), assigned.get(blockerOrder.get(0)) == null ? 0 : assigned.get(blockerOrder.get(0)) + damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (UUID blockerId : blockerOrder) {
|
for (UUID blockerId : blockerOrder) {
|
||||||
|
|
@ -455,8 +454,8 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
*
|
*
|
||||||
* Handles abilities like "{this} an block any number of creatures.".
|
* Handles abilities like "{this} an block any number of creatures.".
|
||||||
*
|
*
|
||||||
* Blocker damage for blockers blocking single creatures is handled in
|
* Blocker damage for blockers blocking single creatures is handled in the
|
||||||
* the single/multi blocker methods, so this shouldn't be used anymore.
|
* single/multi blocker methods, so this shouldn't be used anymore.
|
||||||
*
|
*
|
||||||
* @param first
|
* @param first
|
||||||
* @param game
|
* @param game
|
||||||
|
|
@ -870,8 +869,8 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decides damage distribution for blocking creatures with banding or
|
* Decides damage distribution for blocking creatures with banding or if
|
||||||
* if defending player controls the Defensive Formation enchantment.
|
* defending player controls the Defensive Formation enchantment.
|
||||||
*
|
*
|
||||||
* @param game
|
* @param game
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue