mirror of
https://github.com/correl/mage.git
synced 2025-04-09 01:01:06 -09:00
Merge branch 'master' of https://github.com/magefree/mage
This commit is contained in:
commit
07886811f0
14 changed files with 158 additions and 133 deletions
Mage.Client/src/main/java/mage/client/deckeditor
Mage.Server/src/main/java/mage/server
Mage.Sets/src/mage/cards
Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords
Mage/src/main/java/mage
abilities
cards/decks
game/combat
|
@ -851,7 +851,6 @@
|
|||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="chkUnique">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="false"/>
|
||||
<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="focusable" type="boolean" value="false"/>
|
||||
|
|
|
@ -51,13 +51,13 @@ import mage.client.MageFrame;
|
|||
import mage.client.cards.*;
|
||||
import mage.client.constants.Constants.SortBy;
|
||||
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_RULES;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_TYPES;
|
||||
import static mage.client.dialog.PreferencesDialog.KEY_DECK_EDITOR_SEARCH_UNIQUE;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.client.util.gui.FastSearchUtil;
|
||||
import mage.client.dialog.CheckBoxList;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
@ -85,7 +85,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private final SortSetting sortSetting;
|
||||
private static final Map<String, Integer> pdAllowed = new HashMap<>();
|
||||
|
||||
private final String TEST_MULTI_SET="Multiple Sets selected";
|
||||
private final String TEST_MULTI_SET = "Multiple Sets selected";
|
||||
|
||||
private final ActionListener searchAction = evt -> jButtonSearchActionPerformed(evt);
|
||||
|
||||
|
@ -100,22 +100,20 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
initListViewComponents();
|
||||
setGUISize();
|
||||
currentView = mainModel; // by default we use List View
|
||||
|
||||
listCodeSelected = new CheckBoxList();
|
||||
|
||||
listCodeSelected = new CheckBoxList();
|
||||
// remove the all option
|
||||
boolean is_removeFinish=false;
|
||||
|
||||
String[] setCodes = ConstructedFormats.getTypes();
|
||||
java.util.List<String> result = new ArrayList<>();
|
||||
|
||||
for(int i=0; (i<setCodes.length)&&(!is_removeFinish);i++)
|
||||
{
|
||||
boolean is_removeFinish = false;
|
||||
|
||||
String[] setCodes = ConstructedFormats.getTypes();
|
||||
java.util.List<String> result = new ArrayList<>();
|
||||
|
||||
for (int i = 0; (i < setCodes.length) && (!is_removeFinish); i++) {
|
||||
String item = setCodes[i];
|
||||
if(!item.equals(ConstructedFormats.ALL))
|
||||
{
|
||||
if (!item.equals(ConstructedFormats.ALL)) {
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
listCodeSelected.setListData(result.toArray());
|
||||
}
|
||||
|
||||
|
@ -377,33 +375,29 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
criteria.rarities(Rarity.BONUS);
|
||||
}
|
||||
if (this.cbExpansionSet.isVisible()) {
|
||||
if(listCodeSelected.getCheckedIndices().length <= 1)
|
||||
{
|
||||
String expansionSelection = this.cbExpansionSet.getSelectedItem().toString();
|
||||
if (!expansionSelection.equals("- All Sets")) {
|
||||
java.util.List<String> setCodes = ConstructedFormats.getSetsByFormat(expansionSelection);
|
||||
criteria.setCodes(setCodes.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
java.util.List<String> setCodes = new ArrayList<>() ;
|
||||
//java.util.List<String> listReceived=new ArrayList<>() ;
|
||||
if (listCodeSelected.getCheckedIndices().length <= 1) {
|
||||
String expansionSelection = this.cbExpansionSet.getSelectedItem().toString();
|
||||
if (!expansionSelection.equals("- All Sets")) {
|
||||
java.util.List<String> setCodes = ConstructedFormats.getSetsByFormat(expansionSelection);
|
||||
criteria.setCodes(setCodes.toArray(new String[0]));
|
||||
}
|
||||
} else {
|
||||
java.util.List<String> setCodes = new ArrayList<>();
|
||||
//java.util.List<String> listReceived=new ArrayList<>() ;
|
||||
|
||||
int[] choiseValue=listCodeSelected.getCheckedIndices();
|
||||
ListModel x= listCodeSelected.getModel();
|
||||
int[] choiseValue = listCodeSelected.getCheckedIndices();
|
||||
ListModel x = listCodeSelected.getModel();
|
||||
|
||||
for(int itemIndex: choiseValue){
|
||||
|
||||
java.util.List<String> listReceived=ConstructedFormats.getSetsByFormat(x.getElementAt(itemIndex).toString());
|
||||
listReceived.stream().filter((item) -> (setCodes.contains(item)==false)).forEachOrdered((item) -> {
|
||||
setCodes.add(item);
|
||||
});
|
||||
}
|
||||
criteria.setCodes(setCodes.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
for (int itemIndex : choiseValue) {
|
||||
|
||||
java.util.List<String> listReceived = ConstructedFormats.getSetsByFormat(x.getElementAt(itemIndex).toString());
|
||||
listReceived.stream().filter((item) -> (setCodes.contains(item) == false)).forEachOrdered((item) -> {
|
||||
setCodes.add(item);
|
||||
});
|
||||
}
|
||||
criteria.setCodes(setCodes.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
return criteria;
|
||||
}
|
||||
|
@ -1234,22 +1228,19 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
|
||||
if(!cbExpansionSet.getSelectedItem().toString().contains(TEST_MULTI_SET))
|
||||
{
|
||||
int index=cbExpansionSet.getSelectedIndex();
|
||||
if(cbExpansionSet.getItemAt(0).contains(TEST_MULTI_SET))
|
||||
{
|
||||
if (!cbExpansionSet.getSelectedItem().toString().contains(TEST_MULTI_SET)) {
|
||||
int index = cbExpansionSet.getSelectedIndex();
|
||||
if (cbExpansionSet.getItemAt(0).contains(TEST_MULTI_SET)) {
|
||||
cbExpansionSet.removeItemAt(0);
|
||||
index--;
|
||||
}
|
||||
listCodeSelected.uncheckAll();
|
||||
if(index > 0)
|
||||
{
|
||||
listCodeSelected.uncheckAll();
|
||||
if (index > 0) {
|
||||
//ofset because all sets is removed from the list
|
||||
listCodeSelected.setChecked(index-1, true);
|
||||
listCodeSelected.setChecked(index - 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
filterCards();
|
||||
}//GEN-LAST:event_cbExpansionSetActionPerformed
|
||||
|
||||
|
@ -1422,62 +1413,53 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_chkTypesActionPerformed
|
||||
|
||||
private void chkRulesActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
private void chkRulesActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
// TODO add your handling code here:
|
||||
}
|
||||
}
|
||||
|
||||
private void chkUniqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkRulesActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_chkRulesActionPerformed
|
||||
|
||||
private void btnExpansionSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExpansionSearchActionPerformed
|
||||
FastSearchUtil.showFastSearchForStringComboBox(listCodeSelected, FastSearchUtil.DEFAULT_EXPANSION_SEARCH_MESSAGE);
|
||||
FastSearchUtil.showFastSearchForStringComboBox(listCodeSelected, FastSearchUtil.DEFAULT_EXPANSION_SEARCH_MESSAGE);
|
||||
//
|
||||
int[] choiseValue=listCodeSelected.getCheckedIndices();
|
||||
ListModel x= listCodeSelected.getModel();
|
||||
|
||||
if(choiseValue.length==0)//none
|
||||
int[] choiseValue = listCodeSelected.getCheckedIndices();
|
||||
ListModel x = listCodeSelected.getModel();
|
||||
|
||||
if (choiseValue.length == 0)//none
|
||||
{
|
||||
cbExpansionSet.setSelectedIndex(0);
|
||||
}
|
||||
else if(choiseValue.length==1)//one
|
||||
cbExpansionSet.setSelectedIndex(0);
|
||||
} else if (choiseValue.length == 1)//one
|
||||
{
|
||||
String itemSelected=listCodeSelected.getModel().getElementAt(choiseValue[0]).toString();
|
||||
for(int index=0;index < cbExpansionSet.getItemCount();index++)
|
||||
{
|
||||
if(cbExpansionSet.getItemAt(index).equals(itemSelected))
|
||||
{
|
||||
String itemSelected = listCodeSelected.getModel().getElementAt(choiseValue[0]).toString();
|
||||
for (int index = 0; index < cbExpansionSet.getItemCount(); index++) {
|
||||
if (cbExpansionSet.getItemAt(index).equals(itemSelected)) {
|
||||
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.setSelectedIndex(0);
|
||||
|
||||
if(cbExpansionSet.getItemAt(1).contains(TEST_MULTI_SET))
|
||||
{
|
||||
cbExpansionSet.removeItemAt(1);
|
||||
|
||||
if (cbExpansionSet.getItemAt(1).contains(TEST_MULTI_SET)) {
|
||||
cbExpansionSet.removeItemAt(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//listCodeSelected.setChecked(index-1, true);
|
||||
//cbExpansionSet.
|
||||
//cbExpansionSet.
|
||||
}
|
||||
|
||||
/*for(int itemIndex: choiseValue){
|
||||
|
||||
/*for(int itemIndex: choiseValue){
|
||||
// LogLog.warn(String.format("%d:%s",itemIndex,x.getElementAt(itemIndex).toString()));
|
||||
}
|
||||
*/
|
||||
*/
|
||||
//
|
||||
|
||||
filterCards();
|
||||
filterCards();
|
||||
}//GEN-LAST:event_btnExpansionSearchActionPerformed
|
||||
|
||||
private void tbCommonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbCommonActionPerformed
|
||||
|
@ -1537,8 +1519,8 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
private TableModel mainModel;
|
||||
private JTable mainTable;
|
||||
private ICardGrid currentView;
|
||||
|
||||
private CheckBoxList listCodeSelected;
|
||||
|
||||
private final CheckBoxList listCodeSelected;
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.ButtonGroup bgView;
|
||||
|
|
|
@ -26,11 +26,10 @@
|
|||
*/
|
||||
package mage.client.deckeditor.table;
|
||||
|
||||
import java.util.Comparator;
|
||||
import mage.cards.MageCard;
|
||||
import mage.view.CardView;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* {@link MageCard} comparator. Used to sort cards in Deck Editor Table View
|
||||
* pane.
|
||||
|
@ -75,7 +74,7 @@ public class MageCardComparator implements Comparator<CardView> {
|
|||
// Color
|
||||
case 3:
|
||||
aCom = a.getColorText();
|
||||
bCom = a.getColorText();
|
||||
bCom = b.getColorText();
|
||||
break;
|
||||
// Type
|
||||
case 4:
|
||||
|
|
|
@ -100,7 +100,7 @@ public class TableController {
|
|||
} else {
|
||||
controllerName = "System";
|
||||
}
|
||||
table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getDeckType()),
|
||||
table = new Table(roomId, options.getGameType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getDeckType()),
|
||||
options.getPlayerTypes(), TableRecorderImpl.instance, match, options.getBannedUsers(), options.isPlaneChase());
|
||||
chatId = ChatManager.instance.createChatSession("Match Table " + table.getId());
|
||||
init();
|
||||
|
@ -120,7 +120,7 @@ public class TableController {
|
|||
} else {
|
||||
controllerName = "System";
|
||||
}
|
||||
table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getMatchOptions().getDeckType()),
|
||||
table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getMatchOptions().getDeckType()),
|
||||
options.getPlayerTypes(), TableRecorderImpl.instance, tournament, options.getMatchOptions().getBannedUsers(), options.isPlaneChase());
|
||||
chatId = ChatManager.instance.createChatSession("Tourn. table " + table.getId());
|
||||
}
|
||||
|
@ -486,7 +486,11 @@ public class TableController {
|
|||
if (userPlayerMap.get(userId) != null) {
|
||||
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) {
|
||||
Permanent attacker = game.getPermanent(event.getTargetId());
|
||||
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)) {
|
||||
MageObjectReference oozeMor = new MageObjectReference(attacker, game);
|
||||
HashSet<MageObjectReference> relatedCreatures = oozeBlocksOrBlocked.getOrDefault(oozeMor, new HashSet<>());
|
||||
|
|
|
@ -92,7 +92,7 @@ class JinxedIdolEffect extends ContinuousEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent != null) {
|
||||
return permanent.changeControllerId(source.getFirstTarget(), game);
|
||||
} else {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -42,14 +41,16 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class MutagenicGrowth extends CardImpl {
|
||||
|
||||
public MutagenicGrowth (UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G/P}");
|
||||
public MutagenicGrowth(UUID ownerId, CardSetInfo setInfo) {
|
||||
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().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
|
||||
}
|
||||
|
||||
public MutagenicGrowth (final MutagenicGrowth card) {
|
||||
public MutagenicGrowth(final MutagenicGrowth card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,10 +52,9 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
public class Paralyze extends CardImpl {
|
||||
|
||||
public Paralyze(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||
this.subtype.add(SubType.AURA);
|
||||
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
|
@ -96,14 +95,18 @@ class ParalyzeEffect extends DoIfCostPaid {
|
|||
|
||||
@Override
|
||||
protected Player getPayingPlayer(Game game, Ability source) {
|
||||
Permanent attachment = game.getPermanent(source.getSourceId());
|
||||
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
||||
return game.getPlayer(attachedTo.getControllerId());
|
||||
Permanent attachment = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (attachment != null && attachment.getAttachedTo() != null) {
|
||||
Permanent attachedTo = game.getPermanent(attachment.getAttachedTo());
|
||||
if (attachedTo != null) {
|
||||
return game.getPlayer(attachedTo.getControllerId());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return new StringBuilder("that player may ").append(getCostText())
|
||||
.append(". If he or she does, ").append(executingEffects.getText(mode)).toString();
|
||||
return "that player may " + getCostText() + ". If he or she does, " + executingEffects.getText(mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.util.functions.Function;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
@ -16,11 +15,11 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
public class ConstellationTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Daxos's Torment {3}{B}
|
||||
* Constellation — Whenever Daxos’s Torment or another enchantment enters the battlefield under your control,
|
||||
* Daxos’s Torment becomes a 5/5 Demon creature with flying and haste in addition to its other types until end of turn.
|
||||
* Daxos's Torment {3}{B} Constellation — Whenever Daxos’s Torment or
|
||||
* another enchantment enters the battlefield under your control, Daxos’s
|
||||
* 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 void assertDaxosBoost(boolean mustHave) {
|
||||
|
@ -150,7 +149,7 @@ public class ConstellationTest extends CardTestPlayerBase {
|
|||
|
||||
assertHandCount(playerA, daxosCard, 0);
|
||||
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);
|
||||
|
||||
assertPowerToughness(playerA, daxosCard, 5, 5);
|
||||
|
@ -227,5 +226,3 @@ public class ConstellationTest extends CardTestPlayerBase {
|
|||
playDaxosAndVampire(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -185,4 +185,44 @@ public class SuspendTest extends CardTestPlayerBase {
|
|||
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);
|
||||
//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)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -378,7 +379,8 @@ public class ContinuousEffects implements Serializable {
|
|||
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)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -932,8 +934,7 @@ public class ContinuousEffects implements Serializable {
|
|||
System.out.println(game.getTurn() + ", " + game.getPhase() + ": " + "need apply " + layer.stream()
|
||||
.map((eff) -> {return eff.getClass().getName().replaceAll(".+\\.(.+)", "$1");})
|
||||
.collect(Collectors.joining(", ")));
|
||||
*/
|
||||
|
||||
*/
|
||||
for (ContinuousEffect effect : layer) {
|
||||
if (activeLayerEffects.contains(effect) && !appliedEffects.contains(effect.getId())) { // Effect does still exist and was not applied yet
|
||||
Set<UUID> dependentTo = effect.isDependentTo(layer);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import java.util.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.StaticAbility;
|
||||
|
@ -41,8 +42,6 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -134,7 +133,8 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
cost.reset();
|
||||
}
|
||||
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) {
|
||||
activations.put(key, 0);
|
||||
}
|
||||
|
@ -212,10 +212,10 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
&& player.chooseUse(Outcome.Benefit, "Pay " + times + kickerCost.getText(false) + " ?", ability, game)) {
|
||||
this.activateKicker(kickerCost, ability, game);
|
||||
if (kickerCost instanceof Costs) {
|
||||
for (Iterator itKickerCost = ((Costs) kickerCost).iterator(); itKickerCost.hasNext(); ) {
|
||||
for (Iterator itKickerCost = ((Costs) kickerCost).iterator(); itKickerCost.hasNext();) {
|
||||
Object kickerCostObject = itKickerCost.next();
|
||||
if ((kickerCostObject instanceof Costs) || (kickerCostObject instanceof CostsImpl)) {
|
||||
for (@SuppressWarnings("unchecked") Iterator<Cost> itDetails = ((Costs) kickerCostObject).iterator(); itDetails.hasNext(); ) {
|
||||
for (@SuppressWarnings("unchecked") Iterator<Cost> itDetails = ((Costs) kickerCostObject).iterator(); itDetails.hasNext();) {
|
||||
addKickerCostsToAbility(itDetails.next(), ability, game);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -142,7 +142,7 @@ public class Deck implements Serializable {
|
|||
cardInfo = CardRepository.instance.findCard("Silvercoat Lion");
|
||||
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"
|
||||
+ "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.util.*;
|
||||
|
||||
import mage.abilities.common.ControllerAssignCombatDamageToBlockersAbility;
|
||||
import mage.abilities.common.ControllerDivideCombatDamageAbility;
|
||||
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
||||
|
@ -178,7 +177,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
}
|
||||
if (attackers.size() != 1) {
|
||||
multiAttackerDamage(first, game);
|
||||
// } else {
|
||||
// } else {
|
||||
// singleAttackerDamage(first, game);
|
||||
}
|
||||
}
|
||||
|
@ -334,7 +333,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
defenderDamage(attacker, damage, game);
|
||||
} else if (!blockerOrder.isEmpty()) {
|
||||
// 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) {
|
||||
|
@ -430,7 +429,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean checkSoleBlockerAfter (Permanent blocker, Game game) {
|
||||
public boolean checkSoleBlockerAfter(Permanent blocker, Game game) {
|
||||
// this solves some corner cases (involving banding) when finding out whether a blocker is blocking alone or not
|
||||
if (blocker.getBlocking() == 1) {
|
||||
if (game.getCombat().blockingGroups.get(blocker.getId()) == null) {
|
||||
|
@ -454,9 +453,9 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
* {@link #singleBlockerDamage}.
|
||||
*
|
||||
* Handles abilities like "{this} an block any number of creatures.".
|
||||
*
|
||||
* Blocker damage for blockers blocking single creatures is handled in
|
||||
* the single/multi blocker methods, so this shouldn't be used anymore.
|
||||
*
|
||||
* Blocker damage for blockers blocking single creatures is handled in the
|
||||
* single/multi blocker methods, so this shouldn't be used anymore.
|
||||
*
|
||||
* @param first
|
||||
* @param game
|
||||
|
@ -782,7 +781,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
/**
|
||||
* There are effects, that set an attacker to be blocked. Therefore this
|
||||
* setter can be used.
|
||||
*
|
||||
*
|
||||
* This method lacks a band check, use setBlocked(blocked, game) instead.
|
||||
*
|
||||
* @param blocked
|
||||
|
@ -870,8 +869,8 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Decides damage distribution for blocking creatures with banding or
|
||||
* if defending player controls the Defensive Formation enchantment.
|
||||
* Decides damage distribution for blocking creatures with banding or if
|
||||
* defending player controls the Defensive Formation enchantment.
|
||||
*
|
||||
* @param game
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue