Merge remote-tracking branch 'remotes/origin/master'

This commit is contained in:
klayhamn 2015-07-28 17:34:52 +03:00
commit 005554fcfc
5 changed files with 38 additions and 14 deletions

View file

@ -18,7 +18,7 @@ import java.util.Map;
* *
* This class was originally made to work with the historical standard ruleset. * This class was originally made to work with the historical standard ruleset.
* Data taken from http://thattournament.website/historic-tournament.php * Data taken from http://thattournament.website/historic-tournament.php
* (site changed, originally thtp://mtgt.nfshost.com/historic-tournament.php) * (site changed, originally http://mtgt.nfshost.com/historic-tournament.php)
* *
* If there are any questions or corrections, feel free to contact me. * If there are any questions or corrections, feel free to contact me.
* *
@ -111,9 +111,6 @@ public class HistoricalStandard extends Constructed {
// banned cards // banned cards
banned.add("Balance"); banned.add("Balance");
// Not banned in the format, but it is either this or Misty, and most
// people choose Misty.
banned.add("Batterskull");
banned.add("Memory Jar"); banned.add("Memory Jar");
banned.add("Mind Over Matter"); banned.add("Mind Over Matter");
banned.add("Mind Twist"); banned.add("Mind Twist");
@ -134,6 +131,17 @@ public class HistoricalStandard extends Constructed {
Map<String, String> leastInvalid = null; Map<String, String> leastInvalid = null;
boolean valid = false; boolean valid = false;
// first, check whether misty and batterskull are in the same deck.
Map<String, Integer> counts = new HashMap<>();
countCards(counts, deck.getCards());
countCards(counts, deck.getSideboard());
if( counts.containsKey("Stoneforge Mystic")
&& counts.containsKey("Batterskull")){
// if both, then skip all following tests by returning
return false;
}
// up to Lorwyn/Alara, standards will have to be hard-coded. // up to Lorwyn/Alara, standards will have to be hard-coded.
// iterate through the array of standards. // iterate through the array of standards.

View file

@ -76,10 +76,8 @@ public class SuperStandard extends Constructed {
super("Constructed - All Standards"); super("Constructed - All Standards");
banned.add("Ancient Den"); banned.add("Ancient Den");
banned.add("Arcbound Ravager");
banned.add("Disciple of the Vault"); banned.add("Disciple of the Vault");
banned.add("Great Furnace"); banned.add("Great Furnace");
banned.add("Jace, the Mind Sculptor");
banned.add("Seat of the Synod"); banned.add("Seat of the Synod");
banned.add("Skullclamp"); banned.add("Skullclamp");
banned.add("Tree of Tales"); banned.add("Tree of Tales");
@ -98,6 +96,17 @@ public class SuperStandard extends Constructed {
Map<String, String> leastInvalid = null; Map<String, String> leastInvalid = null;
boolean valid = false; boolean valid = false;
// first, check whether misty and batterskull are in the same deck.
Map<String, Integer> counts = new HashMap<>();
countCards(counts, deck.getCards());
countCards(counts, deck.getSideboard());
if( counts.containsKey("Stoneforge Mystic")
&& counts.containsKey("Batterskull")){
// if both, then skip all following tests by returning
return false;
}
// up to Lorwyn/Alara, standards will have to be hard-coded. // up to Lorwyn/Alara, standards will have to be hard-coded.
// iterate through the array of standards. // iterate through the array of standards.
@ -113,10 +122,8 @@ public class SuperStandard extends Constructed {
// misty and darksteel citadel // misty and darksteel citadel
if( setCodes.contains("MRD") || setCodes.contains("SOM")){ if( setCodes.contains("MRD") || setCodes.contains("SOM")){
banned.add("Darksteel Citadel"); banned.add("Darksteel Citadel");
banned.add("Stoneforge Mystic");
}else{ }else{
banned.remove("Darksteel Citadel"); banned.remove("Darksteel Citadel");
banned.remove("Stoneforge Mystic");
} }
// validate it. If it validates, clear the invalid cards and break. // validate it. If it validates, clear the invalid cards and break.
@ -174,10 +181,8 @@ public class SuperStandard extends Constructed {
// misty and darksteel citadel // misty and darksteel citadel
if( setCodes.contains("MRD") || setCodes.contains("SOM")){ if( setCodes.contains("MRD") || setCodes.contains("SOM")){
banned.add("Darksteel Citadel"); banned.add("Darksteel Citadel");
banned.add("Stoneforge Mystic");
}else{ }else{
banned.remove("Darksteel Citadel"); banned.remove("Darksteel Citadel");
banned.remove("Stoneforge Mystic");
} }
// validate it. If it validates, clear the invalid cards and break. // validate it. If it validates, clear the invalid cards and break.

View file

@ -87,7 +87,9 @@
<deckType name="Constructed - Pauper" jar="mage-deck-constructed.jar" className="mage.deck.Pauper"/> <deckType name="Constructed - Pauper" jar="mage-deck-constructed.jar" className="mage.deck.Pauper"/>
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/> <deckType name="Variant Magic - Commander" jar="mage-deck-constructed.jar" className="mage.deck.Commander"/>
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/> <deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed.jar" className="mage.deck.DuelCommander"/>
<deckType name="Variant Magic - Historical Standard" jar="mage-deck-constructed.jar" className="mage.deck.HistoricalStandard"/>
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/> <deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed.jar" className="mage.deck.TinyLeaders"/>
<deckType name="Variant Magic - Super Standard" jar="mage-deck-constructed.jar" className="mage.deck.SuperStandard"/>
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/> <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed.jar" className="mage.deck.InnistradBlock"/>
<deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed.jar" className="mage.deck.KamigawaBlock"/> <deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed.jar" className="mage.deck.KamigawaBlock"/>
<deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed.jar" className="mage.deck.KhansOfTarkirBlock"/> <deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed.jar" className="mage.deck.KhansOfTarkirBlock"/>

View file

@ -66,7 +66,9 @@
<deckType name="Constructed - Pauper" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Pauper"/> <deckType name="Constructed - Pauper" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Pauper"/>
<deckType name="Variant Magic - Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Commander"/> <deckType name="Variant Magic - Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.Commander"/>
<deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.DuelCommander"/> <deckType name="Variant Magic - Duel Commander" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.DuelCommander"/>
<deckType name="Variant Magic - Historical Standard" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.HistoricalStandard"/>
<deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.TinyLeaders"/> <deckType name="Variant Magic - Tiny Leaders" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.TinyLeaders"/>
<deckType name="Variant Magic - Super Standard" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.SuperStandard"/>
<deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.InnistradBlock"/> <deckType name="Block Constructed - Innistrad" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.InnistradBlock"/>
<deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KamigawaBlock"/> <deckType name="Block Constructed - Kamigawa" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KamigawaBlock"/>
<deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KhansOfTarkirBlock"/> <deckType name="Block Constructed - Khans of Tarkir" jar="mage-deck-constructed-${project.version}.jar" className="mage.deck.KhansOfTarkirBlock"/>

View file

@ -41,6 +41,7 @@ import mage.abilities.Ability;
import mage.abilities.ActivatedAbility; import mage.abilities.ActivatedAbility;
import mage.abilities.DelayedTriggeredAbilities; import mage.abilities.DelayedTriggeredAbilities;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.MageSingleton;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.SpecialActions; import mage.abilities.SpecialActions;
import mage.abilities.StaticAbility; import mage.abilities.StaticAbility;
@ -856,13 +857,19 @@ public class GameState implements Serializable, Copyable<GameState> {
* @param ability * @param ability
*/ */
public void addOtherAbility(Card attachedTo, Ability ability) { public void addOtherAbility(Card attachedTo, Ability ability) {
ability.setSourceId(attachedTo.getId()); Ability newAbility;
ability.setControllerId(attachedTo.getOwnerId()); if (ability instanceof MageSingleton) {
newAbility = ability;
} else {
newAbility = ability.copy();
}
newAbility.setSourceId(attachedTo.getId());
newAbility.setControllerId(attachedTo.getOwnerId());
if (!cardState.containsKey(attachedTo.getId())) { if (!cardState.containsKey(attachedTo.getId())) {
cardState.put(attachedTo.getId(), new CardState()); cardState.put(attachedTo.getId(), new CardState());
} }
cardState.get(attachedTo.getId()).addAbility(ability); cardState.get(attachedTo.getId()).addAbility(newAbility);
addAbility(ability, attachedTo.getId(), attachedTo); addAbility(newAbility, attachedTo.getId(), attachedTo);
} }
/** /**